Authored by Lixiaodi

闲鱼是否展示类别

... ... @@ -61,4 +61,6 @@ public class SaleCategory {
private String imageUrl;
private String showInXianyu;
}
... ...
... ... @@ -14,17 +14,18 @@
<result property="linkType" column="link_type"/>
<result property="linkDetail" column="link_detail"/>
<result property="imageUrl" column="image_url"/>
<result property="showInXianyu" column="show_in_xianyu"/>
</resultMap>
<sql id="Base_Column_List">
id, category_name, status, level, parent_id, order_by,create_time,update_time,link_type,link_detail,image_url
id, category_name, status, level, parent_id, order_by,create_time,update_time,link_type,link_detail,image_url,show_in_xianyu
</sql>
<insert id="insert" parameterType="com.yoho.ufo.model.salecategory.SaleCategory">
insert into sale_category(category_name, status, level, parent_id, order_by,create_time,update_time
, link_type,link_detail,image_url)
, link_type,link_detail,image_url,show_in_xianyu)
values (#{categoryName}, #{status}, #{level}, #{parentId}, #{orderBy}, #{createTime}, #{updateTime}
, #{linkType}, #{linkDetail}, #{imageUrl})
, #{linkType}, #{linkDetail}, #{imageUrl}, #{showInXianyu})
</insert>
... ... @@ -56,6 +57,9 @@
<if test="saleCategory.imageUrl != null">
image_url = #{saleCategory.imageUrl},
</if>
<if test="saleCategory.showInXianyu != null">
show_in_xianyu = #{saleCategory.showInXianyu},
</if>
update_time = #{saleCategory.updateTime}
</set>
where id = #{saleCategory.id}
... ...
... ... @@ -73,6 +73,11 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
@Override
public void saveOrUpdateSaleCategory(SaleCategoryResponseBo saleCategoryResponseBo){
log.info("saveOrUpdateSaleCategory param = {}", saleCategoryResponseBo);
if (StringUtils.equals("on", saleCategoryResponseBo.getShowInXianyu())) {
saleCategoryResponseBo.setShowInXianyu("show");
} else {
saleCategoryResponseBo.setShowInXianyu(StringUtils.EMPTY);
}
SaleCategory saleCategory = OrikaUtils.map(saleCategoryResponseBo, SaleCategory.class);
saleCategory.setImageUrl(ImagesHelper.getImageRelativeUrl(saleCategory.getImageUrl(), ImagesConstant.BUCKET_SALE_CATEGORY_IMG));
if(StringUtils.isBlank(saleCategory.getLinkType())){
... ... @@ -139,6 +144,7 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
db_saleCategory.setLinkDetail(saleCategory.getLinkDetail());
}
db_saleCategory.setUpdateTime(DateUtil.currentTimeSeconds());
db_saleCategory.setShowInXianyu(saleCategory.getShowInXianyu());
List<SaleCategory> sameNameList = saleCategoryMapper.selectByNameAndParentId(saleCategory.getCategoryName(),saleCategory.getParentId());
if(CollectionUtils.isNotEmpty(sameNameList)){
... ...
... ... @@ -19,12 +19,12 @@
<input class="easyui-numberbox" id="orderBy" name="orderBy" data-options="validType:'length[1,10]'" />
</td>
</tr>
<!--<tr id="disLink" style="height: 60px">
<td width="20%"><label>展示全部系列</label></td>
<tr id="disLink" style="height: 60px">
<td width="20%"><label>是否在闲鱼展示</label></td>
<td>
<input type="checkbox" name="linkType" id="linkType"/>
<input type="checkbox" name="showInXianyu" id="showInXianyu"/>
</td>
</tr>-->
</tr>
</table>
</div>
</form>
... ... @@ -54,13 +54,13 @@
id: saleCategoryId
}, function (data) {
$("#categoryEditForm").form("load", data.data);
/*if(data.data.parentId==0) {
if(data.data.linkType!=null && data.data.linkType!="") {
document.getElementById('linkType').checked = true;
if(data.data.parentId==0) {
if(data.data.showInXianyu!=null && data.data.showInXianyu!="") {
document.getElementById('showInXianyu').checked = true;
}
} else {
document.getElementById("disLink").style.display = "none";
}*/
}
});
}
});
... ...