zhubaomin
2024-11-22 44180ee779c038ad628fcd847a0b8e2ca9b6f4ee
Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
100个文件已修改
31个文件已添加
3025 ■■■■ 已修改文件
pipIrr-platform/pipIrr-common/pom.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoAspect.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoPowerAspect.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/DriverV1.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_02_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_1601_Down.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_1602_Down.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_1603_Down.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_81_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_83_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_84_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_9601_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_9602_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_9603_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_C0_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/global/GlCreate.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_02_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_81_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_83_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_84_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_C0_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_02_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_80_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_81_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_83_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_84_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_85_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_8A_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_C2_Up.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd80_5BVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd81Vo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd84Vo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd85Vo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_A3Vo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCdC2Vo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeInfo.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeRtu.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeState.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeTaskVo.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/CRC16.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/TimerTaskJob.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/TimerTaskJobTest.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/pom.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/ToRtuMwCom.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoBatteryVolt.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoCumulativeFlow.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeAccumulateAmount.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoSignalIntensity.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voUg/VoRtuProgram.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voUg/VoWatch.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java 189 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeRtuDev.java 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeUnit.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeUnitConfigVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/comResult/CommandResultDeal.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/webRequest/WebRequestDeal.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config(sp沙盘).xml 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config(test测试).xml 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config(ym元谋).xml 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/.gitattributes 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/.gitignore 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/.mvn/wrapper/maven-wrapper.properties 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/mvnw 259 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/mvnw.cmd 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/pom.xml 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/AdapterImp_TcpClUnit.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/PipIrrMwSimulateRtuApplication.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/Server.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/ServerProperties.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/LocalCodecFactory.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/LocalDecoder.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/LocalEncoder.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpClUnit.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpClUnitAdapter.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpClUnitConfigVo.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpConnect.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpHandler.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/downData/DownData.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9600.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9601.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9602.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9603.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpData.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpHeartBeat.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/resources/application.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/resources/config.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/resources/log4j2.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/test/java/com/dy/simRtu/PipIrrMwSimulateRtuApplicationTests.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pom.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/PipIrrMwTestRtuApplication.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/Server.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/resources/Config.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/说明.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1/ComSupportP206V1.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/rtuLog/RtuLogSupport.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-app/pom.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-app/src/main/java/com/dy/pipIrrApp/issue/qo/QoIssueReport.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-app/src/main/java/com/dy/pipIrrApp/workOrder/qo/QoWorkOrder.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictVoMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/program/UgRtuProgramCtrl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuTaskCtrl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DtoToDividePojo.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/DtoToFlowmeterPojo.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/DtoToMoniFlowPojo.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/qo/OnLineIntakesQO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/DtoToPojo.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/RechargeDtoMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/converter/RechargeDtoMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoReceipt.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/SeClientToVoClient.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/dto/DtoVcRecharge.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QoWalletRecharge.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QueryVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/AutomaticClose.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/Recharge.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/issue/qo/QoIssueReport.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/SeClientToVoClient.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/qo/QoVcRecharge.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/pom.xml
@@ -45,6 +45,7 @@
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.28</version>
        </dependency>
        <!-- @Aspect @Pointcut @Around等应用 -->
        <dependency>
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoAspect.java
@@ -111,9 +111,13 @@
                response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, SsoVo.class);
            } catch (Exception e) {
                e.printStackTrace();
                return BaseResponseUtils.buildError("后端系统出错,访问单点登录系统异常");
            }
            assert response != null;
            return response.getBody();
            if(response == null){
                return BaseResponseUtils.buildError("后端系统出错,访问单点登录系统异常");
            }else{
                return response.getBody();
            }
        }else {
            return BaseResponseUtils.buildError("后端系统出错,未得到SsoCheckUrl");
        }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoPowerAspect.java
@@ -129,9 +129,13 @@
                response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, SsoVo.class);
            } catch (Exception e) {
                e.printStackTrace();
                return BaseResponseUtils.buildError("后端系统出错,访问单点登录系统异常");
            }
            assert response != null;
            return response.getBody();
            if(response == null){
                return BaseResponseUtils.buildError("后端系统出错,访问单点登录系统异常");
            }else{
                return response.getBody();
            }
        }else {
            return BaseResponseUtils.buildError("后端系统出错,未得到SsoCheckUrl");
        }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java
@@ -75,7 +75,7 @@
            int len = ByteUtilUnsigned.byte2Byte(bs, ProtocolConstantV206V1.dataLenIndex);
            return len + ProtocolConstantV206V1.lenHead2ctrl + ProtocolConstantV206V1.lenTail;
        }else{
            int len = ByteUtilUnsigned.bytes2Short_BE(bs, ProtocolConstantV206V1.UG_dataLenIndex_start);
            int len = ByteUtilUnsigned.bytes2Short_LE(bs, ProtocolConstantV206V1.UG_dataLenIndex_start);
            return len + ProtocolConstantV206V1.UG_lenHead2Cmd + ProtocolConstantV206V1.UG_lenTail;
        }
    }
@@ -176,8 +176,9 @@
                return "计算CRC是:" + crcCompute + ",上传CRC是" + crcInBs ;
            }
        }else{
            int crcCompute = (byte)new CRC16().CRC(bs, ProtocolConstantV206V1.ctrlIndex, bs.length - 3) ;
            int crcInBs = ByteUtilUnsigned.bytes2Short_BE(bs, bs.length - 3) ;
            short crcCompute = new CRC16().CRC(bs, 0, bs.length - 4) ;
            short crcInBs = ByteUtil.bytes2Short_BE(bs,bs.length - 3) ;
            //int crcInBs = ByteUtilUnsigned.bytes2Short_BE(bs, bs.length - 3) ;
            if(crcCompute == crcInBs){
                return null ;
            }else{
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/DriverV1.java
@@ -112,7 +112,10 @@
            isFail = true ;
            return new MidResult[]{(new MidResultError(ProtocolConstantV206V1.protocolName, rtuAddr, "严重错误,分析Rtu数据出错!数据为:" + upHex + (e.getMessage() == null?"":(",出错信息:" + e.getMessage())), e))} ;
        } finally{
            callback.callback(rtuAddr, upCode, CodeV1.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr);
            if(upCode != null){
                //CRC验证失败时,upCode为null,此时不进行回调
                callback.callback(rtuAddr, upCode, CodeV1.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr);
            }
        }
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_02_Up.java
@@ -76,7 +76,7 @@
            confirmCommand.isQuickSend = true ;
        }
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_1601_Down.java
@@ -33,7 +33,7 @@
        midRs.downCodeName = CodeV1.getCodeName(para.commandCode) ;//下行命令功能码名称;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.hasResponse = false ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
@@ -75,7 +75,7 @@
        if(para.param == null){
            throw new Exception("参数为空") ;
        }
        if(para.param instanceof Com1601Vo){
        if(!(para.param instanceof Com1601Vo)){
            throw new Exception("参数类型非Com1601Vo") ;
        }
        Com1601Vo vo = (Com1601Vo) para.param ;
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_1602_Down.java
@@ -33,7 +33,7 @@
        midRs.downCodeName = CodeV1.getCodeName(para.commandCode) ;//下行命令功能码名称;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.hasResponse = false ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_1603_Down.java
@@ -32,7 +32,7 @@
        midRs.downCodeName = CodeV1.getCodeName(para.commandCode) ;//下行命令功能码名称;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.hasResponse = false ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_81_Up.java
@@ -84,7 +84,7 @@
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_83_Up.java
@@ -86,7 +86,7 @@
        }
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_84_Up.java
@@ -91,7 +91,7 @@
            */
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_9601_Up.java
@@ -43,7 +43,7 @@
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//主动上报
        midRs.reportOrResponse_trueOrFalse = true ;//升级的,不认为是命令应答
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        if(para.data != null && para.data.getSubData() != null){
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_9602_Up.java
@@ -43,7 +43,7 @@
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//主动上报
        midRs.reportOrResponse_trueOrFalse = true ;//升级的,不认为是命令应答
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        if(para.data != null && para.data.getSubData() != null){
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_9603_Up.java
@@ -43,7 +43,7 @@
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//主动上报
        midRs.reportOrResponse_trueOrFalse = true ;//升级的,不认为是命令应答
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        if(para.data != null && para.data.getSubData() != null){
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/Cd_C0_Up.java
@@ -84,7 +84,7 @@
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/global/GlCreate.java
@@ -52,6 +52,17 @@
        bsNoTail[ProtocolConstantV206V1.dataLenIndex] = (byte)len ;
    }
    public static void createLen4PUg(byte[] bytes) throws Exception {
        int len = bytes.length - 4;
        byte[] bs = ByteUtil.int2BCD_LE(len) ;
        if(bs != null && bs.length == 1){
            bytes[1] = bs[0] ;
        }else if(bs != null && bs.length > 1){
            bytes[1] = bs[0] ;
            bytes[2] = bs[1] ;
        }
    }
    /**
     * ç”ŸæˆIC卡编码
@@ -81,9 +92,9 @@
    }
    public static byte[] createCrcTail4Ug(byte[] bsNoTail) throws Exception {
        int crc = new CRC16().CRC(bsNoTail, 0, bsNoTail.length -1) ;
        short crc = new CRC16().CRC(bsNoTail, 0, bsNoTail.length -1) ;
        byte[] bytes = new byte[ProtocolConstantV206V1.UG_lenTail] ;
        ByteUtilUnsigned.short2Bytes_BE(bytes, crc, 0);
        ByteUtil.short2Bytes_BE(bytes, crc, 0);
        bytes[2] = ProtocolConstantV206V1.P_Tail_Byte ;
        return bytes ;
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_02_Up.java
@@ -85,7 +85,7 @@
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_81_Up.java
@@ -83,7 +83,7 @@
                callback.notify(new ValveStateInfo(cdData.stateVo.valveState.byteValue()== 1?false:true));
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_83_Up.java
@@ -86,7 +86,7 @@
                callback.notify(new ValveStateInfo(false));
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_84_Up.java
@@ -92,7 +92,7 @@
            */
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_C0_Up.java
@@ -84,7 +84,7 @@
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_02_Up.java
@@ -75,7 +75,7 @@
            confirmCommand.isQuickSend = true ;
        }
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_80_Up.java
@@ -82,7 +82,7 @@
            callback.notify(new ValveStateInfo(true)) ;
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_81_Up.java
@@ -84,7 +84,7 @@
                callback.notify(new ValveStateInfo(cdData.statePump.byteValue()== 1?true:false));
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_83_Up.java
@@ -79,7 +79,7 @@
        }
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_84_Up.java
@@ -80,7 +80,7 @@
            callback.notify(new ValveStateInfo(true));
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_85_Up.java
@@ -81,7 +81,7 @@
            callback.notify(new ValveStateInfo(false));
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_8A_Up.java
@@ -75,7 +75,7 @@
            confirmCommand.isQuickSend = true ;
        }
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_C2_Up.java
@@ -90,7 +90,7 @@
            }
        }
        return new MidResult[]{midRs, confirmCommand} ;
        return new MidResult[]{confirmCommand, midRs} ;
    }
    /**
     * æ‰§è¡Œåˆ†æž
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd80_5BVo.java
@@ -1,9 +1,11 @@
package com.dy.common.mw.protocol.p206V202404.upVos;
import lombok.Data;
import lombok.EqualsAndHashCode;
//设备终端工作上报 + æŸ¥è¯¢è®¾å¤‡ç»ˆç«¯å®žæ—¶å€¼
@Data
@EqualsAndHashCode(callSuper=false)
public class DataCd80_5BVo extends AlarmVo {
    public String controllerType;//控制器类型:   01:测控一体阀;57:井电控制器
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd81Vo.java
@@ -1,9 +1,11 @@
package com.dy.common.mw.protocol.p206V202404.upVos;
import lombok.Data;
import lombok.EqualsAndHashCode;
//设备终端随机自报
@Data
@EqualsAndHashCode(callSuper=false)
public class DataCd81Vo extends AlarmVo {
    public String controllerType;//控制器类型:   01:测控一体阀;57:井电控制器
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd84Vo.java
@@ -1,9 +1,11 @@
package com.dy.common.mw.protocol.p206V202404.upVos;
import lombok.Data;
import lombok.EqualsAndHashCode;
//刷卡开泵/阀上报
@Data
@EqualsAndHashCode(callSuper=false)
public class DataCd84Vo extends AlarmVo {
    public String controllerType;//控制器类型 01(0x01):测控一体阀;57(0x57):井电控制器
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd85Vo.java
@@ -1,9 +1,11 @@
package com.dy.common.mw.protocol.p206V202404.upVos;
import lombok.Data;
import lombok.EqualsAndHashCode;
//平台/APP远程关闭水泵/阀门   +  åˆ·å¡å…³æ³µ/阀上报
@Data
@EqualsAndHashCode(callSuper=false)
public class DataCd85Vo extends AlarmVo {
    public String controllerType;//控制器类型 01(0x01):测控一体阀;57(0x57):井电控制器
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_A3Vo.java
@@ -1,9 +1,11 @@
package com.dy.common.mw.protocol.p206V202404.upVos;
import lombok.Data;
import lombok.EqualsAndHashCode;
//平台/APP远程关闭水泵/阀门   +  åˆ·å¡å…³æ³µ/阀上报
@Data
@EqualsAndHashCode(callSuper=false)
public class DataCd93_A3Vo extends AlarmVo {
    public String controllerType;//控制器类型 01(0x01):测控一体阀;57(0x57):井电控制器
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCdC2Vo.java
@@ -1,9 +1,11 @@
package com.dy.common.mw.protocol.p206V202404.upVos;
import lombok.Data;
import lombok.EqualsAndHashCode;
//开关水泵/阀门成功/失败上报
@Data
@EqualsAndHashCode(callSuper=false)
public class DataCdC2Vo extends AlarmVo {
    public String controllerType ;//控制器类型:   01:测控一体阀;57:井电控制器
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeInfo.java
@@ -3,6 +3,7 @@
import lombok.Data;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
/**
 * @Author: liurunyu
@@ -17,13 +18,29 @@
    public UpgradeState ugOverallState;
    //升级任务RTU状态列表
    public List<UpgradeRtu> ugRtuStateList;
    public String toString(){
        return this.toString(null) ;
    }
    public String toString(String logRtuAddr){
        StringBuilder sb = new StringBuilder() ;
        sb.append("RTU远程升级状态:") ;
        sb.append("  \n任务id:" + ugTaskId) ;
        sb.append("  \n" + ugOverallState.toString()) ;
        //sb.append("  \n升级的控制器总数:" + ugRtuStateList.size()) ;
        if(ugRtuStateList != null && ugRtuStateList.size() > 0){
            sb.append("  \n升级的控制器总数:" + ugRtuStateList.size()) ;
            sb.append("  \n其中一个控制器升级情况:") ;
            AtomicBoolean exist = new AtomicBoolean(false);
            if(logRtuAddr != null){
                ugRtuStateList.stream().filter(ur -> ur.getRtuAddr().equals(logRtuAddr)).forEach(ur -> {
                    sb.append("  \n" + ur.toString()) ;
                    exist.set(true);
                }) ;
            }
            if(!exist.get()){
                sb.append("  \n" + ugRtuStateList.get(0).toString()) ;
            }
        }
        return sb.toString() ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeRtu.java
@@ -63,11 +63,11 @@
            case STATE_SUCCESS:
                return "升级成功";
            case STATE_FAILONE:
                return "升级失败(1包死)";
                return "一包死";
            case STATE_FAIL:
                return "升级失败(非1包死)";
                return "升级中死";
            case STATE_FAILOFFLINE:
                return "升级失败(离线)";
                return "离线失败";
            default:
                return "未知";
        }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeState.java
@@ -16,8 +16,11 @@
    public int runningTotal ;//所有正在升级
    public int overTotal ;//所有结束(包括成功与所有失败)
    public int successTotal ;//所有成功
    public int failTotal ;//所有失败
    public int failTotal ;//所有失败(一包死失败+多包死失败+离线失败)
    public int failOneTotal ;//所有一包死失败
    public int failOffTotal ;//所有离线失败
    public Boolean allOver ;//所有都结束(true:是,false:否)
    public UpgradeState() {
        this.init();
@@ -31,6 +34,9 @@
        this.overTotal = 0;
        this.successTotal = 0;
        this.failTotal = 0;
        this.failOneTotal = 0;
        this.failOffTotal = 0;
        this.allOver = false ;
    }
    public String toString(){
@@ -43,7 +49,9 @@
        sb.append("    \n已结束总数:" + overTotal) ;
        sb.append("    \n成功总数:" + successTotal) ;
        sb.append("    \n失败总数:" + failTotal) ;
        sb.append("    \n1包死总数:" + failOneTotal) ;
        sb.append("    \n1包死失败总数:" + failOneTotal) ;
        sb.append("    \n离线失败总数:" + failOffTotal) ;
        sb.append("    \n全结束:" + allOver) ;
        return sb.toString() ;
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/softUpgrade/state/UpgradeTaskVo.java
@@ -15,6 +15,7 @@
    public String softFileName ;//升级程序文件名
    public String softStoreAddr ;//升级程序存放地址
    public String softStartAddr ;//程序覆盖起始地址
    public String softFileData64 ;//有效升级程序字节数组
    public byte[] softFileData ;//有效升级程序字节数组
    public Integer softBytesCalculate ;//根据公式计算得到的有效升级程序字节数
    public Integer softByteSrc16 ;//有效升级程序字节数CRC16校验值
@@ -27,7 +28,7 @@
                "   å‡çº§ç¨‹åºæ–‡ä»¶å=" + softFileName + "\n" +
                "   å‡çº§ç¨‹åºå­˜æ”¾åœ°å€=" + softStoreAddr + "\n" +
                "   ç¨‹åºè¦†ç›–起始地址=" + softStartAddr + "\n" +
                "   æœ‰æ•ˆå‡çº§ç¨‹åºå­—节数=" + softFileData.length + "\n" +
                "   æœ‰æ•ˆå‡çº§ç¨‹åºå­—节数(base64)=" + softFileData64 + "\n" +
                "   å…¬å¼è®¡ç®—程序字节数=" + softBytesCalculate +
                "   ç¨‹åºCRC16校验值=" + softByteSrc16 + "\n" +
                "   å‡çº§æŽ§åˆ¶å™¨æ•°é‡=" + rtuAddrList.size() + "\n" +
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
@@ -703,8 +703,7 @@
            // s1不变
            s0 <<= 8;
            s = s0 | s1;
            return (short) s;
            return (short)s ;
        } else {
            throw new Exception("byte2Short时数组越界");
        }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/CRC16.java
@@ -34,7 +34,7 @@
     * @return CRC
     */
    @SuppressWarnings("unused")
    public int CRC(byte[] b, int startIndex, int endIndex) {
    public short CRC(byte[] b, int startIndex, int endIndex) {
        int crc = 0xFFFF;
        for (int j = startIndex ; j <= endIndex; j++) {
            crc = crc ^ ((b[j] + 256) % 256) ;//转换成无符号数,因为终端实现(C语言或汇编语言)都用的是无符号数
@@ -46,7 +46,7 @@
                }
            }
        }
        return crc;
        return (short)crc;
    }
    
    
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/TimerTaskJob.java
New file
@@ -0,0 +1,62 @@
package com.dy.common.util;
import java.util.Timer;
import java.util.TimerTask;
/**
 * @Author: liurunyu
 * @Date: 2024/11/20 17:49
 * @Description :
 * æ­¤æŠ½è±¡ç±»ä»£æ›¿ThreadJob,原因:
 * åœ¨while(true){}中使用Thread.sleep(),可能导致的严重性能问题,不推荐在循环中使用线程休眠。
 * Java线程实现采用内核线程实现,线程的休眠及唤醒(状态切换)需借助操作系统进行,这是一个极其耗时耗力的操作。
 * åœ¨çº¿ç¨‹ä¼‘眠或运行时间较长的情景下,其对性能的影响还不算明显,因为对线程状态的切换并不频繁。
 * ä½†è‹¥çº¿ç¨‹ä¼‘眠及运行的时间都很短(例如毫秒/秒,文中案例就是一个典型案例),
 * ç³»ç»Ÿå°†é¢‘繁的对线程状态进行切换,导致严重的性能损耗,并对着循环次数的递增而放大。
 */
