|
|
@ -11,7 +11,9 @@ import com.ruoyi.common.utils.StringUtils; |
|
|
|
import com.ruoyi.common.utils.uuid.IdUtils; |
|
|
|
import com.ruoyi.system.service.ISysDeptService; |
|
|
|
import com.zc.business.domain.*; |
|
|
|
import com.zc.business.enums.*; |
|
|
|
import com.zc.business.enums.EventSubclass; |
|
|
|
import com.zc.business.enums.EventSubclassEnum; |
|
|
|
import com.zc.business.enums.ValueConverter; |
|
|
|
import com.zc.business.mapper.*; |
|
|
|
import com.zc.business.service.IDcEventProcessService; |
|
|
|
import com.zc.business.service.IDcEventService; |
|
|
@ -139,14 +141,19 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
public int insertDcEvent(DcEvent dcEvent) { |
|
|
|
|
|
|
|
String dcEventId = dcEvent.getId(); |
|
|
|
|
|
|
|
//桩号校验
|
|
|
|
if (!StakeMarkUtils.checkStakeMark(dcEvent.getStakeMark())){ |
|
|
|
return -1; |
|
|
|
} |
|
|
|
//获取事件类型
|
|
|
|
int eventType = Math.toIntExact(dcEvent.getEventType()); |
|
|
|
|
|
|
|
//设置事件Id UUID无下划线格式32
|
|
|
|
String uuid = IdUtils.fastSimpleUUID(); |
|
|
|
dcEvent.setId(uuid); |
|
|
|
dcEvent.setEventState(0L); |
|
|
|
if (dcEvent.getEventState() == null) { |
|
|
|
dcEvent.setEventState(0L); |
|
|
|
} |
|
|
|
//获取部门信息
|
|
|
|
dcEvent.setDeptId(SecurityUtils.getDeptId()); |
|
|
|
//用户
|
|
|
@ -170,7 +177,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityId() != null && dcEvent.getDcEventTrafficControl().getFacilityId()>0) { |
|
|
|
if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityId() != null && dcEvent.getDcEventTrafficControl().getFacilityId() > 0) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
@ -179,6 +186,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
|
|
|
|
//施工建设
|
|
|
|
if (eventType == 7 && dcEvent.getDcEventConstruction().getFacilityId() != null) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventConstruction().getFacilityId()); |
|
|
@ -223,9 +231,23 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
//交通管制
|
|
|
|
case 3: |
|
|
|
if (dcEvent.getDcEventTrafficControl() != null) { |
|
|
|
if (dcEvent.getDcEventTrafficControl().getFacilityId()==null || dcEvent.getDcEventTrafficControl().getFacilityId()>0){ |
|
|
|
if (dcEventId == null) {//非首页进入
|
|
|
|
if (dcEvent.getDcEventTrafficControl().getFacilityIds() ==null ) { |
|
|
|
dcEvent.getDcEventTrafficControl().setId(uuid); |
|
|
|
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
//事件处置页
|
|
|
|
if (dcEvent.getEventState() == 1 && dcEvent.getDcEventTrafficControl().getFacilityIds() == null) {//新增的数据不是收费站
|
|
|
|
updateDcEventState(dcEvent.getId(), dcEvent.getEventState().intValue()); |
|
|
|
dcEvent.getDcEventTrafficControl().setId(uuid); |
|
|
|
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); |
|
|
|
DcEvent dcEvent1 = new DcEvent(); |
|
|
|
dcEvent1.setId(dcEventId);//事件id
|
|
|
|
dcEvent1.setEventNature(1l);//首发事件
|
|
|
|
dcEvent1.setLinkId(uuid);//关联管制事件id
|
|
|
|
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
|
|
|
|
break; |
|
|
|
} |
|
|
|
// 插入多个收费站
|
|
|
@ -325,7 +347,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
|
|
|
|
//新增第一条数据
|
|
|
|
dcEvent.setId(map.get("facilityId" + i)); |
|
|
|
dcEvent.setEventState(0L); |
|
|
|
|
|
|
|
if (dcEvent.getEventState() == null) { |
|
|
|
dcEvent.setEventState(0L); |
|
|
|
} |
|
|
|
|
|
|
|
dcEvent.setDeptId(SecurityUtils.getDeptId()); |
|
|
|
dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
dcEvent.setCreateTime(DateUtils.getNowDate()); |
|
|
@ -346,7 +372,6 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
|
|
|
|
String linkId = sb.toString(); |
|
|
|
dcEvent.setLinkId(linkId); |
|
|
|
System.out.println(linkId); |
|
|
|
|
|
|
|
//交通管制
|
|
|
|
if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityIds()[i] != null) { |
|
|
@ -354,8 +379,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dcEventMapper.insertDcEvent(dcEvent); |
|
|
|
extracted(dcEvent); |
|
|
|
//首页事件 交通管制事件 添加 状态默认为 1 处置中
|
|
|
|
updateDcEventState(dcEvent.getId(), dcEvent.getEventState().intValue()); |
|
|
|
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); |
|
|
|
} |
|
|
|
} |
|
|
@ -702,9 +730,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
// 事件子类校验
|
|
|
|
// 事件子类校验
|
|
|
|
for (EventSubclass value : EventSubclass.values()) { |
|
|
|
if (value.getDescription().equals(dcEvent.getEventSubclass())){ |
|
|
|
if (value.getDescription().equals(dcEvent.getEventSubclass())) { |
|
|
|
dcEvent.setEventSubclass(value.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
@ -716,9 +744,10 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
}*/ |
|
|
|
|
|
|
|
//事件方向
|
|
|
|
if (dcEvent.getDirection().equals("菏泽方向")){ |
|
|
|
if (dcEvent.getDirection().equals("菏泽方向")) { |
|
|
|
dcEvent.setDirection("1"); |
|
|
|
} if (dcEvent.getDirection().equals("济南方向")){ |
|
|
|
} |
|
|
|
if (dcEvent.getDirection().equals("济南方向")) { |
|
|
|
dcEvent.setDirection("3"); |
|
|
|
} |
|
|
|
|
|
|
@ -818,7 +847,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
int i7 = -1; |
|
|
|
for (String id : ids) { |
|
|
|
DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); |
|
|
|
if (dcEvent==null){ |
|
|
|
if (dcEvent == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
// todo 删除信息发布记录
|
|
|
@ -1034,18 +1063,18 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
|
|
|
|
@Override |
|
|
|
public int updateDcEventState(String id, int state) { |
|
|
|
//多次修改请求
|
|
|
|
//多次修改请求
|
|
|
|
DcEvent dcEvent1 = dcEventMapper.selectDcEventById(id); |
|
|
|
//事件删除 后 返回成功
|
|
|
|
if (dcEvent1 ==null){ |
|
|
|
return 1; |
|
|
|
if (dcEvent1 == null) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
//事件状态已被修改 返回成功
|
|
|
|
if (dcEvent1.getEventState()==state){ |
|
|
|
return 1; |
|
|
|
if (dcEvent1.getEventState() == state) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
int i = dcEventMapper.updateDcEventState(id, state); |
|
|
|
int i = dcEventMapper.updateDcEventState(id, state); |
|
|
|
if (i > 0) { |
|
|
|
DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); |
|
|
|
|
|
|
@ -1530,7 +1559,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
} |
|
|
|
} |
|
|
|
String label = ValueConverter.eventLabel(result.getRightPath()); |
|
|
|
if (StringUtils.isNotEmpty(label)){ |
|
|
|
if (StringUtils.isNotEmpty(label)) { |
|
|
|
context = context + label + "修改为:" + result.getRight() + ","; |
|
|
|
} |
|
|
|
} |
|
|
@ -1609,10 +1638,10 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
|
|
|
|
|
|
|
|
DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); |
|
|
|
if (dcEvent.getEventType() == null || (dcEvent.getEventType() != 1 && dcEvent.getEventType() != 2 && dcEvent.getEventType() != 6)){ |
|
|
|
if (dcEvent.getEventType() == null || (dcEvent.getEventType() != 1 && dcEvent.getEventType() != 2 && dcEvent.getEventType() != 6)) { |
|
|
|
return AjaxResult.error("该事件类型无需清障!"); |
|
|
|
} |
|
|
|
if (dcEvent.getEventState() != null && dcEvent.getEventState() == 2){ |
|
|
|
if (dcEvent.getEventState() != null && dcEvent.getEventState() == 2) { |
|
|
|
return AjaxResult.error("该事件已结束,无法进行操作!"); |
|
|
|
} |
|
|
|
int i = dcEventMapper.selectClearInfo(eventId); |
|
|
|