Browse Source

ross认证通part1

Aslee 2 years ago
parent
commit
1a1d0851a4
38 changed files with 1239 additions and 194 deletions
  1. 1 0
      src/main/java/com/caimei/config/ApiConfig.java
  2. 1 1
      src/main/java/com/caimei/config/WxApiInterceptor.java
  3. 42 7
      src/main/java/com/caimei/controller/auth/AuthApi.java
  4. 36 9
      src/main/java/com/caimei/controller/auth/AuthClubApi.java
  5. 12 6
      src/main/java/com/caimei/controller/auth/AuthProductApi.java
  6. 4 3
      src/main/java/com/caimei/controller/auth/ShopApi.java
  7. 21 8
      src/main/java/com/caimei/controller/wechat/LoginApi.java
  8. 92 0
      src/main/java/com/caimei/controller/wechat/RegisterApi.java
  9. 99 0
      src/main/java/com/caimei/controller/wechat/WxUserApi.java
  10. 9 2
      src/main/java/com/caimei/mapper/cmMapper/AuthMapper.java
  11. 3 1
      src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java
  12. 10 2
      src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java
  13. 1 1
      src/main/java/com/caimei/mapper/cmMapper/ShopMapper.java
  14. 6 0
      src/main/java/com/caimei/model/dto/ProductSaveDto.java
  15. 15 0
      src/main/java/com/caimei/model/po/ClubUserPo.java
  16. 30 0
      src/main/java/com/caimei/model/po/CmBrandAuthPo.java
  17. 17 0
      src/main/java/com/caimei/model/po/ProductPo.java
  18. 90 13
      src/main/java/com/caimei/model/vo/AuthFormVo.java
  19. 3 0
      src/main/java/com/caimei/model/vo/AuthVo.java
  20. 59 13
      src/main/java/com/caimei/model/vo/ProductFormVo.java
  21. 15 3
      src/main/java/com/caimei/service/auth/AuthClubService.java
  22. 6 3
      src/main/java/com/caimei/service/auth/AuthProductService.java
  23. 14 11
      src/main/java/com/caimei/service/auth/AuthService.java
  24. 1 1
      src/main/java/com/caimei/service/auth/ShopService.java
  25. 39 7
      src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java
  26. 20 5
      src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java
  27. 35 16
      src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java
  28. 2 2
      src/main/java/com/caimei/service/auth/impl/ShopServiceImpl.java
  29. 11 2
      src/main/java/com/caimei/service/wechat/LoginService.java
  30. 23 0
      src/main/java/com/caimei/service/wechat/RegisterService.java
  31. 35 0
      src/main/java/com/caimei/service/wechat/WxUserService.java
  32. 41 13
      src/main/java/com/caimei/service/wechat/impl/LoginServiceImpl.java
  33. 148 0
      src/main/java/com/caimei/service/wechat/impl/RegisterServiceImpl.java
  34. 107 0
      src/main/java/com/caimei/service/wechat/impl/WxUserServiceImpl.java
  35. 102 38
      src/main/resources/mapper/AuthMapper.xml
  36. 34 7
      src/main/resources/mapper/AuthProductMapper.xml
  37. 46 20
      src/main/resources/mapper/ClubMapper.xml
  38. 9 0
      src/main/resources/mapper/ShopMapper.xml

+ 1 - 0
src/main/java/com/caimei/config/ApiConfig.java

@@ -35,6 +35,7 @@ public class ApiConfig implements WebMvcConfigurer {
         registry.addInterceptor(wxApiInterceptor)
         registry.addInterceptor(wxApiInterceptor)
                 .addPathPatterns("/wx/data/**")
                 .addPathPatterns("/wx/data/**")
                 .addPathPatterns("/wx/user/token/check")
                 .addPathPatterns("/wx/user/token/check")
+                .addPathPatterns("/wx/user/password/update")
                 .excludePathPatterns("/wx/data/feedback/submit");
                 .excludePathPatterns("/wx/data/feedback/submit");
     }
     }
 }
 }

+ 1 - 1
src/main/java/com/caimei/config/WxApiInterceptor.java

@@ -49,7 +49,7 @@ public class WxApiInterceptor implements HandlerInterceptor {
             String[] cacheArr = cacheValue.split(",");
             String[] cacheArr = cacheValue.split(",");
             String mobile = cacheArr[0];
             String mobile = cacheArr[0];
             Integer authUserId = Integer.parseInt(cacheArr[1]);
             Integer authUserId = Integer.parseInt(cacheArr[1]);
-            clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null);
+            clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
         } else if (null != cacheValue && cacheValue.contains("|")){
         } else if (null != cacheValue && cacheValue.contains("|")){
             // 服务号登录用户
             // 服务号登录用户
             String[] cacheArr = cacheValue.split("\\|");
             String[] cacheArr = cacheValue.split("\\|");

+ 42 - 7
src/main/java/com/caimei/controller/auth/AuthApi.java

@@ -43,20 +43,23 @@ public class AuthApi {
      */
      */
     @ApiOperation("授权列表")
     @ApiOperation("授权列表")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1授权列表,2授权审核列表"),
+            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1授权列表,2授权审核列表,3供应商审核列表,4授权牌物流列表"),
             @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
             @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
             @ApiImplicitParam(name = "authParty", required = false, value = "授权机构"),
             @ApiImplicitParam(name = "authParty", required = false, value = "授权机构"),
             @ApiImplicitParam(name = "status", required = false, value = "上线状态:0已下线,1已上线,2待上线"),
             @ApiImplicitParam(name = "status", required = false, value = "上线状态:0已下线,1已上线,2待上线"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
             @ApiImplicitParam(name = "lowerAuditStatus", required = false, value = "商品信息审核状态:0未完成审核,1已完成审核"),
             @ApiImplicitParam(name = "lowerAuditStatus", required = false, value = "商品信息审核状态:0未完成审核,1已完成审核"),
+            @ApiImplicitParam(name = "shopAuditStatus", required = false, value = "供应商审核状态:0未审核,1已审核"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     })
     @GetMapping("/list")
     @GetMapping("/list")
-    public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, Integer status, Integer auditStatus, Integer lowerAuditStatus,
+    public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
+                                                      Integer status, Integer auditStatus, Integer lowerAuditStatus,
+                                                      Integer shopAuditStatus,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authService.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus, pageNum, pageSize);
+        return authService.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus, shopAuditStatus, pageNum, pageSize);
     }
     }
 
 
     @ApiOperation("机构下拉框列表")
     @ApiOperation("机构下拉框列表")
