Browse Source

事件处置联络调度记录

develop
lau572 12 months ago
parent
commit
eb0d407712
  1. 2
      zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java
  2. 42
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java
  3. 3
      zc-business/src/main/resources/mapper/business/DcWarningMapper.xml

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

@ -128,4 +128,6 @@ public interface DcWarningMapper
public List<HashMap<String,Object>> selectVehiclesChoice(@Param("dispatchId")Long dispatchId);
public Integer deleteDispatchResource(@Param("dispatchId")Long dispatchId);
DcDispatch selectDcDispatchById(@Param("id") Long id);
}

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

@ -7,12 +7,7 @@ import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.zc.business.domain.DcDispatch;
import com.zc.business.domain.DcDispatchResource;
import com.zc.business.domain.DcEvent;
import com.zc.business.domain.DcWaringStrategy;
import com.zc.business.domain.DcWarning;
import com.zc.business.domain.DcWarningBatchConvert;
import com.zc.business.domain.*;
import com.zc.business.enums.ValueConverter;
import com.zc.business.enums.WarningSubclassEnum;
import com.zc.business.mapper.DcEventMapper;
@ -56,6 +51,8 @@ public class DcWarningServiceImpl implements IDcWarningService
private DcEventMapper dcEventMapper;
@Autowired
private IDcEventService dcEventService;
@Autowired
private DcEventProcessServiceImpl dcEventProcessService;
@Resource
private RedisCache redisCache;
private final String HAPPEN = "发生";
@ -705,30 +702,47 @@ public class DcWarningServiceImpl implements IDcWarningService
Integer pat = (Integer) map.get("dispatchId");
long dispatchId = pat.longValue();
dcWarningMapper.deleteDispatchResource(dispatchId);//删除全部属于该调度记录下的全部资源
ArrayList<Integer> employeesArray = (ArrayList<Integer>) map.get("employees");//取出人员
ArrayList<Map<String,Object>> employeesArray = (ArrayList<Map<String,Object>>) map.get("employees");//取出人员
String context = "路管人员";
if (employeesArray!=null&&employeesArray.size()>0) {
for (Integer array : employeesArray) {
for (Map<String,Object> array : employeesArray) {
dcDispatchResource.setDispatchType(1);//类型
dcDispatchResource.setResourceId(array.longValue());//资源id
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) {
return 0;
throw new RuntimeException("插入资源失败");
}
}
context = context.substring(0,context.length() -1);
context += "参与事件救援";
}
ArrayList<Integer> vehicleArray = (ArrayList<Integer>) map.get("vehicle");////取出车辆
ArrayList<Map<String,Object>> vehicleArray = (ArrayList<Map<String,Object>>) map.get("vehicle");////取出车辆
if (vehicleArray!=null&&vehicleArray.size()>0) {
for (Integer array : vehicleArray) {
context += ",救援车辆";
for (Map<String,Object> array : vehicleArray) {
dcDispatchResource.setDispatchType(2);
dcDispatchResource.setResourceId(array.longValue());
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) {
return 0;
throw new RuntimeException("插入资源失败");
}
}
context = context.substring(0,context.length() -1);
context += "参与事件救援";
}
DcDispatch dcDispatch = dcWarningMapper.selectDcDispatchById(dispatchId);
DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcDispatch.getEventId());
dcEventProcess.setSource(1);
dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess);
return 1;
}

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

@ -396,4 +396,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE resource.dispatch_id=1 and resource.dispatch_type=2
</select>
<select id="selectDcDispatchById" resultType="com.zc.business.domain.DcDispatch">
select * from dc_dispatch where id = #{id}
</select>
</mapper>

Loading…
Cancel
Save