| | |
| | | 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){ |