@@ -107,7 +110,11 @@ public class AuthApi {
      */
      */
     @ApiOperation("添加/编辑授权")
     @ApiOperation("添加/编辑授权")
     @ApiImplicitParam(name = "params", value = "authId:授权id;authUserId:供应商用户id;authParty:授权机构;provinceId;cityId;" +
     @ApiImplicitParam(name = "params", value = "authId:授权id;authUserId:供应商用户id;authParty:授权机构;provinceId;cityId;" +
-            "townId;address;lngAndLat;mobile;logo;customFlag:是否需要自定义属性:0否,1是;remarks:店铺备注;createBy:创建人id", required = true)
+            "townId;address;lngAndLat;mobile;userMobile:对应机构用户手机号;" +
+            "firstClubType:一级分类为医美=1,生美=2,项目公司=3,个人=4,其他=5;" +
+            "secondClubType:医美的二级分类为诊所=1、门诊=2、医院=3,其他=4。生美二级分类,美容院=5,养生馆=6,其他=7;" +
+            "medicalLicenseImage:医疗许可证图;empNum:员工人数;"+
+            "logo;customFlag:是否需要自定义属性:0否,1是;remarks:店铺备注;createBy:创建人id", required = true)
     @PostMapping("/save")
     @PostMapping("/save")
     public ResponseJson saveAuth(@RequestBody String params) {
     public ResponseJson saveAuth(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         JSONObject paramsMap = JSONObject.parseObject(params);
@@ -119,6 +126,11 @@ public class AuthApi {
         String address = paramsMap.getString("address");
         String address = paramsMap.getString("address");
         String lngAndLat = paramsMap.getString("lngAndLat");
         String lngAndLat = paramsMap.getString("lngAndLat");
         String mobile = paramsMap.getString("mobile");
         String mobile = paramsMap.getString("mobile");
+        String userMobile = paramsMap.getString("userMobile");
+        Integer firstClubType = paramsMap.getInteger("firstClubType");
+        Integer secondClubType = paramsMap.getInteger("secondClubType");
+        String medicalLicenseImage = paramsMap.getString("medicalLicenseImage");
+        Integer empNum = paramsMap.getInteger("empNum");
         String logo = paramsMap.getString("logo");
         String logo = paramsMap.getString("logo");
         Integer customFlag = paramsMap.getInteger("customFlag");
         Integer customFlag = paramsMap.getInteger("customFlag");
         String remarks = paramsMap.getString("remarks");
         String remarks = paramsMap.getString("remarks");
@@ -145,9 +157,14 @@ public class AuthApi {
         auth.setLng(new BigDecimal(split[0]));
         auth.setLng(new BigDecimal(split[0]));
         auth.setLat(new BigDecimal(split[1]));
         auth.setLat(new BigDecimal(split[1]));
         auth.setMobile(mobile);
         auth.setMobile(mobile);
+        auth.setUserMobile(userMobile);
+        auth.setFirstClubType(firstClubType);
+        auth.setSecondClubType(secondClubType);
+        auth.setMedicalLicenseImage(medicalLicenseImage);
+        auth.setEmpNum(empNum);
         auth.setLogo(logo);
         auth.setLogo(logo);
         auth.setCreateBy(createBy);
         auth.setCreateBy(createBy);
-        return authService.saveAuth(auth, bannerList, false);
+        return authService.saveAuth(auth, bannerList, false, 1);
     }
     }
 
 
 
 
@@ -155,7 +172,8 @@ public class AuthApi {
      * 审核品牌授权
      * 审核品牌授权
      */
      */
     @ApiOperation("审核品牌授权")
     @ApiOperation("审核品牌授权")
-    @ApiImplicitParam(name = "params", value = "authId:授权id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;invalidReason:审核不通过原因;auditBy:审核人用户id", required = true)
+    @ApiImplicitParam(name = "params", value = "authId:授权id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;" +
+            "invalidReason:审核不通过原因;auditBy:审核人用户id;source:来源:1管理员审核,2供应商审核", required = true)
     @PostMapping("/audit")
     @PostMapping("/audit")
     public ResponseJson auditAuth(@RequestBody String params) {
     public ResponseJson auditAuth(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         JSONObject paramsMap = JSONObject.parseObject(params);
@@ -163,10 +181,27 @@ public class AuthApi {
         Integer auditStatus = paramsMap.getInteger("auditStatus");
         Integer auditStatus = paramsMap.getInteger("auditStatus");
         String invalidReason = paramsMap.getString("invalidReason");
         String invalidReason = paramsMap.getString("invalidReason");
         Integer auditBy = paramsMap.getInteger("auditBy");
         Integer auditBy = paramsMap.getInteger("auditBy");
-        return authService.auditAuth(authId, auditStatus, invalidReason, auditBy);
+        Integer source = paramsMap.getInteger("source");
+        return authService.auditAuth(authId, auditStatus, invalidReason, auditBy, source);
     }
     }
 
 
 
 
+    /*@ApiOperation("寄送授权牌")
+    @ApiImplicitParam(name = "params", value = "authId:授权id;快递", required = true)
+    @PostMapping("/audit")
+    public ResponseJson auditAuth(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer authId = paramsMap.getInteger("authId");
+        Integer auditStatus = paramsMap.getInteger("auditStatus");
+        String invalidReason = paramsMap.getString("invalidReason");
+        Integer auditBy = paramsMap.getInteger("auditBy");
+        Integer source = paramsMap.getInteger("source");
+        return authService.auditAuth(authId, auditStatus, invalidReason, auditBy, source);
+    }*/
+
+
+
+
     @ApiOperation("excel导入")
     @ApiOperation("excel导入")
     @ApiImplicitParams({
     @ApiImplicitParams({
             @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
             @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),

+ 36 - 9
src/main/java/com/caimei/controller/auth/AuthClubApi.java

@@ -15,6 +15,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
+import java.util.Map;
+
 /**
 /**
  * 供应商API
  * 供应商API
  *
  *
@@ -49,30 +51,30 @@ public class AuthClubApi {
     @ApiOperation("机构用户列表")
     @ApiOperation("机构用户列表")
     @GetMapping("/user/list")
     @GetMapping("/user/list")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "authId", required = true, value = "机构id"),
+            @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
             @ApiImplicitParam(name = "mobile", required = false, value = "手机号"),
             @ApiImplicitParam(name = "mobile", required = false, value = "手机号"),
             @ApiImplicitParam(name = "name", required = false, value = "姓名"),
             @ApiImplicitParam(name = "name", required = false, value = "姓名"),
-            @ApiImplicitParam(name = "status", required = false, value = "状态:0未绑定,1已绑定,2已过期"),
+            @ApiImplicitParam(name = "status", required = false, value = "状态:0停用,1启用"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     })
-    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, String name, Integer status,
+    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authUserId, String mobile, String name, Integer status,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authClubService.getClubUserList(authId, mobile, name, status, pageNum, pageSize);
+        return authClubService.getClubUserList(authUserId, mobile, name, status, pageNum, pageSize);
     }
     }
 
 
     @ApiOperation("添加/编辑机构用户")
     @ApiOperation("添加/编辑机构用户")
     @PostMapping("/user/save")
     @PostMapping("/user/save")
-    @ApiImplicitParam(name = "params", value = "clubUserId:机构用户id;authId:授权机构id;name:姓名;mobile:手机号", required = true)
+    @ApiImplicitParam(name = "params", value = "clubUserId:机构用户id;authUserId:供应商用户id;name:姓名;mobile:手机号", required = true)
     public ResponseJson saveClubUser(@RequestBody String params) {
     public ResponseJson saveClubUser(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         JSONObject paramsMap = JSONObject.parseObject(params);
         Integer clubUserId = paramsMap.getInteger("clubUserId");
         Integer clubUserId = paramsMap.getInteger("clubUserId");
-        Integer authId = paramsMap.getInteger("authId");
+        Integer authUserId = paramsMap.getInteger("authUserId");
         String name = paramsMap.getString("name");
         String name = paramsMap.getString("name");
         String mobile = paramsMap.getString("mobile");
         String mobile = paramsMap.getString("mobile");
-        if (null == authId) {
-            return ResponseJson.error("参数异常,请输入授权机构id");
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id");
         }
         }
         if (StringUtils.isEmpty(name)) {
         if (StringUtils.isEmpty(name)) {
             return ResponseJson.error("参数异常,请输入姓名");
             return ResponseJson.error("参数异常,请输入姓名");
@@ -80,7 +82,7 @@ public class AuthClubApi {
         if (StringUtils.isEmpty(mobile)) {
         if (StringUtils.isEmpty(mobile)) {
             return ResponseJson.error("参数异常,请输入手机号");
             return ResponseJson.error("参数异常,请输入手机号");
         }
         }
-        return authClubService.saveClubUser(clubUserId, authId, name, mobile);
+        return authClubService.saveClubUser(clubUserId, authUserId, name, mobile);
     }
     }
 
 
     @ApiOperation("删除机构用户")
     @ApiOperation("删除机构用户")
@@ -94,4 +96,29 @@ public class AuthClubApi {
         }
         }
         return authClubService.deleteClubUser(clubUserId);
         return authClubService.deleteClubUser(clubUserId);
     }
     }
+
+    @ApiOperation("更新用户状态")
+    @PostMapping("/user/status/update")
+    @ApiImplicitParam(name = "params", value = "clubUserId:机构用户id;status:状态:0停用,1启用", required = true)
+    public ResponseJson updateStatus(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer clubUserId = paramsMap.getInteger("clubUserId");
+        Integer status = paramsMap.getInteger("status");
+        if (null == clubUserId) {
+            return ResponseJson.error("参数异常,机构用户id不能为空");
+        }
+        if (null == status) {
+            return ResponseJson.error("参数异常,状态不能为空");
+        }
+        return authClubService.updateStatus(clubUserId, status);
+    }
+
+
+    @ApiOperation("重置密码")
+    @ApiImplicitParam(name = "params", value = "clubUserId:机构用户id", required = true)
+    @PostMapping("/user/reset/password")
+    public ResponseJson resetShopPassword(@RequestBody Map<String,Integer> params) {
+        Integer clubUserId = params.get("clubUserId");
+        return authClubService.resetClubUserPassword(clubUserId);
+    }
 }
 }

+ 12 - 6
src/main/java/com/caimei/controller/auth/AuthProductApi.java

@@ -40,20 +40,22 @@ public class AuthProductApi {
      */
      */
     @ApiOperation("授权商品列表")
     @ApiOperation("授权商品列表")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1商品列表,2商品审核列表"),
+            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1商品列表,2管理员商品审核列表,3供应商商品审核列表"),
             @ApiImplicitParam(name = "authId", required = true, value = "授权id"),
             @ApiImplicitParam(name = "authId", required = true, value = "授权id"),
             @ApiImplicitParam(name = "productName", required = false, value = "商品名称"),
             @ApiImplicitParam(name = "productName", required = false, value = "商品名称"),
             @ApiImplicitParam(name = "snCode", required = false, value = "商品SN码"),
             @ApiImplicitParam(name = "snCode", required = false, value = "商品SN码"),
             @ApiImplicitParam(name = "status", required = false, value = "上线状态:0下线,1上线,2待上线"),
             @ApiImplicitParam(name = "status", required = false, value = "上线状态:0下线,1上线,2待上线"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
+            @ApiImplicitParam(name = "shopAuditStatus", required = false, value = "供应商审核状态:0未审核,1已审核"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     })
     @GetMapping("/list")
     @GetMapping("/list")
-    public ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName, String snCode, Integer status, Integer auditStatus,
+    public ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName,
+                                                                String snCode, Integer status, Integer auditStatus, Integer shopAuditStatus,
                                                                 @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                                 @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                                 @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
                                                                 @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authProductService.getProductList(listType, authId, productName, snCode, status, auditStatus, pageNum, pageSize);
+        return authProductService.getProductList(listType, authId, productName, snCode, status, auditStatus, shopAuditStatus, pageNum, pageSize);
     }
     }
 
 
 
 
@@ -92,6 +94,8 @@ public class AuthProductApi {
      *                   certificateImage       授权牌照
      *                   certificateImage       授权牌照
      *                   addQrCodeFlag          是否生成二维码授权牌:0否,1是
      *                   addQrCodeFlag          是否生成二维码授权牌:0否,1是
      *                   addTemplateType        生成二维码授权牌模板:1左下,2右边,3左边
      *                   addTemplateType        生成二维码授权牌模板:1左下,2右边,3左边
+     *                   purchaseWay            购买渠道
+     *                   invoiceImage           发票图片
      *                   status                 上线状态:0已下线,1已上线,2待上线
      *                   status                 上线状态:0已下线,1已上线,2待上线
      *                   createBy               创建人id
      *                   createBy               创建人id
      *                   paramList              商品参数列表
      *                   paramList              商品参数列表
@@ -100,7 +104,7 @@ public class AuthProductApi {
     @ApiOperation("添加/编辑授权商品")
     @ApiOperation("添加/编辑授权商品")
     @PostMapping("/save")
     @PostMapping("/save")
     public ResponseJson saveProduct(@RequestBody ProductSaveDto productSaveDto) throws IOException {
     public ResponseJson saveProduct(@RequestBody ProductSaveDto productSaveDto) throws IOException {
-        return authProductService.saveProduct(productSaveDto, false);
+        return authProductService.saveProduct(productSaveDto, false, 1);
     }
     }
 
 
     /**
     /**
@@ -129,7 +133,8 @@ public class AuthProductApi {
      * 审核商品
      * 审核商品
      */
      */
     @ApiOperation("审核商品")
     @ApiOperation("审核商品")
-    @ApiImplicitParam(name = "params", value = "productId:授权商品id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;invalidReason:审核不通过原因;auditBy:审核人用户id", required = true)
+    @ApiImplicitParam(name = "params", value = "productId:授权商品id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;" +
+            "invalidReason:审核不通过原因;auditBy:审核人用户id;source:来源:1管理员审核,2供应商审核", required = true)
     @PostMapping("/audit")
     @PostMapping("/audit")
     public ResponseJson auditProduct(@RequestBody String params) {
     public ResponseJson auditProduct(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         JSONObject paramsMap = JSONObject.parseObject(params);
@@ -137,7 +142,8 @@ public class AuthProductApi {
         Integer auditStatus = paramsMap.getInteger("auditStatus");
         Integer auditStatus = paramsMap.getInteger("auditStatus");
         String invalidReason = paramsMap.getString("invalidReason");
         String invalidReason = paramsMap.getString("invalidReason");
         Integer auditBy = paramsMap.getInteger("auditBy");
         Integer auditBy = paramsMap.getInteger("auditBy");
-        return authProductService.auditProduct(productId, auditStatus, invalidReason, auditBy);
+        Integer source = paramsMap.getInteger("source");
+        return authProductService.auditProduct(productId, auditStatus, invalidReason, auditBy, source);
     }
     }
 
 
     @ApiOperation("添加/编辑设备分类")
     @ApiOperation("添加/编辑设备分类")

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

@@ -40,7 +40,7 @@ public class ShopApi {
      */
      */
     @ApiOperation("供应商列表")
     @ApiOperation("供应商列表")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1供应商列表,2授权信息审核列表,3资料审核列表,4医师审核列表,5添加会员列表,6设备分类审核列表"),
+            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1供应商列表,2授权信息审核列表,3资料审核列表,4医师审核列表,5添加会员列表,6设备分类审核列表,7授权牌物流列表"),
             @ApiImplicitParam(name = "shopName", required = false, value = "供应商名称"),
             @ApiImplicitParam(name = "shopName", required = false, value = "供应商名称"),
             @ApiImplicitParam(name = "loginAccount", required = false, value = "登录账号"),
             @ApiImplicitParam(name = "loginAccount", required = false, value = "登录账号"),
             @ApiImplicitParam(name = "shopType", required = false, value = "供应商类型:1品牌方,2代理商"),
             @ApiImplicitParam(name = "shopType", required = false, value = "供应商类型:1品牌方,2代理商"),
@@ -48,14 +48,15 @@ public class ShopApi {
             @ApiImplicitParam(name = "mobile", required = false, value = "手机号"),
             @ApiImplicitParam(name = "mobile", required = false, value = "手机号"),
             @ApiImplicitParam(name = "linkMan", required = false, value = "联系人"),
             @ApiImplicitParam(name = "linkMan", required = false, value = "联系人"),
             @ApiImplicitParam(name = "lowerAuditStatus", required = false, value = "下级审核状态,0未完成审核,1已完成审核"),
             @ApiImplicitParam(name = "lowerAuditStatus", required = false, value = "下级审核状态,0未完成审核,1已完成审核"),
+            @ApiImplicitParam(name = "sendStatus", required = false, value = "寄送状态:0未寄送,1已寄送"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     })
     @GetMapping("/list")
     @GetMapping("/list")
-    public ResponseJson<PageInfo<ShopListVo>> getShopList(Integer listType, String shopName,String loginAccount, Integer shopType, Integer brandId, String mobile, String linkMan, Integer lowerAuditStatus,
+    public ResponseJson<PageInfo<ShopListVo>> getShopList(Integer listType, String shopName,String loginAccount, Integer shopType, Integer brandId, String mobile, String linkMan, Integer lowerAuditStatus, Integer sendStatus,
                                                           @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                           @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                           @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
                                                           @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return shopService.getShopList(listType, shopName, loginAccount, shopType, brandId, mobile, linkMan, lowerAuditStatus, pageNum, pageSize);
+        return shopService.getShopList(listType, shopName, loginAccount, shopType, brandId, mobile, linkMan, lowerAuditStatus, sendStatus, pageNum, pageSize);
     }
     }
 
 
     /**
     /**

+ 21 - 8
src/main/java/com/caimei/controller/wechat/LoginApi.java

@@ -8,6 +8,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,14 +24,14 @@ import org.springframework.web.bind.annotation.RestController;
 @Api(tags = "微信机构用户登录API")
 @Api(tags = "微信机构用户登录API")
 @RestController
 @RestController
 @RequiredArgsConstructor
 @RequiredArgsConstructor
-@RequestMapping("/wx/user")
+@RequestMapping("/wx/user/login")
 public class LoginApi {
 public class LoginApi {
 
 
     private final LoginService loginService;
     private final LoginService loginService;
 
 
     @ApiOperation("服务号授权登录")
     @ApiOperation("服务号授权登录")
     @ApiImplicitParam(name = "params", value = "code登录凭证;appId;", required = true)
     @ApiImplicitParam(name = "params", value = "code登录凭证;appId;", required = true)
-    @PostMapping("/login/authorization")
+    @PostMapping("/authorization")
     public ResponseJson<WxClubUserVo> authorizationLogin(@RequestBody String params) {
     public ResponseJson<WxClubUserVo> authorizationLogin(@RequestBody String params) {
         JSONObject parseObject = JSONObject.parseObject(params);
         JSONObject parseObject = JSONObject.parseObject(params);
         String code = parseObject.getString("code");
         String code = parseObject.getString("code");
@@ -51,7 +52,7 @@ public class LoginApi {
 
 
     @ApiOperation("服务号验证码登录")
     @ApiOperation("服务号验证码登录")
     @ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;invitationCode:邀请码;accessToken;openId;appId", required = true)
     @ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;invitationCode:邀请码;accessToken;openId;appId", required = true)
-    @PostMapping("/login/service/invitation/code")
+    @PostMapping("/service/invitation/code")
     public ResponseJson<WxClubUserVo> invitationCode(@RequestBody String params) throws Exception {
     public ResponseJson<WxClubUserVo> invitationCode(@RequestBody String params) throws Exception {
         JSONObject parseObject = JSONObject.parseObject(params);
         JSONObject parseObject = JSONObject.parseObject(params);
         String mobile = parseObject.getString("mobile");
         String mobile = parseObject.getString("mobile");
@@ -64,7 +65,7 @@ public class LoginApi {
 
 
     @ApiOperation("订阅号验证码登录")
     @ApiOperation("订阅号验证码登录")
     @ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;openId;appId", required = true)
     @ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;openId;appId", required = true)
-    @PostMapping("/login/subscribe/verify/code")
+    @PostMapping("/subscribe/verify/code")
     public ResponseJson<WxClubUserVo> loginByVerifyCode(@RequestBody String params){
     public ResponseJson<WxClubUserVo> loginByVerifyCode(@RequestBody String params){
         JSONObject parseObject = JSONObject.parseObject(params);
         JSONObject parseObject = JSONObject.parseObject(params);
         String mobile = parseObject.getString("mobile");
         String mobile = parseObject.getString("mobile");
@@ -73,9 +74,21 @@ public class LoginApi {
         return loginService.loginByVerifyCode(mobile, verifyCode, authUserId);
         return loginService.loginByVerifyCode(mobile, verifyCode, authUserId);
     }
     }
 
 
-    @ApiOperation("校验token是否失效")
-    @PostMapping("/token/check")
-    public ResponseJson checkToken(){
-        return ResponseJson.success("token有效");
+    @ApiOperation("密码登录")
+    @ApiImplicitParam(name = "params", value = "mobile:手机号;password:密码;authUserId:供应商用户id", required = true)
+    @PostMapping("/password")
+    public ResponseJson<WxClubUserVo> passwordLogin(@RequestBody String params) {
+        JSONObject parseObject = JSONObject.parseObject(params);
+        String mobile = parseObject.getString("mobile");
+        String password = parseObject.getString("password");
+        Integer authUserId = parseObject.getInteger("authUserId");
+        if (StringUtils.isEmpty(mobile) || StringUtils.isEmpty(password)) {
+            return ResponseJson.error("参数异常", null);
+        }
+        if (null == authUserId) {
+            return ResponseJson.error("供应商用户id不能为空", null);
+        }
+        return loginService.passwordLogin(mobile, password, authUserId);
     }
     }
+
 }
 }

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

@@ -0,0 +1,92 @@
+package com.caimei.controller.wechat;
+
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.WxClubUserVo;
+import com.caimei.service.wechat.RegisterService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.Map;
+
+
+/**
+ * 机构用户登录API
+ *
+ * @author : Aslee
+ * @date : 2021/5/11
+ */
+@Api(tags = "机构用户注册API")
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/wx/user/register")
+public class RegisterApi {
+
+    private final RegisterService registerService;
+
+    @ApiOperation("普通注册")
+    @ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;password:密码;authUserId:供应商用户id;authId:机构id", required = true)
+    @PostMapping("/simple")
+    public ResponseJson<WxClubUserVo> simpleRegister(@RequestBody String params) {
+        JSONObject parseObject = JSONObject.parseObject(params);
+        String mobile = parseObject.getString("mobile");
+        String verifyCode = parseObject.getString("verifyCode");
+        String password = parseObject.getString("password");
+        Integer authUserId = parseObject.getInteger("authUserId");
+        String authParty = parseObject.getString("authParty");
+        if (StringUtils.isEmpty(mobile)) {
+            return ResponseJson.error("手机号不能为空", null);
+        }
+        if (StringUtils.isEmpty(verifyCode)) {
+            return ResponseJson.error("验证码不能为空", null);
+        }
+        if (StringUtils.isEmpty(password)) {
+            return ResponseJson.error("密码不能为空", null);
+        }
+        if (null == authUserId) {
+            return ResponseJson.error("供应商用户id不能为空", null);
+        }
+        if (StringUtils.isEmpty(authParty)) {
+            return ResponseJson.error("机构名称不能为空", null);
+        }
+        return registerService.simpleRegister(mobile, verifyCode, password, authUserId, authParty);
+    }
+
+    @ApiOperation("全部注册")
+    @ApiImplicitParam(name = "params", value = "registerType:1机构用户注册,机构认证,3设备认证;" +
+            "authUserId:供应商用户id" +
+            "clubUserInfo:机构用户数据;" +
+            "clubInfo:机构数据;" +
+            "productInfo:设备数据", required = true)
+    @PostMapping("/all")
+    public ResponseJson allRegister(@RequestBody String params) {
+        JSONObject parseObject = JSONObject.parseObject(params);
+        // 注册类型,以逗号分割
+        String registerType = parseObject.getString("registerType");
+        if (StringUtils.isEmpty(registerType)) {
+            return ResponseJson.error("注册类型不能为空", null);
+        }
+        // 供应商用户id
+        Integer authUserId = parseObject.getInteger("authUserId");
+        if (null == authUserId) {
+            return ResponseJson.error("供应商用户id不能为空", null);
+        }
+        Integer clubUserId = parseObject.getInteger("clubUserId");
+        Integer authId = parseObject.getInteger("authId");
+        // 机构用户数据
+        String clubUserInfo = parseObject.getString("clubUserInfo");
+        // 认证机构数据
+        String authInfo = parseObject.getString("authInfo");
+        // 认证设备数据
+        String productInfo = parseObject.getString("productInfo");
+        if (null == productInfo) {
+            return ResponseJson.error("认证设备数据异常", null);
+        }
+        return registerService.allRegister(authUserId, clubUserId, authId, registerType, clubUserInfo, authInfo, productInfo);
+    }
+}

+ 99 - 0
src/main/java/com/caimei/controller/wechat/WxUserApi.java

@@ -0,0 +1,99 @@
+package com.caimei.controller.wechat;
+
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.WxClubUserVo;
+import com.caimei.service.wechat.RegisterService;
+import com.caimei.service.wechat.WxUserService;
+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;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+/**
+ * 机构用户登录API
+ *
+ * @author : Aslee
+ * @date : 2021/5/11
+ */
+@Api(tags = "机构用户API")
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/wx/user")
+public class WxUserApi {
+
+    private final WxUserService wxUserService;
+
+    @ApiOperation("获取用户信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mobile", required = true, value = "手机号"),
+            @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
+            @ApiImplicitParam(name = "clubUserId", required = false, value = "机构用户id")
+    })
+    @GetMapping("/info")
+    public ResponseJson<Map<String,Object>> register(String mobile, Integer authUserId, Integer clubUserId) {
+        if (StringUtils.isEmpty(mobile) && null == clubUserId) {
+            return ResponseJson.error("参数异常", null);
+        }
+        if (null == clubUserId && null == authUserId) {
+            return ResponseJson.error("供应商用户id不能为空", null);
+        }
+        return wxUserService.getUserInfo(mobile, authUserId, clubUserId);
+    }
+
+    @ApiOperation("登录注册验证码发送")
+    @ApiImplicitParam(name = "params", value = "mobile:手机号;authUserId:供应商用户id;type:1注册验证码,2忘记密码验证码")
+    @PostMapping("/login/code/send")
+    public ResponseJson sendForgetCode(@RequestBody String params) {
+        JSONObject parseObject = JSONObject.parseObject(params);
+        String mobile = parseObject.getString("mobile");
+        Integer authUserId = parseObject.getInteger("authUserId");
+        Integer type = parseObject.getInteger("type");
+        if (StringUtils.isEmpty(mobile)) {
+            return ResponseJson.error("手机号不能为空", null);
+        }
+        if (null == authUserId) {
+            return ResponseJson.error("供应商用户id不能为空", null);
+        }
+        if (null == type) {
+            return ResponseJson.error("验证码类型不能为空");
+        }
+        return wxUserService.sendLoginCode(mobile, authUserId, type);
+    }
+
+    @ApiOperation("修改密码")
+    @ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;password:新密码;authUserId:供应商用户id")
+    @PostMapping("/password/update")
+    public ResponseJson updatePassword(@RequestBody String params) {
+        JSONObject parseObject = JSONObject.parseObject(params);
+        String mobile = parseObject.getString("mobile");
+        String verifyCode = parseObject.getString("verifyCode");
+        String password = parseObject.getString("password");
+        Integer authUserId = parseObject.getInteger("authUserId");
+        if (StringUtils.isEmpty(mobile)) {
+            return ResponseJson.error("手机号不能为空", null);
+        }
+        if (StringUtils.isEmpty(verifyCode)) {
+            return ResponseJson.error("验证码不能为空", null);
+        }
+        if (StringUtils.isEmpty(password)) {
+            return ResponseJson.error("新密码不能为空", null);
+        }
+        if (null == authUserId) {
+            return ResponseJson.error("供应商用户id不能为空", null);
+        }
+        return wxUserService.updatePassword(mobile, verifyCode, password, authUserId);
+    }
+
+    @ApiOperation("校验token是否失效")
+    @PostMapping("/token/check")
+    public ResponseJson checkToken(){
+        return ResponseJson.success("token有效");
+    }
+}

+ 9 - 2
src/main/java/com/caimei/mapper/cmMapper/AuthMapper.java

@@ -3,6 +3,7 @@ package com.caimei.mapper.cmMapper;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.LdmDataPo;
 import com.caimei.model.po.LdmDataPo;
 import com.caimei.model.po.TownPo;
 import com.caimei.model.po.TownPo;
+import com.caimei.model.vo.AuthFormVo;
 import com.caimei.model.vo.AuthVo;
 import com.caimei.model.vo.AuthVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -19,7 +20,7 @@ import java.util.List;
 @Mapper
 @Mapper
 public interface AuthMapper {
 public interface AuthMapper {
 
 
-    List<AuthVo> getAuthList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus);
+    List<AuthVo> getAuthList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus);
 
 
     void updateAuthStatusByAuthId(@Param("authId") Integer authId, @Param("status") Integer status);
     void updateAuthStatusByAuthId(@Param("authId") Integer authId, @Param("status") Integer status);
 
 
@@ -35,7 +36,7 @@ public interface AuthMapper {
 
 
     Integer getClubStatus(Integer authId);
     Integer getClubStatus(Integer authId);
 
 
-    CmBrandAuthPo getAuthById(Integer authId);
+    AuthFormVo getAuthFormById(Integer authId);
 
 
     Integer getAuthIdByAuthParty(@Param("authParty") String authParty, @Param("authUserId") Integer authUserId);
     Integer getAuthIdByAuthParty(@Param("authParty") String authParty, @Param("authUserId") Integer authUserId);
 
 
@@ -70,4 +71,10 @@ public interface AuthMapper {
     List<TownPo> getTownList(String townName);
     List<TownPo> getTownList(String townName);
 
 
     Integer getProvinceIdByCityId(Integer cityId);
     Integer getProvinceIdByCityId(Integer cityId);
+
+    AuthFormVo getAuthByUserMobile(@Param("mobile") String userMobile, @Param("authUserId") Integer authUserId);
+
+    AuthVo getAuthById(Integer authId);
+
+    void updateAuthShopAuditStatus(@Param("authId") Integer authId, @Param("shopAuditStatus") Integer auditStatus, @Param("shopInvalidReason") String invalidReason, @Param("shopAuditTime") Date auditTime);
 }
 }

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

@@ -22,7 +22,7 @@ import java.util.List;
 @Mapper
 @Mapper
 public interface AuthProductMapper {
 public interface AuthProductMapper {
 
 
-    List<ProductListVo> getProductList(@Param("listType") Integer listType, @Param("authId") Integer authId, @Param("productName") String productName, @Param("snCode") String snCode, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus);
+    List<ProductListVo> getProductList(@Param("listType") Integer listType, @Param("authId") Integer authId, @Param("productName") String productName, @Param("snCode") String snCode, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("shopAuditStatus") Integer shopAuditStatus);
 
 
     void updateProductStatusByProductId(@Param("productId") Integer productId, @Param("status") Integer status);
     void updateProductStatusByProductId(@Param("productId") Integer productId, @Param("status") Integer status);
 
 
@@ -85,4 +85,6 @@ public interface AuthProductMapper {
     ProductTypePo getProductType(Integer productTypeId);
     ProductTypePo getProductType(Integer productTypeId);
 
 
     Integer getProductCountByTypeId(Integer productTypeId);
     Integer getProductCountByTypeId(Integer productTypeId);
+
+    void updateProductShopAuditStatus(@Param("productId") Integer productId, @Param("shopAuditStatus") Integer auditStatus, @Param("shopInvalidReason") String invalidReason, @Param("shopAuditTime") Date auditTime);
 }
 }

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

@@ -18,7 +18,7 @@ import java.util.List;
 public interface ClubMapper {
 public interface ClubMapper {
     List<ClubVo> getClubList(@Param("authUserId") Integer authUserId, @Param("clubName") String clubName);
     List<ClubVo> getClubList(@Param("authUserId") Integer authUserId, @Param("clubName") String clubName);
 
 
-    List<ClubUserVo> getClubUserList(@Param("authId") Integer authId, @Param("mobile") String mobile, String name, @Param("status") Integer status);
+    List<ClubUserVo> getClubUserList(@Param("authUserId") Integer authUserId, @Param("mobile") String mobile, String name, @Param("status") Integer status);
 
 
     void insertClubUser(ClubUserPo clubUser);
     void insertClubUser(ClubUserPo clubUser);
 
 
@@ -28,11 +28,19 @@ public interface ClubMapper {
 
 
     void insertFeedback(@Param("clubUserId") Integer clubUserId, @Param("content") String content);
     void insertFeedback(@Param("clubUserId") Integer clubUserId, @Param("content") String content);
 
 
-    WxClubUserVo getWxClubUser(@Param("mobile") String mobile, @Param("appId") String appId, @Param("authUserId") Integer authUserId, @Param("authId") Integer authId);
+    WxClubUserVo getWxClubUser(@Param("mobile") String mobile, @Param("appId") String appId, @Param("authUserId") Integer authUserId, @Param("authId") Integer authId, @Param("clubUserId") Integer clubUserId);
 
 
     WxClubDetailsVo getClubDetails(Integer authId);
     WxClubDetailsVo getClubDetails(Integer authId);
 
 
     void updateClubUser(ClubUserPo clubUser);
     void updateClubUser(ClubUserPo clubUser);
 
 
     void deleteClubUser(Integer clubUserId);
     void deleteClubUser(Integer clubUserId);
+
+    void updatePassword(@Param("mobile") String mobile, @Param("password") String password, @Param("authUserId") Integer authUserId);
+
+    void updateAuthId(@Param("clubUserId") Integer clubUserId, @Param("authId") Integer authId);
+
+    void updateStatus(@Param("clubUserId") Integer clubUserId, @Param("status") Integer status);
+
+    void updateClubUserPassword(@Param("clubUserId") Integer clubUserId, @Param("password") String md5Password);
 }
 }

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

@@ -18,7 +18,7 @@ import java.util.List;
 @Mapper
 @Mapper
 public interface ShopMapper {
 public interface ShopMapper {
 
 
-    List<ShopListVo> getShopList(@Param("listType") Integer listType, @Param("shopName") String shopName,@Param("loginAccount")  String loginAccount, @Param("shopType") Integer shopType, @Param("brandId") Integer brandId, @Param("mobile") String mobile, @Param("linkMan") String linkMan, @Param("lowerAuditStatus") Integer lowerAuditStatus);
+    List<ShopListVo> getShopList(@Param("listType") Integer listType, @Param("shopName") String shopName, @Param("loginAccount") String loginAccount, @Param("shopType") Integer shopType, @Param("brandId") Integer brandId, @Param("mobile") String mobile, @Param("linkMan") String linkMan, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("sendStatus") Integer sendStatus);
 
 
     void updateShopStatusByUserId(@Param("authUserId") Integer authUserId, @Param("status") Integer status);
     void updateShopStatusByUserId(@Param("authUserId") Integer authUserId, @Param("status") Integer status);
 
 

+ 6 - 0
src/main/java/com/caimei/model/dto/ProductSaveDto.java

@@ -50,6 +50,12 @@ public class ProductSaveDto {
     @ApiModelProperty("生成二维码授权牌模板:1左下,2右边,3左边")
     @ApiModelProperty("生成二维码授权牌模板:1左下,2右边,3左边")
     private Integer addTemplateType;
     private Integer addTemplateType;
 
 
+    @ApiModelProperty("购买渠道")
+    private String purchaseWay;
+
+    @ApiModelProperty("发票图片")
+    private String invoiceImage;
+
     @NotNull(message = "创建人id不能为空")
     @NotNull(message = "创建人id不能为空")
     @ApiModelProperty("创建人id")
     @ApiModelProperty("创建人id")
     private Integer createBy;
     private Integer createBy;

+ 15 - 0
src/main/java/com/caimei/model/po/ClubUserPo.java

@@ -16,6 +16,11 @@ public class ClubUserPo {
      */
      */
     private Integer id;
     private Integer id;
 
 
+    /**
+     * 供应商用户id
+     */
+    private Integer authUserId;
+
     /**
     /**
      * 机构id
      * 机构id
      */
      */
@@ -35,4 +40,14 @@ public class ClubUserPo {
      * 手机号
      * 手机号
      */
      */
     private String mobile;
     private String mobile;
+
+    /**
+     * 手机号
+     */
+    private String password;
+
+    /**
+     * 状态:0停用,1启用
+     */
+    private Integer status;
 }
 }

+ 30 - 0
src/main/java/com/caimei/model/po/CmBrandAuthPo.java

@@ -67,6 +67,31 @@ public class CmBrandAuthPo {
      */
      */
     private String mobile;
     private String mobile;
 
 
+    /**
+     * 对应机构用户手机号
+     */
+    private String userMobile;
+
+    /**
+     * 一级分类为医美=1,生美=2,项目公司=3,个人=4,其他=5
+     */
+    private Integer firstClubType;
+
+    /**
+     * 医美的二级分类为诊所=1、门诊=2、医院=3,其他=4。生美二级分类,美容院=5,养生馆=6,其他=7
+     */
+    private Integer secondClubType;
+
+    /**
+     * 医疗许可证图片
+     */
+    private String medicalLicenseImage;
+
+    /**
+     * 员工人数
+     */
+    private Integer empNum;
+
     /**
     /**
      * 机构logo
      * 机构logo
      */
      */
@@ -92,6 +117,11 @@ public class CmBrandAuthPo {
      */
      */
     private Integer auditStatus;
     private Integer auditStatus;
 
 
+    /**
+     * 供应商审核状态:0审核未通过,1审核通过,2待审核
+     */
+    private Integer shopAuditStatus;
+
     /**
     /**
      * 创建人Id
      * 创建人Id
      */
      */

+ 17 - 0
src/main/java/com/caimei/model/po/ProductPo.java

@@ -2,6 +2,8 @@ package com.caimei.model.po;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
+
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
 /**
 /**
@@ -82,6 +84,16 @@ public class ProductPo {
      */
      */
     private Integer addTemplateType;
     private Integer addTemplateType;
 
 
+    /**
+     * 购买渠道
+     */
+    private String purchaseWay;
+
+    /**
+     * 发票图片
+     */
+    private String invoiceImage;
+
     /**
     /**
      * 上线状态:0已下线,1已上线,2待上线
      * 上线状态:0已下线,1已上线,2待上线
      */
      */
@@ -92,6 +104,11 @@ public class ProductPo {
      */
      */
     private Integer auditStatus;
     private Integer auditStatus;
 
 
+    /**
+     * 供应商审核状态:0审核未通过,1审核通过,2待审核
+     */
+    private Integer shopAuditStatus;
+
     /**
     /**
      * 创建时间
      * 创建时间
      */
      */

+ 90 - 13
src/main/java/com/caimei/model/vo/AuthFormVo.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -14,42 +15,118 @@ import java.util.List;
  */
  */
 @Data
 @Data
 public class AuthFormVo implements Serializable {
 public class AuthFormVo implements Serializable {
-    @ApiModelProperty("授权机构id")
+    /**
+     * 授权机构id
+     */
     private Integer authId;
     private Integer authId;
 
 
-    @ApiModelProperty("授权机构")
+    /**
+     * 授权机构
+     */
     private String authParty;
     private String authParty;
 
 
-    @ApiModelProperty("省id")
+    /**
+     * 省id
+     */
     private Integer provinceId;
     private Integer provinceId;
 
 
-    @ApiModelProperty("市id")
+    /**
+     * 市id
+     */
     private Integer cityId;
     private Integer cityId;
 
 
-    @ApiModelProperty("区id")
+    /**
+     * 区id
+     */
     private Integer townId;
     private Integer townId;
 
 
-    @ApiModelProperty("区域")
+    /**
+     * 区域
+     */
     private String area;
     private String area;
 
 
-    @ApiModelProperty("详细地址")
+    /**
+     * 详细地址
+     */
     private String address;
     private String address;
 
 
-    @ApiModelProperty("经纬度")
+    /**
+     * 经纬度
+     */
     private String lngAndLat;
     private String lngAndLat;
 
 
-    @ApiModelProperty("联系方式")
+    /**
+     * 经度
+     */
+    private BigDecimal lng;
+
+    /**
+     * 纬度
+     */
+    private BigDecimal lat;
+
+    /**
+     * 联系方式
+     */
     private String mobile;
     private String mobile;
 
 
-    @ApiModelProperty("机构logo")
+    /**
+     * 对应机构用户手机号
+     */
+    private String userMobile;
+
+    /**
+     * 一级分类为医美=1,生美=2,项目公司=3,个人=4,其他=5
+     */
+    private Integer firstClubType;
+
+    /**
+     * 医美的二级分类为诊所=1、门诊=2、医院=3,其他=4。生美二级分类,美容院=5,养生馆=6,其他=7
+     */
+    private Integer secondClubType;
+
+    /**
+     * 医疗许可证图片
+     */
+    private String medicalLicenseImage;
+
+    /**
+     * 员工人数
+     */
+    private Integer empNum;
+
+    /**
+     * 机构logo
+     */
     private String logo;
     private String logo;
 
 
-    @ApiModelProperty("轮播图")
+    /**
+     * 轮播图
+     */
     private List<String> bannerList;
     private List<String> bannerList;
 
 
-    @ApiModelProperty("是否需要自定义属性:0否,1是")
+    /**
+     * 是否需要自定义属性:0否,1是
+     */
     private Integer customFlag;
     private Integer customFlag;
 
 
-    @ApiModelProperty("店铺备注")
+    /**
+     * 店铺备注
+     */
     private String remarks;
     private String remarks;
+
+    /**
+     * 审核状态:0审核未通过,1审核通过,2待审核
+     */
+    private Integer auditStatus;
+
+    /**
+     * 供应商审核状态:0审核未通过,1审核通过,2待审核
+     */
+    private Integer shopAuditStatus;
+
+    /**
+     * 供应商审核不通过原因
+     */
+    private Integer shopInvalidReason;
 }
 }

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

@@ -15,6 +15,9 @@ public class AuthVo {
     @ApiModelProperty("授权id")
     @ApiModelProperty("授权id")
     private Integer authId;
     private Integer authId;
 
 
+    @ApiModelProperty("供应商用户id")
+    private Integer authUserId;
+
     @ApiModelProperty("授权机构")
     @ApiModelProperty("授权机构")
     private String authParty;
     private String authParty;
 
 

+ 59 - 13
src/main/java/com/caimei/model/vo/ProductFormVo.java

@@ -14,42 +14,88 @@ import java.util.List;
  */
  */
 @Data
 @Data
 public class ProductFormVo {
 public class ProductFormVo {
-    @ApiModelProperty("商品id")
+    /**
+     * 商品id
+     */
     private Integer productId;
     private Integer productId;
 
 
-    @ApiModelProperty("授权id")
+    /**
+     * 授权id
+     */
     private Integer authId;
     private Integer authId;
 
 
-    @ApiModelProperty("品牌id")
+    /**
+     * 品牌id
+     */
     private Integer brandId;
     private Integer brandId;
 
 
-    @ApiModelProperty("品牌名称")
+    /**
+     * 品牌名称
+     */
     private String brandName;
     private String brandName;
 
 
-    @ApiModelProperty("设备分类id")
+    /**
+     * 设备分类id
+     */
     private Integer productTypeId;
     private Integer productTypeId;
 
 
-    @ApiModelProperty("商品名称")
+    /**
+     * 商品名称
+     */
     private String productName;
     private String productName;
 
 
-    @ApiModelProperty("商品SN码")
+    /**
+     * 商品SN码
+     */
     private String snCode;
     private String snCode;
 
 
-    @ApiModelProperty("商品图片")
+    /**
+     * 商品图片
+     */
     private String productImage;
     private String productImage;
 
 
-    @ApiModelProperty("授权牌照")
+    /**
+     * 授权牌照
+     */
     private String certificateImage;
     private String certificateImage;
 
 
-    @ApiModelProperty("原授权牌照")
+    /**
+     * 原授权牌照
+     */
     private String originalCertificateImage;
     private String originalCertificateImage;
 
 
-    @ApiModelProperty("是否生成二维码授权牌:0否,1是")
+    /**
+     * 是否生成二维码授权牌:0否,1是
+     */
     private Integer addQrCodeFlag;
     private Integer addQrCodeFlag;
 
 
-    @ApiModelProperty("生成二维码授权牌模板:1左下,2右边,3左边")
+    /**
+     * 生成二维码授权牌模板:1左下,2右边,3左边
+     */
     private Integer addTemplateType;
     private Integer addTemplateType;
 
 
-    @ApiModelProperty("商品参数列表")
+    /**
+     * 购买渠道
+     */
+    private String purchaseWay;
+
+    /**
+     * 发票图片
+     */
+    private String invoiceImage;
+
+    /**
+     * 商品参数列表
+     */
     private List<ProductParamPo> paramList;
     private List<ProductParamPo> paramList;
+
+    /**
+     * 供应商审核状态:0审核未通过,1审核通过,2待审核
+     */
+    private Integer shopAuditStatus;
+
+    /**
+     * 供应商审核不通过原因
+     */
+    private Integer shopInvalidReason;
 }
 }

+ 15 - 3
src/main/java/com/caimei/service/auth/AuthClubService.java

@@ -25,7 +25,7 @@ public interface AuthClubService {
 
 
     /**
     /**
      * 机构用户列表
      * 机构用户列表
-     * @param authId    机构id
+     * @param authUserId    供应商用户id
      * @param mobile    手机号
      * @param mobile    手机号
      * @param name
      * @param name
      * @param status    状态:1未绑定,2已绑定,3已过期
      * @param status    状态:1未绑定,2已绑定,3已过期
@@ -33,7 +33,7 @@ public interface AuthClubService {
      * @param pageSize  一页多少条
      * @param pageSize  一页多少条
      * @return  ClubUserVo
      * @return  ClubUserVo
      */
      */
-    ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authUserId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize);
 
 
     /**
     /**
      * 微信公众号机构列表
      * 微信公众号机构列表
@@ -73,10 +73,22 @@ public interface AuthClubService {
     /**
     /**
      * 添加/编辑机构用户
      * 添加/编辑机构用户
      */
      */
-    ResponseJson saveClubUser(Integer clubUserId, Integer authId, String name, String mobile);
+    ResponseJson saveClubUser(Integer clubUserId, Integer authUserId, String name, String mobile);
 
 
     /**
     /**
      * 删除机构用户
      * 删除机构用户
      */
      */
     ResponseJson deleteClubUser(Integer clubUserId);
     ResponseJson deleteClubUser(Integer clubUserId);
+
+    /**
+     * 更新用户状态
+     */
+    ResponseJson updateStatus(Integer clubUserId, Integer status);
+
+    /**
+     * 重置机构用户密码
+     * @param clubUserId
+     * @return
+     */
+    ResponseJson resetClubUserPassword(Integer clubUserId);
 }
 }

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

@@ -27,11 +27,12 @@ public interface AuthProductService {
      * @param snCode        商品SN码
      * @param snCode        商品SN码
      * @param status        上线状态:0下线,1上线,2待上线
      * @param status        上线状态:0下线,1上线,2待上线
      * @param auditStatus   审核状态:0审核未通过,1审核通过,2待审核
      * @param auditStatus   审核状态:0审核未通过,1审核通过,2待审核
+     * @param shopAuditStatus   供应商审核状态:0审核未通过,1审核通过,2待审核
      * @param pageNum       第几页
      * @param pageNum       第几页
      * @param pageSize      一页多少条
      * @param pageSize      一页多少条
      * @return  ProductListVo
      * @return  ProductListVo
      */
      */
-    ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName, String snCode, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName, String snCode, Integer status, Integer auditStatus, Integer shopAuditStatus, Integer pageNum, Integer pageSize);
 
 
     /**
     /**
      * 更新授权商品状态
      * 更新授权商品状态
@@ -50,6 +51,7 @@ public interface AuthProductService {
 
 
     /**
     /**
      * 添加/编辑授权商品
      * 添加/编辑授权商品
+     * @param source  来源:1供应商保存,2机构保存
      *
      *
      * @param productSaveDto {
      * @param productSaveDto {
      *                       productId              授权商品id
      *                       productId              授权商品id
@@ -64,7 +66,7 @@ public interface AuthProductService {
      *                       }
      *                       }
      * @return ResponseJson
      * @return ResponseJson
      */
      */
-    ResponseJson saveProduct(ProductSaveDto productSaveDto, boolean importFlag) throws IOException;
+    ResponseJson saveProduct(ProductSaveDto productSaveDto, boolean importFlag, Integer source) throws IOException;
 
 
     /**
     /**
      * 获取授权商品回显数据
      * 获取授权商品回显数据
@@ -93,9 +95,10 @@ public interface AuthProductService {
      * @param auditStatus       审核状态
      * @param auditStatus       审核状态
      * @param invalidReason     审核不通过原因
      * @param invalidReason     审核不通过原因
      * @param auditBy           审核人用户id
      * @param auditBy           审核人用户id
+     * @param source
      * @return ResponseJson
      * @return ResponseJson
      */
      */
-    ResponseJson auditProduct(Integer productId, Integer auditStatus, String invalidReason, Integer auditBy);
+    ResponseJson auditProduct(Integer productId, Integer auditStatus, String invalidReason, Integer auditBy, Integer source);
 
 
 
 
     /**
     /**

+ 14 - 11
src/main/java/com/caimei/service/auth/AuthService.java

@@ -21,17 +21,18 @@ public interface AuthService {
     /**
     /**
      * 授权列表
      * 授权列表
      *
      *
-     * @param listType   列表类型:1授权列表,2授权审核列表
-     * @param authUserId 供应商用户id
-     * @param authParty  授权机构
-     * @param status    上线状态:0已下线,1已上线,2待上线
-     * @param auditStatus  审核状态:0审核未通过,1审核通过,2待审核
-     * @param lowerAuditStatus  商品信息审核状态:0未完成审核,1已完成审核
-     * @param pageNum    第几页
-     * @param pageSize   一页多少条
+     * @param listType             列表类型:1授权列表,2授权审核列表
+     * @param authUserId           供应商用户id
+     * @param authParty            授权机构
+     * @param status               上线状态:0已下线,1已上线,2待上线
+     * @param auditStatus          审核状态:0审核未通过,1审核通过,2待审核
+     * @param lowerAuditStatus     商品信息审核状态:0未完成审核,1已完成审核
+     * @param shopAuditStatus      供应商审核状态:0审核未通过,1审核通过,2待审核
+     * @param pageNum              第几页
+     * @param pageSize             一页多少条
      * @return AuthVo
      * @return AuthVo
      */
      */
-    ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, Integer status, Integer auditStatus, Integer lowerAuditStatus, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, Integer status, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer pageNum, Integer pageSize);
 
 
     /**
     /**
      * 更新授权状态
      * 更新授权状态
@@ -54,9 +55,10 @@ public interface AuthService {
      *
      *
      * @param auth       授权机构
      * @param auth       授权机构
      * @param bannerList 轮播图列表
      * @param bannerList 轮播图列表
+     * @param source     来源:1供应商保存,2机构保存
      * @return ResponseJson
      * @return ResponseJson
      */
      */
-    ResponseJson saveAuth(CmBrandAuthPo auth, List<String> bannerList, boolean importFlag);
+    ResponseJson saveAuth(CmBrandAuthPo auth, List<String> bannerList, boolean importFlag, Integer source);
 
 
     /**
     /**
      * 审核品牌授权
      * 审核品牌授权
@@ -65,9 +67,10 @@ public interface AuthService {
      * @param auditStatus       审核状态
      * @param auditStatus       审核状态
      * @param invalidReason     审核不通过原因
      * @param invalidReason     审核不通过原因
      * @param auditBy           审核人用户id
      * @param auditBy           审核人用户id
+     * @param source
      * @return ResponseJson
      * @return ResponseJson
      */
      */
-    ResponseJson auditAuth(Integer authId, Integer auditStatus, String invalidReason, Integer auditBy);
+    ResponseJson auditAuth(Integer authId, Integer auditStatus, String invalidReason, Integer auditBy, Integer source);
 
 
     /**
     /**
      * 导入excel中的授权机构和商品数据
      * 导入excel中的授权机构和商品数据

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

@@ -31,7 +31,7 @@ public interface ShopService {
      * @param pageSize  一页多少条
      * @param pageSize  一页多少条
      * @return PageInfo<ShopVo>
      * @return PageInfo<ShopVo>
      */
      */
-    ResponseJson<PageInfo<ShopListVo>> getShopList(Integer listType, String shopName, String loginAccount, Integer shopType, Integer brandId, String mobile, String linkMan, Integer lowerAuditStatus, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<ShopListVo>> getShopList(Integer listType, String shopName, String loginAccount, Integer shopType, Integer brandId, String mobile, String linkMan, Integer lowerAuditStatus, Integer sendStatus, Integer pageNum, Integer pageSize);
 
 
     /**
     /**
      * 更新供应商状态
      * 更新供应商状态

+ 39 - 7
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -5,7 +5,10 @@ import com.caimei.model.ResponseJson;
 import com.caimei.model.po.ClubUserPo;
 import com.caimei.model.po.ClubUserPo;
 import com.caimei.model.vo.*;
 import com.caimei.model.vo.*;
 import com.caimei.service.auth.AuthClubService;
 import com.caimei.service.auth.AuthClubService;
+import com.caimei.utils.AliyunSmsUtil;
 import com.caimei.utils.CodeUtil;
 import com.caimei.utils.CodeUtil;
+import com.caimei.utils.Md5Util;
+import com.caimei.utils.SmsUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -52,12 +55,12 @@ public class AuthClubServiceImpl implements AuthClubService {
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize) {
-        if (null == authId) {
-            return ResponseJson.error("参数异常,请输入授权机构id", null);
+    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authUserId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize) {
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id", null);
         }
         }
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
-        List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authId, mobile, name, status);
+        List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authUserId, mobile, name, status);
         PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
         PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }
@@ -132,21 +135,22 @@ public class AuthClubServiceImpl implements AuthClubService {
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson saveClubUser(Integer clubUserId, Integer authId, String name, String mobile) {
+    public ResponseJson saveClubUser(Integer clubUserId, Integer authUserId, String name, String mobile) {
         // 是否为添加操作
         // 是否为添加操作
         boolean insertFlag = null == clubUserId;
         boolean insertFlag = null == clubUserId;
         // 构建机构用户
         // 构建机构用户
         ClubUserPo clubUser = new ClubUserPo();
         ClubUserPo clubUser = new ClubUserPo();
-        clubUser.setAuthId(authId);
+        clubUser.setAuthUserId(authUserId);
         clubUser.setName(name);
         clubUser.setName(name);
         clubUser.setMobile(mobile);
         clubUser.setMobile(mobile);
         if (insertFlag) {
         if (insertFlag) {
             // 根据手机号校验该机构下是否已添加该机构用户
             // 根据手机号校验该机构下是否已添加该机构用户
-            WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, null, null, authId);
+            WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
             if (null != wxClubUser) {
             if (null != wxClubUser) {
                 return ResponseJson.error("该用户已存在,请勿重复添加");
                 return ResponseJson.error("该用户已存在,请勿重复添加");
             }
             }
             clubUser.setAddTime(new Date());
             clubUser.setAddTime(new Date());
+            clubUser.setPassword("rzt123456");
             clubMapper.insertClubUser(clubUser);
             clubMapper.insertClubUser(clubUser);
         } else {
         } else {
             clubUser.setId(clubUserId);
             clubUser.setId(clubUserId);
@@ -160,4 +164,32 @@ public class AuthClubServiceImpl implements AuthClubService {
         clubMapper.deleteClubUser(clubUserId);
         clubMapper.deleteClubUser(clubUserId);
         return ResponseJson.success("删除机构用户成功");
         return ResponseJson.success("删除机构用户成功");
     }
     }
+
+    @Override
+    public ResponseJson updateStatus(Integer clubUserId, Integer status) {
+        clubMapper.updateStatus(clubUserId, status);
+        return ResponseJson.success("修改成功");
+    }
+
+    @Override
+    public ResponseJson resetClubUserPassword(Integer clubUserId) {
+        if (clubUserId == null) {
+            return ResponseJson.error("请输入机构用户id");
+        }
+        String newPassword = "rzt123456";
+        String md5Password = Md5Util.md5(newPassword);
+        clubMapper.updateClubUserPassword(clubUserId, md5Password);
+        WxClubUserVo clubUser = clubMapper.getWxClubUser(null, null, null, null, clubUserId);
+        String mobile = clubUser.getMobile();
+        String content = "您认证通登录密码为:" + newPassword;
+        Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
+        if (!sendSms) {
+            log.info("机构用户重置密码发送失败,手机号:" + mobile);
+            return ResponseJson.error("发送失败,请确认手机号无误");
+        } else {
+            log.info("机构用户重置密码发送成功,手机号:" + mobile);
+
+        }
+        return ResponseJson.success("密码重置成功");
+    }
 }
 }

+ 20 - 5
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -72,13 +72,15 @@ public class AuthProductServiceImpl implements AuthProductService {
     private String bucketName = "caimei-oss";
     private String bucketName = "caimei-oss";
 
 
     @Override
     @Override
-    public ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName, String snCode, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName,
+                                                                String snCode, Integer status, Integer auditStatus,
+                                                                Integer shopAuditStatus, Integer pageNum, Integer pageSize) {
         if (null == authId) {
         if (null == authId) {
             return ResponseJson.error("参数异常,请输入授权id", null);
             return ResponseJson.error("参数异常,请输入授权id", null);
         }
         }
         listType = null == listType ? 1 : listType;
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
-        List<ProductListVo> productList = authProductMapper.getProductList(listType, authId, productName, snCode, status, auditStatus);
+        List<ProductListVo> productList = authProductMapper.getProductList(listType, authId, productName, snCode, status, auditStatus, shopAuditStatus);
         PageInfo<ProductListVo> pageData = new PageInfo<>(productList);
         PageInfo<ProductListVo> pageData = new PageInfo<>(productList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }
@@ -114,7 +116,7 @@ public class AuthProductServiceImpl implements AuthProductService {
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson saveProduct(ProductSaveDto productSaveDto, boolean importFlag) throws IOException {
+    public ResponseJson saveProduct(ProductSaveDto productSaveDto, boolean importFlag, Integer source) throws IOException {
         Integer productId = productSaveDto.getProductId();
         Integer productId = productSaveDto.getProductId();
         Integer authId = productSaveDto.getAuthId();
         Integer authId = productSaveDto.getAuthId();
         Integer brandId = productSaveDto.getBrandId();
         Integer brandId = productSaveDto.getBrandId();
@@ -124,6 +126,8 @@ public class AuthProductServiceImpl implements AuthProductService {
         Integer addQrCodeFlag = productSaveDto.getAddQrCodeFlag();
         Integer addQrCodeFlag = productSaveDto.getAddQrCodeFlag();
         Integer addTemplateType = productSaveDto.getAddTemplateType();
         Integer addTemplateType = productSaveDto.getAddTemplateType();
         Integer createBy = productSaveDto.getCreateBy();
         Integer createBy = productSaveDto.getCreateBy();
+        String purchaseWay = productSaveDto.getPurchaseWay();
+        String invoiceImage = productSaveDto.getInvoiceImage();
         List<ProductParamPo> paramList = productSaveDto.getParamList();
         List<ProductParamPo> paramList = productSaveDto.getParamList();
         if (null == authId) {
         if (null == authId) {
             return ResponseJson.error("参数异常,请输入授权id", null);
             return ResponseJson.error("参数异常,请输入授权id", null);
@@ -173,9 +177,14 @@ public class AuthProductServiceImpl implements AuthProductService {
         product.setCertificateImage(certificateImage);
         product.setCertificateImage(certificateImage);
         product.setAddQrCodeFlag(addQrCodeFlag);
         product.setAddQrCodeFlag(addQrCodeFlag);
         product.setAddTemplateType(addTemplateType);
         product.setAddTemplateType(addTemplateType);
+        // 购买渠道
+        product.setPurchaseWay(purchaseWay);
+        // 发票图片
+        product.setInvoiceImage(invoiceImage);
         // 商品信息保存后,上线状态默认为“待上线”,审核状态为“待审核”
         // 商品信息保存后,上线状态默认为“待上线”,审核状态为“待审核”
         product.setStatus(2);
         product.setStatus(2);
         product.setAuditStatus(2);
         product.setAuditStatus(2);
+        product.setShopAuditStatus(1 == source ? 1 : 2);
         if (insertFlag) {
         if (insertFlag) {
             // 原授权牌照
             // 原授权牌照
             product.setOriginalCertificateImage(product.getCertificateImage());
             product.setOriginalCertificateImage(product.getCertificateImage());
@@ -368,7 +377,7 @@ public class AuthProductServiceImpl implements AuthProductService {
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson auditProduct(Integer productId, Integer auditStatus, String invalidReason, Integer auditBy) {
+    public ResponseJson auditProduct(Integer productId, Integer auditStatus, String invalidReason, Integer auditBy, Integer source) {
         if (productId == null) {
         if (productId == null) {
             return ResponseJson.error("请输入商品id");
             return ResponseJson.error("请输入商品id");
         }
         }
@@ -381,12 +390,18 @@ public class AuthProductServiceImpl implements AuthProductService {
         if (auditBy == null) {
         if (auditBy == null) {
             return ResponseJson.error("请输入审核人用户id");
             return ResponseJson.error("请输入审核人用户id");
         }
         }
+        source = null == source ? 1 : source;
         Date auditTime = new Date();
         Date auditTime = new Date();
         int status = 0;
         int status = 0;
         if (1 == auditStatus) {
         if (1 == auditStatus) {
             status = 1;
             status = 1;
         }
         }
-        authProductMapper.updateProductAuditStatus(productId, status, auditStatus, invalidReason, auditBy, auditTime);
+        if (1 == source) {
+            authProductMapper.updateProductAuditStatus(productId, status, auditStatus, invalidReason, auditBy, auditTime);
+        }
+        if (2 == source) {
+            authProductMapper.updateProductShopAuditStatus(productId, auditStatus, invalidReason, auditTime);
+        }
         return ResponseJson.success("审核商品成功");
         return ResponseJson.success("审核商品成功");
     }
     }
 
 

+ 35 - 16
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -92,13 +92,16 @@ public class AuthServiceImpl implements AuthService {
     private FastFileStorageClient storageClient;
     private FastFileStorageClient storageClient;
 
 
     @Override
     @Override
-    public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, Integer status, Integer auditStatus, Integer lowerAuditStatus, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
+                                                      Integer status, Integer auditStatus, Integer lowerAuditStatus,
+                                                      Integer shopAuditStatus,
+                                                      Integer pageNum, Integer pageSize) {
         if (null == authUserId) {
         if (null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id", null);
             return ResponseJson.error("参数异常,请输入供应商用户id", null);
         }
         }
         listType = null == listType ? 1 : listType;
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
-        List<AuthVo> authList = authMapper.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus);
+        List<AuthVo> authList = authMapper.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus, shopAuditStatus);
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }
@@ -143,12 +146,9 @@ public class AuthServiceImpl implements AuthService {
         if (null == authId) {
         if (null == authId) {
             return ResponseJson.error("参数异常,机构id不能为空", null);
             return ResponseJson.error("参数异常,机构id不能为空", null);
         }
         }
-        CmBrandAuthPo auth = authMapper.getAuthById(authId);
-        AuthFormVo authFormVo = new AuthFormVo();
-        authFormVo.setAuthId(auth.getId());
-        BeanUtils.copyProperties(auth, authFormVo);
-        if (null != auth.getLng()) {
-            authFormVo.setLngAndLat(auth.getLng() + "," + auth.getLat());
+        AuthFormVo authFormVo = authMapper.getAuthFormById(authId);
+        if (null != authFormVo.getLng()) {
+            authFormVo.setLngAndLat(authFormVo.getLng() + "," + authFormVo.getLat());
         }
         }
         List<String> bannerList = authMapper.getBannerList(authId);
         List<String> bannerList = authMapper.getBannerList(authId);
         authFormVo.setBannerList(bannerList);
         authFormVo.setBannerList(bannerList);
@@ -157,12 +157,12 @@ public class AuthServiceImpl implements AuthService {
 
 
     @Override
     @Override
     public ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId) {
     public ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId) {
-        List<AuthVo> authList = authMapper.getAuthList(1, authUserId, null, null, null, null);
+        List<AuthVo> authList = authMapper.getAuthList(1, authUserId, null, null, null, null, null);
         return ResponseJson.success(authList);
         return ResponseJson.success(authList);
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson saveAuth(CmBrandAuthPo auth, List<String> bannerList, boolean importFlag) {
+    public ResponseJson saveAuth(CmBrandAuthPo auth, List<String> bannerList, boolean importFlag, Integer source) {
         Integer authId = auth.getId();
         Integer authId = auth.getId();
         Integer authUserId = auth.getAuthUserId();
         Integer authUserId = auth.getAuthUserId();
         String authParty = auth.getAuthParty();
         String authParty = auth.getAuthParty();
@@ -174,7 +174,19 @@ public class AuthServiceImpl implements AuthService {
         }
         }
         Integer authIdByAuthParty = authMapper.getAuthIdByAuthParty(authParty, authUserId);
         Integer authIdByAuthParty = authMapper.getAuthIdByAuthParty(authParty, authUserId);
         if (null != authIdByAuthParty && !authIdByAuthParty.equals(authId)) {
         if (null != authIdByAuthParty && !authIdByAuthParty.equals(authId)) {
-            return ResponseJson.error("参数异常,该授权机构已存在,请重新输入", null);
+            return ResponseJson.error("参数异常,该授权机构已存在,请重新输入");
+        }
+        if (null == auth.getFirstClubType()) {
+            return ResponseJson.error("请勾选机构类型");
+        }
+        if ((1 == auth.getFirstClubType() || 2 == auth.getFirstClubType()) && null == auth.getSecondClubType()) {
+            return ResponseJson.error("请勾选二级机构类型");
+        }
+        if (1 == auth.getFirstClubType() && StringUtils.isEmpty(auth.getMedicalLicenseImage())) {
+            return ResponseJson.error("请上传医疗许可证");
+        }
+        if (null == auth.getEmpNum()) {
+            return ResponseJson.error("请输入员工人数");
         }
         }
         if (null == auth.getCreateBy()) {
         if (null == auth.getCreateBy()) {
             return ResponseJson.error("参数异常,请输入创建人id");
             return ResponseJson.error("参数异常,请输入创建人id");
@@ -194,6 +206,7 @@ public class AuthServiceImpl implements AuthService {
         auth.setStatus(2);
         auth.setStatus(2);
         auth.setAuditStatus(2);
         auth.setAuditStatus(2);
         auth.setDelFlag(0);
         auth.setDelFlag(0);
+        auth.setShopAuditStatus(1 == source ? 1 : 2);
         /*
         /*
             保存授权
             保存授权
          */
          */
@@ -206,13 +219,13 @@ public class AuthServiceImpl implements AuthService {
         }
         }
         // 保存轮播图
         // 保存轮播图
         if (null != bannerList) {
         if (null != bannerList) {
-            bannerList.forEach(banner-> authMapper.insertBanner(auth.getId(), banner));
+            bannerList.forEach(banner -> authMapper.insertBanner(auth.getId(), banner));
         }
         }
         return ResponseJson.success("保存品牌授权成功", auth);
         return ResponseJson.success("保存品牌授权成功", auth);
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson auditAuth(Integer authId, Integer auditStatus, String invalidReason, Integer auditBy) {
+    public ResponseJson auditAuth(Integer authId, Integer auditStatus, String invalidReason, Integer auditBy, Integer source) {
         if (authId == null) {
         if (authId == null) {
             return ResponseJson.error("请输入授权id");
             return ResponseJson.error("请输入授权id");
         }
         }
@@ -225,6 +238,7 @@ public class AuthServiceImpl implements AuthService {
         if (auditBy == null) {
         if (auditBy == null) {
             return ResponseJson.error("请输入审核人用户id");
             return ResponseJson.error("请输入审核人用户id");
         }
         }
+        source = null == source ? 1 : source;
         Date auditTime = new Date();
         Date auditTime = new Date();
         // 授权状态更新
         // 授权状态更新
         Integer status = null;
         Integer status = null;
@@ -235,7 +249,12 @@ public class AuthServiceImpl implements AuthService {
             // 审核通过,上线授权
             // 审核通过,上线授权
             status = 1;
             status = 1;
         }
         }
-        authMapper.updateAuthAuditStatus(authId, status, auditStatus, invalidReason, auditBy, auditTime);
+        if (1 == source) {
+            authMapper.updateAuthAuditStatus(authId, status, auditStatus, invalidReason, auditBy, auditTime);
+        }
+        if (2 == source) {
+            authMapper.updateAuthShopAuditStatus(authId, auditStatus, invalidReason, auditTime);
+        }
         return ResponseJson.success("审核品牌授权成功");
         return ResponseJson.success("审核品牌授权成功");
     }
     }
 
 
@@ -581,7 +600,7 @@ public class AuthServiceImpl implements AuthService {
                 auth.setAuthUserId(authUserId);
                 auth.setAuthUserId(authUserId);
                 auth.setAuthParty(authParty);
                 auth.setAuthParty(authParty);
                 auth.setCreateBy(createBy);
                 auth.setCreateBy(createBy);
-                ResponseJson responseJson = saveAuth(auth, null, true);
+                ResponseJson responseJson = saveAuth(auth, null, true, 1);
                 CmBrandAuthPo authPo = (CmBrandAuthPo) responseJson.getData();
                 CmBrandAuthPo authPo = (CmBrandAuthPo) responseJson.getData();
                 authId = authPo.getId();
                 authId = authPo.getId();
             }
             }
@@ -595,7 +614,7 @@ public class AuthServiceImpl implements AuthService {
                     String certificateImage = productDto.getCertificateImage();
                     String certificateImage = productDto.getCertificateImage();
                     productDto.setProductImage(productImage);
                     productDto.setProductImage(productImage);
                     productDto.setCertificateImage(certificateImage);
                     productDto.setCertificateImage(certificateImage);
-                    authProductService.saveProduct(productDto, true);
+                    authProductService.saveProduct(productDto, true, 1);
                 } catch (IOException e) {
                 } catch (IOException e) {
                     e.printStackTrace();
                     e.printStackTrace();
                 }
                 }

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

@@ -49,10 +49,10 @@ public class ShopServiceImpl implements ShopService {
     private String active;
     private String active;
 
 
     @Override
     @Override
-    public ResponseJson<PageInfo<ShopListVo>> getShopList(Integer listType, String shopName, String loginAccount, Integer shopType, Integer brandId, String mobile, String linkMan, Integer lowerAuditStatus, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<ShopListVo>> getShopList(Integer listType, String shopName, String loginAccount, Integer shopType, Integer brandId, String mobile, String linkMan, Integer lowerAuditStatus, Integer sendStatus, Integer pageNum, Integer pageSize) {
         listType = null == listType ? 1 : listType;
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
-        List<ShopListVo> shopList = shopMapper.getShopList(listType, shopName, loginAccount, shopType, brandId, mobile, linkMan, lowerAuditStatus);
+        List<ShopListVo> shopList = shopMapper.getShopList(listType, shopName, loginAccount, shopType, brandId, mobile, linkMan, lowerAuditStatus, sendStatus);
         ListIterator<ShopListVo> iterator = shopList.listIterator();
         ListIterator<ShopListVo> iterator = shopList.listIterator();
         while (iterator.hasNext()) {
         while (iterator.hasNext()) {
             // 根据是否完成商品信息审核筛选项,设置下级审核状态
             // 根据是否完成商品信息审核筛选项,设置下级审核状态

+ 11 - 2
src/main/java/com/caimei/service/wechat/LoginService.java

@@ -37,8 +37,17 @@ public interface LoginService {
      * 订阅号验证码登录
      * 订阅号验证码登录
      * @param mobile        手机号
      * @param mobile        手机号
      * @param verifyCode    验证码
      * @param verifyCode    验证码
-     * @param appId         公众号appId
+     * @param authUserId    供应商用户id
      * @return
      * @return
      */
      */
     ResponseJson<WxClubUserVo> loginByVerifyCode(String mobile, String verifyCode, Integer authUserId);
     ResponseJson<WxClubUserVo> loginByVerifyCode(String mobile, String verifyCode, Integer authUserId);
- }
+
+    /**
+     * 密码登录
+     * @param mobile
+     * @param password
+     * @param authUserId
+     * @return
+     */
+    ResponseJson<WxClubUserVo> passwordLogin(String mobile, String password, Integer authUserId);
+}

+ 23 - 0
src/main/java/com/caimei/service/wechat/RegisterService.java

@@ -0,0 +1,23 @@
+package com.caimei.service.wechat;
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.WxClubUserVo;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/15
+ */
+public interface RegisterService {
+
+    /**
+     * 普通注册
+     */
+    ResponseJson<WxClubUserVo> simpleRegister(String mobile, String verifyCode, String password, Integer authUserId, String authParty);
+
+    /**
+     * 全部注册
+     */
+    ResponseJson allRegister(Integer authUserId, Integer clubUserId, Integer authId, String registerType, String clubUserInfo, String authInfo, String productInfo);
+}

+ 35 - 0
src/main/java/com/caimei/service/wechat/WxUserService.java

@@ -0,0 +1,35 @@
+package com.caimei.service.wechat;
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.WxClubUserVo;
+
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/15
+ */
+public interface WxUserService {
+
+    /**
+     * 获取用户信息
+     *
+     * @param mobile
+     * @param authUserId
+     * @return
+     */
+    ResponseJson<Map<String, Object>> getUserInfo(String mobile, Integer authUserId, Integer clubUserId);
+
+
+    /**
+     * 发送验证码
+     */
+    ResponseJson sendLoginCode(String mobile, Integer authUserId, Integer type);
+
+    /**
+     * 修改密码
+     */
+    ResponseJson updatePassword(String mobile, String verifyCode, String password, Integer authUserId);
+}

+ 41 - 13
src/main/java/com/caimei/service/wechat/impl/LoginServiceImpl.java

@@ -7,12 +7,11 @@ import com.caimei.mapper.cmMapper.LoginMapper;
 import com.caimei.mapper.cmMapper.ShopMapper;
 import com.caimei.mapper.cmMapper.ShopMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.CmBrandAuthPo;
+import com.caimei.model.vo.AuthVo;
 import com.caimei.model.vo.ShopFormVo;
 import com.caimei.model.vo.ShopFormVo;
 import com.caimei.model.vo.WxClubUserVo;
 import com.caimei.model.vo.WxClubUserVo;
 import com.caimei.service.wechat.LoginService;
 import com.caimei.service.wechat.LoginService;
-import com.caimei.utils.CodeUtil;
-import com.caimei.utils.SmsUtils;
-import com.caimei.utils.WxUtils;
+import com.caimei.utils.*;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -139,18 +138,18 @@ public class LoginServiceImpl implements LoginService {
             return ResponseJson.error("验证码错误,请重新输入", null);
             return ResponseJson.error("验证码错误,请重新输入", null);
         }
         }
         // 校验机构用户是否存在
         // 校验机构用户是否存在
-        WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, appId, null, null);
+        WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, appId, null, null, null);
         if (null == wxClubUser) {
         if (null == wxClubUser) {
             return ResponseJson.error("抱歉,您的手机号暂无权限登录", null);
             return ResponseJson.error("抱歉,您的手机号暂无权限登录", null);
         }
         }
         // 校验机构和供应商的状态是否为已上线
         // 校验机构和供应商的状态是否为已上线
-        CmBrandAuthPo clubPo = authMapper.getAuthById(wxClubUser.getAuthId());
-        Integer shopStatus = shopMapper.getShopStatus(clubPo.getAuthUserId());
-        if (1 != clubPo.getStatus() || 1 != shopStatus) {
+        AuthVo auth = authMapper.getAuthById(wxClubUser.getAuthId());
+        Integer shopStatus = shopMapper.getShopStatus(auth.getAuthUserId());
+        if (1 != auth.getStatus() || 1 != shopStatus) {
             return ResponseJson.error("登录失败", null);
             return ResponseJson.error("登录失败", null);
         }
         }
         // 校验appId是否和机构所属供应商的appId相同
         // 校验appId是否和机构所属供应商的appId相同
-        String dbAppId = shopMapper.getAppId(clubPo.getAuthUserId());
+        String dbAppId = shopMapper.getAppId(auth.getAuthUserId());
         if (StringUtils.isEmpty(dbAppId) || !appId.equals(dbAppId)) {
         if (StringUtils.isEmpty(dbAppId) || !appId.equals(dbAppId)) {
             return ResponseJson.error("登录失败", null);
             return ResponseJson.error("登录失败", null);
         }
         }
@@ -160,7 +159,7 @@ public class LoginServiceImpl implements LoginService {
         WxClubUserVo clubUser = new WxClubUserVo();
         WxClubUserVo clubUser = new WxClubUserVo();
         clubUser.setClubUserId(wxClubUser.getClubUserId());
         clubUser.setClubUserId(wxClubUser.getClubUserId());
         clubUser.setAuthId(wxClubUser.getAuthId());
         clubUser.setAuthId(wxClubUser.getAuthId());
-        clubUser.setAuthUserId(clubPo.getAuthUserId());
+        clubUser.setAuthUserId(auth.getAuthUserId());
         clubUser.setMobile(mobile);
         clubUser.setMobile(mobile);
         clubUser.setOpenId(openId);
         clubUser.setOpenId(openId);
         clubUser.setAccessToken(accessToken);
         clubUser.setAccessToken(accessToken);
@@ -186,16 +185,16 @@ public class LoginServiceImpl implements LoginService {
             return ResponseJson.error("验证码错误,请重新输入", null);
             return ResponseJson.error("验证码错误,请重新输入", null);
         }
         }
         // 获取手机号对应机构用户
         // 获取手机号对应机构用户
-        WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null);
+        WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
         if (null == clubUser) {
         if (null == clubUser) {
             clubUser = new WxClubUserVo();
             clubUser = new WxClubUserVo();
             clubUser.setMobile(mobile);
             clubUser.setMobile(mobile);
             return ResponseJson.error("抱歉,您的手机号暂无权限登录", clubUser);
             return ResponseJson.error("抱歉,您的手机号暂无权限登录", clubUser);
         }
         }
         // 校验机构和供应商的状态是否为已上线
         // 校验机构和供应商的状态是否为已上线
-        CmBrandAuthPo clubPo = authMapper.getAuthById(clubUser.getAuthId());
-        Integer shopStatus = shopMapper.getShopStatus(clubPo.getAuthUserId());
-        if (1 != clubPo.getStatus() || 1 != shopStatus) {
+        AuthVo auth = authMapper.getAuthById(clubUser.getAuthId());
+        Integer shopStatus = shopMapper.getShopStatus(auth.getAuthUserId());
+        if (1 != auth.getStatus() || 1 != shopStatus) {
             return ResponseJson.error("登录失败", null);
             return ResponseJson.error("登录失败", null);
         }
         }
         // 登录成功redis保存token
         // 登录成功redis保存token
@@ -204,4 +203,33 @@ public class LoginServiceImpl implements LoginService {
         clubUser.setAccessToken(accessToken);
         clubUser.setAccessToken(accessToken);
         return ResponseJson.success(clubUser);
         return ResponseJson.success(clubUser);
     }
     }
+
+    @Override
+    public ResponseJson<WxClubUserVo> passwordLogin(String mobile, String password, Integer authUserId) {
+        // 获取手机号对应机构用户
+        WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
+        Boolean passwordVerify;
+        if (null == clubUser) {
+            return ResponseJson.error("用户不存在", null);
+        } else {
+            // 比对密码
+            passwordVerify = passwordVerify(password, password);
+            if (passwordVerify) {
+                // 登录成功redis保存token
+                String accessToken = UUID.randomUUID().toString();
+                redisService.set(accessToken, mobile + "," + authUserId, 60L * 60 * 24);
+                clubUser.setAccessToken(accessToken);
+                return ResponseJson.success(clubUser);
+            }
+        }
+        return ResponseJson.error("输入的密码和账户名不匹配", null);
+    }
+
+    /**
+     * 密码校验
+     */
+    private Boolean passwordVerify(String password, String dbPassword) {
+        String md5Password = Md5Util.md5(password);
+        return md5Password.equals(dbPassword);
+    }
 }
 }

+ 148 - 0
src/main/java/com/caimei/service/wechat/impl/RegisterServiceImpl.java

@@ -0,0 +1,148 @@
+package com.caimei.service.wechat.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.components.RedisService;
+import com.caimei.mapper.cmMapper.AuthMapper;
+import com.caimei.mapper.cmMapper.ClubMapper;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.dto.ProductSaveDto;
+import com.caimei.model.po.ClubUserPo;
+import com.caimei.model.po.CmBrandAuthPo;
+import com.caimei.model.vo.AuthFormVo;
+import com.caimei.model.vo.AuthVo;
+import com.caimei.model.vo.WxClubUserVo;
+import com.caimei.service.auth.AuthProductService;
+import com.caimei.service.auth.AuthService;
+import com.caimei.service.wechat.RegisterService;
+import com.caimei.utils.Md5Util;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/15
+ */
+@Slf4j
+@Service
+public class RegisterServiceImpl implements RegisterService {
+
+    @Resource
+    private RedisService redisService;
+    @Resource
+    private ClubMapper clubMapper;
+    @Resource
+    private AuthMapper authMapper;
+    @Resource
+    private AuthService authService;
+    @Resource
+    private AuthProductService authProductService;
+
+    @Override
+    public ResponseJson<WxClubUserVo> simpleRegister(String mobile, String verifyCode, String password, Integer authUserId, String authParty) {
+        // 校验手机号
+        WxClubUserVo clubUserVo = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
+        if (null != clubUserVo) {
+            return ResponseJson.error(-2, "抱歉,该手机号已注册!", null);
+        }
+        // 手机号是否有对应的机构
+        AuthFormVo auth = authMapper.getAuthByUserMobile(mobile, authUserId);
+        if (null != auth && !authParty.equals(auth.getAuthParty())) {
+            return ResponseJson.error("机构名称不一致,请确认机构名称", null);
+        }
+        // 校验验证码是否正确
+        String redisVerifyCode = null == redisService.get("code:" + mobile) ? null : redisService.get("code:" + mobile).toString();
+        if (!verifyCode.equals(redisVerifyCode)) {
+            return ResponseJson.error("验证码错误,请重新输入", null);
+        }
+        String md5Password = Md5Util.md5(password);
+        /*
+         * 构建机构用户数据
+         */
+        ClubUserPo clubUser = new ClubUserPo();
+        clubUser.setAuthUserId(authUserId);
+        if (null != auth) {
+            clubUser.setAuthId(auth.getAuthId());
+        }
+        clubUser.setName(authParty);
+        clubUser.setStatus(1);
+        clubUser.setPassword(md5Password);
+        clubUser.setAddTime(new Date());
+        clubMapper.insertClubUser(clubUser);
+        clubUserVo = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
+        return ResponseJson.success(clubUserVo);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public ResponseJson allRegister(Integer authUserId, Integer clubUserId, Integer authId, String registerType, String clubUserInfo, String authInfo, String productInfo) {
+        if (registerType.contains("1")) {
+            JSONObject clubUserMap = JSONObject.parseObject(clubUserInfo);
+            if (null == clubUserMap) {
+                return ResponseJson.error("机构用户数据异常");
+            }
+            String mobile = (String) clubUserMap.get("mobile");
+            String verifyCode = (String) clubUserMap.get("verifyCode");
+            String password = (String) clubUserMap.get("password");
+            String authParty = (String) clubUserMap.get("authParty");
+            ResponseJson<WxClubUserVo> result = simpleRegister(mobile, verifyCode, password, authUserId, authParty);
+            WxClubUserVo clubUser = result.getData();
+            clubUserId = clubUser.getClubUserId();
+        }
+        if (registerType.contains("2")) {
+            if (StringUtils.isEmpty(authInfo)) {
+                // 设置手动回滚事务
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return ResponseJson.error("认证机构数据异常");
+            }
+            CmBrandAuthPo auth = JSONObject.parseObject(authInfo, CmBrandAuthPo.class);
+            JSONObject authMap = JSONObject.parseObject(authInfo);
+            String lngAndLat = authMap.getString("lngAndLat");
+            if (StringUtils.isEmpty(lngAndLat)) {
+                return ResponseJson.error("参数异常,经纬度不能为空", null);
+            }
+            String[] split = lngAndLat.split(",");
+            auth.setLng(new BigDecimal(split[0]));
+            auth.setLat(new BigDecimal(split[1]));
+            List<String> bannerList = (List<String>) authMap.get("bannerList");
+            ResponseJson result = authService.saveAuth(auth, bannerList, false, 2);
+            int code = result.getCode();
+            if (0 != code) {
+                // 设置手动回滚事务
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return result;
+            } else {
+                CmBrandAuthPo data = (CmBrandAuthPo) result.getData();
+                authId = data.getId();
+            }
+            // 保存机构用户对应的机构id
+            clubMapper.updateAuthId(clubUserId, authId);
+        }
+        if (registerType.contains("3")) {
+            if (StringUtils.isEmpty(productInfo)) {
+                // 设置手动回滚事务
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return ResponseJson.error("认证设备数据异常");
+            }
+            ProductSaveDto productSaveDto = JSONObject.parseObject(productInfo, ProductSaveDto.class);
+            productSaveDto.setAuthId(authId);
+            try {
+                authProductService.saveProduct(productSaveDto, false, 1);
+            } catch (Exception e) {
+                // 设置手动回滚事务
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return ResponseJson.error("保存认证设备失败");
+            }
+        }
+        return ResponseJson.success("保存成功");
+    }
+}

+ 107 - 0
src/main/java/com/caimei/service/wechat/impl/WxUserServiceImpl.java

@@ -0,0 +1,107 @@
+package com.caimei.service.wechat.impl;
+
+import com.caimei.components.RedisService;
+import com.caimei.mapper.cmMapper.*;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.AuthFormVo;
+import com.caimei.model.vo.AuthVo;
+import com.caimei.model.vo.ProductListVo;
+import com.caimei.model.vo.WxClubUserVo;
+import com.caimei.service.wechat.WxUserService;
+import com.caimei.utils.CodeUtil;
+import com.caimei.utils.Md5Util;
+import com.caimei.utils.SmsUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/15
+ */
+@Slf4j
+@Service
+public class WxUserServiceImpl implements WxUserService {
+
+    @Resource
+    private RedisService redisService;
+    @Resource
+    private LoginMapper loginMapper;
+    @Resource
+    private ShopMapper shopMapper;
+    @Resource
+    private ClubMapper clubMapper;
+    @Resource
+    private AuthMapper authMapper;
+    @Resource
+    private AuthProductMapper authProductMapper;
+
+
+    @Override
+    public ResponseJson<Map<String, Object>> getUserInfo(String mobile, Integer authUserId, Integer clubUserId) {
+        HashMap<String, Object> map = new HashMap<>(2);
+        // 机构用户
+        WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, clubUserId);
+        // 授权机构
+        AuthFormVo auth = null;
+        if (null == clubUser) {
+            // 机构用户未注册,查询手机号对应的已认证机构
+            auth = authMapper.getAuthByUserMobile(mobile, authUserId);
+        } else {
+            // 机构用户已注册
+            if (null != clubUser.getAuthId()) {
+                auth = authMapper.getAuthFormById(clubUser.getAuthId());
+            }
+        }
+        map.put("clubUser", clubUser);
+        map.put("auth", auth);
+        return ResponseJson.success(map);
+    }
+
+    @Override
+    public ResponseJson sendLoginCode(String mobile, Integer authUserId, Integer type) {
+        if (2 == type) {
+            // 获取手机号对应机构用户
+            WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
+            if (null == clubUser) {
+                return ResponseJson.error("用户不存在");
+            }
+        }
+        String verifyCode = CodeUtil.generateCodeInt(6);
+        String content = "您的短信验证码为:" + verifyCode + ",该验证码 5 分钟内有效,请勿泄漏于他人。";
+        Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
+        String msgType = 1 == type ? "注册" : 2 == type ? "忘记密码" : "";
+        if (!sendSms) {
+            log.info(msgType + "验证码发送失败,手机号:" + mobile);
+            return ResponseJson.error("发送失败,请确认手机号无误");
+        } else {
+            log.info(msgType + "验证码发送成功,手机号:" + mobile + ",验证码:" + verifyCode);
+        }
+        log.info(content);
+        redisService.set("code:" + mobile, verifyCode, 300L);
+        return ResponseJson.success("发送成功");
+    }
+
+    @Override
+    public ResponseJson updatePassword(String mobile, String verifyCode, String password, Integer authUserId) {
+        // 获取手机号对应机构用户
+        WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
+        if (null == clubUser) {
+            return ResponseJson.error("用户不存在");
+        }
+        // 校验验证码是否正确
+        String redisVerifyCode = null == redisService.get("code:" + mobile) ? null : redisService.get("code:" + mobile).toString();
+        if (!verifyCode.equals(redisVerifyCode)) {
+            return ResponseJson.error("验证码错误,请重新输入", null);
+        }
+        String md5Password = Md5Util.md5(password);
+        clubMapper.updatePassword(mobile, md5Password, authUserId);
+        return ResponseJson.success("密码修改成功");
+    }
+}

+ 102 - 38
src/main/resources/mapper/AuthMapper.xml

@@ -3,9 +3,11 @@
 <mapper namespace="com.caimei.mapper.cmMapper.AuthMapper">
 <mapper namespace="com.caimei.mapper.cmMapper.AuthMapper">
     <insert id="insertAuth" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.model.po.CmBrandAuthPo">
     <insert id="insertAuth" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.model.po.CmBrandAuthPo">
         insert into cm_brand_auth (authUserId, authParty, provinceId, cityId, townId, address, lng, lat,
         insert into cm_brand_auth (authUserId, authParty, provinceId, cityId, townId, address, lng, lat,
-                                   mobile, logo, customFlag, remarks, status, createTime, createBy, auditStatus, delFlag)
+                                   mobile, userMobile, firstClubType, secondClubType, medicalLicenseImage, empNum,
+                                   logo, customFlag, remarks, status, createTime, createBy, auditStatus, shopAuditStatus, delFlag)
         values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
         values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
-                #{mobile}, #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{delFlag})
+                #{mobile}, #{userMobile}, #{firstClubType}, #{secondClubType}, #{medicalLicenseImage}, #{empNum},
+                #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{shopAuditStatus}, #{delFlag})
     </insert>
     </insert>
     <insert id="insertBanner">
     <insert id="insertBanner">
         insert into cm_brand_auth_banner (authId, banner)
         insert into cm_brand_auth_banner (authId, banner)
@@ -18,19 +20,23 @@
     </update>
     </update>
     <update id="updateAuthByAuthId">
     <update id="updateAuthByAuthId">
         update cm_brand_auth
         update cm_brand_auth
-        set authParty   = #{authParty},
-            provinceId  = #{provinceId},
-            cityId      = #{cityId},
-            townId      = #{townId},
-            address     = #{address},
-            lng         = #{lng},
-            lat         = #{lat},
-            mobile      = #{mobile},
-            logo        = #{logo},
-            customFlag  = #{customFlag},
-            remarks     = #{remarks},
-            status      = #{status},
-            auditStatus = #{auditStatus}
+        set authParty       = #{authParty},
+            provinceId      = #{provinceId},
+            cityId          = #{cityId},
+            townId          = #{townId},
+            address         = #{address},
+            lng             = #{lng},
+            lat             = #{lat},
+            mobile          = #{mobile},
+            userMobile      = #{userMobile},
+            firstClubType   = #{firstClubType},
+            secondClubType  = #{secondClubType},
+            logo            = #{logo},
+            customFlag      = #{customFlag},
+            remarks         = #{remarks},
+            status          = #{status},
+            auditStatus     = #{auditStatus},
+            shopAuditStatus = #{shopAuditStatus}
         where id = #{id}
         where id = #{id}
     </update>
     </update>
     <update id="updateAuthAuditStatus">
     <update id="updateAuthAuditStatus">
@@ -48,19 +54,29 @@
     <update id="updateLdmLatestClubId">
     <update id="updateLdmLatestClubId">
         update ldm_latest_club_id set ldmClubId = #{ldmLatestClubId} where id = 1;
         update ldm_latest_club_id set ldmClubId = #{ldmLatestClubId} where id = 1;
     </update>
     </update>
+    <update id="updateAuthShopAuditStatus">
+        update cm_brand_auth
+        set shopAuditStatus   = #{shopAuditStatus},
+            shopInvalidReason = #{shopInvalidReason},
+            shopAuditTime     = #{shopAuditTime}
+        where id = #{authId}
+    </update>
     <delete id="deleteBanner">
     <delete id="deleteBanner">
         delete from cm_brand_auth_banner where authId = #{authId}
         delete from cm_brand_auth_banner where authId = #{authId}
     </delete>
     </delete>
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
-        select id as authId, authParty, a.status, a.auditStatus, a.createTime, cu.name as createBy,
+        select id as authId, authParty, a.status, a.auditStatus, a.shopAuditStatus, a.createTime, cu.name as createBy,
             au.name as auditBy,a.auditTime,a.invalidReason,
             au.name as auditBy,a.auditTime,a.invalidReason,
             ifnull(ap.waitAuditNum,0) as waitAuditNum,
             ifnull(ap.waitAuditNum,0) as waitAuditNum,
+            ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
             if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus
             if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus
         from cm_brand_auth a
         from cm_brand_auth a
         left join cm_brand_auth_user cu on a.createBy = cu.authUserId
         left join cm_brand_auth_user cu on a.createBy = cu.authUserId
         left join cm_brand_auth_user au on a.auditBy = au.authUserId
         left join cm_brand_auth_user au on a.auditBy = au.authUserId
         left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where auditStatus = 2 group by
         left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where auditStatus = 2 group by
             authId) ap on a.id = ap.authId
             authId) ap on a.id = ap.authId
+        left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where shopAuditStatus = 2 group by
+            authId) bp on a.id = bp.authId
         where a.authUserId = #{authUserId} and delFlag = 0
         where a.authUserId = #{authUserId} and delFlag = 0
         <if test="authParty != null and authParty != ''">
         <if test="authParty != null and authParty != ''">
             and a.authParty like CONCAT('%',#{authParty},'%')
             and a.authParty like CONCAT('%',#{authParty},'%')
@@ -71,6 +87,20 @@
         <if test="auditStatus != null">
         <if test="auditStatus != null">
             and a.auditStatus = #{auditStatus}
             and a.auditStatus = #{auditStatus}
         </if>
         </if>
+        <if test="1 == listType or 2 == listType">
+            and a.shopAuditStatus = 1
+        </if>
+        <if test="4 == listType">
+            and a.auditStatus = 1
+        </if>
+        <if test="shopAuditStatus != null">
+            <if test="0 == shopAuditStatus">
+                and (a.shopAuditStatus = 2 or ifnull(bp.waitAuditNum,0) > 0)
+            </if>
+            <if test="1 == shopAuditStatus">
+                and (a.shopAuditStatus = 0 or a.shopAuditStatus = 1 or ifnull(bp.waitAuditNum,0) > 0)
+            </if>
+        </if>
         <if test="lowerAuditStatus != null">
         <if test="lowerAuditStatus != null">
             <if test="0 == lowerAuditStatus">
             <if test="0 == lowerAuditStatus">
                 and ifnull(ap.waitAuditNum,0) > 0
                 and ifnull(ap.waitAuditNum,0) > 0
@@ -83,6 +113,9 @@
             <when test="listType == 2">
             <when test="listType == 2">
                 order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,waitAuditNum desc, a.createTime desc
                 order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,waitAuditNum desc, a.createTime desc
             </when>
             </when>
+            <when test="listType == 3">
+                order by (case a.shopAuditStatus when 2 then 2 when 0 then 1 else 0 end) desc,shopWaitAuditNum desc, a.createTime desc
+            </when>
             <otherwise>
             <otherwise>
                 order by a.createTime desc, a.id desc
                 order by a.createTime desc, a.id desc
             </otherwise>
             </otherwise>
@@ -99,28 +132,6 @@
         from cm_brand_auth
         from cm_brand_auth
         where id = #{authId}
         where id = #{authId}
     </select>
     </select>
-    <select id="getAuthById" resultType="com.caimei.model.po.CmBrandAuthPo">
-        select id,
-               authParty,
-               authUserId,
-               a.provinceId,
-               a.cityId,
-               a.townId,
-               concat(p.name, '/', c.name, '/', t.name) as area,
-               address,
-               lng,
-               lat,
-               mobile,
-               logo,
-               customFlag,
-               remarks,
-               status
-        from cm_brand_auth a
-                 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
-        where id = #{authId}
-    </select>
     <select id="getAuthIdByAuthParty" resultType="java.lang.Integer">
     <select id="getAuthIdByAuthParty" resultType="java.lang.Integer">
         select id
         select id
         from cm_brand_auth
         from cm_brand_auth
@@ -184,4 +195,57 @@
     <select id="getProvinceIdByCityId" resultType="java.lang.Integer">
     <select id="getProvinceIdByCityId" resultType="java.lang.Integer">
         select provinceID from city where cityID = #{cityId}
         select provinceID from city where cityID = #{cityId}
     </select>
     </select>
+    <select id="getAuthByUserMobile" resultType="com.caimei.model.vo.AuthFormVo">
+        select id as authId, authParty
+        from cm_brand_auth
+        where authUserId = #{authUserId}
+          and userMobile = #{mobile}
+    </select>
+    <select id="getAuthById" resultType="com.caimei.model.vo.AuthVo">
+        select id      as authId,
+               a.authUserId,
+               authParty,
+               a.status,
+               a.auditStatus,
+               a.createTime,
+               cu.name as createBy,
+               au.name as auditBy,
+               a.auditTime,
+               a.invalidReason
+        from cm_brand_auth a
+                 left join cm_brand_auth_user cu on a.createBy = cu.authUserId
+                 left join cm_brand_auth_user au on a.auditBy = au.authUserId
+        where a.delFlag = 0
+          and a.id = #{authId}
+    </select>
+    <select id="getAuthFormById" resultType="com.caimei.model.vo.AuthFormVo">
+        select id as authId,
+               authParty,
+               authUserId,
+               a.provinceId,
+               a.cityId,
+               a.townId,
+               concat(p.name, '/', c.name, '/', t.name) as area,
+               address,
+               lng,
+               lat,
+               mobile,
+               userMobile,
+               firstClubType,
+               secondClubType,
+               medicalLicenseImage,
+               empNum,
+               logo,
+               customFlag,
+               remarks,
+               status,
+               auditStatus,
+               shopAuditStatus,
+               shopInvalidReason
+        from cm_brand_auth a
+                 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
+        where id = #{authId}
+    </select>
 </mapper>
 </mapper>

+ 34 - 7
src/main/resources/mapper/AuthProductMapper.xml

@@ -3,13 +3,15 @@
 <mapper namespace="com.caimei.mapper.cmMapper.AuthProductMapper">
 <mapper namespace="com.caimei.mapper.cmMapper.AuthProductMapper">
     <insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
     <insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
         insert into cm_brand_auth_product(`authId`, `brandId`, `productTypeId`, `snCode`,
         insert into cm_brand_auth_product(`authId`, `brandId`, `productTypeId`, `snCode`,
-                                          `originalCertificateImage`,`certificateImage`,`pcCertificateImage`,
-                                          `appletsCertificateImage`, `addQrCodeFlag`,`addTemplateType`, `status`,
-                                          `auditStatus`,`createTime`, `createBy`)
+                                          `originalCertificateImage`, `certificateImage`, `pcCertificateImage`,
+                                          `appletsCertificateImage`, `addQrCodeFlag`, `addTemplateType`,
+                                          purchaseWay, invoiceImage, `status`,
+                                          `auditStatus`, shopAuditStatus, `createTime`, `createBy`)
         values (#{authId}, #{brandId}, #{productTypeId}, #{snCode},
         values (#{authId}, #{brandId}, #{productTypeId}, #{snCode},
                 #{originalCertificateImage}, #{certificateImage}, #{pcCertificateImage},
                 #{originalCertificateImage}, #{certificateImage}, #{pcCertificateImage},
-                #{appletsCertificateImage}, #{addQrCodeFlag}, #{addTemplateType}, #{status},
-                #{auditStatus}, #{createTime},#{createBy})
+                #{appletsCertificateImage}, #{addQrCodeFlag}, #{addTemplateType},
+                #{purchaseWay}, #{invoiceImage}, #{status},
+                #{auditStatus}, #{shopAuditStatus}, #{createTime}, #{createBy})
     </insert>
     </insert>
     <insert id="insertProductParam">
     <insert id="insertProductParam">
         insert into cm_brand_product_param (`productId`, `name`, `content`)
         insert into cm_brand_product_param (`productId`, `name`, `content`)
@@ -43,8 +45,11 @@
             <if test="appletsCertificateImage != null and appletsCertificateImage != ''">
             <if test="appletsCertificateImage != null and appletsCertificateImage != ''">
                 `appletsCertificateImage`      = #{appletsCertificateImage},
                 `appletsCertificateImage`      = #{appletsCertificateImage},
             </if>
             </if>
+            purchaseWay        = #{purchaseWay},
+            invoiceImage       = #{invoiceImage},
             `status`           = #{status},
             `status`           = #{status},
             `auditStatus`      = #{auditStatus},
             `auditStatus`      = #{auditStatus},
+            `shopAuditStatus`  = #{shopAuditStatus},
         </set>
         </set>
         where id = #{productId};
         where id = #{productId};
     </update>
     </update>
@@ -109,6 +114,13 @@
     <update id="deleteProductType">
     <update id="deleteProductType">
         update cm_brand_product_type set delFlag = 1 where id = #{productTypeId}
         update cm_brand_product_type set delFlag = 1 where id = #{productTypeId}
     </update>
     </update>
+    <update id="updateProductShopAuditStatus">
+        update cm_brand_auth_product
+        set shopAuditStatus   = #{shopAuditStatus},
+            shopInvalidReason = #{shopInvalidReason},
+            shopAuditTime     = #{shopAuditTime}
+        where id = #{productId}
+    </update>
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
         select p.id as productId,t.name as productName,snCode,p.status,p.auditStatus,p.createTime,cu.name as createBy,
         select p.id as productId,t.name as productName,snCode,p.status,p.auditStatus,p.createTime,cu.name as createBy,
                au.name as auditBy,p.auditTime,p.invalidReason
                au.name as auditBy,p.auditTime,p.invalidReason
@@ -127,12 +139,23 @@
             and p.status = #{status}
             and p.status = #{status}
         </if>
         </if>
         <if test="auditStatus != null">
         <if test="auditStatus != null">
-            and p.auditStatus = #{auditStatus}
+            and p.auditStatus = #{auditStatus} and p.shopAuditStatus = 1
+        </if>
+        <if test="shopAuditStatus != null">
+            <if test="0 == shopAuditStatus">
+                and p.shopAuditStatus = 2
+            </if>
+            <if test="1 == shopAuditStatus">
+                and (p.shopAuditStatus = 0 or p.shopAuditStatus = 2)
+            </if>
         </if>
         </if>
         <choose>
         <choose>
             <when test="listType == 2">
             <when test="listType == 2">
                 order by (case p.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,p.createTime desc
                 order by (case p.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,p.createTime desc
             </when>
             </when>
+            <when test="listType == 3">
+                order by (case p.shopAuditStatus when 2 then 2 when 0 then 1 else 0 end) desc, a.createTime desc
+            </when>
             <otherwise>
             <otherwise>
                 order by p.createTime desc
                 order by p.createTime desc
             </otherwise>
             </otherwise>
@@ -153,7 +176,11 @@
                `originalCertificateImage`,
                `originalCertificateImage`,
                addQrCodeFlag,
                addQrCodeFlag,
                addTemplateType,
                addTemplateType,
-               p.`status`
+               purchaseWay,
+               invoiceImage,
+               p.`status`,
+               p.shopAuditStatus,
+               p.shopInvalidReason
         from cm_brand_auth_product p
         from cm_brand_auth_product p
                  left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
                  left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         where p.id = #{productId}
         where p.id = #{productId}

+ 46 - 20
src/main/resources/mapper/ClubMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.mapper.cmMapper.ClubMapper">
 <mapper namespace="com.caimei.mapper.cmMapper.ClubMapper">
     <insert id="insertClubUser">
     <insert id="insertClubUser">
-        insert into cm_brand_club_user (authId, name, mobile, addTime, delFlag)
-        values (#{authId}, #{name}, #{mobile}, #{addTime}, 0)
+        insert into cm_brand_club_user (authUserId, authId, name, mobile, password, addTime, status, delFlag)
+        values (#{authUserId}, #{authId}, #{name}, #{mobile}, #{password}, #{addTime}, #{status}, 0)
     </insert>
     </insert>
     <insert id="insertFeedback">
     <insert id="insertFeedback">
         insert into cm_brand_club_feedback(clubUserId, content, commitTime, handleStatus)
         insert into cm_brand_club_feedback(clubUserId, content, commitTime, handleStatus)
@@ -18,6 +18,25 @@
     <update id="deleteClubUser">
     <update id="deleteClubUser">
         update cm_brand_club_user set delFlag = 1 where id = #{clubUserId}
         update cm_brand_club_user set delFlag = 1 where id = #{clubUserId}
     </update>
     </update>
+    <update id="updatePassword">
+        update cm_brand_club_user
+        set password = #{password}
+        where mobile = #{mobile}
+          and authUserId = #{authUserId}
+    </update>
+    <update id="updateAuthId">
+        update cm_brand_club_user set authId = #{authId} where id = #{clubUserId}
+    </update>
+    <update id="updateStatus">
+        update cm_brand_club_user
+        set status = #{status}
+        where id = #{clubUserId}
+    </update>
+    <update id="updateClubUserPassword">
+        update cm_brand_club_user
+        set password=#{password}
+        where id = #{clubUserId}
+    </update>
     <select id="getClubList" resultType="com.caimei.model.vo.ClubVo">
     <select id="getClubList" resultType="com.caimei.model.vo.ClubVo">
         select id as authId,authParty as clubName,createTime
         select id as authId,authParty as clubName,createTime
         from cm_brand_auth where authUserId = #{authUserId}
         from cm_brand_auth where authUserId = #{authUserId}
@@ -27,24 +46,29 @@
         order by createTime desc
         order by createTime desc
     </select>
     </select>
     <select id="getClubUserList" resultType="com.caimei.model.vo.ClubUserVo">
     <select id="getClubUserList" resultType="com.caimei.model.vo.ClubUserVo">
-        select id as clubUserId,
-        authId,
-        name,
-        mobile,
-        addTime,
-        nickName,
-        mobile,
-        openId
-        from cm_brand_club_user
-        where authId = #{authId}
-        and delFlag = 0
+        select cu.id as clubUserId,
+        cu.authId,
+        cu.name,
+        cu.mobile,
+        cu.addTime,
+        cu.nickName,
+        cu.mobile,
+        cu.openId
+        from cm_brand_club_user cu
+        left join cm_brand_auth a on cu.authId = a.id
+        where cu.authUserId = #{authUserId}
+        and cu.status = 1
+        and cu.delFlag = 0
         <if test="name != null and name != ''">
         <if test="name != null and name != ''">
-            and name like concat('%',#{name},'%')
+            and cu.name like concat('%',#{name},'%')
         </if>
         </if>
         <if test="mobile != null and mobile != ''">
         <if test="mobile != null and mobile != ''">
-            and mobile like concat('%',#{mobile},'%')
+            and cu.mobile like concat('%',#{mobile},'%')
         </if>
         </if>
-        order by addTime desc
+        <if test="status != null">
+            and cu.status = #{status}
+        </if>
+        order by cu.addTime desc
     </select>
     </select>
     <select id="getWxClubList" resultType="com.caimei.model.vo.WxClubListVo">
     <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 clubName,concat(ifnull(p.name,''),ifnull(c.name,''),ifnull(t.name,'')) as area,a.address,a.mobile,a.logo,
@@ -80,21 +104,23 @@
         where cu.mobile = #{mobile} and au.appId = #{appId} and cu.delFlag = 0 limit 1
         where cu.mobile = #{mobile} and au.appId = #{appId} and cu.delFlag = 0 limit 1
     </select>
     </select>
     <select id="getWxClubUser" resultType="com.caimei.model.vo.WxClubUserVo">
     <select id="getWxClubUser" resultType="com.caimei.model.vo.WxClubUserVo">
-        select cu.id as clubUserId, a.id as authId, au.authUserId, cu.mobile
+        select cu.id as clubUserId, cu.authId as authId, au.authUserId, cu.mobile
         from cm_brand_club_user cu
         from cm_brand_club_user cu
                  left join cm_brand_auth a on cu.authId = a.id
                  left join cm_brand_auth a on cu.authId = a.id
                  left join cm_brand_auth_user au on a.authUserId = au.authUserId
                  left join cm_brand_auth_user au on a.authUserId = au.authUserId
-        where cu.mobile = #{mobile}
+        where cu.delFlag = 0
+          <if test="mobile != null and mobile != ''">
+              and cu.mobile = #{mobile}
+          </if>
           <if test="appId != null and appId != ''">
           <if test="appId != null and appId != ''">
               and au.appId = #{appId}
               and au.appId = #{appId}
           </if>
           </if>
           <if test="authUserId != null">
           <if test="authUserId != null">
-              and au.authUserId = #{authUserId}
+              and (au.authUserId = #{authUserId} or cu.authUserId = #{authUserId})
           </if>
           </if>
           <if test="authId != null">
           <if test="authId != null">
               and cu.authId = #{authId}
               and cu.authId = #{authId}
           </if>
           </if>
-          and cu.delFlag = 0
         limit 1
         limit 1
     </select>
     </select>
     <select id="getClubDetails" resultType="com.caimei.model.vo.WxClubDetailsVo">
     <select id="getClubDetails" resultType="com.caimei.model.vo.WxClubDetailsVo">

+ 9 - 0
src/main/resources/mapper/ShopMapper.xml

@@ -137,6 +137,7 @@
         left join (select authUserId, count(*) as zipWaitNum from cm_brand_file where auditStatus = 2 and fileType = 2 group by authUserId) zw on u.authUserId = zw.authUserId
         left join (select authUserId, count(*) as zipWaitNum from cm_brand_file where auditStatus = 2 and fileType = 2 group by authUserId) zw on u.authUserId = zw.authUserId
         left join (select authUserId, count(*) as doctorWaitNum from cm_brand_doctor where auditStatus = 2 group by authUserId) dw on u.authUserId = dw.authUserId
         left join (select authUserId, count(*) as doctorWaitNum from cm_brand_doctor where auditStatus = 2 group by authUserId) dw on u.authUserId = dw.authUserId
         left join (select authUserId, count(*) as productTypeWaitNum from cm_brand_product_type where auditStatus = 2 group by authUserId) tw on u.authUserId = tw.authUserId
         left join (select authUserId, count(*) as productTypeWaitNum from cm_brand_product_type where auditStatus = 2 group by authUserId) tw on u.authUserId = tw.authUserId
+        left join (select authUserId, count(*) as waitSendNum from cm_brand_auth where auditStatus = 2 and sendStatus = 0 group by authUserId) sw on u.authUserId = sw.authUserId
         where u.userIdentity = 2
         where u.userIdentity = 2
         <if test="shopName != null and shopName !=''">
         <if test="shopName != null and shopName !=''">
             AND u.name like CONCAT('%',#{shopName},'%')
             AND u.name like CONCAT('%',#{shopName},'%')
@@ -159,6 +160,14 @@
         <if test="linkMan != null and linkMan !=''">
         <if test="linkMan != null and linkMan !=''">
             AND u.linkMan like CONCAT('%',#{linkMan},'%')
             AND u.linkMan like CONCAT('%',#{linkMan},'%')
         </if>
         </if>
+        <if test="sendStatus != null">
+            <if test="0 == sendStatus">
+                and ifnull(sw.waitSendNum,0) > 0
+            </if>
+            <if test="1 == sendStatus">
+                and ifnull(sw.waitSendNum,0) = 0
+            </if>
+        </if>
         <if test="lowerAuditStatus != null">
         <if test="lowerAuditStatus != null">
             <if test="0 == lowerAuditStatus">
             <if test="0 == lowerAuditStatus">
                 <if test="listType == 2">
                 <if test="listType == 2">