Aslee пре 2 година
родитељ
комит
e9237f9587
36 измењених фајлова са 275 додато и 106 уклоњено
  1. 2 2
      src/main/java/com/caimei/controller/admin/auth/AuthApi.java
  2. 3 3
      src/main/java/com/caimei/controller/admin/auth/AuthClubApi.java
  3. 9 9
      src/main/java/com/caimei/controller/admin/auth/AuthProductApi.java
  4. 2 2
      src/main/java/com/caimei/controller/admin/auth/DoctorApi.java
  5. 4 4
      src/main/java/com/caimei/controller/admin/auth/ShopApi.java
  6. 16 5
      src/main/java/com/caimei/controller/admin/data/ArticleApi.java
  7. 2 2
      src/main/java/com/caimei/controller/admin/data/FileApi.java
  8. 2 2
      src/main/java/com/caimei/controller/admin/data/ImageApi.java
  9. 2 2
      src/main/java/com/caimei/controller/admin/data/VideoApi.java
  10. 19 0
      src/main/java/com/caimei/controller/wechat/RegisterApi.java
  11. 15 5
      src/main/java/com/caimei/controller/wechat/WxAuthApi.java
  12. 2 0
      src/main/java/com/caimei/mapper/cmMapper/ArticleMapper.java
  13. 4 2
      src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java
  14. 4 2
      src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java
  15. 1 1
      src/main/java/com/caimei/mapper/cmMapper/ShopMapper.java
  16. 5 0
      src/main/java/com/caimei/model/po/ArticlePo.java
  17. 3 0
      src/main/java/com/caimei/model/vo/ArticleFormVo.java
  18. 3 0
      src/main/java/com/caimei/model/vo/ArticleListVo.java
  19. 5 0
      src/main/java/com/caimei/model/vo/AuthProductVo.java
  20. 1 1
      src/main/java/com/caimei/model/vo/ClubVo.java
  21. 1 1
      src/main/java/com/caimei/model/vo/FeedbackVo.java
  22. 3 0
      src/main/java/com/caimei/model/vo/WxClubDetailsVo.java
  23. 1 1
      src/main/java/com/caimei/model/vo/WxClubListVo.java
  24. 6 6
      src/main/java/com/caimei/model/vo/WxProductListVo.java
  25. 7 1
      src/main/java/com/caimei/service/auth/ArticleService.java
  26. 13 4
      src/main/java/com/caimei/service/auth/AuthClubService.java
  27. 1 1
      src/main/java/com/caimei/service/auth/AuthProductService.java
  28. 2 2
      src/main/java/com/caimei/service/auth/ShopService.java
  29. 11 1
      src/main/java/com/caimei/service/auth/impl/ArticleServiceImpl.java
  30. 10 4
      src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java
  31. 32 3
      src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java
  32. 2 2
      src/main/java/com/caimei/service/auth/impl/ShopServiceImpl.java
  33. 13 7
      src/main/resources/mapper/ArticleMapper.xml
  34. 39 21
      src/main/resources/mapper/AuthProductMapper.xml
  35. 26 6
      src/main/resources/mapper/ClubMapper.xml
  36. 4 4
      src/main/resources/mapper/ShopMapper.xml

+ 2 - 2
src/main/java/com/caimei/controller/admin/auth/AuthApi.java

@@ -281,8 +281,8 @@ public class AuthApi {
 
     @ApiOperation("更改查看标记")
     @ApiImplicitParam(name = "authId", required = true, value = "授权机构id")
-    @PostMapping("/check")
-    public ResponseJson checkAuth(Integer authId) {
+    @PostMapping("/check/{id}")
+    public ResponseJson checkAuth(@PathVariable("id") Integer authId) {
         return authService.checkAuth(authId);
     }
 

+ 3 - 3
src/main/java/com/caimei/controller/admin/auth/AuthClubApi.java

@@ -37,12 +37,12 @@ public class AuthClubApi {
 
     @ApiOperation("机构列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "clubName", required = false, value = "机构名称"),
+            @ApiImplicitParam(name = "authParty", required = false, value = "机构名称"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/list")
-    public ResponseJson<PageInfo<ClubVo>> getClubList(@CurrentUser SysUser sysUser, String clubName,
+    public ResponseJson<PageInfo<ClubVo>> getClubList(@CurrentUser SysUser sysUser, String authParty,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
         if (null == sysUser) {
@@ -54,7 +54,7 @@ public class AuthClubApi {
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
         }
-        return authClubService.getClubList(authUserId, clubName, pageNum, pageSize);
+        return authClubService.getClubList(authUserId, authParty, pageNum, pageSize);
     }
 
 

+ 9 - 9
src/main/java/com/caimei/controller/admin/auth/AuthProductApi.java

@@ -9,7 +9,6 @@ import com.caimei.model.dto.ProductSaveDto;
 import com.caimei.model.po.ProductParamPo;
 import com.caimei.model.po.ProductTypePo;
 import com.caimei.model.po.SysUser;
-import com.caimei.model.vo.AuthProductVo;
 import com.caimei.model.vo.ProductFormVo;
 import com.caimei.model.vo.ProductListVo;
 import com.caimei.model.vo.ProductTypeListVo;
@@ -66,7 +65,7 @@ public class AuthProductApi {
     }
 
 
-    @ApiOperation("供应商下设备sn码列表")
+    @ApiOperation("供应商下审核通过设备sn码列表")
     @GetMapping("/sn/list")
     public ResponseJson<List<String>> getSnCodeList(@CurrentUser SysUser sysUser) {
         if (null == sysUser) {
@@ -137,17 +136,18 @@ public class AuthProductApi {
         return authProductService.getProductFormData(relationId);
     }
 
-    @ApiOperation("设备详情")
+
+    @ApiOperation("关联设备获取设备信息")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "productId", required = false, value = "设备id"),
-            @ApiImplicitParam(name = "snCode", required = true, value = "sn码")
+            @ApiImplicitParam(name = "snCode", required = false, value = "sn码")
     })
-    @GetMapping("/details")
-    public ResponseJson<ProductFormVo> getProductDetails(Integer productId, String snCode) {
+    @GetMapping("/info")
+    public ResponseJson<ProductFormVo> getProductInfo(Integer productId, String snCode) {
         if (null == productId && null == snCode) {
             return ResponseJson.error("设备id和sn码不能同时为空", null);
         }
-        return authProductService.getProductDetails(productId, snCode);
+        return authProductService.getProductInfo(productId, snCode);
     }
 
     /**
@@ -314,8 +314,8 @@ public class AuthProductApi {
 
     @ApiOperation("更改查看标记")
     @ApiImplicitParam(name = "productId", required = true, value = "productId")
-    @PostMapping("/check")
-    public ResponseJson checkAuthProduct(Integer productId) {
+    @PostMapping("/check/{id}")
+    public ResponseJson checkAuthProduct(@PathVariable("id") Integer productId) {
         return authProductService.checkAuthProduct(productId);
     }
 }

+ 2 - 2
src/main/java/com/caimei/controller/admin/auth/DoctorApi.java

@@ -165,8 +165,8 @@ public class DoctorApi {
 
     @ApiOperation("更改查看标记")
     @ApiImplicitParam(name = "doctorId", required = true, value = "doctorId")
-    @PostMapping("/check")
-    public ResponseJson checkDoctor(Integer doctorId) {
+    @PostMapping("/check/{id}")
+    public ResponseJson checkDoctor(@PathVariable("id") Integer doctorId) {
         return doctorService.checkDoctor(doctorId);
     }
 }

+ 4 - 4
src/main/java/com/caimei/controller/admin/auth/ShopApi.java

@@ -203,7 +203,7 @@ public class ShopApi {
         List<ShopInfoDto> shopInfoList = new ArrayList<>();
         List<String> brandNameList = new ArrayList<>();
         for (Map<String, Object> infoMap : shopInfoData) {
-            Integer infoId = (Integer) infoMap.get("info");
+            Integer infoId = (Integer) infoMap.get("infoId");
             String brandName = (String) infoMap.get("brandName");
             String brandLogo = (String) infoMap.get("brandLogo");
             String producePlace = (String) infoMap.get("producePlace");
@@ -279,14 +279,14 @@ public class ShopApi {
 
     @ApiOperation("用户反馈列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "clubName", required = false, value = "机构名称"),
+            @ApiImplicitParam(name = "authParty", required = false, value = "机构名称"),
             @ApiImplicitParam(name = "mobile", required = false, value = "手机号"),
             @ApiImplicitParam(name = "handleStatus", required = false, value = "处理状态:0未处理,1已处理"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/feedback/list")
-    public ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(@CurrentUser SysUser sysUser, String clubName, String mobile, Integer handleStatus,
+    public ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(@CurrentUser SysUser sysUser, String authParty, String mobile, Integer handleStatus,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
         if (null == sysUser) {
@@ -298,7 +298,7 @@ public class ShopApi {
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
         }
-        return shopService.getFeedbackList(authUserId, clubName, mobile, handleStatus, pageNum, pageSize);
+        return shopService.getFeedbackList(authUserId, authParty, mobile, handleStatus, pageNum, pageSize);
     }
 
     @ApiOperation("用户反馈表单数据")

+ 16 - 5
src/main/java/com/caimei/controller/admin/data/ArticleApi.java

@@ -74,7 +74,8 @@ public class ArticleApi {
         String articleTitle = paramsMap.getString("articleTitle");
         String articleImage = paramsMap.getString("articleImage");
         String articleContent = paramsMap.getString("articleContent");
-        return articleService.saveArticle(articleId, authUserId, articleTitle, articleImage, articleContent);
+        Integer sort = paramsMap.getInteger("sort");
+        return articleService.saveArticle(articleId, authUserId, articleTitle, articleImage, articleContent, sort);
     }
 
     @ApiOperation("文章回显数据")
@@ -87,7 +88,7 @@ public class ArticleApi {
     @ApiOperation("更新文章状态")
     @ApiImplicitParam(name = "params", value = "articleId:文章id;status:文章状态:0停用 1启用;", required = true)
     @PostMapping("/update/status")
-    public ResponseJson updateArticleStatus(@RequestBody Map<String,Integer> params) {
+    public ResponseJson updateArticleStatus(@RequestBody Map<String, Integer> params) {
         Integer articleId = params.get("articleId");
         Integer status = params.get("status");
         return articleService.updateArticleStatus(articleId, status);
@@ -96,7 +97,7 @@ public class ArticleApi {
     @ApiOperation("删除文章")
     @ApiImplicitParam(name = "params", value = "articleId:文章id", required = true)
     @PostMapping("/delete")
-    public ResponseJson deleteArticle(@RequestBody Map<String,Integer> params) {
+    public ResponseJson deleteArticle(@RequestBody Map<String, Integer> params) {
         Integer articleId = params.get("articleId");
         return articleService.deleteArticle(articleId);
     }
@@ -115,8 +116,18 @@ public class ArticleApi {
 
     @ApiOperation("更改查看标记")
     @ApiImplicitParam(name = "articleId", required = true, value = "文章id")
-    @PostMapping("/check")
-    public ResponseJson checkArticle(Integer articleId) {
+    @PostMapping("/check/{id}")
+    public ResponseJson checkArticle(@PathVariable("id") Integer articleId) {
         return articleService.checkArticle(articleId);
     }
+
+    @ApiOperation("更改排序值")
+    @ApiImplicitParam(name = "params", required = true, value = "articleId:文章id;sort:排序值")
+    @PostMapping("/sort/update")
+    public ResponseJson updateSort(@RequestBody String params ) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer articleId = paramsMap.getInteger("articleId");
+        Integer sort = paramsMap.getInteger("sort");
+        return articleService.updateSort(articleId, sort);
+    }
 }

+ 2 - 2
src/main/java/com/caimei/controller/admin/data/FileApi.java

@@ -158,8 +158,8 @@ public class FileApi {
 
     @ApiOperation("更改查看标记")
     @ApiImplicitParam(name = "fileId", required = true, value = "文件id")
-    @PostMapping("/check")
-    public ResponseJson checkFile(Integer fileId) {
+    @PostMapping("/check/{id}")
+    public ResponseJson checkFile(@PathVariable("id") Integer fileId) {
         return fileService.checkFile(fileId);
     }
 }

+ 2 - 2
src/main/java/com/caimei/controller/admin/data/ImageApi.java

@@ -115,8 +115,8 @@ public class ImageApi {
 
     @ApiOperation("更改查看标记")
     @ApiImplicitParam(name = "imageId", required = true, value = "图片id")
-    @PostMapping("/check")
-    public ResponseJson checkImage(Integer imageId) {
+    @PostMapping("/check/{id}")
+    public ResponseJson checkImage(@PathVariable("id") Integer imageId) {
         return imageService.checkImage(imageId);
     }
 }

+ 2 - 2
src/main/java/com/caimei/controller/admin/data/VideoApi.java

@@ -109,8 +109,8 @@ public class VideoApi {
 
     @ApiOperation("更改查看标记")
     @ApiImplicitParam(name = "videoId", required = true, value = "视频id")
-    @PostMapping("/check")
-    public ResponseJson checkVideo(Integer videoId) {
+    @PostMapping("/check/{id}")
+    public ResponseJson checkVideo(@PathVariable("id") Integer videoId) {
         return videoService.checkVideo(videoId);
     }
 }

+ 19 - 0
src/main/java/com/caimei/controller/wechat/RegisterApi.java

@@ -2,10 +2,13 @@ package com.caimei.controller.wechat;
 
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.ProductFormVo;
 import com.caimei.model.vo.WxClubUserVo;
+import com.caimei.service.auth.AuthProductService;
 import com.caimei.service.wechat.RegisterService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
@@ -27,6 +30,8 @@ public class RegisterApi {
 
     private final RegisterService registerService;
 
+    private final AuthProductService authProductService;
+
     @ApiOperation("普通注册")
     @ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;password:密码;authUserId:供应商用户id;", required = true)
     @PostMapping("/simple")
@@ -85,4 +90,18 @@ public class RegisterApi {
         }
         return registerService.allRegister(authUserId, clubUserId, authId, registerType, clubUserInfo, authInfo, productInfo);
     }
+
+
+    @ApiOperation("关联设备获取设备信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productId", required = false, value = "设备id"),
+            @ApiImplicitParam(name = "snCode", required = false, value = "sn码")
+    })
+    @GetMapping("/product/info")
+    public ResponseJson<ProductFormVo> getProductDetails(Integer productId, String snCode) {
+        if (null == productId && null == snCode) {
+            return ResponseJson.error("设备id和sn码不能同时为空", null);
+        }
+        return authProductService.getProductInfo(productId, snCode);
+    }
 }

+ 15 - 5
src/main/java/com/caimei/controller/wechat/WxAuthApi.java

@@ -57,7 +57,7 @@ public class WxAuthApi {
             @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
             @ApiImplicitParam(name = "appId", required = false, value = "供应商公众号appId"),
             @ApiImplicitParam(name = "lngAndLat", required = false, value = "用户当前经纬度"),
-            @ApiImplicitParam(name = "clubName", required = false, value = "机构名称"),
+            @ApiImplicitParam(name = "authParty", required = false, value = "机构名称"),
             @ApiImplicitParam(name = "provinceId", required = false, value = "省id"),
             @ApiImplicitParam(name = "cityId", required = false, value = "市id"),
             @ApiImplicitParam(name = "townId", required = false, value = "区id"),
@@ -65,14 +65,24 @@ public class WxAuthApi {
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/club/list")
-    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String clubName, Integer provinceId,
+    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String authParty, Integer provinceId,
                                                               Integer cityId, Integer townId,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
         if (null == authUserId && StringUtils.isEmpty(appId)) {
             return ResponseJson.error("参数异常,供应商用户id和appId不能同时为空", null);
         }
-        return authClubService.getWxClubList(authUserId, appId, lngAndLat, clubName, provinceId, cityId, townId, pageNum, pageSize);
+        return authClubService.getWxClubList(authUserId, appId, lngAndLat, authParty, provinceId, cityId, townId, pageNum, pageSize);
+    }
+
+    @ApiOperation("明星机构列表")
+    @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id")
+    @GetMapping("/club/list")
+    public ResponseJson<List<WxClubListVo>> getStarClubList(Integer authUserId) {
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,供应商用户id不能为空", null);
+        }
+        return authClubService.getWxStarClubList(authUserId);
     }
 
     @ApiOperation("已认证机构详情")
@@ -102,11 +112,11 @@ public class WxAuthApi {
 
     @ApiOperation("认证商品列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1供应商设备分类上线设备列表 2设备认证列表"),
+            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1供应商设备分类上线设备列表 2设备认证列表"),
             @ApiImplicitParam(name = "authId", required = false, value = "机构id"),
             @ApiImplicitParam(name = "authParty", required = false, value = "机构名称"),
             @ApiImplicitParam(name = "productTypeId", required = false, value = "设备分类id"),
-            @ApiImplicitParam(name = "snCode", required = false, value = "sn码后四位"),
+            @ApiImplicitParam(name = "snCode", required = false, value = "sn码"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })

+ 2 - 0
src/main/java/com/caimei/mapper/cmMapper/ArticleMapper.java

@@ -36,4 +36,6 @@ public interface ArticleMapper {
     List<WxArticleListVo> getWxArticleList(@Param("authUserId") Integer authUserId, @Param("articleTitle") String articleTitle);
 
     void checkArticle(Integer articleId);
+
+    void updateSort(Integer articleId, Integer sort);
 }

+ 4 - 2
src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java

@@ -93,13 +93,15 @@ public interface AuthProductMapper {
 
     Integer insertProductRelation(@Param("authId") Integer authId, @Param("productId") Integer productId, @Param("authType") Integer authType);
 
-    ProductRelationVo getProductRelation(Integer relationId);
+    ProductRelationVo getProductRelation(@Param("relationId") Integer relationId, @Param("productId") Integer productId, @Param("authId") Integer authId);
 
     void updateProductRelation(@Param("relationId") Integer relationId, @Param("authId") Integer authId, @Param("productId") Integer productId, @Param("authType") Integer authType);
 
     Integer getProductRelationCount(Integer productId);
 
-    ProductFormVo getProductDetails(@Param("productId") Integer productId, @Param("snCode") String snCode);
+    ProductFormVo getProductInfo(@Param("productId") Integer productId, @Param("snCode") String snCode);
 
     List<String> getSnCodeList(Integer authUserId);
+
+    List<WxClubListVo> getProductClubList(Integer productId);
 }

+ 4 - 2
src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java

@@ -15,13 +15,13 @@ import java.util.List;
  */
 @Mapper
 public interface ClubMapper {
-    List<ClubVo> getClubList(@Param("authUserId") Integer authUserId, @Param("clubName") String clubName);
+    List<ClubVo> getClubList(@Param("authUserId") Integer authUserId, @Param("authParty") String authParty);
 
     List<ClubUserVo> getClubUserList(@Param("authUserId") Integer authUserId, @Param("mobile") String mobile, String name, @Param("status") Integer status);
 
     void insertClubUser(ClubUserPo clubUser);
 
-    List<WxClubListVo> getWxClubList(@Param("authUserId") Integer authUserId, @Param("clubName") String clubName, @Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId, @Param("townId") Integer townId, @Param("lng") Double lng, @Param("lat") Double lat);
+    List<WxClubListVo> getWxClubList(@Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId, @Param("townId") Integer townId, @Param("lng") Double lng, @Param("lat") Double lat);
 
     Integer checkMobile(@Param("mobile") String mobile, @Param("appId") String appId);
 
@@ -46,4 +46,6 @@ public interface ClubMapper {
     void unbindAuthId(Integer clubUserId);
 
     String getDbPassword(Integer clubUserId);
+
+    List<WxClubListVo> getWxStarClubList(Integer authUserId);
 }

+ 1 - 1
src/main/java/com/caimei/mapper/cmMapper/ShopMapper.java

@@ -55,7 +55,7 @@ public interface ShopMapper {
 
     Integer getProductCount(@Param("authUserId") Integer authUserId, @Param("infoId") Integer infoId);
 
-    List<FeedbackVo> getFeedbackList(@Param("authUserId") Integer authUserId, @Param("clubName") String clubName, @Param("mobile") String mobile, @Param("handleStatus") Integer handleStatus);
+    List<FeedbackVo> getFeedbackList(@Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("handleStatus") Integer handleStatus);
 
     FeedbackVo getFeedback(Integer feedbackId);
 

+ 5 - 0
src/main/java/com/caimei/model/po/ArticlePo.java

@@ -69,4 +69,9 @@ public class ArticlePo {
      * 是否查看过:1是,0否
      */
     private Integer checkFlag;
+
+    /**
+     * 排序值
+     */
+    private Integer sort;
 }

+ 3 - 0
src/main/java/com/caimei/model/vo/ArticleFormVo.java

@@ -29,4 +29,7 @@ public class ArticleFormVo {
 
     @ApiModelProperty("审核状态:0审核未通过,1审核通过,2待审核")
     private Integer auditStatus;
+
+    @ApiModelProperty("排序值")
+    private Integer sort;
 }

+ 3 - 0
src/main/java/com/caimei/model/vo/ArticleListVo.java

@@ -39,4 +39,7 @@ public class ArticleListVo {
 
     @ApiModelProperty("审核时间")
     private Date auditTime;
+
+    @ApiModelProperty("排序值")
+    private Integer sort;
 }

+ 5 - 0
src/main/java/com/caimei/model/vo/AuthProductVo.java

@@ -98,4 +98,9 @@ public class AuthProductVo {
      * 小程序授权牌照图片(含水印)
      */
     private String appletsCertificateImage;
+
+    /**
+     * 设备关联的机构列表
+     */
+    private List<WxClubListVo> clubList;
 }

+ 1 - 1
src/main/java/com/caimei/model/vo/ClubVo.java

@@ -19,7 +19,7 @@ public class ClubVo {
      * 机构名称
      */
     @ApiModelProperty("机构名称")
-    private String clubName;
+    private String authParty;
 
     /**
      * 创建时间

+ 1 - 1
src/main/java/com/caimei/model/vo/FeedbackVo.java

@@ -16,7 +16,7 @@ public class FeedbackVo {
     private Integer feedbackId;
 
     @ApiModelProperty("机构名称")
-    private String clubName;
+    private String authParty;
 
     @ApiModelProperty("手机号")
     private String mobile;

+ 3 - 0
src/main/java/com/caimei/model/vo/WxClubDetailsVo.java

@@ -35,6 +35,9 @@ public class WxClubDetailsVo implements Serializable {
     @ApiModelProperty("机构logo")
     private String logo;
 
+    @ApiModelProperty("机构授权牌")
+    private String authImage;
+
     @ApiModelProperty("轮播图")
     private List<String> bannerList;
 

+ 1 - 1
src/main/java/com/caimei/model/vo/WxClubListVo.java

@@ -17,7 +17,7 @@ public class WxClubListVo {
     private Integer authId;
 
     @ApiModelProperty("机构名称")
-    private String clubName;
+    private String authParty;
 
     @ApiModelProperty("省市区")
     private String area;

+ 6 - 6
src/main/java/com/caimei/model/vo/WxProductListVo.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 微信公众号商品列表
@@ -15,9 +16,6 @@ public class WxProductListVo {
     @ApiModelProperty("商品id")
     private Integer productId;
 
-    @ApiModelProperty("授权机构id")
-    private Integer authId;
-
     @ApiModelProperty("商品名称")
     private String productName;
 
@@ -27,9 +25,11 @@ public class WxProductListVo {
     @ApiModelProperty("商品图片")
     private String productImage;
 
-    @ApiModelProperty("机构名称")
-    private String clubName;
-
     @ApiModelProperty("审核状态:0未通过,1已通过,2待审核")
     private String auditStatus;
+
+    /**
+     * 设备关联的机构列表
+     */
+    private List<WxClubListVo> clubList;
 }

+ 7 - 1
src/main/java/com/caimei/service/auth/ArticleService.java

@@ -35,9 +35,10 @@ public interface ArticleService {
      * @param articleTitle      文章标题
      * @param articleImage      文章图片
      * @param articleContent    文章内容
+     * @param sort
      * @return  ResponseJson
      */
-    ResponseJson saveArticle(Integer articleId, Integer authUserId, String articleTitle, String articleImage, String articleContent);
+    ResponseJson saveArticle(Integer articleId, Integer authUserId, String articleTitle, String articleImage, String articleContent, Integer sort);
 
     /**
      * 更新文章状态
@@ -87,4 +88,9 @@ public interface ArticleService {
      * @return
      */
     ResponseJson checkArticle(Integer articleId);
+
+    /**
+     * 更改排序值
+     */
+    ResponseJson updateSort(Integer articleId, Integer sort);
 }

+ 13 - 4
src/main/java/com/caimei/service/auth/AuthClubService.java

@@ -4,6 +4,8 @@ import com.caimei.model.ResponseJson;
 import com.caimei.model.vo.*;
 import com.github.pagehelper.PageInfo;
 
+import java.util.List;
+
 /**
  * Description
  *
@@ -16,12 +18,12 @@ public interface AuthClubService {
      * 机构列表
      *
      * @param authUserId    供应商用户id
-     * @param clubName      机构名称
+     * @param authParty      机构名称
      * @param pageNum       第几页
      * @param pageSize      一页多少条
      * @return AuthVo
      */
-    ResponseJson<PageInfo<ClubVo>> getClubList(Integer authUserId, String clubName, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<ClubVo>> getClubList(Integer authUserId, String authParty, Integer pageNum, Integer pageSize);
 
     /**
      * 机构用户列表
@@ -39,12 +41,12 @@ public interface AuthClubService {
      * 微信公众号机构列表
      *
      * @param authUserId 供应商用户id
-     * @param clubName   机构名称
+     * @param authParty   机构名称
      * @param pageNum    第几页
      * @param pageSize   一页多少条
      * @return
      */
-    ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String clubName, Integer provinceId,
+    ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String authParty, Integer provinceId,
                                                        Integer cityId, Integer townId, Integer pageNum, Integer pageSize);
 
     /**
@@ -91,4 +93,11 @@ public interface AuthClubService {
      * @return
      */
     ResponseJson resetClubUserPassword(Integer clubUserId);
+
+    /**
+     *
+     * @param authUserId
+     * @return
+     */
+    ResponseJson<List<WxClubListVo>> getWxStarClubList(Integer authUserId);
 }

+ 1 - 1
src/main/java/com/caimei/service/auth/AuthProductService.java

@@ -175,7 +175,7 @@ public interface AuthProductService {
      * @param snCode
      * @return
      */
-    ResponseJson<ProductFormVo> getProductDetails(Integer productId, String snCode);
+    ResponseJson<ProductFormVo> getProductInfo(Integer productId, String snCode);
 
     /**
      * sn码列表

+ 2 - 2
src/main/java/com/caimei/service/auth/ShopService.java

@@ -85,14 +85,14 @@ public interface ShopService {
     /**
      * 用户反馈列表
      * @param authUserId    供应商用户id
-     * @param clubName
+     * @param authParty
      * @param mobile
      * @param handleStatus
      * @param pageNum
      * @param pageSize
      * @return
      */
-    ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(Integer authUserId, String clubName, String mobile, Integer handleStatus, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(Integer authUserId, String authParty, String mobile, Integer handleStatus, Integer pageNum, Integer pageSize);
 
     /**
      * 用户反馈表单数据

+ 11 - 1
src/main/java/com/caimei/service/auth/impl/ArticleServiceImpl.java

@@ -44,7 +44,7 @@ public class ArticleServiceImpl implements ArticleService {
     }
 
     @Override
-    public ResponseJson saveArticle(Integer articleId, Integer authUserId, String articleTitle, String articleImage, String articleContent) {
+    public ResponseJson saveArticle(Integer articleId, Integer authUserId, String articleTitle, String articleImage, String articleContent, Integer sort) {
         if (null == articleId && null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id");
         }
@@ -57,6 +57,9 @@ public class ArticleServiceImpl implements ArticleService {
         if (StringUtils.isEmpty(articleContent)) {
             return ResponseJson.error("参数异常,请输入文章内容");
         }
+        if (null == sort) {
+            return ResponseJson.error("排序值不能为空");
+        }
         boolean insertFlag = null == articleId;
         ArticleFormVo dbArticle = null;
         if (!insertFlag) {
@@ -69,6 +72,7 @@ public class ArticleServiceImpl implements ArticleService {
         article.setTitle(articleTitle);
         article.setImage(articleImage);
         article.setContent(articleContent);
+        article.setSort(sort);
         // 供应商保存,直接上线;机构保存,需要供应商审核通过后才上线
         if (null != dbArticle && 1 != dbArticle.getAuditStatus()) {
             // 被驳回的数据,编辑后变为待审核状态
@@ -177,4 +181,10 @@ public class ArticleServiceImpl implements ArticleService {
         articleMapper.checkArticle(articleId);
         return ResponseJson.success();
     }
+
+    @Override
+    public ResponseJson updateSort(Integer articleId, Integer sort) {
+        articleMapper.updateSort(articleId, sort);
+        return null;
+    }
 }

+ 10 - 4
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -42,12 +42,12 @@ public class AuthClubServiceImpl implements AuthClubService {
     private DoctorMapper doctorMapper;
 
     @Override
-    public ResponseJson<PageInfo<ClubVo>> getClubList(Integer authUserId, String clubName, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<ClubVo>> getClubList(Integer authUserId, String authParty, Integer pageNum, Integer pageSize) {
         if (null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id", null);
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<ClubVo> clubList = clubMapper.getClubList(authUserId, clubName);
+        List<ClubVo> clubList = clubMapper.getClubList(authUserId, authParty);
         PageInfo<ClubVo> pageData = new PageInfo<>(clubList);
         return ResponseJson.success(pageData);
     }
@@ -61,7 +61,7 @@ public class AuthClubServiceImpl implements AuthClubService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String clubName, Integer provinceId,
+    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String authParty, Integer provinceId,
                                                               Integer cityId, Integer townId, Integer pageNum, Integer pageSize) {
         if (null == authUserId && StringUtils.isNotEmpty(appId)) {
             authUserId = shopMapper.getUserIdByAppId(appId);
@@ -75,7 +75,7 @@ public class AuthClubServiceImpl implements AuthClubService {
             lat = Double.parseDouble(split[1]);
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<WxClubListVo> clubList = clubMapper.getWxClubList(authUserId, clubName, provinceId, cityId, townId, lng, lat);
+        List<WxClubListVo> clubList = clubMapper.getWxClubList(authUserId, authParty, provinceId, cityId, townId, lng, lat);
         PageInfo<WxClubListVo> pageData = new PageInfo<>(clubList);
         return ResponseJson.success(pageData);
     }
@@ -212,4 +212,10 @@ public class AuthClubServiceImpl implements AuthClubService {
         }
         return ResponseJson.success("密码重置成功");
     }
+
+    @Override
+    public ResponseJson<List<WxClubListVo>> getWxStarClubList(Integer authUserId) {
+        List<WxClubListVo> starClubList = clubMapper.getWxStarClubList(authUserId);
+        return null;
+    }
 }

+ 32 - 3
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -199,7 +199,7 @@ public class AuthProductServiceImpl implements AuthProductService {
         ProductRelationVo dbRelation = null;
         ProductFormVo dbProduct = null;
         if (!newRelation) {
-            dbRelation = authProductMapper.getProductRelation(relationId);
+            dbRelation = authProductMapper.getProductRelation(relationId, null, null);
             dbProduct = authProductMapper.getProductFormData(relationId);
         }
         /*
@@ -255,6 +255,11 @@ public class AuthProductServiceImpl implements AuthProductService {
                 // 插入机构设备关联关系
                 relationId = authProductMapper.insertProductRelation(authId, product.getProductId(), authType);
             } else {
+                // 检测机构是否已关联该设备
+                ProductRelationVo productRelation = authProductMapper.getProductRelation(null, productId, authId);
+                if (null != productRelation) {
+                    return ResponseJson.error("不能重复关联同一台设备");
+                }
                 // 关联设备,更新设备
                 authProductMapper.updateProductByProductId(product);
                 // 插入机构设备关联关系
@@ -265,6 +270,11 @@ public class AuthProductServiceImpl implements AuthProductService {
                 // 更新设备
                 authProductMapper.updateProductByProductId(product);
                 if (2 == authType) {
+                    // 检测机构是否已关联该设备
+                    ProductRelationVo productRelation = authProductMapper.getProductRelation(null, productId, authId);
+                    if (null != productRelation) {
+                        return ResponseJson.error("不能重复关联同一台设备");
+                    }
                     // 更新机构设备关联关系
                     authProductMapper.updateProductRelation(dbRelation.getRelationId(), authId, product.getProductId(), authType);
                     // 原本关联的新增设备若无关联机构,删除该设备
@@ -280,6 +290,11 @@ public class AuthProductServiceImpl implements AuthProductService {
                 } else {
                     // 更新设备
                     authProductMapper.updateProductByProductId(product);
+                    // 检测机构是否已关联该设备
+                    ProductRelationVo productRelation = authProductMapper.getProductRelation(null, productId, authId);
+                    if (null != productRelation) {
+                        return ResponseJson.error("不能重复关联同一台设备");
+                    }
                 }
                 // 更新机构设备关联关系
                 authProductMapper.updateProductRelation(dbRelation.getRelationId(), authId, product.getProductId(), authType);
@@ -680,6 +695,10 @@ public class AuthProductServiceImpl implements AuthProductService {
         }
         PageHelper.startPage(pageNum, pageSize);
         List<WxProductListVo> productList = authProductMapper.getWxProductList(listType, authId, authParty, productTypeId, snCode);
+        productList.forEach(product->{
+            List<WxClubListVo> clubList = authProductMapper.getProductClubList(product.getProductId());
+            product.setClubList(clubList);
+        });
         PageInfo<WxProductListVo> pageData = new PageInfo<>(productList);
         return ResponseJson.success(pageData);
     }
@@ -690,6 +709,7 @@ public class AuthProductServiceImpl implements AuthProductService {
         if (null == authProduct) {
             return ResponseJson.error("商品不存在", null);
         }
+        authProduct.setClubList(authProductMapper.getProductClubList(productId));
         // 商品参数
         authProduct.setParamList(authProductMapper.getAuthProductParams(productId));
         return ResponseJson.success(authProduct);
@@ -830,8 +850,17 @@ public class AuthProductServiceImpl implements AuthProductService {
     }
 
     @Override
-    public ResponseJson<ProductFormVo> getProductDetails(Integer productId, String snCode) {
-        ProductFormVo product =  authProductMapper.getProductDetails(productId, snCode);
+    public ResponseJson<ProductFormVo> getProductInfo(Integer productId, String snCode) {
+        ProductFormVo product =  authProductMapper.getProductInfo(productId, snCode);
+        if (null == product) {
+            return ResponseJson.error(-1, "设备SN码不存在", null);
+        }
+        if (2 == product.getAuditStatus()) {
+            return ResponseJson.error(-2, "设备待审核", null);
+        }
+        if (0 == product.getAuditStatus()) {
+            return ResponseJson.error(-3, "设备审核失败", null);
+        }
         return ResponseJson.success(product);
     }
 

+ 2 - 2
src/main/java/com/caimei/service/auth/impl/ShopServiceImpl.java

@@ -265,9 +265,9 @@ public class ShopServiceImpl implements ShopService {
     }
 
     @Override
-    public ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(Integer authUserId, String clubName, String mobile, Integer handleStatus, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(Integer authUserId, String authParty, String mobile, Integer handleStatus, Integer pageNum, Integer pageSize) {
         PageHelper.startPage(pageNum, pageSize);
-        List<FeedbackVo> feedbackList = shopMapper.getFeedbackList(authUserId, clubName, mobile, handleStatus);
+        List<FeedbackVo> feedbackList = shopMapper.getFeedbackList(authUserId, authParty, mobile, handleStatus);
         PageInfo<FeedbackVo> pageData = new PageInfo<>(feedbackList);
         return ResponseJson.success(pageData);
     }

+ 13 - 7
src/main/resources/mapper/ArticleMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.mapper.cmMapper.ArticleMapper">
     <insert id="insertArticle">
-        insert into cm_brand_article(authUserId, title, image, content, auditStatus, status, createTime, auditBy, auditTime, checkFlag)
-        values (#{authUserId}, #{title}, #{image}, #{content}, #{auditStatus}, #{status}, #{createTime}, #{auditBy}, #{auditTime}, #{checkFlag})
+        insert into cm_brand_article(authUserId, title, image, content, auditStatus, status, createTime, auditBy, auditTime, checkFlag, sort)
+        values (#{authUserId}, #{title}, #{image}, #{content}, #{auditStatus}, #{status}, #{createTime}, #{auditBy}, #{auditTime}, #{checkFlag}, #{sort})
     </insert>
     <update id="updateArticleByArticleId">
         update cm_brand_article
@@ -11,7 +11,8 @@
             image       = #{image},
             content     = #{content},
             status      = #{status},
-            auditStatus = #{auditStatus}
+            auditStatus = #{auditStatus},
+            sort        = #{sort}
         where id = #{id}
     </update>
     <update id="updateArticleStatusByArticleId">
@@ -33,13 +34,18 @@
         set checkFlag = 1
         where id = #{articleId}
     </update>
+    <update id="updateSort">
+        update cm_brand_article
+        set sort = #{sort}
+        where id = #{articleId}
+    </update>
     <delete id="deleteArticleByArticleId">
         delete from cm_brand_article where id = #{articleId}
     </delete>
     <select id="getArticleList" resultType="com.caimei.model.vo.ArticleListVo">
         select a.id as articleId,a.title as articleTitle,a.image as articleImage,
         a.auditStatus,a.invalidReason,a.status,a.createTime,
-        au.name as auditBy,a.auditTime
+        au.name as auditBy,a.auditTime,a.sort
         from cm_brand_article a
         left join cm_brand_auth_user au on a.auditBy = au.authUserId
         where a.authUserId = #{authUserId}
@@ -57,12 +63,12 @@
                 order by a.auditStatus desc, a.createTime desc
             </when>
             <otherwise>
-                order by a.createTime desc
+                order by -a.sort desc, a.createTime desc
             </otherwise>
         </choose>
     </select>
     <select id="getArticleForm" resultType="com.caimei.model.vo.ArticleFormVo">
-        select id as articleId, title as articleTitle, image as articleImage, content as articleContent, createTime, auditStatus
+        select id as articleId, title as articleTitle, image as articleImage, content as articleContent, createTime, auditStatus, sort
         from cm_brand_article
         where id = #{articleId}
     </select>
@@ -75,6 +81,6 @@
         <if test="articleTitle != null and articleTitle != ''">
             and title like concat('%',#{articleTitle},'%')
         </if>
-        order by a.createTime desc
+        order by -a.sort desc, a.createTime desc
     </select>
 </mapper>

+ 39 - 21
src/main/resources/mapper/AuthProductMapper.xml

@@ -244,7 +244,7 @@
         where productId = #{productId}
     </select>
     <select id="getProductIdsByAuthId" resultType="java.lang.Integer">
-        select p.id
+        select DISTINCT p.id
         from cm_brand_auth_product p
                  left join cm_brand_product_relation r on p.id = r.productId
         where r.authId = #{authId};
@@ -260,12 +260,10 @@
         from cm_brand_auth_product
     </select>
     <select id="getWxProductList" resultType="com.caimei.model.vo.WxProductListVo">
-        select p.id as productId,
-        r.authId,
+        select DISTINCT p.id as productId,
         if(p.productTypeId is null,p.name,t.name) as productName,
         p.snCode,
         if(p.productTypeId is null,p.image,t.image) as productImage,
-        a.authParty as clubName,
         p.auditStatus
         from cm_brand_auth_product p
         left join cm_brand_product_relation r on p.id = r.productId
@@ -282,15 +280,24 @@
                 and p.auditStatus = 1
                 and t.status = 1
                 and t.auditStatus = 1
+                <if test="snCode != null and snCode != ''">
+                    and p.snCode like concat('%',#{snCode},'%')
+                </if>
+                <if test="authId != null">
+                    and r.authId = #{authId}
+                </if>
+                <if test="authParty != null and authParty != ''">
+                    and a.authParty like concat('%',#{authParty},'%')
+                </if>
             </if>
-            <if test="snCode != null and snCode != ''">
-                and p.snCode like concat('%',#{snCode},'%')
-            </if>
-            <if test="authId != null">
-                and r.authId = #{authId}
-            </if>
-            <if test="authParty != null and authParty != ''">
-                and a.authParty like concat('%',#{authParty},'%')
+            <if test="listType == 2">
+                and p.productTypeId = #{productTypeId}
+                <if test="snCode != null and snCode != ''">
+                    and p.snCode = #{snCode}
+                </if>
+                <if test="authParty != null and authParty != ''">
+                    and a.authParty = #{authParty}
+                </if>
             </if>
         </where>
         order by p.createTime desc
@@ -323,9 +330,6 @@
                i.brandName        as brandName,
                i.producePlace     as producePlace,
                i.manufacturer     as manufacturer,
-               a.id               as authId,
-               a.authParty,
-               a.logo             as clubLogo,
                u.authUserId       as authUserId,
                u.name             as shopName,
                u.shopType,
@@ -344,6 +348,7 @@
           and p.auditStatus = 1
           and t.status = 1
           and t.auditStatus = 1
+        limit 1
     </select>
     <select id="getAuthProductParams" resultType="com.caimei.model.po.ProductParamPo">
         select p.name as paramName, p.content as paramContent
@@ -351,7 +356,7 @@
         where ap.id = #{productId}
     </select>
     <select id="getClubProductList" resultType="com.caimei.model.vo.WxProductListVo">
-        select p.id as productId, t.name as productName, p.snCode
+        select p.id as productId, t.image as productImage, t.name as productName, p.snCode
         from cm_brand_auth_product p
                  left join cm_brand_product_relation r on p.id = r.productId
                  left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
@@ -427,6 +432,7 @@
                  left join cm_brand_product_relation r on p.id = r.productId
                  left join cm_brand_auth a on r.authId = a.id
         where p.id = #{productId}
+        limit 1
     </select>
     <select id="getProductTypeParamList" resultType="com.caimei.model.po.ProductParamPo">
         select name as paramName, content as paramContent
@@ -436,16 +442,22 @@
     <select id="getProductRelation" resultType="com.caimei.model.vo.ProductRelationVo">
         select id as relationId, authId, productId, authType
         from cm_brand_product_relation
-        where id = #{relationId}
+        where
+        <if test="relationId != null">
+            id = #{relationId}
+        </if>
+        <if test="productId != null and authId != null">
+            productId = #{productId} and authId = #{authId}
+        </if>
     </select>
     <select id="getProductRelationCount" resultType="java.lang.Integer">
         select count(*)
         from cm_brand_product_relation
         where productId = #{productId}
     </select>
-    <select id="getProductDetails" resultType="com.caimei.model.vo.ProductFormVo">
+    <select id="getProductInfo" resultType="com.caimei.model.vo.ProductFormVo">
         select p.id as productId,if(p.productTypeId is null,p.name,t.name) as productName,
-        certificateImageType,certificateImage,purchaseWay,invoiceImage
+        certificateImageType,certificateImage,purchaseWay,invoiceImage,p.auditStatus
         from cm_brand_auth_product p
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         <where>
@@ -458,10 +470,16 @@
         </where>
     </select>
     <select id="getSnCodeList" resultType="java.lang.String">
-        select snCode
+        select DISTINCT snCode
         from cm_brand_auth_product p
                  left join cm_brand_product_relation r on p.id = r.productId
                  left join cm_brand_auth a on a.id = r.authId and a.delFlag = 0
-        where a.authUserId = #{authUserId}
+        where a.authUserId = #{authUserId} and p.auditStatus = 1
+    </select>
+    <select id="getProductClubList" resultType="com.caimei.model.vo.WxClubListVo">
+        select a.id as authId, a.authParty, a.logo
+        from cm_brand_auth a
+                 left join cm_brand_product_relation r on a.id = r.authId
+        where r.productId = #{productId}
     </select>
 </mapper>

+ 26 - 6
src/main/resources/mapper/ClubMapper.xml

@@ -42,10 +42,10 @@
         where id = #{clubUserId}
     </update>
     <select id="getClubList" resultType="com.caimei.model.vo.ClubVo">
-        select id as authId,authParty as clubName,createTime
+        select id as authId,authParty as authParty,createTime
         from cm_brand_auth where authUserId = #{authUserId}
-        <if test="clubName != null and clubName != ''">
-            and authParty like concat('%',#{clubName},'%')
+        <if test="authParty != null and authParty != ''">
+            and authParty like concat('%',#{authParty},'%')
         </if>
         order by createTime desc
     </select>
@@ -75,7 +75,7 @@
         order by cu.addTime desc
     </select>
     <select id="getWxClubList" resultType="com.caimei.model.vo.WxClubListVo">
-        select id as authId, authParty as clubName,concat(ifnull(p.name,''),ifnull(c.name,''),ifnull(t.name,'')) as area,a.address,a.mobile,a.logo,
+        select id as authId, authParty as authParty,concat(ifnull(p.name,''),ifnull(c.name,''),ifnull(t.name,'')) as area,a.address,a.mobile,a.logo,
         ifnull(round(st_distance(point(a.lng,a.lat),point(#{lng},#{lat}))*111195/1000,2),99999) as distance
         from cm_brand_auth a
         left join cm_brand_auth_user au on a.authUserId = au.authUserId
@@ -90,8 +90,8 @@
         and a.auditStatus = 1
         and a.delFlag = 0
         and au.status = 1
-        <if test="clubName != null and clubName != ''">
-            and a.authParty like concat('%',#{clubName},'%')
+        <if test="authParty != null and authParty != ''">
+            and a.authParty like concat('%',#{authParty},'%')
         </if>
         <if test="provinceId != null">
             and a.provinceId = #{provinceId}
@@ -140,6 +140,7 @@
                a.address,
                a.mobile,
                a.logo,
+               a.authImage,
                concat(a.lng,',',a.lat) as lngAndLat,
                if(a.customFlag = 1,a.remarks,null) as remarks
         from cm_brand_auth a
@@ -155,4 +156,23 @@
     <select id="getDbPassword" resultType="java.lang.String">
         select password from cm_brand_club_user where id = #{clubUserId}
     </select>
+    <select id="getWxStarClubList" resultType="com.caimei.model.vo.WxClubListVo">
+        select id as authId, authParty as authParty,concat(ifnull(p.name,''),ifnull(c.name,''),ifnull(t.name,'')) as area,a.address,a.mobile,a.logo,
+        ifnull(round(st_distance(point(a.lng,a.lat),point(#{lng},#{lat}))*111195/1000,2),99999) as distance
+        from cm_brand_auth a
+        left join cm_brand_auth_user au on a.authUserId = au.authUserId
+        left join province p on a.provinceId = p.provinceID
+        left join city c on a.cityId = c.cityID
+        left join town t on a.townId = t.townID
+        left join (select r.authId as authId, count(*) as productCount
+        from cm_brand_auth_product p left join cm_brand_product_relation r on p.id = r.productId
+        where p.status = 1 group by r.authId) pc on a.id = pc.authId
+        where au.authUserId = #{authUserId}
+        and a.status = 1
+        and a.auditStatus = 1
+        and a.delFlag = 0
+        and au.status = 1
+        and a.starFlag = 1
+        order by rand()
+    </select>
 </mapper>

+ 4 - 4
src/main/resources/mapper/ShopMapper.xml

@@ -233,15 +233,15 @@
         where a.authUserId = #{authUserId} and p.infoId = #{infoId}
     </select>
     <select id="getFeedbackList" resultType="com.caimei.model.vo.FeedbackVo">
-        select cf.id as feedbackId, a.authParty as clubName, cu.mobile, content, commitTime, handleStatus, handleResult,
+        select cf.id as feedbackId, a.authParty as authParty, cu.mobile, content, commitTime, handleStatus, handleResult,
         handleTime
         from cm_brand_club_feedback cf
         left join cm_brand_club_user cu on cf.clubUserId = cu.id
         left join cm_brand_auth a on cu.authId = a.id
         left join cm_brand_auth_user au on cu.authUserId = au.authUserId
         where (a.authUserId = #{authUserId} or au.authUserId = #{authUserId})
-        <if test="clubName != null and clubName != ''">
-            and a.authParty like concat('%',#{clubName},'%')
+        <if test="authParty != null and authParty != ''">
+            and a.authParty like concat('%',#{authParty},'%')
         </if>
         <if test="mobile != null and mobile != ''">
             and cu.mobile like concat('%',#{mobile},'%')
@@ -251,7 +251,7 @@
         </if>
     </select>
     <select id="getFeedback" resultType="com.caimei.model.vo.FeedbackVo">
-        select cf.id as feedbackId, a.authParty as clubName, cu.mobile, content, commitTime, handleStatus, handleResult, handleTime
+        select cf.id as feedbackId, a.authParty as authParty, cu.mobile, content, commitTime, handleStatus, handleResult, handleTime
         from cm_brand_club_feedback cf
                  left join cm_brand_club_user cu on cf.clubUserId = cu.id
                  left join cm_brand_auth a on cu.authId = a.id