From 7aab004601e77890b158f19d1735594a8326feaa Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 24 四月 2025 17:11:17 +0800
Subject: [PATCH] 数据库事务注解位置调整

---
 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java |  462 ++++++++++++++++++++++++++++++--------------------------
 1 files changed, 247 insertions(+), 215 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java
index 2dc85c6..c00d8c6 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java
@@ -85,141 +85,143 @@
             return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
 
-        Long intakeId = valve.getIntakeId();
-        String intakeName = valve.getIntakeName();
-        Long vcId = valve.getVcId();
-        Boolean forceOpen = valve.getForceOpen();
-        Long operator = valve.getOperator();
-        Long comId = new IDLongGenerator().generate();
-
-        if(intakeId == null && intakeName == null) {
-            return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
+        Map map_result = commandSv.openWx(valve, null, null);
+        if(map_result.get("success").equals(false)) {
+            return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString());
         }
+        return BaseResponseUtils.buildSuccess(map_result.get("content")) ;
 
-        // intakeName鎹ntakeId
-        if(intakeId == null) {
-            intakeId = commandSv.getIntakeIdByName(intakeName);
-            if(intakeId == null) {
-                return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
-            }
-        }
-
-        /**
-         * 濡傛灉鍐滄埛閫夋嫨浜嗚櫄鎷熷崱锛屽垯浣跨敤璇ヨ櫄鎷熷崱
-         * 濡傛灉鍐滄埛鏈�夋嫨铏氭嫙鍗★紝鍒欐牴鎹彇姘村彛ID鑾峰彇涓庝箣缁戝畾鐨勮櫄鎷熷崱
-         * 濡傛灉鍙栨按鍙f病鏈変笌涔嬬粦瀹氱殑铏氭嫙鍗★紝鍒欐彁绀哄啘鎴烽�夋嫨涓�寮犺櫄鎷熷崱
-         */
-        if (vcId == null) {
-            vcId = commandSv.getVcIdByIntakeId(intakeId);
-            if (vcId == null) {
-                return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage());
-            }
-        }
-
-        // 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄
-        VoVirtualCard vc = commandSv.getVcById(vcId);
-        if (vc == null) {
-            return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage());
-        }
-
-        // 铏氭嫙鍗$姸鎬佷负浣跨敤涓紝涓斾笉鏄己鍒跺紑闃�鏃舵彁绀�
-        if (vc.getInUse() && !forceOpen) {
-            return BaseResponseUtils.buildCodeMsg(WechatResultCode.IN_USE_VC_CANNOT_OPEN_VALVE.getCode(), WechatResultCode.IN_USE_VC_CANNOT_OPEN_VALVE.getMessage());
-        }
-
-        // 鑾峰彇姘翠环
-        Double waterPrice = commandSv.getPrice();
-        if(waterPrice == null) {
-            return BaseResponseUtils.buildErrorMsg(WechatResultCode.NO_WATER_PRICE.getMessage());
-        }
-
-        // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚
-        JSONObject job_rtu = getRtu(intakeId, null);
-        if (job_rtu == null) {
-            return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage());
-        }
-        String rtuAddr = job_rtu.getString("rtuAddr");
-        String protocol = job_rtu.getString("protocol");
-        //String orgTag = job_rtu.getString("orgTag");
-        //if(orgTag == null) {
-        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_SET_DATA_SOURCE.getMessage());
+        //Long intakeId = valve.getIntakeId();
+        //String intakeName = valve.getIntakeName();
+        //Long vcId = valve.getVcId();
+        //Boolean forceOpen = valve.getForceOpen();
+        //Long operator = valve.getOperator();
+        //Long comId = new IDLongGenerator().generate();
+        //
+        //if(intakeId == null && intakeName == null) {
+        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
         //}
