Browse Source

车辆管理,机构查询处理,感知事件上报总数量接口处理

develop
wangsixiang 9 months ago
parent
commit
06f5adf5ba
  1. 4
      zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java
  2. 104
      zc-business/src/main/java/com/zc/business/controller/DcVehiclesController.java
  3. 10
      zc-business/src/main/java/com/zc/business/domain/DcEmployees.java
  4. 4
      zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java
  5. 108
      zc-business/src/main/java/com/zc/business/domain/DcVehicles.java
  6. 2
      zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java
  7. 2
      zc-business/src/main/java/com/zc/business/service/IDcEmployeesService.java
  8. 61
      zc-business/src/main/java/com/zc/business/service/IDcVehiclesService.java
  9. 4
      zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java
  10. 96
      zc-business/src/main/java/com/zc/business/service/impl/DcVehiclesServiceImpl.java
  11. 5
      zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml
  12. 3
      zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml
  13. 90
      zc-business/src/main/resources/mapper/business/DcVehiclesMapper.xml

4
zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java

@ -119,8 +119,8 @@ public class DcEmployeesController extends BaseController
//查询全部机构id与名称信息 //查询全部机构id与名称信息
@ApiOperation(value = "查询全部机构id与名称信息") @ApiOperation(value = "查询全部机构id与名称信息")
@PostMapping("/organization") @PostMapping("/organization")
public AjaxResult selectOrganizationAll(){ public AjaxResult selectOrganizationAll(@RequestBody DcEmployees dcEmployees ){
return AjaxResult.success(dcEmployeesService.selectOrganizationAll()); return AjaxResult.success(dcEmployeesService.selectOrganizationAll(dcEmployees));
} }
//查询全部岗位id与名称信息 //查询全部岗位id与名称信息
@ApiOperation(value = "查询全部岗位id与名称信息") @ApiOperation(value = "查询全部岗位id与名称信息")

104
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<DcVehicles> 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<DcVehicles> list = dcVehiclesService.selectDcVehiclesList(dcVehicles);
ExcelUtil<DcVehicles> 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));
}
}

10
zc-business/src/main/java/com/zc/business/domain/DcEmployees.java

@ -48,6 +48,16 @@ public class DcEmployees extends BaseEntity
@Excel(name = "机构") @Excel(name = "机构")
private String organizationName; private String organizationName;
private Long parentId;
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getOrganizationName() { public String getOrganizationName() {
return organizationName; return organizationName;
} }

4
zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java

@ -50,8 +50,8 @@ public class DcRoadSection extends BaseEntity
private String roadCode; private String roadCode;
/** 里程 */ /** 里程 */
@ApiModelProperty("里程") @ApiModelProperty("里程(km)")
@Excel(name = "里程") @Excel(name = "里程(km)")
private String mileage; private String mileage;
/** 部门名称 */ /** 部门名称 */
@ApiModelProperty("部门名称") @ApiModelProperty("部门名称")

108
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();
}
}

2
zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java

@ -65,7 +65,7 @@ public interface DcEmployeesMapper
int deleteDcEmployeesByIds(Long[] ids); int deleteDcEmployeesByIds(Long[] ids);
//获取全部机构id与名称 //获取全部机构id与名称
public List<HashMap<String,Object>> selectOrganizationAll(); public List<HashMap<String,Object>> selectOrganizationAll(DcEmployees dcEmployees);
//获取全部岗位信息 //获取全部岗位信息
public List<HashMap<String,Object>> selectSysPostAll(); public List<HashMap<String,Object>> selectSysPostAll();
//获取用户信息,按照岗位分组 //获取用户信息,按照岗位分组

2
zc-business/src/main/java/com/zc/business/service/IDcEmployeesService.java

@ -62,7 +62,7 @@ public interface IDcEmployeesService
*/ */
int deleteDcEmployeesById(Long id); int deleteDcEmployeesById(Long id);
//获取全部机构id与名称 //获取全部机构id与名称
public List<HashMap<String,Object>> selectOrganizationAll(); public List<HashMap<String,Object>> selectOrganizationAll( DcEmployees dcEmployees);
//获取全部岗位信息 //获取全部岗位信息
public List<HashMap<String,Object>> selectSysPostAll(); public List<HashMap<String,Object>> selectSysPostAll();
//获取用户信息,按照岗位分组 //获取用户信息,按照岗位分组

61
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<DcVehicles> 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);
}

4
zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java

@ -96,8 +96,8 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService {
//获取全部机构id与名称 //获取全部机构id与名称
@Override @Override
public List<HashMap<String, Object>> selectOrganizationAll() { public List<HashMap<String, Object>> selectOrganizationAll(DcEmployees dcEmployees) {
return dcEmployeesMapper.selectOrganizationAll(); return dcEmployeesMapper.selectOrganizationAll(dcEmployees);
} }
//获取全部岗位信息 //获取全部岗位信息

96
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<DcVehicles> 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);
}
}

5
zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml

@ -94,7 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<select id="selectOrganizationAll" resultType="java.util.HashMap"> <select id="selectOrganizationAll" resultType="java.util.HashMap">
select id,parent_id parentId,organization_name organizationName,organization_type organizationType select id,parent_id parentId,organization_name organizationName,organization_type organizationType
from dc_organization where parent_id!=0 from dc_organization
<where>
<if test="parentId != null"> and parent_id != #{parentId}</if>
</where>
</select> </select>
<select id="selectSysPostAll" resultType="java.util.HashMap"> <select id="selectSysPostAll" resultType="java.util.HashMap">
select post_id postId,post_name postName from sys_post select post_id postId,post_name postName from sys_post

3
zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

@ -7,7 +7,7 @@
<select id="perceivedEventsWarningNum" resultType="java.lang.Integer"> <select id="perceivedEventsWarningNum" resultType="java.lang.Integer">
select count(1) from dc_warning select count(1) from dc_warning where warning_state=1
</select> </select>
<select id="selectEventTypeList" resultType="com.zc.business.domain.DcEventType"> <select id="selectEventTypeList" resultType="com.zc.business.domain.DcEventType">
@ -37,6 +37,7 @@
warning.`other_config` FROM dc_warning AS warning warning.`other_config` FROM dc_warning AS warning
left JOIN dc_stake_mark AS mark ON mark.stake_mark=warning.stake_mark and mark.direction=warning.direction left JOIN dc_stake_mark AS mark ON mark.stake_mark=warning.stake_mark and mark.direction=warning.direction
<where> <where>
<if test="warningState != null and warningState != ''"> and warning.warning_state = #{warningState}</if>
<if test="warningType != null and warningType != ''"> and warning.warning_type = #{warningType}</if> <if test="warningType != null and warningType != ''"> and warning.warning_type = #{warningType}</if>
<if test="warningSubclass != null and warningSubclass != ''"> and warning.warning_subclass = #{warningSubclass}</if> <if test="warningSubclass != null and warningSubclass != ''"> and warning.warning_subclass = #{warningSubclass}</if>
<if test="warningSource != null and warningSource != ''"> and warning.warning_source = #{warningSource}</if> <if test="warningSource != null and warningSource != ''"> and warning.warning_source = #{warningSource}</if>

90
zc-business/src/main/resources/mapper/business/DcVehiclesMapper.xml

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcVehiclesMapper">
<resultMap type="DcVehicles" id="DcVehiclesResult">
<result property="id" column="id" />
<result property="organizationId" column="organization_id" />
<result property="vehiclePlate" column="vehicle_plate" />
<result property="vehicleType" column="vehicle_type" />
<result property="vehicleStatus" column="vehicle_status" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="organizationName" column="organization_name" />
</resultMap>
<sql id="selectDcVehiclesVo">
select v.id, v.organization_id, v.vehicle_plate,
organization.organization_name,
v.vehicle_type, v.vehicle_status,
v.remark, v.create_time, v.update_time from dc_vehicles as v
left join dc_organization as organization on organization.id=v.organization_id
</sql>
<select id="selectDcVehiclesList" parameterType="DcVehicles" resultMap="DcVehiclesResult">
<include refid="selectDcVehiclesVo"/>
<where>
<if test="organizationId != null "> and organization_id = #{organizationId}</if>
<if test="vehiclePlate != null and vehiclePlate != ''"> and vehicle_plate = #{vehiclePlate}</if>
<if test="vehicleType != null "> and vehicle_type = #{vehicleType}</if>
<if test="vehicleStatus != null "> and vehicle_status = #{vehicleStatus}</if>
</where>
</select>
<select id="selectDcVehiclesById" parameterType="Long" resultMap="DcVehiclesResult">
<include refid="selectDcVehiclesVo"/>
where id = #{id}
</select>
<insert id="insertDcVehicles" parameterType="DcVehicles">
insert into dc_vehicles
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="organizationId != null">organization_id,</if>
<if test="vehiclePlate != null and vehiclePlate != ''">vehicle_plate,</if>
<if test="vehicleType != null">vehicle_type,</if>
<if test="vehicleStatus != null">vehicle_status,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="organizationId != null">#{organizationId},</if>
<if test="vehiclePlate != null and vehiclePlate != ''">#{vehiclePlate},</if>
<if test="vehicleType != null">#{vehicleType},</if>
<if test="vehicleStatus != null">#{vehicleStatus},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDcVehicles" parameterType="DcVehicles">
update dc_vehicles
<trim prefix="SET" suffixOverrides=",">
<if test="organizationId != null">organization_id = #{organizationId},</if>
<if test="vehiclePlate != null and vehiclePlate != ''">vehicle_plate = #{vehiclePlate},</if>
<if test="vehicleType != null">vehicle_type = #{vehicleType},</if>
<if test="vehicleStatus != null">vehicle_status = #{vehicleStatus},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcVehiclesById" parameterType="Long">
delete from dc_vehicles where id = #{id}
</delete>
<delete id="deleteDcVehiclesByIds" parameterType="String">
delete from dc_vehicles where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save