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