-        //comSendUrl = env.getProperty(pro_mw + "." + orgTag + "." + key_mw);
-        comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw);
-
-        // 鐢熸垚璁㈠崟鍙�
-        String orderNo = generateOrderNo();
-        if(orderNo == null) {
-            return BaseResponseUtils.buildErrorMsg(WechatResultCode.NO_ORDER_NUMBER.getMessage());
-        }
-
-        String commandCode = null;
-        if (protocol.equals(ProtocolConstantV206V202404.protocolName)) {
-            // 鑾峰彇鍔熻兘鐮�
-            commandCode = CodeV202404.cd_A2;
-
-            // 鍒涘缓瑙嗗浘
-            ComCd92_A2Vo param = new ComCd92_A2Vo();
-            param.controllerType = controllerType;
-            param.projectNo = projectNo;
-            param.icCardNo = vc.getVcNum().toString();
-            param.waterRemain = 0.0;
-            param.moneyRemain = vc.getMoney();
-            param.waterPrice = waterPrice;
-            param.elePrice = 0.0;
-            param.orderNo = orderNo;
-
-            /**
-             * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
-             * 1 鍑嗗鍙傛暟
-             * 2 璋冪敤鍏叡鏂规硶
-             */
-            Param myParam = new Param();
-            myParam.setComId(comId);
-            myParam.setComType((byte)1);
-            myParam.setCommandCode(commandCode);
-            myParam.setCommandName(CodeV202404.getCodeName(commandCode));
-            myParam.setIntakeId(intakeId);
-            myParam.setRtuAddr(rtuAddr);
-            myParam.setProtocol(protocol);
-            myParam.setVcId(vcId);
-            myParam.setParam(param);
-            myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
-            myParam.setOperator(operator);
-            return dealWithCommandResult(myParam);
-
-        } else if (protocol.equals(ProtocolConstantV206V1.protocolName) || protocol.equals(ProtocolConstantV206V2.protocolName)) {
-            // 鑾峰彇鍔熻兘鐮�
-            commandCode = CodeV1.cd_97;
-
-            // 鍒涘缓瑙嗗浘
-            Com97Vo param = new Com97Vo();
-            param.icCardNo = vc.getVcNum().toString();
-            param.moneyRemain = vc.getMoney();
-            param.waterPrice = waterPrice;
-            param.orderNo = orderNo;
-
-            /**
-             * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
-             * 1 鍑嗗鍙傛暟
-             * 2 璋冪敤鍏叡鏂规硶
-             */
-            Param myParam = new Param();
-            myParam.setComId(comId);
-            myParam.setComType((byte)1);
-            myParam.setCommandCode(commandCode);
-            myParam.setCommandName(CodeV1.getCodeName(commandCode));
-            myParam.setIntakeId(intakeId);
-            myParam.setRtuAddr(rtuAddr);
-            myParam.setProtocol(protocol);
-            myParam.setVcId(vcId);
-            myParam.setParam(param);
-            myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
-            myParam.setOperator(operator);
-            return dealWithCommandResult(myParam);
-        } else {
-            return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�");
-        }
+        //
+        //// intakeName鎹ntakeId
+        //if(intakeId == null) {
+        //    intakeId = commandSv.getIntakeIdByName(intakeName);
+        //    if(intakeId == null) {
+        //        return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
+        //    }
+        //}
+        //
+        ///**
+        // * 濡傛灉鍐滄埛閫夋嫨浜嗚櫄鎷熷崱锛屽垯浣跨敤璇ヨ櫄鎷熷崱
+        // * 濡傛灉鍐滄埛鏈�夋嫨铏氭嫙鍗★紝鍒欐牴鎹彇姘村彛ID鑾峰彇涓庝箣缁戝畾鐨勮櫄鎷熷崱
+        // * 濡傛灉鍙栨按鍙f病鏈変笌涔嬬粦瀹氱殑铏氭嫙鍗★紝鍒欐彁绀哄啘鎴烽�夋嫨涓�寮犺櫄鎷熷崱
+        // */
+        //if (vcId == null) {
+        //    vcId = commandSv.getVcIdByIntakeId(intakeId);
+        //    if (vcId == null) {
+        //        return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage());
+        //    }
+        //}
+        //
+        //// 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄
+        //VoVirtualCard vc = commandSv.getVcById(vcId);
+        //if (vc == null) {
+        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage());
+        //}
+        //
+        //// 铏氭嫙鍗$姸鎬佷负浣跨敤涓紝涓斾笉鏄己鍒跺紑闃�鏃舵彁绀�
+        //if (vc.getInUse() && !forceOpen) {
+        //    return BaseResponseUtils.buildCodeMsg(WechatResultCode.IN_USE_VC_CANNOT_OPEN_VALVE.getCode(), WechatResultCode.IN_USE_VC_CANNOT_OPEN_VALVE.getMessage());
+        //}
+        //
+        //// 鑾峰彇姘翠环
+        //Double waterPrice = commandSv.getPrice();
+        //if(waterPrice == null) {
+        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.NO_WATER_PRICE.getMessage());
+        //}
+        //
+        //// 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚
+        //JSONObject job_rtu = getRtu(intakeId, null);
+        //if (job_rtu == null) {
+        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage());
+        //}
+        //String rtuAddr = job_rtu.getString("rtuAddr");
+        //String protocol = job_rtu.getString("protocol");
+        //
+        //comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw);
+        //
+        //// 鐢熸垚璁㈠崟鍙�
+        //String orderNo = generateOrderNo();
+        //if(orderNo == null) {
+        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.NO_ORDER_NUMBER.getMessage());
+        //}
+        //
+        //String commandCode = null;
+        //if (protocol.equals(ProtocolConstantV206V202404.protocolName)) {
+        //    // 鑾峰彇鍔熻兘鐮�
+        //    commandCode = CodeV202404.cd_A2;
+        //
+        //    // 鍒涘缓瑙嗗浘
+        //    ComCd92_A2Vo param = new ComCd92_A2Vo();
+        //    param.controllerType = controllerType;
+        //    param.projectNo = projectNo;
+        //    param.icCardNo = vc.getVcNum().toString();
+        //    param.waterRemain = 0.0;
+        //    param.moneyRemain = vc.getMoney();
+        //    param.waterPrice = waterPrice;
+        //    param.elePrice = 0.0;
+        //    param.orderNo = orderNo;
+        //
+        //    /**
+        //     * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
+        //     * 1 鍑嗗鍙傛暟
+        //     * 2 璋冪敤鍏叡鏂规硶
+        //     */
+        //    Param myParam = new Param();
+        //    myParam.setComId(comId);
+        //    myParam.setComType((byte)1);
+        //    myParam.setCommandCode(commandCode);
+        //    myParam.setCommandName(CodeV202404.getCodeName(commandCode));
+        //    myParam.setIntakeId(intakeId);
+        //    myParam.setRtuAddr(rtuAddr);
+        //    myParam.setProtocol(protocol);
+        //    myParam.setVcId(vcId);
+        //    myParam.setParam(param);
+        //    myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
+        //    myParam.setOperator(operator);
+        //    return dealWithCommandResult(myParam);
+        //
+        //} else if (protocol.equals(ProtocolConstantV206V1.protocolName) || protocol.equals(ProtocolConstantV206V2.protocolName)) {
+        //    // 鑾峰彇鍔熻兘鐮�
+        //    commandCode = CodeV1.cd_97;
+        //
+        //    // 鍒涘缓瑙嗗浘
+        //    Com97Vo param = new Com97Vo();
+        //    param.icCardNo = vc.getVcNum().toString();
+        //    param.moneyRemain = vc.getMoney();
+        //    param.waterPrice = waterPrice;
+        //    param.orderNo = orderNo;
+        //
+        //    /**
+        //     * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
+        //     * 1 鍑嗗鍙傛暟
+        //     * 2 璋冪敤鍏叡鏂规硶
+        //     */
+        //    Param myParam = new Param();
+        //    myParam.setComId(comId);
+        //    myParam.setComType((byte)1);
+        //    myParam.setCommandCode(commandCode);
+        //    myParam.setCommandName(CodeV1.getCodeName(commandCode));
+        //    myParam.setIntakeId(intakeId);
+        //    myParam.setRtuAddr(rtuAddr);
+        //    myParam.setProtocol(protocol);
+        //    myParam.setVcId(vcId);
+        //    myParam.setParam(param);
+        //    myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
+        //    myParam.setOperator(operator);
+        //    return dealWithCommandResult(myParam);
+        //} else {
+        //    return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�");
+        //}
     }
 
     /**
@@ -236,87 +238,93 @@
             return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
 
-        String rtuAddr = valve.getRtuAddr();
-        String vcNum = valve.getVcNum();
-        Long vcId = Optional.ofNullable(seVirtualCardMapper.getVcIdByNum(vcNum)).orElse(0L);
-        String orderNo = valve.getOrderNo();
-        Long operator = valve.getOperator();
-        Long comId = new IDLongGenerator().generate();
-
-        // 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚
-        JSONObject job_rtu = getRtu(null, rtuAddr);
-        if (job_rtu == null) {
-            return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage());
+        Map map_result = commandSv.closeWx(valve, null, null);
+        if(map_result.get("success").equals(false)) {
+            return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString());
         }
-        Long intakeId = job_rtu.getLong("intakeId");
-        String protocol = job_rtu.getString("protocol");
-        //String orgTag = job_rtu.getString("orgTag");
-        //if(orgTag == null) {
-        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_SET_DATA_SOURCE.getMessage());
+        return BaseResponseUtils.buildSuccess(map_result.get("content")) ;
+
+        //String rtuAddr = valve.getRtuAddr();
+        //String vcNum = valve.getVcNum();
+        //Long vcId = Optional.ofNullable(seVirtualCardMapper.getVcIdByNum(vcNum)).orElse(0L);
+        //String orderNo = valve.getOrderNo();
+        //Long operator = valve.getOperator();
+        //Long comId = new IDLongGenerator().generate();
+        //
+        //// 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚
+        //JSONObject job_rtu = getRtu(null, rtuAddr);
+        //if (job_rtu == null) {
+        //    return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage());
         //}
-        //comSendUrl = env.getProperty(pro_mw + "." + orgTag + "." + key_mw);
-        comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw);
-
-        String commandCode = null;
-        if (protocol.equals(ProtocolConstantV206V202404.protocolName)) {
-            // 鑾峰彇鍔熻兘鐮�
-            commandCode = CodeV202404.cd_A3;
-
-            // 鍒涘缓瑙嗗浘
-            ComCd93_A3Vo param = new ComCd93_A3Vo();
-            param.controllerType = controllerType;
-            param.projectNo = projectNo;
-            param.icCardNo = vcNum;
-            param.orderNo = orderNo;
-
-            /**
-             * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
-             * 1 鍑嗗鍙傛暟
-             * 2 璋冪敤鍏叡鏂规硶
-             */
-            Param myParam = new Param();
-            myParam.setComId(comId);
-            myParam.setComType((byte)2);
-            myParam.setCommandCode(commandCode);
-            myParam.setCommandName(CodeV202404.getCodeName(commandCode));
-            myParam.setIntakeId(intakeId);
-            myParam.setRtuAddr(rtuAddr);
-            myParam.setProtocol(protocol);
-            myParam.setVcId(vcId);
-            myParam.setParam(param);
-            myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
-            myParam.setOperator(operator);
-            return dealWithCommandResult(myParam);
-        } else if (protocol.equals(ProtocolConstantV206V1.protocolName) || protocol.equals(ProtocolConstantV206V2.protocolName)) {
-            // 鑾峰彇鍔熻兘鐮�
-            commandCode = CodeV1.cd_98;
-
-            // 鍒涘缓瑙嗗浘
-            Com98Vo param = new Com98Vo();
-            param.icCardNo = vcNum;
-            param.orderNo = orderNo;
-
-            /**
-             * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
-             * 1 鍑嗗鍙傛暟
-             * 2 璋冪敤鍏叡鏂规硶
-             */
-            Param myParam = new Param();
-            myParam.setComId(comId);
-            myParam.setComType((byte)2);
-            myParam.setCommandCode(commandCode);
-            myParam.setCommandName(CodeV1.getCodeName(commandCode));
-            myParam.setIntakeId(intakeId);
-            myParam.setRtuAddr(rtuAddr);
-            myParam.setProtocol(protocol);
-            myParam.setVcId(vcId);
-            myParam.setParam(param);
-            myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
-            myParam.setOperator(operator);
-            return dealWithCommandResult(myParam);
-        } else {
-            return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�");
-        }
+        //Long intakeId = job_rtu.getLong("intakeId");
+        //String protocol = job_rtu.getString("protocol");
+        ////String orgTag = job_rtu.getString("orgTag");
+        ////if(orgTag == null) {
+        ////    return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_SET_DATA_SOURCE.getMessage());
+        ////}
+        ////comSendUrl = env.getProperty(pro_mw + "." + orgTag + "." + key_mw);
+        //comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw);
+        //
+        //String commandCode = null;
+        //if (protocol.equals(ProtocolConstantV206V202404.protocolName)) {
+        //    // 鑾峰彇鍔熻兘鐮�
+        //    commandCode = CodeV202404.cd_A3;
+        //
+        //    // 鍒涘缓瑙嗗浘
+        //    ComCd93_A3Vo param = new ComCd93_A3Vo();
+        //    param.controllerType = controllerType;
+        //    param.projectNo = projectNo;
+        //    param.icCardNo = vcNum;
+        //    param.orderNo = orderNo;
+        //
+        //    /**
+        //     * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
+        //     * 1 鍑嗗鍙傛暟
+        //     * 2 璋冪敤鍏叡鏂规硶
+        //     */
+        //    Param myParam = new Param();
+        //    myParam.setComId(comId);
+        //    myParam.setComType((byte)2);
+        //    myParam.setCommandCode(commandCode);
+        //    myParam.setCommandName(CodeV202404.getCodeName(commandCode));
+        //    myParam.setIntakeId(intakeId);
+        //    myParam.setRtuAddr(rtuAddr);
+        //    myParam.setProtocol(protocol);
+        //    myParam.setVcId(vcId);
+        //    myParam.setParam(param);
+        //    myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
+        //    myParam.setOperator(operator);
+        //    return dealWithCommandResult(myParam);
+        //} else if (protocol.equals(ProtocolConstantV206V1.protocolName) || protocol.equals(ProtocolConstantV206V2.protocolName)) {
+        //    // 鑾峰彇鍔熻兘鐮�
+        //    commandCode = CodeV1.cd_98;
+        //
+        //    // 鍒涘缓瑙嗗浘
+        //    Com98Vo param = new Com98Vo();
+        //    param.icCardNo = vcNum;
+        //    param.orderNo = orderNo;
+        //
+        //    /**
+        //     * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋�
+        //     * 1 鍑嗗鍙傛暟
+        //     * 2 璋冪敤鍏叡鏂规硶
+        //     */
+        //    Param myParam = new Param();
+        //    myParam.setComId(comId);
+        //    myParam.setComType((byte)2);
+        //    myParam.setCommandCode(commandCode);
+        //    myParam.setCommandName(CodeV1.getCodeName(commandCode));
+        //    myParam.setIntakeId(intakeId);
+        //    myParam.setRtuAddr(rtuAddr);
+        //    myParam.setProtocol(protocol);
+        //    myParam.setVcId(vcId);
+        //    myParam.setParam(param);
+        //    myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
+        //    myParam.setOperator(operator);
+        //    return dealWithCommandResult(myParam);
+        //} else {
+        //    return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�");
+        //}
     }
 
     /**
@@ -416,7 +424,15 @@
             myParam.setParam(param);
             myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
             myParam.setOperator(operator);
-            return dealWithCommandResult(myParam);
+            //return dealWithCommandResult(myParam);
+
+            BaseResponse<Boolean> result = dealWithCommandResult(myParam);
+            // 濡傛灉鍛戒护鎵ц澶辫触锛屽垯鍐嶆鎵ц鍛戒护
+            if(!result.isSuccess()) {
+                myParam.setComId(new IDLongGenerator().generate());
+                result = dealWithCommandResult(myParam);
+            }
+            return result;
         } else {
             return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�");
         }
@@ -519,7 +535,15 @@
             myParam.setParam(param);
             myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
             myParam.setOperator(operator);
-            return dealWithCommandResult(myParam);
+            //return dealWithCommandResult(myParam);
+
+            BaseResponse<Boolean> result = dealWithCommandResult(myParam);
+            // 濡傛灉鍛戒护鎵ц澶辫触锛屽垯鍐嶆鎵ц鍛戒护
+            if(!result.isSuccess()) {
+                myParam.setComId(new IDLongGenerator().generate());
+                result = dealWithCommandResult(myParam);
+            }
+            return result;
         } else {
             return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�");
         }
@@ -538,7 +562,7 @@
             return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
 
-        Map map_result = commandSv.planedOpenTimedClose(automaticClose, null,null);
+        Map map_result = commandSv.planedOpenTimedClose(automaticClose, null, null, null,null);
         if(map_result.get("success").equals(false)) {
             return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString());
         }
@@ -766,7 +790,15 @@
             myParam.setParam(param);
             myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx);
             myParam.setOperator(operator);
-            return dealWithCommandResult(myParam);
+            //return dealWithCommandResult(myParam);
+
+            BaseResponse<Boolean> result = dealWithCommandResult(myParam);
+            // 濡傛灉鍛戒护鎵ц澶辫触锛屽垯鍐嶆鎵ц鍛戒护
+            if(!result.isSuccess()) {
+                myParam.setComId(new IDLongGenerator().generate());
+                result = dealWithCommandResult(myParam);
+            }
+            return result;
         } else {
             return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�");
         }

--
Gitblit v1.8.0