From cb68c3e4547653ee7d308aa4da51f31363647a0f Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期四, 23 十一月 2023 18:09:43 +0800
Subject: [PATCH] 自动补货

---
 src/main/java/com/zy/asrs/service/impl/AgvWrkMastServiceImp.java |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/AgvWrkMastServiceImp.java b/src/main/java/com/zy/asrs/service/impl/AgvWrkMastServiceImp.java
index 2cf9450..dc74a33 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvWrkMastServiceImp.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvWrkMastServiceImp.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.core.common.Cools;
 import com.core.exception.CoolException;
@@ -11,10 +12,7 @@
 import com.zy.asrs.entity.param.AgvTaskParam;
 import com.zy.asrs.entity.param.AgvTaskkDescribeParam;
 import com.zy.asrs.mapper.AgvWrkMastMapper;
-import com.zy.asrs.service.AgvLocMastService;
-import com.zy.asrs.service.AgvWrkDetlService;
-import com.zy.asrs.service.AgvWrkMastService;
-import com.zy.asrs.service.ApiLogService;
+import com.zy.asrs.service.*;
 import com.zy.common.utils.HttpHandler;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,6 +45,9 @@
     @Value("${agv.containerArrivedPath}")
     private String containerArrivedPath;
 
+    @Value("${agvBasDev.maxWorkNum}")
+    private int maxWrokNum;
+
     @Autowired
     AgvWrkMastMapper agvWrkMastMapper;
     @Autowired
@@ -55,6 +56,8 @@
     AgvLocMastService agvLocMastService;
     @Autowired
     ApiLogService apiLogService;
+    @Autowired
+    AgvBasDevpService agvBasDevpService;
 
     public void updateWrkStsByWrkNo(int wrkNo, long wrkSts) {
         AgvWrkMast agvWrkMast = this.selectById(wrkNo);
@@ -134,6 +137,20 @@
         return doHttpRequest(containerArrivedParam,"瀹瑰櫒杈惧埌閫氱煡",url, containerArrivedPath,null,"127.0.0.1");
     }
 
+    @Override
+    public List<AgvWrkMast> selectReadyAgvWrkMast() {
+        List<String> stationCodes = agvBasDevpService.selectAllStationCode();
+        Wrapper<AgvWrkMast> wrapper = new EntityWrapper<AgvWrkMast>().eq("wrk_sts", 21L).like(false, "loc_no", "@");
+        wrapper.in("loc_no",stationCodes);
+        return this.selectList(wrapper);
+        //return this.baseMapper.selectReadyAgvWrkMast();
+    }
+
+    @Override
+    public AgvWrkMast selectByContainerCode(String containerCode) {
+        return this.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode",containerCode));
+    }
+
     private void getContainerMoveParam(List<AgvWrkMast> agvWrkMastList,List<Map<String,String>> positionCodeMapList){
         //寰�瀹瑰櫒鍏ュ満鍙傛暟涓斁鍏ユ簮绔欑偣浣嶇疆
         for(AgvWrkMast agvWrkMast : agvWrkMastList){
@@ -162,7 +179,9 @@
             agvTaskParam.setTaskPriority(agvWrkMast.getIoPri().intValue());
 
             //AgvTaskkDescribeParam
-            agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo());
+            if(agvWrkMast.getSourceLocNo().contains("CS") || agvWrkMast.getSourceLocNo().contains("SK")){
+                agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo());
+            }
             agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo());
             agvTaskkDescribeParam.setContainerCode(agvWrkMast.getBarcode());
             return agvTaskParam;

--
Gitblit v1.9.1