分配问题修改;
This commit is contained in:
+2
-2
@@ -611,8 +611,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
? outMaterialDetailDb.getAllocationQuantity()
|
||||
: BigDecimal.ZERO;
|
||||
// 分配数量和已分配数量都减少:本次手动取消分配视为“把这条明细已分配的全部撤回”
|
||||
BigDecimal newAllocationQuantity = dbAllocationQuantity.subtract(allocationQuantity);
|
||||
if ((newAllocationQuantity.add(childAllocationQuantity)).compareTo(BigDecimal.ZERO) < 0) {
|
||||
BigDecimal newAllocationQuantity = dbAllocationQuantity.add(childAllocationQuantity).subtract(allocationQuantity);
|
||||
if ((newAllocationQuantity).compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new ServiceException("物料" + outMaterialDetailDb.getMaterialName() + ",取消分配数量不能大于分配总数");
|
||||
}
|
||||
outMaterialDetail.setAllocationQuantity(newAllocationQuantity);
|
||||
|
||||
Reference in New Issue
Block a user