From cb403584764c2e2a81ac50390032a57ceebf63c1 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Thu, 30 May 2024 20:01:21 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/domain/DcDevice.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java index 0bd60eb7..4ef85d4c 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java @@ -35,8 +35,8 @@ public class DcDevice { @ApiModelProperty("物联设备ID") @Excel(name = "物联设备ID") private String iotDeviceId; - @ApiModelProperty("组ID") - @Excel(name = "组ID") + @ApiModelProperty("所属机构") + //@Excel(name = "所属机构") private Long groupId; @ApiModelProperty("产品ID") @Excel(name = "产品ID") @@ -45,7 +45,7 @@ public class DcDevice { @Excel(name = "桩号") private String stakeMark; @ApiModelProperty("方向1-上行(菏泽方向),2-中,3-下行(济南方向)") - @Excel(name = "方向") + @Excel(name = "方向", readConverterExp = "1=菏泽方向,3=济南方向") private String direction; @ApiModelProperty("设备名称") @Excel(name = "设备名称") @@ -54,7 +54,7 @@ public class DcDevice { @Excel(name = "设备编号") private String deviceCode; @ApiModelProperty("设备类型") - @Excel(name = "设备类型") + @Excel(name = "设备类型", readConverterExp = "1=摄像机,2=可变信息标志,3=气象监测器,4=出口诱导灯,5=路段语音广播,6=护栏碰撞,7=毫米波雷达,8=合流区预警,9=智慧锥桶,10=激光疲劳唤醒,11=一类交通量调查站,12=行车诱导,13=智能设备箱,14=光线在线监测,15=太阳能板,16=远端机") private String deviceType; @ApiModelProperty("所属网段") @Excel(name = "所属网段") @@ -75,10 +75,10 @@ public class DcDevice { @Excel(name = "安装位置") private String installationSite; @ApiModelProperty("设备状态") - @Excel(name = "设备状态") + @Excel(name = "设备状态", readConverterExp = "0=异常,1=正常") private String deviceState; @ApiModelProperty("使用状态") - @Excel(name = "使用状态") + @Excel(name = "使用状态", readConverterExp = "0=使用中,1=未使用") private Integer useState; @ApiModelProperty("其他配置") @Excel(name = "其他配置") @@ -87,7 +87,7 @@ public class DcDevice { @Excel(name = "备注") private String remark; @ApiModelProperty("设施归属类型(0:默认1: 道路沿线2:桥梁3: 隧道4:收费广场5: 收费站6: 服务区等") - @Excel(name = "设施归属类型") + @Excel(name = "设施归属类型", readConverterExp = "0=默认,1=道路沿线,2=桥梁,3=隧道,4=收费广场,5=收费站,6=服务区") private String facilitiesType; @ApiModelProperty("设备ip") @Excel(name = "设备ip") @@ -102,7 +102,7 @@ public class DcDevice { @Excel(name = "修改时间") private Date updateTime; @ApiModelProperty("子类型") - @Excel(name = "子类型") + @Excel(name = "子类型", readConverterExp = "1-1=高清网络枪型固定摄像机,1-2=高清网络球形摄像机,1-3=桥下高清网络球形摄像机,1-4=360°全景摄像机,1-5=180°全景摄像机,2-1=门架式可变信息标志,2-2=站前可变信息标志,2-3=雨棚可变信息标志,2-4=站前悬臂式可变信息标") private String childType; @TableField(exist = false) private String longitude; From 6863e41809fb91dd9a58055255267dfc4f490480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Thu, 30 May 2024 20:35:57 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E9=A6=96=E5=9B=A0=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/service/impl/DcEventServiceImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index cd94b9d1..5451a5c4 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -264,7 +264,9 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent1.setId(dcEventId);//事件id if (dcEvent2.getEventType() != 3) { dcEvent1.setEventNature(1l);//首发事件 + dcEvent1.setLinkId(dcEvent2.getLinkId() + "," + uuid);//关联管制事件id + dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 } } @@ -282,7 +284,11 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent1.setId(dcEventId);//事件id if (dcEvent2.getEventType() != 3) { dcEvent1.setEventNature(1l);//首发事件 - dcEvent1.setLinkId(dcEvent2.getLinkId()+","+uuid);//关联管制事件id + if (dcEvent2.getLinkId()!=null) { + dcEvent1.setLinkId(dcEvent2.getLinkId()+","+uuid);//关联管制事件id + }else { + dcEvent1.setLinkId(uuid);//关联管制事件id + } dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 } @@ -327,7 +333,11 @@ public class DcEventServiceImpl extends ServiceImpl impl a++; } String linkId2 = sb2.toString(); - dcEvent1.setLinkId(dcEvent2.getLinkId()+","+linkId2);//关联管制事件id + if (dcEvent2.getLinkId()!=null){ + dcEvent1.setLinkId(dcEvent2.getLinkId()+","+linkId2);//关联管制事件id + }else { + dcEvent1.setLinkId(linkId2);//关联管制事件id + } if (dcEvent2.getEventType() != 3) { dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 From 355d30718947a15fed4bcad8009ab14918cd908d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Fri, 31 May 2024 09:49:44 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E6=98=AF=E5=90=A6=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=EF=BC=8C=E9=99=A4=E4=BA=A4=E9=80=9A=E4=BA=8B=E6=95=85=EF=BC=8C?= =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=95=85=E9=9A=9C=E5=A4=96=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=EF=BC=8C=E5=BD=95=E5=85=A5=E5=90=8E=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=BD=AC=E4=B8=BA=E7=A1=AE=E8=AE=A4=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DcEventServiceImpl.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index 5451a5c4..c18beb37 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -221,6 +221,9 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent.getDcEventAccident().setId(uuid); int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident()); + if (dcEvent.getEventState() ==1){ + updateDcEventState(uuid,1);//直接确认 + } } break; //车辆事故 @@ -228,6 +231,9 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getDcEventVehicleAccident() != null) { dcEvent.getDcEventVehicleAccident().setId(uuid); int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident()); + if (dcEvent.getEventState() ==1){ + updateDcEventState(uuid,1);//直接确认 + } } break; //交通管制 @@ -239,12 +245,13 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getDcEventTrafficControl().getFacilityIds() == null) { dcEvent.getDcEventTrafficControl().setId(uuid); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); + updateDcEventState(uuid,1);//直接确认 break; } } //事件处置页 if (dcEvent.getEventState() == 1 && dcEvent.getDcEventTrafficControl().getFacilityIds() == null) {//新增的数据不是收费站 - updateDcEventState(dcEvent.getId(), 1); + updateDcEventState(dcEvent.getId(), 1);//直接确认 dcEvent.getDcEventTrafficControl().setId(uuid); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); //查询事件 @@ -304,6 +311,8 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent.getDcEventTrafficControl().setId(uuid); dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);//取出数组字段赋值 设施id int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); + updateDcEventState(uuid,1);//直接确认 + } } else if (dcEvent.getDcEventTrafficControl().getFacilityIds().length > 1) {//facilityIds1=1 说明只选择了多个收费站 @@ -333,7 +342,7 @@ public class DcEventServiceImpl extends ServiceImpl impl a++; } String linkId2 = sb2.toString(); - if (dcEvent2.getLinkId()!=null){ + if (dcEvent2.getLinkId() !=null){ dcEvent1.setLinkId(dcEvent2.getLinkId()+","+linkId2);//关联管制事件id }else { dcEvent1.setLinkId(linkId2);//关联管制事件id @@ -380,6 +389,7 @@ public class DcEventServiceImpl extends ServiceImpl impl updateDcEventState(map.get("facilityId" + i), 1); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); + updateDcEventState(map.get("facilityId" + i),1);//直接确认 } } else { @@ -433,6 +443,8 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEventMapper.insertDcEvent(dcEvent); extracted(dcEvent); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); + updateDcEventState(map.get("facilityId" + i),1);//直接确认 + } } } @@ -446,6 +458,9 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getDcEventTrafficCongestion() != null) { dcEvent.getDcEventTrafficCongestion().setId(uuid); int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion()); + + updateDcEventState(uuid,1);//直接确认 + } break; @@ -460,6 +475,8 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getDcEventConstruction() != null) { dcEvent.getDcEventConstruction().setId(uuid); int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction()); + updateDcEventState(uuid,1);//直接确认 + } break; @@ -468,6 +485,8 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getDcEventServiceArea() != null) { dcEvent.getDcEventServiceArea().setId(uuid); int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea()); + updateDcEventState(uuid,1);//直接确认 + } break; //设施设备隐患 @@ -478,6 +497,8 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getDcEventAbnormalWeather() != null) { dcEvent.getDcEventAbnormalWeather().setId(uuid); int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather()); + updateDcEventState(uuid,1);//直接确认 + } break; //其他事件 @@ -491,6 +512,7 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 dcEvent.setEventNature(2l); dcEventMapper.updateDcEventLinkId(dcEvent);//修改 新添加的 事件性质 + updateDcEventState(uuid,1);//直接确认 } break; @@ -793,6 +815,7 @@ public class DcEventServiceImpl extends ServiceImpl impl * @return 结果 */ @Override + public int updateDcEvent(DcEvent dcEvent) { /* //事件类型校验 From 416900240191fc08d5db74eb8f71ada56bfcaa37 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Fri, 31 May 2024 11:50:17 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=A9=E6=B0=94?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=A3=85=E5=A5=BD=E8=8C=83=E5=9B=B4=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WeatherForecastController.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java index f15aaff6..516166b0 100644 --- a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java +++ b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java @@ -68,7 +68,7 @@ public class WeatherForecastController extends BaseController { String[] split1 = split[i].split("[+]"); String k = split1[0].replace("K", ""); int parseInt = Integer.parseInt(k); - numStake.append("K").append(parseInt).append("+000"); + numStake.append("K").append(findNearestMultipleOfFive(parseInt)).append("+000"); if (i != split.length - 1) { numStake.append("|"); } @@ -108,6 +108,24 @@ public class WeatherForecastController extends BaseController { return AjaxResult.error("请求失败"); } + public static int findNearestMultipleOfFive(int number) { + // 计算除以5的余数 + int remainder = number % 5; + + // 如果余数为0,则number已经是5的倍数 + if (remainder == 0) { + return number; + } + + // 如果余数不为0,则最近的5的倍数要么是number减去余数(如果余数小于3), + // 要么是number加上(5 - 余数)(如果余数大于或等于3) + // 这里选择的是较小的那个值(向上或向下取整) + int lowerMultiple = number - remainder; + int higherMultiple = number + (5 - remainder); + + // 返回两者中较小的那个 + return (lowerMultiple < higherMultiple) ? lowerMultiple : higherMultiple; + } /* * 当前气象预警信息查询 From 01174c0cee45202e7b343cf12a39d9c7e8a6f6f1 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 31 May 2024 12:00:10 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=8A=E6=B8=B8?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=95=B0=E9=87=8F=EF=BC=8C=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E8=AE=BE=E5=A4=87=E6=95=B0=E9=87=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/service/impl/DcEmergencyPlansServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 0252e65f..0541ced0 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java @@ -485,7 +485,12 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { } }); if (dcDevices.size() > 0) { - dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + if (dcExecuteAction.getNumber() > dcDevices.size()) { + dcDevices = dcDevices.subList(0, dcDevices.size()); + }else { + dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + } + } } else { // 下行 取最小的几个 From 7de559052d6062bd1b2ef5f241b86865a609539c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Fri, 31 May 2024 14:45:31 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E9=9D=9E=EF=BC=88?= =?UTF-8?q?=E4=BA=A4=E9=80=9A=E4=BA=8B=E6=95=85=EF=BC=8C=E8=BD=A6=E8=BE=86?= =?UTF-8?q?=E6=95=85=E9=9A=9C=EF=BC=89=20=E5=A2=9E=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=8F=91=E7=94=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/service/impl/DcEventServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index c18beb37..0e4fc7f0 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -160,6 +160,10 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent.setCreateTime(DateUtils.getNowDate()); + if (eventType != 1 && eventType != 2){ + dcEvent.setOccurrenceTime(DateUtils.getNowDate());//默认发生时间 + } + //处理无桩号事件 //交通事故 if (eventType == 1 && dcEvent.getDcEventAccident().getFacilityId() != null) { @@ -384,6 +388,7 @@ public class DcEventServiceImpl extends ServiceImpl impl String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[i]); dcEvent.setStakeMark(extracted(facilityId)); } + dcEvent.setOccurrenceTime(DateUtils.getNowDate());//默认发生时间 dcEventMapper.insertDcEvent(dcEvent); //首页事件 交通管制事件 添加 状态默认为 1 处置中 updateDcEventState(map.get("facilityId" + i), 1); @@ -439,7 +444,7 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent.setStakeMark(extracted(facilityId)); } - + dcEvent.setOccurrenceTime(DateUtils.getNowDate());//默认发生时间 dcEventMapper.insertDcEvent(dcEvent); extracted(dcEvent); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); From a499149593897df456c1622222fb5b249a34a9bc Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 31 May 2024 14:57:45 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=95=B0=E9=87=8F=E8=B6=85=E5=87=BA=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E5=AD=98=E5=9C=A8=E7=9A=84=E8=AE=BE=E5=A4=87=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DcEmergencyPlansServiceImpl.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 0541ced0..3952697a 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java @@ -508,7 +508,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { } }); if (dcDevices.size() > 0) { - dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + if (dcExecuteAction.getNumber() > dcDevices.size()) { + dcDevices = dcDevices.subList(0, dcDevices.size()); + }else { + dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + } } } @@ -530,7 +534,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { } }); if (dcDevices.size() > 0) { - dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + if (dcExecuteAction.getNumber() > dcDevices.size()) { + dcDevices = dcDevices.subList(0, dcDevices.size()); + }else { + dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + } } } else { @@ -550,7 +558,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { }); // 需要对查出的设备,按照桩号进行排序从小到大 if (dcDevices.size() > 0) { - dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + if (dcExecuteAction.getNumber() > dcDevices.size()) { + dcDevices = dcDevices.subList(0, dcDevices.size()); + }else { + dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber()); + } } } } else { From 222eef13f74146bece02acd53d8393f7fdd3ec7e Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Fri, 31 May 2024 15:30:27 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E9=87=8D=E8=A6=81=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/mapper/DcEventImportantFileMapper.java | 8 ++++++++ .../service/impl/DcEventImportantFileServiceImpl.java | 9 +++++++++ .../mapper/business/DcEventImportantFileMapper.xml | 3 +++ 3 files changed, 20 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java index 56e388eb..b0a4af04 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java @@ -68,4 +68,12 @@ public interface DcEventImportantFileMapper * @return 结果 */ int getImportantFileStatus(String eventId); + + /** + * 获取重要事件的上报状态 + * + * @param dcEventImportantFile 事件 + * @return 结果 + */ + int selectStatus(DcEventImportantFile dcEventImportantFile); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java index 799dadea..dffd4471 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java @@ -62,6 +62,15 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer @Override public List selectDcEventImportantFileList(DcEventImportantFile dcEventImportantFile) { + int type = dcEventImportantFileMapper.getImportantFileStatus(dcEventImportantFile.getEventId()); + + //已初报待续报的, 如果查初报只能查上报了的 + if ((type == 1 || type == 2) && dcEventImportantFile.getType().equals("1")){ + dcEventImportantFile.setStatus("1"); + } else if (type == 3){ + //已终报的, 不管查什么类型的都只能查已上报状态的 + dcEventImportantFile.setStatus("1"); + } return dcEventImportantFileMapper.selectDcEventImportantFileList(dcEventImportantFile); } diff --git a/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml index 1aed6148..f292981c 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml @@ -48,6 +48,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM `dc_event_important_file` where event_id = #{eventId} and status = '1' + insert into dc_event_important_file From afd778341db4ff31c83dfa8a0e8434b9753c74cb Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 31 May 2024 15:46:42 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E6=A1=88?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8F=AF=E6=8E=A7=E8=AE=BE=E5=A4=87=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/service/impl/DcEmergencyPlansServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 3952697a..0cee3846 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java @@ -79,7 +79,9 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { .filter(dcEmergencyPlans1 -> StringUtils.isNotEmpty(dcEmergencyPlans1.getControllableDevice())) .forEach(dcEmergencyPlans1 -> { List deviceIds = Arrays.asList(dcEmergencyPlans1.getControllableDevice().split(",")); - List deviceList = dcDeviceService.listByIds(deviceIds); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(DcDevice::getIotDeviceId, deviceIds); + List deviceList = dcDeviceService.list(lambdaQueryWrapper); StringBuilder stringBuilder = new StringBuilder(); deviceList.forEach(dcDevice -> { stringBuilder.append(",");