From ea6367de0e26f856f2e45047435d3206216dc320 Mon Sep 17 00:00:00 2001
From: 18516761980 <56479841@qq.com>
Date: 星期六, 13 八月 2022 10:44:58 +0800
Subject: [PATCH] Merge branch 'gzynasrs' of http://47.97.1.152:5880/r/zy-asrs into gzynasrs

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   91 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index 4736f0e..5085744 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -4,6 +4,7 @@
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.core.annotations.ManagerAuth;
 import com.core.common.*;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
@@ -11,6 +12,8 @@
 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.CodeRes;
 import com.zy.common.constant.MesConstant;
@@ -23,6 +26,8 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -69,6 +74,15 @@
     private StaDescService staDescService;
     @Autowired
     private CommonService commonService;
+    @Autowired
+    private NodeService nodeService;
+    @Autowired
+    private ManLocDetlService manLocDetlService;
+    @Autowired
+    private TestMastService testMastService;
+    @Autowired
+    private WorkLogHandler workLogHandler;
+
 
     @Override
     @Transactional
@@ -180,6 +194,39 @@
             orderService.updateSettle(order.getId(), 2L, userId);
         }
 
+    }
+
+    @Override
+    public void onSale(CombParam param) {
+        // 鑾峰彇搴撲綅鍙�
+        String locno = param.getLocno();
+        Node node = nodeService.selectByUuid(locno);
+        if (Cools.isEmpty(node)) {
+            throw new CoolException(param.getLocno() + ":搴撲綅涓嶅瓨鍦�");
+        }
+
+        // 鑾峰彇鍟嗗搧鍒楄〃
+        for(CombParam.CombMat combMat : param.getCombMats()){
+            Mat mat = matService.selectByMatnr(combMat.getMatnr());
+            if (Cools.isEmpty(mat)){
+                throw new CoolException(combMat.getMatnr() + ":鍟嗗搧妗f涓嶅瓨鍦紒");
+            }
+            if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme()==0){
+                throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鏁伴噺鏈夎锛�");
+            }
+            if (Cools.isEmpty(combMat.getBatch())){
+                throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鎵瑰彿鏈夎锛�");
+            }
+            ManLocDetl manLocDetl = new ManLocDetl();
+            manLocDetl.setLocNo(locno);
+            manLocDetl.setNodeId(node.getId());
+            manLocDetl.setMatnr(combMat.getMatnr());
+            manLocDetl.setBatch(combMat.getBatch());
+            manLocDetl.setAnfme(combMat.getAnfme());
+            if (!manLocDetlService.insert(manLocDetl)) {
+                throw new CoolException("鍟嗗搧涓婃灦澶辫触锛�");
+            }
+        }
     }
 
     @Override
@@ -554,4 +601,48 @@
             throw new CoolException(locDetl.getLocNo() + "搴撲綅涓嶆槸鍦ㄥ簱鐘舵��");
         }
     }
+
+    /*...........................璧e窞鏂板..............浠ヤ笅.............璧e窞鏂板...........................*/
+    @Override
+    @Transactional
+    public void startUpTestPACK(TestMast testMast) {
+
+        //鍚姩娴嬭瘯璇锋眰
+        ReturnT<String> result=workLogHandler.startUpTestPACK(testMast);
+        if (!result.isSuccess()) {
+            log.error("娴嬭瘯鐢宠澶辫触", testMast.getBarcode());
+        }
+        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()));
+        if (Cools.isEmpty(locMast)) {
+            throw new CoolException(BaseRes.PARAM);
+        }
+
+        Date date1;
+        try {
+            date1 = new Date();
+        }catch (Exception e){
+            throw new CoolException("鑾峰彇鏃堕棿澶辫触");
+        }
+        testMast.setChannel(1);
+        testMast.setStatus(1);
+        testMast.setModiTime(date1);
+        testMast.setAppeTime(date1);
+        if (!testMastService.insert(testMast)){
+            throw new CoolException("娣诲姞testMast澶辫触");
+        }
+        locMast.setPackStatus(2);
+        locMast.setModiTime(date1);
+        if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()))){
+            throw new CoolException("鐢宠娴嬭瘯澶辫触");
+        }
+    }
+    @Override
+    @Transactional
+    public void suspendTestPACK() {
+        ReturnT<String> result=workLogHandler.suspendTestPACK();
+        if (!result.isSuccess()) {
+            log.error("娴嬭瘯鐢宠澶辫触");
+        }
+    }
+    /*...........................璧e窞鏂板..............浠ヤ笂.............璧e窞鏂板...........................*/
 }

--
Gitblit v1.9.1