Browse Source

充电相关sql维护

zhangxin 1 year ago
parent
commit
20a1dcefdc

File diff suppressed because it is too large
+ 14 - 0
base_sql/bucket_sql/xuankuang_ddl_20230904.sql


+ 4 - 8
warewms-hard/src/main/java/com/ruoyi/hard/ChargingMachineClient.java

@@ -89,8 +89,7 @@ public class ChargingMachineClient {
      * 则最终返回的数组:[0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
      */
     public boolean[] getStatus(boolean con) {
-        ModbusMasterUtil modbusMasterUtil = con ? modbusTcpMasterTemplateFourth.getModbusMasterUtil()
-                : modbusTcpMasterTemplateFifth.getModbusMasterUtil();
+        ModbusMasterUtil modbusMasterUtil = modbusTcpMasterTemplateFourth.getModbusMasterUtil();
         ReadResponse read = modbusMasterUtil.readCoils(1, CHARGER_STATUS.getOffset(), CHARGER_STATUS.getCommand());
         if (read == null || read.getBooleanData() == null) {
             log.error("获取充电机状态为空!");
@@ -109,8 +108,7 @@ public class ChargingMachineClient {
      * @return
      */
     private boolean start(boolean con) {
-        ModbusMasterUtil modbusMasterUtil = con ? modbusTcpMasterTemplateFourth.getModbusMasterUtil()
-                : modbusTcpMasterTemplateFifth.getModbusMasterUtil();
+        ModbusMasterUtil modbusMasterUtil = modbusTcpMasterTemplateFourth.getModbusMasterUtil();
         return modbusMasterUtil.writeCoil(1, START.getOffset(), START.getCommand());
     }
 
@@ -120,8 +118,7 @@ public class ChargingMachineClient {
      * @return
      */
     private boolean stop(boolean con) {
-        ModbusMasterUtil modbusMasterUtil = con ? modbusTcpMasterTemplateFourth.getModbusMasterUtil()
-                : modbusTcpMasterTemplateFifth.getModbusMasterUtil();
+        ModbusMasterUtil modbusMasterUtil = modbusTcpMasterTemplateFourth.getModbusMasterUtil();
         return modbusMasterUtil.writeCoil(1, STOP.getOffset(), STOP.getCommand());
     }
 
@@ -131,8 +128,7 @@ public class ChargingMachineClient {
      * @return
      */
     private boolean discharge(boolean con) {
-        ModbusMasterUtil modbusMasterUtil = con ? modbusTcpMasterTemplateFourth.getModbusMasterUtil()
-                : modbusTcpMasterTemplateFifth.getModbusMasterUtil();
+        ModbusMasterUtil modbusMasterUtil = modbusTcpMasterTemplateFourth.getModbusMasterUtil();
         return modbusMasterUtil.writeCoil(1, DISCHARGE.getOffset(), DISCHARGE.getCommand());
     }