Authored by caoyan

发售日历

... ... @@ -57,6 +57,10 @@ public class Product {
private String ageLevel;
private List<Integer> productIdList;
private Integer isSynCalender;
private BigDecimal offerPrice;
public Integer getId() {
return id;
... ... @@ -265,4 +269,21 @@ public class Product {
public void setProductIdList(List<Integer> productIdList) {
this.productIdList = productIdList;
}
public Integer getIsSynCalender() {
return isSynCalender;
}
public void setIsSynCalender(Integer isSynCalender) {
this.isSynCalender = isSynCalender;
}
public BigDecimal getOfferPrice() {
return offerPrice;
}
public void setOfferPrice(BigDecimal offerPrice) {
this.offerPrice = offerPrice;
}
}
\ No newline at end of file
... ...
... ... @@ -22,6 +22,8 @@
<result column="key_words" jdbcType="VARCHAR" property="keyWords" />
<result column="del_status" jdbcType="INTEGER" property="delStatus" />
<result column="age_level" jdbcType="VARCHAR" property="ageLevel" />
<result column="is_syn_calender" jdbcType="INTEGER" property="isSynCalender" />
<result column="offer_price" jdbcType="DECIMAL" property="offerPrice" />
</resultMap>
<insert id="insert" parameterType="com.yoho.ufo.dal.model.Product" useGeneratedKeys="true" keyProperty="id" >
... ... @@ -31,14 +33,15 @@
min_price, max_price, create_time,
update_time, shelve_time, edit_time,
shelve_status, storage, key_words,
del_status, age_level)
del_status, age_level, is_syn_calender, offer_price)
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},
#{minPrice,jdbcType=DECIMAL}, #{maxPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=INTEGER},
#{updateTime,jdbcType=INTEGER}, #{shelveTime,jdbcType=INTEGER}, #{editTime,jdbcType=INTEGER},
#{shelveStatus,jdbcType=INTEGER}, #{storage,jdbcType=INTEGER}, #{keyWords,jdbcType=VARCHAR},
#{delStatus,jdbcType=INTEGER}, #{ageLevel,jdbcType=VARCHAR})
#{delStatus,jdbcType=INTEGER}, #{ageLevel,jdbcType=VARCHAR},
#{isSynCalender,jdbcType=INTEGER}, #{offerPrice,jdbcType=DECIMAL})
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.ufo.dal.model.Product">
update product
... ... @@ -55,27 +58,29 @@
update_time = unix_timestamp(),
edit_time = unix_timestamp(),
age_level = #{ageLevel,jdbcType=VARCHAR},
key_words = #{keyWords,jdbcType=VARCHAR}
key_words = #{keyWords,jdbcType=VARCHAR},
is_syn_calender = #{isSynCalender,jdbcType=INTEGER},
offer_price = #{offerPrice,jdbcType=DECIMAL}
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,
shelve_status, storage, key_words, del_status, age_level
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price
from product
where id = #{id,jdbcType=INTEGER}
</select>
<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
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price
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
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price
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">
... ... @@ -162,7 +167,7 @@
<select id="selectProductListByIds" 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
shelve_status, storage, key_words, del_status, age_level, is_syn_calender, offer_price
from product where id in
<foreach item="item" index="index" collection="productIdList" open="(" separator="," close=")">
#{item}
... ...
... ... @@ -31,7 +31,7 @@ import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.constants.QNliveConstants;
import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
import com.yohobuy.ufo.model.order.resp.*;
import com.yohobuy.ufo.model.order.resp.SkupImageInfo;
//import com.yohobuy.ufo.model.order.resp.SkupImageInfo;
import com.yohobuy.ufo.model.resp.product.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -1611,7 +1611,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setStatus(buyerOrder.getStatus());
resp.setStatusStr(Constant.convertOrderStatusStr(buyerOrder.getStatus()));
resp.setCreateTimeStr(DateUtil.int2DateStr(buyerOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
resp.setAttributes(buyerOrder.getAttributes());
// resp.setAttributes(buyerOrder.getAttributes());
//检查买家是否是线下店的用户
resp.setInnerBuyerType("0");
... ... @@ -2493,7 +2493,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setGoodsPrice(String.format("%.2f", buyerGoodsMap.get(item.getOrderCode()).getGoodsPrice().doubleValue()));
resp.setStatusStr(Constant.convertOrderStatusStr(item.getStatus()));
resp.setStatus(item.getStatus());
resp.setAttributes(item.getAttributes());
// resp.setAttributes(item.getAttributes());
respList.add(resp);
}
... ... @@ -2629,8 +2629,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
if (null != secondDetailResp.getImageInfoList()) {
secondDetailResp.getImageInfoList().stream().forEach(a -> imageInfoList.add(new SkupImageInfo(a.getImageUrl(), a.getImageDesc())));
}
resp.setImageInfoList(imageInfoList);
resp.setSecondProductDesc(secondDetailResp.getDesc());
// resp.setImageInfoList(imageInfoList);
// resp.setSecondProductDesc(secondDetailResp.getDesc());
}
}
}
... ...
... ... @@ -316,12 +316,17 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
p.setCreateTime((int) (System.currentTimeMillis() / 1000));
p.setMinPrice(new BigDecimal(bo.getMinPrice()));
p.setMaxPrice(new BigDecimal(bo.getMaxPrice()));
p.setIsSynCalender(bo.getIsSynCalender());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
p.setSaleTime((int) (sdf.parse(bo.getSaleTime()).getTime() / 1000));
} catch (ParseException e) {
}
if(StringUtils.isNotEmpty(bo.getOfferPrice())) {
p.setOfferPrice(new BigDecimal(bo.getOfferPrice()));
}
p.setGender(bo.getGender().toString());
return p;
}
... ... @@ -462,6 +467,9 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
bo.setProductIntro(productIntroService.selectProductIntroById(product.getId()));
bo.setLimitSaleInfo(CollectionUtil.distinct(productLimitSaleMapper.selectByProductId(product.getId()), limit-> limit.getUid()+" "+limit.getProfitRate()));
bo.setIsSynCalender(product.getIsSynCalender());
bo.setOfferPrice(product.getOfferPrice().toString());
return new ApiResponse<ProductEditResponceBo>(bo);
}
... ...
... ... @@ -178,6 +178,18 @@
</table>
</div>
</li>
<li>
<div class="label" style="align-self: flex-start;">同步至发售日历:</div>
<div class="base-info-item">
<label><input type="checkbox" name="isSynCalender" value="1" /></label>
</div>
</li>
<li>
<div class="label">发售价:</div>
<div class="base-info-item">
<input id="editOfferPrice" type="text" name="offerPrice"/>
</div>
</li>
</ul>
</li>
... ... @@ -255,7 +267,8 @@
editSeriesId: $('#editSeriesId'),
imageUpload: $('#imageUpload'),
keyword: $('#keyword'),
colorSizeTable: $('#colorSizeTable')
colorSizeTable: $('#colorSizeTable'),
editOfferPrice: $('#editOfferPrice')
};
},
initFormData: function(detail) {
... ... @@ -284,6 +297,11 @@
$("input[name=limitSale]:eq(1)").attr("checked",'checked');
}
if(detail.isSynCalender == 1){
$('input[name=isSynCalender]').attr('checked','checked');
}
this.dom.editOfferPrice.textbox('setValue', detail.offerPrice);
this.dom.keyword.textbox('setValue', detail.keyWords);
$('input[name=gender]').eq(detail.gender - 1).attr('checked','true');
$('.group-color li[data-id=' + detail.colorId + ']').addClass('actived');
... ... @@ -387,7 +405,10 @@
prompt : "最高价",
required: true,
missingMessage: "最高价不能为空"
});
});
this.dom.editOfferPrice.textbox({
prompt : "发售价"
});
this.dom.colorSizeTable.myDatagrid({
fit: false,
fitColumns: true,
... ... @@ -699,7 +720,9 @@
productName: that.dom.editProductName.textbox('getValue'),
saleTime: that.dom.editSaleTime.myDatebox('getValue'),
seriesId: +that.dom.editSeriesId.combobox('getValue'),
limitSaleInfo : limitInfo
limitSaleInfo : limitInfo,
isSynCalender: $('input[name="isSynCalender"]:checked').val(),
offerPrice: that.dom.editOfferPrice.textbox('getValue'),
};
if (!ajaxData.brandId) {
... ...