取消分配状态吧第一条全部取消第二条还有值状态应该为部分分配
This commit is contained in:
+4
@@ -835,6 +835,10 @@ public class StockOutOrderApplicationService {
|
||||
* @return Boolean
|
||||
*/
|
||||
public Boolean cancelAssign(StockOutOrderDO stockOutOrderDO){
|
||||
StockOutOrderPO infoChildren = getInfoChildren(stockOutOrderDO.getOutOrderId());
|
||||
BigDecimal alreadyAllocationQuantityAll = infoChildren.getMaterialDetailList().stream().map(OutMaterialDetailPO::getAlreadyAllocationQuantity)
|
||||
.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockOutOrderDO.setAlreadyAllocationQuantityAll(alreadyAllocationQuantityAll);
|
||||
return stockOutOrderDomainService.cancelAssign(stockOutOrderDO);
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -406,4 +406,7 @@ public class StockOutOrderDO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "审核时间查询条件结束日期")
|
||||
private String auditTimeEnd;
|
||||
|
||||
@ApiModelProperty(name = "已分配数量总数量")
|
||||
private BigDecimal alreadyAllocationQuantityAll;
|
||||
}
|
||||
+10
-3
@@ -408,6 +408,8 @@ public class StockOutOrderDomainService {
|
||||
//修改物料明细信息
|
||||
StockOutOrderPO stockOutOrderPO = outMaterialDetailService.batchCancelAssignUpdate(stockOutOrderDb.getOutOrderNumber(), stockOutOrderDO.getMaterialDetailList());
|
||||
//修改出库单
|
||||
|
||||
stockOutOrderPO.setAlreadyAllocationQuantity(stockOutOrderDO.getAlreadyAllocationQuantityAll());//全部的已分配数量
|
||||
return updateStockOutOrderByAllocation(stockOutOrderDb, stockOutOrderPO, 2);
|
||||
}
|
||||
|
||||
@@ -445,13 +447,18 @@ public class StockOutOrderDomainService {
|
||||
// 如果出库单的已分配数量小于要取消的数量,说明数据不一致,使用要取消的数量作为基准
|
||||
alreadyAllocationQuantity = cancelAlreadyAllocationQuantity;
|
||||
}
|
||||
alreadyAllocationQuantity = alreadyAllocationQuantity.subtract(cancelAlreadyAllocationQuantity);
|
||||
alreadyAllocationQuantity = alreadyAllocationQuantity.subtract(cancelQuantity);
|
||||
// 确保不会变成负数
|
||||
if (alreadyAllocationQuantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
alreadyAllocationQuantity = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
status = judgeAllocationQuantityByManualAssign(stockOutOrderPO.getAllocationQuantity(), stockOutOrderPO.getAlreadyAllocationQuantity(),type);
|
||||
BigDecimal subtract = stockOutOrderPO.getAlreadyAllocationQuantity().subtract(alreadyAllocationQuantity);
|
||||
if (subtract.compareTo(BigDecimal.ZERO) == 0) {
|
||||
status = 2;
|
||||
} else {
|
||||
status = 3;
|
||||
}
|
||||
// status = judgeAllocationQuantityByManualAssign(stockOutOrderPO.getAllocationQuantity(), stockOutOrderPO.getAlreadyAllocationQuantity(),type);
|
||||
|
||||
}else {
|
||||
allocationQuantity = stockOutOrderPO.getAllocationQuantity();//直接使用返回的分配数量
|
||||
|
||||
Reference in New Issue
Block a user