Browse Source

Merge remote-tracking branch 'origin/xuankuang' into xuankuang

zhangxin 1 year ago
parent
commit
ecbcd5bcc2

+ 18 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/test/ChargingMachineTestController.java

@@ -3,6 +3,8 @@ package com.ruoyi.web.controller.warewms.test;
 import cn.hutool.json.JSONUtil;
 import com.jwk.spring.boot.autoconfigure.ModbusTcpMasterTemplate;
 import com.jwk.spring.boot.modbus4j.ModbusMasterUtil;
+import com.ruoyi.ams.agv.ndc.service.FeedbackTS;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.hard.ChargingMachineClient;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -10,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -29,6 +32,8 @@ public class ChargingMachineTestController {
 
     @Autowired(required = false)
     private ChargingMachineClient chargingMachineClient;
+    @Autowired
+    private FeedbackTS feedbackTS;
 
     /**
      * 充电机(三向车)
@@ -106,4 +111,17 @@ public class ChargingMachineTestController {
         }
         return statusNameMapping;
     }
+
+    /**
+     * 下发101任务
+     */
+    @ApiOperation("查询充电机状态")
+    @PostMapping("/sendTask101")
+    public AjaxResult sendTask101(@RequestBody Map<String, String> map) {
+        String taskNo = map.get("taskNo");
+        Integer index = Integer.valueOf(map.get("index"));
+        Integer agvNo = Integer.valueOf(map.get("agvNo"));
+        feedbackTS.feedbackTS101(taskNo, index, agvNo);
+        return AjaxResult.success();
+    }
 }

+ 2 - 1
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/AciService.java

@@ -145,7 +145,8 @@ public class AciService {
                             log.info("writeOrder:" + order);
                             if (t.getBusinessType().equals("m") ||
                                     t.getBusinessType().equals("01") ||
-                                    t.getBusinessType().equals("164")
+                                    t.getBusinessType().equals("164")||
+                                    t.getBusinessType().equals("101")
                             ) {
 
                                 buffer.put(ByteUtil.hexString2ByteArray(order));