From f1223c78a7b93d89017c26770390ef446cc57ac6 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期五, 14 七月 2023 08:06:28 +0800
Subject: [PATCH] 完善AGV相关功能

---
 src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
index 8dd6f85..0a5fcc4 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
@@ -1,34 +1,22 @@
 package com.zy.asrs.service.impl;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
-import com.core.common.DateUtils;
-import com.core.common.SnowflakeIdWorker;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.entity.param.CombParam;
 import com.zy.asrs.entity.param.MobileAdjustParam;
-import com.zy.asrs.entity.param.OpenOrderPakinParam;
 import com.zy.asrs.service.*;
-import com.zy.asrs.task.core.ReturnT;
-import com.zy.asrs.task.handler.WorkLogHandler;
-import com.zy.asrs.utils.MatUtils;
-import com.zy.common.constant.MesConstant;
-import com.zy.common.entity.Parameter;
 import com.zy.common.model.DetlDto;
-import com.zy.common.model.MesCombParam;
-import com.zy.common.utils.HttpHandler;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -53,7 +41,7 @@
 
     @Override
     @Transactional
-    public void comb(CombParam param, Long userId) {
+    public String comb(CombParam param, Long userId) {
         if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
             throw new CoolException(BaseRes.PARAM);
         }
@@ -99,6 +87,7 @@
                 }
             });
         }else {
+            //鍏宠仈缁勬墭
             Order order = orderService.selectByNo(param.getOrderNo());
             if (order.getSettle() > 2) {
                 throw new CoolException("鍗曟嵁缂栧彿宸茶繃鏈�");
@@ -150,7 +139,12 @@
             orderService.updateSettle(order.getId(), 2L, userId);
         }
 
-        //鍏宠仈缁勬墭
+        if(StringUtils.isEmpty(param.getLocno())){
+            return "缁勬墭鎴愬姛";
+        }else {
+            combBinding(param.getBarcode(),param.getLocno());
+            return "缁勬墭鎴愬姛锛岀粦瀹氱珯鐐规垚鍔�";
+        }
 
     }
 
@@ -171,8 +165,11 @@
         EntityWrapper<AgvBasDevp> wrapper = new EntityWrapper<>();
         wrapper.eq("dev_no",stationCode);
         AgvBasDevp agvBasDevp = agvBasDevpService.selectOne(wrapper);
+        if(agvBasDevp == null){
+            throw new CoolException(stationCode + "绔欑偣淇℃伅閿欒");
+        }
         if(!"O".equals(agvBasDevp.getLocSts())){
-            throw new CoolException(barcode + "璇ョ珯鐐归潪绌�");
+            throw new CoolException(stationCode + "璇ョ珯鐐硅揣浣嶇姸鎬侀潪绌�");
         }
 
         agvBasDevp.setBarcode(barcode);
@@ -180,4 +177,10 @@
         agvBasDevpService.update(agvBasDevp,wrapper);
     }
 
+    public List<AgvBasDevp> getAgvBasDevpByFloor(int floor) {
+        EntityWrapper<AgvBasDevp> wrapper = new EntityWrapper<>();
+        wrapper.eq("floor",floor).eq("cache_shelves","Y");
+        return agvBasDevpService.selectList(wrapper);
+    }
+
 }

--
Gitblit v1.9.1