瀏覽代碼

ldm版本part6

Aslee 3 年之前
父節點
當前提交
6afbb4547d
共有 27 個文件被更改,包括 127 次插入83 次删除
  1. 1 1
      src/main/java/com/caimei/controller/vip/VipApi.java
  2. 2 2
      src/main/java/com/caimei/controller/wechat/LoginApi.java
  3. 33 14
      src/main/java/com/caimei/controller/wechat/WxAuthApi.java
  4. 3 1
      src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java
  5. 1 1
      src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java
  6. 1 1
      src/main/java/com/caimei/mapper/cmMapper/DoctorMapper.java
  7. 1 1
      src/main/java/com/caimei/mapper/cmMapper/ShopMapper.java
  8. 3 0
      src/main/java/com/caimei/model/vo/ProductFormVo.java
  9. 3 0
      src/main/java/com/caimei/model/vo/WxShopVo.java
  10. 9 8
      src/main/java/com/caimei/service/auth/AuthClubService.java
  11. 2 1
      src/main/java/com/caimei/service/auth/AuthProductService.java
  12. 3 2
      src/main/java/com/caimei/service/auth/DoctorService.java
  13. 9 8
      src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java
  14. 13 2
      src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java
  15. 9 5
      src/main/java/com/caimei/service/auth/impl/DoctorServiceImpl.java
  16. 2 2
      src/main/java/com/caimei/service/auth/impl/ShopServiceImpl.java
  17. 0 3
      src/main/java/com/caimei/service/data/impl/FileServiceImpl.java
  18. 0 6
      src/main/java/com/caimei/service/sys/impl/SysUserServiceImpl.java
  19. 2 2
      src/main/java/com/caimei/service/wechat/LoginService.java
  20. 2 2
      src/main/java/com/caimei/service/wechat/SDKService.java
  21. 10 7
      src/main/java/com/caimei/service/wechat/impl/LoginServiceImpl.java
  22. 1 1
      src/main/java/com/caimei/task/LdmTask.java
  23. 8 2
      src/main/resources/mapper/AuthProductMapper.xml
  24. 1 1
      src/main/resources/mapper/ClubMapper.xml
  25. 6 5
      src/main/resources/mapper/DoctorMapper.xml
  26. 0 3
      src/main/resources/mapper/FileMapper.xml
  27. 2 2
      src/main/resources/mapper/ShopMapper.xml

+ 1 - 1
src/main/java/com/caimei/controller/vip/VipApi.java

@@ -136,7 +136,7 @@ public class VipApi {
         if (null == packageId) {
             return ResponseJson.error("参数异常,会员套餐id不能为空");
         }
-        return vipService.payVip(authUserId, packageId, null, 2, 1, new Date());
+        return vipService.payVip(authUserId, packageId, "", 2, 1, new Date());
     }
 
     @ApiOperation("会员服务配置表单数据")

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

@@ -44,9 +44,9 @@ public class LoginApi {
     public ResponseJson sendVerifyCode(@RequestBody String params) {
         JSONObject parseObject = JSONObject.parseObject(params);
         String mobile = parseObject.getString("mobile");
-        String appId = parseObject.getString("appId");
+        Integer authUserId = parseObject.getInteger("authUserId");
         Integer type = parseObject.getInteger("type");
-        return loginService.sendVerifyCode(mobile, appId, type);
+        return loginService.sendVerifyCode(mobile, authUserId, type);
     }
 
     @ApiOperation("服务号验证码登录")

+ 33 - 14
src/main/java/com/caimei/controller/wechat/WxAuthApi.java

@@ -13,6 +13,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.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -34,15 +35,22 @@ public class WxAuthApi {
     private final DoctorService doctorService;
 
     @ApiOperation("供应商信息")
-    @ApiImplicitParam(name = "appId", required = true, value = "供应商公众号appId")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
+            @ApiImplicitParam(name = "appId", required = false, value = "供应商公众号appId")
+    })
     @GetMapping("/shop/info")
