From 06f5adf5baba61b96d159c1b9df7f01b28158c99 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Tue, 5 Mar 2024 17:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E7=AE=A1=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E6=9F=A5=E8=AF=A2=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6=E4=B8=8A=E6=8A=A5=E6=80=BB?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E6=8E=A5=E5=8F=A3=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEmployeesController.java | 4 +- .../controller/DcVehiclesController.java | 104 +++++++++++++++++ .../com/zc/business/domain/DcEmployees.java | 10 ++ .../com/zc/business/domain/DcRoadSection.java | 4 +- .../com/zc/business/domain/DcVehicles.java | 108 ++++++++++++++++++ .../zc/business/mapper/DcEmployeesMapper.java | 2 +- .../business/service/IDcEmployeesService.java | 2 +- .../business/service/IDcVehiclesService.java | 61 ++++++++++ .../service/impl/DcEmployeesServiceImpl.java | 4 +- .../service/impl/DcVehiclesServiceImpl.java | 96 ++++++++++++++++ .../mapper/business/DcEmployeesMapper.xml | 5 +- .../DcPerceivedEventsWarningMapper.xml | 3 +- .../mapper/business/DcVehiclesMapper.xml | 90 +++++++++++++++ 13 files changed, 483 insertions(+), 10 deletions(-) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcVehiclesController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcVehicles.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcVehiclesService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcVehiclesServiceImpl.java create mode 100644 zc-business/src/main/resources/mapper/business/DcVehiclesMapper.xml diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java index 92ac39f9..926da68a 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java @@ -119,8 +119,8 @@ public class DcEmployeesController extends BaseController //查询全部机构id与名称信息 @ApiOperation(value = "查询全部机构id与名称信息") @PostMapping("/organization") - public AjaxResult selectOrganizationAll(){ - return AjaxResult.success(dcEmployeesService.selectOrganizationAll()); + public AjaxResult selectOrganizationAll(@RequestBody DcEmployees dcEmployees ){ + return AjaxResult.success(dcEmployeesService.selectOrganizationAll(dcEmployees)); } //查询全部岗位id与名称信息 @ApiOperation(value = "查询全部岗位id与名称信息") diff --git a/zc-business/src/main/java/com/zc/business/controller/DcVehiclesController.java b/zc-business/src/main/java/com/zc/business/controller/DcVehiclesController.java new file mode 100644 index 00000000..25b98120 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcVehiclesController.java @@ -0,0 +1,104 @@ +package com.zc.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcVehicles; +import com.zc.business.service.IDcVehiclesService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 车辆信息Controller + * + * @author ruoyi + * @date 2024-03-05 + */ +@RestController +@RequestMapping("/business/vehicles") +public class DcVehiclesController extends BaseController +{ + @Autowired + private IDcVehiclesService dcVehiclesService; + + /** + * 查询车辆信息列表 + */ + @PreAuthorize("@ss.hasPermi('business:vehicles:list')") + @GetMapping("/list") + public TableDataInfo list(DcVehicles dcVehicles) + { + startPage(); + List list = dcVehiclesService.selectDcVehiclesList(dcVehicles); + return getDataTable(list); + } + + /** + * 导出车辆信息列表 + */ + @PreAuthorize("@ss.hasPermi('business:vehicles:export')") + @Log(title = "车辆信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcVehicles dcVehicles) + { + List list = dcVehiclesService.selectDcVehiclesList(dcVehicles); + ExcelUtil util = new ExcelUtil<>(DcVehicles.class); + util.exportExcel(response, list, "车辆信息数据"); + } + + /** + * 获取车辆信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('business:vehicles:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(dcVehiclesService.selectDcVehiclesById(id)); + } + + /** + * 新增车辆信息 + */ + @PreAuthorize("@ss.hasPermi('business:vehicles:add')") + @Log(title = "车辆信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcVehicles dcVehicles) + { + return toAjax(dcVehiclesService.insertDcVehicles(dcVehicles)); + } + + /** + * 修改车辆信息 + */ + @PreAuthorize("@ss.hasPermi('business:vehicles:edit')") + @Log(title = "车辆信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcVehicles dcVehicles) + { + return toAjax(dcVehiclesService.updateDcVehicles(dcVehicles)); + } + + /** + * 删除车辆信息 + */ + @PreAuthorize("@ss.hasPermi('business:vehicles:remove')") + @Log(title = "车辆信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcVehiclesService.deleteDcVehiclesByIds(ids)); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEmployees.java b/zc-business/src/main/java/com/zc/business/domain/DcEmployees.java index ef4360e8..a5fe4c71 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEmployees.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEmployees.java @@ -48,6 +48,16 @@ public class DcEmployees extends BaseEntity @Excel(name = "机构") private String organizationName; + private Long parentId; + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + public String getOrganizationName() { return organizationName; } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java b/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java index a2990fa3..2761dfc5 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java @@ -50,8 +50,8 @@ public class DcRoadSection extends BaseEntity private String roadCode; /** 里程 */ - @ApiModelProperty("里程") - @Excel(name = "里程") + @ApiModelProperty("里程(km)") + @Excel(name = "里程(km)") private String mileage; /** 部门名称 */ @ApiModelProperty("部门名称") diff --git a/zc-business/src/main/java/com/zc/business/domain/DcVehicles.java b/zc-business/src/main/java/com/zc/business/domain/DcVehicles.java new file mode 100644 index 00000000..db198893 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcVehicles.java @@ -0,0 +1,108 @@ +package com.zc.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 车辆信息对象 dc_vehicles + * + * @author ruoyi + * @date 2024-03-05 + */ +public class DcVehicles extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 机构id */ + + private Long organizationId; + + /** 车牌号 */ + @Excel(name = "车牌号") + private String vehiclePlate; + + /** 车辆类型 */ + @Excel(name = "车辆类型") + private Integer vehicleType; + + /** 1-可用2-使用中 */ + @Excel(name = "状态",readConverterExp = "1=可用,2=使用中") + private Integer vehicleStatus; + + /** 机构 */ + @Excel(name = "机构") + private String organizationName; + + public void setId(Long id) + { + this.id = id; + } + + public String getOrganizationName() { + return organizationName; + } + + public void setOrganizationName(String organizationName) { + this.organizationName = organizationName; + } + + public Long getId() + { + return id; + } + public void setOrganizationId(Long organizationId) + { + this.organizationId = organizationId; + } + + public Long getOrganizationId() + { + return organizationId; + } + public void setVehiclePlate(String vehiclePlate) + { + this.vehiclePlate = vehiclePlate; + } + + public String getVehiclePlate() + { + return vehiclePlate; + } + public void setVehicleType(Integer vehicleType) + { + this.vehicleType = vehicleType; + } + + public Integer getVehicleType() + { + return vehicleType; + } + public void setVehicleStatus(Integer vehicleStatus) + { + this.vehicleStatus = vehicleStatus; + } + + public Integer getVehicleStatus() + { + return vehicleStatus; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("organizationId", getOrganizationId()) + .append("vehiclePlate", getVehiclePlate()) + .append("vehicleType", getVehicleType()) + .append("vehicleStatus", getVehicleStatus()) + .append("remark", getRemark()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java index 602f1982..e95273bd 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java @@ -65,7 +65,7 @@ public interface DcEmployeesMapper int deleteDcEmployeesByIds(Long[] ids); //获取全部机构id与名称 - public List> selectOrganizationAll(); + public List> selectOrganizationAll(DcEmployees dcEmployees); //获取全部岗位信息 public List> selectSysPostAll(); //获取用户信息,按照岗位分组 diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEmployeesService.java b/zc-business/src/main/java/com/zc/business/service/IDcEmployeesService.java index f76ec7b4..2b0e6fc5 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEmployeesService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEmployeesService.java @@ -62,7 +62,7 @@ public interface IDcEmployeesService */ int deleteDcEmployeesById(Long id); //获取全部机构id与名称 - public List> selectOrganizationAll(); + public List> selectOrganizationAll( DcEmployees dcEmployees); //获取全部岗位信息 public List> selectSysPostAll(); //获取用户信息,按照岗位分组 diff --git a/zc-business/src/main/java/com/zc/business/service/IDcVehiclesService.java b/zc-business/src/main/java/com/zc/business/service/IDcVehiclesService.java new file mode 100644 index 00000000..98ee5136 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcVehiclesService.java @@ -0,0 +1,61 @@ +package com.zc.business.service; + +import java.util.List; +import com.zc.business.domain.DcVehicles; + +/** + * 车辆信息Service接口 + * + * @author ruoyi + * @date 2024-03-05 + */ +public interface IDcVehiclesService +{ + /** + * 查询车辆信息 + * + * @param id 车辆信息主键 + * @return 车辆信息 + */ + public DcVehicles selectDcVehiclesById(Long id); + + /** + * 查询车辆信息列表 + * + * @param dcVehicles 车辆信息 + * @return 车辆信息集合 + */ + List selectDcVehiclesList(DcVehicles dcVehicles); + + /** + * 新增车辆信息 + * + * @param dcVehicles 车辆信息 + * @return 结果 + */ + int insertDcVehicles(DcVehicles dcVehicles); + + /** + * 修改车辆信息 + * + * @param dcVehicles 车辆信息 + * @return 结果 + */ + int updateDcVehicles(DcVehicles dcVehicles); + + /** + * 批量删除车辆信息 + * + * @param ids 需要删除的车辆信息主键集合 + * @return 结果 + */ + int deleteDcVehiclesByIds(Long[] ids); + + /** + * 删除车辆信息信息 + * + * @param id 车辆信息主键 + * @return 结果 + */ + int deleteDcVehiclesById(Long id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java index d74bd76b..baac635d 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java @@ -96,8 +96,8 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService { //获取全部机构id与名称 @Override - public List> selectOrganizationAll() { - return dcEmployeesMapper.selectOrganizationAll(); + public List> selectOrganizationAll(DcEmployees dcEmployees) { + return dcEmployeesMapper.selectOrganizationAll(dcEmployees); } //获取全部岗位信息 diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcVehiclesServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcVehiclesServiceImpl.java new file mode 100644 index 00000000..57a43b53 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcVehiclesServiceImpl.java @@ -0,0 +1,96 @@ +package com.zc.business.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zc.business.mapper.DcVehiclesMapper; +import com.zc.business.domain.DcVehicles; +import com.zc.business.service.IDcVehiclesService; + +/** + * 车辆信息Service业务层处理 + * + * @author ruoyi + * @date 2024-03-05 + */ +@Service +public class DcVehiclesServiceImpl implements IDcVehiclesService +{ + @Autowired + private DcVehiclesMapper dcVehiclesMapper; + + /** + * 查询车辆信息 + * + * @param id 车辆信息主键 + * @return 车辆信息 + */ + @Override + public DcVehicles selectDcVehiclesById(Long id) + { + return dcVehiclesMapper.selectDcVehiclesById(id); + } + + /** + * 查询车辆信息列表 + * + * @param dcVehicles 车辆信息 + * @return 车辆信息 + */ + @Override + public List selectDcVehiclesList(DcVehicles dcVehicles) + { + return dcVehiclesMapper.selectDcVehiclesList(dcVehicles); + } + + /** + * 新增车辆信息 + * + * @param dcVehicles 车辆信息 + * @return 结果 + */ + @Override + public int insertDcVehicles(DcVehicles dcVehicles) + { + dcVehicles.setCreateTime(DateUtils.getNowDate()); + return dcVehiclesMapper.insertDcVehicles(dcVehicles); + } + + /** + * 修改车辆信息 + * + * @param dcVehicles 车辆信息 + * @return 结果 + */ + @Override + public int updateDcVehicles(DcVehicles dcVehicles) + { + dcVehicles.setUpdateTime(DateUtils.getNowDate()); + return dcVehiclesMapper.updateDcVehicles(dcVehicles); + } + + /** + * 批量删除车辆信息 + * + * @param ids 需要删除的车辆信息主键 + * @return 结果 + */ + @Override + public int deleteDcVehiclesByIds(Long[] ids) + { + return dcVehiclesMapper.deleteDcVehiclesByIds(ids); + } + + /** + * 删除车辆信息信息 + * + * @param id 车辆信息主键 + * @return 结果 + */ + @Override + public int deleteDcVehiclesById(Long id) + { + return dcVehiclesMapper.deleteDcVehiclesById(id); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml b/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml index 9abd868d..67cb8995 100644 --- a/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml @@ -94,7 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select count(1) from dc_warning + select count(1) from dc_warning where warning_state=1 + + + and organization_id = #{organizationId} + and vehicle_plate = #{vehiclePlate} + and vehicle_type = #{vehicleType} + and vehicle_status = #{vehicleStatus} + + + + + + + insert into dc_vehicles + + id, + organization_id, + vehicle_plate, + vehicle_type, + vehicle_status, + remark, + create_time, + update_time, + + + #{id}, + #{organizationId}, + #{vehiclePlate}, + #{vehicleType}, + #{vehicleStatus}, + #{remark}, + #{createTime}, + #{updateTime}, + + + + + update dc_vehicles + + organization_id = #{organizationId}, + vehicle_plate = #{vehiclePlate}, + vehicle_type = #{vehicleType}, + vehicle_status = #{vehicleStatus}, + remark = #{remark}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from dc_vehicles where id = #{id} + + + + delete from dc_vehicles where id in + + #{id} + + + \ No newline at end of file