Authored by mali

展示渠道

package com.yoho.ufo.dal.model;
import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal;
import java.util.List;
... ... @@ -62,11 +64,15 @@ public class Product {
private BigDecimal offerPrice;
private String hsCode;
private String measuremenCode;
private String barCode;
private String productNameCn;
private String showChannel; // 展示哪些频道内 '0 代表有货 1代表闲鱼 多个用逗号分隔
public Integer getId() {
return id;
}
... ... @@ -322,4 +328,17 @@ public class Product {
public void setMeasuremenCode(String measuremenCode) {
this.measuremenCode = measuremenCode;
}
public String getShowChannel() {
return showChannel;
}
public void setShowChannel(String showChannel) {
this.showChannel = showChannel;
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
}
}
\ No newline at end of file
... ...
... ... @@ -28,6 +28,7 @@
<result column="measuremen_code" jdbcType="VARCHAR" property="measuremenCode" />
<result column="bar_code" jdbcType="VARCHAR" property="barCode" />
<result column="product_name_cn" jdbcType="VARCHAR" property="productNameCn" />
<result column="show_channel" jdbcType="VARCHAR" property="showChannel" />
</resultMap>
<insert id="insert" parameterType="com.yoho.ufo.dal.model.Product" useGeneratedKeys="true" keyProperty="id" >
... ... @@ -37,7 +38,7 @@
min_price, max_price, create_time,
update_time, shelve_time, edit_time,
shelve_status, storage, key_words,
del_status, age_level, is_syn_calender, offer_price,hs_code,bar_code,product_name_cn,measuremen_code)
del_status, age_level, is_syn_calender, offer_price,hs_code,bar_code,product_name_cn,measuremen_code, show_channel)
values (#{id,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, #{productCode,jdbcType=VARCHAR},
#{maxSortId,jdbcType=INTEGER}, #{midSortId,jdbcType=INTEGER}, #{brandId,jdbcType=INTEGER},
#{seriesId,jdbcType=INTEGER}, #{gender,jdbcType=CHAR}, #{saleTime,jdbcType=INTEGER},
... ... @@ -45,7 +46,8 @@
#{updateTime,jdbcType=INTEGER}, #{shelveTime,jdbcType=INTEGER}, #{editTime,jdbcType=INTEGER},
#{shelveStatus,jdbcType=INTEGER}, #{storage,jdbcType=INTEGER}, #{keyWords,jdbcType=VARCHAR},
#{delStatus,jdbcType=INTEGER}, #{ageLevel,jdbcType=VARCHAR},
#{isSynCalender,jdbcType=INTEGER}, #{offerPrice,jdbcType=DECIMAL}, #{hsCode,jdbcType=DECIMAL}, #{barCode,jdbcType=VARCHAR}, #{productNameCn,jdbcType=VARCHAR}, #{measuremenCode,jdbcType=VARCHAR})
#{isSynCalender,jdbcType=INTEGER}, #{offerPrice,jdbcType=DECIMAL}, #{hsCode,jdbcType=DECIMAL}, #{barCode,jdbcType=VARCHAR}, #{productNameCn,jdbcType=VARCHAR}, #{measuremenCode,jdbcType=VARCHAR}
, #{showChannel,jdbcType=VARCHAR})
</insert>
<update id="updateAttByPrimaryKey" parameterType="com.yoho.ufo.dal.model.Product">
update product set
... ... @@ -76,12 +78,13 @@
bar_code = #{barCode,jdbcType=VARCHAR},
hs_code = #{hsCode,jdbcType=INTEGER},
measuremen_code = #{measuremenCode,jdbcType=VARCHAR},
product_name_cn = #{productNameCn,jdbcType=VARCHAR}
product_name_cn = #{productNameCn,jdbcType=VARCHAR},
show_channel = #{showChannel,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id,
gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time,
gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time, show_channel,
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price , hs_code,bar_code,product_name_cn,measuremen_code
from product
where id = #{id,jdbcType=INTEGER}
... ... @@ -89,14 +92,14 @@
<select id="selectAll" resultMap="BaseResultMap">
select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id,
gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time,
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price ,show_channel
from product
</select>
<select id="selectPage" resultMap="BaseResultMap">
select id, product_name, product_code, max_sort_id, mid_sort_id, brand_id, series_id,
gender, sale_time, min_price, max_price, create_time, update_time, shelve_time, edit_time,
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price ,show_channel
from product where del_status=0 <include refid="pageCondition" /> order by product.id desc limit #{start},#{rows}
</select>
<select id="selectCount" resultType="java.lang.Integer">
... ...
... ... @@ -207,6 +207,14 @@
</li>
<li>
<div class="label">展示平台 <span class="red">*</span></div>
<div class="base-info-item">
<input type="checkbox" name="showChannel" id="showChannel0" value="0">有货
<input type="checkbox" name="showChannel" id="showChannel1" value="1">闲鱼
</div>
</li>
<li>
<div class="label" style="align-self: flex-start;">卖家限制<span class="red">*</span></div>
<div class="base-info-item">
<label><input type="radio" name="limitSale" value="0" />全部卖家可售</label>
... ... @@ -398,6 +406,12 @@
that.dom.imageUpload.before('<div class="img" data-url="' + item + '" style="background-image:url(' + item + ');">');
});
}
if (detail.showChannel && detail.showChannel.length > 0) {
for (var channel in detail.showChannel.split(",")) {
$('#showChannel' + detail.showChannel.split(",")[channel]).attr('checked','checked');
}
}
},
initForm: function() {
var that = this;
... ... @@ -880,6 +894,20 @@
});
}
var showChannel = "";
$("input[name='showChannel']:checked").each(function (index, item) {
if ($("input[name='showChannel']:checked").length - 1 == index) {
showChannel += $(this).val();
} else {
showChannel += $(this).val() + ",";
}
});
if (showChannel.length <= 0) {
$.messager.alert('操作提示', '请选择展示平台!');
return false;
}
var ajaxData = {
brandId: +that.dom.editBrandId.textbox('getValue'),
colorId: +$('.group-color .actived').data('id'),
... ... @@ -904,7 +932,8 @@
limitSaleInfo : limitInfo,
isSynCalender: $('input[name="isSynCalender"]:checked').val(),
offerPrice: that.dom.editOfferPrice.textbox('getValue'),
productIntro : ue.getContent()
productIntro : ue.getContent(),
showChannel : showChannel
};
if (!ajaxData.brandId) {
... ...