Browse Source

完成PDA任务管理

zhifei 1 year ago
parent
commit
6b66c7b255

+ 2 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java

@@ -123,8 +123,7 @@ public class WcsTaskController extends BaseController {
         if (StringUtils.isNotEmpty(wcsTask.getAgvNo())) {
             agvNo = Integer.parseInt(wcsTask.getAgvNo());
         }
-        AjaxResult ajaxResult = wcsTaskService.callBack(wcsTask.getTaskNo(), 4, agvNo);
-        return ajaxResult;
+        return wcsTaskService.callBack(wcsTask.getTaskNo(), 4, agvNo);
     }
 
     @Log(title = "卸货任务完成", businessType = BusinessType.INSERT)
@@ -138,8 +137,7 @@ public class WcsTaskController extends BaseController {
         if (StringUtils.isNotEmpty(wcsTask.getAgvNo())) {
             agvNo = Integer.parseInt(wcsTask.getAgvNo());
         }
-        AjaxResult ajaxResult = wcsTaskService.callBack(wcsTask.getTaskNo(),2,agvNo);
-        return ajaxResult;
+        return wcsTaskService.callBack(wcsTask.getTaskNo(),2,agvNo);
     }
 
     @Log(title = "任务取消", businessType = BusinessType.INSERT)

+ 74 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/pda/PdawcsTaskController.java

@@ -0,0 +1,74 @@
+package com.ruoyi.web.controller.warewms.pda;
+
+import com.ruoyi.ams.task.domain.WcsTask;
+import com.ruoyi.ams.task.service.IWcsTaskService;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * AGV任务Controller
+ *
+ * @author andy
+ * @date 2022-03-10
+ */
+@RestController
+@RequestMapping("/app/wcsTask")
+public class PdawcsTaskController extends BaseController {
+    @Autowired
+    private IWcsTaskService wcsTaskService;
+
+
+    @GetMapping("/list")
+    public AjaxResult getlist(WcsTask wcsTask) {
+        startPage();
+        List<WcsTask> list = wcsTaskService.selectWcsTaskList(wcsTask);
+        return new AjaxResult(200,"查询成功!",list);
+    }
+
+    @Log(title = "取货任务完成", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/taskPickupComplete")
+    public AjaxResult taskPickupComplete(@RequestBody WcsTask task) {
+        int agvNo = 9999;
+        WcsTask wcsTask = wcsTaskService.selectWcsTaskByTaskNo(task.getTaskNo());
+        if (wcsTask == null) {
+            return AjaxResult.error("任务回调失败");
+        }
+        if (StringUtils.isNotEmpty(wcsTask.getAgvNo())) {
+            agvNo = Integer.parseInt(wcsTask.getAgvNo());
+        }
+        return  wcsTaskService.callBack(wcsTask.getTaskNo(), 4, agvNo);
+    }
+
+    @Log(title = "卸货任务完成", businessType = BusinessType.INSERT)
+    @PostMapping (value = "/taskComplete")
+    public AjaxResult taskComplete(@RequestBody WcsTask task) {
+        int agvNo = 9999;
+        WcsTask wcsTask = wcsTaskService.selectWcsTaskByTaskNo(task.getTaskNo());
+        if (wcsTask == null) {
+           return AjaxResult.error("任务回调失败");
+        }
+        if (StringUtils.isNotEmpty(wcsTask.getAgvNo())) {
+            agvNo = Integer.parseInt(wcsTask.getAgvNo());
+        }
+        return  wcsTaskService.callBack(wcsTask.getTaskNo(),2,agvNo);
+    }
+
+    @Log(title = "任务取消", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/taskCancel")
+    public AjaxResult taskCancel(@RequestBody WcsTask task) {
+        WcsTask wcsTask = wcsTaskService.selectWcsTaskByTaskNo(task.getTaskNo());
+        if (wcsTask == null) {
+            AjaxResult.error("任务查询不存在");
+        }
+        wcsTaskService.cancelTask(wcsTask);
+        return AjaxResult.success("任务取消指令下发成功!");
+    }
+
+}