public abstract class TimerTaskJob {
    protected Timer timer;
    protected boolean stop = false ;
    public void stop(){
        this.stop = true ;
        if(this.timer != null){
            this.timer.cancel();
        }
    }
    public boolean isStop(){
        return this.stop ;
    }
    /**
     *
     * @param delay
     * @param interval
     * @param callback
     * @throws Exception
     */
    public void start(Long delay, Long interval, Callback callback) throws Exception {
        this.timer = new Timer();
        this.timer.schedule(new TimerTask() {
            public void run() {
                Exception exe = null ;
                Object obj = null ;
                try {
                    obj = execute() ;
                }catch(Exception e){
                    e.printStackTrace();
                    exe = e ;
                }finally {
                    if(callback != null){
                        if(exe != null){
                            callback.exception(exe);
                        }else{
                            callback.call(obj);
                        }
                    }
                }
            }
        }, delay , interval);
    }
    public abstract Object execute() throws Exception ;
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/TimerTaskJobTest.java
New file
@@ -0,0 +1,48 @@
package com.dy.common.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author: liurunyu
 * @Date: 2024/11/20 18:29
 * @Description
 */
public class TimerTaskJobTest extends TimerTaskJob implements Callback {
    private static int count = 0 ;
    public static void main(String[] args) throws Exception {
        TimerTaskJobTest obj = new TimerTaskJobTest() ;
        obj.start(1000L,  1000L, obj);
    }
    public Object execute() {
        count++ ;
        System.out.println("执行伺服线程" + count + "次");
        if(count == 10) {
            stop() ;
        }
        return true ;
    }
    ////////////////////////////////////////////////////
    //
    // å‡çº§çŠ¶æ€é€šçŸ¥å·¥ä½œçº¿ç¨‹æ‰§è¡Œå®ŒæˆåŽå›žè°ƒçš„æ–¹æ³•ï¼Œ
    // ä¹Ÿå°±æ˜¯ä¸Šé¢execute方法执行完成返回或抛出异常后,执行下面三个方法
    //
    ////////////////////////////////////////////////////
    @Override
    public void call(Object obj) {
        //线程工作执行一次,obj = Boolean(true)
        System.out.println("伺服线程执行一次回调");
    }
    @Override
    public void call(Object... objs) {
    }
    @Override
    public void exception(Exception e) {
        e.printStackTrace();
        System.out.println("伺服线程发生异常" + e.getMessage());
    }
}
pipIrr-platform/pipIrr-global/pom.xml
@@ -124,6 +124,7 @@
            <version>1.5.5.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/ToRtuMwCom.java
@@ -5,6 +5,7 @@
import com.dy.common.mw.protocol.CommandType;
import com.dy.common.softUpgrade.state.UpgradeTaskVo;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -90,8 +91,13 @@
            response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
@@ -114,7 +120,12 @@
            response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoBatteryVolt.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@@ -13,6 +14,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class VoBatteryVolt extends VoIntake {
    /**
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoCumulativeFlow.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@@ -13,6 +14,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class VoCumulativeFlow extends VoIntake {
    /**
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeAccumulateAmount.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author :WuZeYu
@@ -12,6 +13,7 @@
 *                    æ¶ˆè´¹é‡‘额 å¤§äºŽ æŒ‡å®šå€¼
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class VoIntakeAccumulateAmount extends VoIntake{
    private static final long serialVersionUID = 202408051046001L;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java
@@ -2,6 +2,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author :WuZeYu
@@ -11,6 +12,7 @@
 *                ç”¨æ°´æ—¶é•¿ > æŒ‡å®šå€¼  (分钟)
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class VoIntakeOpenCount extends VoIntake{
    private static final long serialVersionUID = 202408051046001L;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoSignalIntensity.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@@ -13,6 +14,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class VoSignalIntensity extends VoIntake {
    /**
     * ä¿¡å·å¼ºåº¦
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voUg/VoRtuProgram.java
@@ -34,9 +34,9 @@
    public String storeRamAddr;
    /**
     * ç¨‹åºè¦†ç›–超始地址(4字节,8位十六进制字符)
     * ç¨‹åºè¦†ç›–起始地址(4字节,8位十六进制字符)
     */
    @Schema(description = "程序覆盖超始地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @Schema(description = "程序覆盖起始地址", requiredMode = Schema.RequiredMode.REQUIRED)
    public String startRamAddr;
    /**
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voUg/VoWatch.java
@@ -28,17 +28,32 @@
        public String rtuAddr ;     //控制器地址
        public Integer rate ;       //进度
        public String state;        //升级状态
        public Integer status;      //过程状态(0:离线,1:升级中,2:升级成功,3升级失败)
        public Integer reTryTimes ; //重试次数
        public boolean over ;       //是否结束(true:是,false:否)
        public boolean success ;    //是否成功(true:是,false:否)
        public Boolean over ;       //是否结束(true:是,false:否)
        public Boolean success ;    //是否成功(null:进行中,true:是,false:否)
        public void fromCache(UpgradeRtu ugRtu){
            this.rtuAddr = ugRtu.rtuAddr ;
            this.rate = (ugRtu.currentPackage * 1000)/ugRtu.totalPackage ;//前端实现是1000份的进度条
            this.state = UpgradeRtu.getStateName(ugRtu.state) ;
            this.status = 1 ;//默认升级中
            if(ugRtu.state == UpgradeRtu.STATE_OFFLINE){
                this.status = 0 ;
            }else if(ugRtu.state == UpgradeRtu.STATE_SUCCESS){
                this.status = 2 ;
            }else {
                if(ugRtu.isOver && ugRtu.state != UpgradeRtu.STATE_SUCCESS){
                    this.status = 3;
                }
            }
            this.reTryTimes = ugRtu.reTryTimes ;
            this.over = ugRtu.isOver ;
            this.success = ugRtu.state == UpgradeRtu.STATE_SUCCESS ? true : false ;
            if(ugRtu.isOver){
                this.success = (ugRtu.state == UpgradeRtu.STATE_SUCCESS ? true : false) ;
            }else{
                this.success = null ;
            }
        }
    }
}
pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml
@@ -5,9 +5,9 @@
            #name: ym
            type: com.alibaba.druid.pool.DruidDataSource
            driverClassName: com.mysql.cj.jdbc.Driver
#            url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
            url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
#            url: jdbc:mysql://8.130.130.233:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
            url: jdbc:mysql://127.0.0.1:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
#            url: jdbc:mysql://127.0.0.1:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
            username: root
            password: dysql,;.abc!@#
            druid:
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml
@@ -313,7 +313,7 @@
    #命令发送地址(中缀是机构tag,其也是数据源后缀名称)
    ym:
        comSendUrl: "http://127.0.0.1:8070/rtuMw/com/send"
        ugTaskSendUrl: "http://127.0.0.1:8070/rtuMw/com/upgradeRtu"
        ugTaskSendUrl: "http://192.168.40.132:8070/rtuMw/com/upgradeRtu"
        rtuLogFileUrl: "http://127.0.0.1:8070/rtuMw/com/rtuLogFile"
        rtuLogTextUrl: "http://127.0.0.1:8070/rtuMw/com/rtuLogText"
    sp:
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java
@@ -336,12 +336,14 @@
            //RTU远程升级模块
            UpgradeUnitConfigVo ugVo = new UpgradeUnitConfigVo();
            ugVo.enable = conf.getSetAttrBoolean(doc, "config.upgrade", "enable", null, null) ;
            ugVo.noOneRtuUpgradeMaxDuration = conf.getSetAttrPlusInt(doc, "config.upgrade", "noOneRtuUpgradeMaxDuration", null, 5, 3600, null);
            ugVo.noOneRtuUpgradeMaxDuration = ugVo.noOneRtuUpgradeMaxDuration * 1000 ;//变成毫秒
            ugVo.failTryTimes = conf.getSetAttrPlusInt(doc, "config.upgrade", "failTryTimes", null, 0, 100, null);
            ugVo.ugMaxRtuAtOnce = conf.getSetAttrPlusInt(doc, "config.upgrade", "ugMaxRtuAtOnce", null, 0, 1000000, null);
            ugVo.rtuOffLineWaitDuration = conf.getSetAttrPlusInt(doc, "config.upgrade", "rtuOffLineWaitDuration", null, 1, 36000, null);
            ugVo.rtuOffLineWaitDuration = ugVo.rtuOffLineWaitDuration + 1000;//变成毫秒
            ugVo.rtuOffLineWaitDuration = ugVo.rtuOffLineWaitDuration * 1000;//变成毫秒
            ugVo.notifyStateInterval = conf.getSetAttrPlusInt(doc, "config.upgrade", "notifyStateInterval", null, 1, 300, null);
            ugVo.notifyStateInterval = ugVo.notifyStateInterval + 1000;//变成毫秒
            ugVo.notifyStateInterval = ugVo.notifyStateInterval * 1000;//变成毫秒
            ugVo.showStartInfo = showStartInfo ;
            AdapterImp_UpgradeUnit ugAdap = new AdapterImp_UpgradeUnit();
            ugAdap.setConfig(ugVo);
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java
@@ -7,19 +7,19 @@
import com.dy.common.springUtil.SpringContextUtil;
import com.dy.common.util.Callback;
import com.dy.common.util.DateTime;
import com.dy.common.util.ThreadJob;
import com.dy.common.util.TimerTaskJob;
import com.dy.rtuMw.web.webRequest.WebRequestDeal;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.List;
/**
 * @Author: liurunyu
 * @Date: 2024/11/4 16:03
 *  å‡çº§ç®¡ç†ç±»
 * @Author liurunyu
 * @Date 2024/11/4 16:03
 * @Description
 */
public class UpgradeManager extends ThreadJob implements Callback {
public class UpgradeManager extends TimerTaskJob implements Callback {
    private static final Logger log = LogManager.getLogger(UpgradeManager.class.getName());
@@ -29,8 +29,11 @@
    private Integer ugMaxRtuSameTime ;//同时升级RTU最大个数
    private UpgradeTask task ;//升级任务
    private boolean monitorFirst = true ;//是否是第一次监视
    private UpgradeManager(){}
    private UpgradeManager(){
        monitorFirst = true ;
    }
    public static UpgradeManager getInstance() {
        return UpgradeManager.INSTANCE;
@@ -47,25 +50,40 @@
    /**
     * è®¾ç½®å‡çº§ä»»åŠ¡
     * @param vo UpgradeTaskVo å‡çº§ä»»åŠ¡å¯¹è±¡
     * @throws Exception
     * @throws Exception å¼‚常
     */
    public void setUpgradeTask(UpgradeTaskVo vo) throws Exception {
        if(this.task != null && !this.task.taskIsOver){
            throw new Exception("当前存在升级任务,请等待当前任务执行完或强制结束当前任务");
        }else {
            this.task.forceOver();
            this.task = new UpgradeTask();
            this.task.initOption(this.failTryTimes, this.ugMaxRtuSameTime);
            this.task.setTask(vo);
            this.start(this);
            Exception ex = null ;
            try{
                if(this.task != null){
                    this.task.forceOver();
                }
                this.task = new UpgradeTask();
                this.task.initOption(this.failTryTimes, this.ugMaxRtuSameTime);
                this.task.setTask(vo);
            }catch (Exception e){
                ex = e ;
            }finally {
                if(ex != null){
                    this.task = null ;
                    throw ex ;
                }else{
                    this.start(1000L, (long) UpgradeUnit.confVo.notifyStateInterval, this);
                }
            }
        }
    }
    /**
     * ç»“束当前升级任务
     * @throws Exception
     * å¼ºåˆ¶ç»“束当前升级任务,
     * æ­¤åŠŸèƒ½å¯èƒ½ä¸ä¼šå¼€æ”¾å‡ºåŽ»ï¼Œ
     * å› ä¸ºå¼ºåˆ¶ç»“束升级任务,对一个未升级完成的RTU就会卡死,
     * æ‰€ä»¥å½“强制结束升级任务,代码逻辑并没有强制结果RTU升级过程,如果升级过程也强制停止,那么RTU真会卡死
     */
    public void overUpgradeTask() throws Exception {
    public void forceOverUpgradeTask() {
        if(this.task != null){
            this.stop();
            this.task.forceOver();
@@ -75,11 +93,11 @@
    /**
     * RTU有上行数据了,触发下发升级数据
     * @param rtuAddr
     * @param code
     * @param protocolName
     * @param protocolVersion
     * @param callbackCom
     * @param rtuAddr æŽ§åˆ¶å™¨RTU地址
     * @param code ä¸Šè¡Œæ•°æ®åŠŸèƒ½ç 
     * @param protocolName ä¸Šè¡Œæ•°æ®å¯¹åº”的协议名称
     * @param protocolVersion ä¸Šè¡Œæ•°æ®å¯¹åº”的协议版本号
     * @param callbackCom å›žè°ƒå‡½æ•°ï¼Œå¤„理下行命令
     */
    public void trigger(String rtuAddr, String code, String protocolName, Short protocolVersion, Callback callbackCom){
        if(task != null && !task.taskIsOver){
@@ -94,7 +112,7 @@
    ////////////////////////////////////////////////////
    /**
     * å½“前升级状态
     * @return
     * @return å½“前升级状态
     */
    public UpgradeState currentUpgradeState() {
        if(task != null){
@@ -106,9 +124,10 @@
    /**
     * Rtu升级信息
     * @param rtuAddr
     * @return
     * @param rtuAddr æŽ§åˆ¶å™¨RTU地址
     * @return æŽ§åˆ¶å™¨RTU升级状态
     */
    @SuppressWarnings("unused")
    public UpgradeRtu upgradeRtuInfo(String rtuAddr){
        if(task != null){
            return task.upgradeInfos(rtuAddr) ;
@@ -119,9 +138,10 @@
    /**
     * Rtu升级信息
     * @param rtuAddrList
     * @return
     * @param rtuAddrList æŽ§åˆ¶å™¨åœ°å€åˆ—表
     * @return æŒ‡å®šåˆ—表中的控制器RTU升级状态
     */
    @SuppressWarnings("unused")
    public List<UpgradeRtu> upgradeRtuInfos(List<String> rtuAddrList){
        if(task != null){
            return task.upgradeInfos(rtuAddrList) ;
@@ -132,8 +152,8 @@
    /**
     * Rtu升级信息
     * @return
     * æ‰€æœ‰Rtu升级信息
     * @return æ‰€æœ‰Rtu升级信息
     */
    public List<UpgradeRtu> upgradeRtuInfoAll(){
        if(task != null){
@@ -150,70 +170,64 @@
    // ç»Ÿè®¡çŠ¶æ€ + çŠ¶æ€é€šçŸ¥
    //
    ////////////////////////////////////////////////////
    @Override
    public Object execute() throws Exception {
        boolean first = true ;
        while (true){
            if(this.isStop()){
                break ;
            }
            if(first){
                try{
                    //首次启动,停1秒
                    Thread.sleep(1000L);
                }catch (Exception e){
                }
            }else{
                try{
                    //停X毫秒
                    Thread.sleep(UpgradeUnit.confVo.notifyStateInterval);
                }catch (Exception e){
                }
            }
            if(this.task == null
                    || this.task.taskVo == null
                    || this.task.taskVo.rtuAddrList == null
                    || this.task.taskVo.rtuAddrList.size() == 0){
                //任务为空
                break ;
            }else{
                if(!this.task.taskIsOver){
                    //升级任务未完成
                    //工作1:统计当前正在升级的RTU数量,为受限同时升级数量做准备
                    this.task.statisticsRunningRtuCount() ;
                    //工作2:统计需要升级但当前离线RTU的情况
                    this.task.statisticsOffRtuCountAndSet() ;
                    //工作3:统计是否全部升级完成
                    this.task.taskIsOver = this.task.statisticsIsAllOver() ;
                    if(this.task.taskIsOver){
                        if(!this.task.taskOverType.equals(UpgradeTask.TaskOverType_Force)){
                            //任务不是强制结束的
                            this.task.taskOverType = UpgradeTask.TaskOverType_Natural ;//任务完成方式(自然,强制)
                            this.task.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//任务完成时间(yyyy-mm-dd HH:MM:SS)
                        }
                        //任务完成,执行最后一次升级状态通知
                        //工作4:升级状态通知
                        if(!first){
                            this.notifyUpgradeStatus() ;
                        }
                    }else{
                        //任务未完成,继续执行升级状态通知
                        //工作4: å‡çº§çŠ¶æ€é€šçŸ¥
                        if(!first){
                            this.notifyUpgradeStatus() ;
                        }
                    }
                }else{
    public Object execute() {
        if(this.task == null
                || this.task.taskVo == null
                || this.task.taskVo.rtuAddrList == null
                || this.task.taskVo.rtuAddrList.size() == 0){
            //任务为空
            this.stop() ;
        }else{
            if(!this.task.taskIsOver){
                //升级任务未完成
                //工作1:判断是否无任何一个RTU进行过升级,并且达到时限,则认为当前升级任务完成
                //-1:无一RTU升级且超时,0:无RTU升级但未超时等待,1有RTU升级正常执行
                int temp = this.task.countNoOneRtuUpgradeInDuration() ;
                if(temp == -1){
                    this.task.taskIsOver = true ;
                    //任务已经完成
                    this.stop();
                }else if(temp == 1){
                    //工作2:统计当前正在升级的RTU数量,为同时升级数量限制做准备
                    this.task.countRunningRtuCount() ;
                    //工作3:统计需要升级但当前离线RTU的情况,超过时限的设备为升级完成
                    this.task.countOffRtuAndSetIfOver() ;
                    //工作4:统计是否全部升级完成
                    this.task.taskIsOver = this.task.countIsAllOver() ;
                }else if(temp == 0){
                    //不作为
                }
                if(this.task.taskIsOver){
                    if(!this.task.taskOverType.equals(UpgradeTask.TaskOverType_Force)){
                        //任务不是强制结束的
                        this.task.taskOverType = UpgradeTask.TaskOverType_Natural ;//任务完成方式(自然,强制)
                        this.task.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//任务完成时间(yyyy-mm-dd HH:MM:SS)
                    }
                    //任务完成,执行最后一次升级状态通知
                    //工作5:升级状态通知
                    //if(!first){
                    //    this.notifyUpgradeStatus() ;
                    //}
                }else{
                    //任务未完成,继续执行升级状态通知
                    //工作5: å‡çº§çŠ¶æ€é€šçŸ¥
                    //if(!first){
                    //    this.notifyUpgradeStatus() ;
                    //}
                }
                //工作5:升级状态通知
                if(!this.monitorFirst){
                    this.notifyUpgradeStatus() ;
                }
            }else{
                //任务已经完成
                this.stop();
            }
            if(first){
                first = false ;
            }
        }
        if(this.monitorFirst){
            this.monitorFirst = false ;
        }
        return true ;
    }
@@ -241,7 +255,6 @@
    @Override
    public void call(Object obj) {
        //线程工作执行完了,obj = Boolean(true)
        this.thread = null ;//赋值为null,使线程对象被垃圾回收器回收
    }
    @Override
    public void call(Object... objs) {
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeRtuDev.java
@@ -5,9 +5,11 @@
import com.dy.common.mw.protocol.CommandType;
import com.dy.common.softUpgrade.Com1601Vo;
import com.dy.common.softUpgrade.state.UpgradeRtu;
import com.dy.common.softUpgrade.state.UpgradeTaskVo;
import com.dy.common.util.Callback;
import com.dy.common.util.DateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @Author: liurunyu
@@ -15,17 +17,22 @@
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class UpgradeRtuDev extends UpgradeRtu {
    @JSONField(serialize = false)
    private UpgradeTask task ;
    private Integer failTryTimes ;//升级失败后,重新偿试升级次数,0表示不重新偿试升级
    @JSONField(serialize = false)
    public UpgradeTaskVo taskVo ;//升级任务值对象
    private UpgradeRtuDev(){
    }
    public UpgradeRtuDev(UpgradeTask task, String rtuAddr, int totalPackage) {
    public UpgradeRtuDev(UpgradeTaskVo taskVo, Integer failTryTimes , String rtuAddr, int totalPackage) {
        super();
        this.task = task ;
        this.taskVo = taskVo ;
        this.failTryTimes = failTryTimes ;
        this.rtuAddr = rtuAddr ;
        this.state = STATE_UNSTART ;
        this.totalPackage = totalPackage ;
@@ -36,9 +43,10 @@
        this.isOver = false ;
    }
    public UpgradeRtuDev(UpgradeTask task, String rtuAddr, int totalPackage, int state) {
    public UpgradeRtuDev(UpgradeTaskVo taskVo, Integer failTryTimes, String rtuAddr, int totalPackage, int state) {
        super();
        this.task = task ;
        this.taskVo = taskVo ;
        this.failTryTimes = failTryTimes ;
        this.rtuAddr = rtuAddr ;
        this.state = state ;
        this.totalPackage = totalPackage ;
@@ -57,73 +65,90 @@
     */
    @Override
    public void trigger(String code, String protocolName, Short protocolVersion, byte[][] softData, Callback callbackCom){
        if(this.state == STATE_OFFLINE || this.state == STATE_UNSTART){
            //当前未开始升级过程,下发升级配置指令
            this.setStateAtCom1601Time();
            callbackCom.call(createCommand1601(protocolName, protocolVersion));
        }else if(this.state == STATE_RUNNING){
            //当前升级过程中
            if(code.equals(UpgradeCode.cd_1601)){
                //下发配置返回
                this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                callbackCom.call(createCommand1602(protocolName, protocolVersion, currentPackage, currentRamAddr, softData));//下发数据包指令
            }else if(code.equals(UpgradeCode.cd_1602)){
                //下发数据包返回
                currentPackage++ ;
                currentRamAddr += RAMADDRADD ;
                if(currentPackage < totalPackage){
        if(!this.isOver){
            //升级未完成
            if(this.state == STATE_OFFLINE || this.state == STATE_UNSTART){
                //当前未开始升级过程,下发升级配置指令
                this.setStateAtSendCom1601Time();
                callbackCom.call(createCommand1601(protocolName, protocolVersion));
            }else if(this.state == STATE_RUNNING){
                //当前升级过程中
                if(code.equals(UpgradeCode.cd_9601)){
                    //下发配置返回
                    this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                    callbackCom.call(createCommand1602(protocolName, protocolVersion, currentPackage, currentRamAddr, softData));
                }else{
                    this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                    callbackCom.call(createCommand1603(protocolName, protocolVersion));//下发校验指令
                }
            }else if(code.equals(UpgradeCode.cd_1603)){
                //下发校验返回
                this.isOver = true ;//升级完成
                this.state = STATE_SUCCESS ;
                this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                callbackCom.call(createCommand1600(protocolName, protocolVersion));//下发复位指令,此指令无应答
            }else{
                if(!this.isOver){
                    //升级未完成
                    if(this.state == STATE_FAILONE || this.state == STATE_FAIL){
                        //已经是升级失败态
                        if(this.reTryTimes < task.failTryTimes){
                            //重试次数未达到上限,继续重试
                            this.reTryTimes += 1 ;
                            this.setStateAtCom1601Time();
                            callbackCom.call(createCommand1601(protocolName, protocolVersion));//下发配置指令
                        }else{
                            this.isOver = true ;//升级完成
                        }
                    callbackCom.call(createCommand1602(protocolName, protocolVersion, currentPackage, currentRamAddr, softData));//下发数据包指令
                }else if(code.equals(UpgradeCode.cd_9602)){
                    //下发数据包返回
                    currentPackage++ ;
                    currentRamAddr += RAMADDRADD ;
                    if(currentPackage < totalPackage){
                        this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                        callbackCom.call(createCommand1602(protocolName, protocolVersion, currentPackage, currentRamAddr, softData));
                    }else{
                        //非升级功能码,如果在升级过程中收到这个功能码的上行数据,说明升级失败了
                        if(currentPackage == 0 || currentPackage == 1){
                            //1包死,升级失败
                            this.state = STATE_FAILONE ;
                        }else{
                            //非1包死,升级失败
                            this.state = STATE_FAIL ;
                        }
                        this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                        callbackCom.call(createCommand1603(protocolName, protocolVersion));//下发校验指令
                    }
                }else if(code.equals(UpgradeCode.cd_9603)){
                    //下发校验返回
                    this.setStateAtReceiveRes9603Time() ;
                    callbackCom.call(createCommand1600(protocolName, protocolVersion));//下发复位指令,此指令无应答
                }else{
                    //升级完成,无业务逻辑
                    //当前是升级中状态,并且升级未完成,收到了非960X系列功能码,则升级失败
                    if(currentPackage == 0 || currentPackage == 1){
                        //1包死,升级失败
                        this.state = STATE_FAILONE ;
                    }else{
                        //非1包死,升级失败
                        this.state = STATE_FAIL ;
                    }
                }
            }else if(this.state == STATE_FAILONE || this.state == STATE_FAIL){
                //上次设置了失败状态,并且升级未完成,收到了非960X系列功能码,则升级失败
                if(this.reTryTimes < this.failTryTimes){
                    //重试次数未达到上限,继续重试
                    this.reTryTimes += 1 ;
                    this.setStateAtSendCom1601Time();
                    callbackCom.call(createCommand1601(protocolName, protocolVersion));//下发配置指令
                }else{
                    //升级失败,并且重试次数达到上限,强制设置升级完成
                    this.isOver = true ;
                }
            }else if(this.state == STATE_SUCCESS){
                //升级成功态,不会出现此情况,因为设置为成功态时,升级结束属性isOver设置为true了
                //为安全见,这里再设置为结束态
                this.isOver = true ;
            }else if(this.state == STATE_FAILOFFLINE){
                //已经被其他逻辑模块强制设置成离线失败态了,不会出现此情况,因为设置为离线失败态时,升级结束属性isOver设置为true了
                //这里不再有作为
                //为安全见,这里再设置为结束态
                this.isOver = true ;
            }else{
                //其他状态(没有其他态了,除非再设计开发时增加了状态)
                //为安全见,这里再设置为结束态
                this.isOver = true ;
            }
        }else{
            //在其他状态下,不触发任务工作
            //升级完成,无业务逻辑
        }
    }
    /**
     * è®¾ç½®å‘送配置命令时刻的状态
     */
    private void setStateAtCom1601Time(){
        this.state = STATE_RUNNING;
    private void setStateAtSendCom1601Time(){
        this.state = STATE_RUNNING;//升级进行中
        this.currentPackage = 0 ;
        this.currentRamAddr = 0 ;
        this.isOver = false ;
        this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
    }
    /**
     * è®¾ç½®1603指令返回时刻的状态
     */
    private void setStateAtReceiveRes9603Time(){
        this.isOver = true ;//升级完成
        this.state = STATE_SUCCESS ;
        this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
    }
@@ -139,10 +164,10 @@
        com.rtuResultSendWebUrl = Command.ignoreRtuResultSendWebUrl ;
        Com1601Vo vo = new Com1601Vo() ;
        vo.softStoreAddr = this.task.taskVo.softStoreAddr ;
        vo.softStartAddr = this.task.taskVo.softStartAddr ;
        vo.totalByte =  this.task.taskVo.softBytesCalculate ;
        vo.softCrc = this.task.taskVo.softByteSrc16;
        vo.softStoreAddr = this.taskVo.softStoreAddr ;
        vo.softStartAddr = this.taskVo.softStartAddr ;
        vo.totalByte =  this.taskVo.softBytesCalculate ;
        vo.softCrc = this.taskVo.softByteSrc16;
        com.param = vo ;
        return com ;
    }
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java
@@ -8,8 +8,11 @@
import com.dy.common.util.Callback;
import com.dy.common.util.DateTime;
import lombok.Data;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
 * @Author: liurunyu
@@ -18,6 +21,8 @@
 */
@Data
public class UpgradeTask {
    private static final Logger log = LogManager.getLogger(UpgradeTask.class.getName());
    protected static final String TaskOverType_Natural = "自然" ;
    protected static final String TaskOverType_Force = "强制" ;
@@ -37,7 +42,7 @@
    protected byte[][] softFileDataGrp ;//以512字节为单位把升级程序数据分组
    @JSONField(serialize = false)
    protected Map<String, UpgradeRtu> upgradeRtus;//升级状态
    protected ConcurrentHashMap<String, UpgradeRtu> upgradeRtus;//升级状态
    public boolean taskIsOver = false ;//任务是否完成
    public String taskOverType = "" ;//任务完成方式(自然,强制)
@@ -76,7 +81,7 @@
        if(taskVo.softStartAddr == null || taskVo.softStartAddr.trim().length() != 8){
            throw new Exception("程序覆盖起始地址不合法,必须是8字符(十六进制)的字符串") ;
        }
        if(taskVo.softFileData == null || taskVo.softFileData.length <= 0){
        if(taskVo.softFileData64 == null || taskVo.softFileData64.trim().length() == 0){
            throw new Exception("升级程序内容必须提供") ;
        }
        if(taskVo.softBytesCalculate == null){
@@ -95,14 +100,19 @@
        this.setupDtLong = System.currentTimeMillis() ;
        this.taskVo = taskVo ;
        this.upgradeRtus = new HashMap<>();
        if(taskVo.softFileData != null && taskVo.softFileData.length >0){
        this.upgradeRtus = new ConcurrentHashMap<>();
        if(taskVo.softFileData64 != null && !taskVo.softFileData64.trim().equals("")){
            taskVo.softFileData = Base64.getDecoder().decode(taskVo.softFileData64);
            List<byte[]> listBytes = new HexFileParse().splitBytesByUnit512(taskVo.softFileData);
            this.softFileDataGrp = listBytes.toArray(new byte[0][]);
            for(String rtuAddr : this.taskVo.rtuAddrList){
                //此时状态设置成离线状态
                UpgradeRtuDev ugRtu = new UpgradeRtuDev(this, rtuAddr, this.softFileDataGrp.length, UpgradeRtuDev.STATE_OFFLINE) ;
                this.upgradeRtus.put(rtuAddr, ugRtu) ;
            try{
                for(String rtuAddr : this.taskVo.rtuAddrList){
                    //此时状态设置成离线状态
                    UpgradeRtuDev ugRtu = new UpgradeRtuDev(this.taskVo, this.failTryTimes, rtuAddr, this.softFileDataGrp.length, UpgradeRtuDev.STATE_OFFLINE) ;
                    this.upgradeRtus.put(rtuAddr, ugRtu) ;
                }
            }catch (Exception e){
                log.error(e);
            }
        }
    }
@@ -120,7 +130,7 @@
                //根据方法setTask的逻辑,只要RTU在升级之列,此处ugRtuState一定不为null
                //为保险,实现下面逻辑
                if(taskVo.rtuAddrList.contains(rtuAddr)){
                    ugRtu = new UpgradeRtuDev(this, rtuAddr, this.taskVo.softFileData.length) ;
                    ugRtu = new UpgradeRtuDev(this.taskVo, this.failTryTimes, rtuAddr, this.taskVo.softFileData.length) ;
                    upgradeRtus.put(rtuAddr, ugRtu) ;
                }else{
                    //rtu不在升级之列
@@ -174,11 +184,13 @@
     * å¼ºåˆ¶ç»“束升级任务
     */
    public void forceOver(){
        this.taskIsOver = true ;//强制设置任务完成
        this.taskOverType = TaskOverType_Force ;//任务完成方式(自然,强制)
        this.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//任务完成时间(yyyy-mm-dd HH:MM:SS)
        //this.taskVo.rtuAddrList.clear();
        //this.upgradeState.clear();
        if(!this.taskIsOver){
            this.taskIsOver = true ;//强制设置任务完成
            this.taskOverType = TaskOverType_Force ;//任务完成方式(自然,强制)
            this.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//任务完成时间(yyyy-mm-dd HH:MM:SS)
            //this.taskVo.rtuAddrList.clear();
            //this.upgradeState.clear();
        }
    }
    /**
@@ -190,8 +202,7 @@
        if(this.taskVo.rtuAddrList != null && this.taskVo.rtuAddrList.size() > 0){
            state.rtuTotal = this.taskVo.rtuAddrList.size() ;
            if(this.upgradeRtus != null && this.upgradeRtus.size() > 0){
                Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
                for(UpgradeRtu info : col){
                this.upgradeRtus.values().stream().forEach(info ->{
                    if(info.state == UpgradeRtu.STATE_OFFLINE){
                        state.offLineTotal ++ ;
                    }else if(info.state == UpgradeRtu.STATE_UNSTART){
@@ -200,16 +211,19 @@
                        state.runningTotal ++ ;
                    }else if(info.state == UpgradeRtu.STATE_SUCCESS) {
                        state.successTotal++;
                    }else if(info.state == UpgradeRtu.STATE_FAIL) {
                        state.failTotal++;
                    }else if(info.state == UpgradeRtu.STATE_FAILONE) {
                        state.failOneTotal++;
                        state.failTotal++;
                    }else if(info.state == UpgradeRtu.STATE_FAIL) {
                    }else if(info.state == UpgradeRtu.STATE_FAILOFFLINE) {
                        state.failTotal++;
                        state.failOffTotal++;
                    }
                    if(info.isOver){
                        state.overTotal++;
                    }
                }
                });
            }
        }
        return state ;
@@ -254,10 +268,38 @@
    ///////////////////////////////////////////////////////////
    //以下方法为内部服务,不对外提供服务
    ///////////////////////////////////////////////////////////
    /**
     * ç»Ÿè®¡å½“前正在升级的RTU数量,为受限同时升级数量做准备
     * åˆ¤æ–­æ˜¯å¦æ²¡ç”¨ä»»ä½•一个RTU进行过升级,而且超过了时限
     * @return -1:无一RTU升级且超时,0:无RTU升级但未超时等待,1有RTU升级正常执行
     */
    protected void statisticsRunningRtuCount(){
    protected int countNoOneRtuUpgradeInDuration(){
        if(this.upgradeRtus == null || upgradeRtus.size() == 0){
            //当前没有任何一个设备进行过升级
            Long now = System.currentTimeMillis() ;
            if(now - this.setupDtLong > UpgradeUnit.confVo.noOneRtuUpgradeMaxDuration){
                return -1 ;
            }
        }else{
            Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
            for(UpgradeRtu info : col){
                if(info.currentPackage > 0){
                    //当前有设备进行过升级
                    return 1 ;
                }
            }
            Long now = System.currentTimeMillis() ;
            if(now - this.setupDtLong > UpgradeUnit.confVo.noOneRtuUpgradeMaxDuration){
                return -1 ;
            }
        }
        return 0 ;
    }
    /**
     * ç»Ÿè®¡å½“前正在升级的RTU数量,为同时升级数量限制做准备
     */
    protected void countRunningRtuCount(){
        int runningTotal = 0 ;
        Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
        for(UpgradeRtu info : col){
@@ -269,9 +311,9 @@
    }
    /**
     * ç»Ÿè®¡éœ€è¦å‡çº§ä½†å½“前离线RTU的情况
     * ç»Ÿè®¡éœ€è¦å‡çº§ä½†å½“前离线RTU的情况,超过时限的设备为升级完成
     */
    protected void statisticsOffRtuCountAndSet() {
    protected void countOffRtuAndSetIfOver() {
        Long now = System.currentTimeMillis() ;
        if(now - this.setupDtLong > UpgradeUnit.confVo.rtuOffLineWaitDuration){
            //rtu离线,等待其升级的时长(毫秒),超过配置的最大时长,设置其升级失败,且设置升级任务完成
@@ -290,7 +332,7 @@
    /**
     * ç»Ÿè®¡æ˜¯å¦å‡çº§å…¨éƒ¨ç»“束
     */
    protected boolean statisticsIsAllOver() {
    protected boolean countIsAllOver() {
        if (this.taskVo.rtuAddrList != null && this.taskVo.rtuAddrList.size() > 0) {
            Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
            for(UpgradeRtu info : col){
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeUnit.java
@@ -78,7 +78,7 @@
     */
    public void overUpgradeTask() throws Exception {
        if(manager != null ){
            manager.overUpgradeTask() ;
            manager.forceOverUpgradeTask() ;
        }
    }
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeUnitConfigVo.java
@@ -9,6 +9,7 @@
    public Boolean showStartInfo ;
    public Boolean enable ;//模块是否启动
    public Integer noOneRtuUpgradeMaxDuration ;//升级任务设置后,没有设备升级最大时长(毫秒),超过这个时长,认为升级任务完成,取值范围是5分钟~60分钟
    public Integer failTryTimes ;//升级失败后(针对的是在线进行了升级下发命令),重新偿试升级次数,0表示不重新偿试升级
    public Integer ugMaxRtuAtOnce;//为了缓解通信中间件的压力,同时支持升级的RTU台数
    public Integer rtuOffLineWaitDuration;//rtu离线,等待其升级的时长(毫秒),超过这个时间,设置其升级失败,且设置升级任务完成
@@ -16,6 +17,7 @@
    public UpgradeUnitConfigVo(){
        this.enable = false ;
        this.noOneRtuUpgradeMaxDuration = 10 * 60 * 1000 ;
        this.failTryTimes = 0 ;
        this.ugMaxRtuAtOnce = Integer.MAX_VALUE ;
        this.rtuOffLineWaitDuration = 10 * 60 * 60 * 1000 ;
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/comResult/CommandResultDeal.java
@@ -1,7 +1,9 @@
package com.dy.rtuMw.web.comResult;
import com.dy.common.contant.Constant;
import com.dy.common.mw.protocol.Command;
import com.dy.common.mw.protocol.Data;
import com.dy.rtuMw.server.ServerProperties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +19,7 @@
 * @Author liurunyu
 * @Date 2023/12/21 20:28
 * @LastEditTime 2023/12/21 20:28
 * @Description
 * @Description é€šä¿¡ä¸­é—´ä»¶å¯¹å¤–进行web调用,把命令结果发送出去
 */
@Component()
public class CommandResultDeal {
@@ -41,6 +43,7 @@
            restTemplate.getMessageConverters().set(1,new StringHttpMessageConverter(StandardCharsets.UTF_8));
            HttpHeaders headers = new HttpHeaders();
            headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
            headers.set(Constant.UserTokenKeyInHeader, ServerProperties.orgTag);
            HttpEntity<?> httpEntity = new HttpEntity<>(data, headers);
            ResponseEntity<WebResponseVo> response = null;
            try {
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/webRequest/WebRequestDeal.java
@@ -1,7 +1,9 @@
package com.dy.rtuMw.web.webRequest;
import com.dy.common.contant.Constant;
import com.dy.common.mw.protocol.Command;
import com.dy.common.webUtil.BaseResponse;
import com.dy.rtuMw.server.ServerProperties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,6 +47,7 @@
            restTemplate.getMessageConverters().set(1,new StringHttpMessageConverter(StandardCharsets.UTF_8));
            HttpHeaders headers = new HttpHeaders();
            headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
            headers.set(Constant.UserTokenKeyInHeader, ServerProperties.orgTag);
            HttpEntity<?> httpEntity = new HttpEntity<>(obj, headers);
            ResponseEntity<BaseResponse> response = null;
            try {
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config(spɳÅÌ).xml
@@ -24,22 +24,22 @@
    sendDingDingAlarmMsInterval: æœ‰æŠ¥è­¦å‘生时,向钉钉发送消息的间隔时长(分钟)
     -->
    <base
        orgTag="sp"
        isLowPower="false"
        onlyDealRtus=""
        onlyOneProtocol="false"
        downComandMaxResendTimes="1"
        commandSendInterval="10"
        cachWaitResultTimeout="120"
        offLineCachTimeout="86400"
        lastUpDataTimeLive="500"
        dbDataIdSuffix="0"
        cacheUpDownDataWarnCount="100000"
        cacheUpDownDataMaxCount="110000"
        disconnectedByNoUpDataMinutes="3"
        workReportDealOneByTimes="5"
        intakeAlarmLossMinValue="1.0"
        sendDingDingAlarmMsInterval="60"
            orgTag="sp"
            isLowPower="false"
            onlyDealRtus=""
            onlyOneProtocol="false"
            downComandMaxResendTimes="1"
            commandSendInterval="3"
            cachWaitResultTimeout="120"
            offLineCachTimeout="86400"
            lastUpDataTimeLive="500"
            dbDataIdSuffix="0"
            cacheUpDownDataWarnCount="100000"
            cacheUpDownDataMaxCount="110000"
            disconnectedByNoUpDataMinutes="3"
            workReportDealOneByTimes="5"
            intakeAlarmLossMinValue="1.0"
            sendDingDingAlarmMsInterval="60"
    />
    <!--
@@ -49,19 +49,21 @@
    synchroRtuClockTimepieces:当RTU与服务器时钟相差一定毫秒(配置文件是秒钟)后,进行校时
     -->
    <protocol
        centerAddr="1"
        synchroRtuClock="true"
        synchroRtuClockTimepieces="300000"
            centerAddr="1"
            synchroRtuClock="true"
            synchroRtuClockTimepieces="300000"
    />
    <!-- RTU è½¯ä»¶å‡çº§
    enable: æ¨¡å—是否启动
    noOneRtuUpgradeMaxDuration:升级任务设置后,无一设备升级最大时长(秒),超过这个时长,认为升级任务完成,取值范围是5分钟~60分钟
    failTryTimes:升级失败后(针对的是在线进行了升级下发命令),重新偿试升级次数,当设置为0时表示不重新偿试升级
    ugMaxRtuAtOnce:为了缓解通信中间件的压力,同时支持升级的RTU台数,当设置为0时表示不受限制
    rtuOffLineWaitDuration: rtu离线,等待其升级的时长(秒),超过这个时间,设置其升级失败,且设置升级任务完成
    notifyStateInterval: å‡çº§çŠ¶æ€é€šçŸ¥é—´éš”ï¼ˆç§’ï¼‰
    -->
    <upgrade enable="true"
             noOneRtuUpgradeMaxDuration="600"
             failTryTimes="1"
             ugMaxRtuAtOnce="1000"
             rtuOffLineWaitDuration="1200"
@@ -83,15 +85,15 @@
    enableThreadPool:是否启用线程池
     -->
    <support
        short_maxThread="6"
        short_minThread="6"
        short_freeTimeout="60"
        short_busyTimeout="5"
        long_maxThread="6"
        long_minThread="6"
        long_freeTimeout="60"
        long_busyTimeout="-1"
        enableThreadPool="true"
            short_maxThread="6"
            short_minThread="6"
            short_freeTimeout="60"
            short_busyTimeout="5"
            long_maxThread="6"
            long_minThread="6"
            long_freeTimeout="60"
            long_busyTimeout="-1"
            enableThreadPool="true"
    />
    <!--
@@ -103,11 +105,11 @@
    saveDbInterval:Rtu状态存数据库间隔(分钟)
     -->
    <resource
        rtuLogDir="rtuLogs/"
        rtuLogFileMaxSize="100000"
        rtuLogFileMaxCount="2"
        monitorInterval="2"
        saveDbInterval="10"
            rtuLogDir="rtuLogs/"
            rtuLogFileMaxSize="100000"
            rtuLogFileMaxCount="2"
            monitorInterval="2"
            saveDbInterval="10"
    />
@@ -128,10 +130,10 @@
    queueMaxSize: ç¼“存队列节点数最大数量
     -->
    <core
        sleepBigBusy="100"
        sleepSmallBusy="500"
        queueWarnSize="100000"
        queueMaxSize="300000"
            sleepBigBusy="100"
            sleepSmallBusy="500"
            queueWarnSize="100000"
            queueMaxSize="300000"
    />
    <!--
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config(test²âÊÔ).xml
@@ -24,22 +24,22 @@
    sendDingDingAlarmMsInterval: æœ‰æŠ¥è­¦å‘生时,向钉钉发送消息的间隔时长(分钟)
     -->
    <base
        orgTag="test"
        isLowPower="false"
        onlyDealRtus=""
        onlyOneProtocol="false"
        downComandMaxResendTimes="1"
        commandSendInterval="10"
        cachWaitResultTimeout="120"
        offLineCachTimeout="86400"
        lastUpDataTimeLive="500"
        dbDataIdSuffix="0"
        cacheUpDownDataWarnCount="100000"
        cacheUpDownDataMaxCount="110000"
        disconnectedByNoUpDataMinutes="3"
        workReportDealOneByTimes="5"
        intakeAlarmLossMinValue="1.0"
        sendDingDingAlarmMsInterval="60"
            orgTag="test"
            isLowPower="false"
            onlyDealRtus=""
            onlyOneProtocol="false"
            downComandMaxResendTimes="1"
            commandSendInterval="3"
            cachWaitResultTimeout="120"
            offLineCachTimeout="86400"
            lastUpDataTimeLive="500"
            dbDataIdSuffix="0"
            cacheUpDownDataWarnCount="100000"
            cacheUpDownDataMaxCount="110000"
            disconnectedByNoUpDataMinutes="3"
            workReportDealOneByTimes="5"
            intakeAlarmLossMinValue="1.0"
            sendDingDingAlarmMsInterval="60"
    />
    <!--
@@ -49,19 +49,21 @@
    synchroRtuClockTimepieces:当RTU与服务器时钟相差一定毫秒(配置文件是秒钟)后,进行校时
     -->
    <protocol
        centerAddr="1"
        synchroRtuClock="true"
        synchroRtuClockTimepieces="300000"
            centerAddr="1"
            synchroRtuClock="true"
            synchroRtuClockTimepieces="300000"
    />
    <!-- RTU è½¯ä»¶å‡çº§
    enable: æ¨¡å—是否启动
    noOneRtuUpgradeMaxDuration:升级任务设置后,无一设备升级最大时长(秒),超过这个时长,认为升级任务完成,取值范围是5分钟~60分钟
    failTryTimes:升级失败后(针对的是在线进行了升级下发命令),重新偿试升级次数,当设置为0时表示不重新偿试升级
    ugMaxRtuAtOnce:为了缓解通信中间件的压力,同时支持升级的RTU台数,当设置为0时表示不受限制
    rtuOffLineWaitDuration: rtu离线,等待其升级的时长(秒),超过这个时间,设置其升级失败,且设置升级任务完成
    notifyStateInterval: å‡çº§çŠ¶æ€é€šçŸ¥é—´éš”ï¼ˆç§’ï¼‰
    -->
    <upgrade enable="true"
             noOneRtuUpgradeMaxDuration="600"
             failTryTimes="1"
             ugMaxRtuAtOnce="1000"
             rtuOffLineWaitDuration="1200"
@@ -83,15 +85,15 @@
    enableThreadPool:是否启用线程池
     -->
    <support
        short_maxThread="6"
        short_minThread="6"
        short_freeTimeout="60"
        short_busyTimeout="5"
        long_maxThread="6"
        long_minThread="6"
        long_freeTimeout="60"
        long_busyTimeout="-1"
        enableThreadPool="true"
            short_maxThread="6"
            short_minThread="6"
            short_freeTimeout="60"
            short_busyTimeout="5"
            long_maxThread="6"
            long_minThread="6"
            long_freeTimeout="60"
            long_busyTimeout="-1"
            enableThreadPool="true"
    />
    <!--
@@ -103,11 +105,11 @@
    saveDbInterval:Rtu状态存数据库间隔(分钟)
     -->
    <resource
        rtuLogDir="rtuLogs/"
        rtuLogFileMaxSize="100000"
        rtuLogFileMaxCount="2"
        monitorInterval="2"
        saveDbInterval="10"
            rtuLogDir="rtuLogs/"
            rtuLogFileMaxSize="100000"
            rtuLogFileMaxCount="2"
            monitorInterval="2"
            saveDbInterval="10"
    />
@@ -128,10 +130,10 @@
    queueMaxSize: ç¼“存队列节点数最大数量
     -->
    <core
        sleepBigBusy="100"
        sleepSmallBusy="500"
        queueWarnSize="100000"
        queueMaxSize="300000"
            sleepBigBusy="100"
            sleepSmallBusy="500"
            queueWarnSize="100000"
            queueMaxSize="300000"
    />
    <!--
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config(ymԪı).xml
@@ -24,22 +24,22 @@
    sendDingDingAlarmMsInterval: æœ‰æŠ¥è­¦å‘生时,向钉钉发送消息的间隔时长(分钟)
     -->
    <base
        orgTag="ym"
        isLowPower="false"
        onlyDealRtus=""
        onlyOneProtocol="false"
        downComandMaxResendTimes="1"
        commandSendInterval="10"
        cachWaitResultTimeout="120"
        offLineCachTimeout="86400"
        lastUpDataTimeLive="500"
        dbDataIdSuffix="0"
        cacheUpDownDataWarnCount="100000"
        cacheUpDownDataMaxCount="110000"
        disconnectedByNoUpDataMinutes="3"
        workReportDealOneByTimes="5"
        intakeAlarmLossMinValue="1.0"
        sendDingDingAlarmMsInterval="60"
            orgTag="ym"
            isLowPower="false"
            onlyDealRtus=""
            onlyOneProtocol="false"
            downComandMaxResendTimes="1"
            commandSendInterval="3"
            cachWaitResultTimeout="120"
            offLineCachTimeout="86400"
            lastUpDataTimeLive="500"
            dbDataIdSuffix="0"
            cacheUpDownDataWarnCount="100000"
            cacheUpDownDataMaxCount="110000"
            disconnectedByNoUpDataMinutes="3"
            workReportDealOneByTimes="5"
            intakeAlarmLossMinValue="1.0"
            sendDingDingAlarmMsInterval="60"
    />
    <!--
@@ -49,19 +49,21 @@
    synchroRtuClockTimepieces:当RTU与服务器时钟相差一定毫秒(配置文件是秒钟)后,进行校时
     -->
    <protocol
        centerAddr="1"
        synchroRtuClock="true"
        synchroRtuClockTimepieces="300000"
            centerAddr="1"
            synchroRtuClock="true"
            synchroRtuClockTimepieces="300000"
    />
    <!-- RTU è½¯ä»¶å‡çº§
    enable: æ¨¡å—是否启动
    noOneRtuUpgradeMaxDuration:升级任务设置后,无一设备升级最大时长(秒),超过这个时长,认为升级任务完成,取值范围是5分钟~60分钟
    failTryTimes:升级失败后(针对的是在线进行了升级下发命令),重新偿试升级次数,当设置为0时表示不重新偿试升级
    ugMaxRtuAtOnce:为了缓解通信中间件的压力,同时支持升级的RTU台数,当设置为0时表示不受限制
    rtuOffLineWaitDuration: rtu离线,等待其升级的时长(秒),超过这个时间,设置其升级失败,且设置升级任务完成
    notifyStateInterval: å‡çº§çŠ¶æ€é€šçŸ¥é—´éš”ï¼ˆç§’ï¼‰
    -->
    <upgrade enable="true"
             noOneRtuUpgradeMaxDuration="600"
             failTryTimes="1"
             ugMaxRtuAtOnce="1000"
             rtuOffLineWaitDuration="1200"
@@ -83,15 +85,15 @@
    enableThreadPool:是否启用线程池
     -->
    <support
        short_maxThread="6"
        short_minThread="6"
        short_freeTimeout="60"
        short_busyTimeout="5"
        long_maxThread="6"
        long_minThread="6"
        long_freeTimeout="60"
        long_busyTimeout="-1"
        enableThreadPool="true"
            short_maxThread="6"
            short_minThread="6"
            short_freeTimeout="60"
            short_busyTimeout="5"
            long_maxThread="6"
            long_minThread="6"
            long_freeTimeout="60"
            long_busyTimeout="-1"
            enableThreadPool="true"
    />
    <!--
@@ -103,11 +105,11 @@
    saveDbInterval:Rtu状态存数据库间隔(分钟)
     -->
    <resource
        rtuLogDir="rtuLogs/"
        rtuLogFileMaxSize="100000"
        rtuLogFileMaxCount="2"
        monitorInterval="2"
        saveDbInterval="10"
            rtuLogDir="rtuLogs/"
            rtuLogFileMaxSize="100000"
            rtuLogFileMaxCount="2"
            monitorInterval="2"
            saveDbInterval="10"
    />
@@ -128,10 +130,10 @@
    queueMaxSize: ç¼“存队列节点数最大数量
     -->
    <core
        sleepBigBusy="100"
        sleepSmallBusy="500"
        queueWarnSize="100000"
        queueMaxSize="300000"
            sleepBigBusy="100"
            sleepSmallBusy="500"
            queueWarnSize="100000"
            queueMaxSize="300000"
    />
    <!--
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.xml
@@ -29,7 +29,7 @@
            onlyDealRtus=""
            onlyOneProtocol="false"
            downComandMaxResendTimes="1"
            commandSendInterval="10"
            commandSendInterval="3"
            cachWaitResultTimeout="120"
            offLineCachTimeout="86400"
            lastUpDataTimeLive="500"
@@ -56,12 +56,14 @@
    <!-- RTU è½¯ä»¶å‡çº§
    enable: æ¨¡å—是否启动
    noOneRtuUpgradeMaxDuration:升级任务设置后,无一设备升级最大时长(秒),超过这个时长,认为升级任务完成,取值范围是5分钟~60分钟
    failTryTimes:升级失败后(针对的是在线进行了升级下发命令),重新偿试升级次数,当设置为0时表示不重新偿试升级
    ugMaxRtuAtOnce:为了缓解通信中间件的压力,同时支持升级的RTU台数,当设置为0时表示不受限制
    rtuOffLineWaitDuration: rtu离线,等待其升级的时长(秒),超过这个时间,设置其升级失败,且设置升级任务完成
    notifyStateInterval: å‡çº§çŠ¶æ€é€šçŸ¥é—´éš”ï¼ˆç§’ï¼‰
    -->
    <upgrade enable="true"
             noOneRtuUpgradeMaxDuration="600"
             failTryTimes="1"
             ugMaxRtuAtOnce="1000"
             rtuOffLineWaitDuration="1200"
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/.gitattributes
New file
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/.gitignore
New file
@@ -0,0 +1,34 @@
HELP.md
target/
/pipIrr-mw-simulate-rtu.iml
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/.mvn/wrapper/maven-wrapper.properties
New file
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/mvnw
New file
@@ -0,0 +1,259 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
#   JAVA_HOME - location of a JDK home dir, required when download maven via java source
#   MVNW_REPOURL - repo url base for downloading maven distribution
#   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
#   MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
  [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
  native_path() { cygpath --path --windows "$1"; }
  ;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
  # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
  if [ -n "${JAVA_HOME-}" ]; then
    if [ -x "$JAVA_HOME/jre/sh/java" ]; then
      # IBM's JDK on AIX uses strange locations for the executables
      JAVACMD="$JAVA_HOME/jre/sh/java"
      JAVACCMD="$JAVA_HOME/jre/sh/javac"
    else
      JAVACMD="$JAVA_HOME/bin/java"
      JAVACCMD="$JAVA_HOME/bin/javac"
      if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
        echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
        echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
        return 1
      fi
    fi
  else
    JAVACMD="$(
      'set' +e
      'unset' -f command 2>/dev/null
      'command' -v java
    )" || :
    JAVACCMD="$(
      'set' +e
      'unset' -f command 2>/dev/null
      'command' -v javac
    )" || :
    if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
      echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
      return 1
    fi
  fi
}
# hash string like Java String::hashCode
hash_string() {
  str="${1:-}" h=0
  while [ -n "$str" ]; do
    char="${str%"${str#?}"}"
    h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
    str="${str#?}"
  done
  printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
  printf %s\\n "$1" >&2
  exit 1
}
trim() {
  # MWRAPPER-139:
  #   Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
  #   Needed for removing poorly interpreted newline sequences when running in more
  #   exotic environments such as mingw bash on Windows.
  printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
  case "${key-}" in
  distributionUrl) distributionUrl=$(trim "${value-}") ;;
  distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
  esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
  MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
  case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
  *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
  :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
  :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
  :Linux*x86_64*) distributionPlatform=linux-amd64 ;;
  *)
    echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
    distributionPlatform=linux-amd64
    ;;
  esac
  distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
  ;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
  unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
  exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
  verbose "found existing MAVEN_HOME at $MAVEN_HOME"
  exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
  clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
  trap clean HUP INT TERM EXIT
else
  die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
  distributionUrl="${distributionUrl%.zip}.tar.gz"
  distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
  verbose "Found wget ... using wget"
  wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
  verbose "Found curl ... using curl"
  curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
  verbose "Falling back to use Java to download"
  javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
  targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
  cat >"$javaSource" <<-END
    public class Downloader extends java.net.Authenticator
    {
      protected java.net.PasswordAuthentication getPasswordAuthentication()
      {
        return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
      }
      public static void main( String[] args ) throws Exception
      {
        setDefault( new Downloader() );
        java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
      }
    }
    END
  # For Cygwin/MinGW, switch paths to Windows format before running javac and java
  verbose " - Compiling Downloader.java ..."
  "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
  verbose " - Running Downloader.java ..."
  "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
  distributionSha256Result=false
  if [ "$MVN_CMD" = mvnd.sh ]; then
    echo "Checksum validation is not supported for maven-mvnd." >&2
    echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
    exit 1
  elif command -v sha256sum >/dev/null; then
    if echo "$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
      distributionSha256Result=true
    fi
  elif command -v shasum >/dev/null; then
    if echo "$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
      distributionSha256Result=true
    fi
  else
    echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
    echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
    exit 1
  fi
  if [ $distributionSha256Result = false ]; then
    echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
    echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
    exit 1
  fi
fi
# unzip and move
if command -v unzip >/dev/null; then
  unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
  tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/mvnw.cmd
New file
@@ -0,0 +1,149 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  You may obtain a copy of the License at
@REM
@REM    http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM   MVNW_REPOURL - repo url base for downloading maven distribution
@REM   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM   MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
  IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
  $VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
  Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
  "maven-mvnd-*" {
    $USE_MVND = $true
    $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
    $MVN_CMD = "mvnd.cmd"
    break
  }
  default {
    $USE_MVND = $false
    $MVN_CMD = $script -replace '^mvnw','mvn'
    break
  }
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
  $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
  $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
  $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
  Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
  Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
  exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
  Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
  if ($TMP_DOWNLOAD_DIR.Exists) {
    try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
    catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
  }
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
  $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
  if ($USE_MVND) {
    Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
  }
  Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
  if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
    Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
  }
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
  Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
  if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
    Write-Error "fail to move MAVEN_HOME"
  }
} finally {
  try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
  catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/pom.xml
New file
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>pipIrr-mw</artifactId>
        <groupId>com.dy</groupId>
        <version>1.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <packaging>jar</packaging>
    <artifactId>pipIrr-mw-simulate-rtu</artifactId>
    <version>1.0.0</version>
    <name>pipIrr-mw-simulate-rtu</name>
    <description>RTU模拟器,模拟RTU软件远程升级等</description>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-json</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- åŠ¨æ€åŠ è½½æ–°ç¼–è¯‘çš„ç±» -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- apache mina -->
        <dependency>
            <groupId>org.apache.mina</groupId>
            <artifactId>mina-core</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.7</version>
        </dependency>
        <!-- æµ‹è¯• -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- ç”Ÿæˆä¸åŒ…含依赖jar的可执行jar包
            <plugin>
                !- spring boot提供的maven打包插件 -
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        !-
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        -
                        <configuration>
                            !- ä¸åŠ çš„è¯æœ€ç»ˆåŒ…åä¸º: ${artifactId}-${version}.jar, åŠ äº†çš„è¯æœ€ç»ˆåŒ…å: ${artifactId}-${version}-${classifier}.jar  -
                            <classifier>execute</classifier>
                            !- ä¸æŒ‡å®šç”Ÿæˆè·¯å¾„的话, é»˜è®¤ä¿å­˜åœ¨ ${build.directory} ä¸‹ -
                            <outputDirectory>${project.build.directory}/execute</outputDirectory>
                            <finalName>${artifactId}-${version}</finalName>
                            <layout>ZIP</layout>
                            <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass>
                            <includes>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-common</artifactId>
                                </include>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-global</artifactId>
                                </include>
                            </includes>
                            <excludes>
                                <exclude>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                </exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            -->
            <!-- æ‹·è´ä¾èµ–çš„jar包到lib目录-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <configuration>
                            <!-- ä¸åŠ çš„è¯æœ€ç»ˆåŒ…åä¸º: ${artifactId}-${version}.jar, åŠ äº†çš„è¯æœ€ç»ˆåŒ…å: ${artifactId}-${version}-${classifier}.jar
                            <classifier>execute</classifier>
                            -->
                            <!-- ${project.build.directory}是maven变量,内置的,表示target目录,如果不写,将在根目录下创建/lib -->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <!-- excludeTransitive:是否不包含间接依赖包,比如我们依赖A,但是A又依赖了B,我们是否也要把B打进去 é»˜è®¤ä¸æ‰“-->
                            <excludeTransitive>false</excludeTransitive>
                            <!-- å¤åˆ¶çš„jar文件去掉版本信息 -->
                            <stripVersion>false</stripVersion>
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <layout>ZIP</layout>
                            <mainClass>com.dy.rtuMw.PipIrrMwAcceptApplication</mainClass>
                            <includes>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-common</artifactId>
                                </include>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-global</artifactId>
                                </include>
                            </includes>
                            <excludes>
                                <exclude>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                </exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- è®¾ç½®java编译版本,运行环境版本 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- source: æºä»£ç ç¼–译版本;target: ç›®æ ‡å¹³å°ç¼–译版本;encoding: å­—符集编码。 -->
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- è§£å†³èµ„源文件的编码问题 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- maven里执行测试用例的插件 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <!-- ä¸‹é¢è§£å†³ï¼šå½“进行Maven Lifecycle package时报错:Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)-->
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
</project>
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/AdapterImp_TcpClUnit.java
New file
@@ -0,0 +1,19 @@
package com.dy.simRtu;
import com.dy.simRtu.tcpClient.TcpClUnitAdapter;
import com.dy.simRtu.tcpClient.TcpClUnitConfigVo;
public class AdapterImp_TcpClUnit implements TcpClUnitAdapter {
    private TcpClUnitConfigVo configVo ;
    public TcpClUnitConfigVo getConfig() {
        return configVo;
    }
    public void setConfig(TcpClUnitConfigVo configVo){
        this.configVo = configVo ;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/PipIrrMwSimulateRtuApplication.java
New file
@@ -0,0 +1,73 @@
package com.dy.simRtu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) //禁止启动数据库连接池
@ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.simRtu"},
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {
                        com.dy.common.apiDoc.SpringApiConfig.class, //一种排除类的方式
                        com.dy.pipIrrGlobal.config.DingTalk.class
                }),
                @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
                        //二种排除类的方式,写正则表达式,需要对目标类的完全限定名完全匹配,否则不生效
                        "com.dy.common.aop..*",
                        "com.dy.common.apiDoc..*",
                        "com.dy.common.multiDataSource..*",
                        "com.dy.common.mybatis..*",
                        "com.dy.common.singleDataSource..*",
                        "com.dy.common.webFilter..*",
                        "com.dy.common.webListener..*",
                        "com.dy.pipIrrGlobal.webCtrls..*"
                })
        }
)
public class PipIrrMwSimulateRtuApplication implements CommandLineRunner {
    public static void main(String[] args) {
        new SpringApplicationBuilder(PipIrrMwSimulateRtuApplication.class)
                .web(WebApplicationType.NONE)//不启动web服务
                .run(args);
    }
    /**
     * Spring容器启动完成后,执行下面方法
     * @param args å‚æ•°
     * @throws Exception å¼‚常
     */
    @Override
    public void run(String... args) throws Exception {
        try{
            //等待一下
            Thread.sleep(500L);
        }catch (Exception e){
            e.printStackTrace();
        }
        finally {
            this.startMwSv() ;
        }
    }
    private void startMwSv(){
        if(sv != null){
            sv.startServer();
        }
    }
    private Server sv ;
    @Autowired
    public void setSv(Server sv){
        this.sv = sv ;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/Server.java
New file
@@ -0,0 +1,111 @@
package com.dy.simRtu;
import com.dy.common.mw.UnitInterface;
import com.dy.common.util.ConfigXml4Springboot;
import com.dy.simRtu.tcpClient.TcpClUnit;
import com.dy.simRtu.tcpClient.TcpClUnitConfigVo;
import org.jdom2.Document;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
 * @Author: liurunyu
 * @Date: 2024/11/18 9:54
 * @Description
 */
@Component
public class Server {
    @Autowired
    protected ResourceLoader resourceLoader ;
    private ConfigXml4Springboot conf = null ;
    private Document doc = null ;
    private boolean showStartInfo = false ;
    private String mwServerUrl ;
    private List<UnitInterface> units = new ArrayList<UnitInterface>() ;
    /**
     * å¯åŠ¨æœåŠ¡
     */
    public void startServer() {
        long start = System.currentTimeMillis();
        try {
            this.conf = new ConfigXml4Springboot() ;
            this.doc = this.conf.createDom(resourceLoader, "config.xml") ;
            ////////////////
            //服务 é…ç½®
            this.showStartInfo = this.conf.getSetAttrBoolean(this.doc, "config.server", "showStartInfo", null, null) ;
            this.startUnits() ;
            String svName ;
            try{
                svName = this.conf.getSetAttrTxt(this.doc, "config.server", "name", null, false, null) ;
            }catch(Exception e){
                svName = "" ;
            }
            String company ;
            try{
                company = this.conf.getSetAttrTxt(this.doc, "config.server", "company", null, true, null) ;
            }catch(Exception e){
                company = "" ;
            }
            System.out.println("OOOOOOOOOO           OOOOOOOO       OOOOOOOO") ;
            System.out.println("@@@@@@@@@@@@@@@@#O    $@@@@@@@@&    @@@@@@@@#") ;
            System.out.println("@@@@@@@@@@@@@@@@@@@#    @@@@@@@@# $@@@@@@@@&") ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@#   #@@@@@@@@@@@@@@@@O") ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@@@   &@@@@@@@@@@@@@@") ;
            System.out.println("@@@@@@$      $@@@@@@@@@&   O@@@@@@@@@@@#") ;
            System.out.println("@@@@@@$        @@@@@@@@@     @@@@@@@@@&      " + svName ) ;
            System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@") ;
            if(this.mwServerUrl != null){
                System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@       è¿œç¨‹ä¸­é—´ä»¶æœåŠ¡ " + this.mwServerUrl ) ;
            }else{
                System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@") ;
            }
            System.out.println("@@@@@@$      #@@@@@@@@@$     &@@@@@@@@       æœ¬RTU模拟地址 " + ServerProperties.rtuAddr ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@@#      &@@@@@@@@       Runing in standalone mode" ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@&       &@@@@@@@@       Startup in " + (System.currentTimeMillis() - start) + " MS" ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@#         &@@@@@@@@       " + company) ;
            System.out.println("@@@@@@@@@@@@@@@@#O           &@@@@@@@@") ;
        }catch(Exception e){
            e.printStackTrace();
        }
    }
    private void startUnits() {
        try {
            // ///////////////
            // åŸºç¡€é…ç½®
            ServerProperties.rtuAddr = conf.getSetAttrTxt(doc, "config.base", "rtuAddr", null, false, null);
            // ///////////////
            // TCP æ¨¡å—
            TcpClUnitConfigVo tcpVo = new TcpClUnitConfigVo();
            tcpVo.mwServerIp = conf.getSetAttrTxt(doc, "config.tcpCl", "mwServerIp", null, false, null);
            tcpVo.mwServerPort = conf.getSetAttrPlusInt(doc, "config.tcpCl", "mwServerPort", null, 100, 65535, null);
            tcpVo.connectTimeout = conf.getSetAttrPlusInt(doc, "config.tcpCl", "connectTimeout", null, 1000, 10000, null);
            this.mwServerUrl = tcpVo.mwServerIp + ":" + tcpVo.mwServerPort ;
            AdapterImp_TcpClUnit tcpAdap = new AdapterImp_TcpClUnit();
            tcpAdap.setConfig(tcpVo);
            TcpClUnit tcpUnit = TcpClUnit.getInstance();
            tcpUnit.setAdapter(tcpAdap);
            tcpUnit.start(obj -> {
            });
            units.add(tcpUnit) ;
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/ServerProperties.java
New file
@@ -0,0 +1,12 @@
package com.dy.simRtu;
/**
 * @Author: liurunyu
 * @Date: 2024/11/18 9:53
 * @Description
 */
public class ServerProperties {
    public static String rtuAddr ;
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/LocalCodecFactory.java
New file
@@ -0,0 +1,35 @@
package com.dy.simRtu.tcpClient;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;
public class LocalCodecFactory implements ProtocolCodecFactory {
    private ProtocolEncoder encoder;
    private ProtocolDecoder decoder;
    public LocalCodecFactory() {
        encoder = new LocalEncoder();
        decoder = new LocalDecoder();
    }
    /**
     * å¾—到协议编码器
     * @param ioSession ç½‘络会话
     * @return åè®®ç¼–码器
     */
    @Override
    public ProtocolEncoder getEncoder(IoSession ioSession) {
        return encoder;
    }
    /**
     * å¾—到协议解码器
     * @param ioSession ç½‘络会话
     * @return åè®®è§£ç å™¨
     */
    @Override
    public ProtocolDecoder getDecoder(IoSession ioSession) {
        return decoder;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/LocalDecoder.java
New file
@@ -0,0 +1,39 @@
package com.dy.simRtu.tcpClient;
import com.dy.common.util.ByteUtil;
import com.dy.simRtu.tcpClient.downData.DownData;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolDecoderOutput;
import java.io.IOException;
public class LocalDecoder extends CumulativeProtocolDecoder {
    private static final Logger log = LogManager.getLogger(LocalDecoder.class) ;
    private static final String DECODER_STATE_KEY = LocalDecoder.class.getName() + ".STATE";
    public static final int MAX_SIZE = 2147483647 ;
    /**
     * å¯¹ç½‘络传输来的数据进行解码
     */
    protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws IOException, Exception{
        int remain = in.remaining() ;
        if(remain > 0){
            byte[] bs = new byte[remain];
            in.get(bs) ;
            in.position(0) ;
            log.info("收到中间件下行数据:" + ByteUtil.bytes2Hex(bs, true));
            new DownData().parseData(bs);
        }
        return true;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/LocalEncoder.java
New file
@@ -0,0 +1,26 @@
package com.dy.simRtu.tcpClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;
import java.io.IOException;
public class LocalEncoder extends ProtocolEncoderAdapter {
    private static final Logger log = LogManager.getLogger(LocalEncoder.class) ;
    /**
     * å¯¹æ•°æ®è¿›è¡Œç¼–码,以备网络传输
     */
    public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws IOException, Exception{
        byte[] data = (byte[])message;
        //log.info("上行数据:" + ByteUtil.bytes2Hex(data, true));
        out.write(IoBuffer.allocate((data==null?0:data.length), false).put(data).flip());
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpClUnit.java
New file
@@ -0,0 +1,119 @@
package com.dy.simRtu.tcpClient;
import com.dy.common.mw.UnitAdapterInterface;
import com.dy.common.mw.UnitCallbackInterface;
import com.dy.common.mw.UnitInterface;
import com.dy.common.util.Callback;
import com.dy.simRtu.ServerProperties;
import com.dy.simRtu.tcpClient.upData.UpData;
import com.dy.simRtu.tcpClient.upData.UpHeartBeat;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.mina.core.session.IoSession;
public class TcpClUnit implements UnitInterface {
    private static final Logger log = LogManager.getLogger(TcpClUnit.class) ;
    private static TcpClUnit instance = new TcpClUnit() ;
    public static TcpClUnitAdapter adapter ;
    public static TcpClUnitConfigVo confVo ;
    public static IoSession session ;
    private TcpClUnit(){} ;
    public static TcpClUnit getInstance(){
        return instance ;
    }
    @Override
    public void setAdapter(UnitAdapterInterface adapter) throws Exception {
        if(adapter == null){
            throw new Exception("Tcp Client模块适配器对象不能为空!") ;
        }
        TcpClUnit.adapter = (TcpClUnitAdapter)adapter ;
        TcpClUnit.confVo = TcpClUnit.adapter.getConfig() ;
        if(TcpClUnit.confVo == null){
            throw new Exception("Tcp Client模块配置对象不能为空!") ;
        }
    }
    @Override
    public void start(UnitCallbackInterface callback) throws Exception {
        System.out.println("Tcp Client模块成功启动");
        this.doStart();
        callback.call(null) ;
    }
    @Override
    public void stop(UnitCallbackInterface callback) throws Exception {
        callback.call(null);
    }
    private void doStart(){
        new Thread(() -> {
            Exception ex ;
            while(true){
                ex = null ;
                try {
                    new TcpConnect().createSession(
                            confVo.mwServerIp,
                            confVo.mwServerPort,
                            confVo.connectTimeout,
                            new TcpHandler(),
                            new Callback() {
                                @Override
                                public void call(Object obj) {
                                    if (obj == null) {
                                        log.error("创建网络会话返回为null");
                                    } else {
                                        TcpClUnit.session = (IoSession) obj;
                                        log.info("成功创建与通信中间件的网络连接");
                                        UpData.setSession(TcpClUnit.session);
                                        heartBeat() ;
                                    }
                                }
                                @Override
                                public void call(Object... objs) {
                                }
                                @Override
                                public void exception(Exception e) {
                                }
                            });
                }catch (Exception e){
                   ex = e ;
                }
                if(ex == null){
                    break ;
                }else{
                    try{
                        Thread.sleep(100);
                    }catch (Exception e){
                    }
                }
            }
        }).start();
    }
    private void heartBeat(){
        new Thread(new Runnable(){
            @Override
            public void run() {
                while(true){
                    try {
                        UpHeartBeat.upCd02Data(ServerProperties.rtuAddr);
                        Thread.sleep(30000L);
                        //Thread.sleep(30000000L);
                    }catch (Exception e){
                        continue;
                    }
                }
            }
        }).start();
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpClUnitAdapter.java
New file
@@ -0,0 +1,9 @@
package com.dy.simRtu.tcpClient;
import com.dy.common.mw.UnitAdapterInterface;
public interface TcpClUnitAdapter extends UnitAdapterInterface {
    TcpClUnitConfigVo getConfig() ;
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpClUnitConfigVo.java
New file
@@ -0,0 +1,7 @@
package com.dy.simRtu.tcpClient;
public class TcpClUnitConfigVo {
    public String  mwServerIp ;
    public Integer  mwServerPort ;
    public Integer  connectTimeout ;
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpConnect.java
New file
@@ -0,0 +1,62 @@
package com.dy.simRtu.tcpClient;
import com.dy.common.util.Callback;
import org.apache.mina.core.future.ConnectFuture;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.transport.socket.SocketConnector;
import org.apache.mina.transport.socket.nio.NioSocketConnector;
import java.net.InetSocketAddress;
public class TcpConnect {
     /**
     * åˆ¤æ–­ä¼šè¯æ˜¯å¦æœ‰æ•ˆ
     * @param se ç½‘络会话
     * @return æ˜¯å¦è¿žæŽ¥
     */
    public boolean isConnected(IoSession se) {
        return (se != null && se.isConnected());
    }
    /**
     * åˆ›å»ºæ–°ä¼šè¯
     * @param host æœåС噍URI
     * @param port æœåŠ¡å™¨ç«¯å£
     * @param connectTimeout è¿žæŽ¥è¶…æ—¶æ—¶é•¿
     * @param handler æ•°æ®å¤„理者
     * @param callback å›žè°ƒ
     * @return ç½‘络会话
     */
    public void createSession(String host ,
                               int port ,
                               int connectTimeout ,
                               TcpHandler handler,
                               Callback callback) throws Exception{
        SocketConnector connector = new NioSocketConnector();
        connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new LocalCodecFactory()));
        connector.setHandler(handler);
        ConnectFuture connectFuture = connector.connect(new InetSocketAddress(host, port));
        connectFuture.awaitUninterruptibly(connectTimeout);
        IoSession se = connectFuture.getSession();
        callback.call(se) ;
    }
    /**
     * å…³é—­ä¼šè¯è”接
     * @param se
     * @param connectTimeout
     */
    public void disconnect(IoSession se , int connectTimeout) {
        if (se != null) {
            try{
                se.closeNow().awaitUninterruptibly(connectTimeout);
            }catch(Exception e){
            }finally{
                se = null;
            }
        }
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/TcpHandler.java
New file
@@ -0,0 +1,92 @@
package com.dy.simRtu.tcpClient;
import com.dy.common.util.ByteUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IdleStatus;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.FilterEvent;
public class TcpHandler extends IoHandlerAdapter {
    private static Logger log = LogManager.getLogger(TcpHandler.class.getName()) ;
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionCreated(IoSession session) throws Exception {
        super.sessionCreated(session);
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionOpened(IoSession session) throws Exception {
        super.sessionOpened(session);
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionClosed(IoSession session) throws Exception {
        super.sessionClosed(session);
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionIdle(IoSession session, IdleStatus status) throws Exception {
        super.sessionIdle(session, status);
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void messageReceived(IoSession session, Object message) throws Exception {
        if(message != null){
            byte[] bs = (byte[])message ;
            log.info("收到中间件数据:" + ByteUtil.bytes2Hex(bs, true));
        }
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void messageSent(IoSession session, Object message) throws Exception {
        log.info("网络发送了数据,"
                + (session==null?"":(session.getRemoteAddress() != null?("中间件网址是:" + session.getRemoteAddress().toString()):"")) );
        if(message != null){
            byte[] bs = (byte[])message ;
            log.info("网络发送了数据:" + ByteUtil.bytes2Hex(bs, true));
        }
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void inputClosed(IoSession session) throws Exception {
        session.closeNow();
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void event(IoSession session, FilterEvent event) throws Exception {
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/downData/DownData.java
New file
@@ -0,0 +1,56 @@
package com.dy.simRtu.tcpClient.downData;
import com.dy.common.mw.protocol.p206V1.ProtocolConstantV206V1;
import com.dy.common.util.ByteUtil;
import com.dy.simRtu.tcpClient.upData.*;
/**
 * @Author: liurunyu
 * @Date: 2024/11/18 10:57
 * @Description ä¸­é—´ä»¶çš„下行数据
 */
public class DownData {
    public void parseData(byte[] bs){
        if(bs != null && bs.length > 0){
            if(bs.length >= (ProtocolConstantV206V1.ctrlIndex)
                    && bs[0] == ProtocolConstantV206V1.P_Head_Byte
                    && bs[2] == ProtocolConstantV206V1.P_Head_Byte){
                this.dealP206V1(bs);
            }else if(bs.length >= (ProtocolConstantV206V1.UG_codeIndex)
                    && bs[0] == ProtocolConstantV206V1.UG_P_Head_Byte
                    && bs[3] == ProtocolConstantV206V1.UG_P_Head_Byte){
                this.dealUpgrade(bs);
            }
        }
    }
    private void dealP206V1(byte[] bs){
        //应该是链路检测数据
    }
    private void dealUpgrade(byte[] bs){
        String cdPre = ByteUtil.bytes2Hex(bs, false, ProtocolConstantV206V1.UG_codeIndex, 1);
        if(cdPre.equals("16")){
            //升级功能码
            UpHeartBeat.upHeartBeat = false ;//不上行心跳
            if(bs.length >= ProtocolConstantV206V1.UG_lenHead2Cmd + 1){
                String cdSuf = ByteUtil.bytes2Hex(bs, false, ProtocolConstantV206V1.UG_codeIndex + 1, 1);
                String cd = cdPre + cdSuf;
                if(cd.equals("1601")){
                    //升级配置
                    UpCd9601.upData() ;
                }else if(cd.equals("1602")){
                    //升级数据
                    UpCd9602.upData() ;
                }else if(cd.equals("1603")){
                    //升级校验
                    UpCd9603.upData() ;
                }else if(cd.equals("1600")){
                    //升级复位
                    UpCd9600.upData() ;
                    UpHeartBeat.upHeartBeat = true ;//不上行心跳
                }
            }
        }
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9600.java
New file
@@ -0,0 +1,21 @@
package com.dy.simRtu.tcpClient.upData;
import com.dy.common.mw.protocol.p206V1.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
import com.dy.simRtu.ServerProperties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author: liurunyu
 * @Date: 2024/11/18 11:26
 * @Description
 */
public class UpCd9600 extends UpData {
    private static final Logger log = LogManager.getLogger(UpCd9600.class);
    public static void upData() {
        //无上行数据
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9601.java
New file
@@ -0,0 +1,53 @@
package com.dy.simRtu.tcpClient.upData;
import com.dy.common.mw.protocol.p206V1.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
import com.dy.simRtu.ServerProperties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author: liurunyu
 * @Date: 2024/11/18 11:26
 * @Description
 */
public class UpCd9601 extends UpData {
    private static final Logger log = LogManager.getLogger(UpCd9601.class);
    public static void upData() {
        try {
            if (UpData.session != null && UpData.session.isConnected()) {
                byte[] bs = createData(ServerProperties.rtuAddr);
                UpData.upSend(bs);
            } else {
                log.error("未连接通信中间件,不能发送数据");
            }
        } catch (Exception e) {
            log.error("向通信中间件发送数据产生异常", e);
        }
    }
    /**
     * æž„造数据
     *
     * @return å­—节数组
     * @throws Exception å¼‚常
     */
    private static byte[] createData(String rtuAddr) throws Exception {
        byte[] bytes = creatHead4Upgrade(rtuAddr, "96","01");
        byte[] bs = new byte[1];
        bs[0] = (byte) 0x00;//00 æ­£ç¡® ï¼Œ0xXX é”™è¯¯
        bytes = ByteUtil.bytesMerge(bytes, bs);
        GlCreate.createLen4PUg(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail4Ug(bytes);//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail);
        return bytes;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9602.java
New file
@@ -0,0 +1,53 @@
package com.dy.simRtu.tcpClient.upData;
import com.dy.common.mw.protocol.p206V1.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
import com.dy.simRtu.ServerProperties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author: liurunyu
 * @Date: 2024/11/18 11:26
 * @Description
 */
public class UpCd9602 extends UpData {
    private static final Logger log = LogManager.getLogger(UpCd9602.class);
    public static void upData() {
        try {
            if (UpData.session != null && UpData.session.isConnected()) {
                byte[] bs = createData(ServerProperties.rtuAddr);
                UpData.upSend(bs);
            } else {
                log.error("未连接通信中间件,不能发送数据");
            }
        } catch (Exception e) {
            log.error("向通信中间件发送数据产生异常", e);
        }
    }
    /**
     * æž„造数据
     *
     * @return å­—节数组
     * @throws Exception å¼‚常
     */
    private static byte[] createData(String rtuAddr) throws Exception {
        byte[] bytes = creatHead4Upgrade(rtuAddr, "96","02");
        byte[] bs = new byte[1];
        bs[0] = (byte) 0x00;//00 æ­£ç¡® ï¼Œ0xXX é”™è¯¯
        bytes = ByteUtil.bytesMerge(bytes, bs);
        GlCreate.createLen4PUg(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail4Ug(bytes);//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail);
        return bytes;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9603.java
New file
@@ -0,0 +1,53 @@
package com.dy.simRtu.tcpClient.upData;
import com.dy.common.mw.protocol.p206V1.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
import com.dy.simRtu.ServerProperties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author: liurunyu
 * @Date: 2024/11/18 11:26
 * @Description
 */
public class UpCd9603 extends UpData {
    private static final Logger log = LogManager.getLogger(UpCd9603.class);
    public static void upData() {
        try {
            if (UpData.session != null && UpData.session.isConnected()) {
                byte[] bs = createData(ServerProperties.rtuAddr);
                UpData.upSend(bs);
            } else {
                log.error("未连接通信中间件,不能发送数据");
            }
        } catch (Exception e) {
            log.error("向通信中间件发送数据产生异常", e);
        }
    }
    /**
     * æž„造数据
     *
     * @return å­—节数组
     * @throws Exception å¼‚常
     */
    private static byte[] createData(String rtuAddr) throws Exception {
        byte[] bytes = creatHead4Upgrade(rtuAddr, "96","03");
        byte[] bs = new byte[1];
        bs[0] = (byte) 0x00;//00 æ­£ç¡® ï¼Œ0xXX é”™è¯¯
        bytes = ByteUtil.bytesMerge(bytes, bs);
        GlCreate.createLen4PUg(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail4Ug(bytes);//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail);
        return bytes;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpData.java
New file
@@ -0,0 +1,76 @@
package com.dy.simRtu.tcpClient.upData;
import com.dy.common.mw.protocol.p206V1.ProtocolConstantV206V1;
import com.dy.common.mw.protocol.p206V1.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
import org.apache.mina.core.session.IoSession;
/**
 * @Author: liurunyu
 * @Date: 2024/7/15 14:20
 * @Description
 */
public class UpData {
    protected static IoSession session ;
    private static Object synObj = new Object() ;
    public static void setSession(IoSession session){
        UpData.session = session ;
    }
    protected static void upSend(byte[] bs) throws Exception{
        synchronized (synObj){
            session.write(bs) ;
        }
    }
    protected static byte[] creatHead(String rtuAddr, String code, byte ctrl)throws Exception {
        byte[] bsHead = new byte[ProtocolConstantV206V1.lenHead2Code] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1.P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1.P_Head_Byte ;
        index++ ;
        bsHead[index] = ctrl; //控制域功能码
        index++ ;
        GlCreate.createRtuAddr4P206(rtuAddr, bsHead, index);
        index += 5 ;
        ByteUtil.hex2Bytes(code, bsHead, index) ;
        return bsHead ;
    }
    protected static byte[] creatHead4Upgrade(String rtuAddr, String preCode, String sufCode)throws Exception {
        byte[] bsHead = new byte[12] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1.UG_P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1.UG_P_Head_Byte ;
        index++ ;
        bsHead[index] = ByteUtil.hex2Bytes(preCode)[0]; //功能码域
        index++ ;
        bsHead[index] = ByteUtil.hex2Bytes(sufCode)[0]; //功能码域
        index++ ;
        GlCreate.createRtuAddr4P206(rtuAddr, bsHead, index);
        return bsHead ;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpHeartBeat.java
New file
@@ -0,0 +1,63 @@
package com.dy.simRtu.tcpClient.upData;
import com.dy.common.mw.protocol.p206V1.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author: liurunyu
 * @Date: 2024/7/15 14:18
 * @Description
 */
public class UpHeartBeat extends UpData {
    private static final Logger log = LogManager.getLogger(UpHeartBeat.class) ;
    private static boolean isFirst = true ;
    public static boolean upHeartBeat = true ;//是否可以发送心跳
    public static void upCd02Data(String rtuAddr){
        if(upHeartBeat){
            try{
                if(UpData.session != null && UpData.session.isConnected()){
                    byte[] bs = createData(rtuAddr) ;
                    UpData.upSend(bs) ;
                }else{
                    log.error("未连接通信中间件,不能发送数据");
                }
            }catch (Exception e){
                log.error("向通信中间件发送数据产生异常", e);
            }
        }
    }
    /**
     * æž„造心跳数据
     * @return å­—节数组
     * @throws Exception å¼‚常
     */
    private static byte[] createData(String rtuAddr) throws Exception {
        byte[] bytes = creatHead(rtuAddr, "02", (byte)0xB0);
        byte[] bs = new byte[1] ;
        if(isFirst){
            isFirst = false ;
            bs[0] = (byte)0xF0 ;//数据域: 1 ä¸ªå­—节,F0 ç™»å½•, F1 é€€å‡ºç™»å½•,F2 åœ¨çº¿ä¿æŒã€‚
        }else{
            bs[0] = (byte)0xF2 ;//数据域: 1 ä¸ªå­—节,F0 ç™»å½•, F1 é€€å‡ºç™»å½•,F2 åœ¨çº¿ä¿æŒã€‚
        }
        bytes = ByteUtil.bytesMerge(bytes, bs) ;
        GlCreate.createLen(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail4P206(bytes) ;//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
        return bytes ;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/resources/application.yml
New file
@@ -0,0 +1,5 @@
logging:
    charset:
        console: UTF-8
    config:
        classpath: log4j2.yml
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/resources/config.xml
New file
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <server name="RTU模拟器(升级)" showStartInfo="true" company="http://www.dyjs.com"/>
    <!--
        532328000214
        532328000215
        532328000169
        620201000030
     -->
    <base rtuAddr="532328000214"></base>
    <!-- -->
    <tcpCl mwServerIp="192.168.40.132" mwServerPort="60000" connectTimeout="3000" />
</config>
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/resources/log4j2.xml
New file
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="OFF">
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout charset="GBK" pattern="%d %-5p [%t] (%F:%L) - %m%n%throwable"/>
    </Console>
    <RollingFile name="File" fileName="logs/simRtu.log" filePattern="logs/simRtu-%d{yyyyMMdd}-%i.log">
      <PatternLayout charset="UTF-8" pattern="%d %-5p [%t] (%class.%method:%L) - %m%n%throwable"/>
      <Policies>
        <TimeBasedTriggeringPolicy interval="7" />
        <SizeBasedTriggeringPolicy size="10MB"/>
      </Policies>
      <DefaultRolloverStrategy max="50" />
    </RollingFile>
  </Appenders>
  <Loggers>
      <!--
      <Logger name="com.zhzc.jgTest" level="debug">
      <AppenderRef ref="Console"/>
    </Logger>
      <Logger name="org.jgroups" level="info">
      <AppenderRef ref="File"/>
    </Logger>
      -->
    <!-- Root与各个Logger同时起作用 -->
    <Root level="info">
      <AppenderRef ref="Console"/>
      <AppenderRef ref="File"/>
    </Root>
  </Loggers>
</Configuration>
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/test/java/com/dy/simRtu/PipIrrMwSimulateRtuApplicationTests.java
New file
@@ -0,0 +1,13 @@
package com.dy.simRtu;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PipIrrMwSimulateRtuApplicationTests {
    @Test
    void contextLoads() {
    }
}
pipIrr-platform/pipIrr-mw/pom.xml
@@ -16,6 +16,7 @@
    <modules>
        <module>pipIrr-mw-rtu</module>
        <module>pipIrr-mw-simulate-rtu</module>
        <module>pipIrr-mwTest-server</module>
        <module>pipIrr-mwTest-client</module>
    </modules>
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/PipIrrMwTestRtuApplication.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrMwTestRtu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -22,7 +23,8 @@
                        "com.dy.common.mybatis..*",
                        "com.dy.common.singleDataSource..*",
                        "com.dy.common.webFilter..*",
                        "com.dy.common.webListener..*"
                        "com.dy.common.webListener..*",
                        "com.dy.pipIrrGlobal.webCtrls..*"
                })
        }
)
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/Server.java
@@ -6,6 +6,7 @@
import com.dy.pipIrrMwTestRtu.tcpClient.TcpClUnitConfigVo;
import org.jdom2.Document;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Component;
@@ -22,6 +23,10 @@
public class Server {
    @Autowired
    protected ResourceLoader resourceLoader ;
    @Value("${server.port}")
    private Integer webPort ;
    @Value("${server.servlet.context-path}")
    private String webContext ;
    private ConfigXml4Springboot conf = null ;
    private Document doc = null ;
@@ -76,11 +81,11 @@
            System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@") ;
            if(this.mwServerUrl != null){
                System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@       ä¸­é—´ä»¶æœåŠ¡ç«¯ " + this.mwServerUrl ) ;
                System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@       è¿œç¨‹ä¸­é—´ä»¶æœåŠ¡ç«¯ " + this.mwServerUrl ) ;
            }else{
                System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@") ;
            }
            System.out.println("@@@@@@$      #@@@@@@@@@$     &@@@@@@@@" ) ;
            System.out.println("@@@@@@$      #@@@@@@@@@$     &@@@@@@@@       æœ¬åœ°web服务端http://[ip]:" + this.webPort + this.webContext ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@@#      &@@@@@@@@       Runing in standalone mode" ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@&       &@@@@@@@@       Startup in " + (System.currentTimeMillis() - start) + " MS" ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@#         &@@@@@@@@       " + company) ;
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java
@@ -54,49 +54,46 @@
    }
    private void doStart(){
        new Thread(new Runnable(){
            @Override
            public void run() {
                Exception ex = null ;
                while(true){
                    ex = null ;
                    try {
                        new TcpConnect().createSession(
                                confVo.mwServerIp,
                                confVo.mwServerPort,
                                confVo.connectTimeout,
                                new TcpHandler(),
                                new Callback() {
                                    @Override
                                    public void call(Object obj) {
                                        if (obj == null) {
                                            log.error("创建网络会话返回为null");
                                        } else {
                                            TcpClUnit.session = (IoSession) obj;
                                            log.info("成功创建与通信中间件的网络连接");
                                            UpData.setSession(TcpClUnit.session);
                                            heartBeat() ;
                                        }
        new Thread(() -> {
            Exception ex ;
            while(true){
                ex = null ;
                try {
                    new TcpConnect().createSession(
                            confVo.mwServerIp,
                            confVo.mwServerPort,
                            confVo.connectTimeout,
                            new TcpHandler(),
                            new Callback() {
                                @Override
                                public void call(Object obj) {
                                    if (obj == null) {
                                        log.error("创建网络会话返回为null");
                                    } else {
                                        TcpClUnit.session = (IoSession) obj;
                                        log.info("成功创建与通信中间件的网络连接");
                                        UpData.setSession(TcpClUnit.session);
                                        heartBeat() ;
                                    }
                                }
                                    @Override
                                    public void call(Object... objs) {
                                    }
                                @Override
                                public void call(Object... objs) {
                                }
                                    @Override
                                    public void exception(Exception e) {
                                    }
                                });
                                @Override
                                public void exception(Exception e) {
                                }
                            });
                }catch (Exception e){
                   ex = e ;
                }
                if(ex == null){
                    break ;
                }else{
                    try{
                        Thread.sleep(100);
                    }catch (Exception e){
                       ex = e ;
                    }
                    if(ex == null){
                        break ;
                    }else{
                        try{
                            Thread.sleep(100);
                        }catch (Exception e){
                        }
                    }
                }
            }
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/resources/Config.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <server name="RTU模拟器" showStartInfo="true" company="http://www.dyjs.com"/>
    <server name="RTU升级模拟器" showStartInfo="true" company="http://www.dyjs.com"/>
    <base rtuAddr="532328059995" onlyOneHeartBeat="true" icCardAddr="3B7D1E1A" icCardNo="61181622830147821"></base>
    <!-- -->
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/˵Ã÷.txt
@@ -1 +1 @@
RTU模拟器
RTU模拟器,其实现Restfull接口,由web端调用触发使其模拟RTU上报指定的功能码数据
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1/ComSupportP206V1.java
@@ -4,6 +4,7 @@
import com.dy.common.mw.protocol.CommandType;
import com.dy.common.mw.protocol.p206V1.ProtocolConstantV206V1;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -82,8 +83,13 @@
            response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
    /**
@@ -102,8 +108,13 @@
            response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java
@@ -5,6 +5,7 @@
import com.dy.common.mw.protocol.p206V202404.ProtocolConstantV206V202404;
import com.dy.common.mw.protocol.p206V202404.downVos.ComCdXyVo;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -78,8 +79,13 @@
            response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
    /**
@@ -98,8 +104,13 @@
            response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/rtuLog/RtuLogSupport.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrMwTestWeb.rtuLog;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
@@ -61,7 +62,12 @@
            response = restTemplate.exchange(fullUrl, HttpMethod.GET, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-app/pom.xml
@@ -12,10 +12,8 @@
    <packaging>jar</packaging>
    <artifactId>pipIrr-web-app</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>pipIrr-web-app</name>
    <description>手机App</description>
    <build>
        <plugins>
pipIrr-platform/pipIrr-web/pipIrr-web-app/src/main/java/com/dy/pipIrrApp/issue/qo/QoIssueReport.java
@@ -2,6 +2,7 @@
import com.dy.common.webUtil.QueryConditionVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -11,6 +12,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class QoIssueReport extends QueryConditionVo {
    /**
     * å·¡æ£€å‘˜ID
pipIrr-platform/pipIrr-web/pipIrr-web-app/src/main/java/com/dy/pipIrrApp/workOrder/qo/QoWorkOrder.java
@@ -2,6 +2,9 @@
import com.dy.common.webUtil.QueryConditionVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
/**
 * @author ZhuBaoMin
@@ -11,6 +14,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class QoWorkOrder extends QueryConditionVo {
    /**
     * æ´¾å•人姓名
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictVoMapper.java
@@ -4,9 +4,10 @@
import com.dy.pipIrrGlobal.util.TypeConversionEnum;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
@Mapper(uses = {TypeConversionEnum.class})
@Mapper(uses = {TypeConversionEnum.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DistrictVoMapper {
    DistrictVoMapper INSTANCT = Mappers.getMapper(DistrictVoMapper.class);
    /**
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/program/UgRtuProgramCtrl.java
@@ -4,6 +4,7 @@
import com.dy.common.aop.SsoAop;
import com.dy.common.softUpgrade.parse.HexFileParse;
import com.dy.common.softUpgrade.parse.HexFileVo;
import com.dy.common.util.ByteUtil;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
@@ -147,6 +148,18 @@
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        if(vo.storeRamAddr == null
                || vo.storeRamAddr.trim().equals("")
                || vo.storeRamAddr.length() != 8
                || !HexUtil.isHexNumber(vo.storeRamAddr)){
            return BaseResponseUtils.buildFail("升级程序存放地址(4字节,8位十六进制数)不正确") ;
        }
        if(vo.startRamAddr == null
                || vo.startRamAddr.trim().equals("")
                || vo.startRamAddr.length() != 8
                || !HexUtil.isHexNumber(vo.startRamAddr)){
            return BaseResponseUtils.buildFail("程序覆盖起始地址(4字节,8位十六进制数)不正确") ;
        }
        if(vo.file == null){
            return BaseResponseUtils.buildFail("RTU程序文件必须上传") ;
        }
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuTaskCtrl.java
@@ -220,7 +220,7 @@
            }
            count = this.sv.execute(id);
        } catch (Exception e) {
            log.error("结束RTU升级任务异常", e);
            log.error("执行RTU升级任务异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        if(count <= 0){
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DtoToDividePojo.java
@@ -3,6 +3,7 @@
import com.dy.pipIrrGlobal.pojoPr.PrDivide;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -12,7 +13,7 @@
 * @Description
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DtoToDividePojo {
    DtoToDividePojo INSTANCT = Mappers.getMapper(DtoToDividePojo.class);
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/DtoToFlowmeterPojo.java
@@ -3,6 +3,7 @@
import com.dy.pipIrrGlobal.pojoPr.PrFlowmeter;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -12,7 +13,7 @@
 * @Description
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DtoToFlowmeterPojo {
    DtoToFlowmeterPojo INSTANCT = Mappers.getMapper(DtoToFlowmeterPojo.class);
//    @Mapping(target = "code", source = "code")
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/DtoToMoniFlowPojo.java
@@ -3,6 +3,7 @@
import com.dy.pipIrrGlobal.pojoPr.PrMonitoringFlowmeter;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -12,7 +13,7 @@
 * @Description æµé‡ç›‘测站、流量计Dto转Pojo
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DtoToMoniFlowPojo {
    DtoToMoniFlowPojo INSTANCT = Mappers.getMapper(DtoToMoniFlowPojo.class);
    @Mapping(target = "monitoringid", source = "monitoringId")
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/qo/OnLineIntakesQO.java
@@ -4,6 +4,7 @@
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -13,6 +14,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class OnLineIntakesQO extends QueryConditionVo {
    /**
     * ä¸­é—´ä»¶è¿”回的RTU在线情况对象数组
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/DtoToPojo.java
@@ -3,6 +3,7 @@
import com.dy.pipIrrGlobal.pojoPr.PrIntakeController;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -12,7 +13,7 @@
 * @Description DtoToPojo è½¬ PrIntakeController
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DtoToPojo {
    DtoToPojo INSTANCT = Mappers.getMapper(DtoToPojo.class);
    @Mapping(target = "intakeid", source = "intakeId")
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java
@@ -29,6 +29,7 @@
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
/**
@@ -67,7 +68,7 @@
    @GetMapping(path = "/issuedTask")
    @SsoAop()
    public BaseResponse<Boolean> issuedTask(String id){
        if(id == null || !id.trim().equals("")){
        if(id == null || id.trim().equals("")){
            return BaseResponseUtils.buildError("任务id不能为空") ;
        }
        UgRtuTask tpo = this.sv.selectTaskById(id) ;
@@ -87,7 +88,7 @@
            return BaseResponseUtils.buildError("任务所涉及的控制器还未设置") ;
        }
        String ugCallbackUrl_rm = env.getProperty("mw." + DataSourceContext.get() + ".ugCallbackUrl_rm" );
        String ugCallbackUrl_rm = env.getProperty("mw.ugCallbackUrl_rm" );
        if(ugCallbackUrl_rm == null || ugCallbackUrl_rm.trim().equals("")){
            return BaseResponseUtils.buildError("未配置升级任务回调网址") ;
        }
@@ -104,8 +105,12 @@
                this.sv.setUpgradeTaskExecuted(id);
                return BaseResponseUtils.buildSuccess(true) ;
            }else{
                log.error("通信中间件执行下发升级任务失败" + (res.getMsg() == null? "" : ("," + res.getMsg()))) ;
                return BaseResponseUtils.buildFail("通信中间件执行失败" + (res.getMsg() == null? "" : ("," + res.getMsg()))) ;
                String msg = res.getContent()==null?null:(String)res.getContent() ;
                if(msg == null){
                    msg = res.getMsg() ;
                }
                log.error("通信中间件执行下发升级任务失败" + msg) ;
                return BaseResponseUtils.buildFail("通信中间件执行失败" + msg) ;
            }
        }else{
            log.error("通信中间件返回结果为null") ;
@@ -118,7 +123,8 @@
        vo.softFileName = ppo.hexFileName ;
        vo.softStoreAddr = ppo.storeRamAddr ;
        vo.softStartAddr = ppo.startRamAddr ;
        vo.softFileData = ppo.programBytes ;
        vo.softFileData64 = Base64.getEncoder().encodeToString(ppo.programBytes) ;
        //vo.softFileData = ppo.programBytes ;
        vo.softBytesCalculate = ppo.programCalculateBytes ;
        vo.softByteSrc16 = ppo.programCrc16 ;
    }
@@ -130,7 +136,7 @@
    @GetMapping(path = "/demoReset")
    @SsoAop()
    public BaseResponse<Boolean> demoReset(){
        if(RtuUpgradeStateReceiverCtrl.cache == null){
        if(RtuUpgradeStateReceiverCtrl.cache != null){
            //return BaseResponseUtils.buildError("当前没有升级任务") ;
            //正式运行时,下面两行去掉,上面一行打开
            RtuUpgradeStateReceiverCtrl ctrl = SpringContextUtil.getBean(RtuUpgradeStateReceiverCtrl.class);
@@ -159,6 +165,8 @@
    public BaseResponse<QueryResultVo<VoWatch> > curUpgradeState(QueryVo qvo){
        if(qvo == null){
            qvo = new QueryVo();
            qvo.pageCurr = 1 ;
            qvo.pageSize = 50 ;
        }
        if(RtuUpgradeStateReceiverCtrl.cache == null){
            //return BaseResponseUtils.buildError("当前没有升级任务") ;
@@ -169,32 +177,35 @@
        QueryResultVo<VoWatch> rsVo = new QueryResultVo();
        VoWatch vo = new VoWatch() ;
        vo.upgrade = this.sv.selectTaskDetail(RtuUpgradeStateReceiverCtrl.cache.ugTaskId);
        vo.overall = RtuUpgradeStateReceiverCtrl.cache.ugOverallState ;
        vo.rtus = new ArrayList<>() ;
        List<UpgradeRtu> listFiltered = null ;
        if(RtuUpgradeStateReceiverCtrl.cache.ugRtuStateList != null && RtuUpgradeStateReceiverCtrl.cache.ugRtuStateList.size() > 0) {
            listFiltered = filterByQuery(qvo) ;
            if (listFiltered.size() > 0) {
                if(qvo.pageCurr < 1){
                    qvo.pageCurr = 1 ;
                }
                int start = (qvo.pageCurr - 1) * qvo.pageSize ;
                if(start >= listFiltered.size()){
                    if(listFiltered.size()%qvo.pageSize > 0){
                        start = listFiltered.size() - listFiltered.size()%qvo.pageSize ;
                    }else{
                        start = listFiltered.size() - qvo.pageSize ;
        if(RtuUpgradeStateReceiverCtrl.cache != null && RtuUpgradeStateReceiverCtrl.cache.ugTaskId != null){
            vo.upgrade = this.sv.selectTaskDetail(RtuUpgradeStateReceiverCtrl.cache.ugTaskId);
            vo.overall = RtuUpgradeStateReceiverCtrl.cache.ugOverallState ;
            vo.rtus = new ArrayList<>() ;
            if(RtuUpgradeStateReceiverCtrl.cache.ugRtuStateList != null && RtuUpgradeStateReceiverCtrl.cache.ugRtuStateList.size() > 0) {
                listFiltered = filterByQuery(qvo) ;
                if (listFiltered.size() > 0) {
                    if(qvo.pageCurr < 1){
                        qvo.pageCurr = 1 ;
                    }
                }
                for(int i = start; i < (start + qvo.pageSize) && i < listFiltered.size(); i++){
                    UpgradeRtu ugRtu = listFiltered.get(i) ;
                    VoWatch.VoWatchRtu rtu = new VoWatch.VoWatchRtu() ;
                    rtu.fromCache(ugRtu) ;
                    vo.rtus.add(rtu) ;
                    int start = (qvo.pageCurr - 1) * qvo.pageSize ;
                    if(start >= listFiltered.size()){
                        if(listFiltered.size()%qvo.pageSize > 0){
                            start = listFiltered.size() - listFiltered.size()%qvo.pageSize ;
                        }else{
                            start = listFiltered.size() - qvo.pageSize ;
                        }
                    }
                    for(int i = start; i < (start + qvo.pageSize) && i < listFiltered.size(); i++){
                        UpgradeRtu ugRtu = listFiltered.get(i) ;
                        VoWatch.VoWatchRtu rtu = new VoWatch.VoWatchRtu() ;
                        rtu.fromCache(ugRtu) ;
                        vo.rtus.add(rtu) ;
                    }
                }
            }
        }
        rsVo.obj = vo ;
        rsVo.pageSize = qvo.pageSize ;
        rsVo.pageCurr = qvo.pageCurr ;
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java
@@ -1,5 +1,7 @@
package com.dy.pipIrrRemote.rtuUpgrage;
import com.dy.common.contant.Constant;
import com.dy.common.multiDataSource.DataSourceContext;
import com.dy.common.softUpgrade.state.UpgradeInfo;
import com.dy.common.softUpgrade.state.UpgradeRtu;
import com.dy.common.softUpgrade.state.UpgradeState;
@@ -12,6 +14,8 @@
import com.dy.pipIrrGlobal.pojoUg.UgRtuTask;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -43,11 +47,15 @@
     */
    @Hidden //不公开接口,其只有通信中间件调用
    @PostMapping(path = "/receive")
    public BaseResponse<Boolean> receive(@RequestBody UpgradeInfo info){
        log.info("接收到的RTU远程升级状态数据为:{}", info.toString());
    public BaseResponse<Boolean> receive(@RequestBody UpgradeInfo info, HttpServletRequest req, HttpServletResponse rep){
        log.info("接收到的RTU远程升级状态数据为:{}", info.toString("532328000214"));
        //进行排序
        //Comparator<UpgradeRtu> comparator = Comparator.comparing(UpgradeRtu::getRtuAddr, Comparator.naturalOrder());
        //info.ugRtuStateList = info.ugRtuStateList.stream().sorted(comparator).collect(Collectors.toList());
        //通信中间件传过来的机构tag,以用于查找数据源
        String token = req.getHeader(Constant.UserTokenKeyInHeader);
        DataSourceContext.set(token);
        if(info.ugRtuStateList != null && info.ugRtuStateList.size() > 0){
            if(info.ugRtuStateList.size() < 10){
@@ -218,27 +226,62 @@
            //离线的,不处理
            return ;
        }
        int n = Integer.parseInt(new CreateRandom().create(2)) ;
        if(n == 44 || n == 45 || n == 54){
            if(rtu.currentPackage == 1){
                //1包死
                rtu.state = UpgradeRtu.STATE_FAILONE ;
                return ;
            }
        }
        if(rtu.currentPackage == rtu.totalPackage){
            //升级结束
            rtu.state = UpgradeRtu.STATE_SUCCESS ;
            rtu.isOver = true ;
            return ;
        }
        if(rtu.reTryTimes >= 2){
            //重试次数达到最大值
            if(rtu.state == UpgradeRtu.STATE_FAILONE ||
                    rtu.state == UpgradeRtu.STATE_FAIL){
                //又失败了,认为结束了
                rtu.isOver = true ;
                return ;
            }
        }
        rtu.state = UpgradeRtu.STATE_RUNNING ;
        rtu.currentPackage += 1 ;
        rtu.currentRamAddr = 0x00 + UpgradeRtu.RAMADDRADD ;
        rtu.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
        rtu.reTryTimes = 0 ;
        rtu.isOver = false ;
        int n = Integer.parseInt(new CreateRandom().create(3)) ;
        if(n == 540 || n == 541 || n == 542 || n == 543 || n == 544 || n == 545){
            if(rtu.currentPackage == 1){
                //1包死
                rtu.state = UpgradeRtu.STATE_FAILONE ;
                return ;
            }
        }
        if(n == 450 || n == 451 || n == 452 || n == 453 || n == 454 || n == 455){
            if(rtu.currentPackage != 1){
                //升死
                rtu.state = UpgradeRtu.STATE_FAIL ;
                return ;
            }
        }
        if(rtu.state == UpgradeRtu.STATE_FAILONE ||
                rtu.state == UpgradeRtu.STATE_FAIL){
            if(rtu.reTryTimes < 2){
                rtu.state = UpgradeRtu.STATE_RUNNING ;
                rtu.currentPackage = 1 ;
                rtu.currentRamAddr = 0x00 ;
                rtu.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                rtu.reTryTimes++ ;
                rtu.isOver = false ;
                return ;
            }
        }
        if(rtu.state != UpgradeRtu.STATE_FAILONE &&
                rtu.state != UpgradeRtu.STATE_FAIL){
            rtu.state = UpgradeRtu.STATE_RUNNING ;
            rtu.currentPackage += 1 ;
            rtu.currentRamAddr = 0x00 + UpgradeRtu.RAMADDRADD ;
            rtu.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
            rtu.isOver = false ;
        }
    }
    /**
@@ -249,6 +292,7 @@
        boolean hasRunning = false ;
        if(cache.ugRtuStateList != null && cache.ugRtuStateList.size() > 0){
            cache.ugOverallState.init();
            cache.ugOverallState.rtuTotal = cache.ugRtuStateList.size() ;
            for(UpgradeRtu rtu : cache.ugRtuStateList){
                if(rtu.state == UpgradeRtu.STATE_OFFLINE){
                    cache.ugOverallState.offLineTotal ++ ;
@@ -270,6 +314,9 @@
                }
            }
        }
        if(!hasRunning){
            cache.ugOverallState.allOver = true ;
        }
        return hasRunning ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/RechargeDtoMapper.java
@@ -3,6 +3,7 @@
import com.dy.pipIrrSell.recharge.DtoRecharge;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -12,7 +13,7 @@
 * @Description å°†DtoActiveCard映射为DtoRecharge
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface RechargeDtoMapper {
    RechargeDtoMapper INSTANCT = Mappers.getMapper(RechargeDtoMapper.class);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/converter/RechargeDtoMapper.java
@@ -4,6 +4,7 @@
import com.dy.pipIrrSell.cardOperate.dto.DtoRecharge;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -13,7 +14,7 @@
 * @Description
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface RechargeDtoMapper {
    RechargeDtoMapper INSTANCT = Mappers.getMapper(RechargeDtoMapper.class);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoReceipt.java
@@ -3,6 +3,7 @@
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -12,6 +13,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Schema(name = "收据查询条件")
public class QoReceipt extends QueryConditionVo {
    @Schema(description = "交易ID")
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java
@@ -3,6 +3,7 @@
import com.dy.pipIrrGlobal.pojoSe.SeClient;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -12,7 +13,7 @@
 * @Description
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DtoClientToSeClient {
    DtoClientToSeClient INSTANCT = Mappers.getMapper(DtoClientToSeClient.class);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/SeClientToVoClient.java
@@ -4,6 +4,7 @@
import com.dy.pipIrrGlobal.voSe.VoClient;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -13,7 +14,7 @@
 * @Description
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface SeClientToVoClient {
    SeClientToVoClient INSTANCT = Mappers.getMapper(SeClientToVoClient.class);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/dto/DtoVcRecharge.java
@@ -12,6 +12,7 @@
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Schema(name = "虚拟卡充值记录查询条件")
public class DtoVcRecharge extends QueryConditionVo {
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QoWalletRecharge.java
@@ -3,6 +3,7 @@
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -12,6 +13,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Schema(name = "电子钱包充值查询条件")
public class QoWalletRecharge extends QueryConditionVo {
    @Schema(description = "电子钱包账户ID")
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QueryVo.java
@@ -3,6 +3,7 @@
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -12,6 +13,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Schema(name = "电子钱包账户查询条件")
public class QueryVo extends QueryConditionVo {
    @Schema(description = "农户姓名")
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/AutomaticClose.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@@ -12,6 +13,7 @@
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class AutomaticClose extends DtoBase {
    public static final long serialVersionUID = 202407231056001L;
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/Recharge.java
@@ -2,6 +2,7 @@
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -11,6 +12,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class Recharge extends DtoBase {
    public static final long serialVersionUID = 202406261045001L;
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/issue/qo/QoIssueReport.java
@@ -2,6 +2,7 @@
import com.dy.common.webUtil.QueryConditionVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -11,6 +12,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class QoIssueReport extends QueryConditionVo {
    /**
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/SeClientToVoClient.java
@@ -4,6 +4,7 @@
import com.dy.pipIrrGlobal.voSe.VoClient;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
@@ -13,7 +14,7 @@
 * @Description
 */
@Mapper
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface SeClientToVoClient {
    SeClientToVoClient INSTANCT = Mappers.getMapper(SeClientToVoClient.class);
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/qo/QoVcRecharge.java
@@ -2,6 +2,7 @@
import com.dy.common.webUtil.QueryConditionVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author ZhuBaoMin
@@ -11,6 +12,7 @@
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class QoVcRecharge extends QueryConditionVo {
    /**