fix:子卷装箱添加装箱计划校验

This commit is contained in:
zhangzq
2025-01-18 17:25:38 +08:00
parent d46b856eea
commit 60c9524821

View File

@@ -261,10 +261,18 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
.in(PdmBiSlittingproductionplan::getContainer_name, containerNameList) .in(PdmBiSlittingproductionplan::getContainer_name, containerNameList)
.eq(PdmBiSlittingproductionplan::getIs_delete,IOSEnum.IS_NOTANDYES.code("")) .eq(PdmBiSlittingproductionplan::getIs_delete,IOSEnum.IS_NOTANDYES.code(""))
); );
List<PdmBiSubpackagerelation> subpackagerelations = this.list(new QueryWrapper<PdmBiSubpackagerelation>().in("workorder_id", workIdList));
if (ObjectUtils.isEmpty(planList)) { if (ObjectUtils.isEmpty(planList)) {
throw new BadRequestException("子卷查询不到分切计划,请检查!"); throw new BadRequestException("子卷查询不到分切计划,请检查!");
} }
Optional<PdmBiSubpackagerelation> any = subpackagerelations.stream()
.filter(sub -> sub.getStatus().equals("0") && StringUtils.isNotEmpty(sub.getPackage_box_sn()))
.findAny();
if (any.isPresent()){
PdmBiSubpackagerelation subpackagerelation = any.get();
throw new BadRequestException(subpackagerelation.getPackage_box_sn()+"包装关系已存在"+subpackagerelation.getPackage_box_sn()+"如重新生成请确认MES跟LMS包装关系已解绑定");
}
BigDecimal totalWeight; BigDecimal totalWeight;
totalWeight = planList.stream() totalWeight = planList.stream()
.map(PdmBiSlittingproductionplan::getWeight) .map(PdmBiSlittingproductionplan::getWeight)