Browse Source

充电机测试修改

k 1 year ago
parent
commit
e06b633a0d

+ 4 - 4
ruoyi-admin/src/main/resources/application-prod.yml

@@ -74,19 +74,19 @@ modbus:
             host: 192.168.100.161
             port: 502
         second: # 按钮盒
-            open: true
+            open: false
             host: 192.168.100.151
             port: 502
         third: # 按钮盒
-            open: true
+            open: false
             host: 192.168.100.152
             port: 502
         fourth: # 按钮盒
-            open: true
+            open: false
             host: 192.168.100.153
             port: 502
         fifth: # 按钮盒
-            open: true
+            open: false
             host: 192.168.100.154
             port: 502
         sixth: # 充电机

+ 13 - 11
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/service/ChargerButtService.java

@@ -169,7 +169,7 @@ public class ChargerButtService {
      */
     public void theChargingPositionHasBeenReached(Integer index, Integer chargingSite, Integer agvNo) {
         if (chargingMachineClient == null) {
-            log.error("充电机通讯开关关闭!");
+            log.info("充电机通讯开关关闭!");
             return;
         }
         String taskNo = "";
@@ -186,7 +186,7 @@ public class ChargerButtService {
                 && agvInfoMap.get(KEY_AGV_STS).toString().equals(AGV_CHARGING_STS.START.toString())) {
             // 反馈TS正常充电
             this.feedbackTSLog(taskNo, index, NORMAL, agvNo + "AGV开始充电!", xx);
-            log.error("充电机已经开始充电,不可重复请求!车号:{},充电机号:{}", agvNo, chargingSite);
+            log.info("充电机已经开始充电,不可重复请求!车号:{},充电机号:{}", agvNo, chargingSite);
             return;
         }
         // 如果是TS创建的充电任务 是没有对应的WcsTask任务 需要创建 并且设置到Redis
@@ -194,7 +194,7 @@ public class ChargerButtService {
         if (agvInfoMap.get(KEY_TASK_NO) == null || StringUtils.isEmpty(agvInfoMap.get(KEY_TASK_NO).toString())) {
             AjaxResult ajaxResult = wcsTaskService.addChargingTask(agvNo, chargingSite, index);
             if (!ajaxResult.isSuccess()) {
-                log.error(ajaxResult.getMsg());
+                log.info(ajaxResult.getMsg());
                 return;
             }
             taskNo = (String) ajaxResult.get("data");
@@ -273,12 +273,12 @@ public class ChargerButtService {
      */
     public void theChargingTaskCanceledArtificially(Integer index, Integer chargingSite, Integer agvNo) {
         if (chargingMachineClient == null) {
-            log.error("充电机通讯开关关闭!");
+            log.info("充电机通讯开关关闭!");
             return;
         }
         // 没有充电桩号没办法取消对应的充电机
         if (chargingSite == null) {
-            log.error("没有充电桩号没办法取消对应的充电机!");
+            log.info("没有充电桩号没办法取消对应的充电机!");
             return;
         }
         String taskNo = "";
@@ -315,8 +315,8 @@ public class ChargerButtService {
 //        if (wcsTask != null) {
 //            boolean con = wcsTask.getExt4().equals("1") ? true : false;
 //            if (!con) {
-                // 反馈TS结束充电
-                this.feedbackTSLog(taskNo, index, AGV_STOP, agvNo + ",AGV结束充电!", xx);
+        // 反馈TS结束充电
+        this.feedbackTSLog(taskNo, index, AGV_STOP, agvNo + ",AGV结束充电!", xx);
 //            }
 //        }
         // 下发一个TS101的任务
@@ -349,8 +349,10 @@ public class ChargerButtService {
             taskNo = agvInfoMap.get(KEY_TASK_NO).toString();
             // WcsTask
             wcsTask = wcsTaskService.selectWcsTaskByTaskNo(taskNo);
-            wcsTask.setExt4("1");
-            wcsTaskService.updateWcsTask(wcsTask);
+            if (wcsTask != null) {
+                wcsTask.setExt4("1");
+                wcsTaskService.updateWcsTask(wcsTask);
+            }
         }
     }
 
@@ -396,7 +398,7 @@ public class ChargerButtService {
         if (StringUtils.isNotEmpty(remarks)) {
             Map<String, Boolean> statusNameMapping = chargingMachineClient.getStatusNameMapping(xx);
             if (statusNameMapping != null) {
-                log.error(remarks + JSONUtil.toJsonStr(statusNameMapping));
+                log.info(remarks + JSONUtil.toJsonStr(statusNameMapping));
             }
         }
         // 反馈TS
@@ -584,7 +586,7 @@ public class ChargerButtService {
                 return con;
             }
             // 递归
-           return confirmChargerStatus(status, startTime, isRecursion, xx);
+            return confirmChargerStatus(status, startTime, isRecursion, xx);
         }
         return con;
     }