重复分配修改;

This commit is contained in:
王奎兴
2026-02-25 13:40:21 +08:00
parent bcc777539a
commit a42c2fde3f
4 changed files with 21 additions and 5 deletions
@@ -444,4 +444,8 @@ public class OutMaterialDetail extends BaseVOEntity {
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
}
@@ -299,10 +299,14 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
totalAllocationQuantity = totalAllocationQuantity.add(outMaterialDetail.getAlreadyAllocationQuantity());
}
stockOutOrderPO.setAllocationQuantity(totalAllocationQuantity);
//保存物料明细信息
saveOrUpdateBatch(outMaterialDetailList);
//分配(修改库存)
xgkc(outMaterialDetailList,outOrderNumber,loginUser);
//保存物料明细信息
//给MaterialDetailList中的每一项的isAllocated赋值为1
outMaterialDetailList.forEach(outMaterialDetail -> {
outMaterialDetail.setIsAllocated("1");
});
saveOrUpdateBatch(outMaterialDetailList);
return stockOutOrderPO;
}
@@ -416,10 +420,11 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
StockOutOrder stockOutOrder = stockOutOrderMapper.selectOne(new QueryWrapper<StockOutOrder>().lambda().eq(StockOutOrder::getOutOrderNumber, outOrderNumber));
for (OutMaterialDetail outMaterialDetail : outMaterialDetailList) {
BigDecimal alreadyAllocationQuantity = outMaterialDetail.getAlreadyAllocationQuantity();
// 如果已经分配数量大于0,则跳过本次循环(该明细已分配过,不再重复处理)
/*if (alreadyAllocationQuantity != null && alreadyAllocationQuantity.compareTo(BigDecimal.ZERO) > 0) {
String isAllocated = outMaterialDetail.getIsAllocated();
// 如果已经分配过,则跳过本次循环(该明细已分配过,不再重复处理)
if (isAllocated != null && "1".equals(isAllocated)) {
continue;
}*/
}
Long materialInventoryId = outMaterialDetail.getMaterialInventoryId();
BigDecimal allocationQuantity = outMaterialDetail.getAllocationQuantity();
if (ObjectUtils.isEmpty(allocationQuantity)) {
@@ -462,4 +462,8 @@ public class OutMaterialDetailPO extends StockOutOrderBaseDO {
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
}
@@ -420,4 +420,7 @@ public class OutMaterialDetailDO extends BaseVOEntity {
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
}