Authored by mali

展示渠道

1 package com.yoho.ufo.dal.model; 1 package com.yoho.ufo.dal.model;
2 2
  3 +import com.alibaba.fastjson.JSONObject;
  4 +
3 import java.math.BigDecimal; 5 import java.math.BigDecimal;
4 import java.util.List; 6 import java.util.List;
5 7
@@ -62,11 +64,15 @@ public class Product { @@ -62,11 +64,15 @@ public class Product {
62 64
63 private BigDecimal offerPrice; 65 private BigDecimal offerPrice;
64 66
  67 +
  68 +
65 private String hsCode; 69 private String hsCode;
66 private String measuremenCode; 70 private String measuremenCode;
67 private String barCode; 71 private String barCode;
68 private String productNameCn; 72 private String productNameCn;
69 73
  74 + private String showChannel; // 展示哪些频道内 '0 代表有货 1代表闲鱼 多个用逗号分隔
  75 +
70 public Integer getId() { 76 public Integer getId() {
71 return id; 77 return id;
72 } 78 }
@@ -322,4 +328,17 @@ public class Product { @@ -322,4 +328,17 @@ public class Product {
322 public void setMeasuremenCode(String measuremenCode) { 328 public void setMeasuremenCode(String measuremenCode) {
323 this.measuremenCode = measuremenCode; 329 this.measuremenCode = measuremenCode;
324 } 330 }
  331 +
  332 + public String getShowChannel() {
  333 + return showChannel;
  334 + }
  335 +
  336 + public void setShowChannel(String showChannel) {
  337 + this.showChannel = showChannel;
  338 + }
  339 +
  340 + @Override
  341 + public String toString() {
  342 + return JSONObject.toJSONString(this);
  343 + }
325 } 344 }
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 <result column="measuremen_code" jdbcType="VARCHAR" property="measuremenCode" /> 28 <result column="measuremen_code" jdbcType="VARCHAR" property="measuremenCode" />
29 <result column="bar_code" jdbcType="VARCHAR" property="barCode" /> 29 <result column="bar_code" jdbcType="VARCHAR" property="barCode" />
30 <result column="product_name_cn" jdbcType="VARCHAR" property="productNameCn" /> 30 <result column="product_name_cn" jdbcType="VARCHAR" property="productNameCn" />
  31 + <result column="show_channel" jdbcType="VARCHAR" property="showChannel" />
31 </resultMap> 32 </resultMap>
32 33
33 <insert id="insert" parameterType="com.yoho.ufo.dal.model.Product" useGeneratedKeys="true" keyProperty="id" > 34 <insert id="insert" parameterType="com.yoho.ufo.dal.model.Product" useGeneratedKeys="true" keyProperty="id" >
@@ -37,7 +38,7 @@ @@ -37,7 +38,7 @@
37 min_price, max_price, create_time, 38 min_price, max_price, create_time,
38 update_time, shelve_time, edit_time, 39 update_time, shelve_time, edit_time,
39 shelve_status, storage, key_words, 40 shelve_status, storage, key_words,
40 - del_status, age_level, is_syn_calender, offer_price,hs_code,bar_code,product_name_cn,measuremen_code) 41 + del_status, age_level, is_syn_calender, offer_price,hs_code,bar_code,product_name_cn,measuremen_code, show_channel)
41 values (#{id,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, #{productCode,jdbcType=VARCHAR}, 42 values (#{id,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, #{productCode,jdbcType=VARCHAR},
42 #{maxSortId,jdbcType=INTEGER}, #{midSortId,jdbcType=INTEGER}, #{brandId,jdbcType=INTEGER}, 43 #{maxSortId,jdbcType=INTEGER}, #{midSortId,jdbcType=INTEGER}, #{brandId,jdbcType=INTEGER},
43 #{seriesId,jdbcType=INTEGER}, #{gender,jdbcType=CHAR}, #{saleTime,jdbcType=INTEGER}, 44 #{seriesId,jdbcType=INTEGER}, #{gender,jdbcType=CHAR}, #{saleTime,jdbcType=INTEGER},
@@ -45,7 +46,8 @@ @@ -45,7 +46,8 @@
45 #{updateTime,jdbcType=INTEGER}, #{shelveTime,jdbcType=INTEGER}, #{editTime,jdbcType=INTEGER}, 46 #{updateTime,jdbcType=INTEGER}, #{shelveTime,jdbcType=INTEGER}, #{editTime,jdbcType=INTEGER},
46 #{shelveStatus,jdbcType=INTEGER}, #{storage,jdbcType=INTEGER}, #{keyWords,jdbcType=VARCHAR}, 47 #{shelveStatus,jdbcType=INTEGER}, #{storage,jdbcType=INTEGER}, #{keyWords,jdbcType=VARCHAR},
47 #{delStatus,jdbcType=INTEGER}, #{ageLevel,jdbcType=VARCHAR}, 48 #{delStatus,jdbcType=INTEGER}, #{ageLevel,jdbcType=VARCHAR},
48 - #{isSynCalender,jdbcType=INTEGER}, #{offerPrice,jdbcType=DECIMAL}, #{hsCode,jdbcType=DECIMAL}, #{barCode,jdbcType=VARCHAR}, #{productNameCn,jdbcType=VARCHAR}, #{measuremenCode,jdbcType=VARCHAR}) 49 + #{isSynCalender,jdbcType=INTEGER}, #{offerPrice,jdbcType=DECIMAL}, #{hsCode,jdbcType=DECIMAL}, #{barCode,jdbcType=VARCHAR}, #{productNameCn,jdbcType=VARCHAR}, #{measuremenCode,jdbcType=VARCHAR}
  50 + , #{showChannel,jdbcType=VARCHAR})
49 </insert> 51 </insert>
50 <update id="updateAttByPrimaryKey" parameterType="com.yoho.ufo.dal.model.Product"> 52 <update id="updateAttByPrimaryKey" parameterType="com.yoho.ufo.dal.model.Product">
51 update product set 53 update product set
@@ -76,12 +78,13 @@ @@ -76,12 +78,13 @@
76 bar_code = #{barCode,jdbcType=VARCHAR}, 78 bar_code = #{barCode,jdbcType=VARCHAR},
77 hs_code = #{hsCode,jdbcType=INTEGER}, 79 hs_code = #{hsCode,jdbcType=INTEGER},
78 measuremen_code = #{measuremenCode,jdbcType=VARCHAR}, 80 measuremen_code = #{measuremenCode,jdbcType=VARCHAR},
79 - product_name_cn = #{productNameCn,jdbcType=VARCHAR} 81 + product_name_cn = #{productNameCn,jdbcType=VARCHAR},
  82 + show_channel = #{showChannel,jdbcType=VARCHAR}
80 where id = #{id,jdbcType=INTEGER} 83 where id = #{id,jdbcType=INTEGER}
81 </update> 84 </update>
82 <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> 85 <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
83 select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id, 86 select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id,
84 - gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time, 87 + gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time, show_channel,
85 shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price , hs_code,bar_code,product_name_cn,measuremen_code 88 shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price , hs_code,bar_code,product_name_cn,measuremen_code
86 from product 89 from product
87 where id = #{id,jdbcType=INTEGER} 90 where id = #{id,jdbcType=INTEGER}
@@ -89,14 +92,14 @@ @@ -89,14 +92,14 @@
89 <select id="selectAll" resultMap="BaseResultMap"> 92 <select id="selectAll" resultMap="BaseResultMap">
90 select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id, 93 select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id,
91 gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time, 94 gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time,
92 - shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price 95 + shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price ,show_channel
93 from product 96 from product
94 </select> 97 </select>
95 98
96 <select id="selectPage" resultMap="BaseResultMap"> 99 <select id="selectPage" resultMap="BaseResultMap">
97 select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id, 100 select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id,
98 gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time, 101 gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time,
99 - shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price 102 + shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price ,show_channel
100 from product where del_status=0 <include refid="pageCondition" /> order by product.id desc limit #{start},#{rows} 103 from product where del_status=0 <include refid="pageCondition" /> order by product.id desc limit #{start},#{rows}
101 </select> 104 </select>
102 <select id="selectCount" resultType="java.lang.Integer"> 105 <select id="selectCount" resultType="java.lang.Integer">
@@ -207,6 +207,14 @@ @@ -207,6 +207,14 @@
207 </li> 207 </li>
208 208
209 <li> 209 <li>
  210 + <div class="label">展示平台 <span class="red">*</span></div>
  211 + <div class="base-info-item">
  212 + <input type="checkbox" name="showChannel" id="showChannel0" value="0">有货
  213 + <input type="checkbox" name="showChannel" id="showChannel1" value="1">闲鱼
  214 + </div>
  215 + </li>
  216 +
  217 + <li>
210 <div class="label" style="align-self: flex-start;">卖家限制<span class="red">*</span></div> 218 <div class="label" style="align-self: flex-start;">卖家限制<span class="red">*</span></div>
211 <div class="base-info-item"> 219 <div class="base-info-item">
212 <label><input type="radio" name="limitSale" value="0" />全部卖家可售</label> 220 <label><input type="radio" name="limitSale" value="0" />全部卖家可售</label>
@@ -398,6 +406,12 @@ @@ -398,6 +406,12 @@
398 that.dom.imageUpload.before('<div class="img" data-url="' + item + '" style="background-image:url(' + item + ');">'); 406 that.dom.imageUpload.before('<div class="img" data-url="' + item + '" style="background-image:url(' + item + ');">');
399 }); 407 });
400 } 408 }
  409 +
  410 + if (detail.showChannel && detail.showChannel.length > 0) {
  411 + for (var channel in detail.showChannel.split(",")) {
  412 + $('#showChannel' + detail.showChannel.split(",")[channel]).attr('checked','checked');
  413 + }
  414 + }
