From 522073f658bccd864bddeaf1763701a21a8b64c1 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期二, 25 三月 2025 16:03:10 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/service/CommonService.java | 82 ++++++++++++++++++++++++---------------- 1 files changed, 49 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java index 09ce68b..c6031f3 100644 --- a/src/main/java/com/zy/common/service/CommonService.java +++ b/src/main/java/com/zy/common/service/CommonService.java @@ -570,46 +570,62 @@ if (Cools.isEmpty(locMast) && crnNo != 0) { List<LocMast> locMasts = new ArrayList<>(); int floor = 0; - if (locTypeDto.getLocType1() == 1){ - int F1count = locMastService.selectCount(new EntityWrapper<LocMast>() - .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()) - .eq("crn_no", 7) - .eq("loc_type1", locTypeDto.getLocType1()) - .eq("lev1", 1)); - if (F1count <= 10) { - int F2count = locMastService.selectCount(new EntityWrapper<LocMast>() + if (locTypeDto.getLev1() == null){ + if (locTypeDto.getLocType1() == 1){ + int F1count = locMastService.selectCount(new EntityWrapper<LocMast>() .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()) .eq("crn_no", 7) .eq("loc_type1", locTypeDto.getLocType1()) - .eq("lev1", 2)); - if (F2count <= 10) { - throw new CoolException("搴撲綅涓嶈冻"); + .eq("lev1", 1)); + if (F1count <= 10) { + int F2count = locMastService.selectCount(new EntityWrapper<LocMast>() + .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()) + .eq("crn_no", 7) + .eq("loc_type1", locTypeDto.getLocType1()) + .eq("lev1", 2)); + if (F2count <= 10) { + throw new CoolException("搴撲綅涓嶈冻"); + }else { + floor = 2; + } }else { - floor = 2; + floor = 1; } - }else { - floor = 1; - } - }else if (locTypeDto.getLocType1() == 2){ - int F3count = locMastService.selectCount(new EntityWrapper<LocMast>() - .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()) - .eq("crn_no", 7) - .eq("loc_type1", locTypeDto.getLocType1()) - .eq("lev1", 3)); - if (F3count <= 10) { - throw new CoolException("搴撲綅涓嶈冻"); + }else if (locTypeDto.getLocType1() == 2){ + int F3count = locMastService.selectCount(new EntityWrapper<LocMast>() + .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()) + .eq("crn_no", 7) + .eq("loc_type1", locTypeDto.getLocType1()) + .eq("lev1", 3)); + if (F3count <= 10) { + throw new CoolException("搴撲綅涓嶈冻"); + } + floor = 3; + }else { + throw new CoolException("搴撲綅楂樺害鏁版嵁寮傚父"); } - floor = 3; - }else { - throw new CoolException("搴撲綅楂樺害鏁版嵁寮傚父"); } - locMasts = locMastService.selectList(new EntityWrapper<LocMast>() - .eq("bay1", nearRow) - .in("loc_sts", "O").eq("whs_type",rowLastnoType.getType().longValue()) - .eq("crn_no",7) - .eq("loc_type1",locTypeDto.getLocType1()) - .eq("lev1",floor).orderBy("row1",false));//鏈�娴呭簱浣� + + if (locTypeDto.getLev1() != null){ + locMasts = locMastService.selectList(new EntityWrapper<LocMast>() + .eq("bay1", nearRow) + .in("loc_sts", "O").eq("whs_type",rowLastnoType.getType().longValue()) + .eq("crn_no",7) + .eq("loc_type1",locTypeDto.getLocType1()) + .eq("lev1",locTypeDto.getLev1()).orderBy("row1",false));//鏈�娴呭簱浣� + }else { + if (floor == 0){ + throw new CoolException("搴撲綅宸叉弧"); + } + locMasts = locMastService.selectList(new EntityWrapper<LocMast>() + .eq("bay1", nearRow) + .in("loc_sts", "O").eq("whs_type",rowLastnoType.getType().longValue()) + .eq("crn_no",7) + .eq("loc_type1",locTypeDto.getLocType1()) + .eq("lev1",floor).orderBy("row1",false));//鏈�娴呭簱浣� + } + for (LocMast locMast1 : locMasts) { if (locMast != null){ @@ -636,7 +652,7 @@ continue; } for (LocMast locMastGro1 : locMasts1) { - if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q") || locMastGro1.getLocSts().equals("R")) { + if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q") || locMastGro1.getLocSts().equals("R") || locMastGro1.getLocSts().equals("X")) { break; } if (locMastGro1.getLocSts().equals("O")){ -- Gitblit v1.9.1