Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/xiepufeng/jihe-dc into develop

develop
xiepufeng 11 months ago
parent
commit
05e39ccad9
  1. 14
      zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java
  2. 10
      zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java
  3. 126
      zc-business/src/main/java/com/zc/business/controller/DcEventController.java
  4. 120
      zc-business/src/main/java/com/zc/business/controller/DcEventHistoryController.java
  5. 4
      zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java
  6. 2
      zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java
  7. 132
      zc-business/src/main/java/com/zc/business/domain/DcEvent.java
  8. 311
      zc-business/src/main/java/com/zc/business/domain/DcEventHistory.java
  9. 68
      zc-business/src/main/java/com/zc/business/domain/DcEventMap.java
  10. 63
      zc-business/src/main/java/com/zc/business/mapper/DcEventHistoryMapper.java
  11. 64
      zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java
  12. 63
      zc-business/src/main/java/com/zc/business/service/IDcEventHistoryService.java
  13. 64
      zc-business/src/main/java/com/zc/business/service/IDcEventService.java
  14. 96
      zc-business/src/main/java/com/zc/business/service/impl/DcEventHistoryServiceImpl.java
  15. 186
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  16. 36
      zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java
  17. BIN
      zc-business/src/main/resources/excelTemplate/值班示例模板.xlsx
  18. 155
      zc-business/src/main/resources/mapper/business/DcEventHistoryMapper.xml
  19. 294
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

14
zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java

