|
|
@@ -186,6 +186,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//查询库存是否存在
|
|
|
InventoryResponse inventoryResponse = this.checkInventoryExist(outboundItemVO);
|
|
|
if (inventoryResponse != null) {
|
|
|
+ //库存量小于本次出库数量
|
|
|
+ if(inventoryResponse.getInvQty().compareTo(outboundItemVO.getOutingQty())<0){
|
|
|
+ throw new BaseBusinessException(ErrorCodeEnum.SKU_IS_NOT_IN_INVENTORY.getCode(),
|
|
|
+ ErrorCodeEnum.SKU_IS_NOT_IN_INVENTORY.getMessage());
|
|
|
+ }
|
|
|
+ //region todo 2024年7月10日14:36:47 严格按照库存数量足够额为准
|
|
|
BigDecimal invQty = inventoryResponse.getInvQty().subtract(outboundItemVO.getOutingQty());
|
|
|
// (库存量 大于等于 本次出库数量不用做任何处理)
|
|
|
//库存量 小于 本次出库数量
|
|
|
@@ -194,6 +200,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//不够库存数量----新建出库中数量
|
|
|
outboundItemVO.setNotEnoughInventoryQty(invQty.abs());
|
|
|
}
|
|
|
+ //endregion
|
|
|
} else {
|
|
|
//todo 2024年7月2日09:23:38 修改成无库存不允许出库
|
|
|
// //不够库存数量----新建出库中数量
|
|
|
@@ -554,7 +561,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -801,7 +808,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -846,7 +853,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -978,7 +985,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1012,7 +1019,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1260,7 +1267,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1336,7 +1343,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1555,7 +1562,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1603,7 +1610,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1829,7 +1836,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1994,7 +2001,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -2070,7 +2077,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
int countRow = orderItemMapper.updateById(orderItem);
|
|
|
//数量超出
|
|
|
if (countRow == 0) {
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVENTORY_QUANTITY_EXCEEDED_OUTBOUND.getMessage());
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UPDATE_ORDER_ERROR.getMessage());
|
|
|
}
|
|
|
}
|
|
|
//endregion
|