Commit f957b7d6 authored by 方建宇's avatar 方建宇

价格校验

parent ffe9b468
...@@ -178,5 +178,11 @@ public class StoreGoodsStock extends CyIdIncreEntity<StoreGoodsStock> { ...@@ -178,5 +178,11 @@ public class StoreGoodsStock extends CyIdIncreEntity<StoreGoodsStock> {
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal salesCategories; private BigDecimal salesCategories;
/**
* 价格
*/
@TableField(exist = false)
private String isPrice;
} }
...@@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -198,11 +199,21 @@ public class StoreGoodsStockServiceImpl extends ServiceImpl<StoreGoodsStockRepos ...@@ -198,11 +199,21 @@ public class StoreGoodsStockServiceImpl extends ServiceImpl<StoreGoodsStockRepos
StoreGoodsStock stock = new StoreGoodsStock(); StoreGoodsStock stock = new StoreGoodsStock();
stock.setActualGoodsCode(wmsGoods.getGoodsCode()); stock.setActualGoodsCode(wmsGoods.getGoodsCode());
stock.setActualGtGoodsCounts(0); stock.setActualGtGoodsCounts(0);
stock.setIsPrice(wmsGoods.getIsPrice());
stock.setStoreId(CyUserUtil.getAuthenDept());
// 1. 查询 goodsNumber // 1. 查询 goodsNumber
List<StoreGoodsStock> result = baseMapper.queryWmsGoodsStocks(stock); List<StoreGoodsStock> result = baseMapper.queryWmsGoodsStocks(stock);
if(CollectionUtils.isEmpty(result) || result.size() > 1 || result.get(0).getGoodsCounts() < 1) { if(CollectionUtils.isEmpty(result) || result.size() > 1 || result.get(0).getGoodsCounts() < 1) {
throw new CyServiceException(500, "商品不存在或库存不足!"); throw new CyServiceException(500, "商品不存在或库存不足!");
} }
if(Objects.equals(stock.getIsPrice(), "1")) {
if(result.get(0).getOriginalPrice() == null||result.get(0).getDiscountPrice() == null || result.get(0).getStorePrice() == null){
throw new CyServiceException(500, "商品价格不存在!");
}
}
return result.get(0); return result.get(0);
} }
......
...@@ -171,5 +171,11 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> { ...@@ -171,5 +171,11 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
@TableField(exist = false) @TableField(exist = false)
private String isReturn; private String isReturn;
/**
* 价格
*/
@TableField(exist = false)
private String isPrice;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment