Explorar el Código

ldm版本part2

Aslee hace 3 años
padre
commit
4fa3520d03
Se han modificado 41 ficheros con 466 adiciones y 293 borrados
  1. 17 1
      src/main/java/com/caimei/controller/auth/AuthApi.java
  2. 22 23
      src/main/java/com/caimei/controller/auth/AuthClubApi.java
  3. 20 21
      src/main/java/com/caimei/controller/auth/AuthProductApi.java
  4. 12 6
      src/main/java/com/caimei/controller/auth/DoctorApi.java
  5. 1 1
      src/main/java/com/caimei/controller/data/ArticleApi.java
  6. 6 4
      src/main/java/com/caimei/controller/data/FileApi.java
  7. 23 8
      src/main/java/com/caimei/controller/wechat/WxAuthApi.java
  8. 3 2
      src/main/java/com/caimei/controller/wechat/WxDataApi.java
  9. 4 5
      src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java
  10. 5 8
      src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java
  11. 15 6
      src/main/java/com/caimei/mapper/cmMapper/DoctorMapper.java
  12. 2 2
      src/main/java/com/caimei/mapper/cmMapper/FileMapper.java
  13. 2 3
      src/main/java/com/caimei/model/dto/ProductSaveDto.java
  14. 4 14
      src/main/java/com/caimei/model/po/ClubUserPo.java
  15. 10 0
      src/main/java/com/caimei/model/po/CmBrandAuthPo.java
  16. 10 0
      src/main/java/com/caimei/model/po/CmBrandDoctorPo.java
  17. 5 0
      src/main/java/com/caimei/model/po/FilePo.java
  18. 2 2
      src/main/java/com/caimei/model/po/ProductPo.java
  19. 7 13
      src/main/java/com/caimei/model/vo/ClubUserVo.java
  20. 14 2
      src/main/java/com/caimei/model/vo/DoctorFormVo.java
  21. 22 0
      src/main/java/com/caimei/model/vo/ParamVo.java
  22. 3 0
      src/main/java/com/caimei/model/vo/ProductTypeListVo.java
  23. 3 0
      src/main/java/com/caimei/model/vo/ShopListVo.java
  24. 8 0
      src/main/java/com/caimei/model/vo/WxDoctorListVo.java
  25. 21 0
      src/main/java/com/caimei/model/vo/WxProductTypeListVo.java
  26. 12 22
      src/main/java/com/caimei/service/auth/AuthClubService.java
  27. 9 7
      src/main/java/com/caimei/service/auth/AuthProductService.java
  28. 5 0
      src/main/java/com/caimei/service/auth/AuthService.java
  29. 7 3
      src/main/java/com/caimei/service/auth/DoctorService.java
  30. 27 50
      src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java
  31. 20 12
      src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java
  32. 6 11
      src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java
  33. 42 10
      src/main/java/com/caimei/service/auth/impl/DoctorServiceImpl.java
  34. 2 1
      src/main/java/com/caimei/service/auth/impl/ShopServiceImpl.java
  35. 6 3
      src/main/java/com/caimei/service/data/FileService.java
  36. 11 5
      src/main/java/com/caimei/service/data/impl/FileServiceImpl.java
  37. 6 2
      src/main/resources/mapper/AuthMapper.xml
  38. 17 7
      src/main/resources/mapper/AuthProductMapper.xml
  39. 14 31
      src/main/resources/mapper/ClubMapper.xml
  40. 34 5
      src/main/resources/mapper/DoctorMapper.xml
  41. 7 3
      src/main/resources/mapper/FileMapper.xml

+ 17 - 1
src/main/java/com/caimei/controller/auth/AuthApi.java

@@ -5,6 +5,7 @@ import com.caimei.model.ResponseJson;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.vo.AuthFormVo;
 import com.caimei.model.vo.AuthVo;
+import com.caimei.model.vo.ProductTypeListVo;
 import com.caimei.service.auth.AuthService;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
@@ -57,6 +58,17 @@ public class AuthApi {
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
         return authService.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus, pageNum, pageSize);
     }
+
+    @ApiOperation("机构下拉框列表")
+    @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id")
+    @GetMapping("/select")
+    public ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId) {
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,供应商用户id不能为空", null);
+        }
+        return authService.getAuthSelectList(authUserId);
+    }
+
     /**
      * 更新授权状态
      */
@@ -94,7 +106,8 @@ public class AuthApi {
      * 添加/编辑授权
      */
     @ApiOperation("添加/编辑授权")
-    @ApiImplicitParam(name = "params", value = "authId:授权id;authUserId:供应商用户id;authParty:授权机构;createBy:创建人id", required = true)
+    @ApiImplicitParam(name = "params", value = "authId:授权id;authUserId:供应商用户id;authParty:授权机构;provinceId;cityId;" +
+            "townId;address;lngAndLat;mobile;logo;customFlag:是否需要自定义属性:0否,1是;remarks:店铺备注;createBy:创建人id", required = true)
     @PostMapping("/save")
     public ResponseJson saveAuth(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
@@ -107,6 +120,8 @@ public class AuthApi {
         String lngAndLat = paramsMap.getString("lngAndLat");
         String mobile = paramsMap.getString("mobile");
         String logo = paramsMap.getString("logo");
+        Integer customFlag = paramsMap.getInteger("customFlag");
+        String remarks = paramsMap.getString("remarks");
         List<String> bannerList = (List<String>) paramsMap.get("bannerList");
         String authParty = paramsMap.getString("authParty");
         Integer createBy = paramsMap.getInteger("createBy");
@@ -121,6 +136,7 @@ public class AuthApi {
         auth.setCityId(cityId);
         auth.setTownId(townId);
         auth.setAddress(address);
+        auth.setCustomFlag(customFlag);
         if (StringUtils.isEmpty(lngAndLat)) {
             return ResponseJson.error("参数异常,经纬度不能为空");
         }

+ 22 - 23
src/main/java/com/caimei/controller/auth/AuthClubApi.java

@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -50,49 +51,47 @@ public class AuthClubApi {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "authId", required = true, value = "机构id"),
             @ApiImplicitParam(name = "mobile", required = false, value = "手机号"),
+            @ApiImplicitParam(name = "name", required = false, value = "姓名"),
             @ApiImplicitParam(name = "status", required = false, value = "状态:0未绑定,1已绑定,2已过期"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
-    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, Integer status,
+    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, String name, Integer status,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authClubService.getClubUserList(authId, mobile, status, pageNum, pageSize);
+        return authClubService.getClubUserList(authId, mobile, name, status, pageNum, pageSize);
     }
 
-    @ApiOperation("生成邀请码")
-    @PostMapping("/user/code/generate")
-    @ApiImplicitParam(name = "params", value = "authId:授权机构id", required = true)
-    public ResponseJson generateCode(@RequestBody String params) {
+    @ApiOperation("添加/编辑机构用户")
+    @PostMapping("/user/save")
+    @ApiImplicitParam(name = "params", value = "clubUserId:机构用户id;authId:授权机构id;name:姓名;mobile:手机号", required = true)
+    public ResponseJson saveClubUser(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer clubUserId = paramsMap.getInteger("clubUserId");
         Integer authId = paramsMap.getInteger("authId");
+        String name = paramsMap.getString("name");
+        String mobile = paramsMap.getString("mobile");
         if (null == authId) {
             return ResponseJson.error("参数异常,请输入授权机构id");
         }
-        return authClubService.generateCode(authId);
-    }
-
-    @ApiOperation("解绑邀请码")
-    @PostMapping("/user/code/unbind")
-    @ApiImplicitParam(name = "params", value = "clubUserId:机构用户id", required = true)
-    public ResponseJson unbindCode(@RequestBody String params) {
-        JSONObject paramsMap = JSONObject.parseObject(params);
-        Integer clubUserId = paramsMap.getInteger("clubUserId");
-        if (null == clubUserId) {
-            return ResponseJson.error("参数异常,请输入机构用户id");
+        if (StringUtils.isEmpty(name)) {
+            return ResponseJson.error("参数异常,请输入姓名");
+        }
+        if (StringUtils.isEmpty(mobile)) {
+            return ResponseJson.error("参数异常,请输入手机号");
         }
-        return authClubService.unbindCode(clubUserId);
+        return authClubService.saveClubUser(clubUserId, authId, name, mobile);
     }
 
-    @ApiOperation("更新邀请码")
-    @PostMapping("/user/code/update")
+    @ApiOperation("删除机构用户")
+    @PostMapping("/user/delete")
     @ApiImplicitParam(name = "params", value = "clubUserId:机构用户id", required = true)
-    public ResponseJson updateCode(@RequestBody String params) {
+    public ResponseJson deleteClubUser(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         Integer clubUserId = paramsMap.getInteger("clubUserId");
         if (null == clubUserId) {
-            return ResponseJson.error("参数异常,请输入机构用户id");
+            return ResponseJson.error("参数异常,机构用户id不能为空");
         }
-        return authClubService.updateCode(clubUserId);
+        return authClubService.deleteClubUser(clubUserId);
     }
 }

+ 20 - 21
src/main/java/com/caimei/controller/auth/AuthProductApi.java

@@ -86,7 +86,7 @@ public class AuthProductApi {
      *                   productId              授权商品id
      *                   authId                 授权id
      *                   brandId                品牌id
-     *                   productName            商品名称
+     *                   productTypeId          设备分类id
      *                   snCode                 商品SN码
      *                   productImage           商品图片
      *                   certificateImage       授权牌照
@@ -141,15 +141,15 @@ public class AuthProductApi {
     }
 
     @ApiOperation("添加/编辑设备分类")
-    @ApiImplicitParams({
-            @ApiImplicitParam(required = false, name = "productTypeId", value = "设备分类id"),
-            @ApiImplicitParam(required = false, name = "authUserId", value = "供应商用户id"),
-            @ApiImplicitParam(required = false, name = "name", value = "设备分类名称"),
-            @ApiImplicitParam(required = false, name = "image", value = "图片"),
-            @ApiImplicitParam(required = false, name = "createBy", value = "创建人用户id")
-    })
+    @ApiImplicitParam(name = "params", value = "productTypeId:设备分类id;authUserId:供应商用户id;name:设备分类名称;image:图片;createBy:创建人用户id;", required = true)
     @PostMapping("/type/save")
-    public ResponseJson saveProductType(Integer productTypeId, Integer authUserId, String name, String image, Integer createBy) {
+    public ResponseJson saveProductType(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer productTypeId = paramsMap.getInteger("productTypeId");
+        Integer authUserId = paramsMap.getInteger("authUserId");
+        String name = paramsMap.getString("name");
+        String image = paramsMap.getString("image");
+        Integer createBy = paramsMap.getInteger("createBy");
         if (null == authUserId) {
             return ResponseJson.error("参数异常,供应商用户id不能为空");
         }
@@ -173,12 +173,11 @@ public class AuthProductApi {
     }
 
     @ApiOperation("更新设备分类状态")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "设备分类id", value = "productTypeId", required = true),
-            @ApiImplicitParam(name = "上线状态:0已下线,1已上线,2待上线", value = "status", required = true)
-    })
+    @ApiImplicitParam(name = "params", value = "productTypeId:设备分类id;status:上线状态:0已下线,1已上线,2待上线", required = true)
     @PostMapping("/type/update/status")
-    public ResponseJson updateProductTypeStatus(Integer productTypeId, Integer status) {
+    public ResponseJson updateProductTypeStatus(@RequestBody Map<String,Integer> params) {
+        Integer productTypeId = params.get("productTypeId");
+        Integer status = params.get("status");
         if (productTypeId == null) {
             return ResponseJson.error("请输入设备分类id");
         }
@@ -221,14 +220,14 @@ public class AuthProductApi {
     }
 
     @ApiOperation("审核设备分类")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "productTypeId", required = true, value = "供应商用户id"),
-            @ApiImplicitParam(name = "auditStatus", required = true, value = "审核状态:0审核未通过,1审核通过,2待审核"),
-            @ApiImplicitParam(name = "invalidReason", required = false, value = "审核不通过原因"),
-            @ApiImplicitParam(name = "auditBy", required = true, value = "审核人用户id")
-    })
+    @ApiImplicitParam(name = "params", value = "productTypeId:设备分类id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;invalidReason:审核不通过原因;auditBy:审核人用户id", required = true)
     @PostMapping("/type/audit")
-    public ResponseJson auditProduct(Integer productTypeId, Integer auditStatus, String invalidReason, Integer auditBy) {
+    public ResponseJson auditProductType(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer productTypeId = paramsMap.getInteger("productTypeId");
+        Integer auditStatus = paramsMap.getInteger("auditStatus");
+        String invalidReason = paramsMap.getString("invalidReason");
+        Integer auditBy = paramsMap.getInteger("auditBy");
         if (productTypeId == null) {
             return ResponseJson.error("请输入商品id");
         }

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

@@ -49,7 +49,7 @@ public class DoctorApi {
     public ResponseJson<PageInfo<DoctorListVo>> getDoctorList(Integer listType, Integer authUserId, Integer doctorType, String doctorName, String certificateNo, Integer status, Integer auditStatus,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return doctorService.getDoctorList(listType, authUserId, doctorName, certificateNo, status, auditStatus, pageNum, pageSize);
+        return doctorService.getDoctorList(listType, authUserId, doctorType, doctorName, certificateNo, status, auditStatus, pageNum, pageSize);
     }
 
     /**
@@ -89,22 +89,26 @@ public class DoctorApi {
      * 添加/编辑医师
      */
     @ApiOperation("添加/编辑医师")
-    @ApiImplicitParam(name = "params", value = "doctorId:医师id;authUserId:供应商用户id;authId:机构id;doctorName:医师姓名;" +
-            "certificateNo:从业资格证编号;clubName:所在机构;createBy:创建人id;bannerList:轮播图列表;" +
-            "doctorImage:医师照片;equipmentList([{equipmentName:'',brand:'',image:''}]);tagList(['标签1','标签2'];" +
-            "paramList([{name:'参数1',content:'内容1'},{}]))", required = true)
+    @ApiImplicitParam(name = "params", value = "doctorId:医师id;authUserId:供应商用户id;authId:机构id;doctorType:医师类型:1操作医师,2培训医师;" +
+            "doctorName:医师姓名;" +"certificateNo:从业资格证编号;clubName:所在机构;createBy:创建人id;" +
+            "bannerList:轮播图列表;" +"doctorImage:医师照片;equipmentList([{equipmentName:'',brand:'',image:''}]);" +
+            "tagList(['标签1','标签2'];" + "paramList([{name:'参数1',content:'内容1'}..]))", required = true)
     @PostMapping("/save")
     public ResponseJson saveDoctor(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         Integer doctorId = paramsMap.getInteger("doctorId");
         Integer authUserId = paramsMap.getInteger("authUserId");
+        Integer authId = paramsMap.getInteger("authId");
+        Integer doctorType = paramsMap.getInteger("doctorType");
         String doctorName = paramsMap.getString("doctorName");
         String certificateNo = paramsMap.getString("certificateNo");
         String clubName = paramsMap.getString("clubName");
         String doctorImage = paramsMap.getString("doctorImage");
         Integer createBy = paramsMap.getInteger("createBy");
         List<String> bannerList = (List<String>) paramsMap.get("bannerList");
+        List<String> tagList = (List<String>) paramsMap.get("tagList");
         List<Map<String,Object>> equipmentList = (List<Map<String,Object>>) paramsMap.get("equipmentList");
+        List<Map<String,String>> paramList = (List<Map<String,String>>) paramsMap.get("paramList");
 
         /*
             组装医师数据
@@ -112,12 +116,14 @@ public class DoctorApi {
         CmBrandDoctorPo doctor = new CmBrandDoctorPo();
         doctor.setId(doctorId);
         doctor.setAuthUserId(authUserId);
+        doctor.setAuthId(authId);
+        doctor.setDoctorType(doctorType);
         doctor.setName(doctorName);
         doctor.setImage(doctorImage);
         doctor.setCertificateNo(certificateNo);
         doctor.setClubName(clubName);
         doctor.setCreateBy(createBy);
-        return doctorService.saveDoctor(doctor, bannerList, equipmentList);
+        return doctorService.saveDoctor(doctor, bannerList, equipmentList, tagList, paramList);
     }
 
 

+ 1 - 1
src/main/java/com/caimei/controller/auth/ArticleApi.java → src/main/java/com/caimei/controller/data/ArticleApi.java

@@ -1,4 +1,4 @@
-package com.caimei.controller.auth;
+package com.caimei.controller.data;
 
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;

+ 6 - 4
src/main/java/com/caimei/controller/data/FileApi.java

@@ -36,6 +36,7 @@ public class FileApi {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1文件列表,2文件审核列表"),
             @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
+            @ApiImplicitParam(name = "fileType", required = false, value = "文件类型:1单个文件,2资料包"),
             @ApiImplicitParam(name = "fileTitle", required = false, value = "文件标题"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
             @ApiImplicitParam(name = "status", required = false, value = "文件状态:0已下线,1已上线,2待上线"),
@@ -43,24 +44,25 @@ public class FileApi {
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/list")
-    public ResponseJson<PageInfo<FileListVo>> getFileList(Integer listType, Integer authUserId, String fileTitle, Integer auditStatus, Integer status,
+    public ResponseJson<PageInfo<FileListVo>> getFileList(Integer listType, Integer authUserId, Integer fileType, String fileTitle, Integer auditStatus, Integer status,
                                                           @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                           @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return fileService.getFileList(listType, authUserId, fileTitle, auditStatus, status, pageNum, pageSize);
+        return fileService.getFileList(listType, authUserId, fileType, fileTitle, auditStatus, status, pageNum, pageSize);
     }
 
     @ApiOperation("添加/编辑文件")
-    @ApiImplicitParam(name = "params", required = false, value = "fileId:文件id;authUserId:供应商用户id;fileTitle:文件标题;fileName:文件名称;filePreviewUrl:文件预览链接;fileDownloadUrl:oss名称")
+    @ApiImplicitParam(name = "params", required = false, value = "fileId:文件id;authUserId:供应商用户id;fileType:文件类型:1单个文件,2资料包;fileTitle:文件标题;fileName:文件名称;filePreviewUrl:文件预览链接;fileDownloadUrl:oss名称")
     @PostMapping("/save")
     public ResponseJson saveFile(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         Integer fileId = paramsMap.getInteger("fileId");
         Integer authUserId = paramsMap.getInteger("authUserId");
+        Integer fileType = paramsMap.getInteger("fileType");
         String fileTitle = paramsMap.getString("fileTitle");
         String fileName = paramsMap.getString("fileName");
         String filePreviewUrl = paramsMap.getString("filePreviewUrl");
         String fileDownloadUrl = paramsMap.getString("fileDownloadUrl");
-        return fileService.saveFile(fileId, authUserId, fileTitle, fileName, filePreviewUrl, fileDownloadUrl);
+        return fileService.saveFile(fileId, authUserId, fileType, fileTitle, fileName, filePreviewUrl, fileDownloadUrl);
     }
 
     @ApiOperation("更新文件状态")

+ 23 - 8
src/main/java/com/caimei/controller/wechat/WxAuthApi.java

@@ -66,18 +66,32 @@ public class WxAuthApi {
         return authClubService.getWxClubDetails(authId);
     }
 
-    @ApiOperation("已认证商品列表")
+    @ApiOperation("设备分类列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "appId", required = true, value = "供应商公众号appId"),
-            @ApiImplicitParam(name = "productName", required = false, value = "商品名称"),
+            @ApiImplicitParam(name = "productTypeName", required = false, value = "设备分类名称"),
+            @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
+            @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
+    })
+    @GetMapping("/product/type/list")
+    public ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(String appId, String name,
+                                                                    @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                                    @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+        return authProductService.getWxProductTypeList(appId, name, pageNum, pageSize);
+    }
+
+    @ApiOperation("已认证商品列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productTypeId", required = true, value = "设备分类id"),
+            @ApiImplicitParam(name = "snCode", required = false, value = "sn码后四位"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/product/list")
-    public ResponseJson<PageInfo<WxProductListVo>> getWxProductList(String appId, String productName,
+    public ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer productTypeId, String snCode,
                                                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                                     @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authProductService.getWxProductList(appId, productName, pageNum, pageSize);
+        return authProductService.getWxProductList(productTypeId, snCode, pageNum, pageSize);
     }
 
     @ApiOperation("已认证商品详情")
@@ -90,15 +104,16 @@ public class WxAuthApi {
     @ApiOperation("已认证医师列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "appId", required = true, value = "供应商公众号appId"),
+            @ApiImplicitParam(name = "doctorType", required = false, value = "医师类型:1操作医师,2培训医师"),
             @ApiImplicitParam(name = "doctorName", required = false, value = "医师名称"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/doctor/list")
-    public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, String doctorName,
-                                                                   @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-                                                                   @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return doctorService.getWxDoctorList(appId, doctorName, pageNum, pageSize);
+    public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, Integer doctorType, String doctorName,
+                                                                  @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                                  @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+        return doctorService.getWxDoctorList(appId, doctorType, doctorName, pageNum, pageSize);
     }
 
     @ApiOperation("已认证医师详情")

+ 3 - 2
src/main/java/com/caimei/controller/wechat/WxDataApi.java

@@ -83,15 +83,16 @@ public class WxDataApi {
     @ApiOperation("资料库文件列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
+            @ApiImplicitParam(name = "fileType", required = false, value = "文件类型:1单个文件,2资料包"),
             @ApiImplicitParam(name = "fileTitle", required = false, value = "文章名称"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/file/list")
-    public ResponseJson<PageInfo<WxFileListVo>> getWxFileList(Integer authUserId, String fileTitle,
+    public ResponseJson<PageInfo<WxFileListVo>> getWxFileList(Integer authUserId, Integer fileType, String fileTitle,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return fileService.getWxFileList(authUserId, fileTitle, pageNum, pageSize);
+        return fileService.getWxFileList(authUserId, fileType, fileTitle, pageNum, pageSize);
     }
 
 

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

@@ -3,10 +3,7 @@ package com.caimei.mapper.cmMapper;
 import com.caimei.model.po.ProductParamPo;
 import com.caimei.model.po.ProductPo;
 import com.caimei.model.po.ProductTypePo;
-import com.caimei.model.vo.ProductFormVo;
-import com.caimei.model.vo.ProductListVo;
-import com.caimei.model.vo.ProductTypeListVo;
-import com.caimei.model.vo.WxProductListVo;
+import com.caimei.model.vo.*;
 import com.caimei.module.base.entity.po.CmBrandProductParamPo;
 import com.caimei.module.base.entity.vo.AuthProductVo;
 import com.caimei.module.base.entity.vo.StatementFileVo;
@@ -55,7 +52,7 @@ public interface AuthProductMapper {
 
     void updateProductAuditStatus(@Param("productId") Integer productId, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("invalidReason") String invalidReason, @Param("auditBy") Integer auditBy, @Param("auditTime") Date auditTime);
 
-    List<WxProductListVo> getWxProductList(@Param("appId") String appId, @Param("productName") String productName);
+    List<WxProductListVo> getWxProductList(@Param("productTypeId") Integer productTypeId, @Param("productName") String productName);
 
     Integer getBrandIdByBrandName(String brand);
 
@@ -82,4 +79,6 @@ public interface AuthProductMapper {
     List<ProductTypeListVo> getProductTypeList(Integer listType, Integer authUserId, String name, Integer status, Integer auditStatus);
 
     void updateProductTypeAuditStatus(Integer productTypeId, Integer status, Integer auditStatus, String invalidReason, Integer auditBy, Date auditTime);
+
+    List<WxProductTypeListVo> getWxProductTypeList(String appId, String name);
 }

+ 5 - 8
src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java

@@ -5,7 +5,6 @@ import com.caimei.model.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -19,16 +18,10 @@ import java.util.List;
 public interface ClubMapper {
     List<ClubVo> getClubList(@Param("authUserId") Integer authUserId, @Param("clubName") String clubName);
 
-    List<ClubUserVo> getClubUserList(@Param("authId") Integer authId, @Param("mobile") String mobile, @Param("status") Integer status);
+    List<ClubUserVo> getClubUserList(@Param("authId") Integer authId, @Param("mobile") String mobile, String name, @Param("status") Integer status);
 
     void insertClubUser(ClubUserPo clubUser);
 
-    void unbindClubUser(Integer clubUserId);
-
-    void updateCode(@Param("clubUserId") Integer clubUserId, @Param("invitationCode") String invitationCode, @Param("updateTime") Date updateTime, @Param("invitationCodeTime") Date invitationCodeTime);
-
-    Integer getStatusByClubUserId(Integer clubUserId);
-
     List<WxClubListVo> getWxClubList(@Param("appId") String appId, @Param("clubName") String clubName, @Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId, @Param("townId") Integer townId, @Param("lng") Double lng, @Param("lat") Double lat);
 
     Integer checkMobile(@Param("mobile") String mobile, @Param("appId") String appId);
@@ -38,4 +31,8 @@ public interface ClubMapper {
     WxClubUserVo getWxClubUser(@Param("mobile") String mobile, @Param("appId") String appId);
 
     WxClubDetailsVo getClubDetails(Integer authId);
+
+    void updateClubUser(ClubUserPo clubUser);
+
+    void deleteClubUser(Integer clubUserId);
 }

+ 15 - 6
src/main/java/com/caimei/mapper/cmMapper/DoctorMapper.java

@@ -1,10 +1,7 @@
 package com.caimei.mapper.cmMapper;
 
 import com.caimei.model.po.CmBrandDoctorPo;
-import com.caimei.model.vo.DoctorEquipmentVo;
-import com.caimei.model.vo.DoctorFormVo;
-import com.caimei.model.vo.DoctorListVo;
-import com.caimei.model.vo.WxDoctorListVo;
+import com.caimei.model.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -20,7 +17,7 @@ import java.util.List;
 @Mapper
 public interface DoctorMapper {
 
-    List<DoctorListVo> getDoctorList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("doctorName") String doctorName, @Param("certificateNo") String certificateNo, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus);
+    List<DoctorListVo> getDoctorList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("doctorType") Integer doctorType, @Param("doctorName") String doctorName, @Param("certificateNo") String certificateNo, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus);
 
     void updateDoctorStatus(@Param("doctorId") Integer doctorId, @Param("status") Integer status);
 
@@ -48,7 +45,19 @@ public interface DoctorMapper {
 
     List<DoctorEquipmentVo> getEquipmentList(Integer doctorId);
 
-    List<WxDoctorListVo> getWxDoctorList(@Param("appId") String appId,@Param("doctorName") String doctorName);
+    List<WxDoctorListVo> getWxDoctorList(@Param("appId") String appId, @Param("doctorType") Integer doctorType, @Param("doctorName") String doctorName);
 
     DoctorFormVo getDoctorDetailsById(Integer doctorId);
+
+    void deleteTag(Integer doctorId);
+
+    void deleteParam(Integer doctorId);
+
+    void insertTag(Integer doctorId, String tag);
+
+    void insertParam(Integer doctorId, String name, String content);
+
+    List<String> getTagList(Integer doctorId);
+
+    List<ParamVo> getParamList(Integer doctorId);
 }

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

@@ -21,7 +21,7 @@ import java.util.List;
 @Mapper
 public interface FileMapper {
 
-    List<FileListVo> getFileList(Integer listType, @Param("authUserId") Integer authUserId, @Param("fileTitle") String fileTitle, @Param("auditStatus") Integer auditStatus, @Param("status") Integer status);
+    List<FileListVo> getFileList(Integer listType, @Param("authUserId") Integer authUserId, Integer fileType, @Param("fileTitle") String fileTitle, @Param("auditStatus") Integer auditStatus, @Param("status") Integer status);
 
     void insertFile(FilePo file);
 
@@ -35,7 +35,7 @@ public interface FileMapper {
 
     void updateFileSelective(FilePo file);
 
-    List<WxFileListVo> getWxFileList(@Param("authUserId") Integer authUserId, @Param("fileTitle") String fileTitle);
+    List<WxFileListVo> getWxFileList(@Param("authUserId") Integer authUserId, @Param("fileType") Integer fileType, @Param("fileTitle") String fileTitle);
 
     List<ProductImagePo> getAuthImageData();
 

+ 2 - 3
src/main/java/com/caimei/model/dto/ProductSaveDto.java

@@ -29,9 +29,8 @@ public class ProductSaveDto {
     @ApiModelProperty("品牌id")
     private Integer brandId;
 
-    @NotNull(message = "商品名称不能为空")
-    @ApiModelProperty("商品名称")
-    private String productName;
+    @ApiModelProperty("设备分类id")
+    private Integer productTypeId;
 
     @NotNull(message = "商品SN码不能为空")
     @ApiModelProperty("商品SN码")

+ 4 - 14
src/main/java/com/caimei/model/po/ClubUserPo.java

@@ -21,28 +21,18 @@ public class ClubUserPo {
      */
     private Integer authId;
 
-    /**
-     * 邀请码
-     */
-    private String invitationCode;
-
-    /**
-     * 状态:1未绑定,2已绑定,3已过期
-     */
-    private Integer status;
-
     /**
      * 添加时间
      */
     private Date addTime;
 
     /**
-     * 更新时间
+     * 姓名
      */
-    private Date updateTime;
+    private String name;
 
     /**
-     * 邀请码过期时间
+     * 手机号
      */
-    private Date invitationCodeTime;
+    private String mobile;
 }

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

@@ -72,6 +72,16 @@ public class CmBrandAuthPo {
      */
     private String logo;
 
+    /**
+     * 是否需要自定义属性:0否,1是
+     */
+    private Integer customFlag;
+
+    /**
+     * 店铺备注
+     */
+    private String remarks;
+
     /**
      * 上线状态:0已下线,1已上线,2待上线
      */

+ 10 - 0
src/main/java/com/caimei/model/po/CmBrandDoctorPo.java

@@ -18,6 +18,16 @@ public class CmBrandDoctorPo {
      */
     private Integer authUserId;
 
+    /**
+     * 机构id
+     */
+    private Integer authId;
+
+    /**
+     * 医师类型:1操作医师,2培训医师
+     */
+    private Integer doctorType;
+
     /**
      * 医师名称
      */

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

@@ -20,6 +20,11 @@ public class FilePo {
      */
     private Integer authUserId;
 
+    /**
+     * 文件类型:1单个文件,2资料包
+     */
+    private Integer fileType;
+
     /**
      * 文件标题
      */

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

@@ -28,9 +28,9 @@ public class ProductPo {
     private Integer brandId;
 
     /**
-     * 商品名称
+     * 设备分类id
      */
-    private String productName;
+    private Integer productTypeId;
 
     /**
      * sn码

+ 7 - 13
src/main/java/com/caimei/model/vo/ClubUserVo.java

@@ -19,24 +19,18 @@ public class ClubUserVo {
     @ApiModelProperty("机构id")
     private Integer authId;
 
-    @ApiModelProperty("邀请码")
-    private String invitationCode;
+    @ApiModelProperty("姓名")
+    private String name;
 
-    @ApiModelProperty("状态:0未绑定,1已绑定,2已过期")
-    private Integer status;
-
-    @ApiModelProperty("添加时间")
-    private Date addTime;
-
-    @ApiModelProperty("绑定时间")
-    private Date bindTime;
+    @ApiModelProperty("手机号")
+    private String mobile;
 
     @ApiModelProperty("微信昵称")
     private String nickName;
 
-    @ApiModelProperty("手机号")
-    private String mobile;
-
     @ApiModelProperty("openId")
     private String openId;
+
+    @ApiModelProperty("添加时间")
+    private Date addTime;
 }

+ 14 - 2
src/main/java/com/caimei/model/vo/DoctorFormVo.java

@@ -17,6 +17,12 @@ public class DoctorFormVo implements Serializable {
     @ApiModelProperty("医师id")
     private Integer doctorId;
 
+    @ApiModelProperty("机构id")
+    private Integer authId;
+
+    @ApiModelProperty("医师类型:1操作医师,2培训医师")
+    private String doctorType;
+
     @ApiModelProperty("医师名称")
     private String doctorName;
 
@@ -29,10 +35,16 @@ public class DoctorFormVo implements Serializable {
     @ApiModelProperty("医师照片")
     private String doctorImage;
 
-    @ApiModelProperty("轮播图")
+    @ApiModelProperty("轮播图列表")
     private List<String> bannerList;
 
-    @ApiModelProperty("仪器")
+    @ApiModelProperty("标签列表")
+    private List<String> tagList;
+
+    @ApiModelProperty("仪器列表")
     private List<DoctorEquipmentVo> equipmentList;
 
+    @ApiModelProperty("属性列表")
+    private List<ParamVo> paramList;
+
 }

+ 22 - 0
src/main/java/com/caimei/model/vo/ParamVo.java

@@ -0,0 +1,22 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2022/4/1
+ */
+@Data
+public class ParamVo implements Serializable {
+
+    @ApiModelProperty("属性名")
+    private String name;
+
+    @ApiModelProperty("属性内容")
+    private String content;
+}

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

@@ -17,6 +17,9 @@ public class ProductTypeListVo {
     @ApiModelProperty("设备分类名称")
     private String name;
 
+    @ApiModelProperty("设备分类图片")
+    private String image;
+
     @ApiModelProperty("上线状态:0下线,1上线,2待上线")
     private Integer status;
 

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

@@ -102,4 +102,7 @@ public class ShopListVo implements Serializable {
 
     @ApiModelProperty("医师待审核数量")
     private Integer doctorWaitNum;
+
+    @ApiModelProperty("设备分类待审核数量")
+    private Integer productTypeWaitNum;
 }

+ 8 - 0
src/main/java/com/caimei/model/vo/WxDoctorListVo.java

@@ -3,6 +3,8 @@ package com.caimei.model.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * 微信公众号商品列表
  * @author Aslee
@@ -16,6 +18,9 @@ public class WxDoctorListVo {
     @ApiModelProperty("授权机构id")
     private Integer authId;
 
+    @ApiModelProperty("医师类型:1操作医师,2培训医师")
+    private Integer doctorType;
+
     @ApiModelProperty("医师姓名")
     private String doctorName;
 
@@ -27,4 +32,7 @@ public class WxDoctorListVo {
 
     @ApiModelProperty("机构名称")
     private String clubName;
+
+    @ApiModelProperty("标签列表")
+    private List<String> tagList;
 }

+ 21 - 0
src/main/java/com/caimei/model/vo/WxProductTypeListVo.java

@@ -0,0 +1,21 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 微信公众号商品列表
+ * @author Aslee
+ * @date 2021/5/17
+ */
+@Data
+public class WxProductTypeListVo {
+    @ApiModelProperty("设备分类id")
+    private Integer productTypeId;
+
+    @ApiModelProperty("设备分类名称")
+    private String name;
+
+    @ApiModelProperty("设备分类图片")
+    private String image;
+}

+ 12 - 22
src/main/java/com/caimei/service/auth/AuthClubService.java

@@ -27,33 +27,13 @@ public interface AuthClubService {
      * 机构用户列表
      * @param authId    机构id
      * @param mobile    手机号
+     * @param name
      * @param status    状态:1未绑定,2已绑定,3已过期
      * @param pageNum   第几页
      * @param pageSize  一页多少条
      * @return  ClubUserVo
      */
-    ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, Integer status, Integer pageNum, Integer pageSize);
-
-    /**
-     * 生成邀请码
-     * @param authId
-     * @return
-     */
-    ResponseJson generateCode(Integer authId);
-
-    /**
-     * 解绑邀请码
-     * @param clubUserId
-     * @return
-     */
-    ResponseJson unbindCode(Integer clubUserId);
-
-    /**
-     * 更新邀请码
-     * @param clubUserId
-     * @return
-     */
-    ResponseJson updateCode(Integer clubUserId);
+    ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize);
 
     /**
      * 微信公众号机构列表
@@ -88,4 +68,14 @@ public interface AuthClubService {
      * @return
      */
     ResponseJson<WxShopVo> getWxShopInfo(String appId);
+
+    /**
+     * 添加/编辑机构用户
+     */
+    ResponseJson saveClubUser(Integer clubUserId, Integer authId, String name, String mobile);
+
+    /**
+     * 删除机构用户
+     */
+    ResponseJson deleteClubUser(Integer clubUserId);
 }

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

@@ -2,10 +2,7 @@ package com.caimei.service.auth;
 
 import com.caimei.model.ResponseJson;
 import com.caimei.model.dto.ProductSaveDto;
-import com.caimei.model.vo.ProductFormVo;
-import com.caimei.model.vo.ProductListVo;
-import com.caimei.model.vo.ProductTypeListVo;
-import com.caimei.model.vo.WxProductListVo;
+import com.caimei.model.vo.*;
 import com.caimei.module.base.entity.vo.AuthProductVo;
 import com.github.pagehelper.PageInfo;
 
@@ -103,13 +100,13 @@ public interface AuthProductService {
 
     /**
      * 微信公众号机构列表
-     * @param appId         供应商公众号appId
-     * @param productName   商品名称
+     * @param productTypeId         设备分类id
+     * @param snCode   sn码后四位
      * @param pageNum       第几页
      * @param pageSize      一页多少条
      * @return
      */
-    ResponseJson<PageInfo<WxProductListVo>> getWxProductList(String appId, String productName, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer productTypeId, String snCode, Integer pageNum, Integer pageSize);
 
     /**
      * 认证商品详情
@@ -147,6 +144,11 @@ public interface AuthProductService {
      * 审核设备分类
      */
     ResponseJson auditProductType(Integer productTypeId, Integer auditStatus, String invalidReason, Integer auditBy);
+
+    /**
+     * 微信设备分类列表
+     */
+    ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(String appId, String name, Integer pageNum, Integer pageSize);
 }
 
 

+ 5 - 0
src/main/java/com/caimei/service/auth/AuthService.java

@@ -101,4 +101,9 @@ public interface AuthService {
      * @return
      */
     ResponseJson<AuthFormVo> getAuthFormData(Integer authId);
+
+    /**
+     * 机构下拉框列表
+     */
+    ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId);
 }

+ 7 - 3
src/main/java/com/caimei/service/auth/DoctorService.java

@@ -23,6 +23,7 @@ public interface DoctorService {
      *
      * @param listType   列表类型:1医师列表,2医师审核列表
      * @param authUserId 供应商用户id
+     * @param doctorType
      * @param doctorName  医师
      * @param certificateNo
      * @param status    上线状态:0已下线,1已上线,2待上线
@@ -31,7 +32,7 @@ public interface DoctorService {
      * @param pageSize   一页多少条
      * @return DoctorListVo
      */
-    ResponseJson<PageInfo<DoctorListVo>> getDoctorList(Integer listType, Integer authUserId, String doctorName, String certificateNo, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<DoctorListVo>> getDoctorList(Integer listType, Integer authUserId, Integer doctorType, String doctorName, String certificateNo, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize);
 
     /**
      * 更新医师状态
@@ -55,9 +56,11 @@ public interface DoctorService {
      * @param doctor       医师机构
      * @param bannerList 轮播图列表
      * @param equipmentList 仪器列表
+     * @param tagList
+     * @param paramList
      * @return ResponseJson
      */
-    ResponseJson saveDoctor(CmBrandDoctorPo doctor, List<String> bannerList, List<Map<String,Object>> equipmentList);
+    ResponseJson saveDoctor(CmBrandDoctorPo doctor, List<String> bannerList, List<Map<String, Object>> equipmentList, List<String> tagList, List<Map<String, String>> paramList);
 
     /**
      * 审核品牌医师
@@ -80,12 +83,13 @@ public interface DoctorService {
     /**
      * 微信公众号医师列表
      * @param appId
+     * @param doctorType
      * @param doctorName
      * @param pageNum
      * @param pageSize
      * @return
      */
-    ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, String doctorName, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, Integer doctorType, String doctorName, Integer pageNum, Integer pageSize);
 
     /**
      * 认证医师详情

+ 27 - 50
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -52,64 +52,16 @@ public class AuthClubServiceImpl implements AuthClubService {
     }
 
     @Override
-    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authId, String mobile, Integer status, Integer pageNum, Integer pageSize) {
+    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);
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authId, mobile, status);
+        List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authId, mobile, name, status);
         PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
         return ResponseJson.success(pageData);
     }
 
-    @Override
-    public ResponseJson generateCode(Integer authId) {
-        // 生成邀请码
-        String invitationCode = CodeUtil.generateCodeInt(6);
-        Date currentTime = new Date();
-        Calendar calendar = new GregorianCalendar();
-        calendar.setTime(currentTime);
-        calendar.add(Calendar.DATE,1);
-        Date tomorrowTime = calendar.getTime();
-        // 构建机构用户
-        ClubUserPo clubUser = new ClubUserPo();
-        clubUser.setAuthId(authId);
-        clubUser.setAddTime(currentTime);
-        clubUser.setUpdateTime(currentTime);
-        clubUser.setInvitationCode(invitationCode);
-        clubUser.setStatus(0);
-        clubUser.setInvitationCodeTime(tomorrowTime);
-        // 插入机构用户
-        clubMapper.insertClubUser(clubUser);
-        return ResponseJson.success("生成邀请码成功");
-    }
-
-    @Override
-    public ResponseJson unbindCode(Integer clubUserId) {
-        Integer status = clubMapper.getStatusByClubUserId(clubUserId);
-        if (1 != status) {
-            return ResponseJson.error("该邀请码未绑定,无法解绑");
-        }
-        clubMapper.unbindClubUser(clubUserId);
-        return ResponseJson.success("解绑成功");
-    }
-
-    @Override
-    public ResponseJson updateCode(Integer clubUserId) {
-        Integer status = clubMapper.getStatusByClubUserId(clubUserId);
-        if (1 == status) {
-            return ResponseJson.error("该邀请码已绑定用户,无法更新");
-        }
-        Date updateTime = new Date();
-        Calendar calendar = new GregorianCalendar();
-        calendar.setTime(updateTime);
-        calendar.add(Calendar.DATE,1);
-        Date invitationCodeTime = calendar.getTime();
-        String invitationCode = CodeUtil.generateCodeInt(6);
-        clubMapper.updateCode(clubUserId, invitationCode, updateTime, invitationCodeTime);
-        return ResponseJson.success("更新邀请码成功");
-    }
-
     @Override
     public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(String appId, String lngAndLat, String clubName, Integer provinceId,
                                                               Integer cityId, Integer townId, Integer pageNum, Integer pageSize) {
@@ -170,4 +122,29 @@ public class AuthClubServiceImpl implements AuthClubService {
         }
         return ResponseJson.success(shop);
     }
+
+    @Override
+    public ResponseJson saveClubUser(Integer clubUserId, Integer authId, String name, String mobile) {
+        // 是否为添加操作
+        boolean insertFlag = null == clubUserId;
+        // 构建机构用户
+        ClubUserPo clubUser = new ClubUserPo();
+        clubUser.setAuthId(authId);
+        clubUser.setName(name);
+        clubUser.setMobile(mobile);
+        if (insertFlag) {
+            clubUser.setAddTime(new Date());
+            clubMapper.insertClubUser(clubUser);
+        } else {
+            clubUser.setId(clubUserId);
+            clubMapper.updateClubUser(clubUser);
+        }
+        return ResponseJson.success("保存机构用户成功");
+    }
+
+    @Override
+    public ResponseJson deleteClubUser(Integer clubUserId) {
+        clubMapper.deleteClubUser(clubUserId);
+        return null;
+    }
 }

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

@@ -8,10 +8,7 @@ import com.caimei.model.dto.ProductSaveDto;
 import com.caimei.model.po.ProductParamPo;
 import com.caimei.model.po.ProductPo;
 import com.caimei.model.po.ProductTypePo;
-import com.caimei.model.vo.ProductFormVo;
-import com.caimei.model.vo.ProductListVo;
-import com.caimei.model.vo.ProductTypeListVo;
-import com.caimei.model.vo.WxProductListVo;
+import com.caimei.model.vo.*;
 import com.caimei.module.base.entity.vo.AuthProductVo;
 import com.caimei.module.base.entity.vo.StatementFileVo;
 import com.caimei.service.auth.AuthProductService;
@@ -117,7 +114,7 @@ public class AuthProductServiceImpl implements AuthProductService {
         Integer productId = productSaveDto.getProductId();
         Integer authId = productSaveDto.getAuthId();
         Integer brandId = productSaveDto.getBrandId();
-        String productName = productSaveDto.getProductName();
+        Integer productTypeId = productSaveDto.getProductTypeId();
         String snCode = productSaveDto.getSnCode();
         String productImage = productSaveDto.getProductImage();
         String certificateImage = productSaveDto.getCertificateImage();
@@ -131,8 +128,8 @@ public class AuthProductServiceImpl implements AuthProductService {
         if (null == brandId) {
             return ResponseJson.error("参数异常,请输入品牌id", null);
         }
-        if (StringUtils.isBlank(productName)) {
-            return ResponseJson.error("参数异常,请输入商品名称", null);
+        if (null == productTypeId) {
+            return ResponseJson.error("参数异常,请输入设备分类id", null);
         }
         if (StringUtils.isBlank(snCode)) {
             return ResponseJson.error("参数异常,请输入商品SN码", null);
@@ -169,7 +166,7 @@ public class AuthProductServiceImpl implements AuthProductService {
         // 品牌id
         product.setBrandId(brandId);
         // 商品名称
-        product.setProductName(productName);
+        product.setProductTypeId(productTypeId);
         // sn码
         product.setSnCode(snCode);
         // 商品图片
@@ -406,12 +403,15 @@ public class AuthProductServiceImpl implements AuthProductService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxProductListVo>> getWxProductList(String appId, String productName, Integer pageNum, Integer pageSize) {
-        if (null == appId) {
-            return ResponseJson.error("参数异常,请输入供应商appId", null);
+    public ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer productTypeId, String snCode, Integer pageNum, Integer pageSize) {
+        if (null == productTypeId) {
+            return ResponseJson.error("参数异常,请输入设备分类id", null);
+        }
+        if (StringUtils.isNotEmpty(snCode) && 4 != snCode.length()) {
+            return ResponseJson.error("参数异常,请输入SN码后四位", null);
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<WxProductListVo> productList = authProductMapper.getWxProductList(appId, productName);
+        List<WxProductListVo> productList = authProductMapper.getWxProductList(productTypeId, snCode);
         PageInfo<WxProductListVo> pageData = new PageInfo<>(productList);
         return ResponseJson.success(pageData);
     }
@@ -512,4 +512,12 @@ public class AuthProductServiceImpl implements AuthProductService {
         return ResponseJson.success("审核设备分类成功");
     }
 
+    @Override
+    public ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(String appId, String name, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<WxProductTypeListVo> productTypeList = authProductMapper.getWxProductTypeList(appId, name);
+        PageInfo<WxProductTypeListVo> pageData = new PageInfo<>(productTypeList);
+        return ResponseJson.success(pageData);
+    }
+
 }

+ 6 - 11
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -99,17 +99,6 @@ public class AuthServiceImpl implements AuthService {
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
         List<AuthVo> authList = authMapper.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus);
-        ListIterator<AuthVo> iterator = authList.listIterator();
-        while (iterator.hasNext()) {
-            // 根据是否完成商品信息审核筛选项,进行筛选
-            AuthVo auth = iterator.next();
-            Integer waitAuditNum = auth.getWaitAuditNum();
-            if (waitAuditNum > 0) {
-                auth.setLowerAuditStatus(0);
-            } else {
-                auth.setLowerAuditStatus(1);
-            }
-        }
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         return ResponseJson.success(pageData);
     }
@@ -166,6 +155,12 @@ public class AuthServiceImpl implements AuthService {
         return ResponseJson.success(authFormVo);
     }
 
+    @Override
+    public ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId) {
+        List<AuthVo> authList = authMapper.getAuthList(1, authUserId, null, null, null, null);
+        return ResponseJson.success(authList);
+    }
+
     @Override
     public ResponseJson saveAuth(CmBrandAuthPo auth, List<String> bannerList, boolean importFlag) {
         Integer authId = auth.getId();

+ 42 - 10
src/main/java/com/caimei/service/auth/impl/DoctorServiceImpl.java

@@ -36,13 +36,16 @@ public class DoctorServiceImpl implements DoctorService {
     private String imageDomain;
 
     @Override
-    public ResponseJson<PageInfo<DoctorListVo>> getDoctorList(Integer listType, Integer authUserId, String doctorName, String certificateNo, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<DoctorListVo>> getDoctorList(Integer listType, Integer authUserId, Integer doctorType, String doctorName, String certificateNo, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize) {
         if (null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id", null);
         }
+        if (null == doctorType) {
+            return ResponseJson.error("参数异常,医师类型不能为空", null);
+        }
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
-        List<DoctorListVo> doctorList = doctorMapper.getDoctorList(listType, authUserId, doctorName, certificateNo, status, auditStatus);
+        List<DoctorListVo> doctorList = doctorMapper.getDoctorList(listType, authUserId, doctorType, doctorName, certificateNo, status, auditStatus);
         PageInfo<DoctorListVo> pageData = new PageInfo<>(doctorList);
         return ResponseJson.success(pageData);
     }
@@ -74,6 +77,10 @@ public class DoctorServiceImpl implements DoctorService {
         doctorMapper.deleteBanner(doctorId);
         // 删除仪器
         doctorMapper.deleteEquipment(doctorId);
+        // 删除标签
+        doctorMapper.deleteTag(doctorId);
+        // 删除属性
+        doctorMapper.deleteParam(doctorId);
         return ResponseJson.success("删除医师成功");
     }
 
@@ -94,11 +101,17 @@ public class DoctorServiceImpl implements DoctorService {
         // 仪器
         List<DoctorEquipmentVo> equipmentList = doctorMapper.getEquipmentList(doctorId);
         doctorFormVo.setEquipmentList(equipmentList);
+        // 标签
+        List<String> tagList = doctorMapper.getTagList(doctorId);
+        doctorFormVo.setTagList(tagList);
+        // 属性
+        List<ParamVo> paramList = doctorMapper.getParamList(doctorId);
+        doctorFormVo.setParamList(paramList);
         return ResponseJson.success(doctorFormVo);
     }
 
     @Override
-    public ResponseJson saveDoctor(CmBrandDoctorPo doctor, List<String> bannerList, List<Map<String,Object>> equipmentList) {
+    public ResponseJson saveDoctor(CmBrandDoctorPo doctor, List<String> bannerList, List<Map<String, Object>> equipmentList, List<String> tagList, List<Map<String, String>> paramList) {
         Integer doctorId = doctor.getId();
         Integer authUserId = doctor.getAuthUserId();
         String certificateNo = doctor.getCertificateNo();
@@ -115,9 +128,12 @@ public class DoctorServiceImpl implements DoctorService {
         if (null != doctorIdByCertificateNo && !doctorIdByCertificateNo.equals(doctorId)) {
             return ResponseJson.error("参数异常,该从业资格证编号已存在,请重新输入", null);
         }
-        if (StringUtils.isBlank(doctor.getClubName())) {
+        if (StringUtils.isBlank(doctor.getClubName()) && null == doctor.getAuthId()) {
             return ResponseJson.error("参数异常,请输入所属机构");
         }
+        if (null == doctor.getDoctorType()) {
+            return ResponseJson.error("参数异常,请输入医师类型");
+        }
         if (StringUtils.isBlank(doctor.getImage())) {
             return ResponseJson.error("参数异常,请上传医师照片");
         }
@@ -144,13 +160,19 @@ public class DoctorServiceImpl implements DoctorService {
             doctorMapper.deleteBanner(doctor.getId());
             // 删除原有的设备
             doctorMapper.deleteEquipment(doctor.getId());
+            // 删除原有的标签
+            doctorMapper.deleteTag(doctor.getId());
+            // 删除原有的属性
+            doctorMapper.deleteParam(doctor.getId());
         }
         // 保存轮播图
         bannerList.forEach(banner-> doctorMapper.insertBanner(doctor.getId(), banner));
         // 保存设备
-        equipmentList.forEach(equipment-> {
-            doctorMapper.insertEquipment(doctor.getId(), (String) equipment.get("equipmentName"), (String) equipment.get("brand"), (String) equipment.get("image"));
-        });
+        equipmentList.forEach(equipment-> doctorMapper.insertEquipment(doctor.getId(), (String) equipment.get("equipmentName"), (String) equipment.get("brand"), (String) equipment.get("image")));
+        // 保存标签
+        tagList.forEach(tag -> doctorMapper.insertTag(doctor.getId(), tag));
+        // 保存属性
+        paramList.forEach(param -> doctorMapper.insertParam(doctor.getId(), param.get("name"), param.get("content")));
         return ResponseJson.success("保存医师成功", doctor);
     }
 
@@ -183,13 +205,17 @@ public class DoctorServiceImpl implements DoctorService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, String doctorName, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, Integer doctorType, String doctorName, Integer pageNum, Integer pageSize) {
         if (null == appId) {
             return ResponseJson.error("参数异常,请输入供应商appId", null);
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<WxDoctorListVo> productList = doctorMapper.getWxDoctorList(appId, doctorName);
-        PageInfo<WxDoctorListVo> pageData = new PageInfo<>(productList);
+        List<WxDoctorListVo> doctorList = doctorMapper.getWxDoctorList(appId, doctorType, doctorName);
+        doctorList.forEach(doctor->{
+            List<String> tagList = doctorMapper.getTagList(doctor.getDoctorId());
+            doctor.setTagList(tagList);
+        });
+        PageInfo<WxDoctorListVo> pageData = new PageInfo<>(doctorList);
         return ResponseJson.success(pageData);
     }
 
@@ -208,6 +234,12 @@ public class DoctorServiceImpl implements DoctorService {
         // 仪器
         List<DoctorEquipmentVo> equipmentList = doctorMapper.getEquipmentList(doctorId);
         doctor.setEquipmentList(equipmentList);
+        // 标签
+        List<String> tagList = doctorMapper.getTagList(doctorId);
+        doctor.setTagList(tagList);
+        // 属性
+        List<ParamVo> paramList = doctorMapper.getParamList(doctorId);
+        doctor.setParamList(paramList);
         return ResponseJson.success(doctor);
     }
 }

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

@@ -62,7 +62,8 @@ public class ShopServiceImpl implements ShopService {
             int videoWaitNum = shop.getVideoWaitNum();
             int fileWaitNum = shop.getFileWaitNum();
             int doctorWaitNum = shop.getDoctorWaitNum();
-            int waitAuditNum = 2 == listType ? shop.getWaitAuditNum() : (3 == listType ? (articleWaitNum + imageWaitNum + videoWaitNum + fileWaitNum) : (4 == listType ? doctorWaitNum : 0));
+            int productTypeWaitNum = shop.getProductTypeWaitNum();
+            int waitAuditNum = 2 == listType ? shop.getWaitAuditNum() : (3 == listType ? (articleWaitNum + imageWaitNum + videoWaitNum + fileWaitNum) : (4 == listType ? doctorWaitNum : (6 == listType ? productTypeWaitNum : 0)));
             if (waitAuditNum > 0) {
                 shop.setLowerAuditStatus(0);
             }else {

+ 6 - 3
src/main/java/com/caimei/service/data/FileService.java

@@ -19,6 +19,7 @@ public interface FileService {
      *
      * @param listType      列表类型:1文件列表,2文件审核列表
      * @param authUserId    供应商用户id
+     * @param fileType
      * @param fileTitle    文件标题
      * @param auditStatus   审核状态
      * @param status        上线状态
@@ -26,19 +27,20 @@ public interface FileService {
      * @param pageSize      一页多少条
      * @return  FileVo
      */
-    ResponseJson<PageInfo<FileListVo>> getFileList(Integer listType, Integer authUserId, String fileTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<FileListVo>> getFileList(Integer listType, Integer authUserId, Integer fileType, String fileTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize);
 
     /**
      * 添加/编辑文件
      * @param fileId           文件id
      * @param authUserId        供应商用户id
+     * @param fileType
      * @param fileTitle        文件标题
      * @param fileName        文件名称
      * @param filePreviewUrl      文件预览链接
      * @param fileDownloadUrl          oss名称
      * @return  ResponseJson
      */
-    ResponseJson saveFile(Integer fileId, Integer authUserId, String fileTitle, String fileName, String filePreviewUrl, String fileDownloadUrl);
+    ResponseJson saveFile(Integer fileId, Integer authUserId, Integer fileType, String fileTitle, String fileName, String filePreviewUrl, String fileDownloadUrl);
 
     /**
      * 更新文件状态
@@ -68,12 +70,13 @@ public interface FileService {
     /**
      * 微信公众号文件列表
      * @param authUserId        供应商用户id
+     * @param fileType
      * @param fileTitle          文件名称
      * @param pageNum           第几页
      * @param pageSize          一页多少条
      * @return
      */
-    ResponseJson<PageInfo<WxFileListVo>> getWxFileList(Integer authUserId, String fileTitle, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<WxFileListVo>> getWxFileList(Integer authUserId, Integer fileType, String fileTitle, Integer pageNum, Integer pageSize);
 
     void download();
 

+ 11 - 5
src/main/java/com/caimei/service/data/impl/FileServiceImpl.java

@@ -54,19 +54,20 @@ public class FileServiceImpl implements FileService {
     private String active;
 
     @Override
-    public ResponseJson<PageInfo<FileListVo>> getFileList(Integer listType, Integer authUserId, String fileTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<FileListVo>> getFileList(Integer listType, Integer authUserId, Integer fileType, String fileTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize) {
         if (null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id", null);
         }
         listType = null == listType ? 1 : listType;
+        fileType = null == fileType ? 1 : fileType;
         PageHelper.startPage(pageNum, pageSize);
-        List<FileListVo> fileList = fileMapper.getFileList(listType, authUserId, fileTitle, auditStatus, status);
+        List<FileListVo> fileList = fileMapper.getFileList(listType, authUserId, fileType, fileTitle, auditStatus, status);
         PageInfo<FileListVo> pageData = new PageInfo<>(fileList);
         return ResponseJson.success(pageData);
     }
 
     @Override
-    public ResponseJson saveFile(Integer fileId, Integer authUserId, String fileTitle, String fileName, String filePreviewUrl, String fileDownloadUrl) {
+    public ResponseJson saveFile(Integer fileId, Integer authUserId, Integer fileType, String fileTitle, String fileName, String filePreviewUrl, String fileDownloadUrl) {
         if (null == fileId && null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id");
         }
@@ -79,10 +80,14 @@ public class FileServiceImpl implements FileService {
         if (null == filePreviewUrl || null == fileDownloadUrl) {
             return ResponseJson.error("参数异常,请上传文件");
         }
+        if (null == fileType) {
+            fileType = 1;
+        }
         /*
             组装文件数据
         */
         FilePo dataFile = new FilePo();
+        dataFile.setFileType(fileType);
         dataFile.setTitle(fileTitle);
         dataFile.setPreviewUrl(filePreviewUrl);
         dataFile.setDownloadUrl(fileDownloadUrl);
@@ -162,12 +167,13 @@ public class FileServiceImpl implements FileService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxFileListVo>> getWxFileList(Integer authUserId, String fileTitle, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<WxFileListVo>> getWxFileList(Integer authUserId,Integer fileType, String fileTitle, Integer pageNum, Integer pageSize) {
         if (null == authUserId) {
             return ResponseJson.error("参数异常,供应商用户id不能为空", null);
         }
+        fileType = null == fileType ? 1 : fileType;
         PageHelper.startPage(pageNum, pageSize);
-        List<WxFileListVo> fileList = fileMapper.getWxFileList(authUserId, fileTitle);
+        List<WxFileListVo> fileList = fileMapper.getWxFileList(authUserId, fileType, fileTitle);
         PageInfo<WxFileListVo> pageData = new PageInfo<>(fileList);
         return ResponseJson.success(pageData);
     }

+ 6 - 2
src/main/resources/mapper/AuthMapper.xml

@@ -3,9 +3,9 @@
 <mapper namespace="com.caimei.mapper.cmMapper.AuthMapper">
     <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,
-                                   mobile, logo, status, createTime, createBy, auditStatus, delFlag)
+                                   mobile, logo, customFLag, remarks, status, createTime, createBy, auditStatus, delFlag)
         values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
-                #{mobile}, #{logo}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{delFlag})
+                #{mobile}, #{logo}, #{customFLag}, #{remarks}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{delFlag})
     </insert>
     <insert id="insertBanner">
         insert into cm_brand_auth_banner (authId, banner)
@@ -27,6 +27,8 @@
             lat         = #{lat},
             mobile      = #{mobile},
             logo        = #{logo},
+            customFlag  = #{customFlag},
+            remarks     = #{remarks},
             status      = #{status},
             auditStatus = #{auditStatus}
         where id = #{id}
@@ -110,6 +112,8 @@
                lat,
                mobile,
                logo,
+               customFlag,
+               remarks
                status
         from cm_brand_auth a
                  left join province p on a.provinceId = p.provinceID

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

@@ -2,11 +2,11 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.mapper.cmMapper.AuthProductMapper">
     <insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
-        insert into cm_brand_auth_product(`authId`, `brandId`, `name`, `snCode`, `image`,`pcImage`,`appletsImage`,
+        insert into cm_brand_auth_product(`authId`, `brandId`, `productTypeId`, `snCode`, `image`,`pcImage`,`appletsImage`,
                                           `originalCertificateImage`,`certificateImage`,`pcCertificateImage`,
                                           `appletsCertificateImage`, `addQrCodeFlag`,`addTemplateType`, `status`,
                                           `auditStatus`,`createTime`, `createBy`)
-        values (#{authId}, #{brandId}, #{productName}, #{snCode}, #{productImage}, #{pcImage}, #{appletsImage},
+        values (#{authId}, #{brandId}, #{productTypeId}, #{snCode}, #{productImage}, #{pcImage}, #{appletsImage},
                 #{originalCertificateImage}, #{certificateImage}, #{pcCertificateImage},
                 #{appletsCertificateImage}, #{addQrCodeFlag}, #{addTemplateType}, #{status},
                 #{auditStatus}, #{createTime},#{createBy})
@@ -28,7 +28,7 @@
         update cm_brand_auth_product
         <set>
             `brandId`          = #{brandId},
-            `name`             = #{productName},
+            `productTypeId`    = #{productTypeId},
             `snCode`           = #{snCode},
             `image`            = #{productImage},
             `certificateImage` = #{certificateImage},
@@ -190,9 +190,9 @@
         from cm_brand_auth_product p
         left join cm_brand_auth a on p.authId = a.id
         left join cm_brand_auth_user au on a.authUserId = au.authUserId
-        where au.appId = #{appId}
-        <if test="productName != null and productName != ''">
-            and p.name like concat('%',#{productName},'%')
+        where p.productTypeId = #{productTypeId}
+        <if test="snCode != null and snCode != ''">
+            and p.snCode like concat('%',#{snCode})
         </if>
         and au.status = 1
         and a.status = 1
@@ -267,7 +267,7 @@
         order by p.createTime desc
     </select>
     <select id="getProductTypeList" resultType="com.caimei.model.vo.ProductTypeListVo">
-        select id as productTypeId,t.name as productName,t.status,t.auditStatus,t.createTime,cu.name as createBy,
+        select id as productTypeId,t.name,t.image,t.status,t.auditStatus,t.createTime,cu.name as createBy,
         au.name as auditBy,t.auditTime,t.invalidReason
         from cm_brand_product_type t
         left join cm_brand_auth_user cu on t.createBy = cu.authUserId
@@ -291,4 +291,14 @@
             </otherwise>
         </choose>
     </select>
+    <select id="getWxProductTypeList" resultType="com.caimei.model.vo.WxProductTypeListVo">
+        select t.id as productTypeId,t.name,t.image
+        from cm_brand_product_type t
+            left join cm_brand_auth_user u on t.authUserId = u.authUserId
+        where u.appId = #{appId}
+        <if test="name != null and name != ''">
+            and t.name like concat('%',#{name},'%')
+        </if>
+        order by t.id desc
+    </select>
 </mapper>

+ 14 - 31
src/main/resources/mapper/ClubMapper.xml

@@ -2,24 +2,21 @@
 <!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">
     <insert id="insertClubUser">
-        insert into cm_brand_club_user (authId, invitationCode, status, addTime, updateTime, invitationCodeTime,
-                                        delFlag)
-        values (#{authId}, #{invitationCode}, #{status}, #{addTime}, #{updateTime}, #{invitationCodeTime}, 0)
+        insert into cm_brand_club_user (authId, name, mobile, addTime, delFlag)
+        values (#{authId}, #{name}, #{mobile}, #{addTime}, 0)
     </insert>
     <insert id="insertFeedback">
         insert into cm_brand_club_feedback(clubUserId, content, commitTime, handleStatus)
         values (#{clubUserId}, #{content}, NOW(), 0)
     </insert>
-    <update id="unbindClubUser">
-        update cm_brand_club_user set delFlag = 1 where id = #{clubUserId}
-    </update>
-    <update id="updateCode">
+    <update id="updateClubUser">
         update cm_brand_club_user
-        set invitationCode     = #{invitationCode},
-            status             = 0,
-            invitationCodeTime = #{invitationCodeTime},
-            updateTime         = #{updateTime}
-        where id = #{clubUserId}
+        set name   = #{name},
+            mobile = #{mobile}
+        where id = #{id}
+    </update>
+    <update id="deleteClubUser">
+        update cm_brand_club_user set delFlag = 1 where id = #{clubUserId}
     </update>
     <select id="getClubList" resultType="com.caimei.model.vo.ClubVo">
         select id as authId,authParty as clubName,createTime
@@ -32,37 +29,23 @@
     <select id="getClubUserList" resultType="com.caimei.model.vo.ClubUserVo">
         select id as clubUserId,
         authId,
-        invitationCode,
-        IF(status = 0, (IF(NOW() >= invitationCodeTime, 2, 0)), status) as status,
+        name,
+        mobile,
         addTime,
-        bindTime,
         nickName,
         mobile,
         openId
         from cm_brand_club_user
         where authId = #{authId}
         and delFlag = 0
+        <if test="name != null and name != ''">
+            and name like concat('%',#{name},'%')
+        </if>
         <if test="mobile != null and mobile != ''">
             and mobile like concat('%',#{mobile},'%')
         </if>
-        <if test="status != null">
-            <if test="status == 0">
-                and status = 0 and NOW() <![CDATA[<=]]> invitationCodeTime
-            </if>
-            <if test="status == 2">
-                and status = 0 and NOW() >= invitationCodeTime
-            </if>
-            <if test="status == 1">
-                and status = 1
-            </if>
-        </if>
         order by addTime desc
     </select>
-    <select id="getStatusByClubUserId" resultType="java.lang.Integer">
-        select IF(status = 0, (IF(NOW() >= invitationCodeTime, 2, 0)), status)
-        from cm_brand_club_user
-        where id = #{clubUserId}
-    </select>
     <select id="getWxClubList" resultType="com.caimei.model.vo.WxClubListVo">
         select id as authId, authParty as clubName,concat(ifnull(p.name,''),ifnull(c.name,''),ifnull(t.name,'')) as area,a.address,a.mobile,a.logo,
         ifnull(round(st_distance(point(a.lng,a.lat),point(#{lng},#{lat}))*111195/1000,2),99999) as distance

+ 34 - 5
src/main/resources/mapper/DoctorMapper.xml

@@ -2,9 +2,9 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.mapper.cmMapper.DoctorMapper">
     <insert id="insertDoctor" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.model.po.CmBrandDoctorPo">
-        insert into cm_brand_doctor (authUserId, name, certificateNo, clubName, image, status, createTime, createBy,
+        insert into cm_brand_doctor (authUserId, authId, doctorType, name, certificateNo, clubName, image, status, createTime, createBy,
                                      auditStatus)
-        values (#{authUserId}, #{name}, #{certificateNo}, #{clubName}, #{image}, #{status}, NOW(), #{createBy}, #{auditStatus})
+        values (#{authUserId}, #{authId}, #{doctorType}, #{name}, #{certificateNo}, #{clubName}, #{image}, #{status}, NOW(), #{createBy}, #{auditStatus})
     </insert>
     <insert id="insertBanner">
         insert into cm_brand_doctor_banner (doctorId, banner)
@@ -14,6 +14,14 @@
         insert into cm_brand_doctor_equipment(doctorId, name, brand, image)
         values (#{doctorId}, #{equipmentName}, #{brand}, #{image})
     </insert>
+    <insert id="insertTag">
+        insert into cm_brand_doctor_tag (doctorId, tag)
+        VALUES (#{doctorId}, #{tag})
+    </insert>
+    <insert id="insertParam">
+        insert into cm_brand_doctor_equipment(doctorId, name, content)
+        values (#{doctorId}, #{name}, #{content})
+    </insert>
     <update id="updateDoctorStatus">
         update cm_brand_doctor
         set status = #{status}
@@ -21,7 +29,9 @@
     </update>
     <update id="updateDoctorByDoctorId">
         update cm_brand_doctor
-        set name          = #{name},
+        set authId        = #{authId},
+            doctorType    = #{doctorType},
+            name          = #{name},
             certificateNo = #{certificateNo},
             clubName      = #{clubName},
             image         = #{image},
@@ -47,13 +57,19 @@
     <delete id="deleteEquipment">
         delete from cm_brand_doctor_equipment where doctorId = #{doctorId}
     </delete>
+    <delete id="deleteTag">
+        delete from cm_brand_doctor_tag where doctorId = #{doctorId}
+        </delete>
+    <delete id="deleteParam">
+        delete from cm_brand_doctor_param where doctorId = #{doctorId}
+        </delete>
     <select id="getDoctorList" resultType="com.caimei.model.vo.DoctorListVo">
         select id as doctorId, a.name as doctorName,a.certificateNo, a.status, a.auditStatus, a.createTime, cu.name as createBy,
                au.name as auditBy,a.auditTime,a.invalidReason
         from cm_brand_doctor 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.authUserId = #{authUserId}
+        where a.authUserId = #{authUserId} and doctorType = #{doctorType}
         <if test="doctorName != null and doctorName != ''">
             and a.name like CONCAT('%',#{doctorName},'%')
         </if>
@@ -77,6 +93,7 @@
     </select>
     <select id="getDoctorById" resultType="com.caimei.model.po.CmBrandDoctorPo">
         select id,
+               authId,
                name,
                authUserId,
                certificateNo,
@@ -102,10 +119,13 @@
         where doctorId = #{doctorId}
     </select>
     <select id="getWxDoctorList" resultType="com.caimei.model.vo.WxDoctorListVo">
-        select d.id as doctorId, d.name as doctorName,d.certificateNo,d.clubName,d.image as doctorImage
+        select d.id as doctorId, d.doctorType, d.name as doctorName,d.certificateNo,d.clubName,d.image as doctorImage
         from cm_brand_doctor d
         left join cm_brand_auth_user au on d.authUserId = au.authUserId
         where au.appId = #{appId}
+        <if test="doctorType != null">
+            and d.doctorType = #{doctorType}
+        </if>
         <if test="doctorName != null and doctorName != ''">
             and d.name like concat('%',#{doctorName},'%')
         </if>
@@ -115,6 +135,7 @@
     </select>
     <select id="getDoctorDetailsById" resultType="com.caimei.model.vo.DoctorFormVo">
         select id     as doctorId,
+               d.doctorType,
                d.name as doctorName,
                certificateNo,
                clubName,
@@ -126,4 +147,12 @@
           and d.status = 1
           and d.auditStatus = 1
     </select>
+    <select id="getTagList" resultType="java.lang.String">
+        select tag from cm_brand_doctor_tag where doctorId = #{doctorId}
+    </select>
+    <select id="getParamList" resultType="com.caimei.model.vo.ParamVo">
+        select name, content
+        from cm_brand_doctor_param
+        where doctorId = #{doctorId}
+    </select>
 </mapper>

+ 7 - 3
src/main/resources/mapper/FileMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.mapper.cmMapper.FileMapper">
     <insert id="insertFile" keyColumn="id" keyProperty="id" parameterType="com.caimei.model.po.FilePo" useGeneratedKeys="true">
-        insert into cm_brand_file(authUserId, title, name, previewUrl, downloadUrl, auditStatus, status, createTime)
-        values (#{authUserId}, #{title}, #{name}, #{previewUrl}, #{downloadUrl}, #{auditStatus}, #{status},
+        insert into cm_brand_file(authUserId, fileType, title, name, previewUrl, downloadUrl, auditStatus, status, createTime)
+        values (#{authUserId}, #{fileType}, #{title}, #{name}, #{previewUrl}, #{downloadUrl}, #{auditStatus}, #{status},
                 #{createTime})
     </insert>
     <insert id="insertCourseFile">
@@ -34,6 +34,9 @@
     <update id="updateFileSelective">
         update cm_brand_file
         <set>
+            <if test="fileType != null">
+                fileType = #{fileType},
+            </if>
             <if test="title != null and title != ''">
                 title = #{title},
             </if>
@@ -76,7 +79,7 @@
         au.name as auditBy,a.auditTime
         from cm_brand_file a
         left join cm_brand_auth_user au on a.auditBy = au.authUserId
-        where a.authUserId = #{authUserId}
+        where a.authUserId = #{authUserId} and fileType = #{fileType}
         <if test="fileTitle != null and fileTitle != ''">
             and a.title like concat('%',#{fileTitle},'%')
         </if>
@@ -101,6 +104,7 @@
         from cm_brand_file a
         where authUserId = #{authUserId}
         and status = 1
+        and fileType = #{fileType}
         <if test="fileTitle != null and fileTitle != ''">
             and title like concat('%',#{fileTitle},'%')
         </if>