401 }, 415 },
402 initForm: function() { 416 initForm: function() {
403 var that = this; 417 var that = this;
@@ -880,6 +894,20 @@ @@ -880,6 +894,20 @@
880 }); 894 });
881 } 895 }
882 896
  897 + var showChannel = "";
  898 + $("input[name='showChannel']:checked").each(function (index, item) {
  899 + if ($("input[name='showChannel']:checked").length - 1 == index) {
  900 + showChannel += $(this).val();
  901 + } else {
  902 + showChannel += $(this).val() + ",";
  903 + }
  904 + });
  905 +
  906 + if (showChannel.length <= 0) {
  907 + $.messager.alert('操作提示', '请选择展示平台!');
  908 + return false;
  909 + }
  910 +
883 var ajaxData = { 911 var ajaxData = {
884 brandId: +that.dom.editBrandId.textbox('getValue'), 912 brandId: +that.dom.editBrandId.textbox('getValue'),
885 colorId: +$('.group-color .actived').data('id'), 913 colorId: +$('.group-color .actived').data('id'),
@@ -904,7 +932,8 @@ @@ -904,7 +932,8 @@
904 limitSaleInfo : limitInfo, 932 limitSaleInfo : limitInfo,
905 isSynCalender: $('input[name="isSynCalender"]:checked').val(), 933 isSynCalender: $('input[name="isSynCalender"]:checked').val(),
906 offerPrice: that.dom.editOfferPrice.textbox('getValue'), 934 offerPrice: that.dom.editOfferPrice.textbox('getValue'),
907 - productIntro : ue.getContent() 935 + productIntro : ue.getContent(),
  936 + showChannel : showChannel
908 }; 937 };
909 938
910 if (!ajaxData.brandId) { 939 if (!ajaxData.brandId) {