From 74fd6eb7fb0322078f7946f51073f20e90231df1 Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期二, 01 四月 2025 11:54:00 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java | 62 +++++++++++++++++++++++++++++--
1 files changed, 58 insertions(+), 4 deletions(-)
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 b88327a..4205f08 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -19,6 +19,7 @@
import com.zy.asrs.utils.CodeDetectionUtil;
import com.zy.asrs.utils.MatUtils;
import com.zy.asrs.utils.PostMesDataUtils;
+import com.zy.asrs.utils.Utils;
import com.zy.common.model.DetlDto;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.StartupDto;
@@ -1133,8 +1134,20 @@
if (Cools.isEmpty(basDevp.getCanining()) || !basDevp.getCanining().equals("Y")){
throw new CoolException("鐮佸灈浣嶇紪鍙� palletizingNo="+param.getStaNo()+" 鎵�澶勭珯鐐逛笉鏄兘鍏ョ姸鎬�");
}
- if (Cools.isEmpty(basDevp.getBarcode())){
+ if (Cools.isEmpty(basDevp.getBarcode()) || basDevp.getBarcode().equals("00000000")){
throw new CoolException("鐮佸灈浣嶇紪鍙� palletizingNo="+param.getStaNo()+" 鎵�澶勭珯鐐规枡绠辩爜寮傚父鐘舵�侊紱鏂欑鐮�==銆嬩负绌�"+basDevp.getBarcode());
+ }
+ if (!basDevp.getInEnable().equals("Y")){
+ try{
+ Thread.sleep(500);
+ } catch (Exception e){
+
+ }
+ BasDevp basDevp1111 = basDevpService.selectById(param.getStaNo());
+ if (!basDevp1111.getInEnable().equals("Y")){
+ throw new CoolException("鐮佸灈浣嶇紪鍙� palletizingNo="+param.getStaNo()+" 鎵�澶勭珯鐐癸紝璇风瓑寰呯炕杞畬鎴愶紱鏂欑鐮�==銆�"+basDevp.getBarcode());
+ }
+
}
if (!CodeDetectionUtil.barcodeDetection(basDevp.getBarcode(),8)){
throw new CoolException("鐮佸灈浣嶇紪鍙� palletizingNo="+param.getStaNo()+" 鎵�澶勭珯鐐规枡绠辩爜寮傚父鐘舵�侊紱鏂欑鐮侊細"+basDevp.getBarcode());
@@ -1232,7 +1245,10 @@
}
ArrayList<LocDetl> locDetlArrayList = new ArrayList<>();
- Wrapper<LocDetl> wrapper = new EntityWrapper<LocDetl>().eq("matnr", param.getMatnr()).eq("weight", param.getWeight());
+ Wrapper<LocDetl> wrapper = new EntityWrapper<LocDetl>()
+ .eq("matnr", param.getMatnr())
+ .eq("weight", param.getWeight())
+ .orderBy("batch", true);
if (param.getDevNo() == 536) {
wrapper.eq("model", param.getModel())
.eq("specs", param.getOrderNo());
@@ -1259,6 +1275,7 @@
.lt("weight", param.getWeight() + mat.getUnits())
.and()
.gt("weight", param.getWeight())
+ .orderBy("batch", true)
.orderBy("weight", true);
if (param.getDevNo() == 536){
locDetlWrapper.eq("model", param.getModel())
@@ -1284,6 +1301,7 @@
.gt("weight", param.getWeight() - mat.getUnits())
.and()
.lt("weight", param.getWeight())
+ .orderBy("batch", true)
.orderBy("weight", false);
if (param.getDevNo() == 536){
locDetlWrapper.eq("model", param.getModel())
@@ -1311,12 +1329,48 @@
if (locDetlArrayList.size()<batchNum){
throw new CoolException("搴撳瓨鏁伴噺:"+locDetlArrayList.size()+"锛涘皬浜庨渶姹傛暟閲�:"+param.getBatchNum());
}
+ ArrayList<String> locS = new ArrayList<>();
+
+ ArrayList<LocDetl> locDetlArrayAnd = new ArrayList<>();
+ for (LocDetl locDetl : locDetlArrayList){
+ if (!locS.contains(locDetl.getLocNo())){
+ locDetlArrayAnd.add(locDetl);
+ locS.add(locDetl.getLocNo());
+ if (crnList.contains(1) || crnList.contains(2)){
+ String singleLoc = Utils.singleLoc(locDetl.getLocNo());
+ if (Cools.isEmpty(singleLoc)){
+ log.error("寮傚父搴撲綅鍙凤細"+singleLoc+"锛涜緭鍏ュ簱浣嶅彿锛�"+locDetl.getLocNo());
+ continue;
+ }
+ LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", singleLoc));
+ if (locMast.getLocSts().equals("F")){
+ LocDetl locDetl1 = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", singleLoc));
+ if (Cools.isEmpty(locDetl1)){
+ throw new CoolException("搴撲綅"+locMast.getLocNo()+"寮傚父锛屽湪搴撲絾鏄棤搴撳瓨锛侊紒锛�");
+ }
+ if (!locS.contains(locDetl1.getLocNo())){
+ if (locDetl1.getMatnr().equals(locDetl.getMatnr())){
+ locDetlArrayAnd.add(locDetl1);
+ locS.add(locDetl1.getLocNo());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (locDetlArrayAnd.isEmpty()){
+ throw new CoolException("鏈壘鍒扮鍚堟潯浠剁殑鐗╂枡鏄庣粏锛氬搧鍙�==銆媘atnr:"+param.getMatnr()+"锛涢噸閲�==銆媤right:"+param.getWeight());
+ }
+ if (locDetlArrayAnd.size()<batchNum){
+ throw new CoolException("搴撳瓨鏁伴噺:"+locDetlArrayAnd.size()+"锛涘皬浜庨渶姹傛暟閲�:"+param.getBatchNum());
+ }
ArrayList<LocDetl> locDetlArraySou = new ArrayList<>();
- for (LocDetl locDetl : locDetlArrayList){
+ for (LocDetl locDetl : locDetlArrayAnd){
if (batchNum <= 0){
- return;
+ break;
}
locDetlArraySou.add(locDetl);
batchNum --;
--
Gitblit v1.9.1