Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
zhaoxianglong 10 months ago
parent
commit
c777df102b
  1. 26
      zc-business/src/main/java/com/zc/business/controller/DcWarningController.java
  2. 2
      zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java
  3. 7
      zc-business/src/main/java/com/zc/business/service/IDcWarningService.java
  4. 59
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java
  5. 3
      zc-business/src/main/resources/mapper/business/DcWarningMapper.xml

26
zc-business/src/main/java/com/zc/business/controller/DcWarningController.java

@ -184,6 +184,27 @@ public class DcWarningController extends BaseController
}
return (dcWarningService.insertDispatch(map));
}
//4.指挥调度资源新增(用户修改弹窗的提交)
@PostMapping("/updateSource")
public AjaxResult insertDispatchSource(@RequestBody HashMap map){
return toAjax(dcWarningService.insertDispatchSource(map));
}
//5.修改调度资源记录 1.查询记录id
// @PostMapping("/selectDispatchId")
// public AjaxResult selectDispatchId(@RequestBody HashMap map){
// if (map == null || !map.containsKey("eventId")||StringUtils.isBlank(map.get("eventId").toString())){
// return AjaxResult.error("参数错误");
// }
// return AjaxResult.success(dcWarningService.selectDispatchId(map.get("eventId").toString()));
// }
//5.修改调度资源记录 2.提交调度资源
@PostMapping("/updateDispatchSource")
public AjaxResult updateDispatch(@RequestBody HashMap map){
if (map == null || !map.containsKey("dispatchId")||StringUtils.isBlank(map.get("dispatchId").toString())){
return AjaxResult.error("参数错误");
}
return toAjax(dcWarningService.updateDispatchSource(map));
}
//指挥调度记录修改
@PostMapping("/updateDispatch")
public AjaxResult insertDispatch(@RequestBody DcDispatch dcDispatch){
@ -192,11 +213,6 @@ public class DcWarningController extends BaseController
}
return toAjax(dcWarningService.insertDispatch(dcDispatch));
}
//4.指挥调度资源新增(用户修改弹窗的提交)
@PostMapping("/updateSource")
public AjaxResult insertDispatchSource(@RequestBody HashMap map){
return toAjax(dcWarningService.insertDispatchSource(map));
}
//感知事件误报
@PostMapping("/falseAlarm")
public AjaxResult falseAlarmResolution(@RequestBody DcWarning dcWarning){

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

@ -148,4 +148,6 @@ public interface DcWarningMapper
public String vehiclesType(Long id);
//依据机构id查询机构名称
public String organizationName(Long id);
//事件id查询调度记录id
public HashMap selectDispatchId(@Param("eventId")String eventId);
}

7
zc-business/src/main/java/com/zc/business/service/IDcWarningService.java

@ -97,10 +97,13 @@ public interface IDcWarningService
AjaxResult intelligentSource(DcWarning dcWarning);
//3.指挥调度新增资源
AjaxResult insertDispatch(HashMap map);
//4.新增指挥调度资源记录
public Integer insertDispatchSource(HashMap map);
//5.修改调度资源记录
public HashMap selectDispatchId(String eventId);
public Integer updateDispatchSource(HashMap map);
//修改指挥调度资源记录
public Integer insertDispatch(DcDispatch dcDispatch);
//新增指挥调度资源记录
public Integer insertDispatchSource(HashMap map);
//误报解除
public Integer falseAlarmResolution(DcWarning dcWarning);
}

59
zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

@ -650,6 +650,7 @@ public class DcWarningServiceImpl implements IDcWarningService
mapAll.put("existence",0);
return AjaxResult.success(mapAll);
}
mapAll.put("dispatchId",dcDispatch.get("id"));
mapAll.put("existence",1);
HashMap<String, Object> map = dcWarningMapper.selectDcDispatch(dcWarning.getId());//获取机构id与资源id
if (map!=null){
@ -855,6 +856,64 @@ public class DcWarningServiceImpl implements IDcWarningService
dcEventProcessService.insertDcEventProcess(dcEventProcess);
return 1;
}
@Override
public HashMap selectDispatchId(String eventId) {
return dcWarningMapper.selectDispatchId(eventId);
}
@Override
public Integer updateDispatchSource(HashMap map) {
DcDispatchResource dcDispatchResource = new DcDispatchResource();
Long dispatchId = Long.parseLong(map.get("dispatchId").toString());
dcWarningMapper.deleteDispatchResource(dispatchId);//删除全部属于该调度记录下的全部资源
ArrayList<Map<String,Object>> employeesArray = (ArrayList<Map<String,Object>>) map.get("employees");//取出人员
String context = "";
if (employeesArray!=null&&employeesArray.size()>0) {
context += "路管人员";
for (Map<String,Object> array : employeesArray) {
dcDispatchResource.setDispatchType(1);//类型
dcDispatchResource.setResourceId(Long.valueOf(array.get("id").toString()));//资源id
dcDispatchResource.setDispatchId(dispatchId);//关联调度记录
Integer integer = dcWarningMapper.insertDispatchResource(dcDispatchResource);
context = context + array.get("name").toString() + "、";
if (integer == 0) {
throw new RuntimeException("插入资源失败");
}
}
context = context.substring(0,context.length() -1);
context += "参与事件救援";
}
ArrayList<Map<String,Object>> vehicleArray = (ArrayList<Map<String,Object>>) map.get("vehicle");////取出车辆
if (vehicleArray!=null&&vehicleArray.size()>0) {
if (context.length() > 0){
context += ",";
}
context += "救援车辆";
for (Map<String,Object> array : vehicleArray) {
dcDispatchResource.setDispatchType(2);
dcDispatchResource.setResourceId(Long.valueOf(array.get("id").toString()));
dcDispatchResource.setDispatchId(dispatchId);
Integer integer = dcWarningMapper.insertDispatchResource(dcDispatchResource);
context = context + array.get("vehiclePlate").toString() + "、";
if (integer == 0) {
throw new RuntimeException("插入资源失败");
}
}
context = context.substring(0,context.length() -1);
context += "参与事件救援";
}
DcDispatch dcDispatchEventId = dcWarningMapper.selectDcDispatchById(dispatchId);
DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcDispatchEventId.getEventId());
dcEventProcess.setSource(1);
dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess);
return 1;
}
//误报解除
@Override
public Integer falseAlarmResolution(DcWarning dcWarning) {

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

@ -430,5 +430,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTrafficPolice" resultType="java.util.HashMap">
select name,contact_number contactNumber from dc_employees where organization_id=#{organizationId} and employees_type=2
</select>
<select id="selectDispatchId" resultType="java.util.HashMap">
select id dispatchId from dc_dispatch where event_id=#{eventId}
</select>
</mapper>

Loading…
Cancel
Save