-    public ResponseJson<WxShopVo> getWxShopInfo(String appId) {
-        return authClubService.getWxShopInfo(appId);
+    public ResponseJson<WxShopVo> getWxShopInfo(Integer authUserId, String appId) {
+        if (null == authUserId && StringUtils.isEmpty(appId)) {
+            return ResponseJson.error("参数异常,供应商用户id和appId不能同时为空", null);
+        }
+        return authClubService.getWxShopInfo(authUserId, appId);
     }
 
     @ApiOperation("已认证机构列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "appId", required = true, value = "供应商公众号appId"),
+            @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
+            @ApiImplicitParam(name = "appId", required = false, value = "供应商公众号appId"),
             @ApiImplicitParam(name = "lngAndLat", required = false, value = "用户当前经纬度"),
             @ApiImplicitParam(name = "clubName", required = false, value = "机构名称"),
             @ApiImplicitParam(name = "provinceId", required = false, value = "省id"),
@@ -52,11 +60,14 @@ public class WxAuthApi {
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/club/list")
-    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(String appId, String lngAndLat, String clubName, Integer provinceId,
+    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String clubName, Integer provinceId,
                                                               Integer cityId, Integer townId,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authClubService.getWxClubList(appId, lngAndLat, clubName, provinceId, cityId, townId, pageNum, pageSize);
+        if (null == authUserId && StringUtils.isEmpty(appId)) {
+            return ResponseJson.error("参数异常,供应商用户id和appId不能同时为空", null);
+        }
+        return authClubService.getWxClubList(authUserId, appId, lngAndLat, clubName, provinceId, cityId, townId, pageNum, pageSize);
     }
 
     @ApiOperation("已认证机构详情")
@@ -68,16 +79,20 @@ public class WxAuthApi {
 
     @ApiOperation("设备分类列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "appId", required = true, value = "供应商公众号appId"),
+            @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
+            @ApiImplicitParam(name = "appId", required = false, value = "供应商公众号appId"),
             @ApiImplicitParam(name = "name", 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);
+    public ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(Integer authUserId, String appId, String name,
+                                                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+        if (null == authUserId && StringUtils.isEmpty(appId)) {
+            return ResponseJson.error("参数异常,供应商用户id和appId不能同时为空", null);
+        }
+        return authProductService.getWxProductTypeList(authUserId, appId, name, pageNum, pageSize);
     }
 
     @ApiOperation("已认证商品列表")
@@ -103,17 +118,21 @@ public class WxAuthApi {
 
     @ApiOperation("已认证医师列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "appId", required = true, value = "供应商公众号appId"),
+            @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
+            @ApiImplicitParam(name = "appId", required = false, 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, Integer doctorType, String doctorName,
+    public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(Integer authUserId, 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);
+        if (null == authUserId && StringUtils.isEmpty(appId)) {
+            return ResponseJson.error("参数异常,供应商用户id和appId不能同时为空", null);
+        }
+        return doctorService.getWxDoctorList(authUserId, appId, doctorType, doctorName, pageNum, pageSize);
     }
 
     @ApiOperation("已认证医师详情")

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

@@ -80,7 +80,9 @@ public interface AuthProductMapper {
 
     void updateProductTypeAuditStatus(Integer productTypeId, Integer status, Integer auditStatus, String invalidReason, Integer auditBy, Date auditTime);
 
-    List<WxProductTypeListVo> getWxProductTypeList(String appId, String name);
+    List<WxProductTypeListVo> getWxProductTypeList(Integer authUserId, String name);
 
     ProductTypePo getProductType(Integer productTypeId);
+
+    Integer getProductCountByTypeId(Integer productTypeId);
 }

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

@@ -22,7 +22,7 @@ public interface ClubMapper {
 
     void insertClubUser(ClubUserPo clubUser);
 
-    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);
+    List<WxClubListVo> getWxClubList(@Param("authUserId") Integer authUserId, @Param("clubName") String clubName, @Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId, @Param("townId") Integer townId, @Param("lng") Double lng, @Param("lat") Double lat);
 
     Integer checkMobile(@Param("mobile") String mobile, @Param("appId") String appId);
 

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

@@ -45,7 +45,7 @@ public interface DoctorMapper {
 
     List<DoctorEquipmentVo> getEquipmentList(Integer doctorId);
 
-    List<WxDoctorListVo> getWxDoctorList(@Param("appId") String appId, @Param("authId") Integer authId, @Param("doctorType") Integer doctorType, @Param("doctorName") String doctorName);
+    List<WxDoctorListVo> getWxDoctorList(@Param("authUserId") Integer authUserId, @Param("authId") Integer authId, @Param("doctorType") Integer doctorType, @Param("doctorName") String doctorName);
 
     DoctorFormVo getDoctorDetailsById(Integer doctorId);
 

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

@@ -84,7 +84,7 @@ public interface ShopMapper {
 
     List<String> getShopBrands(Integer authUserId);
 
-    WxShopVo getWxShopInfo(String appId);
+    WxShopVo getWxShopInfo(Integer authUserId);
 
     Integer getWxAccountTypeByAppId(String appId);
 

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

@@ -26,6 +26,9 @@ public class ProductFormVo {
     @ApiModelProperty("品牌名称")
     private String brandName;
 
+    @ApiModelProperty("设备分类id")
+    private Integer productTypeId;
+
     @ApiModelProperty("商品名称")
     private String productName;
 

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

@@ -17,6 +17,9 @@ public class WxShopVo implements Serializable {
     @ApiModelProperty("供应商用户id")
     private Integer authUserId;
 
+    @ApiModelProperty("appId")
+    private String appId;
+
     @ApiModelProperty("供应商名称")
     private String shopName;
 

+ 9 - 8
src/main/java/com/caimei/service/auth/AuthClubService.java

@@ -38,13 +38,13 @@ public interface AuthClubService {
     /**
      * 微信公众号机构列表
      *
-     * @param appId    供应商公众号appId
-     * @param clubName 机构名称
-     * @param pageNum  第几页
-     * @param pageSize 一页多少条
+     * @param authUserId 供应商用户id
+     * @param clubName   机构名称
+     * @param pageNum    第几页
+     * @param pageSize   一页多少条
      * @return
      */
-    ResponseJson<PageInfo<WxClubListVo>> getWxClubList(String appId, String lngAndLat, String clubName, Integer provinceId,
+    ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String clubName, Integer provinceId,
                                                        Integer cityId, Integer townId, Integer pageNum, Integer pageSize);
 
     /**
@@ -63,11 +63,12 @@ public interface AuthClubService {
     ResponseJson<WxClubDetailsVo> getWxClubDetails(Integer authId);
 
     /**
-     * 根据appId获取供应商信息
-     * @param appId
+     * 根据authUserId获取供应商信息
+     *
+     * @param authUserId
      * @return
      */
-    ResponseJson<WxShopVo> getWxShopInfo(String appId);
+    ResponseJson<WxShopVo> getWxShopInfo(Integer authUserId, String appId);
 
     /**
      * 添加/编辑机构用户

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

@@ -148,7 +148,8 @@ public interface AuthProductService {
     /**
      * 微信设备分类列表
      */
-    ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(String appId, String name, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(Integer authUserId, String appId, String name, Integer pageNum, Integer pageSize);
+
 }
 
 

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

@@ -82,14 +82,15 @@ public interface DoctorService {
 
     /**
      * 微信公众号医师列表
-     * @param appId
+     *
+     * @param authUserId
      * @param doctorType
      * @param doctorName
      * @param pageNum
      * @param pageSize
      * @return
      */
-    ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, Integer doctorType, String doctorName, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(Integer authUserId, String appId, Integer doctorType, String doctorName, Integer pageNum, Integer pageSize);
 
     /**
      * 认证医师详情

+ 9 - 8
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -63,10 +63,10 @@ public class AuthClubServiceImpl implements AuthClubService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(String appId, String lngAndLat, String clubName, Integer provinceId,
+    public ResponseJson<PageInfo<WxClubListVo>> getWxClubList(Integer authUserId, String appId, String lngAndLat, String clubName, Integer provinceId,
                                                               Integer cityId, Integer townId, Integer pageNum, Integer pageSize) {
-        if (null == appId) {
-            return ResponseJson.error("参数异常,请输入供应商公众号appId", null);
+        if (null == authUserId && StringUtils.isNotEmpty(appId)) {
+            authUserId = shopMapper.getUserIdByAppId(appId);
         }
         log.info("查询机构数据,经纬度:" + lngAndLat);
         Double lng = null;
@@ -76,7 +76,8 @@ public class AuthClubServiceImpl implements AuthClubService {
             lng = Double.parseDouble(split[0]);
             lat = Double.parseDouble(split[1]);
         }
-        List<WxClubListVo> clubList = clubMapper.getWxClubList(appId, clubName, provinceId, cityId, townId, lng, lat);
+        PageHelper.startPage(pageNum, pageSize);
+        List<WxClubListVo> clubList = clubMapper.getWxClubList(authUserId, clubName, provinceId, cityId, townId, lng, lat);
         PageInfo<WxClubListVo> pageData = new PageInfo<>(clubList);
         return ResponseJson.success(pageData);
     }
@@ -119,11 +120,11 @@ public class AuthClubServiceImpl implements AuthClubService {
     }
 
     @Override
-    public ResponseJson<WxShopVo> getWxShopInfo(String appId) {
-        if (StringUtils.isEmpty(appId)) {
-            return ResponseJson.error("参数异常,请输入appId", null);
+    public ResponseJson<WxShopVo> getWxShopInfo(Integer authUserId, String appId) {
+        if (null == authUserId && StringUtils.isNotEmpty(appId)) {
+            authUserId = shopMapper.getUserIdByAppId(appId);
         }
-        WxShopVo shop = shopMapper.getWxShopInfo(appId);
+        WxShopVo shop = shopMapper.getWxShopInfo(authUserId);
         if (null == shop) {
             return ResponseJson.error("供应商不存在", null);
         }

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

@@ -3,6 +3,7 @@ package com.caimei.service.auth.impl;
 import com.aliyun.oss.OSS;
 import com.aliyun.oss.OSSClientBuilder;
 import com.caimei.mapper.cmMapper.AuthProductMapper;
+import com.caimei.mapper.cmMapper.ShopMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.dto.ProductSaveDto;
 import com.caimei.model.po.ProductParamPo;
@@ -46,6 +47,9 @@ public class AuthProductServiceImpl implements AuthProductService {
     @Resource
     private AuthProductMapper authProductMapper;
 
+    @Resource
+    private ShopMapper shopMapper;
+
     @Value("${caimei.imageDomain}")
     private String imageDomain;
 
@@ -468,6 +472,10 @@ public class AuthProductServiceImpl implements AuthProductService {
 
     @Override
     public ResponseJson deleteProductType(Integer productTypeId) {
+        Integer count = authProductMapper.getProductCountByTypeId(productTypeId);
+        if (count > 0) {
+            return ResponseJson.error("该设备有绑定设备认证,暂时无法删除");
+        }
         authProductMapper.deleteProductType(productTypeId);
         return ResponseJson.success("删除设备分类成功");
     }
@@ -509,9 +517,12 @@ public class AuthProductServiceImpl implements AuthProductService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(String appId, String name, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<WxProductTypeListVo>> getWxProductTypeList(Integer authUserId, String appId, String name, Integer pageNum, Integer pageSize) {
+        if (null == authUserId && StringUtils.isNotEmpty(appId)) {
+            authUserId = shopMapper.getUserIdByAppId(appId);
+        }
         PageHelper.startPage(pageNum, pageSize);
-        List<WxProductTypeListVo> productTypeList = authProductMapper.getWxProductTypeList(appId, name);
+        List<WxProductTypeListVo> productTypeList = authProductMapper.getWxProductTypeList(authUserId, name);
         PageInfo<WxProductTypeListVo> pageData = new PageInfo<>(productTypeList);
         return ResponseJson.success(pageData);
     }

+ 9 - 5
src/main/java/com/caimei/service/auth/impl/DoctorServiceImpl.java

@@ -1,6 +1,7 @@
 package com.caimei.service.auth.impl;
 
 import com.caimei.mapper.cmMapper.DoctorMapper;
+import com.caimei.mapper.cmMapper.ShopMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.CmBrandDoctorPo;
 import com.caimei.model.vo.*;
@@ -29,6 +30,9 @@ public class DoctorServiceImpl implements DoctorService {
     @Resource
     private DoctorMapper doctorMapper;
 
+    @Resource
+    private ShopMapper shopMapper;
+
     @Value("${spring.profiles.active}")
     private String active;
 
@@ -210,13 +214,13 @@ public class DoctorServiceImpl implements DoctorService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, Integer doctorType, String doctorName, Integer pageNum, Integer pageSize) {
-        if (null == appId) {
-            return ResponseJson.error("参数异常,请输入供应商appId", null);
+    public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(Integer authUserId, String appId, Integer doctorType, String doctorName, Integer pageNum, Integer pageSize) {
+        if (null == authUserId && StringUtils.isNotEmpty(appId)) {
+            authUserId = shopMapper.getUserIdByAppId(appId);
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<WxDoctorListVo> doctorList = doctorMapper.getWxDoctorList(appId, null, doctorType, doctorName);
-        doctorList.forEach(doctor->{
+        List<WxDoctorListVo> doctorList = doctorMapper.getWxDoctorList(authUserId, null, doctorType, doctorName);
+        doctorList.forEach(doctor -> {
             List<String> tagList = doctorMapper.getTagList(doctor.getDoctorId());
             doctor.setTagList(tagList);
         });

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

@@ -268,8 +268,8 @@ public class ShopServiceImpl implements ShopService {
                 // 短信发送失败重试一次
                 AliyunSmsUtil.sendSms(mobile, 14, "{password:\"" + password + "\"}");
             }
-            // 给供应商分配供应商基础角色和试用期会员基础角色
-            sysUserService.saveRoleRelation(shop.getAuthUserId(), "1,2");
+            // 给供应商分配供应商基础角色
+            sysUserService.saveRoleRelation(shop.getAuthUserId(), "1");
             log.info("添加供应商,供应商用户id:" + shop.getAuthUserId());
         } else {
             shop.setAuthUserId(authUserId);

+ 0 - 3
src/main/java/com/caimei/service/data/impl/FileServiceImpl.java

@@ -55,9 +55,6 @@ public class FileServiceImpl implements FileService {
 
     @Override
     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);

+ 0 - 6
src/main/java/com/caimei/service/sys/impl/SysUserServiceImpl.java

@@ -83,12 +83,6 @@ public class SysUserServiceImpl implements SysUserService {
                     systemMapper.deleteUserRoleRelation(id);
                     // 赋予基础供应商角色
                     saveRoleRelation(id, "1");
-                } else {
-                    // 会员到期但还在试用期内
-                    // 删除用户角色关联
-                    systemMapper.deleteUserRoleRelation(id);
-                    // 赋予基础供应商角色和会员基础角色
-                    saveRoleRelation(id, "1,2");
                 }
             }
             List<Integer> roleIds = setUserRoleInfo(sysUser);

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

@@ -22,11 +22,11 @@ public interface LoginService {
      * 发送登录验证码
      *
      * @param mobile
-     * @param appId
+     * @param authUserId
      * @param type
      * @return
      */
-    ResponseJson sendVerifyCode(String mobile, String appId, Integer type);
+    ResponseJson sendVerifyCode(String mobile, Integer authUserId, Integer type);
 
     /**
      * 服务号验证码登录

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

@@ -14,11 +14,11 @@ public interface SDKService {
 
     /**
      * 获取公众号配置数据
-     * @param authUserId         供应商用户id
+     * @param appId         供应商公众号appId
      * @param url           公众号url
      * @return
      */
-    ResponseJson<Map<String, String>> getConfigData(String authUserId, String url) throws Exception;
+    ResponseJson<Map<String, String>> getConfigData(String appId, String url) throws Exception;
 
     /**
      * 获取公众号类型

+ 10 - 7
src/main/java/com/caimei/service/wechat/impl/LoginServiceImpl.java

@@ -8,6 +8,7 @@ import com.caimei.mapper.cmMapper.ShopMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.ClubUserPo;
 import com.caimei.model.po.CmBrandAuthPo;
+import com.caimei.model.vo.ShopFormVo;
 import com.caimei.model.vo.WxClubUserVo;
 import com.caimei.service.wechat.LoginService;
 import com.caimei.utils.CodeUtil;
@@ -84,31 +85,33 @@ public class LoginServiceImpl implements LoginService {
     }
 
     @Override
-    public ResponseJson sendVerifyCode(String mobile, String appId, Integer type) {
+    public ResponseJson sendVerifyCode(String mobile, Integer authUserId, Integer type) {
         if (StringUtils.isEmpty(mobile)) {
             return ResponseJson.error("参数异常,请输入手机号");
         }
-        if (StringUtils.isEmpty(appId)) {
-            return ResponseJson.error("参数异常,请输入appId");
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id");
         }
         // 获取供应商名称
-        String shopName = shopMapper.getShopNameByAppId(appId);
-        if (StringUtils.isEmpty(shopName)) {
+        ShopFormVo shop = shopMapper.getShopByUserId(authUserId);
+        String shopName = "";
+        if (null == shop) {
             return ResponseJson.error("供应商不存在");
         } else {
+            shopName = shop.getShopName();
             if (shopName.contains("上海品辉")) {
                 shopName = "上海品辉";
             }
         }
         String verifyCode = CodeUtil.generateCodeInt(6);
         String content = "欢迎登录" + shopName + "会员,您的短信验证码为:" + verifyCode + ",该验证码 5 分钟内有效,请勿泄漏于他人。";
-        /*Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
+        Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
         if (!sendSms) {
             log.info("会员登录验证码发送失败,手机号:" + mobile);
             return ResponseJson.error("发送失败,请确认手机号无误");
         } else {
             log.info("会员登录验证码发送成功,手机号:" + mobile + ",验证码:" + verifyCode);
-        }*/
+        }
         log.info(content);
         redisService.set("code:" + mobile, verifyCode, 300L);
         return ResponseJson.success("发送成功");

+ 1 - 1
src/main/java/com/caimei/task/LdmTask.java

@@ -44,7 +44,7 @@ public class LdmTask {
     /**
      * 每天凌晨1点读取ldm数据库机构数据,存入采美数据库中
      */
-    @Scheduled(cron = "0 0 1 * * ?")
+    @Scheduled(cron = "0 0 0/30 * * ?")
     public void readLdmData() {
         AtomicReference<Integer> ldmLatestClubId = new AtomicReference<>(authMapper.getLdmLatestClubId());
         List<LdmDataPo> ldmDataList = ldmMapper.getLdmClubData(ldmLatestClubId.get());

+ 8 - 2
src/main/resources/mapper/AuthProductMapper.xml

@@ -81,7 +81,9 @@
             <if test="appletsImage != null and appletsImage != ''">
                 appletsImage = #{appletsImage},
             </if>
-            image = #{image}
+            image = #{image},
+            status = #{status},
+            auditStatus = #{auditStatus}
         where id = #{productTypeId}
     </update>
     <update id="updateProductTypeStatus">
@@ -143,6 +145,7 @@
         select p.`id`    as productId,
                `authId`,
                `brandId`,
+               p.productTypeId,
                t.name  as productName,
                `snCode`,
                t.`image` as productImage,
@@ -302,7 +305,7 @@
         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} and t.delFlag = 0
+        where u.authUserId = #{authUserId} and t.delFlag = 0
         <if test="name != null and name != ''">
             and t.name like concat('%',#{name},'%')
         </if>
@@ -313,4 +316,7 @@
         from cm_brand_product_type
         where id = #{productTypeId};
     </select>
+    <select id="getProductCountByTypeId" resultType="java.lang.Integer">
+        select count(*) from cm_brand_auth_product where productTypeId = #{productTypeId}
+    </select>
 </mapper>

+ 1 - 1
src/main/resources/mapper/ClubMapper.xml

@@ -54,7 +54,7 @@
         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 au.appId = #{appId}
+        where au.authUserId = #{authUserId}
         and a.status = 1
         and a.auditStatus = 1
         and a.delFlag = 0

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

@@ -127,8 +127,8 @@
         au.status = 1
         and d.status = 1
         and d.auditStatus = 1
-        <if test="appId != null and appId != ''">
-            and au.appId = #{appId}
+        <if test="authUserId != null and authUserId != ''">
+            and au.authUserId = #{authUserId}
         </if>
         <if test="authId != null">
             and d.authId = #{authId}
@@ -144,15 +144,16 @@
         and d.auditStatus = 1
     </select>
     <select id="getDoctorDetailsById" resultType="com.caimei.model.vo.DoctorFormVo">
-        select id     as doctorId,
+        select d.id     as doctorId,
                d.doctorType,
                d.name as doctorName,
                certificateNo,
-               clubName,
+               ifnull(cba.authParty,d.clubName) as clubName,
                image  as doctorImage
         from cm_brand_doctor d
                  left join cm_brand_auth_user au on d.authUserId = au.authUserId
-        where id = #{doctorId}
+                 left join cm_brand_auth cba on d.authId = cba.id
+        where d.id = #{doctorId}
           and au.status = 1
           and d.status = 1
           and d.auditStatus = 1

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

@@ -34,9 +34,6 @@
     <update id="updateFileSelective">
         update cm_brand_file
         <set>
-            <if test="fileType != null">
-                fileType = #{fileType},
-            </if>
             <if test="title != null and title != ''">
                 title = #{title},
             </if>

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

@@ -355,11 +355,11 @@
         where i.authUserId = #{authUserId}
     </select>
     <select id="getWxShopInfo" resultType="com.caimei.model.vo.WxShopVo">
-        select au.authUserId, au.name as shopName, if(au.shopType = 1, cb.authLogo, au.logo) as logo
+        select au.authUserId, au.appId, au.name as shopName, if(au.shopType = 1, cb.authLogo, au.logo) as logo
         from cm_brand_auth_user au
                  left join cm_brand_auth_shop_info si on au.authUserId = si.authUserId
                  left join cm_brand cb on si.brandId = cb.id
-        where au.appId = #{appId}
+        where au.authUserId = #{authUserId}
         and au.status = 1
         limit 1
     </select>