Browse Source

update 商品增加是否置换商品字段

周箭河 4 năm trước cách đây
mục cha
commit
e989d64677

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

@@ -252,6 +252,15 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 						}
 						continue;
 					}
+					if (columnValue.equals("replacementShow")) {
+						for (YesOrNoEnum yesOrNoEnum : YesOrNoEnum.values()) {
+							if (yesOrNoEnum.getMsg().equals(row.get(s).toString())) {
+								objectMap.put(columnValue, yesOrNoEnum);
+								break;
+							}
+						}
+						continue;
+					}
 					if (columnValue.equals("clientShow")) {
 						for (YesOrNoEnum yesOrNoEnum : YesOrNoEnum.values()) {
 							if (yesOrNoEnum.getMsg().equals(row.get(s).toString())) {

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

@@ -62,20 +62,20 @@
         INSERT INTO goods
         (goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,tax_stock_count_,sell_count_,market_price_,
         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_,educational_show_,music_group_show_,stock_warning_,stock_type_)
+        complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,client_show_,educational_show_,music_group_show_,replacement_show_,stock_warning_,stock_type_)
         VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{taxStockCount},#{sellCount},#{marketPrice},
         #{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},#{educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
+        #{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
         INSERT INTO goods
         (goods_category_id_,name_,brand_,specification_,image_,market_price_,
         discount_price_,group_purchase_price_,brief_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_,
-        stock_count_,tax_stock_count_,client_show_,educational_show_,music_group_show_,stock_warning_,stock_type_)
+        stock_count_,tax_stock_count_,client_show_,educational_show_,music_group_show_,replacement_show_,stock_warning_,stock_type_)
         VALUES
         <foreach collection="list" separator="," item="goods">
             (#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
@@ -84,6 +84,7 @@
             #{goods.stockCount},#{goods.taxStockCount},#{goods.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{goods.educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         	#{goods.musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        	#{goods.replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
         </foreach>
@@ -167,6 +168,9 @@
             <if test="musicGroupShow != null">
                 music_group_show_ = #{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
+            <if test="replacementShow != null">
+                replacement_show_ = #{replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
             <if test="stockWarning != null">
                 stock_warning_ = #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
@@ -257,6 +261,9 @@
 	            <if test="goods.musicGroupShow != null">
 	                music_group_show_ = #{goods.musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 	            </if>
+                <if test="goods.replacementShow != null">
+                    music_group_show_ = #{goods.replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+                </if>
                 <if test="goods.stockWarning != null">
                     stock_warning_ = #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
                 </if>

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -217,11 +217,11 @@ public class ExportController extends BaseController {
         OutputStream outputStream = response.getOutputStream();
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"商品编号", "货号", "品牌", "商品名称",
-                    "是否组合商品", "学员是否展示", "教务端是否展示", "乐团是否展示", "是否库存预警",
+                    "是否组合商品", "学员是否展示", "教务端是否展示", "乐团是否展示","是否乐器置换", "是否库存预警",
                     "商品类型", "商品分类", "具体型号", "内部库存", "税务库存", "库存类型", "市场价(元)",
                     "零售价(元)", "商品团购价(元)", "商品描述", "商品详情", "是否上下架"}, new String[]{
                     "id", "sn", "brand", "name",
-                    "complementGoodsIdList == null || complementGoodsIdList == '' ? '否':'是'", "clientShow.msg", "educationalShow.msg", "musicGroupShow.msg", "stockWarning.msg",
+                    "complementGoodsIdList == null || complementGoodsIdList == '' ? '否':'是'", "clientShow.msg", "educationalShow.msg", "musicGroupShow.msg","replacementShow.msg", "stockWarning.msg",
                     "type.desc", "goodsCategoryName", "specification", "stockCount", "taxStockCount", "stockType.msg", "marketPrice",
                     "discountPrice", "groupPurchasePrice", "brief", "desc", "status.msg"}, rows);
             response.setContentType("application/octet-stream");

+ 1 - 0
mec-web/src/main/resources/columnMapper.ini

@@ -18,6 +18,7 @@
 是否App展示 = clientShow
 是否在教务端展示 = educationalShow
 是否在乐团展示 = musicGroupShow
+是否乐器置换 = replacementShow
 库存类型 = stockType
 商品详情 = desc
 库存预警 = stockWarning

BIN
mec-web/src/main/resources/excelTemplate/商品导入模板.xls