From f6796dda5fb7e269482f0cc92a898fe7ffc203d4 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期一, 25 三月 2024 12:56:58 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/controller/LocMastController.java |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/LocMastController.java b/src/main/java/com/zy/asrs/controller/LocMastController.java
index ae31ef8..392ad72 100644
--- a/src/main/java/com/zy/asrs/controller/LocMastController.java
+++ b/src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -12,9 +12,11 @@
 import com.core.common.R;
 import com.zy.asrs.entity.LocDetl;
 import com.zy.asrs.entity.LocMast;
+import com.zy.asrs.entity.WrkMast;
 import com.zy.asrs.entity.param.LocMastInitParam;
 import com.zy.asrs.service.LocDetlService;
 import com.zy.asrs.service.LocMastService;
+import com.zy.asrs.service.WrkMastService;
 import com.zy.common.entity.Parameter;
 import com.zy.common.model.Shelves;
 import com.zy.common.web.BaseController;
@@ -39,6 +41,8 @@
     private Integer equipmentCount;
     @Value("${channel.channelMax}")
     private Integer channelMax;
+    @Autowired
+    private WrkMastService wrkMastService;
 
     @RequestMapping(value = "/locMast/init/pwd")
     public R locMastInitPwd(@RequestParam(required = false) String pwd) {
@@ -82,7 +86,11 @@
                 wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                 wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
             } else {
-                wrapper.like(entry.getKey(), val);
+                if (entry.getKey().equals("loc_type1")){
+                    wrapper.eq(entry.getKey(), val);
+                }else {
+                    wrapper.like(entry.getKey(), val);
+                }
             }
         }
     }
@@ -101,6 +109,18 @@
 	@RequestMapping(value = "/locMast/update/auth")
 	@ManagerAuth(memo = "搴撲綅淇敼")
     public R update(LocMast locMast){
+        LocMast locMast1 = locMastService.selectById(locMast.getLocNo());
+        if (locMast.getLocType1()==0){
+            locMast.setLocType1(locMast1.getLocType1());
+        }
+        if (!locMast1.getLocType1().equals(locMast.getLocType1())){
+            if (locMast.getRow1()!=2){
+                return R.error("褰撳墠鎿嶄綔宸茶闃绘锛屽彧鍏佽绗簩鎺掑簱浣嶄慨鏀瑰簱浣嶇被鍨嬶紒锛侊紒");
+            }
+            if (locMast1.getLocType1()==1){
+                return R.error("褰撳墠鎿嶄綔宸茶闃绘锛屾祴璇曞簱浣嶇姝慨鏀瑰簱浣嶇被鍨嬶紒锛侊紒");
+            }
+        }
         if (Cools.isEmpty(locMast) || null==locMast.getLocNo()){
             return R.error();
         }
@@ -113,6 +133,11 @@
             if (locMast.getLocSts().equals("O") || locMast.getLocSts().equals("D")) {
                 locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
             }
+        }
+        if(locMast.getFreeze()==1&&locMast.getPackStatus()==6){
+            locMast.setPackStatus(5);
+            locMast.setLocSts("F");
+            wrkMastService.delete(new EntityWrapper<WrkMast>().eq("source_loc_no",locMast.getLocNo()));
         }
         locMast.setModiUser(getUserId());
         locMast.setModiTime(new Date());
@@ -197,20 +222,20 @@
                     locMast.setBay1(b); // 鍒�
                     locMast.setLev1(l); // 灞�
                     locMast.setCrnNo(crnNo); // 鍫嗗灈鏈�
-                    locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1);
-                    locMast.setLocType2(param.getLocType2());
-                    locMast.setLocType3(param.getLocType3());
+                    locMast.setLocType1((short)0);
+                    locMast.setLocType2((short)0);
+                    locMast.setLocType3((short)0);
                     locMast.setAppeUser(getUserId());
                     locMast.setAppeTime(now);
                     locMast.setModiUser(getUserId());
                     locMast.setModiTime(now);
-                    if (r==equipmentRow){
+                    if (r==equipmentRow && b<3){
                         locMast.setChannel(l+(b-2)*param.getEndLev());
                         locMast.setLocType1((short)1);
                         int i = (locMast.getChannel() - 1) / (channelMax / equipmentCount) + 1;
                         locMast.setLocType2((short)i);
                     }
-                    if (r==quietRow){
+                    if (r==quietRow && b<3){
                         locMast.setLocType1((short)2);
                     }
                     list.add(locMast);

--
Gitblit v1.9.1