diff --git a/src/main/java/cn/com/tenlion/dao/shop/IShopDao.java b/src/main/java/cn/com/tenlion/dao/shop/IShopDao.java index d79e6e8..c625cb6 100644 --- a/src/main/java/cn/com/tenlion/dao/shop/IShopDao.java +++ b/src/main/java/cn/com/tenlion/dao/shop/IShopDao.java @@ -134,8 +134,11 @@ public interface IShopDao { */ Integer count(Map params) throws SearchException; - - - - + /** + * 通过店铺ID查询店铺行业信息 + * @param params + * @return + * @throws SearchException + */ + List getIndustry(Map params) throws SearchException; } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java index 25d1984..59c357c 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java @@ -34,6 +34,10 @@ public class ShopDTO { private String shopLatitude; @ApiModelProperty(name = "shopVideo", value = "店铺宣传视频") private String shopVideo; + @ApiModelProperty(name = "industryName", value = "店铺行业") + private String industryName; + @ApiModelProperty(name = "industryId", value = "店铺行业ID") + private String industryId; @ApiModelProperty(name = "userEvaluate", value = "用户评价,分数,满分10分,通过用户对商品的满意度计算") private Double userEvaluate; @@ -198,4 +202,20 @@ public class ShopDTO { public void setCreatorName(String creatorName) { this.creatorName = creatorName; } + + public String getIndustryName() { + return industryName == null ? "" : industryName; + } + + public void setIndustryName(String industryName) { + this.industryName = industryName; + } + + public String getIndustryId() { + return industryId == null ? "" : industryId; + } + + public void setIndustryId(String industryId) { + this.industryId = industryId; + } } diff --git a/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java b/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java index a8a6dbb..ad20bd9 100644 --- a/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java @@ -157,7 +157,20 @@ public class ShopServiceImpl extends DefaultBaseService implements IShopService @Override public ShopDTO get(Map params) { - return shopDao.get(params); + ShopDTO shopDTO = shopDao.get(params); + // 通过店铺ID获取店铺行业信息 + List shopDTOS = shopDao.getIndustry(params); + if(null != shopDTOS && shopDTOS.size() > 0) { + StringBuffer industryName = new StringBuffer(); + StringBuffer industryId = new StringBuffer(); + for(ShopDTO dto: shopDTOS) { + industryName.append(dto.getIndustryName()).append(","); + industryId.append(dto.getIndustryId()).append(","); + } + shopDTO.setIndustryName(industryName.deleteCharAt(industryName.length() - 1).toString()); + shopDTO.setIndustryId(industryId.deleteCharAt(industryId.length() - 1).toString()); + } + return shopDTO; } @Override diff --git a/src/main/resources/mybatis/mapper/shop/shop-mapper.xml b/src/main/resources/mybatis/mapper/shop/shop-mapper.xml index 4cbece3..7737ec0 100644 --- a/src/main/resources/mybatis/mapper/shop/shop-mapper.xml +++ b/src/main/resources/mybatis/mapper/shop/shop-mapper.xml @@ -13,6 +13,8 @@ + + @@ -459,5 +461,18 @@ t1.is_delete = 0 + + + \ No newline at end of file