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