|
|
@@ -1360,6 +1360,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
private ResultMap putOnGoods(Goods goods) {
|
|
|
if (goods != null) {
|
|
|
+ if(goods.getProductid() != null) {
|
|
|
+ Product product = productDao.findOne(goods.getProductid());
|
|
|
+ if(product != null) {
|
|
|
+ if (StringConstant.ERP.equals(product.getSourceApp())) {
|
|
|
+ List<Goods> goodses = goodsDao.findByProductId(product.getId());
|
|
|
+ Double reserve = productService.getGoodsReserveByErpReserve(product.getErpReserve(), goodses);
|
|
|
+ if (NumberUtil.compare(reserve, DoubleConstant.zero) < 0) {
|
|
|
+ throw new IllegalOperatorException("总在售库存量超过空闲库存量");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
setGoodsDefault(goods);
|
|
|
ResultMap resultMap = checkGoods(goods);
|
|
|
if (resultMap.getCode() != CodeType.OK.code()) {
|