|
@@ -54,6 +54,8 @@ public class ProductInfoServiceImpl implements ProductInfoService {
|
|
|
|
|
|
@Resource
|
|
|
private FarmerInfoMapper farmerInfoMapper;
|
|
|
+ @Resource
|
|
|
+ private ProductTypePriceMapper productTypePriceMapper;
|
|
|
|
|
|
private static final GeneratorIdUtils ID_UTILS_INSTANCE = new GeneratorIdUtils();
|
|
|
|
|
@@ -408,7 +410,18 @@ public class ProductInfoServiceImpl implements ProductInfoService {
|
|
|
goodsInfo.setIsSale(1);
|
|
|
goodsInfo.setCreateTime(new Date());
|
|
|
goodsInfo.setModifiedTime(new Date());
|
|
|
+ goodsInfo.setCreateUser(CurrUserUtil.getUserId());
|
|
|
+ goodsInfo.setModifiedUser(CurrUserUtil.getUserId());
|
|
|
+
|
|
|
+ //查询产品类别最新定价为商品售价 lym
|
|
|
+ String fkProductType = productInfo.getFkProductType();
|
|
|
+ ProductTypePriceWithBLOBs typePriceWithBLOBs = productTypePriceMapper.selectNewProductTypePrice(fkProductType);
|
|
|
+ if (typePriceWithBLOBs != null && typePriceWithBLOBs.getFkProductType().contains(fkProductType)){
|
|
|
+ goodsInfo.setPrice(typePriceWithBLOBs.getPrice());
|
|
|
+ }
|
|
|
+
|
|
|
result = this.goodsInfoMapper.insert(goodsInfo);
|
|
|
+
|
|
|
if (result < 1) throw new RuntimeException("产品发布 -- 添加商品记录失败");
|
|
|
|
|
|
GoodsDetail goodsDetail = new GoodsDetail();
|
|
@@ -437,6 +450,7 @@ public class ProductInfoServiceImpl implements ProductInfoService {
|
|
|
goodsSaleInfo.setSaleType(goodsInfoForm.getSaleType());
|
|
|
goodsSaleInfo.setSaleTargets(goodsInfoForm.getSaleTargets());
|
|
|
goodsSaleInfo.setModifiedTime(new Date());
|
|
|
+ goodsSaleInfo.setSalePrice(goodsInfo.getPrice());
|
|
|
result = this.goodsSaleInfoMapper.insertSelective(goodsSaleInfo);
|
|
|
if (result < 1) throw new RuntimeException("产品发布 -- 添加商品销售信息失败");
|
|
|
|