liurunyu
2024-11-29 8c1f294b7ba20b05753ad274dcb5530a389ea78d
RTU升级结果判断并数据库存逻辑bug修改
2个文件已修改
15 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuResultCtrl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuResultCtrl.java
@@ -83,7 +83,7 @@
     * @param response
     */
    @RequestMapping(value = "/exportAll", method = RequestMethod.GET)
    public void exportUgFail(HttpServletResponse response, QueryUgResultVo vo) throws Exception {
    public void exportAll(HttpServletResponse response, QueryUgResultVo vo) throws Exception {
        if(vo.state != null && vo.state == 1){
            //查询升级成功的
            vo.fail = null ;
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java
@@ -112,12 +112,15 @@
    private void save2Db(String taskId, List<UpgradeRtu> newList, List<UpgradeRtu> oldList){
        List<UpgradeRtu> newOverList = newList.stream().filter(vo -> vo.isOver).collect(Collectors.toList()) ;
        List<UpgradeRtu> oldNoOverList = newList.stream().filter(vo -> !vo.isOver).collect(Collectors.toList()) ;
        boolean oldExist = false ;
        for(UpgradeRtu nvo : newOverList){
            if(nvo != null) {
                if(oldNoOverList.stream().anyMatch(vo -> vo.rtuAddr.equals(nvo.rtuAddr))){
                    //上次没有升级结束,而当前升级结束了
                    this.sv.saveRtuUpgradeState(Long.parseLong(taskId), nvo);
                }
            oldExist = false ;
            if(oldNoOverList.stream().anyMatch(vo -> vo.rtuAddr.equals(nvo.rtuAddr))){
                oldExist = true ;
            }
            if(!oldExist){
                //上次没有升级结束,而当前升级结束了
                this.sv.saveRtuUpgradeState(Long.parseLong(taskId), nvo);
            }
        }
    }