@ -2,6 +2,10 @@ package com.zc.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -27,6 +31,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @author ruoyi
* @date 2024-01-05
*/
@Api(tags = {"情报板发布日志"})
@RestController
@RequestMapping("/business/boardReleaseLog")
public class DcBoardReleaseLogController extends BaseController
@ -37,6 +42,7 @@ public class DcBoardReleaseLogController extends BaseController
/**
* 查询情报板内容发布日志列表
*/
@ApiOperation("查询情报板内容发布日志列表")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:list')")
@GetMapping("/list")
public TableDataInfo list(DcBoardReleaseLog dcBoardReleaseLog)
@ -49,6 +55,7 @@ public class DcBoardReleaseLogController extends BaseController
/**
* 导出情报板内容发布日志列表
*/
@ApiOperation("导出情报板内容发布日志列表")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:export')")
@Log(title = "情报板内容发布日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ -62,9 +69,10 @@ public class DcBoardReleaseLogController extends BaseController
/**
* 获取情报板内容发布日志详细信息
*/
@ApiOperation("获取情报板内容发布日志详细信息")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
public AjaxResult getInfo(@ApiParam(value = "id", name = "id",required = true) @PathVariable("id") Long id)
{
return AjaxResult.success(dcBoardReleaseLogService.selectDcBoardReleaseLogById(id));
}
@ -72,6 +80,7 @@ public class DcBoardReleaseLogController extends BaseController
/**
* 新增情报板内容发布日志
*/
@ApiOperation("新增情报板内容发布日志")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:add')")
@Log(title = "情报板内容发布日志", businessType = BusinessType.INSERT)
@PostMapping
@ -94,10 +103,11 @@ public class DcBoardReleaseLogController extends BaseController
/**
* 删除情报板内容发布日志
*/
@ApiOperation("删除情报板内容发布日志")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:remove')")
@Log(title = "情报板内容发布日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
public AjaxResult remove(@ApiParam(value = "id", name = "id",required = true) @PathVariable Long[] ids)
{
return toAjax(dcBoardReleaseLogService.deleteDcBoardReleaseLogByIds(ids));
}

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

@ -32,7 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/
@RestController
@RequestMapping("/business/employees")
@Api(tags = {"人员信息(应急人员与值班人员)"})
public class DcEmployeesController extends BaseController
{
@Autowired
@ -41,7 +41,7 @@ public class DcEmployeesController extends BaseController
/**
* 查询值班人员信息列表
*/
@ApiOperation("获取人员信息列表")
//@ApiOperation("获取人员信息列表")
@PreAuthorize("@ss.hasPermi('business:employees:list')")
@GetMapping("/list")
public TableDataInfo list(DcEmployees dcEmployees)
@ -77,7 +77,7 @@ public class DcEmployeesController extends BaseController
/**
* 新增值班人员信息
*/
@ApiOperation(value = "新增人员信息", notes = "新增人员信息")
//@ApiOperation(value = "新增人员信息", notes = "新增人员信息")
@PreAuthorize("@ss.hasPermi('business:employees:add')")
@Log(title = "值班人员信息", businessType = BusinessType.INSERT)
@PostMapping
@ -89,7 +89,7 @@ public class DcEmployeesController extends BaseController
/**
* 修改值班人员信息
*/
@ApiOperation(value = "修改人员信息", notes = "修改人员信息")
//@ApiOperation(value = "修改人员信息", notes = "修改人员信息")
@PreAuthorize("@ss.hasPermi('business:employees:edit')")
@Log(title = "值班人员信息", businessType = BusinessType.UPDATE)
@PutMapping
@ -111,7 +111,7 @@ public class DcEmployeesController extends BaseController
}
//查询全部机构id与名称信息
@ApiOperation(value = "查询全部机构id与名称信息", notes = "查询全部机构id与名称信息")
//@ApiOperation(value = "查询全部机构id与名称信息", notes = "查询全部机构id与名称信息")
@PostMapping("/organization")
public AjaxResult selectOrganizationAll(){
return AjaxResult.success(dcEmployeesService.selectOrganizationAll());

126
zc-business/src/main/java/com/zc/business/controller/DcEventController.java

@ -0,0 +1,126 @@
package com.zc.business.controller;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.zc.business.domain.DcEvent;
import com.zc.business.service.IDcEventService;
import io.swagger.annotations.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 事件信息Controller
*
* @author ruoyi
* @date 2024-01-03
*/
@Api(tags = "事件信息")
@RestController
@RequestMapping("/system/event")
public class DcEventController extends BaseController
{
@Autowired
private IDcEventService dcEventService;
/**
* 查询事件信息列表
*/
@ApiOperation("查询事件信息列表")
@PreAuthorize("@ss.hasPermi('system:event:list')")
@GetMapping("/list")
public TableDataInfo list(DcEvent dcEvent)
{
startPage();
List<DcEvent> list = dcEventService.selectDcEventList(dcEvent);
return getDataTable(list);
}
/**
* 导出事件信息列表
*/
@ApiOperation("导出事件信息列表")
//@PreAuthorize("@ss.hasPermi('system:event:export')")
@Log(title = "事件信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcEvent dcEvent)
{
List<DcEvent> list = dcEventService.selectDcEventList(dcEvent);
ExcelUtil<DcEvent> util = new ExcelUtil<DcEvent>(DcEvent.class);
util.exportExcel(response, list, "事件信息数据");
}
/**
* 获取事件信息详细信息
*/
@ApiOperation("获取事件信息详细信息")
@PreAuthorize("@ss.hasPermi('system:event:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
DcEvent dcEvent = dcEventService.selectDcEventById(id);
return AjaxResult.success(dcEvent);
}
/**
* 新增事件信息
*/
@ApiOperation("新增事件信息")
@PreAuthorize("@ss.hasPermi('system:event:add')")
@Log(title = "事件信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcEvent dcEvent)
{
return toAjax(dcEventService.insertDcEvent(dcEvent));
}
/**
* 修改事件信息
*/
@ApiOperation("修改事件信息")
@PreAuthorize("@ss.hasPermi('system:event:edit')")
@Log(title = "事件信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcEvent dcEvent)
{
return toAjax(dcEventService.updateDcEvent(dcEvent));
}
/**
* 删除事件信息
*/
@ApiOperation("删除事件信息")
@PreAuthorize("@ss.hasPermi('system:event:remove')")
@Log(title = "事件信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(dcEventService.deleteDcEventByIds(ids));
}
}

120
zc-business/src/main/java/com/zc/business/controller/DcEventHistoryController.java

@ -0,0 +1,120 @@
package com.zc.business.controller;
import javax.servlet.http.HttpServletResponse;
import com.zc.business.domain.DcEventHistory;
import com.zc.business.service.IDcEventHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import java.util.List;
/**
* 事件历史信息Controller
*
* @author ruoyi
* @date 2024-01-05
*/
@Api(tags ="事件历史信息")
@RestController
@RequestMapping("/system/history")
public class DcEventHistoryController extends BaseController
{
@Autowired
private IDcEventHistoryService dcEventHistoryService;
/**
* 查询事件历史信息列表
*/
@ApiOperation("查询事件历史信息列表")
@PreAuthorize("@ss.hasPermi('system:history:list')")
@GetMapping("/list")
public TableDataInfo list(DcEventHistory dcEventHistory)
{
startPage();
List<DcEventHistory> list = dcEventHistoryService.selectDcEventHistoryList(dcEventHistory);
return getDataTable(list);
}
/**
* 导出事件历史信息列表
*/
@ApiOperation("导出事件历史信息列表")
@PreAuthorize("@ss.hasPermi('system:history:export')")
@Log(title = "事件历史信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcEventHistory dcEventHistory)
{
List<DcEventHistory> list = dcEventHistoryService.selectDcEventHistoryList(dcEventHistory);
ExcelUtil<DcEventHistory> util = new ExcelUtil<>(DcEventHistory.class);
util.exportExcel(response, list, "事件历史信息数据");
}
/**
* 获取事件历史信息详细信息
*/
@ApiOperation("获取事件历史信息详细信息")
@PreAuthorize("@ss.hasPermi('system:history:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return AjaxResult.success(dcEventHistoryService.selectDcEventHistoryById(id));
}
/**
* 新增事件历史信息
*/
@ApiOperation("新增事件历史信息")
@PreAuthorize("@ss.hasPermi('system:history:add')")
@Log(title = "事件历史信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcEventHistory dcEventHistory)
{
return toAjax(dcEventHistoryService.insertDcEventHistory(dcEventHistory));
}
/**
* 修改事件历史信息
*/
@ApiOperation("修改事件历史信息")
@PreAuthorize("@ss.hasPermi('system:history:edit')")
@Log(title = "事件历史信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcEventHistory dcEventHistory)
{
return toAjax(dcEventHistoryService.updateDcEventHistory(dcEventHistory));
}
/**
* 删除事件历史信息
*/
@ApiOperation("删除事件历史信息")
@PreAuthorize("@ss.hasPermi('system:history:remove')")
@Log(title = "事件历史信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(dcEventHistoryService.deleteDcEventHistoryByIds(ids));
}
}

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

@ -29,8 +29,8 @@ public class DcInfoBoardTemplateController extends BaseController
@ApiOperation("获取情报板模板")
@GetMapping("/getAllVmsTemplate")
public AjaxResult getAllVmsTemplate(@ApiParam(value="情报板分组", name="category", required=true) String category,
@ApiParam(value="分辨率", name="devicePixel", required=true) String devicePixel) {
public AjaxResult getAllVmsTemplate(@ApiParam(value="情报板分组", name="category") String category,
@ApiParam(value="分辨率", name="devicePixel") String devicePixel) {
return AjaxResult.success(dcInfoBoardTemplateService.getAllVmsTemplate(category, devicePixel));
}

2
zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java

@ -31,7 +31,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @author ruoyi
* @date 2024-01-04
*/
@Api(value = "信息发布记录")
@Api(value = "信息发布记录",tags = {"信息发布记录"})
@RestController
@RequestMapping("/business/dcPublishInfo")
public class DcPublishInfoController extends BaseController

132
zc-business/src/main/java/com/zc/business/domain/DcEvent.java

@ -0,0 +1,132 @@
package com.zc.business.domain;
import java.util.Date;
import java.util.Map;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
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;
import javax.validation.constraints.NotBlank;
/**
* 事件信息对象 dc_event
*
* @author ruoyi
* @date 2024-01-03
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("事件信息")
public class DcEvent extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ApiModelProperty("事件编号")
/** 事件编号 */
private String id;
/** 所属机构 */
@ApiModelProperty("所属机构")
private Long groupId;
/** 所在桩号*/
@ApiModelProperty("所在桩号")
private String stakeMarkId;
/** 结束桩号*/
@ApiModelProperty("结束桩号")
private String endStakeMarkId;
/** 处置时长*/
@ApiModelProperty("处置时长")
private Long handlingTime;
@ApiModelProperty("开始时间")
/** 开始时间*/
private Date startTime;
@ApiModelProperty("结束时间")
/** 结束时间 */
private Date endTime;
@ApiModelProperty("事件等级")
/** 事件等级*/
private Long eventLevel;
/** 事件类型 */
private Long eventType;
/** 1-交通事故2-车辆故障3-路障清除4-交通管制5-道路拥堵6-异常天气7-非法上路8-设备设施隐患9-施工建设10-服务区异常11-其他事件 */
@TableField(exist = false)
@ApiModelProperty("事件类型")
private String eventName;
@ApiModelProperty("影响程度")
/** 影响程度 */
private Long impactLevel;
@ApiModelProperty("事件描述")
/** 事件描述 */
private String description;
@ApiModelProperty("处理人员")
/** 处理人员 */
private Long handlingPerson;
@ApiModelProperty("处理结果")
/** 处理结果 0未解决 1 已解决 2 已关闭 */
private Long handlingResult;
/** 其他配置*/
private String otherConfig;
@TableField(exist = false)
@ApiModelProperty("其他配置 map集合")
private Map<String, Object> eventOtherConfig;
@ApiModelProperty("事件来源")
/** 事件来源 */ /** 1-966592-交警转接3-道路巡音3-视频巡音4-视频AI5-一键救接6-养护通知7-其他 */
private Long eventSource;
@ApiModelProperty("事件性质")
/** 事件性质 1首发事件 2 关联事件 */
private Long eventNature;
@ApiModelProperty("方向")
/** 1-上2-中3-下 */
private String direction;
@ApiModelProperty("事件种类")
/** 1-感知事件2-交通事件 */
private Long eventCategory;
@ApiModelProperty("所属道路")
private Long roadId;
@ApiModelProperty("事件子类")
private Long eventSubclass;
@ApiModelProperty("事件原因")
private String eventCause;
/*
@ApiModelProperty("事件流程对象")
@TableField(exist = false)
private DcProcessConfig dcProcessConfig;
*/
@ApiModelProperty("调度信息详情")
@TableField(exist = false)
private DcEventMap dcEventMap;
}

311
zc-business/src/main/java/com/zc/business/domain/DcEventHistory.java

@ -0,0 +1,311 @@
package com.zc.business.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
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_event_history
*
* @author ruoyi
* @date 2024-01-05
*/
@ApiModel("事件历史信息表")
public class DcEventHistory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private String id;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long groupId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String stakeMarkId;
/** 1-
2-
3- */
@Excel(name = "1-上 2-中 3-下")
private String direction;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long roadId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date startTime;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date endTime;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long eventLevel;
/** 1-感知事件
2-交通事件 */
@Excel(name = "1-感知事件 2-交通事件")
private Long eventCategory;
/** 1-交通事故
2-车辆故障
3-路障清除
4-交通管制
5-道路拥堵
6-异常天气
7-非法上路
8-设备设施隐患
9-施工建设
10-服务区异常
11-其他事件 */
@Excel(name = "1-交通事故 2-车辆故障 3-路障清除 4-交通管制 5-道路拥堵 6-异常天气 7-非法上路 8-设备设施隐患 9-施工建设 10-服务区异常 11-其他事件")
private Long eventType;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long eventSubclass;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String eventCause;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long impactLevel;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String description;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long handlingPerson;
/** 0-未解决
1-已解决
2-已关闭
*/
@Excel(name = "0-未解决 1-已解决 2-已关闭 ")
private Long handlingResult;
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String otherConfig;
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long eventSource;
/** 1-首发事件
2-关联事件 */
@Excel(name = "1-首发事件 2-关联事件")
private Long eventNature;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setGroupId(Long groupId)
{
this.groupId = groupId;
}
public Long getGroupId()
{
return groupId;
}
public void setStakeMarkId(String stakeMarkId)
{
this.stakeMarkId = stakeMarkId;
}
public String getStakeMarkId()
{
return stakeMarkId;
}
public void setDirection(String direction)
{
this.direction = direction;
}
public String getDirection()
{
return direction;
}
public void setRoadId(Long roadId)
{
this.roadId = roadId;
}
public Long getRoadId()
{
return roadId;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setEventLevel(Long eventLevel)
{
this.eventLevel = eventLevel;
}
public Long getEventLevel()
{
return eventLevel;
}
public void setEventCategory(Long eventCategory)
{
this.eventCategory = eventCategory;
}
public Long getEventCategory()
{
return eventCategory;
}
public void setEventType(Long eventType)
{
this.eventType = eventType;
}
public Long getEventType()
{
return eventType;
}
public void setEventSubclass(Long eventSubclass)
{
this.eventSubclass = eventSubclass;
}
public Long getEventSubclass()
{
return eventSubclass;
}
public void setEventCause(String eventCause)
{
this.eventCause = eventCause;
}
public String getEventCause()
{
return eventCause;
}
public void setImpactLevel(Long impactLevel)
{
this.impactLevel = impactLevel;
}
public Long getImpactLevel()
{
return impactLevel;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setHandlingPerson(Long handlingPerson)
{
this.handlingPerson = handlingPerson;
}
public Long getHandlingPerson()
{
return handlingPerson;
}
public void setHandlingResult(Long handlingResult)
{
this.handlingResult = handlingResult;
}
public Long getHandlingResult()
{
return handlingResult;
}
public void setOtherConfig(String otherConfig)
{
this.otherConfig = otherConfig;
}
public String getOtherConfig()
{
return otherConfig;
}
public void setEventSource(Long eventSource)
{
this.eventSource = eventSource;
}
public Long getEventSource()
{
return eventSource;
}
public void setEventNature(Long eventNature)
{
this.eventNature = eventNature;
}
public Long getEventNature()
{
return eventNature;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("groupId", getGroupId())
.append("stakeMarkId", getStakeMarkId())
.append("direction", getDirection())
.append("roadId", getRoadId())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("eventLevel", getEventLevel())
.append("eventCategory", getEventCategory())
.append("eventType", getEventType())
.append("eventSubclass", getEventSubclass())
.append("eventCause", getEventCause())
.append("impactLevel", getImpactLevel())
.append("description", getDescription())
.append("handlingPerson", getHandlingPerson())
.append("handlingResult", getHandlingResult())
.append("otherConfig", getOtherConfig())
.append("eventSource", getEventSource())
.append("eventNature", getEventNature())
.append("remark", getRemark())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

68
zc-business/src/main/java/com/zc/business/domain/DcEventMap.java

@ -0,0 +1,68 @@
package com.zc.business.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DcEventMap {
@ApiModelProperty("流程节点")
private String processNode;
@ApiModelProperty("常用语")
private String commonPhrases;
@ApiModelProperty("节点名称")
private String nodeNode;
@ApiModelProperty("调度信息详情id")
private String dcDispatchId;
@ApiModelProperty("所属机构id")
private String organizationId;
@ApiModelProperty("调度任务名称")
private String dispatchName;
@ApiModelProperty("调度状态")
private String dispatchStatus;
@ApiModelProperty("调度信息详情备注")
private String dcDispatchRemark;
@ApiModelProperty("调度结束时间")
private String dcDispatchEndTime;
@ApiModelProperty("调度开始时间")
private String dcDispatchStartTime;
@ApiModelProperty("调度事件id")
private String eventId;
@ApiModelProperty("机构表主键id")
private String dcOrganizationId;
@ApiModelProperty("机构描述")
private String dcOrganizationDescription;
@ApiModelProperty("机构父id")
private String parentId;
@ApiModelProperty("机构类型")
private String organizationType;
@ApiModelProperty("机构名称")
private String organizationName;
@ApiModelProperty("机构地址")
private String organizationAddress;
@ApiModelProperty("机构所在桩号")
private String dcOrganizationStakeMarkId;
@ApiModelProperty("车牌号")
private String vehiclePlate;
@ApiModelProperty("车辆类型")
private String vehicleType;
@ApiModelProperty("车辆状态")
private String vehicleStatus;
@ApiModelProperty("车辆信息备注")
private String dcVehiclesRemark;
@ApiModelProperty("人员所属岗位id")
private String postId;
@ApiModelProperty("人员姓名")
private String name;
@ApiModelProperty("人员联系电话")
private String contactNumber;
}

63
zc-business/src/main/java/com/zc/business/mapper/DcEventHistoryMapper.java

@ -0,0 +1,63 @@
package com.zc.business.mapper;
import com.zc.business.domain.DcEventHistory;
import java.util.List;
/**
* 事件历史信息Mapper接口
*
* @author ruoyi
* @date 2024-01-05
*/
public interface DcEventHistoryMapper
{
/**
* 查询事件历史信息
*
* @param id 事件历史信息主键
* @return 事件历史信息
*/
public DcEventHistory selectDcEventHistoryById(String id);
/**
* 查询事件历史信息列表
*
* @param dcEventHistory 事件历史信息
* @return 事件历史信息集合
*/
List<DcEventHistory> selectDcEventHistoryList(DcEventHistory dcEventHistory);
/**
* 新增事件历史信息
*
* @param dcEventHistory 事件历史信息
* @return 结果
*/
int insertDcEventHistory(DcEventHistory dcEventHistory);
/**
* 修改事件历史信息
*
* @param dcEventHistory 事件历史信息
* @return 结果
*/
int updateDcEventHistory(DcEventHistory dcEventHistory);
/**
* 删除事件历史信息
*
* @param id 事件历史信息主键
* @return 结果
*/
int deleteDcEventHistoryById(String id);
/**
* 批量删除事件历史信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteDcEventHistoryByIds(String[] ids);
}

64
zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java

@ -0,0 +1,64 @@
package com.zc.business.mapper;
import com.zc.business.domain.DcEvent;
import java.util.List;
/**
* 事件信息Mapper接口
*
* @author ruoyi
* @date 2024-01-03
*/
public interface DcEventMapper
{
/**
* 查询事件信息
*
* @param id 事件信息主键
* @return 事件信息
*/
public DcEvent selectDcEventById(String id);
/**
* 查询事件信息列表
*
* @param dcEvent 事件信息
* @return 事件信息集合
*/
public List<DcEvent> selectDcEventList(DcEvent dcEvent);
/**
* 新增事件信息
*
* @param dcEvent 事件信息
* @return 结果
*/
public int insertDcEvent(DcEvent dcEvent);
/**
* 修改事件信息
*
* @param dcEvent 事件信息
* @return 结果
*/
public int updateDcEvent(DcEvent dcEvent);
/**
* 删除事件信息
*
* @param id 事件信息主键
* @return 结果
*/
public int deleteDcEventById(String id);
/**
* 批量删除事件信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcEventByIds(String[] ids);
}

63
zc-business/src/main/java/com/zc/business/service/IDcEventHistoryService.java

@ -0,0 +1,63 @@
package com.zc.business.service;
import com.zc.business.domain.DcEventHistory;
import java.util.List;
/**
* 事件历史信息Service接口
*
* @author ruoyi
* @date 2024-01-05
*/
public interface IDcEventHistoryService
{
/**
* 查询事件历史信息
*
* @param id 事件历史信息主键
* @return 事件历史信息
*/
public DcEventHistory selectDcEventHistoryById(String id);
/**
* 查询事件历史信息列表
*
* @param dcEventHistory 事件历史信息
* @return 事件历史信息集合
*/
List<DcEventHistory> selectDcEventHistoryList(DcEventHistory dcEventHistory);
/**
* 新增事件历史信息
*
* @param dcEventHistory 事件历史信息
* @return 结果
*/
int insertDcEventHistory(DcEventHistory dcEventHistory);
/**
* 修改事件历史信息
*
* @param dcEventHistory 事件历史信息
* @return 结果
*/
int updateDcEventHistory(DcEventHistory dcEventHistory);
/**
* 批量删除事件历史信息
*
* @param ids 需要删除的事件历史信息主键集合
* @return 结果
*/
int deleteDcEventHistoryByIds(String[] ids);
/**
* 删除事件历史信息信息
*
* @param id 事件历史信息主键
* @return 结果
*/
int deleteDcEventHistoryById(String id);
}

64
zc-business/src/main/java/com/zc/business/service/IDcEventService.java

@ -0,0 +1,64 @@
package com.zc.business.service;
import com.zc.business.domain.DcEvent;
import java.util.List;
/**
* 事件信息Service接口
*
* @author ruoyi
* @date 2024-01-03
*/
public interface IDcEventService
{
/**
* 查询事件信息
*
* @param id 事件信息主键
* @return 事件信息
*/
public DcEvent selectDcEventById(String id);
/**
* 查询事件信息列表
*
* @param dcEvent 事件信息
* @return 事件信息集合
*/
public List<DcEvent> selectDcEventList(DcEvent dcEvent);
/**
* 新增事件信息
*
* @param dcEvent 事件信息
* @return 结果
*/
public int insertDcEvent(DcEvent dcEvent);
/**
* 修改事件信息
*
* @param dcEvent 事件信息
* @return 结果
*/
public int updateDcEvent(DcEvent dcEvent);
/**
* 批量删除事件信息
*
* @param ids 需要删除的事件信息主键集合
* @return 结果
*/
public int deleteDcEventByIds(String[] ids);
/**
* 删除事件信息信息
*
* @param id 事件信息主键
* @return 结果
*/
public int deleteDcEventById(String id);
}

96
zc-business/src/main/java/com/zc/business/service/impl/DcEventHistoryServiceImpl.java

@ -0,0 +1,96 @@
package com.zc.business.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.zc.business.domain.DcEventHistory;
import com.zc.business.mapper.DcEventHistoryMapper;
import com.zc.business.service.IDcEventHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 事件历史信息Service业务层处理
*
* @author ruoyi
* @date 2024-01-05
*/
@Service
public class DcEventHistoryServiceImpl implements IDcEventHistoryService
{
@Autowired
private DcEventHistoryMapper dcEventHistoryMapper;
/**
* 查询事件历史信息
*
* @param id 事件历史信息主键
* @return 事件历史信息
*/
@Override
public DcEventHistory selectDcEventHistoryById(String id)
{
return dcEventHistoryMapper.selectDcEventHistoryById(id);
}
/**
* 查询事件历史信息列表
*
* @param dcEventHistory 事件历史信息
* @return 事件历史信息
*/
@Override
public List<DcEventHistory> selectDcEventHistoryList(DcEventHistory dcEventHistory)
{
return dcEventHistoryMapper.selectDcEventHistoryList(dcEventHistory);
}
/**
* 新增事件历史信息
*
* @param dcEventHistory 事件历史信息
* @return 结果
*/
@Override
public int insertDcEventHistory(DcEventHistory dcEventHistory)
{
dcEventHistory.setCreateTime(DateUtils.getNowDate());
return dcEventHistoryMapper.insertDcEventHistory(dcEventHistory);
}
/**
* 修改事件历史信息
*
* @param dcEventHistory 事件历史信息
* @return 结果
*/
@Override
public int updateDcEventHistory(DcEventHistory dcEventHistory)
{
dcEventHistory.setUpdateTime(DateUtils.getNowDate());
return dcEventHistoryMapper.updateDcEventHistory(dcEventHistory);
}
/**
* 批量删除事件历史信息
*
* @param ids 需要删除的事件历史信息主键
* @return 结果
*/
@Override
public int deleteDcEventHistoryByIds(String[] ids)
{
return dcEventHistoryMapper.deleteDcEventHistoryByIds(ids);
}
/**
* 删除事件历史信息信息
*
* @param id 事件历史信息主键
* @return 结果
*/
@Override
public int deleteDcEventHistoryById(String id)
{
return dcEventHistoryMapper.deleteDcEventHistoryById(id);
}
}

186
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -0,0 +1,186 @@
package com.zc.business.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.core.type.TypeReference;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.zc.business.domain.DcEvent;
import com.zc.business.mapper.DcEventMapper;
import com.zc.business.service.IDcEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import static com.ruoyi.common.utils.SecurityUtils.getLoginUser;
/**
* 事件信息Service业务层处理
*
* @author ruoyi
* @date 2024-01-03
*/
@Service
public class DcEventServiceImpl implements IDcEventService {
@Autowired
private DcEventMapper dcEventMapper;
/**
* 查询事件信息
*
* @param id 事件信息主键
* @return 事件信息
*/
@Override
public DcEvent selectDcEventById(String id) {
DcEvent dcEvent = dcEventMapper.selectDcEventById(id);
if (dcEvent.getOtherConfig() !=null && !dcEvent.getOtherConfig().isEmpty()){
ObjectMapper mapper = new ObjectMapper();
try {
Map<String, Object> map = mapper.readValue(dcEvent.getOtherConfig(), new TypeReference<Map<String, Object>>() {
});
dcEvent.setEventOtherConfig(map); // 设置转换后的 Map 对象到 eventOtherConfig 属性中
System.out.println(map);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
return dcEvent;
}
/**
* 查询事件信息列表
*
* @param dcEvent 事件信息
* @return 事件信息
*/
@Override
public List<DcEvent> selectDcEventList(DcEvent dcEvent) {
if (dcEvent.getStakeMarkId()!=null){
//处理URl地址栏获取参数+号消失
String replace = dcEvent.getStakeMarkId().replace(" ", "+");
dcEvent.setStakeMarkId(replace);
String replace1 = dcEvent.getEndStakeMarkId().replace(" ", "+");
dcEvent.setEndStakeMarkId(replace1);
}
List<DcEvent> dcEvents = dcEventMapper.selectDcEventList(dcEvent);
for (DcEvent event : dcEvents) {
if (event.getOtherConfig() !=null && !event.getOtherConfig().isEmpty()){
ObjectMapper mapper = new ObjectMapper();
try {
Map<String, Object> map = mapper.readValue(event.getOtherConfig(), new TypeReference<Map<String, Object>>() {
});
event.setEventOtherConfig(map); // 设置转换后的 Map 对象到 eventOtherConfig 属性中
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
}
return dcEvents;
}
/**
* 新增事件信息
*
* @param dcEvent 事件信息
* @return 结果
*/
@Override
public int insertDcEvent(DcEvent dcEvent) {
//获取当前登录用户信息
LoginUser loginUser = getLoginUser();
Long userId = loginUser.getUser().getUserId();
//设置处理人员
dcEvent.setHandlingPerson(userId);
if (dcEvent.getEventOtherConfig()!=null){
Map<String, Object> eventOtherConfig = dcEvent.getEventOtherConfig();
// 将 Map 对象转成 JSON 字符串
String jsonString = convertMapToJsonString(eventOtherConfig);
dcEvent.setOtherConfig(jsonString);
}
//设置事件Id UUID无下划线格式32
String uuid = IdUtils.fastSimpleUUID();
dcEvent.setId(uuid);
dcEvent.setCreateTime(DateUtils.getNowDate());
int s = dcEventMapper.insertDcEvent(dcEvent);
if (s >0) {
//TODO
System.out.println("执行插入事件流程表***"+uuid);
}
return s;
}
/**
* 修改事件信息
*
* @param dcEvent 事件信息
* @return 结果
*/
@Override
public int updateDcEvent(DcEvent dcEvent) {
//获取当前登录用户信息
LoginUser loginUser = getLoginUser();
Long userId = loginUser.getUser().getUserId();
//设置处理人员
dcEvent.setHandlingPerson(userId);
if (dcEvent.getEventOtherConfig()!=null){
Map<String, Object> eventOtherConfig = dcEvent.getEventOtherConfig();
// 将 Map 对象转成 JSON 字符串
String jsonString = convertMapToJsonString(eventOtherConfig);
dcEvent.setOtherConfig(jsonString);
}
dcEvent.setUpdateTime(DateUtils.getNowDate());
return dcEventMapper.updateDcEvent(dcEvent);
}
/**
* 批量删除事件信息
*
* @param ids 需要删除的事件信息主键
* @return 结果
*/
@Override
public int deleteDcEventByIds(String[] ids) {
return dcEventMapper.deleteDcEventByIds(ids);
}
/**
* 删除事件信息信息
*
* @param id 事件信息主键
* @return 结果
*/
@Override
public int deleteDcEventById(String id) {
return dcEventMapper.deleteDcEventById(id);
}
public static String convertMapToJsonString(Map<String, Object> map) {
try {
ObjectMapper objectMapper = new ObjectMapper();
return objectMapper.writeValueAsString(map);
} catch (Exception e) {
// 异常处理
return null;
}
}
}

36
zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java

@ -106,13 +106,20 @@ public class DcShiftsServiceImpl implements IDcShiftsService
@Transactional(rollbackFor = ServiceException.class)
public int updateDcShifts(DcShifts dcShifts) throws Exception{
String msg = "";
Long id = dcShifts.getId();
dcShifts.setUpdateTime(DateUtils.getNowDate());
int updateDcShifts = dcShiftsMapper.updateDcShifts(dcShifts);
if (updateDcShifts == 0) {
msg = "修改用户信息失败";
throw new ServiceException(msg);
}
Long idBefore = dcShifts.getIdBefore();
DcEmployees dcShiftsBefore = dcEmployeesMapper.selectDcEmployeesById(idBefore);//拿到修改前的数据
String nameBefore = dcShiftsBefore.getName();//修改前名称
String postNameBefore = dcShiftsBefore.getPostName();//修改前职位
Long employeesId = dcShifts.getEmployeesId();//修改后人员id
if (!idBefore.equals(employeesId)){
if (!idBefore.equals(employeesId)) {
Long id = dcShifts.getId();
DcShifts dcShiftsById = dcShiftsMapper.selectDcShiftsById(id);//查询值班信息
DcEmployees dcEmployees = dcEmployeesMapper.selectDcEmployeesById(employeesId);//查询修改后的人员信息
String name = dcEmployees.getName();//修改后的人名
String postName = dcEmployees.getPostName();//修改后的岗位
@ -120,16 +127,15 @@ public class DcShiftsServiceImpl implements IDcShiftsService
dcShiftsRecord.setOperator(SecurityUtils.getUserId());//操作人员id
dcShiftsRecord.setOperationType("EDIT");//操作类型
dcShiftsRecord.setOperationTime(DateUtils.getNowDate());//操作时间
dcShiftsRecord.setShiftsDate(dcShifts.getDate());//值班日期
dcShiftsRecord.setModifyContent("岗位"+postNameBefore+"姓名"+nameBefore+"修改为"+postName+name);
dcShiftsRecord.setShiftsDate(dcShiftsById.getDate());//值班日期
dcShiftsRecord.setModifyContent("岗位" + postNameBefore + "姓名" + nameBefore + "修改为" + postName + name);
int shiftsRecord = dcShiftsMapper.insertDcShiftsRecord(dcShiftsRecord);
if (shiftsRecord==0){
msg="操作日志记录失败";
if (shiftsRecord == 0) {
msg = "操作日志记录失败";
throw new ServiceException(msg);
}
}
dcShifts.setUpdateTime(DateUtils.getNowDate());
return dcShiftsMapper.updateDcShifts(dcShifts);
return 1;
}
/**
@ -186,22 +192,24 @@ public class DcShiftsServiceImpl implements IDcShiftsService
//List<DcShifts> equipmentList = util.importExcel("值班人员数据",file.getInputStream(),0);
BeanValidators.validateWithException(validator, equipmentList);//对象属性验证
for (int i=0;i<equipmentList.size();i++){
for (int i = 0; i < equipmentList.size(); i++) {
DcShifts dcShifts = equipmentList.get(i);//获取第i条全部的数据,转换给实体类
String name = dcShifts.getName();
String contactNumber = dcShifts.getContactNumber();//手机号
if (contactNumber == null || contactNumber.equals("")) {
msg = "没有获取到相关手机号信息,请输入手机号";
throw new ServiceException(msg);
}
HashMap<String, Object> map = dcShiftsMapper.contactNumber(contactNumber);//手机号获取人员id
if (map==null){
msg="没有查询到"+name+"的手机号绑定的信息,请查看手机号是否正确";
if (map == null) {
msg = "没有查询到" + name + "的手机号绑定的信息,请查看手机号是否正确";
throw new ServiceException(msg);
}
Long id = (Long) map.get("id");
dcShifts.setEmployeesId(id);
dcShifts.setCreateTime(DateUtils.getNowDate());
int shifts = dcShiftsMapper.insertDcShifts(dcShifts);
if (shifts==0){
if (shifts == 0) {
msg = "添加值班信息‘" + dcShifts.getName() + "’失败,请检查后重新导入";
throw new ServiceException(msg);
}

BIN
zc-business/src/main/resources/excelTemplate/值班示例模板.xlsx

Binary file not shown.

155
zc-business/src/main/resources/mapper/business/DcEventHistoryMapper.xml

@ -0,0 +1,155 @@
<?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.DcEventHistoryMapper">
<resultMap type="com.zc.business.domain.DcEventHistory" id="DcEventHistoryResult">
<result property="id" column="id" />
<result property="groupId" column="group_id" />
<result property="stakeMarkId" column="stake_mark_id" />
<result property="direction" column="direction" />
<result property="roadId" column="road_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="eventLevel" column="event_level" />
<result property="eventCategory" column="event_category" />
<result property="eventType" column="event_type" />
<result property="eventSubclass" column="event_subclass" />
<result property="eventCause" column="event_cause" />
<result property="impactLevel" column="impact_level" />
<result property="description" column="description" />
<result property="handlingPerson" column="handling_person" />
<result property="handlingResult" column="handling_result" />
<result property="otherConfig" column="other_config" />
<result property="eventSource" column="event_source" />
<result property="eventNature" column="event_nature" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDcEventHistoryVo">
select id, group_id, stake_mark_id, direction, road_id, start_time, end_time, event_level, event_category, event_type, event_subclass, event_cause, impact_level, description, handling_person, handling_result, other_config, event_source, event_nature, remark, create_time, update_time from dc_event_history
</sql>
<select id="selectDcEventHistoryList" parameterType="DcEventHistory" resultMap="DcEventHistoryResult">
<include refid="selectDcEventHistoryVo"/>
<where>
<if test="groupId != null "> and group_id = #{groupId}</if>
<if test="stakeMarkId != null and stakeMarkId != ''"> and stake_mark_id = #{stakeMarkId}</if>
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
<if test="roadId != null "> and road_id = #{roadId}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="eventLevel != null "> and event_level = #{eventLevel}</if>
<if test="eventCategory != null "> and event_category = #{eventCategory}</if>
<if test="eventType != null "> and event_type = #{eventType}</if>
<if test="eventSubclass != null "> and event_subclass = #{eventSubclass}</if>
<if test="eventCause != null and eventCause != ''"> and event_cause = #{eventCause}</if>
<if test="impactLevel != null "> and impact_level = #{impactLevel}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="handlingPerson != null "> and handling_person = #{handlingPerson}</if>
<if test="handlingResult != null "> and handling_result = #{handlingResult}</if>
<if test="otherConfig != null and otherConfig != ''"> and other_config = #{otherConfig}</if>
<if test="eventSource != null "> and event_source = #{eventSource}</if>
<if test="eventNature != null "> and event_nature = #{eventNature}</if>
</where>
</select>
<select id="selectDcEventHistoryById" parameterType="String" resultMap="DcEventHistoryResult">
<include refid="selectDcEventHistoryVo"/>
where id = #{id}
</select>
<insert id="insertDcEventHistory" parameterType="DcEventHistory">
insert into dc_event_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="groupId != null">group_id,</if>
<if test="stakeMarkId != null and stakeMarkId != ''">stake_mark_id,</if>
<if test="direction != null and direction != ''">direction,</if>
<if test="roadId != null">road_id,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="eventLevel != null">event_level,</if>
<if test="eventCategory != null">event_category,</if>
<if test="eventType != null">event_type,</if>
<if test="eventSubclass != null">event_subclass,</if>
<if test="eventCause != null">event_cause,</if>
<if test="impactLevel != null">impact_level,</if>
<if test="description != null">description,</if>
<if test="handlingPerson != null">handling_person,</if>
<if test="handlingResult != null">handling_result,</if>
<if test="otherConfig != null">other_config,</if>
<if test="eventSource != null">event_source,</if>
<if test="eventNature != null">event_nature,</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="groupId != null">#{groupId},</if>
<if test="stakeMarkId != null and stakeMarkId != ''">#{stakeMarkId},</if>
<if test="direction != null and direction != ''">#{direction},</if>
<if test="roadId != null">#{roadId},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="eventLevel != null">#{eventLevel},</if>
<if test="eventCategory != null">#{eventCategory},</if>
<if test="eventType != null">#{eventType},</if>
<if test="eventSubclass != null">#{eventSubclass},</if>
<if test="eventCause != null">#{eventCause},</if>
<if test="impactLevel != null">#{impactLevel},</if>
<if test="description != null">#{description},</if>
<if test="handlingPerson != null">#{handlingPerson},</if>
<if test="handlingResult != null">#{handlingResult},</if>
<if test="otherConfig != null">#{otherConfig},</if>
<if test="eventSource != null">#{eventSource},</if>
<if test="eventNature != null">#{eventNature},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDcEventHistory" parameterType="DcEventHistory">
update dc_event_history
<trim prefix="SET" suffixOverrides=",">
<if test="groupId != null">group_id = #{groupId},</if>
<if test="stakeMarkId != null and stakeMarkId != ''">stake_mark_id = #{stakeMarkId},</if>
<if test="direction != null and direction != ''">direction = #{direction},</if>
<if test="roadId != null">road_id = #{roadId},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="eventLevel != null">event_level = #{eventLevel},</if>
<if test="eventCategory != null">event_category = #{eventCategory},</if>
<if test="eventType != null">event_type = #{eventType},</if>
<if test="eventSubclass != null">event_subclass = #{eventSubclass},</if>
<if test="eventCause != null">event_cause = #{eventCause},</if>
<if test="impactLevel != null">impact_level = #{impactLevel},</if>
<if test="description != null">description = #{description},</if>
<if test="handlingPerson != null">handling_person = #{handlingPerson},</if>
<if test="handlingResult != null">handling_result = #{handlingResult},</if>
<if test="otherConfig != null">other_config = #{otherConfig},</if>
<if test="eventSource != null">event_source = #{eventSource},</if>
<if test="eventNature != null">event_nature = #{eventNature},</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="deleteDcEventHistoryById" parameterType="String">
delete from dc_event_history where id = #{id}
</delete>
<delete id="deleteDcEventHistoryByIds" parameterType="String">
delete from dc_event_history where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

294
zc-business/src/main/resources/mapper/business/DcEventMapper.xml

@ -0,0 +1,294 @@
<?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.DcEventMapper">
<resultMap type="com.zc.business.domain.DcEvent" id="DcEventResult">
<result property="id" column="id" />
<result property="groupId" column="group_id" />
<result property="stakeMarkId" column="stake_mark_id" />
<result property="direction" column="direction" />
<result property="roadId" column="road_id" />
<result property="handlingPerson" column="handling_person" />
<result property="endStakeMarkId" column="end_stake_mark_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="eventLevel" column="event_level" />
<result property="eventCategory" column="event_category" />
<result property="eventType" column="event_type" />
<result property="eventName" column="event_name" />
<result property="eventSubclass" column="event_subclass" />
<result property="impactLevel" column="impact_level" />
<result property="eventCause" column="event_cause" />
<result property="description" column="description" />
<result property="handlingResult" column="handling_result" />
<result property="otherConfig" column="other_config" />
<result property="eventSource" column="event_source" />
<result property="eventNature" column="event_nature" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap type="com.zc.business.domain.DcEvent" id="DcEventResultListAll">
<result property="id" column="id" />
<result property="groupId" column="group_id" />
<result property="stakeMarkId" column="stake_mark_id" />
<result property="direction" column="direction" />
<result property="roadId" column="road_id" />
<result property="handlingPerson" column="handling_person" />
<result property="endStakeMarkId" column="end_stake_mark_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="eventLevel" column="event_level" />
<result property="eventCategory" column="event_category" />
<result property="eventType" column="event_type" />
<result property="eventName" column="event_name" />
<result property="eventSubclass" column="event_subclass" />
<result property="impactLevel" column="impact_level" />
<result property="eventCause" column="event_cause" />
<result property="description" column="description" />
<result property="handlingResult" column="handling_result" />
<result property="otherConfig" column="other_config" />
<result property="eventSource" column="event_source" />
<result property="eventNature" column="event_nature" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<!-- <result property="dcProcessConfig.processNode" column="process_node" />
<result property="dcProcessConfig.commonPhrases" column="common_phrases" />
<result property="dcProcessConfig.nodeNode" column="node_node" />-->
<result property="dcEventMap.processNode" column="process_node" />
<result property="dcEventMap.commonPhrases" column="common_phrases" />
<result property="dcEventMap.nodeNode" column="node_node" />
<result property="dcEventMap.dcDispatchId" column="dc_dispatch_id" />
<result property="dcEventMap.organizationId" column="organization_id" />
<result property="dcEventMap.dispatchName" column="dispatch_name" />
<result property="dcEventMap.dispatchStatus" column="dispatch_status" />
<result property="dcEventMap.dcDispatchRemark" column="dc_dispatch_remark" />
<result property="dcEventMap.dcDispatchEndTime" column="dc_dispatch_end_time" />
<result property="dcEventMap.dcDispatchStartTime" column="dc_dispatch_start_time" />
<result property="dcEventMap.eventId" column="event_id" />
<result property="dcEventMap.dcOrganizationId" column="dc_organization_id" />
<result property="dcEventMap.parentId" column="parent_id" />
<result property="dcEventMap.organizationType" column="organization_type" />
<result property="dcEventMap.organizationName" column="organization_name" />
<result property="dcEventMap.organizationAddress" column="organization_address" />
<result property="dcEventMap.dcOrganizationStakeMarkId" column="dc_organization_stake_mark_id" />
<result property="dcEventMap.dcOrganizationDescription" column="dc_organization_description" />
<result property="dcEventMap.vehiclePlate" column="vehicle_plate" />
<result property="dcEventMap.vehicleType" column="vehicle_type" />
<result property="dcEventMap.vehicleStatus" column="vehicle_status" />
<result property="dcEventMap.dcVehiclesRemark" column="dc_vehicles_remark" />
<result property="dcEventMap.postId" column="post_id" />
<result property="dcEventMap.name" column="name" />
<result property="dcEventMap.contactNumber" column="contact_number" />
</resultMap>
<!-- 定义 eventOtherConfig 字段的结果集映射 -->
<!-- <resultMap id="eventOtherResultMap" type="java.util.HashMap">
</resultMap>-->
<sql id="selectDcEventVo">
select id, group_id, stake_mark_id, direction, road_id, handling_person, end_stake_mark_id, start_time, end_time, event_level, event_category, event_type, event_subclass, impact_level, event_cause, description, handling_result, other_config, event_source, event_nature, remark, create_time, update_time from dc_event
</sql>
<sql id="selectDcEventVoList">
select id, group_id, stake_mark_id, direction, road_id, handling_person, end_stake_mark_id, start_time, end_time, event_level, event_category,dc_event.event_type AS event_type, event_subclass, impact_level, event_cause, description, handling_result, other_config, event_source, event_nature, remark, create_time, update_time,dc_event_type.event_name AS event_name from dc_event
</sql>
<!--
根据id查询详情
-->
<sql id="selectDcEventVoListAll">SELECT
dc_event.id AS id,
dc_event.group_id AS group_id,
dc_event.stake_mark_id,
dc_event.direction,
dc_event.road_id,
dc_event.handling_person,
dc_event.end_stake_mark_id,
dc_event.start_time,
dc_event.end_time,
dc_event.event_level,
dc_event.event_category,
dc_event.event_type AS event_type,
dc_event.event_subclass,
dc_event.impact_level,
dc_event.event_cause,
dc_event.description,
dc_event.handling_result,
dc_event.other_config,
dc_event.event_source,
dc_event.event_nature,
dc_event.remark ,
dc_event.create_time,
dc_event.update_time,
dc_event_type.event_name AS event_name,
dc_process_config.node_node AS node_node,
dc_process_config.process_node AS process_node,
dc_process_config.common_phrases AS common_phrases,
dc_dispatch.id AS dc_dispatch_id,
dc_dispatch.organization_id,
dc_dispatch.dispatch_name,
dc_dispatch.dispatch_status,
dc_dispatch.remark as dc_dispatch_remark,
dc_dispatch.end_time as dc_dispatch_end_time,
dc_dispatch.start_time as dc_dispatch_start_time,
dc_dispatch.event_id,
dc_organization.id as dc_organization_id,
dc_organization.parent_id,
dc_organization.organization_type,
dc_organization.organization_name,
dc_organization.organization_address,
dc_organization.stake_mark_id as dc_organization_stake_mark_id,
dc_organization.rescue_unit,
dc_organization.description as dc_organization_description,
dc_vehicles.vehicle_plate,
dc_vehicles.vehicle_type,
dc_vehicles.vehicle_status,
dc_vehicles.remark as dc_vehicles_remark,
dc_employees.post_id,
dc_employees.name,
dc_employees.contact_number
FROM dc_event</sql>
<select id="selectDcEventList" parameterType="DcEvent" resultMap="DcEventResult">
<include refid="selectDcEventVoList"/>
JOIN dc_event_type ON dc_event.event_type = dc_event_type.event_type
<where>
<if test="groupId != null "> and group_id = #{groupId}</if>
<if test="stakeMarkId != null and stakeMarkId != ''"> and stake_mark_id BETWEEN #{stakeMarkId} and #{endStakeMarkId}</if>
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
<if test="roadId != null "> and road_id = #{roadId}</if>
<if test="handlingPerson != null "> and handling_person = #{handlingPerson}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="eventLevel != null "> and event_level = #{eventLevel}</if>
<if test="eventCategory != null "> and event_category = #{eventCategory}</if>
<if test="eventType != null "> and event_type = #{eventType}</if>
<if test="eventSubclass != null "> and event_subclass = #{eventSubclass}</if>
<if test="impactLevel != null "> and impact_level = #{impactLevel}</if>
<if test="eventCause != null and eventCause != ''"> and event_cause = #{eventCause}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="handlingResult != null "> and handling_result = #{handlingResult}</if>
<if test="otherConfig != null and otherConfig != ''"> and other_config = #{otherConfig}</if>
<if test="eventSource != null "> and event_source = #{eventSource}</if>
<if test="eventNature != null "> and event_nature = #{eventNature}</if>
</where>
</select>
<select id="selectDcEventById" parameterType="String" resultMap="DcEventResultListAll">
<include refid="selectDcEventVoListAll"/>
LEFT JOIN dc_event_type ON dc_event.event_type = dc_event_type.event_type
LEFT JOIN dc_process_config ON dc_event_type.event_type = dc_process_config.event_type
-- 关联调度信息记录表
LEFT JOIN dc_dispatch ON dc_event.id = dc_dispatch.event_id
-- 关联资源调度调度记录id关联 调度信息记录表的主键
LEFT JOIN dc_dispatch_resource ON dc_dispatch.id = dc_dispatch_resource.dispatch_id
-- 关联车辆
LEFT JOIN dc_vehicles ON dc_dispatch_resource.resource_id = dc_vehicles.id
-- 关联机构表
LEFT JOIN dc_organization ON dc_dispatch.organization_id = dc_organization.id
-- 关联人员信息表
LEFT JOIN dc_employees ON dc_dispatch_resource.resource_id = dc_employees.id
where dc_event.id = #{id}
</select>
<insert id="insertDcEvent" parameterType="DcEvent">
insert into dc_event
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="groupId != null">group_id,</if>
<if test="stakeMarkId != null and stakeMarkId != ''">stake_mark_id,</if>
<if test="direction != null and direction != ''">direction,</if>
<if test="roadId != null">road_id,</if>
<if test="handlingPerson != null">handling_person,</if>
<if test="endStakeMarkId != null">end_stake_mark_id,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="eventLevel != null">event_level,</if>
<if test="eventCategory != null">event_category,</if>
<if test="eventType != null">event_type,</if>
<if test="eventSubclass != null">event_subclass,</if>
<if test="impactLevel != null">impact_level,</if>
<if test="eventCause != null">event_cause,</if>
<if test="description != null">description,</if>
<if test="handlingResult != null">handling_result,</if>
<if test="otherConfig != null">other_config,</if>
<if test="eventSource != null">event_source,</if>
<if test="eventNature != null">event_nature,</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="groupId != null">#{groupId},</if>
<if test="stakeMarkId != null and stakeMarkId != ''">#{stakeMarkId},</if>
<if test="direction != null and direction != ''">#{direction},</if>
<if test="roadId != null">#{roadId},</if>
<if test="handlingPerson != null">#{handlingPerson},</if>
<if test="endStakeMarkId != null">#{endStakeMarkId},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="eventLevel != null">#{eventLevel},</if>
<if test="eventCategory != null">#{eventCategory},</if>
<if test="eventType != null">#{eventType},</if>
<if test="eventSubclass != null">#{eventSubclass},</if>
<if test="impactLevel != null">#{impactLevel},</if>
<if test="eventCause != null">#{eventCause},</if>
<if test="description != null">#{description},</if>
<if test="handlingResult != null">#{handlingResult},</if>
<if test="otherConfig != null">#{otherConfig},</if>
<if test="eventSource != null">#{eventSource},</if>
<if test="eventNature != null">#{eventNature},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDcEvent" parameterType="DcEvent">
update dc_event
<trim prefix="SET" suffixOverrides=",">
<if test="groupId != null">group_id = #{groupId},</if>
<if test="stakeMarkId != null and stakeMarkId != ''">stake_mark_id = #{stakeMarkId},</if>
<if test="direction != null and direction != ''">direction = #{direction},</if>
<if test="roadId != null">road_id = #{roadId},</if>
<if test="handlingPerson != null">handling_person = #{handlingPerson},</if>
<if test="endStakeMarkId != null">end_stake_mark_id = #{endStakeMarkId},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="eventLevel != null">event_level = #{eventLevel},</if>
<if test="eventCategory != null">event_category = #{eventCategory},</if>
<if test="eventType != null">event_type = #{eventType},</if>
<if test="eventSubclass != null">event_subclass = #{eventSubclass},</if>
<if test="impactLevel != null">impact_level = #{impactLevel},</if>
<if test="eventCause != null">event_cause = #{eventCause},</if>
<if test="description != null">description = #{description},</if>
<if test="handlingResult != null">handling_result = #{handlingResult},</if>
<if test="otherConfig != null">other_config = #{otherConfig},</if>
<if test="eventSource != null">event_source = #{eventSource},</if>
<if test="eventNature != null">event_nature = #{eventNature},</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="deleteDcEventById" parameterType="String">
delete from dc_event where id = #{id}
</delete>
<delete id="deleteDcEventByIds" parameterType="String">
delete from dc_event where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save