|
@@ -2,6 +2,7 @@ package com.gree.mall.manager.bean.material.stock;
|
|
|
|
|
|
import com.gree.mall.manager.enums.material.DirectFlagEnum;
|
|
|
import com.gree.mall.manager.enums.material.PartsAttrEnum;
|
|
|
+import com.gree.mall.manager.enums.material.WebsitGoodsTypeEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.plus.entity.WorkerStock;
|
|
|
import com.gree.mall.manager.plus.entity.WorkerStockAcc;
|
|
@@ -179,9 +180,9 @@ public class WorkerStockDTO {
|
|
|
}
|
|
|
BigDecimal direct = this.directFlag.equals(DirectFlagEnum.ADD.getKey()) ? BigDecimal.ONE : new BigDecimal("-1");
|
|
|
BigDecimal closeQty = qty.add(this.changeQty.multiply(direct));
|
|
|
-// if (closeQty.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
-// throw new RemoteServiceException(workerStock.getGoodsName() + ":" + PartsAttrEnum.valueOf(this.partsAttr).getRemark() + "结存库存不能少于0");
|
|
|
-// }
|
|
|
+ if (closeQty.compareTo(BigDecimal.ZERO) < 0 && workerStock.getGoodsType().equals(WebsitGoodsTypeEnum.P.getKey())) {
|
|
|
+ throw new RemoteServiceException(workerStock.getGoodsName() + ":" + PartsAttrEnum.valueOf(this.partsAttr).getRemark() + "结存库存不能少于0");
|
|
|
+ }
|
|
|
// 注入三级帐
|
|
|
BeanUtils.copyProperties(this, workerStockAcc);
|
|
|
workerStockAcc.setQty(qty)
|