From e3e268107c141f10e937761fa6bc94b74a9c9abc Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期三, 24 九月 2025 15:49:11 +0800
Subject: [PATCH] 对接

---
 src/main/java/com/zy/asrs/controller/MobileController.java |  555 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 295 insertions(+), 260 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index 314585e..8f8ac7e 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -3,12 +3,11 @@
 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.plugins.Page;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
 import com.core.common.R;
-import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.entity.param.CombParam;
 import com.zy.asrs.entity.param.MobileAdjustParam;
@@ -16,13 +15,13 @@
 import com.zy.asrs.entity.result.MobileAdjustResult;
 import com.zy.asrs.mapper.ManLocDetlMapper;
 import com.zy.asrs.service.*;
-import com.zy.common.model.LocDto;
-import com.zy.common.model.TaskDto;
 import com.zy.common.model.WrkDto;
 import com.zy.common.utils.HttpHandler;
 import com.zy.common.web.BaseController;
 import com.zy.system.entity.Config;
 import com.zy.system.service.ConfigService;
+import com.zy.third.entity.ExdvYanbu;
+import com.zy.third.mapper.ExdMaterialMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -40,7 +39,7 @@
 @Slf4j
 @RestController
 @RequestMapping("mobile")
-public class MobileController extends BaseController  {
+public class MobileController extends BaseController {
 
     @Autowired
     private MobileService mobileService;
@@ -80,21 +79,24 @@
     @Autowired
     private ConfigService configService;
 
+    @Autowired
+    private ExdMaterialMapper exdMaterialMapper;
+
     // 鍟嗗搧涓婃灦
     @RequestMapping("/mat/onSale/auth")
     @ManagerAuth
-    public R matOnSale(@RequestBody CombParam combParam){
+    public R matOnSale(@RequestBody CombParam combParam) {
         mobileService.onSale(combParam);
         return R.ok("涓婃灦鎴愬姛");
     }
+
     // 鍟嗗搧涓嬫灦
     @RequestMapping("/mat/offSale/auth")
     //@ManagerAuth
-    public R matOffSale(@RequestBody OffSaleParam offSaleParam){
+    public R matOffSale(@RequestBody OffSaleParam offSaleParam) {
         mobileService.offSale(offSaleParam);
         return R.ok("涓嬫灦鎴愬姛");
     }
-
 
 
     // 缁勬墭 ----------------------------------------------------------------------------------------------------
@@ -105,7 +107,7 @@
      */
     @RequestMapping("/order/search/orderNo/auth")
     @ManagerAuth
-    public R orderSearchByBarcode(@RequestParam String orderNo){
+    public R orderSearchByBarcode(@RequestParam String orderNo) {
         Order order = orderService.selectByNo(orderNo);
         if (order == null) {
             return R.ok();
@@ -126,14 +128,14 @@
 
     @RequestMapping("/comb/auth")
     @ManagerAuth(memo = "缁勬墭")
-    public R comb(@RequestBody CombParam combParam){
-        mobileService.comb(combParam, getUserId());
+    public R comb(@RequestBody CombParam combParam) {
+        mobileService.comb(combParam, getUserId(), getUser().getEmail());
         return R.ok("缁勬墭鎴愬姛");
     }
 
     @RequestMapping("/pack/get/auth")
     @ManagerAuth
-    public R packGet(@RequestParam String barcode){
+    public R packGet(@RequestParam String barcode) {
         Pack pack = packService.selectByBarcode(barcode);
         if (pack == null) {
             return R.ok();
@@ -146,7 +148,7 @@
 
     @RequestMapping("/pack/comb/auth")
     @ManagerAuth(memo = "涓嬬嚎缁勬墭")
-    public R packComb(@RequestBody CombParam combParam){
+    public R packComb(@RequestBody CombParam combParam) {
         mobileService.packComb(combParam, getUserId());
         return R.ok("缁勬墭鎴愬姛");
     }
@@ -159,7 +161,7 @@
     @Deprecated
     public R pakoutQuery(@RequestParam(required = false) String barcode,
                          @RequestParam(required = false) Integer staNo,
-                         @RequestParam(required = false) String matnr){
+                         @RequestParam(required = false) String matnr) {
         if (Cools.isEmpty(barcode) && Cools.isEmpty(matnr)) {
             return R.ok();
         }
@@ -183,7 +185,7 @@
      */
     @RequestMapping("/pakout/confirm/barcode/auth")
     @ManagerAuth
-    public R pakoutQueryByBarcode(@RequestParam(required = false) String barcode){
+    public R pakoutQueryByBarcode(@RequestParam(required = false) String barcode) {
         if (Cools.isEmpty(barcode)) {
             return R.ok();
         }
@@ -200,7 +202,7 @@
     // 鏍规嵁搴撲綅鐮佸拰鍟嗗搧鐮佹悳绱㈠晢鍝�
     @RequestMapping("/mat/find/auth")
     public R find(@RequestParam(required = false) String locNo
-            , @RequestParam(required = false) String matnr){
+            , @RequestParam(required = false) String matnr) {
         //List<ManLocDetl> manLocDetls = manLocDetlMapper.selectItem0(locNo, matnr);
         ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(locNo, matnr);
         return R.ok(manLocDetl);
@@ -213,7 +215,7 @@
     @RequestMapping("/pakout/confirm/pick/auth")
     @ManagerAuth
     public R pakoutQueryByBarcode(@RequestParam(required = false) Integer wrkNo
-                                , @RequestParam(required = false) String matnr){
+            , @RequestParam(required = false) String matnr) {
         if (Cools.isEmpty(wrkNo)) {
             return R.ok();
         }
@@ -279,9 +281,9 @@
                 for (WrkDetl wrkDetl : dto.getWrkDetls()) {
                     wrkDetlService.updateInspect(wrkDetl.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                 }
-                if(wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107) {
-                    wrkMast.setWrkSts(16L);//涓嬫灦瀹屾垚绛夊緟鍥炲簱
-                }else {
+                if (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107) {
+                    wrkMast.setWrkSts(34L);//涓嬫灦瀹屾垚绛夊緟鍥炲簱
+                } else {
                     wrkMast.setWrkSts(15L);
                 }
                 wrkMastService.updateById(wrkMast);
@@ -340,7 +342,7 @@
 
     @RequestMapping("/adjust/auth")
     @ManagerAuth(memo = "鐩樼偣")
-    public R adjust(@RequestBody MobileAdjustParam combParam){
+    public R adjust(@RequestBody MobileAdjustParam combParam) {
         mobileService.adjust(combParam, getUserId());
         return R.ok("鐩樼偣鎴愬姛");
     }
@@ -348,10 +350,10 @@
     @PostMapping("/order/out/pakout/auth")
     @ManagerAuth(memo = "璁㈠崟鍑哄簱")
     public synchronized R pakoutByOrder(@RequestBody JSONObject param) {
-        if(!param.containsKey("staNo") || !param.containsKey("orderNo")){
+        if (!param.containsKey("staNo") || !param.containsKey("orderNo")) {
             return R.parse(BaseRes.PARAM);
         }
-        mobileService.pakoutByOrder(param,getUserId());
+        mobileService.pakoutByOrder(param, getUserId());
         return R.ok("鍑哄簱鎴愬姛");
     }
 
@@ -359,38 +361,39 @@
 
     /**
      * 琛ョ┖鏉�   鍖哄煙鍒扮偣
+     *
      * @param locNo 鐩爣绔欑偣
      * @param size  鎵樼洏澶у皬 1锛氬皬鎵樼洏  2锛氬ぇ鎵樼洏
      * @return
      */
     @RequestMapping("/FillEmptyPallets")
     public synchronized R FillEmptyPallets(@RequestParam(required = false) String locNo
-            ,@RequestParam(required = false) String size){
+            , @RequestParam(required = false) String size) {
         if (Cools.isEmpty(locNo) || Cools.isEmpty(size)) {
             return R.error("绔欑偣鎴栬�呭ぇ灏忎笉鑳戒负绌�");
 
         }
         //绌烘墭鐩樼紦鍐插尯 灏忥細E8  澶э細E9
-        String rStaNo ="E8";
-        if(size.equals("2")){
+        String rStaNo = "E8";
+        if (size.equals("2")) {
             rStaNo = "E9";
         }
-        LinkedHashMap<String,Object> rcsParam=new LinkedHashMap<>();
+        LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>();
         rcsParam.put("taskType", "PF-FMR-COMMON");
-        List<LinkedHashMap<String,Object>> targetRoutes=new ArrayList<>();
-        LinkedHashMap<String,Object> t1=new LinkedHashMap<>();
-        LinkedHashMap<String,Object> t2=new LinkedHashMap<>();
+        List<LinkedHashMap<String, Object>> targetRoutes = new ArrayList<>();
+        LinkedHashMap<String, Object> t1 = new LinkedHashMap<>();
+        LinkedHashMap<String, Object> t2 = new LinkedHashMap<>();
         t1.put("seq", 0);
-        t1.put("type","ZONE");
+        t1.put("type", "ZONE");
         t1.put("code", rStaNo);
-        t1.put("autoStart",0);
-        t1.put("operation","COLLECT");
+        t1.put("autoStart", 0);
+        t1.put("operation", "COLLECT");
 
         t2.put("seq", 0);
-        t2.put("type","SITE");
+        t2.put("type", "SITE");
         t2.put("code", locNo);
-        t2.put("autoStart",0);
-        t2.put("operation","DELIVERY");
+        t2.put("autoStart", 0);
+        t2.put("operation", "DELIVERY");
 
         targetRoutes.add(t1);
         targetRoutes.add(t2);
@@ -398,119 +401,12 @@
         rcsParam.put("initPriority", 100);
 
 
-        String response ="";
-        Boolean bool =false;
+        String response = "";
+        Boolean bool = false;
         String msg = "";
-        HashMap<String,Object> map = new HashMap<>();
+        HashMap<String, Object> map = new HashMap<>();
         Date date = new Date();
-        String time = date.getTime()+"";
-
-        map.put("X-LR-REQUEST-ID", time);
-        try {
-            log.info("wms娲惧彂鎼繍浠诲姟缁橝GV鎼繍={}", rcsParam);
-            response = new HttpHandler.Builder()
-                     .setHeaders(map)
-                    .setUri(url)
-                    .setHttps(true)
-                    .setPath(attrcs)
-                    .setJson(JSON.toJSONString(rcsParam))
-                    .build()
-                    .doPostCloseSSL();
-            JSONObject jsonObject = JSON.parseObject(response);
-            if(jsonObject.getString("code").equals("SUCCESS")){
-                bool = true;
-            }else{
-                msg=jsonObject.getString("message");
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("wms娲惧彂鎼繍浠诲姟缁橝GV鎼繍澶辫触杩斿洖鍊�={}", response);
-        } finally {
-            apiLogService.save("wms娲惧彂鎼繍浠诲姟缁橝GV鎼繍"
-                    , url + attrcs
-                    , null
-                    , "127.0.0.1"
-                    , JSON.toJSONString(rcsParam)
-                    , response
-                    , bool
-            );
-        }
-
-        if(bool){
-            return R.ok();
-        }else {
-            return R.error(msg);
-        }
-
-    }
-
-    /**
-     * 绌烘墭鐩樺洖搴�
-     * @param sourceStaNo 鍘熺珯鐐�
-     * @param barcode  鎵樼洏澶у皬 1锛氬皬鎵樼洏  2锛氬ぇ鎵樼洏  鐩爣鍖烘垨鑰呭贩閬�
-     * @return
-     */
-    @RequestMapping("/FillEmptyPalletsStack")
-    public synchronized R FillEmptyPalletsStack(@RequestParam(required = false) String sourceStaNo
-            ,@RequestParam(required = false) String barcode){
-        if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(barcode)) {
-            return R.error("绔欑偣鎴栬�呭ぇ灏忎笉鑳戒负绌�");
-
-        }
-        //绌烘墭鐩樼紦鍐插尯 灏忥細E8  澶э細E9
-        String rStaNo ="E8";
-        if(barcode.substring(0,1).equals("9")){
-            rStaNo = "E9";
-        }
-        String type ="ZONE"; //鍖哄煙
-        Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "autoE").eq("status", "1"));
-        if (config != null) {
-            type ="STACK"; //宸烽亾
-            if (Cools.isEmpty(config.getValue())) {
-                rStaNo = rStaNo + "01";
-                config.setValue("2");
-            }else if (config.getValue().equals("1")) {
-                rStaNo = rStaNo + "01";
-                config.setValue("2");
-            }else if (config.getValue().equals("2")) {
-                rStaNo = rStaNo + "02";
-                config.setValue("3");
-            }else if (config.getValue().equals("3")) {
-                rStaNo = rStaNo + "03";
-                config.setValue("1");
-            }
-            configService.updateById(config);
-        }
-
-        LinkedHashMap<String,Object> rcsParam=new LinkedHashMap<>();
-        rcsParam.put("taskType", "PF-FMR-COMMON");
-        List<LinkedHashMap<String,Object>> targetRoutes=new ArrayList<>();
-        LinkedHashMap<String,Object> t1=new LinkedHashMap<>();
-        LinkedHashMap<String,Object> t2=new LinkedHashMap<>();
-        t1.put("seq", 0);
-        t1.put("type","SITE");
-        t1.put("code", sourceStaNo);
-        t1.put("autoStart",0);
-        t1.put("operation","COLLECT");
-
-        t2.put("seq", 0);
-        t2.put("type",type);
-        t2.put("code", rStaNo);
-        t2.put("autoStart",0);
-        t2.put("operation","DELIVERY");
-
-        targetRoutes.add(t1);
-        targetRoutes.add(t2);
-        rcsParam.put("targetRoute", targetRoutes);
-        rcsParam.put("initPriority", 100);
-
-
-        String response ="";
-        Boolean bool =false;
-        String msg = "";
-        HashMap<String,Object> map = new HashMap<>();
-        Date date = new Date();
-        String time = date.getTime()+"";
+        String time = date.getTime() + "";
 
         map.put("X-LR-REQUEST-ID", time);
         try {
@@ -524,10 +420,10 @@
                     .build()
                     .doPostCloseSSL();
             JSONObject jsonObject = JSON.parseObject(response);
-            if(jsonObject.getString("code").equals("SUCCESS")){
+            if (jsonObject.getString("code").equals("SUCCESS")) {
                 bool = true;
-            }else{
-                msg=jsonObject.getString("message");
+            } else {
+                msg = jsonObject.getString("message");
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -543,9 +439,117 @@
             );
         }
 
-        if(bool){
+        if (bool) {
             return R.ok();
-        }else {
+        } else {
+            return R.error(msg);
+        }
+
+    }
+
+    /**
+     * 绌烘墭鐩樺洖搴�
+     *
+     * @param sourceStaNo 鍘熺珯鐐�
+     * @param barcode     鎵樼洏澶у皬 1锛氬皬鎵樼洏  2锛氬ぇ鎵樼洏  鐩爣鍖烘垨鑰呭贩閬�
+     * @return
+     */
+    @RequestMapping("/FillEmptyPalletsStack")
+    public synchronized R FillEmptyPalletsStack(@RequestParam(required = false) String sourceStaNo
+            , @RequestParam(required = false) String barcode) {
+        if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(barcode)) {
+            return R.error("绔欑偣鎴栬�呭ぇ灏忎笉鑳戒负绌�");
+
+        }
+        //绌烘墭鐩樼紦鍐插尯 灏忥細E8  澶э細E9
+        String rStaNo = "E8";
+        if (barcode.substring(0, 1).equals("9")) {
+            rStaNo = "E9";
+        }
+        String type = "ZONE"; //鍖哄煙
+        Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "autoE").eq("status", "1"));
+        if (config != null) {
+            type = "STACK"; //宸烽亾
+            if (Cools.isEmpty(config.getValue())) {
+                rStaNo = rStaNo + "01";
+                config.setValue("2");
+            } else if (config.getValue().equals("1")) {
+                rStaNo = rStaNo + "01";
+                config.setValue("2");
+            } else if (config.getValue().equals("2")) {
+                rStaNo = rStaNo + "02";
+                config.setValue("3");
+            } else if (config.getValue().equals("3")) {
+                rStaNo = rStaNo + "03";
+                config.setValue("1");
+            }
+            configService.updateById(config);
+        }
+
+        LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>();
+        rcsParam.put("taskType", "PF-FMR-COMMON");
+        List<LinkedHashMap<String, Object>> targetRoutes = new ArrayList<>();
+        LinkedHashMap<String, Object> t1 = new LinkedHashMap<>();
+        LinkedHashMap<String, Object> t2 = new LinkedHashMap<>();
+        t1.put("seq", 0);
+        t1.put("type", "SITE");
+        t1.put("code", sourceStaNo);
+        t1.put("autoStart", 0);
+        t1.put("operation", "COLLECT");
+
+        t2.put("seq", 0);
+        t2.put("type", type);
+        t2.put("code", rStaNo);
+        t2.put("autoStart", 0);
+        t2.put("operation", "DELIVERY");
+
+        targetRoutes.add(t1);
+        targetRoutes.add(t2);
+        rcsParam.put("targetRoute", targetRoutes);
+        rcsParam.put("initPriority", 100);
+
+
+        String response = "";
+        Boolean bool = false;
+        String msg = "";
+        HashMap<String, Object> map = new HashMap<>();
+        Date date = new Date();
+        String time = date.getTime() + "";
+
+        map.put("X-LR-REQUEST-ID", time);
+        try {
+            log.info("wms娲惧彂鎼繍浠诲姟缁橝GV鎼繍={}", rcsParam);
+            response = new HttpHandler.Builder()
+                    .setHeaders(map)
+                    .setUri(url)
+                    .setHttps(true)
+                    .setPath(attrcs)
+                    .setJson(JSON.toJSONString(rcsParam))
+                    .build()
+                    .doPostCloseSSL();
+            JSONObject jsonObject = JSON.parseObject(response);
+            if (jsonObject.getString("code").equals("SUCCESS")) {
+                bool = true;
+            } else {
+                msg = jsonObject.getString("message");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("wms娲惧彂鎼繍浠诲姟缁橝GV鎼繍澶辫触杩斿洖鍊�={}", response);
+        } finally {
+            apiLogService.save("wms娲惧彂鎼繍浠诲姟缁橝GV鎼繍"
+                    , url + attrcs
+                    , null
+                    , "127.0.0.1"
+                    , JSON.toJSONString(rcsParam)
+                    , response
+                    , bool
+            );
+        }
+
+        if (bool) {
+            return R.ok();
+        } else {
             return R.error(msg);
         }
 
@@ -554,39 +558,40 @@
 
     /**
      * 鎵ц绉诲簱浠诲姟--鐐瑰埌鐐�
+     *
      * @param sourceStaNo
      * @param staNo
      * @return
      */
     @RequestMapping("/SITESITEAGVMove")
     public synchronized R SITESITEAGVMove(@RequestParam(required = false) String sourceStaNo
-            ,@RequestParam(required = false) String staNo
-            ,@RequestParam(required = false) String taskNo){
+            , @RequestParam(required = false) String staNo
+            , @RequestParam(required = false) String taskNo) {
         if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(staNo)) {
             return R.error("婧愮珯鐐瑰拰鐩爣绔欑偣涓嶈兘涓虹┖");
 
         }
 
-        LinkedHashMap<String,Object> rcsParam=new LinkedHashMap<>();
+        LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>();
         rcsParam.put("taskType", "PF-FMR-COMMON");
-        if(!Cools.isEmpty(taskNo)){
+        if (!Cools.isEmpty(taskNo)) {
             rcsParam.put("robotTaskCode", taskNo);
         }
 
-        List<LinkedHashMap<String,Object>> targetRoutes=new ArrayList<>();
-        LinkedHashMap<String,Object> t1=new LinkedHashMap<>();
-        LinkedHashMap<String,Object> t2=new LinkedHashMap<>();
+        List<LinkedHashMap<String, Object>> targetRoutes = new ArrayList<>();
+        LinkedHashMap<String, Object> t1 = new LinkedHashMap<>();
+        LinkedHashMap<String, Object> t2 = new LinkedHashMap<>();
         t1.put("seq", 0);
-        t1.put("type","SITE");
+        t1.put("type", "SITE");
         t1.put("code", sourceStaNo);
-        t1.put("autoStart",0);
-        t1.put("operation","COLLECT");
+        t1.put("autoStart", 0);
+        t1.put("operation", "COLLECT");
 
         t2.put("seq", 0);
-        t2.put("type","SITE");
+        t2.put("type", "SITE");
         t2.put("code", staNo);
-        t2.put("autoStart",0);
-        t2.put("operation","DELIVERY");
+        t2.put("autoStart", 0);
+        t2.put("operation", "DELIVERY");
 
         targetRoutes.add(t1);
         targetRoutes.add(t2);
@@ -594,12 +599,12 @@
         rcsParam.put("initPriority", 100);
 
 
-        String response ="";
-        Boolean bool =false;
+        String response = "";
+        Boolean bool = false;
         String msg = "";
-        HashMap<String,Object> map = new HashMap<>();
+        HashMap<String, Object> map = new HashMap<>();
         Date date = new Date();
-        String time = date.getTime()+"";
+        String time = date.getTime() + "";
 
         map.put("X-LR-REQUEST-ID", time);
         try {
@@ -613,10 +618,10 @@
                     .build()
                     .doPostCloseSSL();
             JSONObject jsonObject = JSON.parseObject(response);
-            if(jsonObject.getString("code").equals("SUCCESS")){
+            if (jsonObject.getString("code").equals("SUCCESS")) {
                 bool = true;
-            }else{
-                msg=jsonObject.getString("message");
+            } else {
+                msg = jsonObject.getString("message");
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -632,9 +637,9 @@
             );
         }
 
-        if(bool){
+        if (bool) {
             return R.ok();
-        }else {
+        } else {
             return R.error(msg);
         }
 
@@ -642,38 +647,39 @@
 
     /**
      * 鎵ц绉诲簱浠诲姟--鐐瑰埌鍖哄煙
+     *
      * @param sourceStaNo
      * @param staNo
      * @return
      */
     @RequestMapping("/SITEZONEAGVMove")
     public synchronized R SITEZONEAGVMove(@RequestParam(required = false) String sourceStaNo
-            ,@RequestParam(required = false) String staNo
-            ,@RequestParam(required = false) String taskNo){
+            , @RequestParam(required = false) String staNo
+            , @RequestParam(required = false) String taskNo) {
         if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(staNo)) {
             return R.error("婧愮珯鐐瑰拰鐩爣绔欑偣涓嶈兘涓虹┖");
 
         }
-        LinkedHashMap<String,Object> rcsParam=new LinkedHashMap<>();
+        LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>();
         rcsParam.put("taskType", "PF-FMR-COMMON");
-        if(!Cools.isEmpty(taskNo)){
+        if (!Cools.isEmpty(taskNo)) {
             rcsParam.put("robotTaskCode", taskNo);
         }
 
-        List<LinkedHashMap<String,Object>> targetRoutes=new ArrayList<>();
-        LinkedHashMap<String,Object> t1=new LinkedHashMap<>();
-        LinkedHashMap<String,Object> t2=new LinkedHashMap<>();
+        List<LinkedHashMap<String, Object>> targetRoutes = new ArrayList<>();
+        LinkedHashMap<String, Object> t1 = new LinkedHashMap<>();
+        LinkedHashMap<String, Object> t2 = new LinkedHashMap<>();
         t1.put("seq", 0);
-        t1.put("type","SITE");
+        t1.put("type", "SITE");
         t1.put("code", sourceStaNo);
-        t1.put("autoStart",0);
-        t1.put("operation","COLLECT");
+        t1.put("autoStart", 0);
+        t1.put("operation", "COLLECT");
 
         t2.put("seq", 0);
-        t2.put("type","ZONE");
+        t2.put("type", "ZONE");
         t2.put("code", staNo);
-        t2.put("autoStart",0);
-        t2.put("operation","DELIVERY");
+        t2.put("autoStart", 0);
+        t2.put("operation", "DELIVERY");
 
         targetRoutes.add(t1);
         targetRoutes.add(t2);
@@ -681,12 +687,12 @@
         rcsParam.put("initPriority", 100);
 
 
-        String response ="";
-        Boolean bool =false;
+        String response = "";
+        Boolean bool = false;
         String msg = "";
-        HashMap<String,Object> map = new HashMap<>();
+        HashMap<String, Object> map = new HashMap<>();
         Date date = new Date();
-        String time = date.getTime()+"";
+        String time = date.getTime() + "";
 
         map.put("X-LR-REQUEST-ID", time);
         try {
@@ -700,10 +706,10 @@
                     .build()
                     .doPostCloseSSL();
             JSONObject jsonObject = JSON.parseObject(response);
-            if(jsonObject.getString("code").equals("SUCCESS")){
+            if (jsonObject.getString("code").equals("SUCCESS")) {
                 bool = true;
-            }else{
-                msg=jsonObject.getString("message");
+            } else {
+                msg = jsonObject.getString("message");
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -719,9 +725,9 @@
             );
         }
 
-        if(bool){
+        if (bool) {
             return R.ok();
-        }else {
+        } else {
             return R.error(msg);
         }
 
@@ -729,38 +735,39 @@
 
     /**
      * 鎵ц绉诲簱浠诲姟--鍖哄煙鍒扮偣
+     *
      * @param sourceStaNo
      * @param staNo
      * @return
      */
     @RequestMapping("/ZONESITEAGVMove")
     public synchronized R ZONESITEAGVMove(@RequestParam(required = false) String sourceStaNo
-            ,@RequestParam(required = false) String staNo
-            ,@RequestParam(required = false) String taskNo){
+            , @RequestParam(required = false) String staNo
+            , @RequestParam(required = false) String taskNo) {
         if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(staNo)) {
             return R.error("婧愮珯鐐瑰拰鐩爣绔欑偣涓嶈兘涓虹┖");
 
         }
-        LinkedHashMap<String,Object> rcsParam=new LinkedHashMap<>();
+        LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>();
         rcsParam.put("taskType", "PF-FMR-COMMON");
-        if(!Cools.isEmpty(taskNo)){
+        if (!Cools.isEmpty(taskNo)) {
             rcsParam.put("robotTaskCode", taskNo);
         }
 
-        List<LinkedHashMap<String,Object>> targetRoutes=new ArrayList<>();
-        LinkedHashMap<String,Object> t1=new LinkedHashMap<>();
-        LinkedHashMap<String,Object> t2=new LinkedHashMap<>();
+        List<LinkedHashMap<String, Object>> targetRoutes = new ArrayList<>();
+        LinkedHashMap<String, Object> t1 = new LinkedHashMap<>();
+        LinkedHashMap<String, Object> t2 = new LinkedHashMap<>();
         t1.put("seq", 0);
-        t1.put("type","ZONE");
+        t1.put("type", "ZONE");
         t1.put("code", sourceStaNo);
-        t1.put("autoStart",0);
-        t1.put("operation","COLLECT");
+        t1.put("autoStart", 0);
+        t1.put("operation", "COLLECT");
 
         t2.put("seq", 0);
-        t2.put("type","SITE");
+        t2.put("type", "SITE");
         t2.put("code", staNo);
-        t2.put("autoStart",0);
-        t2.put("operation","DELIVERY");
+        t2.put("autoStart", 0);
+        t2.put("operation", "DELIVERY");
 
         targetRoutes.add(t1);
         targetRoutes.add(t2);
@@ -768,12 +775,12 @@
         rcsParam.put("initPriority", 100);
 
 
-        String response ="";
-        Boolean bool =false;
+        String response = "";
+        Boolean bool = false;
         String msg = "";
-        HashMap<String,Object> map = new HashMap<>();
+        HashMap<String, Object> map = new HashMap<>();
         Date date = new Date();
-        String time = date.getTime()+"";
+        String time = date.getTime() + "";
 
         map.put("X-LR-REQUEST-ID", time);
         try {
@@ -787,10 +794,10 @@
                     .build()
                     .doPostCloseSSL();
             JSONObject jsonObject = JSON.parseObject(response);
-            if(jsonObject.getString("code").equals("SUCCESS")){
+            if (jsonObject.getString("code").equals("SUCCESS")) {
                 bool = true;
-            }else{
-                msg=jsonObject.getString("message");
+            } else {
+                msg = jsonObject.getString("message");
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -806,9 +813,9 @@
             );
         }
 
-        if(bool){
+        if (bool) {
             return R.ok();
-        }else {
+        } else {
             return R.error(msg);
         }
 
@@ -816,54 +823,55 @@
 
     /**
      * AGV绔欑偣缁戝畾鍜岃В缁�
-     * @param sourceStaNo   //绔欑偣
-     * @param barcodeType   //鎵樼洏鐮�
-     * @param invoke        //BIND涓虹粦瀹�    UNBIND涓鸿В缁�
+     *
+     * @param sourceStaNo //绔欑偣
+     * @param barcodeType //鎵樼洏鐮�
+     * @param invoke      //BIND涓虹粦瀹�    UNBIND涓鸿В缁�
      * @return
      */
     @RequestMapping("/siteBindAndUnbind")
     public synchronized R siteBindAndUnbind(@RequestParam(required = false) String sourceStaNo
-            ,@RequestParam(required = false) String barcodeType
-            ,@RequestParam(required = false) String invoke){
+            , @RequestParam(required = false) String barcodeType
+            , @RequestParam(required = false) String invoke) {
         if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(barcodeType)) {
             return R.error("绔欑偣鍜屾墭鐩樼被鍨嬩笉鑳戒负绌�");
 
         }
-        if(barcodeType.substring(0,1).equals("8")){
-            barcodeType="11";
-        }else if(barcodeType.substring(0,1).equals("9")){
-            barcodeType="21";
+        if (barcodeType.substring(0, 1).equals("8")) {
+            barcodeType = "11";
+        } else if (barcodeType.substring(0, 1).equals("9")) {
+            barcodeType = "21";
         }
-        LinkedHashMap<String,Object> rcsParam=new LinkedHashMap<>();
+        LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>();
         rcsParam.put("slotCategory", "SITE");
         rcsParam.put("slotCode", sourceStaNo);
         rcsParam.put("carrierCategory", "PALLET");
         rcsParam.put("carrierType", barcodeType);//11涓哄皬鎵樼洏   21涓哄ぇ鎵樼洏
-if(sourceStaNo.equals("101")){
-    rcsParam.put("carrierDir","0");
-}else  if(sourceStaNo.equals("R01")||sourceStaNo.equals("R03")){
-    rcsParam.put("carrierDir","-90");
+        if (sourceStaNo.equals("101")) {
+            rcsParam.put("carrierDir", "0");
+        } else if (sourceStaNo.equals("R01") || sourceStaNo.equals("R03")) {
+            rcsParam.put("carrierDir", "-90");
 
-    }else  if(sourceStaNo.equals("R02")){
-    rcsParam.put("carrierDir","90");
-}else {
-    rcsParam.put("carrierDir","180");
-}
+        } else if (sourceStaNo.equals("R02")) {
+            rcsParam.put("carrierDir", "90");
+        } else {
+            rcsParam.put("carrierDir", "180");
+        }
 
         rcsParam.put("temporary", "");
         rcsParam.put("invoke", invoke);
 
 
-        String response ="";
-        Boolean bool =false;
+        String response = "";
+        Boolean bool = false;
         String msg = "";
-        HashMap<String,Object> map = new HashMap<>();
+        HashMap<String, Object> map = new HashMap<>();
         Date date = new Date();
-        String time = date.getTime()+"";
+        String time = date.getTime() + "";
 
         map.put("X-LR-REQUEST-ID", time);
         try {
-            log.info("WMS瀹屾垚"+invoke+"agv绔欑偣={},涓婃姤鍙傛暟涓�={}",sourceStaNo,rcsParam);
+            log.info("WMS瀹屾垚" + invoke + "agv绔欑偣={},涓婃姤鍙傛暟涓�={}", sourceStaNo, rcsParam);
             response = new HttpHandler.Builder()
                     .setHeaders(map)
                     .setUri(url)
@@ -873,16 +881,16 @@
                     .build()
                     .doPostCloseSSL();
             JSONObject jsonObject = JSON.parseObject(response);
-            if(jsonObject.getString("code").equals("SUCCESS")){
+            if (jsonObject.getString("code").equals("SUCCESS")) {
                 bool = true;
-            }else{
-                msg=jsonObject.getString("message");
+            } else {
+                msg = jsonObject.getString("message");
             }
         } catch (Exception e) {
             e.printStackTrace();
-            log.error("WMS瀹屾垚"+invoke+"agv绔欑偣澶辫触={}", response);
+            log.error("WMS瀹屾垚" + invoke + "agv绔欑偣澶辫触={}", response);
         } finally {
-            apiLogService.save("WMS瀹屾垚"+invoke+"agv绔欑偣"+sourceStaNo
+            apiLogService.save("WMS瀹屾垚" + invoke + "agv绔欑偣" + sourceStaNo
                     , url + siteBindAndUnbing
                     , null
                     , "127.0.0.1"
@@ -892,9 +900,9 @@
             );
         }
 
-        if(bool){
+        if (bool) {
             return R.ok();
-        }else {
+        } else {
             return R.error(msg);
         }
 
@@ -902,32 +910,37 @@
 
     /**
      * 绌烘澘鍥炲簱鎴栬�呮嫞鏂欏洖搴�
+     *
      * @param sourceStaNo
      * @param staNo
      * @return
      */
     @RequestMapping("/AGVStartReturn")
     public synchronized R AGVStartReturn(@RequestParam(required = false) String sourceStaNo
-            ,@RequestParam(required = false) String staNo
-            ,@RequestParam(required = false) String taskNo){
+            , @RequestParam(required = false) String staNo
+            , @RequestParam(required = false) String taskNo) {
         if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(staNo)) {
             return R.error("婧愮珯鐐瑰拰鎵樼洏鐮佷笉鑳戒负绌�");
 
         }
 
-        R r=R.ok();
+        R r = R.ok();
 
-        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", staNo).in("io_type",103,105,107));
+        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", staNo).in("io_type", 103, 105, 107));
         if (wrkMast == null) {
-            r=FillEmptyPalletsStack(sourceStaNo,staNo);
-        }else {
-            if (wrkMast.getWrkSts()>30){
+            r = FillEmptyPalletsStack(sourceStaNo, staNo);
+        } else {
+            if (wrkMast.getWrkSts() > 30) {
                 return R.error("璇ユ墭鐩�={},娌℃湁涓嬫灦锛岃涓嬫灦鍚庡啀鍥炲簱锛侊紒锛�");
+            }
+            List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("sta_no", wrkMast.getStaNo()).in("io_type", 101, 103, 105, 107).lt("wrk_sts", 33));
+            if (!Cools.isEmpty(wrkMasts)) {
+                return R.error(wrkMast.getCrnNo() + "鍫嗗灈鏈�,鏈夊嚭搴撲换鍔★紝绂佹鍥炲簱锛侊紒锛�");
             }
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
             String format = sdf.format(new Date());
-            String s = format+"-" + wrkMast.getWrkNo() + "-" + wrkMast.getBarcode();
-            r=SITESITEAGVMove(sourceStaNo,wrkMast.getStaNo$(),s);
+            String s = format + "-" + wrkMast.getWrkNo() + "-" + wrkMast.getBarcode();
+            r = SITESITEAGVMove(sourceStaNo, wrkMast.getStaNo$(), s);
             if (r.get("code").equals(200)) {
                 wrkMast.setPdcType(s);
                 /**
@@ -947,16 +960,38 @@
 
     /**
      * 鑾峰彇浠撳簱
+     *
      * @return
      */
     @RequestMapping("/ck")
     @PostMapping
-    public R AGVStartReturn(){
-        List<String> list=new ArrayList<>();
+    public R AGVStartReturn() {
+        List<String> list = new ArrayList<>();
         list.add("鍗婃垚鍝佷粨搴�");
         list.add("鎴愬搧浠撳簱");
         return R.ok(list);
     }
 
 
+    @RequestMapping(value = "/mat/tiaoma/auth")
+    @ManagerAuth
+    public R find(@RequestParam("barcode") String barcode) {
+        ExdvYanbu barcode1 = exdMaterialMapper.getBacode(barcode);
+        if (barcode1 == null) {
+            return R.error("鎵规瀵瑰簲鐨勯獙甯冩暟鎹笉瀛樺湪");
+        }
+        return R.ok(barcode1);
+    }
+
+    @RequestMapping(value = "/getOrderNo/auth")
+    @ManagerAuth
+    public R findOrderNo(@RequestParam("orderNo") String orderNo) {
+        Page<Order> orderPage = orderService.selectPage(new Page<>(0, 10), new EntityWrapper<Order>().like("order_no", "%" + orderNo + "%"));
+        List<String> objects = new ArrayList<>();
+        for (Order record : orderPage.getRecords()) {
+            objects.add(record.getOrderNo());
+        }
+        return R.ok(objects);
+    }
+
 }

--
Gitblit v1.9.1