From 31d7788cf41d7a134326e790fb0cbbe5353ec4a3 Mon Sep 17 00:00:00 2001
From: LSH <brook_w@163.com>
Date: 星期三, 17 八月 2022 17:46:23 +0800
Subject: [PATCH] Revert "#"

---
 src/main/java/com/zy/asrs/task/handler/FireOutHandler.java    |    6 ++
 src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java   |    2 
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   17 ++++++++
 src/main/java/com/zy/asrs/task/handler/StandingHandler.java   |    4 +-
 src/main/java/com/zy/asrs/controller/MobileController.java    |   10 +++++
 src/main/java/com/zy/asrs/entity/LocMast.java                 |    6 ++-
 src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java   |   15 ++-----
 src/main/java/com/zy/asrs/service/MobileService.java          |    5 ++
 8 files changed, 48 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index 0a14b36..ab34b49 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -14,6 +14,7 @@
 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.Review;
 import com.zy.asrs.entity.result.MobileAdjustResult;
 import com.zy.asrs.service.*;
 import com.zy.asrs.task.handler.WorkLogHandler;
@@ -337,6 +338,15 @@
         mobileService.startUpTestPACK(testMast); //鎻愪氦娴嬭瘯绯荤粺
         return R.ok();
     }
+    @PostMapping("/test/transplant/auth")
+    @ManagerAuth(memo = "绉诲簱纭")
+    public synchronized R transplant(@RequestBody Review review) {
+        if (Cools.isEmpty(review)) {
+            return R.parse(BaseRes.PARAM);
+        }
+        mobileService.transplant(review); //绉诲簱纭
+        return R.ok();
+    }
     @PostMapping("/test/suspend/auth")
 //    @ManagerAuth(memo = "鏆傚仠娴嬭瘯")
     public synchronized R suspendTestPACK() {
diff --git a/src/main/java/com/zy/asrs/entity/LocMast.java b/src/main/java/com/zy/asrs/entity/LocMast.java
index 51bfdb0..28c709e 100644
--- a/src/main/java/com/zy/asrs/entity/LocMast.java
+++ b/src/main/java/com/zy/asrs/entity/LocMast.java
@@ -186,7 +186,7 @@
     @TableField("fire_status")
     private Integer fireStatus;
 
-//    浜у搧鐘舵�亄0:鏃�,1:寰呮祴,2:娴嬭瘯涓�;3.闈欑疆涓�;4:闈欑疆瀹屾垚}
+//    浜у搧鐘舵�亄0:鏃�,1:寰呮祴,2:娴嬭瘯涓�;3.娴嬭瘯瀹屾垚;4.闈欑疆涓�;5:闈欑疆瀹屾垚}
     @ApiModelProperty(value= "")
     @TableField("pack_status")
     private Integer packStatus;
@@ -327,8 +327,10 @@
             case 2:
                 return "娴嬭瘯涓�";
             case 3:
-                return "闈欑疆涓�";
+                return "娴嬭瘯瀹屾垚";
             case 4:
+                return "闈欑疆涓�";
+            case 5:
                 return "闈欑疆瀹屾垚";
             default:
                 return String.valueOf(this.packStatus);
diff --git a/src/main/java/com/zy/asrs/service/MobileService.java b/src/main/java/com/zy/asrs/service/MobileService.java
index 17435af..4b2b107 100644
--- a/src/main/java/com/zy/asrs/service/MobileService.java
+++ b/src/main/java/com/zy/asrs/service/MobileService.java
@@ -7,6 +7,8 @@
 import com.zy.asrs.entity.TestMast;
 import com.zy.asrs.entity.param.CombParam;
 import com.zy.asrs.entity.param.MobileAdjustParam;
+import com.zy.asrs.entity.param.Review;
+import com.zy.asrs.task.core.ReturnT;
 
 import java.util.Date;
 
@@ -38,4 +40,7 @@
     void startUpTestPACK(TestMast testMast);
     //鏆傚仠娴嬭瘯
     void suspendTestPACK();
+    //绉诲簱纭
+    void transplant(Review review);
+
 }
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 55923d4..7ef3992 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -82,7 +82,7 @@
     @Autowired
     private TestMastService testMastService;
     @Autowired
-    private WorkLogHandler workLogHandler;
+    private WorkService workService;
 
     @Value("${mes.url}")
     private String mesUrl;
@@ -92,6 +92,7 @@
 
     @Value("${mes.startUpTestPACK}")
     private String suspendTestPACK;
+
 
 
     @Override
@@ -728,5 +729,19 @@
         }
         return SUCCESS;
     }
