Browse Source

管制事件( 关联管制) 事件

develop
王兴琳 10 months ago
parent
commit
953e14f940
  1. 36
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  2. 4
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

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

@ -232,6 +232,8 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
break;
//交通管制
case 3:
//交通管制事件 不做 首因关联
if (dcEvent.getDcEventTrafficControl() != null) {
if (dcEventId == null) {//非首页进入
if (dcEvent.getDcEventTrafficControl().getFacilityIds() == null) {
@ -251,17 +253,21 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (dcEvent2.getLinkId() == null) {
DcEvent dcEvent1 = new DcEvent();
dcEvent1.setId(dcEventId);//事件id
if (dcEvent2.getEventType() != 3) {
dcEvent1.setEventNature(1l);//首发事件
dcEvent1.setLinkId(uuid);//关联管制事件id
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
}else {
}
} else {
DcEvent dcEvent1 = new DcEvent();
dcEvent1.setId(dcEventId);//事件id
if (dcEvent2.getEventType() != 3) {
dcEvent1.setEventNature(1l);//首发事件
dcEvent1.setLinkId(dcEvent2.getLinkId() + "," + uuid);//关联管制事件id
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
}
}
break;
@ -270,12 +276,17 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (dcEvent.getDcEventTrafficControl().getFacilityIds().length == 1) {//facilityIds==1 说明只选择了一个收费站
if (dcEventId != null && !dcEventId.equals("")) {//不等于空 事件处置页面 修改
DcEvent dcEvent2 = dcEventMapper.selectDcEventById(dcEventId);
DcEvent dcEvent1 = new DcEvent();
dcEvent1.setId(dcEventId);//事件id
if (dcEvent2.getEventType() != 3) {
dcEvent1.setEventNature(1l);//首发事件
dcEvent1.setLinkId(uuid);//关联管制事件id
dcEvent1.setLinkId(dcEvent2.getLinkId()+","+uuid);//关联管制事件id
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
}
dcEvent.getDcEventTrafficControl().setId(uuid);
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);//取出数组字段赋值 设施id
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());//
@ -292,10 +303,14 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} else if (dcEvent.getDcEventTrafficControl().getFacilityIds().length > 1) {//facilityIds1=1 说明只选择了多个收费站
if (dcEventId != null) {//不等于空 事件处置页面 修改
DcEvent dcEvent2 = dcEventMapper.selectDcEventById(dcEventId);
dcEventMapper.deleteDcEventById(uuid);//删除添加的事件主类
DcEvent dcEvent1 = new DcEvent();
dcEvent1.setId(dcEventId);//事件id
dcEvent1.setEventNature(1l);//首发事件
Map<String, String> map = new HashMap<>();
for (int i = 0; i < dcEvent.getDcEventTrafficControl().getFacilityIds().length; i++) { //设置事件Id UUID无下划线格式32
String facilityUUID = IdUtils.fastSimpleUUID();
@ -312,8 +327,13 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
a++;
}
String linkId2 = sb2.toString();
dcEvent1.setLinkId(linkId2);//关联管制事件id
dcEvent1.setLinkId(dcEvent2.getLinkId()+","+linkId2);//关联管制事件id
if (dcEvent2.getEventType() != 3) {
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
}
for (int i = 0; i < dcEvent.getDcEventTrafficControl().getFacilityIds().length; i++) {
dcEvent.getDcEventTrafficControl().setId(map.get("facilityId" + i));//交通管制事件id
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[i]);//取出数组字段赋值 设施id
@ -409,6 +429,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
}
break;
//交通拥堵
case 4:
@ -1164,7 +1185,8 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
hashMaps.add(map);
}
List<HashMap<String, Object>> sortedHashMaps = hashMaps.stream().sorted(Comparator.comparing(map -> {
return (Double) map.get("difference"); })).collect(Collectors.toList());
return (Double) map.get("difference");
})).collect(Collectors.toList());
HashMap<String, Object> hashMap = dcWarningMapper.selectDcDispatch(id);//查询事件是否已经有转的调度记录
if (!sortedHashMaps.isEmpty() && hashMap == null) {
HashMap<String, Object> map = sortedHashMaps.get(0);
@ -1779,6 +1801,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
/**
* 调度记录
*
* @param dcEvent
* @return
*/
@ -1819,12 +1842,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
}
/**
* @param eventId
* @return com.ruoyi.common.core.domain.AjaxResult
* @Description 查询关联事件
*
* @author liuwenge
* @date 2024/5/30 14:29
* @param eventId
* @return com.ruoyi.common.core.domain.AjaxResult
*/
@Override
public AjaxResult getLinkEvent(String eventId) {

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

@ -816,12 +816,12 @@
<include refid="selectDcEventVo"/>
<where>
<if test="deptId != null ">and dept_id = #{deptId}</if>
<if test="id != null ">and id = #{id}</if>
<if test="stakeMark != null and stakeMark != ''">and stake_mark BETWEEN #{stakeMark} and #{endStakeMark}
</if>
<if test="direction != null and direction != ''">and direction = #{direction}</if>
<if test="userId != null ">and user_id = #{userId}</if>
<if test="startTime != null ">and start_time BETWEEN #{startTime} and #{endTime}</if>
<if test="estimatedEndTime != null ">and estimated_end_time = #{estimatedEndTime}</if>
<if test="endTime != null ">and end_time BETWEEN #{startTime} and #{endTime}</if>
<if test="eventLevel != null ">and event_level = #{eventLevel}</if>
<if test="eventType != null ">and event_type = #{eventType}</if>
<if test="eventSubclass != null and eventSubclass != ''">and event_subclass = #{eventSubclass}</if>

Loading…
Cancel
Save