opt:增加子卷重量校验

This commit is contained in:
2024-08-01 18:40:45 +08:00
parent 2a8a95e174
commit 68e5217822

View File

@@ -210,6 +210,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (CollectionUtils.isEmpty(ivtList)) {
throw new BadRequestException("该子卷未质检或品质不符合要求,请扫码质检!");
}
if (ivtList.stream().noneMatch(r -> r.getPoint_status().equals(PackageInfoIvtEnum.POINT_STATUS.code("待检区")))) {
throw new BadRequestException("该子卷不在待检区,请检查!");
}
pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper.queryContainerNameBySaleOrder(null, whereJson.get("container_name").toString());
}
Map<String, Long> countByGroup = pdmBiSubpackagerelationList.stream()
@@ -220,8 +223,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
// int containerLength = getMaxNum(null, r.getPaper_tube_description());
// r.setUn_plan_product_property3(Integer.toString(containerLength));
if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) {
// r.setWeight(r.getWeight() != null ? r.getPaper_weight() : "0");
// r.setPaper_weight(r.getPaper_weight() != null ? r.getPaper_weight() : "0");
// r.setWeight(r.getWeight() != null ? r.getPaper_weight() : "0");
// r.setPaper_weight(r.getPaper_weight() != null ? r.getPaper_weight() : "0");
if (r.getBox_group() != null) {
r.setQuanlity_in_box(BigDecimal.valueOf(countByGroup.getOrDefault(r.getBox_group(), null)));
} else {
@@ -326,7 +329,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
throw new BadRequestException("分切计划的子卷重量不能为0");
}
// outBox(workIdList, containerNameList, deviceCode, maxBoxGroup,whereJson,totalWeight);
outBox(workIdList, containerNameList, deviceCode, maxBoxGroup,whereJson,totalWeight);
} catch (Exception e) {
throw new BadRequestException(e.getMessage());
}