瀏覽代碼

Merge remote-tracking branch 'origin/master'

周箭河 5 年之前
父節點
當前提交
3392bbd4a0

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -75,6 +75,9 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	public void addGoodsProcurement(Goods goods, Integer operatorId) {
 		Goods existsGood = goodsDao.findBySn(goods.getSn());
 		if(Objects.nonNull(existsGood)){
+			if(Objects.nonNull(existsGood.getComplementGoodsIdList())){
+				throw new BizException("此货号组合商品已存在");
+			}
 			existsGood.setStockCount(existsGood.getStockCount()+goods.getStockCount());
 			existsGood.setTaxStockCount(existsGood.getTaxStockCount()+existsGood.getTaxStockCount());
 			goodsDao.update(existsGood);

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -57,7 +57,7 @@
         discount_price_,group_purchase_price_,brief_,desc_,is_new_,is_top_,status_,memo_,publish_time_,
         complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,client_show_,stock_warning_)
         VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{taxStockCount},#{sellCount},#{marketPrice},
-        #{discountPrice},#{groupPurchasePrice},#{brief},
+        #{discountPrice},#{groupPurchasePrice},#{brief},#{desc},
         #{isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{memo},#{publishTime},#{complementGoodsIdList},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{agreeCostPrice},
         #{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
@@ -65,12 +65,12 @@
     <insert id="batchInsert">
         INSERT INTO goods
         (goods_category_id_,name_,brand_,specification_,image_,market_price_,
-        discount_price_,group_purchase_price_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_,
+        discount_price_,group_purchase_price_,brief_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_,
         stock_count_,tax_stock_count_,client_show_,stock_warning_)
         VALUES
         <foreach collection="goodsList" separator="," item="goods">
             (#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
-            #{goods.discountPrice},#{goods.groupPurchasePrice},#{goods.desc},now(),now(),
+            #{goods.discountPrice},#{goods.groupPurchasePrice},#{goods.brief},#{goods.desc},now(),now(),
             #{goods.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.agreeCostPrice},#{goods.sn},
             #{goods.stockCount},#{goods.taxStockCount},#{goods.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
         </foreach>