+    @Transactional
+    public void transplant(Review review){
+        //绉诲簱寮�濮嬶紝鏌ヨ鐩爣搴撲綅
+        LocMast targetLocNo = locMastService.selectOne(new EntityWrapper<LocMast>()
+                .eq("row1",2)
+                .eq("loc_sts","O")
+                .eq("fire_status", 0)
+                .eq("pack_status",0));
+        if (targetLocNo != null){
+            workService.locMove(review.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(review.getUserId()));
+        }else {
+            throw new CoolException("娌℃湁绌哄簱浣�");
+        }
+    }
     /*...........................璧e窞鏂板..............浠ヤ笂.............璧e窞鏂板...........................*/
 }
diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index 6aab2f9..683ff79 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -664,6 +664,10 @@
                 if (!testMastService.update(testMast,wrapper)){
                     throw new CoolException("鏇存敼娴嬭瘯鐘舵�佸け璐�");
                 }
+                locMast.setPackStatus(3);
+                if (!locMastService.update(locMast, wrapper)){
+                    throw new CoolException("鏇存敼浜у搧鐘舵�佸け璐�");
+                }
             }else if (Cools.isEmpty(testMast.getStatus())){
                 throw new CoolException("鐘舵�佸紓甯�");
             }else {
@@ -672,16 +676,7 @@
         } else {
             throw new CoolException("鐘舵�佸紓甯�");
         }
-        LocMast targetLocNo = locMastService.selectOne(new EntityWrapper<LocMast>()
-                .eq("row1",2)
-                .eq("loc_sts","O")
-                .eq("fire_status", 0)
-                .eq("pack_status",0));
-        if (targetLocNo != null){
-            workService.locMove(review.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(review.getUserId()));
-        }else {
-            throw new CoolException("娌℃湁绌哄簱浣�");
-        }
+
         return success;
     }
 
diff --git a/src/main/java/com/zy/asrs/task/handler/FireOutHandler.java b/src/main/java/com/zy/asrs/task/handler/FireOutHandler.java
index aad140e..a62803c 100644
--- a/src/main/java/com/zy/asrs/task/handler/FireOutHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/FireOutHandler.java
@@ -42,11 +42,15 @@
             List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                     .eq("fire_status", 1)
                     .eq("loc_sts", "F"));
-
             Integer ioType = 101;   //鍏ュ嚭搴撶被鍨�
             Date now = new Date();
             //浼樺厛绾�99锛屽嚭搴撶珯109锛氭秷闃茬锛�101
             for(LocMast locMast : locMasts){
+                if (locMast.getPackStatus()==2){
+                    //鍚戞樉绀哄睆鍙戜俊鎭�
+                }else {
+                    //鍚戞樉绀哄睆鍙戜俊鎭�
+                }
                 // 鐢熸垚宸ヤ綔鍙�
                 int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));
                 // 鐢熸垚宸ヤ綔妗�
diff --git a/src/main/java/com/zy/asrs/task/handler/StandingHandler.java b/src/main/java/com/zy/asrs/task/handler/StandingHandler.java
index ca28ef4..d4114f4 100644
--- a/src/main/java/com/zy/asrs/task/handler/StandingHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/StandingHandler.java
@@ -45,12 +45,11 @@
             List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                     .eq("fire_status", 0)
                     .eq("loc_sts", "F")
-                    .eq("pack_status", 3));
+                    .eq("pack_status", 4));
             Integer ioType = 101;   //鍏ュ嚭搴撶被鍨�
             //闈欑疆瀹屾垚鍑哄簱绔�104
             for(LocMast locMast : locMasts){
                 LocDetl locDetl=locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",locMast.getLocNo()));
-
                 if (Cools.isEmpty(locDetl)){
                     log.error("搴撲綅:"+locMast.getLocNo()+"娌℃湁鏄庣粏");
                 } else if (Cools.isEmpty(locDetl.getDeadWarn())){
@@ -99,6 +98,7 @@
                     if (locMast.getLocSts().equals("F")) {
                         locMast.setLocSts("R");
                         locMast.setModiTime(now);
+                        locMast.setPackStatus(5); //5:闈欑疆瀹屾垚
                         if (!locMastService.updateById(locMast)) {
                             throw new CoolException("棰勭害搴撲綅鐘舵�佸け璐ワ紝搴撲綅鍙凤細"+locMast.getLocNo());
                         }
diff --git a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
index 14a5666..fd4b8fc 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -297,7 +297,7 @@
                     locMast.setIoTime(now);
                     locMast.setModiTime(now);
                     locMast.setFireStatus(0);
-                    locMast.setPackStatus(3); //3:闈欑疆涓�
+                    locMast.setPackStatus(4); //4:闈欑疆涓�
                     if (!locMastService.updateById(locMast)) {
 //                        exceptionHandle("搴撲綅绉昏浆 ===>> 淇敼鐩爣搴撲綅鐘舵�佸け璐ワ紱[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                         TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

--
Gitblit v1.9.1