From 4c7732b2d35a0074a7b6f7c768d73f5dbeffdca3 Mon Sep 17 00:00:00 2001
From: tzsk <Administrator@qq.com>
Date: 星期三, 04 十二月 2024 09:12:57 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 50 insertions(+), 1 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 541d386..b222e61 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -92,11 +92,18 @@
             throw new CoolException(param.getBarcode() + "鏁版嵁宸茬粡鍦ㄥ簱");
         }
 
+        //鍒ゆ柇鎵樼洏鏄惁宸茬粡鍦ㄥ伐浣滄。
+        if (wrkMastService.selectCount(new EntityWrapper<WrkMast>()
+                .eq("barcode", param.getBarcode())) > 0) {
+            throw new CoolException(param.getBarcode() + "鏁版嵁宸茬粡鍦ㄤ换鍔℃。涓�");
+        }
+
         //鍒ゆ柇鏄惁瀛樺湪鏂欑鐮� => 瀛樺湪鏂欑鐮佸垯瑕佹眰鎻愪氦涓婃潵鐨勭墿鏂檒ist蹇呴』鍏ㄩ儴閮芥湁鏂欑鐮�
         boolean hasContainerCode = false;
         int containerCodeCount = 0;//鏂欑鐮佹暟閲�
         for (CombParam.CombMat combMat : param.getCombMats()) {
-            if (combMat.getContainerCode() != null) {
+            if(!Cools.isEmpty(combMat.getContainerCode())){
+            //if (combMat.getContainerCode() != null) {
                 hasContainerCode = true;
                 containerCodeCount++;
                 continue;
@@ -615,6 +622,48 @@
         });
     }
 
+    @Override
+    public void nodePakinNoComb(CombParam param) {
+        if(Cools.isEmpty(param.getLocno())){
+            throw new CoolException("搴撲綅鍙锋湭濉啓锛屾棤娉曞叆搴�");
+        }
+        param.getCombMats().forEach(combMat -> {
+            Wrapper<ManLocDetl> wrapper = new EntityWrapper<ManLocDetl>().eq("loc_no", param.getLocno()).eq("matnr",combMat.getMatnr());
+            Utils.wapperSetCondition(wrapper,"container_code",combMat.getContainerCode());
+            Utils.wapperSetCondition(wrapper,"batch",combMat.getBatch());
+            Utils.wapperSetCondition(wrapper,"csocode",combMat.getCsocode());
+            Utils.wapperSetCondition(wrapper,"isoseq",combMat.getIsoseq());
+            ManLocDetl manLocDetl = manLocDetlService.selectOne(wrapper);
+            if(Cools.isEmpty(manLocDetl)){
+                saveManlocDetl(combMat,param.getLocno());
+            }else{
+                manLocDetl.setAnfme(manLocDetl.getAnfme() + combMat.getAnfme());
+                manLocDetlService.update(manLocDetl,wrapper);
+            }
+            //鐢熸垚骞冲簱鍏ュ嚭搴撴棩蹇�
+            SaasUtils.insertLog(0,param.getLocno(),combMat.getMatnr(), combMat.getAnfme(),"");
+        });
+
+    }
+
+    private boolean saveManlocDetl(CombParam.CombMat combMat, String locNo){
+        Node node = nodeService.selectOne(new EntityWrapper<Node>()
+                .eq("name", locNo));
+        Mat mat = matService.selectByMatnr(combMat.getMatnr());
+        ManLocDetl manLocDetl = new ManLocDetl();
+        BeanUtils.copyProperties(mat,manLocDetl);
+        manLocDetl.setAnfme(combMat.getAnfme());
+        manLocDetl.setNodeId(node.getId());
+        manLocDetl.setContainerCode(combMat.getContainerCode());
+        manLocDetl.setCsocode(combMat.getCsocode());
+        manLocDetl.setIsoseq(combMat.getIsoseq());
+        manLocDetl.setCreateTime(new Date());
+        manLocDetl.setModiTime(new Date());
+        manLocDetl.setLocNo(locNo);
+        manLocDetl.setStatus(1);
+        return manLocDetlService.insert(manLocDetl);
+    }
+
     private void saveManlocDetl(WaitPakin waitPakin, Date now, String locNo){
 
         Node node = nodeService.selectOne(new EntityWrapper<Node>()

--
Gitblit v1.9.1