Showing
4 changed files
with
23 additions
and
11 deletions
@@ -14,17 +14,18 @@ | @@ -14,17 +14,18 @@ | ||
14 | <result property="linkType" column="link_type"/> | 14 | <result property="linkType" column="link_type"/> |
15 | <result property="linkDetail" column="link_detail"/> | 15 | <result property="linkDetail" column="link_detail"/> |
16 | <result property="imageUrl" column="image_url"/> | 16 | <result property="imageUrl" column="image_url"/> |
17 | + <result property="showInXianyu" column="show_in_xianyu"/> | ||
17 | </resultMap> | 18 | </resultMap> |
18 | 19 | ||
19 | <sql id="Base_Column_List"> | 20 | <sql id="Base_Column_List"> |
20 | - id, category_name, status, level, parent_id, order_by,create_time,update_time,link_type,link_detail,image_url | 21 | + id, category_name, status, level, parent_id, order_by,create_time,update_time,link_type,link_detail,image_url,show_in_xianyu |
21 | </sql> | 22 | </sql> |
22 | 23 | ||
23 | <insert id="insert" parameterType="com.yoho.ufo.model.salecategory.SaleCategory"> | 24 | <insert id="insert" parameterType="com.yoho.ufo.model.salecategory.SaleCategory"> |
24 | insert into sale_category(category_name, status, level, parent_id, order_by,create_time,update_time | 25 | insert into sale_category(category_name, status, level, parent_id, order_by,create_time,update_time |
25 | - , link_type,link_detail,image_url) | 26 | + , link_type,link_detail,image_url,show_in_xianyu) |
26 | values (#{categoryName}, #{status}, #{level}, #{parentId}, #{orderBy}, #{createTime}, #{updateTime} | 27 | values (#{categoryName}, #{status}, #{level}, #{parentId}, #{orderBy}, #{createTime}, #{updateTime} |
27 | - , #{linkType}, #{linkDetail}, #{imageUrl}) | 28 | + , #{linkType}, #{linkDetail}, #{imageUrl}, #{showInXianyu}) |
28 | </insert> | 29 | </insert> |
29 | 30 | ||
30 | 31 | ||
@@ -56,6 +57,9 @@ | @@ -56,6 +57,9 @@ | ||
56 | <if test="saleCategory.imageUrl != null"> | 57 | <if test="saleCategory.imageUrl != null"> |
57 | image_url = #{saleCategory.imageUrl}, | 58 | image_url = #{saleCategory.imageUrl}, |
58 | </if> | 59 | </if> |
60 | + <if test="saleCategory.showInXianyu != null"> | ||
61 | + show_in_xianyu = #{saleCategory.showInXianyu}, | ||
62 | + </if> | ||
59 | update_time = #{saleCategory.updateTime} | 63 | update_time = #{saleCategory.updateTime} |
60 | </set> | 64 | </set> |
61 | where id = #{saleCategory.id} | 65 | where id = #{saleCategory.id} |
@@ -73,6 +73,11 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService { | @@ -73,6 +73,11 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService { | ||
73 | @Override | 73 | @Override |
74 | public void saveOrUpdateSaleCategory(SaleCategoryResponseBo saleCategoryResponseBo){ | 74 | public void saveOrUpdateSaleCategory(SaleCategoryResponseBo saleCategoryResponseBo){ |
75 | log.info("saveOrUpdateSaleCategory param = {}", saleCategoryResponseBo); | 75 | log.info("saveOrUpdateSaleCategory param = {}", saleCategoryResponseBo); |
76 | + if (StringUtils.equals("on", saleCategoryResponseBo.getShowInXianyu())) { | ||
77 | + saleCategoryResponseBo.setShowInXianyu("show"); | ||
78 | + } else { | ||
79 | + saleCategoryResponseBo.setShowInXianyu(StringUtils.EMPTY); | ||
80 | + } | ||
76 | SaleCategory saleCategory = OrikaUtils.map(saleCategoryResponseBo, SaleCategory.class); | 81 | SaleCategory saleCategory = OrikaUtils.map(saleCategoryResponseBo, SaleCategory.class); |
77 | saleCategory.setImageUrl(ImagesHelper.getImageRelativeUrl(saleCategory.getImageUrl(), ImagesConstant.BUCKET_SALE_CATEGORY_IMG)); | 82 | saleCategory.setImageUrl(ImagesHelper.getImageRelativeUrl(saleCategory.getImageUrl(), ImagesConstant.BUCKET_SALE_CATEGORY_IMG)); |
78 | if(StringUtils.isBlank(saleCategory.getLinkType())){ | 83 | if(StringUtils.isBlank(saleCategory.getLinkType())){ |
@@ -139,6 +144,7 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService { | @@ -139,6 +144,7 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService { | ||
139 | db_saleCategory.setLinkDetail(saleCategory.getLinkDetail()); | 144 | db_saleCategory.setLinkDetail(saleCategory.getLinkDetail()); |
140 | } | 145 | } |
141 | db_saleCategory.setUpdateTime(DateUtil.currentTimeSeconds()); | 146 | db_saleCategory.setUpdateTime(DateUtil.currentTimeSeconds()); |
147 | + db_saleCategory.setShowInXianyu(saleCategory.getShowInXianyu()); | ||
142 | 148 | ||
143 | List<SaleCategory> sameNameList = saleCategoryMapper.selectByNameAndParentId(saleCategory.getCategoryName(),saleCategory.getParentId()); | 149 | List<SaleCategory> sameNameList = saleCategoryMapper.selectByNameAndParentId(saleCategory.getCategoryName(),saleCategory.getParentId()); |
144 | if(CollectionUtils.isNotEmpty(sameNameList)){ | 150 | if(CollectionUtils.isNotEmpty(sameNameList)){ |
@@ -19,12 +19,12 @@ | @@ -19,12 +19,12 @@ | ||
19 | <input class="easyui-numberbox" id="orderBy" name="orderBy" data-options="validType:'length[1,10]'" /> | 19 | <input class="easyui-numberbox" id="orderBy" name="orderBy" data-options="validType:'length[1,10]'" /> |
20 | </td> | 20 | </td> |
21 | </tr> | 21 | </tr> |
22 | - <!--<tr id="disLink" style="height: 60px"> | ||
23 | - <td width="20%"><label>展示全部系列</label></td> | 22 | + <tr id="disLink" style="height: 60px"> |
23 | + <td width="20%"><label>是否在闲鱼展示</label></td> | ||
24 | <td> | 24 | <td> |
25 | - <input type="checkbox" name="linkType" id="linkType"/> | 25 | + <input type="checkbox" name="showInXianyu" id="showInXianyu"/> |
26 | </td> | 26 | </td> |
27 | - </tr>--> | 27 | + </tr> |
28 | </table> | 28 | </table> |
29 | </div> | 29 | </div> |
30 | </form> | 30 | </form> |
@@ -54,13 +54,13 @@ | @@ -54,13 +54,13 @@ | ||
54 | id: saleCategoryId | 54 | id: saleCategoryId |
55 | }, function (data) { | 55 | }, function (data) { |
56 | $("#categoryEditForm").form("load", data.data); | 56 | $("#categoryEditForm").form("load", data.data); |
57 | - /*if(data.data.parentId==0) { | ||
58 | - if(data.data.linkType!=null && data.data.linkType!="") { | ||
59 | - document.getElementById('linkType').checked = true; | 57 | + if(data.data.parentId==0) { |
58 | + if(data.data.showInXianyu!=null && data.data.showInXianyu!="") { | ||
59 | + document.getElementById('showInXianyu').checked = true; | ||
60 | } | 60 | } |
61 | } else { | 61 | } else { |
62 | document.getElementById("disLink").style.display = "none"; | 62 | document.getElementById("disLink").style.display = "none"; |
63 | - }*/ | 63 | + } |
64 | }); | 64 | }); |
65 | } | 65 | } |
66 | }); | 66 | }); |
-
Please register or login to post a comment