From 1b7fa84d5b48c67f920ff9d3202ceb9bda80bdc5 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期二, 06 五月 2025 19:36:06 +0800
Subject: [PATCH] 地图绘制完成

---
 src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java |   69 +++++++++++++++++-----------------
 1 files changed, 34 insertions(+), 35 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index f2d45cb..a304dd6 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -5,13 +5,12 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.Cools;
 import com.core.common.R;
-import com.core.exception.CoolException;
 import com.zy.asrs.domain.enums.TaskStatusType;
 import com.zy.asrs.domain.enums.WorkNoType;
 import com.zy.asrs.entity.*;
+import com.zy.asrs.entity.param.TaskCreateParam;
 import com.zy.asrs.entity.param.TaskOverParam;
 import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam;
-import com.zy.asrs.entity.param.TaskCreateParam;
 import com.zy.asrs.service.*;
 import com.zy.asrs.utils.Utils;
 import com.zy.common.service.CommonService;
@@ -34,25 +33,6 @@
 @Service
 public class OpenServiceImpl implements OpenService {
 
-    @Autowired
-    private TaskWrkService taskWrkService;
-    @Autowired
-    private SlaveProperties slaveProperties;
-    @Autowired
-    private ApiLogService apiLogService;
-
-    @Autowired
-    private StaDescService staDescService;
-    @Autowired
-    private CommonService commonService;
-    @Autowired
-    private LocMastService locMastService;
-    @Autowired
-    private BasDevpService basDevpService;
-
-
-    @Value("${wms.url}")
-    private String wmsUrl;
     public ArrayList<String> wharfCode1 = new ArrayList<String>() {{
         add("J-1101");
         add("J-1103");
@@ -63,15 +43,30 @@
         add("H-1101");
         add("G-1101");
     }};
-
+    @Autowired
+    private TaskWrkService taskWrkService;
+    @Autowired
+    private SlaveProperties slaveProperties;
+    @Autowired
+    private ApiLogService apiLogService;
+    @Autowired
+    private StaDescService staDescService;
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private LocMastService locMastService;
+    @Autowired
+    private BasDevpService basDevpService;
+    @Value("${wms.url}")
+    private String wmsUrl;
 
     @Override
     public HashMap<String, Object> taskCreate(TaskCreateParam param) {
-        HashMap<String,Object> map=new HashMap<>();
+        HashMap<String, Object> map = new HashMap<>();
         TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
         if (taskWrk != null) {
-            map.put("Code","0");
-            map.put("Msg",param.getTaskNo()+"浠诲姟宸茬粡鐢熸垚锛�");
+            map.put("Code", "0");
+            map.put("Msg", param.getTaskNo() + "浠诲姟宸茬粡鐢熸垚锛�");
             return map;
         }
 
@@ -123,12 +118,12 @@
         }
 
         if (!taskWrkService.insert(taskWrk)) {
-            map.put("Code","0");
-            map.put("Msg",param.getTaskNo()+"鍒涘缓浠诲姟澶辫触锛�");
+            map.put("Code", "0");
+            map.put("Msg", param.getTaskNo() + "鍒涘缓浠诲姟澶辫触锛�");
             return map;
         }
-        map.put("Code","1");
-        map.put("Msg","ok");
+        map.put("Code", "1");
+        map.put("Msg", "ok");
         return map;
     }
 
@@ -221,7 +216,7 @@
         // 鏍规嵁杈撻�佺嚎plc閬嶅巻
         for (DevpSlave devp : slaveProperties.getDevp()) {
             StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>()
-                    .eq("stn_desc", param.getWharfCode()));
+                    .eq("stn_desc", param.getStartPoint()));
             if (Cools.isEmpty(staDesc)) {
                 throw new RuntimeException("鏈煡璇㈠埌绔欑偣淇℃伅");
             }
@@ -234,7 +229,7 @@
                 staProtocol = staProtocol.clone();
             }
             Short workNo = staProtocol.getWorkNo();
-            if (wharfCode1.contains(param.getWharfCode())) {
+            if (wharfCode1.contains(param.getStartPoint())) {
                 if (!staProtocol.isLoading() && !staProtocol.isCar() && staProtocol.getWorkNo() > 0) {
                     //AGV鍑哄簱瀹屾垚浠ュ悗
                     staProtocol.setWorkNo((short) 0);
@@ -271,11 +266,15 @@
 
     @Override
     public R getAgvPickAndPlaceV1(TaskOverParam param) {
-        BasDevp basDevp = basDevpService.selectById(param.getStaNo());
+        BasDevp basDevp = basDevpService.selectById(param.getStartPoint());
         if (Cools.isEmpty(basDevp)) {
-            return R.error("绔欑偣鍙锋湁璇�" + param.getStaNo());
+            return R.error("绔欑偣鍙锋湁璇�" + param.getStartPoint());
+        }
+        if (Cools.isEmpty(param.getHeight())) {
+            return R.error("楂樺害涓嶈兘涓虹┖" + param.getStartPoint());
         }
         if (param.getType() == 0 && basDevp.getAgvStartPick() == 1) {
+            basDevp.setInreq2(param.getHeight().toString());
             return R.ok();
         } else if (param.getType() == 1 && basDevp.getAgvStartPlace() == 1) {
             return R.ok();
@@ -286,9 +285,9 @@
 
     @Override
     public R getAgvPickAndPlaceV2(TaskOverParam param) {
-        BasDevp basDevp = basDevpService.selectById(param.getStaNo());
+        BasDevp basDevp = basDevpService.selectById(param.getStartPoint());
         if (Cools.isEmpty(basDevp)) {
-            return R.error("绔欑偣鍙锋湁璇�" + param.getStaNo());
+            return R.error("绔欑偣鍙锋湁璇�" + param.getStartPoint());
         }
         if (param.getType() == 0) {
             basDevp.setAgvTargetPick(1);

--
Gitblit v1.9.1