Browse Source

修改 交通管制 收费站设施 等 多选 插入 。事件处置 收费站多选插入

develop
王兴琳 8 months ago
parent
commit
e3de7818ef
  1. 39
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

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

@ -125,9 +125,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
public int insertDcEvent(DcEvent dcEvent) {
String dcEventId =dcEvent.getId();
if (dcEventId ==null){
}
//获取事件类型
@ -138,11 +136,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
dcEvent.setId(uuid);
dcEvent.setEventState(0L);
//获取部门信息
//dcEvent.setDeptId(SecurityUtils.getDeptId());
dcEvent.setDeptId(1l);
dcEvent.setDeptId(SecurityUtils.getDeptId());
//用户
// dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setUserId(1l);
dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate());
@ -183,9 +179,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (i7 > 0) {
/* //中间库
if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == null){//非 事件处置 和收费站等多条数据添加
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);*/
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
}
switch (eventType) {
//交通事故
case 1:
@ -221,6 +219,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);//取出数组字段赋值 设施id
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());//
}else {
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
dcEvent.getDcEventTrafficControl().setId(uuid);
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);//取出数组字段赋值 设施id
@ -251,11 +252,8 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
}
String linkId2 = sb2.toString();
dcEvent1.setLinkId(linkId2);//关联管制事件id
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
// 使用StringBuilder来构建逗号分隔的字符串
@ -263,8 +261,8 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
//新增第一条数据
dcEvent.setId(map.get("facilityId" + i));
dcEvent.setEventState(0L);
dcEvent.setDeptId(1l);
dcEvent.setUserId(1l);
dcEvent.setDeptId(SecurityUtils.getDeptId());
dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate());
dcEvent.setEventNature(2L);//关联管制
@ -287,12 +285,15 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
dcEvent.setStakeMark(extracted(facilityId));
}
dcEventMapper.insertDcEvent(dcEvent);
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
}else {
dcEventMapper.deleteDcEventById(uuid);//删除添加的事件主类
Map<String,String> map = new HashMap<>();
for (int i = 0; i < dcEvent.getDcEventTrafficControl().getFacilityIds().length; i++) { //设置事件Id UUID无下划线格式32
@ -301,15 +302,14 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
}
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
//新增第一条数据
dcEvent.setId(map.get("facilityId" + i));
dcEvent.setEventState(0L);
dcEvent.setDeptId(1l);
dcEvent.setUserId(1l);
dcEvent.setDeptId(SecurityUtils.getDeptId());
dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate());
dcEvent.setEventNature(2L);//关联管制
@ -335,7 +335,12 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[i]);
dcEvent.setStakeMark(extracted(facilityId));
}
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
dcEventMapper.insertDcEvent(dcEvent);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
}

Loading…
Cancel
Save