add:增加子卷包装关系更新木箱长宽高,增加过滤条件非空校验

This commit is contained in:
2024-08-02 19:57:54 +08:00
parent b30cbe3922
commit 168cdcbbdd
3 changed files with 23 additions and 17 deletions

View File

@@ -266,7 +266,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
BigDecimal totalWeight; BigDecimal totalWeight;
totalWeight = planList.stream() totalWeight = planList.stream()
.map(PdmBiSlittingproductionplan::getWeight) .map(PdmBiSlittingproductionplan::getWeight)
.filter(Objects::nonNull) .filter(p -> p != null && !p.trim().isEmpty())
.filter(r -> !r.isEmpty()) .filter(r -> !r.isEmpty())
.map(BigDecimal::new) .map(BigDecimal::new)
.reduce(BigDecimal.ZERO, BigDecimal::add); .reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -278,7 +278,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
.selectList(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getSale_order_name, packagerelationList.get(0).getSale_order_name())); .selectList(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getSale_order_name, packagerelationList.get(0).getSale_order_name()));
Integer maxBoxGroup = pdmBiSubpackagerelationList.stream() Integer maxBoxGroup = pdmBiSubpackagerelationList.stream()
.map(PdmBiSubpackagerelation::getBox_group) .map(PdmBiSubpackagerelation::getBox_group)
.filter(Objects::nonNull) .filter(r -> r != null && !r.trim().isEmpty())
.map(Integer::parseInt) .map(Integer::parseInt)
.max(Integer::compareTo) .max(Integer::compareTo)
.orElse(0) + 1; .orElse(0) + 1;
@@ -343,7 +343,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
String weightTotal = totalWeight.toString(); String weightTotal = totalWeight.toString();
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
try { try {
updateBoxGroup(maxBoxGroup, workIdList, boxSn, whereJson.getString("checked"), weightTotal); updateBoxGroup(maxBoxGroup, workIdList, boxDao, weightTotal);
} catch (Exception e) { } catch (Exception e) {
log.error("子卷装箱异常updateBoxGroup更新子卷包装关系异常,木箱号为:" + boxSn + ",异常信息:" + e); log.error("子卷装箱异常updateBoxGroup更新子卷包装关系异常,木箱号为:" + boxSn + ",异常信息:" + e);
} }
@@ -367,14 +367,16 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
} }
private void updateBoxGroup(Integer maxBoxGroup, List<String> entityList, BstIvtBoxinfo boxDao, String totalWeight) {
private void updateBoxGroup(Integer maxBoxGroup, List<String> entityList, String boxSn, String boxType, String totalWeight) {
UpdateWrapper<PdmBiSubpackagerelation> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<PdmBiSubpackagerelation> updateWrapper = new UpdateWrapper<>();
//理论毛重 //理论毛重
updateWrapper.set("box_weight", totalWeight); updateWrapper.set("box_weight", totalWeight);
updateWrapper.set("package_box_sn", boxSn); updateWrapper.set("package_box_sn", boxDao.getBox_no());
updateWrapper.set("quanlity_in_box", entityList.size()); updateWrapper.set("quanlity_in_box", entityList.size());
updateWrapper.set("box_type", boxType); updateWrapper.set("box_type", boxDao.getMaterial_code());
updateWrapper.set("box_length", boxDao.getBox_length());
updateWrapper.set("box_width", boxDao.getBox_width());
updateWrapper.set("box_high", boxDao.getBox_high());
updateWrapper.set("box_group", maxBoxGroup); updateWrapper.set("box_group", maxBoxGroup);
updateWrapper.set("status", "0"); updateWrapper.set("status", "0");
updateWrapper.in("workorder_id", entityList); updateWrapper.in("workorder_id", entityList);

View File

@@ -288,14 +288,14 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
task.getPoint_code1(), task.getPoint_code1(),
task.getPoint_code3() task.getPoint_code3()
)) ))
.filter(Objects::nonNull) .filter(point -> point != null && !point.trim().isEmpty() )
.collect(Collectors.toSet()); .collect(Collectors.toSet());
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("四个点任务分配"))) { } else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("四个点任务分配"))) {
pointSets = taskList.stream() pointSets = taskList.stream()
.flatMap(task -> Stream.of( .flatMap(task -> Stream.of(
task.getPoint_code1() task.getPoint_code1()
)) ))
.filter(Objects::nonNull) .filter(point -> point != null && !point.trim().isEmpty())
.collect(Collectors.toSet()); .collect(Collectors.toSet());
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货"))) { } else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货"))) {
pointSets = taskList.stream() pointSets = taskList.stream()
@@ -303,13 +303,13 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
task.getPoint_code2(), task.getPoint_code2(),
task.getPoint_code4() task.getPoint_code4()
)) ))
.filter(Objects::nonNull) .filter(point -> point != null && !point.trim().isEmpty() && !point.equals("ZXQ_01_1") && !point.equals("ZXQ_01_2"))
.collect(Collectors.toSet()); .collect(Collectors.toSet());
List<BstIvtPackageinfoivt> ivtList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具"))).collect(Collectors.toList()); List<BstIvtPackageinfoivt> ivtList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具"))).collect(Collectors.toList());
Set<String> ivtpointSets = ivtList.stream().map(BstIvtPackageinfoivt::getPoint_code).collect(Collectors.toSet()); Set<String> ivtpointSets = ivtList.stream().map(BstIvtPackageinfoivt::getPoint_code).collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(ivtpointSets)) { if (CollectionUtils.isNotEmpty(ivtpointSets)) {
//存在任务数量+已有库存数量大于3不创建任务 //存在任务数量+已有库存数量大于3不创建任务
if (pointSets.size() + ivtpointSets.size() > 3) { if (pointSets.size() + ivtpointSets.size() >= 3) {
return returList; return returList;
} }
} }
@@ -319,7 +319,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
task.getPoint_code1(), task.getPoint_code1(),
task.getPoint_code2() task.getPoint_code2()
)) ))
.filter(Objects::nonNull) .filter(point -> point != null && !point.trim().isEmpty() )
.collect(Collectors.toSet()); .collect(Collectors.toSet());
} else { } else {
pointSets = taskList.stream() pointSets = taskList.stream()
@@ -329,7 +329,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
task.getPoint_code3(), task.getPoint_code3(),
task.getPoint_code4() task.getPoint_code4()
)) ))
.filter(Objects::nonNull) .filter(point -> point != null && !point.trim().isEmpty() )
.collect(Collectors.toSet()); .collect(Collectors.toSet());
} }
//符合条件的库存点位过滤掉已存在任务的点位 //符合条件的库存点位过滤掉已存在任务的点位
@@ -346,11 +346,13 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
/** /**
* 获取没有阻挡的点位 * 获取没有阻挡的点位
* ivtList 没分配任务的点位
* taskList 已分配任务的点位
*/ */
private List<BstIvtPackageinfoivt> getNoBlockIvt(String pointCode, List<SchBaseTask> taskList, List<BstIvtPackageinfoivt> ivtList) { private List<BstIvtPackageinfoivt> getNoBlockIvt(String pointCode, List<SchBaseTask> taskList, List<BstIvtPackageinfoivt> ivtList) {
Set<String> taskPointSet = null; Set<String> taskPointSet = null;
if (CollectionUtils.isEmpty(taskList)) { if (CollectionUtils.isNotEmpty(taskList)) {
taskPointSet = taskList.stream().map(SchBaseTask::getPoint_code2).filter(pointCode2 -> !pointCode2.equals("ZXQ_01_1")).collect(Collectors.toSet()); taskPointSet = taskList.stream().map(SchBaseTask::getPoint_code2).filter(pointCode2 -> !pointCode2.equals("ZXQ_01_1") && !pointCode2.equals("ZXQ_01_2")).collect(Collectors.toSet());
} }
List<BstIvtPackageinfoivt> pointList = new ArrayList<>(); List<BstIvtPackageinfoivt> pointList = new ArrayList<>();
//存在补空载具任务已分配却未完成的任务 //存在补空载具任务已分配却未完成的任务

View File

@@ -20,20 +20,22 @@ public enum PackageInfoIvtEnum {
//点位类型 //点位类型
POINT_STATUS(MapOf.of("满轴缓存位", "1", "空载具缓存位", "2", "待检区", "3", "管制区", "4", "装箱位", "5", "装箱区", "6","等待点", "7")), POINT_STATUS(MapOf.of("满轴缓存位", "1", "空载具缓存位", "2", "待检区", "3", "管制区", "4", "装箱位", "5", "装箱区", "6","等待点", "7")),
//深浅位类型
DEPTH_TYPE(MapOf.of("浅货位", "0", "深货位", "1")),
//任务类型 //任务类型
TASK_TYPE(MapOf.of("输送线->满轴缓存位", "010901", "满轴缓存位->待检区", "010902", "满轴缓存位->管制区", TASK_TYPE(MapOf.of("输送线->满轴缓存位", "010901", "满轴缓存位->待检区", "010902", "满轴缓存位->管制区",
"010903", "放空(空载具缓存位->输送线)", "010904", "补空(待检区->空载具缓存位)", "010905", "待检区->管制区", "010903", "放空(空载具缓存位->输送线)", "010904", "补空(待检区->空载具缓存位)", "010905", "待检区->管制区",
"010906", "管制区->待检区", "010907", "待检区->装箱区", "010908", "装箱区->装箱对接位", "010909", "010906", "管制区->待检区", "010907", "待检区->装箱区", "010908", "装箱区->装箱对接位", "010909",
"补空(装箱区->待检区)", "010910", "输送线四个点任务", "010911", "补空(装箱区->管制区)", "010912", "补空(装箱区->待检区)", "010910", "输送线四个点任务", "010911", "补空(装箱区->管制区)", "010912",
"补空(管制区->空载具缓存位)","010913")), "补空(管制区->空载具缓存位)","010913","待检区移库任务","010914","管制区移库任务","010915")),
//ACS任务类型 //ACS任务类型
ACS_TASK_TYPE(MapOf.of("agv任务", "1", "桁架任务", "6")), ACS_TASK_TYPE(MapOf.of("agv任务", "1", "桁架任务", "6")),
//agv二次分配类型 //agv二次分配类型
AGV_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "取放货二次分配", "4")), AGV_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "取放货二次分配", "4", "移库任务", "5")),
//二次分配请求类型 //二次分配请求类型