From 5c0622d48c825ca4b75f63dda78d51ed75bc7a2f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 12 四月 2024 11:04:19 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java |   38 ++++++++++++--------------------------
 1 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java
index cfca0db..0d519de 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java
@@ -10,12 +10,14 @@
 import com.zy.asrs.wcs.common.domain.BaseParam;
 import com.zy.asrs.wcs.common.domain.KeyValVo;
 import com.zy.asrs.wcs.common.domain.PageParam;
+import com.zy.asrs.wcs.core.domain.param.ShuttleMoveLocParam;
 import com.zy.asrs.wcs.core.domain.param.ShuttleOperatorParam;
 import com.zy.asrs.wcs.core.entity.BasShuttle;
 import com.zy.asrs.wcs.core.entity.Motion;
 import com.zy.asrs.wcs.core.entity.Task;
 import com.zy.asrs.wcs.core.entity.TaskCtg;
 import com.zy.asrs.wcs.core.kernel.AnalyzeService;
+import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
 import com.zy.asrs.wcs.core.model.enums.TaskStsType;
 import com.zy.asrs.wcs.core.service.BasShuttleService;
 import com.zy.asrs.wcs.core.service.MotionService;
@@ -29,7 +31,6 @@
 import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
 import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol;
 import com.zy.asrs.wcs.rcs.service.DeviceService;
-import com.zy.asrs.wcs.rcs.service.DeviceTypeService;
 import com.zy.asrs.wcs.rcs.thread.ShuttleThread;
 import com.zy.asrs.wcs.system.controller.BaseController;
 import com.zy.asrs.wcs.utils.ExcelUtil;
@@ -59,8 +60,6 @@
     private MotionService motionService;
     @Autowired
     private DeviceService deviceService;
-    @Autowired
-    private DeviceTypeService deviceTypeService;
 
     @PreAuthorize("hasAuthority('core:basShuttle:list')")
     @PostMapping("/basShuttle/page")
@@ -200,25 +199,12 @@
     @PreAuthorize("hasAuthority('core:basShuttle:operator')")
     @PostMapping("/basShuttle/moveLoc")
     @Transactional
-    public synchronized R shuttleMoveLoc(@RequestParam Integer shuttleNo,
-                            @RequestParam Integer moveType,
-                            @RequestParam Integer xStart,
-                            @RequestParam Integer xTarget,
-                            @RequestParam Integer yStart,
-                            @RequestParam Integer yTarget) {
-        DeviceType deviceType = deviceTypeService.getOne(new LambdaQueryWrapper<DeviceType>()
-                .eq(DeviceType::getFlag, String.valueOf(SlaveType.Shuttle))
-                .eq(DeviceType::getStatus, 1)
-                .eq(DeviceType::getHostId, getHostId()));
-        if (deviceType == null) {
-            return R.error();
-        }
-
+    public synchronized R shuttleMoveLoc(@RequestBody ShuttleMoveLocParam param) {
         Device device = deviceService.getOne(new LambdaQueryWrapper<Device>()
-                .eq(Device::getDeviceType, deviceType.getId())
+                .eq(Device::getDeviceType, DeviceCtgType.SHUTTLE.val())
                 .eq(Device::getStatus, 1)
                 .eq(Device::getHostId, getHostId())
-                .eq(Device::getDeviceNo, shuttleNo));
+                .eq(Device::getDeviceNo, param.getShuttleNo()));
         if (device == null) {
             return R.error();
         }
@@ -238,13 +224,13 @@
         }
 
         shuttleProtocol.setMoveLoc(true);//寮�鍚窇搴�
-        shuttleProtocol.setMoveType(moveType);
-        shuttleProtocol.setXStart(xStart);
-        shuttleProtocol.setXTarget(xTarget);
-        shuttleProtocol.setXCurrent(xStart);
-        shuttleProtocol.setYStart(yStart);
-        shuttleProtocol.setYTarget(yTarget);
-        shuttleProtocol.setYCurrent(yStart);
+        shuttleProtocol.setMoveType(param.getMoveType());
+        shuttleProtocol.setXStart(param.getStartX());
+        shuttleProtocol.setXTarget(param.getTargetX());
+        shuttleProtocol.setXCurrent(param.getStartX());
+        shuttleProtocol.setYStart(param.getStartY());
+        shuttleProtocol.setYTarget(param.getTargetY());
+        shuttleProtocol.setYCurrent(param.getStartY());
         return R.ok();
     }
 

--
Gitblit v1.9.1