Просмотр исходного кода

Merge remote-tracking branch 'origin/developer' into developerD

# Conflicts:
#	src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java
#	src/main/resources/mapper/ClubMapper.xml
huangzhiguo 1 год назад
Родитель
Сommit
b69b8de2f6
33 измененных файлов с 712 добавлено и 469 удалено
  1. 25 9
      src/main/java/com/caimei365/user/components/WeChatService.java
  2. 2 2
      src/main/java/com/caimei365/user/controller/HeHeApi.java
  3. 34 3
      src/main/java/com/caimei365/user/controller/LoginApi.java
  4. 1 0
      src/main/java/com/caimei365/user/controller/RegisterApi.java
  5. 13 0
      src/main/java/com/caimei365/user/mapper/BaseMapper.java
  6. 0 8
      src/main/java/com/caimei365/user/mapper/ClubMapper.java
  7. 3 3
      src/main/java/com/caimei365/user/mapper/HeHeMapper.java
  8. 2 1
      src/main/java/com/caimei365/user/mapper/MessageCenterMapper.java
  9. 1 9
      src/main/java/com/caimei365/user/mapper/SuperVipMapper.java
  10. 4 0
      src/main/java/com/caimei365/user/model/dto/ClubRegisterDto.java
  11. 1 1
      src/main/java/com/caimei365/user/model/dto/HeHeUserDto.java
  12. 3 3
      src/main/java/com/caimei365/user/model/po/CmUser.java
  13. 0 9
      src/main/java/com/caimei365/user/model/po/UserPo.java
  14. 44 0
      src/main/java/com/caimei365/user/model/po/WxUnion.java
  15. 1 1
      src/main/java/com/caimei365/user/model/vo/HeHeUserVo.java
  16. 8 0
      src/main/java/com/caimei365/user/model/vo/MessageCenter.java
  17. 5 5
      src/main/java/com/caimei365/user/model/vo/UserLoginVo.java
  18. 0 8
      src/main/java/com/caimei365/user/model/vo/UserVo.java
  19. 6 4
      src/main/java/com/caimei365/user/service/LoginService.java
  20. 38 6
      src/main/java/com/caimei365/user/service/impl/HeHeServiceImpl.java
  21. 133 83
      src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java
  22. 34 69
      src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java
  23. 27 24
      src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java
  24. 1 1
      src/main/java/com/caimei365/user/service/impl/ShopServiceImpl.java
  25. 1 1
      src/main/java/com/caimei365/user/utils/AliyunSmsUtil.java
  26. 78 7
      src/main/resources/mapper/BaseMapper.xml
  27. 150 105
      src/main/resources/mapper/ClubMapper.xml
  28. 49 52
      src/main/resources/mapper/HeHeMapper.xml
  29. 16 27
      src/main/resources/mapper/LoginMapper.xml
  30. 27 12
      src/main/resources/mapper/MessageCenter.xml
  31. 5 7
      src/main/resources/mapper/RegisterMapper.xml
  32. 0 2
      src/main/resources/mapper/SellerMapper.xml
  33. 0 7
      src/main/resources/mapper/SuperVipMapper.xml

+ 25 - 9
src/main/java/com/caimei365/user/components/WeChatService.java

@@ -5,7 +5,9 @@ import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.caimei365.user.feign.ToolsFeign;
 import com.caimei365.user.feign.ToolsFeign;
+import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.po.WxUnion;
 import com.caimei365.user.utils.RequestUtil;
 import com.caimei365.user.utils.RequestUtil;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.binary.Base64;
@@ -14,21 +16,20 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
-import org.springframework.web.multipart.MultipartFile;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.crypto.Cipher;
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
 import javax.crypto.spec.SecretKeySpec;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.IOException;
 import java.net.URLDecoder;
 import java.net.URLDecoder;
 import java.security.AlgorithmParameters;
 import java.security.AlgorithmParameters;
 import java.security.Security;
 import java.security.Security;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 
 /**
 /**
  * 微信 服务工具类
  * 微信 服务工具类
@@ -68,6 +69,8 @@ public class WeChatService {
     private String imageDomain;
     private String imageDomain;
     @Resource
     @Resource
     private ToolsFeign toolsFeign;
     private ToolsFeign toolsFeign;
+    @Resource
+    private BaseMapper baseMapper;
 
 
     public void setRedirectUri(String redirectUri) {
     public void setRedirectUri(String redirectUri) {
         redirectUri = redirectUri;
         redirectUri = redirectUri;
@@ -177,7 +180,7 @@ public class WeChatService {
      *
      *
      * @param code    微信凭证
      * @param code    微信凭证
      * @param headers HttpHeaders
      * @param headers HttpHeaders
-     * @param mode    1:采美小程序,2:呵呵商城小程序+,3联合丽格小程序
+     * @param mode    1:采美小程序,2:颜选美学商城小程序+,3联合丽格小程序
      * @return HashMap
      * @return HashMap
      */
      */
     public ResponseJson<Map<String, Object>> getInfoMapByApplets(String code, HttpHeaders headers, Integer mode) {
     public ResponseJson<Map<String, Object>> getInfoMapByApplets(String code, HttpHeaders headers, Integer mode) {
@@ -189,24 +192,28 @@ public class WeChatService {
         returnMap.put("referer", referer);
         returnMap.put("referer", referer);
         String requestUrl = "https://api.weixin.qq.com/sns/jscode2session";
         String requestUrl = "https://api.weixin.qq.com/sns/jscode2session";
         Map<String, String> requestUrlParam = new HashMap<String, String>(4);
         Map<String, String> requestUrlParam = new HashMap<String, String>(4);
+        Integer type;
         if (mode == 1) {
         if (mode == 1) {
             // 小程序appId
             // 小程序appId
             requestUrlParam.put("appid", miniAppId);
             requestUrlParam.put("appid", miniAppId);
             log.info("采美小程序appId: ---" + miniAppId);
             log.info("采美小程序appId: ---" + miniAppId);
             // 小程序appSecret
             // 小程序appSecret
             requestUrlParam.put("secret", miniAppSecret);
             requestUrlParam.put("secret", miniAppSecret);
+            type = 1;
         } else if(mode == 2) {
         } else if(mode == 2) {
-            // 呵呵商城小程序appId
+            // 颜选美学商城小程序appId
             requestUrlParam.put("appid", heHeAppId);
             requestUrlParam.put("appid", heHeAppId);
-            log.info("呵呵商城appId: ---" + heHeAppId);
-            // 呵呵商城小程序appSecret
+            log.info("颜选美学商城appId: ---" + heHeAppId);
+            // 颜选美学商城小程序appSecret
             requestUrlParam.put("secret", heHeAppSecret);
             requestUrlParam.put("secret", heHeAppSecret);
+            type = 2;
         } else {
         } else {
             // 联合丽格小程序appId
             // 联合丽格小程序appId
             requestUrlParam.put("appid", mcareAppId);
             requestUrlParam.put("appid", mcareAppId);
             log.info("联合丽格appId: ---" + mcareAppId);
             log.info("联合丽格appId: ---" + mcareAppId);
             // 联合丽格小程序appSecret
             // 联合丽格小程序appSecret
             requestUrlParam.put("secret", mcareAppSecret);
             requestUrlParam.put("secret", mcareAppSecret);
+            type = 3;
         }
         }
         // 小程序端返回的code
         // 小程序端返回的code
         requestUrlParam.put("js_code", code);
         requestUrlParam.put("js_code", code);
@@ -229,6 +236,15 @@ public class WeChatService {
         String errCode = jsonObject.getString("errcode");
         String errCode = jsonObject.getString("errcode");
         String errMsg = jsonObject.getString("errmsg");
         String errMsg = jsonObject.getString("errmsg");
         log.info("openId----->" + openId + ", unionId------>" + unionId);
         log.info("openId----->" + openId + ", unionId------>" + unionId);
+        WxUnion byWxUnion = baseMapper.getByWxUnion(type, openId, null); //保存unionId和openId
+        if (null !=unionId&&(null == byWxUnion||null ==byWxUnion.getUnionId())) {
+            byWxUnion = baseMapper.getByWxUnion(null, null, unionId);
+            if (null == byWxUnion) {
+                baseMapper.addWxUnion(type, openId, unionId);
+            } else {
+                baseMapper.updateWxUnion(type, openId, unionId);
+            }
+        }
         returnMap.put(Keys.OPEN_ID, openId);
         returnMap.put(Keys.OPEN_ID, openId);
         returnMap.put(Keys.UNION_ID, unionId);
         returnMap.put(Keys.UNION_ID, unionId);
         returnMap.put(Keys.SESSION_KEY, sessionKey);
         returnMap.put(Keys.SESSION_KEY, sessionKey);

+ 2 - 2
src/main/java/com/caimei365/user/controller/HeHeApi.java

@@ -12,12 +12,12 @@ import org.springframework.http.HttpHeaders;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 /**
 /**
- * 呵呵商城用户API
+ * 颜选美学商城用户API
  *
  *
  * @author : plf
  * @author : plf
  * @date : 2021/4/21
  * @date : 2021/4/21
  */
  */
-@Api(tags = "呵呵商城用户API")
+@Api(tags = "颜选美学商城用户API")
 @RestController
 @RestController
 @RequiredArgsConstructor
 @RequiredArgsConstructor
 @RequestMapping("/user/he")
 @RequestMapping("/user/he")

+ 34 - 3
src/main/java/com/caimei365/user/controller/LoginApi.java

@@ -233,6 +233,33 @@ public class LoginApi {
         String iv = authAppletsDto.getIv();
         String iv = authAppletsDto.getIv();
         return loginService.appletsOrganizeAuthorization(code, encryptedData, iv, headers);
         return loginService.appletsOrganizeAuthorization(code, encryptedData, iv, headers);
     }
     }
+    @ApiOperation("颜选美学站内消息列表")
+    @GetMapping("/auth/heheMessageList")
+    public ResponseJson<PageInfo<MessageCenter>> heheMessageList(Integer commonId,
+                                                                 Integer messageType,
+                                                                 @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                 @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
+        return loginService.messageList(commonId, messageType, 4, pageNum, pageSize);
+    }
+    @ApiOperation("颜选美学所有站内消息未读消息记录数")
+    @GetMapping("/auth/heheMessageCount")
+    public ResponseJson<Map<String, Object>> heheMessageCount(Integer commonId) {
+        return loginService.messageCount(4, commonId);
+    }
+    @ApiOperation("颜选美学站内消息未读消息记录数")
+    @GetMapping("/auth/heheOneMessageCount")
+    public ResponseJson<Map<String, Object>> heheOneMessageCount(Integer messageType, Integer commonId) {
+        return loginService.count(4,messageType, commonId);
+    }
+    @ApiOperation("颜选美学站内消息改为已读")
+    @GetMapping("/auth/updateHeheMessageAsRead")
+    public ResponseJson<Void> updateHeheMessageAsRead(Integer messageType, Integer commonId) {
+        Integer i = loginService.updateMessageAsRead(4,messageType, commonId);
+        if (i <= 0) {
+            return ResponseJson.error("没有未读消息了!", null);
+        }
+        return ResponseJson.success("标记已读成功", null);
+    }
 
 
     @ApiOperation("机构站内消息未读消息记录数")
     @ApiOperation("机构站内消息未读消息记录数")
     @GetMapping("/auth/ClubMessageCount")
     @GetMapping("/auth/ClubMessageCount")
@@ -265,6 +292,8 @@ public class LoginApi {
 
 
         return loginService.ClubCount(messageType, commonId);
         return loginService.ClubCount(messageType, commonId);
     }
     }
+
+
     @ApiOperation("协销站内消息列表")
     @ApiOperation("协销站内消息列表")
     @GetMapping("/auth/SpMessageList")
     @GetMapping("/auth/SpMessageList")
     public ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId,
     public ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId,
@@ -301,17 +330,19 @@ public class LoginApi {
     @ApiOperation("机构站内消息改为已读")
     @ApiOperation("机构站内消息改为已读")
     @GetMapping("/auth/updateMessageAsRead")
     @GetMapping("/auth/updateMessageAsRead")
     public ResponseJson<Void> updateMessageAsRead(Integer messageType, Integer commonId) {
     public ResponseJson<Void> updateMessageAsRead(Integer messageType, Integer commonId) {
-        Integer i = loginService.updateMessageAsRead(messageType, commonId);
+        Integer i = loginService.updateMessageAsRead(1,messageType, commonId);
         if (i <= 0) {
         if (i <= 0) {
             return ResponseJson.error("没有未读消息了!", null);
             return ResponseJson.error("没有未读消息了!", null);
         }
         }
         return ResponseJson.success("标记已读成功", null);
         return ResponseJson.success("标记已读成功", null);
     }
     }
 
 
+
+
     @ApiOperation("供应商站内消息改为已读")
     @ApiOperation("供应商站内消息改为已读")
     @GetMapping("/auth/updateShopMessageAsRead")
     @GetMapping("/auth/updateShopMessageAsRead")
     public ResponseJson<Void> updateShopMessageAsRead(Integer messageType, Integer commonId) {
     public ResponseJson<Void> updateShopMessageAsRead(Integer messageType, Integer commonId) {
-        Integer i = loginService.updateShopMessageAsRead(messageType, commonId);
+        Integer i = loginService.updateMessageAsRead(2,messageType, commonId);
         if (i <= 0) {
         if (i <= 0) {
             return ResponseJson.error("没有未读消息了!", null);
             return ResponseJson.error("没有未读消息了!", null);
         }
         }
@@ -320,7 +351,7 @@ public class LoginApi {
     @ApiOperation("协销站内消息改为已读")
     @ApiOperation("协销站内消息改为已读")
     @GetMapping("/auth/updateSpMessageAsRead")
     @GetMapping("/auth/updateSpMessageAsRead")
     public ResponseJson<Void> updateSpMessageAsRead(Integer messageType, Integer commonId) {
     public ResponseJson<Void> updateSpMessageAsRead(Integer messageType, Integer commonId) {
-        Integer i = loginService.updateSpMessageAsRead(messageType, commonId);
+        Integer i = loginService.updateMessageAsRead(3,messageType, commonId);
         if (i <= 0) {
         if (i <= 0) {
             return ResponseJson.error("没有未读消息了!", null);
             return ResponseJson.error("没有未读消息了!", null);
         }
         }

+ 1 - 0
src/main/java/com/caimei365/user/controller/RegisterApi.java

@@ -76,6 +76,7 @@ public class RegisterApi {
      *                        passWordConfirm   用户确认密码
      *                        passWordConfirm   用户确认密码
      *                        smsCode           短信验证码(旧:activationCode)
      *                        smsCode           短信验证码(旧:activationCode)
      *                        isAgreed          是否同意勾选同意协议,1是,其他否
      *                        isAgreed          是否同意勾选同意协议,1是,其他否
+     *                        insideFLag        内外部协销标记 0内部协销,1外部协销
      *                        }
      *                        }
      * @param headers         HttpHeaders
      * @param headers         HttpHeaders
      */
      */

+ 13 - 0
src/main/java/com/caimei365/user/mapper/BaseMapper.java

@@ -1,6 +1,7 @@
 package com.caimei365.user.mapper;
 package com.caimei365.user.mapper;
 
 
 import com.caimei365.user.model.po.CmUser;
 import com.caimei365.user.model.po.CmUser;
+import com.caimei365.user.model.po.WxUnion;
 import com.caimei365.user.model.vo.*;
 import com.caimei365.user.model.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -223,5 +224,17 @@ public interface BaseMapper {
     public List<String> findAdminMobileList(Integer type);
     public List<String> findAdminMobileList(Integer type);
 
 
     CmUser findUserByMobile(@Param("mobile") String mobile, @Param("oldUserId") Integer oldUserId, @Param("userIdentity") Integer userIdentity);
     CmUser findUserByMobile(@Param("mobile") String mobile, @Param("oldUserId") Integer oldUserId, @Param("userIdentity") Integer userIdentity);
+    /**
+     * 新增unionid与不同应用的openid关系
+     */
+    int addWxUnion(@Param("type") Integer type,@Param("openid")String openid,@Param("unionId")String unionId);
 
 
+    /**
+     * 修改unionid与不同应用的openid关系
+     */
+    int updateWxUnion(@Param("type") Integer type,@Param("openid")String openid,@Param("unionId")String unionId);
+    /**
+     * 通过对象查询unionid与不同应用的openid关系对象
+     */
+    WxUnion getByWxUnion(@Param("type") Integer type,@Param("openid")String openid,@Param("unionId")String unionId);
 }
 }

+ 0 - 8
src/main/java/com/caimei365/user/mapper/ClubMapper.java

@@ -70,14 +70,6 @@ public interface ClubMapper {
      */
      */
     void updateClubByUpdateInfo(ClubUpdateDto club);
     void updateClubByUpdateInfo(ClubUpdateDto club);
 
 
-//    /**
-//     * 获取订单数量
-//     *
-//     * @param userId
-//     * @return
-//     */
-//    OrderCountVo getOrderCount(Integer userId);
-
     /**
     /**
      * 查询采美豆类型记录
      * 查询采美豆类型记录
      *
      *

+ 3 - 3
src/main/java/com/caimei365/user/mapper/HeHeMapper.java

@@ -18,7 +18,7 @@ import java.util.List;
 public interface HeHeMapper {
 public interface HeHeMapper {
 
 
     /**
     /**
-     * 查询呵呵用户信息
+     * 查询颜选美学用户信息
      *
      *
      * @param openId
      * @param openId
      * @return
      * @return
@@ -34,14 +34,14 @@ public interface HeHeMapper {
     HeHeUserVo findHeHeUserByMobile(String mobile);
     HeHeUserVo findHeHeUserByMobile(String mobile);
 
 
     /**
     /**
-     * 更新呵呵用户信息
+     * 更新颜选美学用户信息
      *
      *
      * @param heHeUser
      * @param heHeUser
      */
      */
     void updateHeHeUser(HeHeUserVo heHeUser);
     void updateHeHeUser(HeHeUserVo heHeUser);
 
 
     /**
     /**
-     * 保存呵呵普通用户信息
+     * 保存颜选美学普通用户信息
      *
      *
      * @param heUserPo
      * @param heUserPo
      */
      */

+ 2 - 1
src/main/java/com/caimei365/user/mapper/MessageCenterMapper.java

@@ -7,6 +7,7 @@ import com.caimei365.user.model.vo.UserVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * Description
  * Description
@@ -91,5 +92,5 @@ public interface MessageCenterMapper {
 
 
     List<Integer> getMessageCenterListDay(Integer day);
     List<Integer> getMessageCenterListDay(Integer day);
 
 
-
+    Map<String,String> getMessageTypeValues(Integer type, Integer id);
 }
 }

+ 1 - 9
src/main/java/com/caimei365/user/mapper/SuperVipMapper.java

@@ -71,18 +71,10 @@ public interface SuperVipMapper {
      */
      */
     void addUserBeansHistory(Integer userId, Integer userBeans);
     void addUserBeansHistory(Integer userId, Integer userBeans);
 
 
-    /**
-     * 用户权限修改
-     * 用户权限 0游客 1 普通用户 2 会员机构 3 供应商 4 协销 5 普通机构 6 呵呵商城用户【V6.2.0版本后0和1不存在】
-     *
-     * @param userId
-     * @param userPermission
-     */
-    void updateUserPermission(Integer userId, Integer userPermission);
 
 
     /**
     /**
      * 用户身份修改
      * 用户身份修改
-     * 用户身份 0、个人 1、协销 2、会员机构 3、供应商 4.普通机构 6、呵呵商城用户【V6.2.0版本后0不存在】
+     * 用户身份 0、个人 1、协销 2、会员机构 3、供应商 4.普通机构 6、颜选美学商城用户【V6.2.0版本后0不存在】
      *
      *
      * @param userId
      * @param userId
      * @param userIdentity
      * @param userIdentity

+ 4 - 0
src/main/java/com/caimei365/user/model/dto/ClubRegisterDto.java

@@ -16,6 +16,10 @@ import java.io.Serializable;
 @ApiModel("机构注册")
 @ApiModel("机构注册")
 @Data
 @Data
 public class ClubRegisterDto implements Serializable {
 public class ClubRegisterDto implements Serializable {
+    /**
+     *  内外部协销标记 0内部协销,1外部协销
+     */
+    private Integer insideFLag;
     /**
     /**
      * 注册来源: 0网站 1小程序
      * 注册来源: 0网站 1小程序
      */
      */

+ 1 - 1
src/main/java/com/caimei365/user/model/dto/HeHeUserDto.java

@@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull;
  * @author : plf
  * @author : plf
  * @date : 2021/4/22
  * @date : 2021/4/22
  */
  */
-@ApiModel("呵呵小程序登录")
+@ApiModel("颜选美学小程序登录")
 @Data
 @Data
 public class HeHeUserDto {
 public class HeHeUserDto {
     /**
     /**

+ 3 - 3
src/main/java/com/caimei365/user/model/po/CmUser.java

@@ -38,10 +38,10 @@ public class CmUser implements Serializable
     /** 企业绑定手机号(机构,供应商) */
     /** 企业绑定手机号(机构,供应商) */
     private String bindMobile;
     private String bindMobile;
 
 
-    /** 用户权限 0游客 1 普通用户 2 会员机构 3 供应商 4 协销 5 普通机构 6 呵呵商城用户【V6.2.0版本后0和1不存在】 */
+    /** 用户权限 0游客 1 普通用户 2 会员机构 3 供应商 4 协销 5 普通机构 6 颜选美学商城用户【V6.2.0版本后0和1不存在】 */
     private Integer userPermission;
     private Integer userPermission;
 
 
-    /** 用户身份 0、个人 1、协销 2、会员机构 3、供应商 4.普通机构 6、呵呵商城用户【V6.2.0版本后0不存在】 */
+    /** 用户身份 0、个人 1、协销 2、会员机构 3、供应商 4.普通机构 6、颜选美学商城用户【V6.2.0版本后0不存在】 */
     private String userIdentity;
     private String userIdentity;
 
 
     /** 邮箱 */
     /** 邮箱 */
@@ -65,7 +65,7 @@ public class CmUser implements Serializable
     /** 名称(机构名称,供应商的公司名称) */
     /** 名称(机构名称,供应商的公司名称) */
     private String name;
     private String name;
 
 
-    /** 见枚举UserType(1供应商,2协销经理,32协销,3会员机构,4普通机构,6呵呵商城) */
+    /** 见枚举UserType(1供应商,2协销经理,32协销,3会员机构,4普通机构,6颜选美学商城) */
     private String registerUserTypeID;
     private String registerUserTypeID;
 
 
     /** 供应商状态, 3待审核, 90已上线,91已下线,92审核不通过 */
     /** 供应商状态, 3待审核, 90已上线,91已下线,92审核不通过 */

+ 0 - 9
src/main/java/com/caimei365/user/model/po/UserPo.java

@@ -1,6 +1,5 @@
 package com.caimei365.user.model.po;
 package com.caimei365.user.model.po;
 
 
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
@@ -65,10 +64,6 @@ public class UserPo implements Serializable {
      * 用户身份: 1协销 2会员机构 3供应商 4普通机构
      * 用户身份: 1协销 2会员机构 3供应商 4普通机构
      */
      */
     private Integer userIdentity;
     private Integer userIdentity;
-    /**
-     * 用户权限: 2会员机构 3供应商 4协销 5普通机构 6颜选用户
-     */
-    private Integer userPermission;
     /**
     /**
      * 是否已经引导过(机构升级:0否,1是)
      * 是否已经引导过(机构升级:0否,1是)
      */
      */
@@ -77,10 +72,6 @@ public class UserPo implements Serializable {
      * 组织名称
      * 组织名称
      */
      */
     private String name;
     private String name;
-    /**
-     * 机构状态:90:已上线,91:已冻结,92:审查资料未通过,待补充资料,1:待审查资料,2:电话预约,3:已预约,20:待确认,21:待拜访,30:待员工推荐,40:已完成第一次采购
-     */
-    private Integer clubStatus;
     /**
     /**
      * 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
      * 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
      */
      */

+ 44 - 0
src/main/java/com/caimei365/user/model/po/WxUnion.java

@@ -0,0 +1,44 @@
+package com.caimei365.user.model.po;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+
+/**
+ * unionid与不同应用的openid关系对象 wx_union
+ *
+ * @author Kaick
+ * @date 2023-11-30
+ */
+@Accessors(chain  = true )
+@Data
+@Alias("WxUnion")
+public class WxUnion implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 微信unionId */
+    private String unionId;
+
+    /** $column.columnComment */
+        private Integer userId;
+
+    /** crm公众openid */
+    private String crmOpenid;
+
+    /** 采美app openid */
+    private String appOpenid;
+
+    /** 小程序openId */
+    private String miniProgramOpenId;
+
+    /** 呵呵app openid */
+    private String heheOpenid;
+
+
+}
+
+
+

+ 1 - 1
src/main/java/com/caimei365/user/model/vo/HeHeUserVo.java

@@ -13,7 +13,7 @@ import java.io.Serializable;
 @Data
 @Data
 public class HeHeUserVo implements Serializable {
 public class HeHeUserVo implements Serializable {
     /**
     /**
-     * 呵呵商城用户id
+     * 颜选美学商城用户id
      */
      */
     private Integer userId;
     private Integer userId;
 
 

+ 8 - 0
src/main/java/com/caimei365/user/model/vo/MessageCenter.java

@@ -128,6 +128,14 @@ public class MessageCenter implements Serializable {
      * 前用户名称
      * 前用户名称
      */
      */
     private String superUserName;
     private String superUserName;
+    /**
+     * pc链接
+     */
+    private String pcLink;
+    /**
+     * app链接
+     */
+    private String appLink;
 
 
     /**
     /**
      * 当前id
      * 当前id

+ 5 - 5
src/main/java/com/caimei365/user/model/vo/UserLoginVo.java

@@ -14,6 +14,11 @@ import java.util.Date;
  */
  */
 @Data
 @Data
 public class UserLoginVo implements Serializable {
 public class UserLoginVo implements Serializable {
+
+    /**
+     * 内外部协销标记 0内部协销,1外部协销
+     */
+    private Integer insideFLag;
     /**
     /**
      * 用户Id
      * 用户Id
      */
      */
@@ -101,11 +106,6 @@ public class UserLoginVo implements Serializable {
      */
      */
     @ApiModelProperty("用户身份: 1协销 2会员机构 3供应商 4普通机构")
     @ApiModelProperty("用户身份: 1协销 2会员机构 3供应商 4普通机构")
     private Integer userIdentity;
     private Integer userIdentity;
-    /**
-     * 用户权限: 2会员机构 3供应商 4协销 5普通机构
-     */
-    @ApiModelProperty("用户权限: 2会员机构 3供应商 4协销 5普通机构")
-    private Integer userPermission;
     /**
     /**
      * 机构状态:90:已上线,91:已冻结,92:审查资料未通过,待补充资料,1:待审查资料,2:电话预约,3:已预约,20:待确认,21:待拜访,30:待员工推荐,40:已完成第一次采购
      * 机构状态:90:已上线,91:已冻结,92:审查资料未通过,待补充资料,1:待审查资料,2:电话预约,3:已预约,20:待确认,21:待拜访,30:待员工推荐,40:已完成第一次采购
      */
      */

+ 0 - 8
src/main/java/com/caimei365/user/model/vo/UserVo.java

@@ -61,18 +61,10 @@ public class UserVo implements Serializable {
      * 用户身份: 1协销 2会员机构 3供应商 4普通机构
      * 用户身份: 1协销 2会员机构 3供应商 4普通机构
      */
      */
     private Integer userIdentity;
     private Integer userIdentity;
-    /**
-     * 用户权限: 2会员机构 3供应商 4协销 5普通机构
-     */
-    private Integer userPermission;
     /**
     /**
      * 组织名称
      * 组织名称
      */
      */
     private String name;
     private String name;
-    /**
-     * 机构状态:90:已上线,91:已冻结,92:审查资料未通过,待补充资料,1:待审查资料,2:电话预约,3:已预约,20:待确认,21:待拜访,30:待员工推荐,40:已完成第一次采购
-     */
-    private Integer clubStatus;
     /**
     /**
      * 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
      * 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
      */
      */

+ 6 - 4
src/main/java/com/caimei365/user/service/LoginService.java

@@ -91,19 +91,21 @@ public interface LoginService {
 
 
     ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
     ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
 
 
+    ResponseJson<PageInfo<MessageCenter>> messageList(Integer commonId,Integer messageType,Integer userType, int pageNum, int pageSize);
+    ResponseJson<Map<String, Object>> messageCount(Integer userType ,Integer commonId);
+    ResponseJson<Map<String, Object>> count(Integer userType,Integer messageType,Integer commonId);
+
     ResponseJson<Map<String, Object>> ClubMessageCount(Integer messageType,Integer commonId);
     ResponseJson<Map<String, Object>> ClubMessageCount(Integer messageType,Integer commonId);
 
 
     ResponseJson<Map<String, Object>> shopMessageCount(Integer messageType,Integer commonId);
     ResponseJson<Map<String, Object>> shopMessageCount(Integer messageType,Integer commonId);
 
 
     ResponseJson<Map<String, Object>> SpCount(Integer messageType,Integer commonId);
     ResponseJson<Map<String, Object>> SpCount(Integer messageType,Integer commonId);
-    ResponseJson<Map<String, Object>> ShopCount(Integer messageType,Integer commonId);
 
 
+    ResponseJson<Map<String, Object>> ShopCount(Integer messageType,Integer commonId);
     ResponseJson<Map<String, Object>> ClubCount(Integer messageType,Integer commonId);
     ResponseJson<Map<String, Object>> ClubCount(Integer messageType,Integer commonId);
 
 
-     Integer updateMessageAsRead(Integer messageType,Integer commonId);
+     Integer updateMessageAsRead(Integer userType,Integer messageType,Integer commonId);
 
 
-    Integer updateShopMessageAsRead(Integer messageType,Integer commonId);
-    Integer updateSpMessageAsRead(Integer messageType,Integer commonId);
 
 
      Integer updateRead(Integer userType,String Id);
      Integer updateRead(Integer userType,String Id);
 
 

+ 38 - 6
src/main/java/com/caimei365/user/service/impl/HeHeServiceImpl.java

@@ -2,6 +2,7 @@ package com.caimei365.user.service.impl;
 
 
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.WeChatService;
 import com.caimei365.user.components.WeChatService;
+import com.caimei365.user.feign.ToolsFeign;
 import com.caimei365.user.mapper.HeHeMapper;
 import com.caimei365.user.mapper.HeHeMapper;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.HeHeUserDto;
 import com.caimei365.user.model.dto.HeHeUserDto;
@@ -12,6 +13,10 @@ import com.caimei365.user.model.vo.HeHeUserVo;
 import com.caimei365.user.service.HeHeService;
 import com.caimei365.user.service.HeHeService;
 import com.caimei365.user.service.RemoteCallService;
 import com.caimei365.user.service.RemoteCallService;
 import com.caimei365.user.utils.CodeUtil;
 import com.caimei365.user.utils.CodeUtil;
+import com.caimei365.user.utils.message.InsideMessage;
+import com.caimei365.user.utils.message.MessageModel;
+import com.caimei365.user.utils.message.MessageType;
+import com.caimei365.user.utils.message.MqInfo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
@@ -44,7 +49,10 @@ public class HeHeServiceImpl implements HeHeService {
     private String active;
     private String active;
     @Resource
     @Resource
     private RemoteCallService remoteCallService;
     private RemoteCallService remoteCallService;
-
+    @Resource
+    private AsyncService asyncService;
+    @Resource
+    private ToolsFeign toolsFeign;
     @Override
     @Override
     public ResponseJson<HeHeUserVo> authorization(String code, HttpHeaders headers) {
     public ResponseJson<HeHeUserVo> authorization(String code, HttpHeaders headers) {
         // 小程序微信授权获取登录信息
         // 小程序微信授权获取登录信息
@@ -60,6 +68,7 @@ public class HeHeServiceImpl implements HeHeService {
             heHeUser.setOpenId(openId);
             heHeUser.setOpenId(openId);
             return ResponseJson.error(-2, "用户未注册", heHeUser);
             return ResponseJson.error(-2, "用户未注册", heHeUser);
         }
         }
+        asyncService.loginUpdateBeans(heHeUser.getUserId(), null);
         return ResponseJson.success(heHeUser);
         return ResponseJson.success(heHeUser);
     }
     }
 
 
@@ -87,8 +96,7 @@ public class HeHeServiceImpl implements HeHeService {
                     user.setUserName(heHeUserDto.getNickName());
                     user.setUserName(heHeUserDto.getNickName());
                     user.setName(heHeUserDto.getNickName());
                     user.setName(heHeUserDto.getNickName());
                     user.setPassword("HeHe");
                     user.setPassword("HeHe");
-                    //6:呵呵商城用户
-                    user.setUserPermission(6);
+                    //6:颜选美学商城用户
                     user.setUserIdentity(6);
                     user.setUserIdentity(6);
                     user.setRegisterUserTypeId(6);
                     user.setRegisterUserTypeId(6);
                     user.setRegisterTime(currentTime);
                     user.setRegisterTime(currentTime);
@@ -110,7 +118,19 @@ public class HeHeServiceImpl implements HeHeService {
                         Double couponAmount = heHeMapper.getCouponAmount(couponId);
                         Double couponAmount = heHeMapper.getCouponAmount(couponId);
                         String content = "恭喜您成功注册登录。现赠送" + couponAmount + "元优惠券到您的领券中心,请赶紧登录颜选美学小程序领取下单吧。退订回T";
                         String content = "恭喜您成功注册登录。现赠送" + couponAmount + "元优惠券到您的领券中心,请赶紧登录颜选美学小程序领取下单吧。退订回T";
                         boolean result = remoteCallService.remoteSendSms(17, 3, heHeUserDto.getMobile(), content);
                         boolean result = remoteCallService.remoteSendSms(17, 3, heHeUserDto.getMobile(), content);
-                        log.info("【呵呵新人券派送】mobile:" + heHeUserDto.getMobile() + ",result:" + result);
+                        log.info("【颜选美学新人券派送】mobile:" + heHeUserDto.getMobile() + ",result:" + result);
+                        //站内信
+                        MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
+                        insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
+                                .mqInfo(new MqInfo().topic("MessageLine").delay(1).async(0))
+                                .info(new InsideMessage()
+                                        .userType(4)
+                                        .messageType(4)
+                                        .couponType(4)
+                                        .content("恭喜您成功注册登录。现赠送"+couponAmount+"元优惠券到您的领券中心,快去领取下单吧。")
+                                        .thisId(heUserPo.getUserId())
+                                );
+                        toolsFeign.sendCommonMessage(insideMessageMessageModel);
                     });
                     });
                     heHeUser = heHeMapper.findHeHeUserByMobile(heHeUserDto.getMobile());
                     heHeUser = heHeMapper.findHeHeUserByMobile(heHeUserDto.getMobile());
                     Integer shareUserId = heHeUserDto.getShareUserId();
                     Integer shareUserId = heHeUserDto.getShareUserId();
@@ -130,7 +150,19 @@ public class HeHeServiceImpl implements HeHeService {
                             Double couponAmount = heHeMapper.getCouponAmount(couponId);
                             Double couponAmount = heHeMapper.getCouponAmount(couponId);
                             String content = "恭喜您成功邀请一位好友注册登录,现赠送"+couponAmount+"元优惠券到您的领券中心,请赶紧登录颜选美学小程序领取下单吧。退订回T";
                             String content = "恭喜您成功邀请一位好友注册登录,现赠送"+couponAmount+"元优惠券到您的领券中心,请赶紧登录颜选美学小程序领取下单吧。退订回T";
                             boolean result = remoteCallService.remoteSendSms(18, 3, mobile, content);
                             boolean result = remoteCallService.remoteSendSms(18, 3, mobile, content);
-                            log.info("【呵呵好友邀请券派送】mobile:" + mobile + ",result:" + result);
+                            log.info("【颜选美学好友邀请券派送】mobile:" + mobile + ",result:" + result);
+                            //站内信
+                            MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
+                            insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
+                                    .mqInfo(new MqInfo().topic("MessageLine").delay(1).async(0))
+                                    .info(new InsideMessage()
+                                            .userType(4)
+                                            .messageType(4)
+                                            .couponType(5)
+                                            .content("恭喜您成功邀请一位好友注册登录,现赠送"+couponAmount+"元优惠券到您的领券中心,快去领取下单吧。")
+                                            .thisId(shareUserId)
+                                    );
+                            toolsFeign.sendCommonMessage(insideMessageMessageModel);
                         });
                         });
                     }
                     }
                 }
                 }
@@ -149,7 +181,7 @@ public class HeHeServiceImpl implements HeHeService {
             // 短信发送失败重试一次
             // 短信发送失败重试一次
             remoteCallService.remoteSendSms(0, 1, mobile, content);
             remoteCallService.remoteSendSms(0, 1, mobile, content);
         }
         }
-        log.info("呵呵商城注册验证码:" + randomCode);
+        log.info("颜选美学商城注册验证码:" + randomCode);
         redisService.set("heCode:" + mobile, randomCode, 300L);
         redisService.set("heCode:" + mobile, randomCode, 300L);
         return ResponseJson.success("发送成功");
         return ResponseJson.success("发送成功");
     }
     }

+ 133 - 83
src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java

@@ -10,21 +10,20 @@ import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.*;
 import com.caimei365.user.model.dto.*;
 import com.caimei365.user.model.po.OperationPo;
 import com.caimei365.user.model.po.OperationPo;
 import com.caimei365.user.model.po.SuperVipPo;
 import com.caimei365.user.model.po.SuperVipPo;
-import com.caimei365.user.model.vo.*;
+import com.caimei365.user.model.vo.MessageCenter;
+import com.caimei365.user.model.vo.OperationVo;
+import com.caimei365.user.model.vo.UserLoginVo;
 import com.caimei365.user.service.LoginService;
 import com.caimei365.user.service.LoginService;
 import com.caimei365.user.service.RemoteCallService;
 import com.caimei365.user.service.RemoteCallService;
 import com.caimei365.user.utils.JwtUtil;
 import com.caimei365.user.utils.JwtUtil;
-import com.caimei365.user.utils.MathUtil;
 import com.caimei365.user.utils.Md5Util;
 import com.caimei365.user.utils.Md5Util;
 import com.caimei365.user.utils.ValidateUtil;
 import com.caimei365.user.utils.ValidateUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
-import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpHeaders;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ObjectUtils;
 
 
@@ -32,9 +31,6 @@ import javax.annotation.Resource;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
 
 
 /**
 /**
  * Description
  * Description
@@ -187,12 +183,12 @@ public class LoginServiceImpl implements LoginService {
         UserLoginVo baseUser = loginMapper.getLoginOrganizeUserByMobileOrEmail(mobileOrEmail);
         UserLoginVo baseUser = loginMapper.getLoginOrganizeUserByMobileOrEmail(mobileOrEmail);
         // 机构下线,登录失败
         // 机构下线,登录失败
         if (91 == baseUser.getClubStatus()) {
         if (91 == baseUser.getClubStatus()) {
-            return ResponseJson.error(-1,"您的企业账号已被冻结,请联系客服处理", null);
+            return ResponseJson.error(-1, "您的企业账号已被冻结,请联系客服处理", null);
         }
         }
         if (null != baseUser) {
         if (null != baseUser) {
             // 绑定微信信息
             // 绑定微信信息
             Integer operationUser = loginMapper.getOperationUser(mobileOrEmail);
             Integer operationUser = loginMapper.getOperationUser(mobileOrEmail);
-            log.info("operationUser==="+operationUser);
+            log.info("operationUser===" + operationUser);
             if (null == operationUser) {
             if (null == operationUser) {
                 // 绑定微信
                 // 绑定微信
                 OperationVo operationVo = new OperationVo();
                 OperationVo operationVo = new OperationVo();
@@ -208,7 +204,7 @@ public class LoginServiceImpl implements LoginService {
                 operationVo.setAddTime(new Date());
                 operationVo.setAddTime(new Date());
                 operationVo.setDelFlag(0);
                 operationVo.setDelFlag(0);
                 loginMapper.insertOperation(operationVo);
                 loginMapper.insertOperation(operationVo);
-                log.info("operationVo***"+operationVo);
+                log.info("operationVo***" + operationVo);
             }
             }
             String key = "login-" + baseUser.getUserId();
             String key = "login-" + baseUser.getUserId();
             boolean exists = redisService.exists(key);
             boolean exists = redisService.exists(key);
@@ -256,13 +252,13 @@ public class LoginServiceImpl implements LoginService {
                 }
                 }
             }
             }
         }
         }
-        return ResponseJson.error(-1,"账户名与密码不匹配,请重新输入", null);
+        return ResponseJson.error(-1, "账户名与密码不匹配,请重新输入", null);
     }
     }
 
 
     /**
     /**
      * @param loginCodeDto {
      * @param loginCodeDto {
-     *                      mobile   手机号
-     *                      code     短信验证码
+     *                     mobile   手机号
+     *                     code     短信验证码
      *                     }
      *                     }
      * @return
      * @return
      * @throws ParseException
      * @throws ParseException
@@ -270,10 +266,10 @@ public class LoginServiceImpl implements LoginService {
     @Override
     @Override
     public ResponseJson<UserLoginVo> codeLogin(LoginCodeDto loginCodeDto) throws ParseException {
     public ResponseJson<UserLoginVo> codeLogin(LoginCodeDto loginCodeDto) throws ParseException {
         if (ObjectUtils.isEmpty(loginCodeDto.getMobile())) {
         if (ObjectUtils.isEmpty(loginCodeDto.getMobile())) {
-            return ResponseJson.error("请填写手机号",null);
+            return ResponseJson.error("请填写手机号", null);
         }
         }
         if (ObjectUtils.isEmpty(loginCodeDto.getCode())) {
         if (ObjectUtils.isEmpty(loginCodeDto.getCode())) {
-            return ResponseJson.error("请输入短信验证码",null);
+            return ResponseJson.error("请输入短信验证码", null);
         }
         }
         String mobile = loginCodeDto.getMobile();
         String mobile = loginCodeDto.getMobile();
         String code = loginCodeDto.getCode();
         String code = loginCodeDto.getCode();
@@ -291,7 +287,7 @@ public class LoginServiceImpl implements LoginService {
                 return ResponseJson.error("验证码已失效,请重新获取");
                 return ResponseJson.error("验证码已失效,请重新获取");
             }
             }
             // 获取redis手机短信验证码
             // 获取redis手机短信验证码
-            Object randomCode = redisService.get("code:"+mobile);
+            Object randomCode = redisService.get("code:" + mobile);
 
 
             if (!ObjectUtils.isEmpty(randomCode)) {
             if (!ObjectUtils.isEmpty(randomCode)) {
                 if (code.equals(randomCode.toString())) {
                 if (code.equals(randomCode.toString())) {
@@ -324,8 +320,8 @@ public class LoginServiceImpl implements LoginService {
 
 
     /**
     /**
      * @param loginCodeDto {
      * @param loginCodeDto {
-     *                      mobile   手机号
-     *                      code     短信验证码
+     *                     mobile   手机号
+     *                     code     短信验证码
      *                     }
      *                     }
      * @return
      * @return
      * @throws ParseException
      * @throws ParseException
@@ -333,10 +329,10 @@ public class LoginServiceImpl implements LoginService {
     @Override
     @Override
     public ResponseJson<UserLoginVo> codeOrganizeLogin(LoginCodeDto loginCodeDto) throws ParseException {
     public ResponseJson<UserLoginVo> codeOrganizeLogin(LoginCodeDto loginCodeDto) throws ParseException {
         if (ObjectUtils.isEmpty(loginCodeDto.getMobile())) {
         if (ObjectUtils.isEmpty(loginCodeDto.getMobile())) {
-            return ResponseJson.error("请填写手机号",null);
+            return ResponseJson.error("请填写手机号", null);
         }
         }
         if (ObjectUtils.isEmpty(loginCodeDto.getCode())) {
         if (ObjectUtils.isEmpty(loginCodeDto.getCode())) {
-            return ResponseJson.error("请输入短信验证码",null);
+            return ResponseJson.error("请输入短信验证码", null);
         }
         }
         String mobile = loginCodeDto.getMobile();
         String mobile = loginCodeDto.getMobile();
         String code = loginCodeDto.getCode();
         String code = loginCodeDto.getCode();
@@ -351,10 +347,10 @@ public class LoginServiceImpl implements LoginService {
             // 查看验证码是否过期
             // 查看验证码是否过期
             long expireTime = redisService.getExpireTime("code:" + mobile);
             long expireTime = redisService.getExpireTime("code:" + mobile);
             if (expireTime < 0) {
             if (expireTime < 0) {
-                return ResponseJson.error(-1,"验证码已失效,请重新获取",null);
+                return ResponseJson.error(-1, "验证码已失效,请重新获取", null);
             }
             }
             // 获取redis手机短信验证码
             // 获取redis手机短信验证码
-            Object randomCode = redisService.get("code:"+mobile);
+            Object randomCode = redisService.get("code:" + mobile);
 
 
             if (!ObjectUtils.isEmpty(randomCode)) {
             if (!ObjectUtils.isEmpty(randomCode)) {
                 if (code.equals(randomCode.toString())) {
                 if (code.equals(randomCode.toString())) {
@@ -363,7 +359,7 @@ public class LoginServiceImpl implements LoginService {
                     UserLoginVo baseUser = loginMapper.getLoginOrganizeUserByMobileOrEmail(mobile);
                     UserLoginVo baseUser = loginMapper.getLoginOrganizeUserByMobileOrEmail(mobile);
                     // 绑定微信信息
                     // 绑定微信信息
                     Integer operationUser = loginMapper.getOperationUser(mobile);
                     Integer operationUser = loginMapper.getOperationUser(mobile);
-                    log.info("operationUser==="+operationUser);
+                    log.info("operationUser===" + operationUser);
                     if (null == operationUser) {
                     if (null == operationUser) {
                         // 绑定微信
                         // 绑定微信
                         OperationVo operationVo = new OperationVo();
                         OperationVo operationVo = new OperationVo();
@@ -399,13 +395,13 @@ public class LoginServiceImpl implements LoginService {
                         return logonVerify(baseUser);
                         return logonVerify(baseUser);
                     }
                     }
                 } else {
                 } else {
-                    return ResponseJson.error(-1,"验证码不匹配,请重新输入",null);
+                    return ResponseJson.error(-1, "验证码不匹配,请重新输入", null);
                 }
                 }
             } else {
             } else {
-                return ResponseJson.error(-1,"验证码错误,请重新获取",null);
+                return ResponseJson.error(-1, "验证码错误,请重新获取", null);
             }
             }
         } else {
         } else {
-            return ResponseJson.error(-1,"验证码错误,请重新获取",null);
+            return ResponseJson.error(-1, "验证码错误,请重新获取", null);
         }
         }
     }
     }
 
 
@@ -418,7 +414,7 @@ public class LoginServiceImpl implements LoginService {
      * @param headers       HttpHeaders
      * @param headers       HttpHeaders
      */
      */
     @Override
     @Override
-    public ResponseJson<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, HttpHeaders headers){
+    public ResponseJson<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, HttpHeaders headers) {
         if (StringUtils.isBlank(code)) {
         if (StringUtils.isBlank(code)) {
             return ResponseJson.error("没有获取到微信授权code", null);
             return ResponseJson.error("没有获取到微信授权code", null);
         }
         }
@@ -492,7 +488,7 @@ public class LoginServiceImpl implements LoginService {
         }
         }
         // 小程序微信授权获取登录信息
         // 小程序微信授权获取登录信息
         ResponseJson<Map<String, Object>> appletsInfo = weChatService.getInfoMapByApplets(code, headers, 3);
         ResponseJson<Map<String, Object>> appletsInfo = weChatService.getInfoMapByApplets(code, headers, 3);
-        log.info("appletsInfo***"+appletsInfo);
+        log.info("appletsInfo***" + appletsInfo);
         if (appletsInfo.getCode() == -1) {
         if (appletsInfo.getCode() == -1) {
             return ResponseJson.error(appletsInfo.getMsg(), null);
             return ResponseJson.error(appletsInfo.getMsg(), null);
         }
         }
@@ -543,12 +539,16 @@ public class LoginServiceImpl implements LoginService {
         Integer accountCount = messageCenterMapper.MessageCount(1, 2, commonId);
         Integer accountCount = messageCenterMapper.MessageCount(1, 2, commonId);
         Integer notificationCount = messageCenterMapper.MessageCount(1, 3, commonId);
         Integer notificationCount = messageCenterMapper.MessageCount(1, 3, commonId);
         Integer promotionCount = messageCenterMapper.MessageCount(1, 4, commonId);
         Integer promotionCount = messageCenterMapper.MessageCount(1, 4, commonId);
+        Integer infoCount = messageCenterMapper.MessageCount(1, 5, commonId);
+        Integer activityCount = messageCenterMapper.MessageCount(1, 6, commonId);
         Map<String, Object> map = new HashMap(10);
         Map<String, Object> map = new HashMap(10);
         map.put("count", count);
         map.put("count", count);
         map.put("tradeCount", tradeCount);
         map.put("tradeCount", tradeCount);
         map.put("account", accountCount);
         map.put("account", accountCount);
         map.put("notificationCount", notificationCount);
         map.put("notificationCount", notificationCount);
         map.put("promotionCount", promotionCount);
         map.put("promotionCount", promotionCount);
+        map.put("infoCount", infoCount);
+        map.put("activityCount", activityCount);
         return ResponseJson.success(map);
         return ResponseJson.success(map);
     }
     }
 
 
@@ -583,6 +583,7 @@ public class LoginServiceImpl implements LoginService {
         map.put("promotionCount", promotionCount);
         map.put("promotionCount", promotionCount);
         return ResponseJson.success(map);
         return ResponseJson.success(map);
     }
     }
+
     @Override
     @Override
     public ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId) {
     public ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId) {
         Integer count = messageCenterMapper.Count(2, commonId);
         Integer count = messageCenterMapper.Count(2, commonId);
@@ -600,19 +601,6 @@ public class LoginServiceImpl implements LoginService {
     }
     }
 
 
 
 
-    @Override
-    public Integer updateMessageAsRead(Integer messageType, Integer commonId) {
-        return messageCenterMapper.updateMessageAsRead(1, messageType, commonId);
-    }
-
-    @Override
-    public Integer updateShopMessageAsRead(Integer messageType, Integer commonId) {
-        return messageCenterMapper.updateMessageAsRead(2, messageType, commonId);
-    }
-    @Override
-    public Integer updateSpMessageAsRead(Integer messageType, Integer commonId) {
-        return messageCenterMapper.updateMessageAsRead(3, messageType, commonId);
-    }
 
 
     @Override
     @Override
     public Integer deleteMessage(String id) {
     public Integer deleteMessage(String id) {
@@ -634,7 +622,28 @@ public class LoginServiceImpl implements LoginService {
         return num;
         return num;
     }
     }
 
 
-
+    @Override
+    public ResponseJson<PageInfo<MessageCenter>> messageList(Integer commonId, Integer messageType, Integer userType, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<MessageCenter> list = setMessageList(userType, messageType, commonId);
+        PageInfo<MessageCenter> pageData = new PageInfo<>(list);
+        return ResponseJson.success(pageData);
+    }
+    @Override
+    public ResponseJson<Map<String, Object>> messageCount(Integer userType , Integer commonId) {
+        return ResponseJson.success(setMessageCount(userType,commonId));
+    }
+    @Override
+    public ResponseJson<Map<String, Object>> count(Integer userType,Integer messageType, Integer commonId) {
+        Integer count = messageCenterMapper.Count(userType, commonId);
+        Map<String, Object> map = new HashMap(1);
+        map.put("count", count);
+        return ResponseJson.success(map);
+    }
+    @Override
+    public Integer updateMessageAsRead(Integer userType,Integer messageType, Integer commonId) {
+        return messageCenterMapper.updateMessageAsRead(userType, messageType, commonId);
+    }
     @Override
     @Override
     public ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
     public ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
@@ -642,7 +651,7 @@ public class LoginServiceImpl implements LoginService {
         list.forEach(mess -> {
         list.forEach(mess -> {
             if (null != mess.getClubId()) {
             if (null != mess.getClubId()) {
                 MessageCenter messageCenter = messageCenterMapper.MainImage(3, commonId, mess.getOrderId());
                 MessageCenter messageCenter = messageCenterMapper.MainImage(3, commonId, mess.getOrderId());
-                Integer productCount=messageCenterMapper.productCount(mess.getOrderId());
+                Integer productCount = messageCenterMapper.productCount(mess.getOrderId());
                 if (null != messageCenter) {
                 if (null != messageCenter) {
                     mess.setMainImage(messageCenter.getMainImage());
                     mess.setMainImage(messageCenter.getMainImage());
                     mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
                     mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
@@ -663,6 +672,7 @@ public class LoginServiceImpl implements LoginService {
         PageInfo<MessageCenter> pageData = new PageInfo<>(list);
         PageInfo<MessageCenter> pageData = new PageInfo<>(list);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }
+
     @Override
     @Override
     public ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
     public ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
@@ -670,7 +680,7 @@ public class LoginServiceImpl implements LoginService {
         list.forEach(mess -> {
         list.forEach(mess -> {
             if (null != mess.getClubId()) {
             if (null != mess.getClubId()) {
                 MessageCenter messageCenter = messageCenterMapper.MainImage(1, commonId, mess.getOrderId());
                 MessageCenter messageCenter = messageCenterMapper.MainImage(1, commonId, mess.getOrderId());
-                Integer productCount=messageCenterMapper.productCount(mess.getOrderId());
+                Integer productCount = messageCenterMapper.productCount(mess.getOrderId());
                 if (null != messageCenter) {
                 if (null != messageCenter) {
                     mess.setMainImage(messageCenter.getMainImage());
                     mess.setMainImage(messageCenter.getMainImage());
                     mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
                     mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
@@ -683,6 +693,12 @@ public class LoginServiceImpl implements LoginService {
                     mess.setRefundType(messageCenter.getRefundType());
                     mess.setRefundType(messageCenter.getRefundType());
                     mess.setStatus(messageCenter.getStatus());
                     mess.setStatus(messageCenter.getStatus());
                 }
                 }
+                if (5 == mess.getMessageType() || 6 == mess.getMessageType()) {
+                    Map<String, String> typeValue = messageCenterMapper.getMessageTypeValues(mess.getMessageType(), mess.getThisId());
+                    mess.setMainImage(typeValue.get("image"));
+                    mess.setPcLink(typeValue.get("pcLink"));
+                    mess.setAppLink(typeValue.get("appLink"));
+                }
             }
             }
         });
         });
         if (source == 2) {
         if (source == 2) {
@@ -697,18 +713,18 @@ public class LoginServiceImpl implements LoginService {
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         List<MessageCenter> list = messageCenterMapper.MessageList(2, messageType, commonId);
         List<MessageCenter> list = messageCenterMapper.MessageList(2, messageType, commonId);
         list.forEach(mess -> {
         list.forEach(mess -> {
-                String shopName=messageCenterMapper.shopName(commonId);
-                MessageCenter messageCenter = messageCenterMapper.productImage(mess.getProductId(),commonId);
-                if (messageCenter != null) {
-                    mess.setMainImage(messageCenter.getMainImage());
-                    mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
-                    if (messageCenter.getProductName().length() > 10) {
-                        mess.setProductName(StringUtils.strip(messageCenter.getProductName().substring(0, 11)));
-                    } else {
-                        mess.setProductName(messageCenter.getProductName());
-                    }
-                    mess.setProductCount(messageCenter.getProductCount());
-                    mess.setRefundType(messageCenter.getRefundType());
+            String shopName = messageCenterMapper.shopName(commonId);
+            MessageCenter messageCenter = messageCenterMapper.productImage(mess.getProductId(), commonId);
+            if (messageCenter != null) {
+                mess.setMainImage(messageCenter.getMainImage());
+                mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
+                if (messageCenter.getProductName().length() > 10) {
+                    mess.setProductName(StringUtils.strip(messageCenter.getProductName().substring(0, 11)));
+                } else {
+                    mess.setProductName(messageCenter.getProductName());
+                }
+                mess.setProductCount(messageCenter.getProductCount());
+                mess.setRefundType(messageCenter.getRefundType());
             }
             }
             mess.setShopName(shopName);
             mess.setShopName(shopName);
         });
         });
@@ -847,8 +863,8 @@ public class LoginServiceImpl implements LoginService {
         operation.setOpenId(openId);
         operation.setOpenId(openId);
         operation.setUnionId(unionId);
         operation.setUnionId(unionId);
         // 审核未通过 待审核状态
         // 审核未通过 待审核状态
-        if (1 == operation.getClubStatus() || 92 == operation.getClubStatus()){
-            return ResponseJson.error(-1,"登陆失败",operation);
+        if (1 == operation.getClubStatus() || 92 == operation.getClubStatus()) {
+            return ResponseJson.error(-1, "登陆失败", operation);
         }
         }
         // 返回登录校验结果
         // 返回登录校验结果
         return logonVerify(operation);
         return logonVerify(operation);
@@ -887,7 +903,7 @@ public class LoginServiceImpl implements LoginService {
             // 供应商商品上架平台信息
             // 供应商商品上架平台信息
             List<String> shopProductList = loginMapper.getShopProductGroudMall(loginUser.getShopId());
             List<String> shopProductList = loginMapper.getShopProductGroudMall(loginUser.getShopId());
             if (null != shopProductList) {
             if (null != shopProductList) {
-                for(String product : shopProductList ) {
+                for (String product : shopProductList) {
                     if (StringUtils.isNotBlank(product)) {
                     if (StringUtils.isNotBlank(product)) {
                         if (product.contains("4")) {
                         if (product.contains("4")) {
                             flag = true;
                             flag = true;
@@ -907,28 +923,23 @@ public class LoginServiceImpl implements LoginService {
         // 超级会员
         // 超级会员
         SuperVipDto end = findEnd(loginUser.getUserId());
         SuperVipDto end = findEnd(loginUser.getUserId());
         loginUser.setVipFlag(end.getVipFlag());
         loginUser.setVipFlag(end.getVipFlag());
-//        if (1 == end.getVipFlag() && 4 == loginUser.getUserIdentity()) {
-//            // 个人超级会员权限置为会员机构
-//            loginUser.setUserIdentity(2);
-//            loginUser.setUserPermission(2);
-//        }
 
 
         if (loginUser.getUserId() != null) {
         if (loginUser.getUserId() != null) {
-            if(loginUser.getClubId() != null&&loginUser.getClubId()!=1342){
+            if (loginUser.getClubId() != null && loginUser.getClubId() != 1342) {
                 loginUser.setSpUserId(loginMapper.getClubSpUserId(loginUser.getClubId()));
                 loginUser.setSpUserId(loginMapper.getClubSpUserId(loginUser.getClubId()));
             }
             }
             Integer shopID = messageCenterMapper.shopID(loginUser.getUserId());
             Integer shopID = messageCenterMapper.shopID(loginUser.getUserId());
             Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
             Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
             // 上架费次数
             // 上架费次数
-            Integer listingFeeCount= messageCenterMapper.listingFee(shopID);
+            Integer listingFeeCount = messageCenterMapper.listingFee(shopID);
             // 上架费有效期内个数
             // 上架费有效期内个数
-            Integer listingfeeExpireCount= messageCenterMapper.listingfeeExpire(shopID);
+            Integer listingfeeExpireCount = messageCenterMapper.listingfeeExpire(shopID);
             // 有免除上架费的次数
             // 有免除上架费的次数
-            Integer receStatctCount=messageCenterMapper.receStatct(shopID);
+            Integer receStatctCount = messageCenterMapper.receStatct(shopID);
             Integer listingFee = 0;
             Integer listingFee = 0;
             // 如果上架费次数为 0 ;所有上架费都不在在生效时间; 没有免除过上架费;
             // 如果上架费次数为 0 ;所有上架费都不在在生效时间; 没有免除过上架费;
-            if(listingFeeCount > 0 && listingfeeExpireCount == 0){
-                if(receStatctCount <= 0){
+            if (listingFeeCount > 0 && listingfeeExpireCount == 0) {
+                if (receStatctCount <= 0) {
                     listingFee = 1;
                     listingFee = 1;
                 }
                 }
             }
             }
@@ -1036,13 +1047,13 @@ public class LoginServiceImpl implements LoginService {
                 System.out.println(savedCount);
                 System.out.println(savedCount);
             } else {
             } else {
                 savedCount = messageCenterMapper.Count(2, shopID);
                 savedCount = messageCenterMapper.Count(2, shopID);
-                Integer listingFeeCount= messageCenterMapper.listingFee(shopID);
-                Integer listingfeeExpireCount= messageCenterMapper.listingfeeExpire(shopID);
-                Integer receStatctCount=messageCenterMapper.receStatct(shopID);
-                Integer listingFee=0;
-                if(listingFeeCount>0 && listingfeeExpireCount>0){
-                    if(receStatctCount<=0){
-                        listingFee=1;
+                Integer listingFeeCount = messageCenterMapper.listingFee(shopID);
+                Integer listingfeeExpireCount = messageCenterMapper.listingfeeExpire(shopID);
+                Integer receStatctCount = messageCenterMapper.receStatct(shopID);
+                Integer listingFee = 0;
+                if (listingFeeCount > 0 && listingfeeExpireCount > 0) {
+                    if (receStatctCount <= 0) {
+                        listingFee = 1;
                     }
                     }
                 }
                 }
 
 
@@ -1127,7 +1138,7 @@ public class LoginServiceImpl implements LoginService {
         // 账号密码验证、短信验证校验方式
         // 账号密码验证、短信验证校验方式
         if ("0".equals(passOrNote)) {
         if ("0".equals(passOrNote)) {
             md5Password = Md5Util.md5(password);
             md5Password = Md5Util.md5(password);
-            item= md5Password.equals(user.getPassword());
+            item = md5Password.equals(user.getPassword());
         }
         }
         if ("1".equals(passOrNote)) {
         if ("1".equals(passOrNote)) {
             item = true;
             item = true;
@@ -1550,10 +1561,10 @@ public class LoginServiceImpl implements LoginService {
         // 账号密码验证
         // 账号密码验证
         if ("0".equals(codeType)) {
         if ("0".equals(codeType)) {
             if (ObjectUtils.isEmpty(loginCodeDto.getMobileOrEmail())) {
             if (ObjectUtils.isEmpty(loginCodeDto.getMobileOrEmail())) {
-                return ResponseJson.error("请输入账号",null);
+                return ResponseJson.error("请输入账号", null);
             }
             }
             if (ObjectUtils.isEmpty(loginCodeDto.getPassword())) {
             if (ObjectUtils.isEmpty(loginCodeDto.getPassword())) {
-                return ResponseJson.error("请输入密码",null);
+                return ResponseJson.error("请输入密码", null);
             }
             }
             // 账号
             // 账号
             String mobileOrEmail = loginCodeDto.getMobileOrEmail();
             String mobileOrEmail = loginCodeDto.getMobileOrEmail();
@@ -1571,10 +1582,10 @@ public class LoginServiceImpl implements LoginService {
         } else {
         } else {
             // 手机短信验证
             // 手机短信验证
             if (ObjectUtils.isEmpty(loginCodeDto.getMobile())) {
             if (ObjectUtils.isEmpty(loginCodeDto.getMobile())) {
-                return ResponseJson.error("请输入手机号",null);
+                return ResponseJson.error("请输入手机号", null);
             }
             }
             if (ObjectUtils.isEmpty(loginCodeDto.getCode())) {
             if (ObjectUtils.isEmpty(loginCodeDto.getCode())) {
-                return ResponseJson.error("请输入验证码",null);
+                return ResponseJson.error("请输入验证码", null);
             }
             }
             String mobile = loginCodeDto.getMobile();
             String mobile = loginCodeDto.getMobile();
             String code = loginCodeDto.getCode();
             String code = loginCodeDto.getCode();
@@ -1620,7 +1631,7 @@ public class LoginServiceImpl implements LoginService {
 
 
     @Override
     @Override
     public List<Integer> getMessageCenterListDay(Integer day) {
     public List<Integer> getMessageCenterListDay(Integer day) {
-        return  messageCenterMapper.getMessageCenterListDay(day);
+        return messageCenterMapper.getMessageCenterListDay(day);
     }
     }
 
 
     /**
     /**
@@ -1643,6 +1654,45 @@ public class LoginServiceImpl implements LoginService {
         }
         }
         return superVipDto;
         return superVipDto;
     }
     }
+    /**
+     * 初始化站内信
+     */
+    private List<MessageCenter> setMessageList(Integer userType,Integer messageType,Integer commonId) {
+        List<MessageCenter> list = messageCenterMapper.MessageList(userType, messageType, commonId);
+        list.forEach(mess -> {
+            if (null != mess.getOrderId()) {
+                MessageCenter messageCenter = messageCenterMapper.MainImage(userType, commonId, mess.getOrderId());
+                Integer productCount = messageCenterMapper.productCount(mess.getOrderId());
+                if (null != messageCenter) {
+                    mess.setMainImage(messageCenter.getMainImage());
+                    mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
+                    if (messageCenter.getProductName().length() > 10) {
+                        mess.setProductName(StringUtils.strip(messageCenter.getProductName().substring(0, 11)));
+                    } else {
+                        mess.setProductName(messageCenter.getProductName());
+                    }
+                    mess.setProductCount(productCount);
+                    mess.setRefundType(messageCenter.getRefundType());
+                    mess.setStatus(messageCenter.getStatus());
+                }
+            }
+        });
+        return list;
+    }
 
 
+    private Map<String, Object> setMessageCount(Integer userType, Integer commonId) {
+        Integer count = messageCenterMapper.Count(userType, commonId);
+        Integer tradeCount = messageCenterMapper.MessageCount(userType, 1, commonId);
+        Integer accountCount = messageCenterMapper.MessageCount(userType, 2, commonId);
+        Integer notificationCount = messageCenterMapper.MessageCount(userType, 3, commonId);
+        Integer promotionCount = messageCenterMapper.MessageCount(userType, 4, commonId);
+        Map<String, Object> map = new HashMap(5);
+        map.put("count", count);
+        map.put("tradeCount", tradeCount);
+        map.put("accountCount", accountCount);
+        map.put("notificationCount", notificationCount);
+        map.put("promotionCount", promotionCount);
+        return map;
+    }
 
 
 }
 }

+ 34 - 69
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -89,7 +89,7 @@ public class RegisterServiceImpl implements RegisterService {
     /**
     /**
      * 检查账号可以注册 -- 组织
      * 检查账号可以注册 -- 组织
      *
      *
-     * @param mobile 手机号
+     * @param mobile     手机号
      * @param organizeId 组织Id
      * @param organizeId 组织Id
      * @return sucess
      * @return sucess
      */
      */
@@ -159,10 +159,17 @@ public class RegisterServiceImpl implements RegisterService {
             return ResponseJson.error(passResult);
             return ResponseJson.error(passResult);
         }
         }
         // 协销Id,默认采美官方
         // 协销Id,默认采美官方
-        Integer spId =1342;
-        if (null !=clubRegisterDto.getIsSp()&&1 ==clubRegisterDto.getIsSp()) {
-            spId =null!= clubRegisterDto.getSpId()?clubRegisterDto.getSpId():clubMapper.getSpIdRAND();
+        Integer spId = 1342;
+        int ss = null != clubRegisterDto.getInsideFLag() ? clubRegisterDto.getInsideFLag() : 0;
+        // 外部协销
+        if (null != clubRegisterDto.getInsideFLag() && 1 == clubRegisterDto.getInsideFLag()) {
+            spId = clubRegisterDto.getSpId();
+        } else {
+            if (null != clubRegisterDto.getIsSp() && 1 == clubRegisterDto.getIsSp()) {
+                spId = null != clubRegisterDto.getSpId() ? clubRegisterDto.getSpId() : clubMapper.getSpIdRAND();
+            }
         }
         }
+        spId = null == spId ? 1342 : spId;
         // 获取ip所在地
         // 获取ip所在地
         String ipAddress = "";
         String ipAddress = "";
         Integer provinceId = null;
         Integer provinceId = null;
@@ -180,7 +187,7 @@ public class RegisterServiceImpl implements RegisterService {
         } catch (IOException e) {
         } catch (IOException e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        log.info("ip所在地====》"+ipAddress);
+        log.info("ip所在地====》" + ipAddress);
         /*
         /*
             组装用户数据 user
             组装用户数据 user
          */
          */
@@ -208,12 +215,8 @@ public class RegisterServiceImpl implements RegisterService {
         user.setBindMobile(clubRegisterDto.getBindMobile());
         user.setBindMobile(clubRegisterDto.getBindMobile());
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         user.setUserIdentity(4);
         user.setUserIdentity(4);
-        // 用户权限: 2会员机构 3供应商 4协销 5普通机构
-        user.setUserPermission(5);
         // 是否已经引导过(机构升级:0否,1是)
         // 是否已经引导过(机构升级:0否,1是)
         user.setGuideFlag(0);
         user.setGuideFlag(0);
-        // 设置机构上线
-        user.setClubStatus(90);
         // 设置密码
         // 设置密码
         user.setPassword(Md5Util.md5(clubRegisterDto.getPassword()));
         user.setPassword(Md5Util.md5(clubRegisterDto.getPassword()));
         // 同意协议
         // 同意协议
@@ -282,8 +285,8 @@ public class RegisterServiceImpl implements RegisterService {
         registerMapper.updateUserClubId(user.getUserId(), club.getClubId());
         registerMapper.updateUserClubId(user.getUserId(), club.getClubId());
         // 添加机构协销记录
         // 添加机构协销记录
         if (StringUtils.isNotBlank(club.getLinkMan())) {
         if (StringUtils.isNotBlank(club.getLinkMan())) {
-            clubMapper.inProvider(spId, club.getClubId(), spId!=1342?"系统自动分配":club.getLinkMan(), 0);
-            if(spId!=1342) {
+            clubMapper.inProvider(spId, club.getClubId(), spId != 1342 ? "系统自动分配" : club.getLinkMan(), 0);
+            if (spId != 1342) {
                 log.info("注册普通机构,开始站内信推送");
                 log.info("注册普通机构,开始站内信推送");
                 String selSpName = clubMapper.selSpName(spId);
                 String selSpName = clubMapper.selSpName(spId);
                 String spMessage = "【采美365】系统已为你分配机构客户,请及时跟进。机构名称【" + user.getUserName() + "】,联系人【" + user.getUserName() + "】,手机号【" + user.getBindMobile() + "】。";
                 String spMessage = "【采美365】系统已为你分配机构客户,请及时跟进。机构名称【" + user.getUserName() + "】,联系人【" + user.getUserName() + "】,手机号【" + user.getBindMobile() + "】。";
@@ -390,9 +393,6 @@ public class RegisterServiceImpl implements RegisterService {
             log.info("注册普通机构,默认绑定为机构运营人员");
             log.info("注册普通机构,默认绑定为机构运营人员");
         }
         }
         log.info("注册普通机构成功,手机号>>>" + clubRegisterDto.getBindMobile());
         log.info("注册普通机构成功,手机号>>>" + clubRegisterDto.getBindMobile());
-//        if (!smsFlag) {
-//            log.info("短信发送失败,手机号:" + clubRegisterDto.getBindMobile());
-//        }
         //新用户自主注册送1000采美豆
         //新用户自主注册送1000采美豆
         UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
         UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
         beansHistory.setUserId(user.getUserId());
         beansHistory.setUserId(user.getUserId());
@@ -417,19 +417,19 @@ public class RegisterServiceImpl implements RegisterService {
     @Override
     @Override
     public ResponseJson accountInfo(String bindMobile, String smsCode, String password, String passWordConfirm) {
     public ResponseJson accountInfo(String bindMobile, String smsCode, String password, String passWordConfirm) {
         if (StringUtils.isBlank(bindMobile) || StringUtils.isEmpty(bindMobile)) {
         if (StringUtils.isBlank(bindMobile) || StringUtils.isEmpty(bindMobile)) {
-            return ResponseJson.error(-1, "请输入手机号",null);
+            return ResponseJson.error(-1, "请输入手机号", null);
         }
         }
         if (StringUtils.isBlank(smsCode) || StringUtils.isEmpty(smsCode)) {
         if (StringUtils.isBlank(smsCode) || StringUtils.isEmpty(smsCode)) {
-            return ResponseJson.error(-1, "请输入验证码",null);
+            return ResponseJson.error(-1, "请输入验证码", null);
         }
         }
         if (StringUtils.isBlank(password) || StringUtils.isEmpty(password)) {
         if (StringUtils.isBlank(password) || StringUtils.isEmpty(password)) {
-            return ResponseJson.error(-1, "请输入登录密码",null);
+            return ResponseJson.error(-1, "请输入登录密码", null);
         }
         }
         if (StringUtils.isBlank(passWordConfirm) || StringUtils.isEmpty(passWordConfirm)) {
         if (StringUtils.isBlank(passWordConfirm) || StringUtils.isEmpty(passWordConfirm)) {
-            return ResponseJson.error(-1, "请确认密码",null);
+            return ResponseJson.error(-1, "请确认密码", null);
         }
         }
         if (!password.equals(passWordConfirm)) {
         if (!password.equals(passWordConfirm)) {
-            return ResponseJson.error(-1, "两次输入的密码不一致",null);
+            return ResponseJson.error(-1, "两次输入的密码不一致", null);
         }
         }
         // 手机号与验证码校验
         // 手机号与验证码校验
         String result = commonService.organizeMobileValidate(bindMobile, smsCode, 4);
         String result = commonService.organizeMobileValidate(bindMobile, smsCode, 4);
@@ -508,12 +508,8 @@ public class RegisterServiceImpl implements RegisterService {
         user.setBindMobile(organizeRegisterDto.getBindMobile());
         user.setBindMobile(organizeRegisterDto.getBindMobile());
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         user.setUserIdentity(4);
         user.setUserIdentity(4);
-        // 用户权限: 2会员机构 3供应商 4协销 5普通机构
-        user.setUserPermission(5);
         // 是否已经引导过(机构升级:0否,1是)
         // 是否已经引导过(机构升级:0否,1是)
         user.setGuideFlag(0);
         user.setGuideFlag(0);
-        // 联合丽格设置待审核
-        user.setClubStatus(1);
         // 设置密码
         // 设置密码
         user.setPassword(Md5Util.md5(organizeRegisterDto.getPassword()));
         user.setPassword(Md5Util.md5(organizeRegisterDto.getPassword()));
         // 同意协议
         // 同意协议
@@ -724,8 +720,6 @@ public class RegisterServiceImpl implements RegisterService {
         user.setEmail(upgradeDto.getContractEmail());
         user.setEmail(upgradeDto.getContractEmail());
         // 机构名称
         // 机构名称
         user.setName(upgradeDto.getName());
         user.setName(upgradeDto.getName());
-        // 待审核资料
-        user.setClubStatus(1);
         // 更新机构用户
         // 更新机构用户
         registerMapper.updateClubUserByUpgrade(user);
         registerMapper.updateClubUserByUpgrade(user);
         /*
         /*
@@ -875,7 +869,7 @@ public class RegisterServiceImpl implements RegisterService {
         } catch (IOException e) {
         } catch (IOException e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        log.info("ip所在地====》"+ipAddress);
+        log.info("ip所在地====》" + ipAddress);
         /*
         /*
             组装用户数据 user
             组装用户数据 user
          */
          */
@@ -900,10 +894,6 @@ public class RegisterServiceImpl implements RegisterService {
         user.setBindMobile(mobile);
         user.setBindMobile(mobile);
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         user.setUserIdentity(4);
         user.setUserIdentity(4);
-        // 用户权限: 2会员机构 3供应商 4协销 5普通机构
-        user.setUserPermission(5);
-        // 设置机构上线
-        user.setClubStatus(90);
         // 默认密码
         // 默认密码
         String randomCode = CodeUtil.generateCodeInt(6);
         String randomCode = CodeUtil.generateCodeInt(6);
         String initPassword = "cm" + randomCode;
         String initPassword = "cm" + randomCode;
@@ -918,8 +908,6 @@ public class RegisterServiceImpl implements RegisterService {
         user.setServiceProviderStatus(serviceProvider.getStatus());
         user.setServiceProviderStatus(serviceProvider.getStatus());
         // 会员机构,填写升级资料
         // 会员机构,填写升级资料
         if (StringUtils.isNotBlank(businessLicense)) {
         if (StringUtils.isNotBlank(businessLicense)) {
-            // 状态:待审查资料
-            user.setClubStatus(1);
             // 组织名称
             // 组织名称
             user.setName(clubTemporary.getName());
             user.setName(clubTemporary.getName());
             // 邮箱
             // 邮箱
@@ -939,13 +927,12 @@ public class RegisterServiceImpl implements RegisterService {
             }
             }
         } else {
         } else {
             user.setUserId(confirmUserId);
             user.setUserId(confirmUserId);
-            user.setClubStatus(90);
             registerMapper.updateClubUser(user);
             registerMapper.updateClubUser(user);
             log.info("客服注册机构注册,更新user表userId>>>>>" + confirmUserId);
             log.info("客服注册机构注册,更新user表userId>>>>>" + confirmUserId);
         }
         }
         /* 机构列表用户状态默认插入 */
         /* 机构列表用户状态默认插入 */
 
 
-        if(user.getUserId() != null) {
+        if (user.getUserId() != null) {
             registerMapper.insertOrgan(user.getUserId());
             registerMapper.insertOrgan(user.getUserId());
             registerMapper.insertActiveOrgan(user.getUserId());
             registerMapper.insertActiveOrgan(user.getUserId());
         }
         }
@@ -1046,7 +1033,7 @@ public class RegisterServiceImpl implements RegisterService {
             clubMapper.inProvider(serviceProvider.getServiceProviderId(), club.getClubId(), club.getLinkMan(), 1);
             clubMapper.inProvider(serviceProvider.getServiceProviderId(), club.getClubId(), club.getLinkMan(), 1);
         }
         }
         //推送信息中心-账户通知
         //推送信息中心-账户通知
-        MessageCenter messageCenter=new MessageCenter();
+        MessageCenter messageCenter = new MessageCenter();
         messageCenter.setShopId(null);
         messageCenter.setShopId(null);
         messageCenter.setClubId(club.getClubId());
         messageCenter.setClubId(club.getClubId());
         messageCenter.setUserType(1);
         messageCenter.setUserType(1);
@@ -1056,9 +1043,6 @@ public class RegisterServiceImpl implements RegisterService {
         messageCenter.setTime(current);
         messageCenter.setTime(current);
         messageCenterMapper.addMessageCenter(messageCenter);
         messageCenterMapper.addMessageCenter(messageCenter);
 
 
-
-
-
         /*
         /*
          * 操作成功,推送短信给机构,获取账号密码。
          * 操作成功,推送短信给机构,获取账号密码。
          * 协销去后台审核,机构用账号密码登录绑定微信
          * 协销去后台审核,机构用账号密码登录绑定微信
@@ -1073,7 +1057,7 @@ public class RegisterServiceImpl implements RegisterService {
             logTxt = String.format(logTxt, "普通机构", mobile, initPassword);
             logTxt = String.format(logTxt, "普通机构", mobile, initPassword);
         }
         }
         // 发送短信
         // 发送短信
-        String content = "欢迎成为采美机构用户,您的登录账号为:"+mobile+",初始密码为:cm"+randomCode+",您可使用该账号密码登录采美365网和“采美采购商城”小程序。";
+        String content = "欢迎成为采美机构用户,您的登录账号为:" + mobile + ",初始密码为:cm" + randomCode + ",您可使用该账号密码登录采美365网和“采美采购商城”小程序。";
         boolean smsFlag = remoteCallService.remoteSendSms(0, 1, mobile, content);
         boolean smsFlag = remoteCallService.remoteSendSms(0, 1, mobile, content);
         if (!smsFlag) {
         if (!smsFlag) {
             // 短信发送失败重试一次
             // 短信发送失败重试一次
@@ -1175,7 +1159,7 @@ public class RegisterServiceImpl implements RegisterService {
         } catch (IOException e) {
         } catch (IOException e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        log.info("ip所在地====》"+ipAddress);
+        log.info("ip所在地====》" + ipAddress);
         /*
         /*
             组装用户数据 user
             组装用户数据 user
          */
          */
@@ -1206,8 +1190,6 @@ public class RegisterServiceImpl implements RegisterService {
         user.setEmail(shopRegisterDto.getEmail());
         user.setEmail(shopRegisterDto.getEmail());
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
         user.setUserIdentity(3);
         user.setUserIdentity(3);
-        // 用户权限: 2会员机构 3供应商 4协销 5普通机构
-        user.setUserPermission(3);
         // 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
         // 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
         user.setManufacturerStatus(3);
         user.setManufacturerStatus(3);
         // 用户状态,1正常,0冻结
         // 用户状态,1正常,0冻结
@@ -1264,8 +1246,8 @@ public class RegisterServiceImpl implements RegisterService {
         shop.setStatus(3);
         shop.setStatus(3);
         //如选择为医疗>>三类器械  则必须要上传资质
         //如选择为医疗>>三类器械  则必须要上传资质
         shop.setMedicalPracticeLicenseImg1(shopRegisterDto.getMedicalPracticeLicense());
         shop.setMedicalPracticeLicenseImg1(shopRegisterDto.getMedicalPracticeLicense());
-        /*
-            保存数据库 shop
+        /**
+         保存数据库 shop
          */
          */
         int insertShopFlag = registerMapper.insertShop(shop);
         int insertShopFlag = registerMapper.insertShop(shop);
         if (insertShopFlag < 1) {
         if (insertShopFlag < 1) {
@@ -1418,19 +1400,19 @@ public class RegisterServiceImpl implements RegisterService {
                     try {
                     try {
                         log.info("***********会员充值微信公众号推送************");
                         log.info("***********会员充值微信公众号推送************");
                         String accessToken = weChatService.getAccessToken();
                         String accessToken = weChatService.getAccessToken();
-                        String unionId=messageCenterMapper.UnionIdList(userId);
+                        String unionId = messageCenterMapper.UnionIdList(userId);
                         String openid = messageCenterMapper.getOpenidListByPermission(unionId);
                         String openid = messageCenterMapper.getOpenidListByPermission(unionId);
-                        String title="恭喜您成为采美商城超级会员";
-                        String name=pac.getDuration() + "个月";
-                        Double price=pac.getPrice();
-                        String date="30";
+                        String title = "恭喜您成为采美商城超级会员";
+                        String name = pac.getDuration() + "个月";
+                        Double price = pac.getPrice();
+                        String date = "30";
                         String time = current;
                         String time = current;
                         String remarkText = "如在使用中有任何疑问,请在小程序内联系在线客服";
                         String remarkText = "如在使用中有任何疑问,请在小程序内联系在线客服";
                         // 跳转到【小程序付款-选择支付方式页面】
                         // 跳转到【小程序付款-选择支付方式页面】
                         String pagePath = "/pages/user/member/member";
                         String pagePath = "/pages/user/member/member";
                         // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接
                         // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接
                         log.error("获取openid>>>>>" + openid);
                         log.error("获取openid>>>>>" + openid);
-                        weChatService.sendTemplateMsgs(accessToken, openid,title,name,price,date,remarkText, pagePath);
+                        weChatService.sendTemplateMsgs(accessToken, openid, title, name, price, date, remarkText, pagePath);
                     } catch (Exception e) {
                     } catch (Exception e) {
                         log.error("【会员充值微信通知】获取微信公众号access_token异常!", e);
                         log.error("【会员充值微信通知】获取微信公众号access_token异常!", e);
                     }
                     }
@@ -1443,7 +1425,7 @@ public class RegisterServiceImpl implements RegisterService {
             if (Double.valueOf(userBeans) >= (pac.getPrice() * pac.getProportion())) {
             if (Double.valueOf(userBeans) >= (pac.getPrice() * pac.getProportion())) {
                 //续费生效时间不变,原到期时间+套餐时间
                 //续费生效时间不变,原到期时间+套餐时间
                 beanPay(userId, packageId, endFlag.getEndTime(), endFlag.getVipFlag());
                 beanPay(userId, packageId, endFlag.getEndTime(), endFlag.getVipFlag());
-                     //推送站内消息
+                //推送站内消息
                 if (clubId != null) {
                 if (clubId != null) {
                     //推送信息中心-账户通知
                     //推送信息中心-账户通知
                     SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                     SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -1770,7 +1752,7 @@ public class RegisterServiceImpl implements RegisterService {
                 .validFlag("1")
                 .validFlag("1")
                 .bindMobile(clubRegisterDto.getBindMobile())
                 .bindMobile(clubRegisterDto.getBindMobile())
         );
         );
-        if (null!=byUser) {
+        if (null != byUser) {
             return ResponseJson.success(String.valueOf(byUser.clubID()), null);
             return ResponseJson.success(String.valueOf(byUser.clubID()), null);
         }
         }
         clubRegisterDto.setPassword("1111aaaa");
         clubRegisterDto.setPassword("1111aaaa");
@@ -1819,12 +1801,8 @@ public class RegisterServiceImpl implements RegisterService {
         user.setBindMobile(clubRegisterDto.getBindMobile());
         user.setBindMobile(clubRegisterDto.getBindMobile());
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构,8分销人员生成机构
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构,8分销人员生成机构
         user.setUserIdentity(8);
         user.setUserIdentity(8);
-        // 用户权限: 2会员机构 3供应商 4协销 5普通机构
-        user.setUserPermission(5);
         // 是否已经引导过(机构升级:0否,1是)
         // 是否已经引导过(机构升级:0否,1是)
         user.setGuideFlag(0);
         user.setGuideFlag(0);
-        // 设置机构
-        user.setClubStatus(92);
         // 设置密码
         // 设置密码
         user.setPassword(Md5Util.md5(clubRegisterDto.getPassword()));
         user.setPassword(Md5Util.md5(clubRegisterDto.getPassword()));
         // 同意协议
         // 同意协议
@@ -1893,18 +1871,5 @@ public class RegisterServiceImpl implements RegisterService {
         return ResponseJson.success(String.valueOf(club.getClubId()), null);
         return ResponseJson.success(String.valueOf(club.getClubId()), null);
     }
     }
 
 
-//    public static void main(String[] args) throws ParseException {
-//        Date d=new Date();
-//        //1.日期格式
-//        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
-//
-//        //2.某天的日期
-//        Date da1=sdf.parse("2022-01-01 03:30:16");
-//        Long s=(d.getTime()-da1.getTime())/24/60/60/30/1000;
-//        //3.输出间隔天数         getTime获取的是毫秒
-//        System.out.println(s);
-//    }
-
-
 }
 }
 
 

+ 27 - 24
src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java

@@ -86,7 +86,7 @@ public class SellerServiceImpl implements SellerService {
                 String start = dateFormat.format(dateFormat.parse(startTime));
                 String start = dateFormat.format(dateFormat.parse(startTime));
                 startTime = start + " 00:00:00";
                 startTime = start + " 00:00:00";
             }
             }
-            if (StringUtils.isNotBlank(endTime)){
+            if (StringUtils.isNotBlank(endTime)) {
                 String end = dateFormat.format(dateFormat.parse(endTime));
                 String end = dateFormat.format(dateFormat.parse(endTime));
                 endTime = end + " 23:59:59";
                 endTime = end + " 23:59:59";
             }
             }
@@ -96,17 +96,17 @@ public class SellerServiceImpl implements SellerService {
         // 获取协销用户下的机构列表
         // 获取协销用户下的机构列表
         List<ClubVo> clubList = new ArrayList<ClubVo>();
         List<ClubVo> clubList = new ArrayList<ClubVo>();
         List<Integer> serviceIds = new ArrayList<Integer>();
         List<Integer> serviceIds = new ArrayList<Integer>();
-        if (1 == type || 3 == type|| 6 == type) {
-            if(null != groupServiceId && groupServiceId > 0){
+        if (1 == type || 3 == type || 6 == type) {
+            if (null != groupServiceId && groupServiceId > 0) {
                 return ResponseJson.success();
                 return ResponseJson.success();
-            }else{
+            } else {
                 PageHelper.startPage(pageNum, pageSize);
                 PageHelper.startPage(pageNum, pageSize);
                 clubList = sellerMapper.findClubs(serviceProviderId, status, name, userIdentity, type, startTime, endTime, activeState, customerValue, null);
                 clubList = sellerMapper.findClubs(serviceProviderId, status, name, userIdentity, type, startTime, endTime, activeState, customerValue, null);
             }
             }
         } else if (2 == type) {
         } else if (2 == type) {
             if (null != groupServiceId && groupServiceId > 0) {
             if (null != groupServiceId && groupServiceId > 0) {
                 PageHelper.startPage(pageNum, pageSize);
                 PageHelper.startPage(pageNum, pageSize);
-                clubList = sellerMapper.findClubs(groupServiceId, status, name, userIdentity, 1,  startTime, endTime, activeState, customerValue, null);
+                clubList = sellerMapper.findClubs(groupServiceId, status, name, userIdentity, 1,  startTime, endTime, null);
             } else {
             } else {
                 Integer leaderId = sellerMapper.findLeaderIdByServiceId(serviceProviderId);
                 Integer leaderId = sellerMapper.findLeaderIdByServiceId(serviceProviderId);
                 Integer managerId = sellerMapper.findmanagerIdByServiceId(serviceProviderId);
                 Integer managerId = sellerMapper.findmanagerIdByServiceId(serviceProviderId);
@@ -265,10 +265,11 @@ public class SellerServiceImpl implements SellerService {
 
 
     /**
     /**
      * 功能描述: 机构活跃分析比例
      * 功能描述: 机构活跃分析比例
-     * @auther: Kaick
-     * @date: 2023/9/4 9:48
+     *
      * @param
      * @param
      * @return []
      * @return []
+     * @auther: Kaick
+     * @date: 2023/9/4 9:48
      */
      */
 
 
     @Override
     @Override
@@ -420,16 +421,16 @@ public class SellerServiceImpl implements SellerService {
                     UserLoginVo baseUser = loginMapper.getLoginOrganizeUserByMobileOrEmail(mobile);
                     UserLoginVo baseUser = loginMapper.getLoginOrganizeUserByMobileOrEmail(mobile);
                     // 协销下线不在登录协销登录
                     // 协销下线不在登录协销登录
                     if (null != baseUser.getUserIdentity() && 1 == baseUser.getUserIdentity()) {
                     if (null != baseUser.getUserIdentity() && 1 == baseUser.getUserIdentity()) {
-                        if ( null != baseUser.getServiceStatus() && 90 != baseUser.getServiceStatus()) {
+                        if (null != baseUser.getServiceStatus() && 90 != baseUser.getServiceStatus()) {
                             seller = new UserLoginVo();
                             seller = new UserLoginVo();
                             seller.setOpenId(openId);
                             seller.setOpenId(openId);
                             seller.setUnionId(unionId);
                             seller.setUnionId(unionId);
-                            return ResponseJson.error(-1,"采购员已下线",seller);
+                            return ResponseJson.error(-1, "采购员已下线", seller);
                         }
                         }
                     }
                     }
                     // 绑定微信信息
                     // 绑定微信信息
                     Integer operationUser = loginMapper.getOperationUser(mobile);
                     Integer operationUser = loginMapper.getOperationUser(mobile);
-                    log.info("operationUser==="+operationUser);
+                    log.info("operationUser===" + operationUser);
                     /*if (null == operationUser) {
                     /*if (null == operationUser) {
                         // 绑定微信
                         // 绑定微信
                         OperationVo operationVo = new OperationVo();
                         OperationVo operationVo = new OperationVo();
@@ -448,10 +449,10 @@ public class SellerServiceImpl implements SellerService {
                     }*/
                     }*/
                     return ResponseJson.success(seller);
                     return ResponseJson.success(seller);
                 } else {
                 } else {
-                    return ResponseJson.error(-1, "验证码错误,请确认验证码输入",null);
+                    return ResponseJson.error(-1, "验证码错误,请确认验证码输入", null);
                 }
                 }
             } else {
             } else {
-                return ResponseJson.error(-1, "验证码错误, 请重新获取",null);
+                return ResponseJson.error(-1, "验证码错误, 请重新获取", null);
             }
             }
         }
         }
         return ResponseJson.error();
         return ResponseJson.error();
@@ -528,13 +529,13 @@ public class SellerServiceImpl implements SellerService {
 
 
     @Override
     @Override
     public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer spId, String accessTime) {
     public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer spId, String accessTime) {
-       // 设置日期格式
+        // 设置日期格式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDate date = LocalDate.parse(accessTime, formatter);
         LocalDate date = LocalDate.parse(accessTime, formatter);
         // 获取前一天的日期
         // 获取前一天的日期
         LocalDate dayBeforeYesterday = date.minusDays(1);
         LocalDate dayBeforeYesterday = date.minusDays(1);
         // 格式化日期
         // 格式化日期
-        accessTime= dayBeforeYesterday.format(formatter);
+        accessTime = dayBeforeYesterday.format(formatter);
         List<CmBehaviorRecordVo> behaviorRecordYesterdayClub = sellerMapper.getBehaviorRecordYesterdayClub(spId, accessTime);
         List<CmBehaviorRecordVo> behaviorRecordYesterdayClub = sellerMapper.getBehaviorRecordYesterdayClub(spId, accessTime);
         for (CmBehaviorRecordVo cmBehaviorRecordVo : behaviorRecordYesterdayClub) {
         for (CmBehaviorRecordVo cmBehaviorRecordVo : behaviorRecordYesterdayClub) {
             String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
             String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
@@ -557,18 +558,18 @@ public class SellerServiceImpl implements SellerService {
             String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
             String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
             cmBehaviorRecordVo.setPageLabel(pageLabel);
             cmBehaviorRecordVo.setPageLabel(pageLabel);
             cmBehaviorRecordVo.setAccessDuration(calculationTime(cmBehaviorRecordVo.getAccessDuration()));
             cmBehaviorRecordVo.setAccessDuration(calculationTime(cmBehaviorRecordVo.getAccessDuration()));
-            if (cmBehaviorRecordVo.getProductID() != 0 && cmBehaviorRecordVo.getPageType().equals("6") ) {
+            if (cmBehaviorRecordVo.getProductID() != 0 && cmBehaviorRecordVo.getPageType().equals("6")) {
                 ProductItemVo productShown = shopMapper.getProductShown(cmBehaviorRecordVo.getProductID());
                 ProductItemVo productShown = shopMapper.getProductShown(cmBehaviorRecordVo.getProductID());
                 cmBehaviorRecordVo.setTitleId(cmBehaviorRecordVo.getProductID());
                 cmBehaviorRecordVo.setTitleId(cmBehaviorRecordVo.getProductID());
                 cmBehaviorRecordVo.setTitle(productShown.getName());
                 cmBehaviorRecordVo.setTitle(productShown.getName());
                 cmBehaviorRecordVo.setTitleImage(productShown.getImage());
                 cmBehaviorRecordVo.setTitleImage(productShown.getImage());
-            }else if ( cmBehaviorRecordVo.getPageType().equals("11") ) {
+            } else if (cmBehaviorRecordVo.getPageType().equals("11")) {
                 //获取文章id
                 //获取文章id
                 Integer id = null;
                 Integer id = null;
                 Pattern pattern = Pattern.compile("info/detail-(.*?)-");
                 Pattern pattern = Pattern.compile("info/detail-(.*?)-");
                 Matcher matcher = pattern.matcher(cmBehaviorRecordVo.getPagePath());
                 Matcher matcher = pattern.matcher(cmBehaviorRecordVo.getPagePath());
                 if (matcher.find()) {
                 if (matcher.find()) {
-                    id= Integer.valueOf(matcher.group(1));
+                    id = Integer.valueOf(matcher.group(1));
                 }
                 }
                 ShopArticleVo info = articleMapper.getShopArticleById(id);
                 ShopArticleVo info = articleMapper.getShopArticleById(id);
                 cmBehaviorRecordVo.setTitleId(id);
                 cmBehaviorRecordVo.setTitleId(id);
@@ -648,7 +649,7 @@ public class SellerServiceImpl implements SellerService {
                 rd.setRecord(recordList);
                 rd.setRecord(recordList);
             }
             }
             // 没有重点访问页面数据删除不回显
             // 没有重点访问页面数据删除不回显
-            data.removeIf(d -> d.getRecord().size() <= 0 );
+            data.removeIf(d -> d.getRecord().size() <= 0);
         }
         }
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         PageInfo<RetuenDataVo> page = new PageInfo<>(data);
         PageInfo<RetuenDataVo> page = new PageInfo<>(data);
@@ -676,6 +677,7 @@ public class SellerServiceImpl implements SellerService {
 
 
     /**
     /**
      * 机构编号
      * 机构编号
+     *
      * @param club
      * @param club
      */
      */
     public void setClubNumber(ClubVo club) {
     public void setClubNumber(ClubVo club) {
@@ -683,7 +685,7 @@ public class SellerServiceImpl implements SellerService {
         int maxLen = 6;
         int maxLen = 6;
         int len = newClubId.length();
         int len = newClubId.length();
         if (len < maxLen) {
         if (len < maxLen) {
-            for (int i = 0;i < (maxLen - len); i++) {
+            for (int i = 0; i < (maxLen - len); i++) {
                 newClubId = "0" + newClubId;
                 newClubId = "0" + newClubId;
             }
             }
         }
         }
@@ -692,12 +694,13 @@ public class SellerServiceImpl implements SellerService {
 
 
     /**
     /**
      * 时间计算
      * 时间计算
+     *
      * @param recordTime
      * @param recordTime
      * @return
      * @return
      */
      */
-    public String calculationTime(String recordTime){
+    public String calculationTime(String recordTime) {
         double doc = Double.parseDouble(recordTime);
         double doc = Double.parseDouble(recordTime);
-        int num = (int)doc;
+        int num = (int) doc;
         //小时
         //小时
         int HH = 0;
         int HH = 0;
         // 分钟
         // 分钟
@@ -705,17 +708,17 @@ public class SellerServiceImpl implements SellerService {
         //秒
         //秒
         int ss = 0;
         int ss = 0;
         int item = num / 1000;
         int item = num / 1000;
-        if ((item / 60) >0) {
+        if ((item / 60) > 0) {
             mm = item / 60;
             mm = item / 60;
             ss = item % 60;
             ss = item % 60;
         } else {
         } else {
             ss = item;
             ss = item;
         }
         }
-        if ((mm / 60) >0) {
+        if ((mm / 60) > 0) {
             HH = mm / 60;
             HH = mm / 60;
             mm = mm % 60;
             mm = mm % 60;
         }
         }
-        String  str= HH+":"+mm+":"+ss;
+        String str = HH + ":" + mm + ":" + ss;
         SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
         SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
         Date parse = null;
         Date parse = null;
         try {
         try {

+ 1 - 1
src/main/java/com/caimei365/user/service/impl/ShopServiceImpl.java

@@ -483,7 +483,7 @@ public class ShopServiceImpl implements ShopService {
     public void Open() {
     public void Open() {
         Jedis jedis = new Jedis("172.31.165.27", 6379);
         Jedis jedis = new Jedis("172.31.165.27", 6379);
         jedis.auth("6#xsI%b4o@5c3RoE");
         jedis.auth("6#xsI%b4o@5c3RoE");
-        jedis.lpush("constraint", "0");
+        jedis.lpush("constraint", "");
     }
     }
 
 
     @Override
     @Override

+ 1 - 1
src/main/java/com/caimei365/user/utils/AliyunSmsUtil.java

@@ -56,7 +56,7 @@ public class AliyunSmsUtil {
             // 模版内容: 欢迎成为采美机构用户,您的登录账号为:${name},初始密码为:cm${content},您可使用该账号密码登录采美365网和“采美采购商城”小程序。
             // 模版内容: 欢迎成为采美机构用户,您的登录账号为:${name},初始密码为:cm${content},您可使用该账号密码登录采美365网和“采美采购商城”小程序。
             templateCode = "SMS_215122672";
             templateCode = "SMS_215122672";
         } else if (type == 7) {
         } else if (type == 7) {
-            // 模版内容: 您"呵呵商城"小程序的验证码为:${code},验证码 5 分钟内有效。
+            // 模版内容: 您"颜选美学商城"小程序的验证码为:${code},验证码 5 分钟内有效。
             templateCode = "SMS_215334982";
             templateCode = "SMS_215334982";
             signName = "采美365";
             signName = "采美365";
         } else if (type == 8) {
         } else if (type == 8) {

+ 78 - 7
src/main/resources/mapper/BaseMapper.xml

@@ -94,7 +94,7 @@
         SELECT serviceProviderID as serviceProviderId, status as operationStatus FROM serviceprovider WHERE contractMobile = #{mobile} and organizeId = 4 limit 1
         SELECT serviceProviderID as serviceProviderId, status as operationStatus FROM serviceprovider WHERE contractMobile = #{mobile} and organizeId = 4 limit 1
     </select>
     </select>
     <select id="getUserIdByOrganizeStatus" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getUserIdByOrganizeStatus" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        SELECT userId, userIdentity, clubStatus
+        SELECT userId, userIdentity, (select status from club where userId = USER.userId limit 1) as clubStatus
         FROM USER
         FROM USER
         WHERE userOrganizeID = #{organizeId}
         WHERE userOrganizeID = #{organizeId}
           AND bindMobile = #{mobile}
           AND bindMobile = #{mobile}
@@ -109,8 +109,8 @@
         limit 1
         limit 1
     </select>
     </select>
     <select id="getClubStatusByUserId" resultType="java.lang.Integer">
     <select id="getClubStatusByUserId" resultType="java.lang.Integer">
-        select clubStatus
-        from user
+        select status
+        from club
         where userID = #{userId}
         where userID = #{userId}
     </select>
     </select>
     <select id="getShopStatusByUserId" resultType="java.lang.Integer">
     <select id="getShopStatusByUserId" resultType="java.lang.Integer">
@@ -161,8 +161,7 @@
                bindMobile,
                bindMobile,
                password,
                password,
                userIdentity,
                userIdentity,
-               userPermission,
-               clubStatus,
+               (select status from club where userId = user.userId limit 1) as clubStatus,
                manufacturerStatus,
                manufacturerStatus,
                serviceProviderStatus,
                serviceProviderStatus,
                auditNote,
                auditNote,
@@ -680,10 +679,82 @@
         select
         select
         cm_admin_mobile.mobile
         cm_admin_mobile.mobile
         from cm_admin_mobile AS cm_admin_mobile
         from cm_admin_mobile AS cm_admin_mobile
-        <where>  cm_admin_mobile.delFlag = 0 and cm_admin_mobile.enabledStatus = 1
-            <if test="type != null  and type != ''"> and cm_admin_mobile.type = #{type}</if>
+        <where>cm_admin_mobile.delFlag = 0 and cm_admin_mobile.enabledStatus = 1
+            <if test="type != null  and type != ''">and cm_admin_mobile.type = #{type}</if>
         </where>
         </where>
         group by cm_admin_mobile.id
         group by cm_admin_mobile.id
         order by cm_admin_mobile.createTime desc
         order by cm_admin_mobile.createTime desc
     </select>
     </select>
+
+    <insert id="addWxUnion" parameterType="WxUnion">
+        insert into wx_union
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="unionId != null and unionId != ''">unionId,</if>
+            <if test="type != null  and type == 1">
+                appOpenid,
+            </if>
+            <if test="type != null  and type == 2">
+                heheOpenid,
+            </if>
+            <if test="type != null  and type == 3">
+                crmOpenid,
+            </if>
+            <if test="type != null  and type == 4">
+                miniProgramOpenId,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="unionId != null and unionId != ''">#{unionId},</if>
+            <if test="type != null">
+                #{openid},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateWxUnion" parameterType="WxUnion">
+        update wx_union
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null  and type == 1">
+                appOpenid = #{openid},
+            </if>
+            <if test="type != null  and type == 2">
+                heheOpenid = #{openid},
+            </if>
+            <if test="type != null  and type == 3">
+                crmOpenid = #{openid},
+            </if>
+            <if test="type != null  and type == 4">
+                miniProgramOpenId = #{openid},
+            </if>
+        </trim>
+        where unionId = #{unionId}
+    </update>
+    <select id="getByWxUnion" parameterType="WxUnion" resultType="WxUnion">
+        select
+        wx_union.unionId,
+        wx_union.userId,
+        wx_union.crmOpenid,
+        wx_union.appOpenid,
+        wx_union.miniProgramOpenId,
+        wx_union.heheOpenid
+        from wx_union AS wx_union
+        <where>
+            <if test="unionId != null  and unionId != ''">
+                and wx_union.unionId = #{unionId}
+            </if>
+            <if test="type != null  and type == 1">
+                and wx_union.appOpenid = #{openid}
+            </if>
+            <if test="type != null  and type == 2">
+                and wx_union.heheOpenid = #{openid}
+            </if>
+            <if test="type != null  and type == 3">
+                and wx_union.crmOpenid = #{openid}
+            </if>
+            <if test="type != null  and type == 4">
+                and wx_union.miniProgramOpenId = #{openid}
+            </if>
+        </where>
+        limit 1
+    </select>
 </mapper>
 </mapper>

+ 150 - 105
src/main/resources/mapper/ClubMapper.xml

@@ -4,11 +4,14 @@
     <insert id="insertRemarks" parameterType="com.caimei365.user.model.po.ClubRemarksPo" keyProperty="remarksId"
     <insert id="insertRemarks" parameterType="com.caimei365.user.model.po.ClubRemarksPo" keyProperty="remarksId"
             useGeneratedKeys="true">
             useGeneratedKeys="true">
         insert into cm_club_remarks(clubId, serviceProviderId, remarks, addTime, questionMan, consultType, clubType,
         insert into cm_club_remarks(clubId, serviceProviderId, remarks, addTime, questionMan, consultType, clubType,
-                                    pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID, reportID,
-                                    communicationSituation, communicationMethods, customerSource, customerGender, customerAge, groupAddition, trendsKeyword, stateKeyword)
+                                    pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID,
+                                    reportID,
+                                    communicationSituation, communicationMethods, customerSource, customerGender,
+                                    customerAge, groupAddition, trendsKeyword, stateKeyword)
         values (#{clubId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{consult}, #{clubType},
         values (#{clubId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{consult}, #{clubType},
                 #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{serviceProviderId}, #{productID}, #{reportID},
                 #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{serviceProviderId}, #{productID}, #{reportID},
-                #{communicationSituation}, #{communicationMethods},#{customerSource},#{customerGender},#{customerAge},#{groupAddition},#{trendsKeyword}, #{stateKeyword} )
+                #{communicationSituation}, #{communicationMethods}, #{customerSource}, #{customerGender},
+                #{customerAge}, #{groupAddition}, #{trendsKeyword}, #{stateKeyword})
     </insert>
     </insert>
     <insert id="insertRemarksImage">
     <insert id="insertRemarksImage">
         insert into cm_club_remarks_file(remarksId, fileType, imageUrl)
         insert into cm_club_remarks_file(remarksId, fileType, imageUrl)
@@ -19,16 +22,21 @@
         values (#{remarksId}, 2, #{fileName}, #{ossName})
         values (#{remarksId}, 2, #{fileName}, #{ossName})
     </insert>
     </insert>
     <insert id="insertQuestionMan" keyProperty="remarksId" keyColumn="id" useGeneratedKeys="true">
     <insert id="insertQuestionMan" keyProperty="remarksId" keyColumn="id" useGeneratedKeys="true">
-        insert into cm_visitor_remarks(questionManId, serviceProviderId, remarks, addTime, questionMan, concactTime, createServiceProviderId)
-        values (#{questionManId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{concactTime}, #{serviceProviderId})
+        insert into cm_visitor_remarks(questionManId, serviceProviderId, remarks, addTime, questionMan, concactTime,
+                                       createServiceProviderId)
+        values (#{questionManId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{concactTime},
+                #{serviceProviderId})
     </insert>
     </insert>
     <insert id="insertVisitorRemark" keyProperty="remarksId" useGeneratedKeys="true">
     <insert id="insertVisitorRemark" keyProperty="remarksId" useGeneratedKeys="true">
         insert into cm_visitor_remarks(questionMan, questionManId, serviceProviderId, remarks, addTime, consultType,
         insert into cm_visitor_remarks(questionMan, questionManId, serviceProviderId, remarks, addTime, consultType,
-                                       clubType, pinceSensitve, satisfied, followup, extra, reportID, productID, createServiceProviderId,
-                                       communicationSituation, communicationMethods, customerSource, customerGender, customerAge, groupAddition, trendsKeyword, stateKeyword)
+                                       clubType, pinceSensitve, satisfied, followup, extra, reportID, productID,
+                                       createServiceProviderId,
+                                       communicationSituation, communicationMethods, customerSource, customerGender,
+                                       customerAge, groupAddition, trendsKeyword, stateKeyword)
         values (#{questionMan}, #{questionManId}, #{serviceProviderId}, #{remarks}, now(), #{consult}, #{clubType},
         values (#{questionMan}, #{questionManId}, #{serviceProviderId}, #{remarks}, now(), #{consult}, #{clubType},
                 #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{reportId}, #{productId}, #{serviceProviderId},
                 #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{reportId}, #{productId}, #{serviceProviderId},
-                #{communicationSituation}, #{communicationMethods},#{customerSource},#{customerGender},#{customerAge},#{groupAddition},#{trendsKeyword}, #{stateKeyword})
+                #{communicationSituation}, #{communicationMethods}, #{customerSource}, #{customerGender},
+                #{customerAge}, #{groupAddition}, #{trendsKeyword}, #{stateKeyword})
     </insert>
     </insert>
     <update id="updateClubNewDeal">
     <update id="updateClubNewDeal">
         update club
         update club
@@ -46,9 +54,10 @@
     <insert id="concactVisit" parameterType="com.caimei365.user.model.vo.RemarksVo" keyProperty="remarksId"
     <insert id="concactVisit" parameterType="com.caimei365.user.model.vo.RemarksVo" keyProperty="remarksId"
             useGeneratedKeys="true">
             useGeneratedKeys="true">
         insert into cm_club_remarks(clubId, serviceProviderId, remarks, addTime, questionMan, concactTime, consultType,
         insert into cm_club_remarks(clubId, serviceProviderId, remarks, addTime, questionMan, concactTime, consultType,
-                                    clubType, pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID, reportID)
+                                    clubType, pinceSensitve, satisfied, followup, extra, createServiceProviderId,
+                                    productID, reportID)
         values (#{clubId}, #{serviceProviderId}, #{remarks}, #{addTime}, #{questionMan}, now(), #{consult}, #{clubType},
         values (#{clubId}, #{serviceProviderId}, #{remarks}, #{addTime}, #{questionMan}, now(), #{consult}, #{clubType},
-                #{pinceSensitve}, #{satisfied}, #{followup}, #{extra},#{serviceProviderId}, #{productId}, #{reportId})
+                #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{serviceProviderId}, #{productId}, #{reportId})
     </insert>
     </insert>
     <insert id="insertChangeRecord" parameterType="com.caimei365.user.model.vo.ClubChangeSpVo"
     <insert id="insertChangeRecord" parameterType="com.caimei365.user.model.vo.ClubChangeSpVo"
             keyProperty="clubChangeSpRecordID"
             keyProperty="clubChangeSpRecordID"
@@ -91,8 +100,7 @@
         <if test="email != null and email != ''">
         <if test="email != null and email != ''">
             email = #{email},
             email = #{email},
         </if>
         </if>
-        userName = #{userName},
-        clubStatus = 1
+        userName = #{userName}
         where userID = #{userId}
         where userID = #{userId}
     </update>
     </update>
     <select id="selClubData" resultType="com.caimei365.user.model.vo.ClubVo">
     <select id="selClubData" resultType="com.caimei365.user.model.vo.ClubVo">
@@ -216,34 +224,34 @@
         where id = #{remarksId}
         where id = #{remarksId}
     </delete>
     </delete>
     <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
     <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
-        select clubID                    as clubId,
-               userID                    as userId,
+        select clubID                                                                                                as clubId,
+               userID                                                                                                as userId,
                name,
                name,
-               sname                     as shortName,
+               sname                                                                                                 as shortName,
                contractMobile,
                contractMobile,
                contractEmail,
                contractEmail,
                contractPhone,
                contractPhone,
                linkMan,
                linkMan,
                linkManIdentity,
                linkManIdentity,
-               provinceID                as proviceId,
-               cityID                    as cityId,
-               townID                    as townId,
-               ifnull(address, '暂无')     as address,
-               headpic                   as shopPhoto,
-               businessLicenseImage      as businessLicense,
+               provinceID                                                                                            as proviceId,
+               cityID                                                                                                as cityId,
+               townID                                                                                                as townId,
+               ifnull(address, '暂无')                                                                                 as address,
+               headpic                                                                                               as shopPhoto,
+               businessLicenseImage                                                                                  as businessLicense,
                socialCreditCode,
                socialCreditCode,
                firstClubType,
                firstClubType,
                secondClubType,
                secondClubType,
                department,
                department,
-               medicalPracticeLicenseImg as medicalPracticeLicense,
-               mainpro                   as mainProduct,
+               medicalPracticeLicenseImg                                                                             as medicalPracticeLicense,
+               mainpro                                                                                               as mainProduct,
                fax,
                fax,
-               info                      as profile,
-               spID                      as serviceProviderId,
+               info                                                                                                  as profile,
+               spID                                                                                                  as serviceProviderId,
                addTime,
                addTime,
                status,
                status,
                lastCheckOrderDate,
                lastCheckOrderDate,
-               newDeal                   as newDeal,
+               newDeal,
                (select userIdentity from user where userId = c.userId) as userIdentity,
                (select userIdentity from user where userId = c.userId) as userIdentity,
                 (select activeState from cm_organ_active_system where stage = 0 and delType = 1 and userId = c.userId) as activeState,
                 (select activeState from cm_organ_active_system where stage = 0 and delType = 1 and userId = c.userId) as activeState,
                 (select customerValue from cm_organ_value_system where stage = 0 and delType = 1 and userId = c.userId) as customerValue
                 (select customerValue from cm_organ_value_system where stage = 0 and delType = 1 and userId = c.userId) as customerValue
@@ -305,25 +313,25 @@
     </update>
     </update>
     <update id="updateRemarks">
     <update id="updateRemarks">
         update cm_club_remarks
         update cm_club_remarks
-        set remarks         = #{remarks},
-            questionMan     = #{questionMan},
-            consultType     = #{consult},
-            clubType        = #{clubType},
-            pinceSensitve   = #{pinceSensitve},
-            satisfied       = #{satisfied},
-            followup        = #{followup},
-            extra           = #{extra},
-            productID       = #{productID},
-            reportID        = #{reportID},
-            communicationSituation  = #{communicationSituation},
-            communicationMethods    = #{communicationMethods},
-            customerSource          = #{customerSource},
-            customerGender          = #{customerGender},
-            customerAge             = #{customerAge},
-            groupAddition           = #{groupAddition},
-            trendsKeyword   = #{trendsKeyword},
-            stateKeyword    = #{stateKeyword}
-            where id = #{remarksId}
+        set remarks                = #{remarks},
+            questionMan            = #{questionMan},
+            consultType            = #{consult},
+            clubType               = #{clubType},
+            pinceSensitve          = #{pinceSensitve},
+            satisfied              = #{satisfied},
+            followup               = #{followup},
+            extra                  = #{extra},
+            productID              = #{productID},
+            reportID               = #{reportID},
+            communicationSituation = #{communicationSituation},
+            communicationMethods   = #{communicationMethods},
+            customerSource         = #{customerSource},
+            customerGender         = #{customerGender},
+            customerAge            = #{customerAge},
+            groupAddition          = #{groupAddition},
+            trendsKeyword          = #{trendsKeyword},
+            stateKeyword           = #{stateKeyword}
+        where id = #{remarksId}
     </update>
     </update>
     <update id="updateQuestionMan">
     <update id="updateQuestionMan">
         update cm_visitor_remarks
         update cm_visitor_remarks
@@ -333,8 +341,8 @@
     </update>
     </update>
     <update id="updateVisitorRemark">
     <update id="updateVisitorRemark">
         update cm_visitor_remarks
         update cm_visitor_remarks
-        set remarks      = #{remarks},
-            consultType  = #{consult},
+        set remarks                = #{remarks},
+            consultType            = #{consult},
             clubType=#{clubType},
             clubType=#{clubType},
             pinceSensitve=#{pinceSensitve},
             pinceSensitve=#{pinceSensitve},
             satisfied=#{satisfied},
             satisfied=#{satisfied},
@@ -342,14 +350,14 @@
             extra=#{extra},
             extra=#{extra},
             reportID=#{reportId},
             reportID=#{reportId},
             productID=#{productId},
             productID=#{productId},
-            communicationSituation  = #{communicationSituation},
-            communicationMethods    = #{communicationMethods},
-            customerSource          = #{customerSource},
-            customerGender          = #{customerGender},
-            customerAge             = #{customerAge},
-            groupAddition           = #{groupAddition},
-            trendsKeyword   = #{trendsKeyword},
-            stateKeyword    = #{stateKeyword}
+            communicationSituation = #{communicationSituation},
+            communicationMethods   = #{communicationMethods},
+            customerSource         = #{customerSource},
+            customerGender         = #{customerGender},
+            customerAge            = #{customerAge},
+            groupAddition          = #{groupAddition},
+            trendsKeyword          = #{trendsKeyword},
+            stateKeyword           = #{stateKeyword}
         where id = #{remarksId}
         where id = #{remarksId}
     </update>
     </update>
     <update id="updateVisit">
     <update id="updateVisit">
@@ -503,13 +511,23 @@
     </select>
     </select>
 
 
     <select id="getRemarksInfo" resultType="com.caimei365.user.model.po.ClubRemarksPo">
     <select id="getRemarksInfo" resultType="com.caimei365.user.model.po.ClubRemarksPo">
-        select ccr.communicationSituation, ccr.communicationMethods, ccr.customerSource,
-               ccr.customerGender, ccr.groupAddition, ccr.customerAge,
-               (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = c.clubId ORDER BY ADDTIME ASC LIMIT 1) AS firstTime,
-               (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = c.clubId ORDER BY ADDTIME DESC LIMIT 1) AS recentlyTime
+        select ccr.communicationSituation,
+               ccr.communicationMethods,
+               ccr.customerSource,
+               ccr.customerGender,
+               ccr.groupAddition,
+               ccr.customerAge,
+               (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = c.clubId ORDER BY ADDTIME ASC LIMIT 1)  AS firstTime,
+               (SELECT ADDTIME
+                FROM cm_club_remarks
+                WHERE clubId = c.clubId
+                ORDER BY ADDTIME DESC
+                LIMIT 1)                                                                                   AS recentlyTime
         from cm_club_remarks ccr
         from cm_club_remarks ccr
-        left join club c on ccr.clubId = c.clubId
-        where c.userId = #{userId} order by ccr.addTime desc limit 1
+                 left join club c on ccr.clubId = c.clubId
+        where c.userId = #{userId}
+        order by ccr.addTime desc
+        limit 1
     </select>
     </select>
 
 
     <select id="getPriorKeywordList" resultType="java.util.Map">
     <select id="getPriorKeywordList" resultType="java.util.Map">
@@ -675,13 +693,16 @@
     <select id="getRemarksListByKey" resultType="com.caimei365.user.model.vo.RemarksVo">
     <select id="getRemarksListByKey" resultType="com.caimei365.user.model.vo.RemarksVo">
 
 
         SELECT DISTINCT
         SELECT DISTINCT
-        ccr.id AS remarksId, ccr.remarks,ccr.addTime,ccr.questionMan,ccr.serviceProviderId as serviceProviderId, ccr.createServiceProviderId as createServiceProviderId,
+        ccr.id AS remarksId, ccr.remarks,ccr.addTime,ccr.questionMan,ccr.serviceProviderId as serviceProviderId,
+        ccr.createServiceProviderId as createServiceProviderId,
         csr.leaderId AS leaderId,IFNULL(ccr.consultType,'') as consult, c.Name as clubName,
         csr.leaderId AS leaderId,IFNULL(ccr.consultType,'') as consult, c.Name as clubName,
-        ccr.clubType AS clubType,ccr.pinceSensitve AS pinceSensitve,ccr.satisfied AS satisfied,ccr.followup AS followup,ccr.extra AS extra,
+        ccr.clubType AS clubType,ccr.pinceSensitve AS pinceSensitve,ccr.satisfied AS satisfied,ccr.followup AS
+        followup,ccr.extra AS extra,
         ccr.communicationSituation, ccr.communicationMethods, ccr.customerSource, ccr.customerGender,
         ccr.communicationSituation, ccr.communicationMethods, ccr.customerSource, ccr.customerGender,
         ccr.groupAddition, ccr.customerAge, ccr.trendsKeyword, ccr.stateKeyword,
         ccr.groupAddition, ccr.customerAge, ccr.trendsKeyword, ccr.stateKeyword,
         (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID= csr.leaderId) AS leaderName,
         (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID= csr.leaderId) AS leaderName,
-        (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.createServiceProviderId) as recordName,c.newDeal as newDeal,cmc.status as status
+        (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.createServiceProviderId) as
+        recordName,c.newDeal as newDeal,cmc.status as status
         # (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.oldserviceProviderId) AS oldName
         # (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.oldserviceProviderId) AS oldName
         FROM cm_club_remarks ccr
         FROM cm_club_remarks ccr
         LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
         LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
@@ -690,7 +711,7 @@
         LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
         LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
         LEFT JOIN cm_club_report cmc ON cmc.ID = ccr.reportID
         LEFT JOIN cm_club_report cmc ON cmc.ID = ccr.reportID
         where
         where
-              (ccr.serviceProviderId=#{serviceProviderId} or ccr.createServiceProviderId=#{serviceProviderId})
+        (ccr.serviceProviderId=#{serviceProviderId} or ccr.createServiceProviderId=#{serviceProviderId})
 
 
         <if test="keyWord != null and keyWord != ''">
         <if test="keyWord != null and keyWord != ''">
             AND (ccr.remarks LIKE CONCAT('%', #{keyWord}, '%')
             AND (ccr.remarks LIKE CONCAT('%', #{keyWord}, '%')
@@ -738,7 +759,8 @@
         SELECT DISTINCT
         SELECT DISTINCT
         ccr.id as remarksId, ccr.questionManId, ccr.remarks, ccr.addTime as addDate,
         ccr.id as remarksId, ccr.questionManId, ccr.remarks, ccr.addTime as addDate,
         ccr.questionMan,IFNULL(ccr.consultType,'') as consult, ccr.createServiceProviderId as createServiceProviderId,
         ccr.questionMan,IFNULL(ccr.consultType,'') as consult, ccr.createServiceProviderId as createServiceProviderId,
-        ccr.serviceProviderId,ccr.clubType,ccr.pinceSensitve,ccr.satisfied,ccr.followup,ccr.extra,ccr.trendsKeyword, ccr.stateKeyword,
+        ccr.serviceProviderId,ccr.clubType,ccr.pinceSensitve,ccr.satisfied,ccr.followup,ccr.extra,ccr.trendsKeyword,
+        ccr.stateKeyword,
         (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.serviceProviderId) AS recordName,
         (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.serviceProviderId) AS recordName,
         (select name from serviceprovider s where s.serviceProviderID = csr.leaderId) as leaderName,cmc.status as status
         (select name from serviceprovider s where s.serviceProviderID = csr.leaderId) as leaderName,cmc.status as status
         FROM cm_visitor_remarks ccr
         FROM cm_visitor_remarks ccr
@@ -959,8 +981,8 @@
         SELECT keyword as label
         SELECT keyword as label
         FROM cm_user_search_frequency
         FROM cm_user_search_frequency
         WHERE keyword like concat('%', #{keyword}, '%')
         WHERE keyword like concat('%', #{keyword}, '%')
-        and dynamicStatus = #{type}
-        and delStatus = 1
+          and dynamicStatus = #{type}
+          and delStatus = 1
         order by addtime DESC
         order by addtime DESC
     </select>
     </select>
 
 
@@ -1086,10 +1108,26 @@
         WHERE csg.serviceId = #{spId}
         WHERE csg.serviceId = #{spId}
     </select>
     </select>
     <select id="selTotal" resultType="com.caimei365.user.model.dto.CmPortraitDto">
     <select id="selTotal" resultType="com.caimei365.user.model.dto.CmPortraitDto">
-        SELECT (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
-               (SELECT IFNULL(SUM(totalAmount), 0) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
-               (SELECT COUNT(cbr.recordID) FROM cm_behavior_record cbr LEFT JOIN club c ON cbr.userID = c.userID
-                WHERE cbr.pageType IN (8, 9) AND c.clubID = #{clubId} AND cbr.accessDate <![CDATA[ < ]]> now())                                                            AS totalkeywords,
+        SELECT (SELECT COUNT(shopOrderId)
+                FROM cm_shop_order
+                WHERE clubID = #{clubId}
+                  AND shopStatus != 4
+                  AND shopStatus != 5
+                  AND refundStatus != 2
+                  AND orderTime <![CDATA[ < ]]> NOW())                                                                 AS orderTotal,
+               (SELECT IFNULL(SUM(totalAmount), 0)
+                FROM cm_shop_order
+                WHERE clubID = #{clubId}
+                  AND shopStatus != 4
+                  AND shopStatus != 5
+                  AND refundStatus != 2
+                  AND orderTime <![CDATA[ < ]]> NOW())                                                                 AS orderTotalAmount,
+               (SELECT COUNT(cbr.recordID)
+                FROM cm_behavior_record cbr
+                         LEFT JOIN club c ON cbr.userID = c.userID
+                WHERE cbr.pageType IN (8, 9)
+                  AND c.clubID = #{clubId}
+                  AND cbr.accessDate <![CDATA[ < ]]> now())                                                            AS totalkeywords,
                (SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubId} AND addTime <![CDATA[ < ]]> now()) AS remarksTotal
                (SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubId} AND addTime <![CDATA[ < ]]> now()) AS remarksTotal
     </select>
     </select>
     <select id="accessRecords" resultType="com.caimei365.user.model.vo.RecordVo">
     <select id="accessRecords" resultType="com.caimei365.user.model.vo.RecordVo">
@@ -1102,22 +1140,21 @@
         ORDER BY cbr.accessDate DESC
         ORDER BY cbr.accessDate DESC
     </select>
     </select>
     <select id="recordDetail" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
     <select id="recordDetail" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
-        SELECT
-            b.recordID,
-            b.userID,
-            b.pagePath,
-            pt.pageType,
-            b.pageLabel,
-            b.productID,
-            b.accessTime,
-            b.accessDuration,
-            b.accessDate,
-            b.referer,
-            b.accessClient,
-            b.isReckon,
-            b.region,
-            p.name      AS productName,
-            p.mainImage AS productImage
+        SELECT b.recordID,
+               b.userID,
+               b.pagePath,
+               pt.pageType,
+               b.pageLabel,
+               b.productID,
+               b.accessTime,
+               b.accessDuration,
+               b.accessDate,
+               b.referer,
+               b.accessClient,
+               b.isReckon,
+               b.region,
+               p.name      AS productName,
+               p.mainImage AS productImage
         FROM cm_behavior_record b
         FROM cm_behavior_record b
                  LEFT JOIN club c ON b.userID = c.userID
                  LEFT JOIN club c ON b.userID = c.userID
                  LEFT JOIN product p ON b.productID = p.productID
                  LEFT JOIN product p ON b.productID = p.productID
@@ -1152,8 +1189,10 @@
 
 
     <select id="selOrderList" resultType="com.caimei365.user.model.po.NewOrderPo">
     <select id="selOrderList" resultType="com.caimei365.user.model.po.NewOrderPo">
         SELECT
         SELECT
-        (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
-        (SELECT IFNULL(SUM(totalAmount), 0) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
+        (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5
+        AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
+        (SELECT IFNULL(SUM(totalAmount), 0) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND
+        shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
         cso.clubID,
         cso.clubID,
         co.secondHandOrderFlag,
         co.secondHandOrderFlag,
         co.rebateFlag,
         co.rebateFlag,
@@ -1165,7 +1204,8 @@
         LEFT JOIN cm_order co ON cso.orderId = co.orderId
         LEFT JOIN cm_order co ON cso.orderId = co.orderId
         left join cm_order_product cop on cop.shopOrderId = cso.shopOrderId
         left join cm_order_product cop on cop.shopOrderId = cso.shopOrderId
         <where>
         <where>
-            cso.clubID = #{clubId} AND cso.shopStatus != 4 AND cso.shopStatus != 5 AND cso.refundStatus != 2 AND cop.productId != 999
+            cso.clubID = #{clubId} AND cso.shopStatus != 4 AND cso.shopStatus != 5 AND cso.refundStatus != 2 AND
+            cop.productId != 999
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                 AND cso.orderTime <![CDATA[ >= ]]> #{startTime} AND cso.orderTime <![CDATA[ <= ]]> #{endTime}
                 AND cso.orderTime <![CDATA[ >= ]]> #{startTime} AND cso.orderTime <![CDATA[ <= ]]> #{endTime}
             </if>
             </if>
@@ -1189,14 +1229,14 @@
     </select>
     </select>
     <select id="selRegion" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
     <select id="selRegion" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
         SELECT IP as ip,
         SELECT IP as ip,
-               accessSource,
-               accessTime,
-               pageType
+        accessSource,
+        accessTime,
+        pageType
         FROM cm_behavior_record_ref
         FROM cm_behavior_record_ref
         <where>
         <where>
             <if test="type == 0">
             <if test="type == 0">
-               IP = #{ip}
-               AND accessTime like concat('%', #{accessDate}, '%')
+                IP = #{ip}
+                AND accessTime like concat('%', #{accessDate}, '%')
             </if>
             </if>
             <if test="type == 1">
             <if test="type == 1">
                 <if test="accessDateList.size()>0">
                 <if test="accessDateList.size()>0">
@@ -1249,30 +1289,35 @@
                         bindMobile           as quickPayMobile,
                         bindMobile           as quickPayMobile,
                         bankUserName         as quickPayUserName,
                         bankUserName         as quickPayUserName,
                         idCard,
                         idCard,
-                        cqi.bankCvvCode as cvvCode,
-                        cqi.bankExpireTime as quickPayBankExpireTime
+                        cqi.bankCvvCode      as cvvCode,
+                        cqi.bankExpireTime   as quickPayBankExpireTime
         FROM cm_quickpay_info cqi
         FROM cm_quickpay_info cqi
                  LEFT JOIN cm_quickpay_bankcode cqb ON cqi.quickPayBankCode = cqb.bankCode
                  LEFT JOIN cm_quickpay_bankcode cqb ON cqi.quickPayBankCode = cqb.bankCode
         where cqi.userId = #{userId}
         where cqi.userId = #{userId}
           and cqi.delFlag = 0
           and cqi.delFlag = 0
     </select>
     </select>
     <select id="selSpLinkMan" resultType="java.lang.String">
     <select id="selSpLinkMan" resultType="java.lang.String">
-        SELECT linkMan FROM serviceprovider WHERE serviceProviderID = #{choseServiceId}
+        SELECT linkMan
+        FROM serviceprovider
+        WHERE serviceProviderID = #{choseServiceId}
     </select>
     </select>
     <select id="getSpIdRAND" resultType="java.lang.Integer">
     <select id="getSpIdRAND" resultType="java.lang.Integer">
-        SELECT sp.serviceProviderID FROM serviceprovider sp
+        SELECT sp.serviceProviderID
+        FROM serviceprovider sp
         WHERE sp.organizeID = 0
         WHERE sp.organizeID = 0
-          and sp.status=90
-          and sp.serviceProviderID NOT IN ( 1342 , 1353 , 1369)
+          and sp.status = 90
+          and sp.insiderFlag = 0
+          and sp.serviceProviderID != 1342
           and linkMan not LIKE '%测试%'
           and linkMan not LIKE '%测试%'
         ORDER BY RAND()
         ORDER BY RAND()
         LIMIT 0,1;
         LIMIT 0,1;
     </select>
     </select>
     <select id="getSpUserId" resultType="java.lang.Integer">
     <select id="getSpUserId" resultType="java.lang.Integer">
-        SELECT sp.userId FROM serviceprovider sp
+        SELECT sp.userId
+        FROM serviceprovider sp
         WHERE sp.organizeID = 0
         WHERE sp.organizeID = 0
-          and sp.status=90
-          and sp.serviceProviderID=#{spId}
+          and sp.status = 90
+          and sp.serviceProviderID = #{spId}
         LIMIT 0,1;
         LIMIT 0,1;
     </select>
     </select>
     <insert id="inProvider">
     <insert id="inProvider">

+ 49 - 52
src/main/resources/mapper/HeHeMapper.xml

@@ -5,83 +5,80 @@
 <mapper namespace="com.caimei365.user.mapper.HeHeMapper">
 <mapper namespace="com.caimei365.user.mapper.HeHeMapper">
 
 
     <select id="findHeHeUserByOpenId" resultType="com.caimei365.user.model.vo.HeHeUserVo">
     <select id="findHeHeUserByOpenId" resultType="com.caimei365.user.model.vo.HeHeUserVo">
-        SELECT
-          userId,
-          NAME,
-          mobile,
-          userIdentity,
-          nickName,
-          headImgUrl,
-          openId
-        FROM
-          cm_hehe_user
-        WHERE
-          openId = #{openId}
+        SELECT userId,
+               NAME,
+               mobile,
+               userIdentity,
+               nickName,
+               headImgUrl,
+               openId
+        FROM cm_hehe_user
+        WHERE openId = #{openId}
     </select>
     </select>
 
 
     <select id="findHeHeUserByMobile" resultType="com.caimei365.user.model.vo.HeHeUserVo">
     <select id="findHeHeUserByMobile" resultType="com.caimei365.user.model.vo.HeHeUserVo">
-        SELECT
-          userId,
-          NAME,
-          mobile,
-          userIdentity,
-          nickName,
-          headImgUrl,
-          openId
-        FROM
-          cm_hehe_user
-        WHERE
-          mobile = #{mobile}
+        SELECT userId,
+               NAME,
+               mobile,
+               userIdentity,
+               nickName,
+               headImgUrl,
+               openId
+        FROM cm_hehe_user
+        WHERE mobile = #{mobile}
     </select>
     </select>
     <select id="getCurrentCouponIds" resultType="java.lang.Integer">
     <select id="getCurrentCouponIds" resultType="java.lang.Integer">
         select id
         select id
         from cm_hehe_coupon
         from cm_hehe_coupon
-        where couponType = #{couponType} and if(startNowFlag = 1,true, NOW() <![CDATA[  >=  ]]> startTime )
-          and if(permanentFlag = 1,true,NOW() <![CDATA[  <=  ]]> endTime) and delFlag = 0
+        where couponType = #{couponType}
+          and if(startNowFlag = 1, true, NOW() <![CDATA[  >=  ]]> startTime)
+          and if(permanentFlag = 1, true, NOW() <![CDATA[  <=  ]]> endTime)
+          and delFlag = 0
     </select>
     </select>
     <select id="getCouponAmount" resultType="java.lang.Double">
     <select id="getCouponAmount" resultType="java.lang.Double">
-        select couponAmount from cm_hehe_coupon where id = #{couponId}
+        select couponAmount
+        from cm_hehe_coupon
+        where id = #{couponId}
     </select>
     </select>
     <select id="findUserMobile" resultType="java.lang.String">
     <select id="findUserMobile" resultType="java.lang.String">
-        select mobile from cm_hehe_user where userId = #{shareUserId}
+        select mobile
+        from cm_hehe_user
+        where userId = #{shareUserId}
     </select>
     </select>
     <select id="getGroupQrCode" resultType="java.lang.String">
     <select id="getGroupQrCode" resultType="java.lang.String">
-        select image from cm_hehe_related_images where id = 1;
+        select image
+        from cm_hehe_related_images
+        where id = 1;
     </select>
     </select>
 
 
     <update id="updateHeHeUser">
     <update id="updateHeHeUser">
         UPDATE
         UPDATE
-          `cm_hehe_user`
-        SET
-          `nickName` = #{nickName},
-          `headImgUrl` = #{headImgUrl},
-          `openId` = #{openId}
-        WHERE
-          `userId` = #{userId}
+            `cm_hehe_user`
+        SET `nickName`   = #{nickName},
+            `headImgUrl` = #{headImgUrl},
+            `openId`     = #{openId}
+        WHERE `userId` = #{userId}
     </update>
     </update>
 
 
     <insert id="insertHeHeUser">
     <insert id="insertHeHeUser">
         insert into cm_hehe_user (userId, `name`, mobile,
         insert into cm_hehe_user (userId, `name`, mobile,
-          userIdentity, nickName, headImgUrl,
-          openId, addTime)
+                                  userIdentity, nickName, headImgUrl,
+                                  openId, addTime)
         values (#{userId}, #{name}, #{mobile},
         values (#{userId}, #{name}, #{mobile},
-          #{userIdentity}, #{nickName}, #{headImgUrl},
-          #{openId}, #{addTime})
+                #{userIdentity}, #{nickName}, #{headImgUrl},
+                #{openId}, #{addTime})
     </insert>
     </insert>
 
 
-    <insert id="insertUser" parameterType="com.caimei365.user.model.po.UserPo" keyColumn="userID" keyProperty="userId" useGeneratedKeys="true">
-        INSERT INTO USER (
-		  bindMobile, userPermission, userIdentity,
-		  userName, password, name, registerTime,
-		  validFlag, registerUserTypeID
-		)
-		VALUES
-		  (
-			#{bindMobile}, #{userPermission}, #{userIdentity},
-			#{userName}, #{password}, #{name}, #{registerTime},
-			#{validFlag}, #{registerUserTypeId}
-		  )
+    <insert id="insertUser" parameterType="com.caimei365.user.model.po.UserPo" keyColumn="userID" keyProperty="userId"
+            useGeneratedKeys="true">
+        INSERT INTO USER (bindMobile, userIdentity,
+                          userName, password, name, registerTime,
+                          validFlag, registerUserTypeID)
+        VALUES (#{bindMobile}, #{userIdentity},
+                #{userName}, #{password}, #{name}, #{registerTime},
+                #{validFlag}, #{registerUserTypeId})
     </insert>
     </insert>
+
     <insert id="insertCouponShare">
     <insert id="insertCouponShare">
         insert into cm_hehe_coupon_share (shareUserId, receiveUserId, shareCouponId, type, createTime)
         insert into cm_hehe_coupon_share (shareUserId, receiveUserId, shareCouponId, type, createTime)
         values (#{shareUserId}, #{receiveUserId}, #{shareCouponId}, 1, NOW())
         values (#{shareUserId}, #{receiveUserId}, #{shareCouponId}, 1, NOW())

+ 16 - 27
src/main/resources/mapper/LoginMapper.xml

@@ -11,11 +11,10 @@
                u.mobile             as mobile,
                u.mobile             as mobile,
                u.bindMobile         as bindMobile,
                u.bindMobile         as bindMobile,
                u.email              as email,
                u.email              as email,
-               u.userPermission     as userPermission,
                u.userIdentity       as userIdentity,
                u.userIdentity       as userIdentity,
                u.password           as password,
                u.password           as password,
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
-               u.clubStatus         as clubStatus,
+               (select status from club where userId = u.userId limit 1)          as clubStatus,
                u.manufacturerStatus as shopStatus
                u.manufacturerStatus as shopStatus
         from user u
         from user u
         where u.userID = #{userId}
         where u.userID = #{userId}
@@ -32,11 +31,10 @@
                u.mobile             as mobile,
                u.mobile             as mobile,
                u.bindMobile         as bindMobile,
                u.bindMobile         as bindMobile,
                u.email              as email,
                u.email              as email,
-               u.userPermission     as userPermission,
                u.userIdentity       as userIdentity,
                u.userIdentity       as userIdentity,
                u.password           as password,
                u.password           as password,
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
-               u.clubStatus         as clubStatus,
+               (select status from club where userId = u.userId limit 1)  as clubStatus,
                u.manufacturerStatus as shopStatus,
                u.manufacturerStatus as shopStatus,
                cu.id                as operationId,
                cu.id                as operationId,
                cu.status            as operationStatus,
                cu.status            as operationStatus,
@@ -58,11 +56,10 @@
                u.mobile             AS mobile,
                u.mobile             AS mobile,
                u.bindMobile         AS bindMobile,
                u.bindMobile         AS bindMobile,
                u.email              AS email,
                u.email              AS email,
-               u.userPermission     AS userPermission,
                u.userIdentity       AS userIdentity,
                u.userIdentity       AS userIdentity,
                u.password           AS PASSWORD,
                u.password           AS PASSWORD,
                u.guideFlag          AS guideFlag,
                u.guideFlag          AS guideFlag,
-               u.clubStatus         AS clubStatus,
+               (select status from club where userId = u.userId limit 1) AS clubStatus,
                u.manufacturerStatus AS shopStatus,
                u.manufacturerStatus AS shopStatus,
                cu.id                AS operationId,
                cu.id                AS operationId,
                cu.status            AS operationStatus,
                cu.status            AS operationStatus,
@@ -85,15 +82,14 @@
                u.serviceProviderId  as serviceProviderId,
                u.serviceProviderId  as serviceProviderId,
                u.userName           as userName,
                u.userName           as userName,
                u.name               as name,
                u.name               as name,
-               ( SELECT linkMan FROM club WHERE userId = u.userID) as clubLinkMan,
+               (SELECT linkMan FROM club WHERE userId = u.userID) as clubLinkMan,
                u.mobile             as mobile,
                u.mobile             as mobile,
                u.bindMobile         as bindMobile,
                u.bindMobile         as bindMobile,
                u.email              as email,
                u.email              as email,
-               u.userPermission     as userPermission,
                u.userIdentity       as userIdentity,
                u.userIdentity       as userIdentity,
                u.password           as password,
                u.password           as password,
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
-               u.clubStatus         as clubStatus,
+               (select status from club where userId = u.userId limit 1) as clubStatus,
                u.manufacturerStatus as shopStatus,
                u.manufacturerStatus as shopStatus,
                u.serviceProviderStatus as serviceStatus,
                u.serviceProviderStatus as serviceStatus,
                cu.id                as operationId,
                cu.id                as operationId,
@@ -116,11 +112,10 @@
                u.mobile             AS mobile,
                u.mobile             AS mobile,
                u.bindMobile         AS bindMobile,
                u.bindMobile         AS bindMobile,
                u.email              AS email,
                u.email              AS email,
-               u.userPermission     AS userPermission,
                u.userIdentity       AS userIdentity,
                u.userIdentity       AS userIdentity,
                u.password           AS PASSWORD,
                u.password           AS PASSWORD,
                u.guideFlag          AS guideFlag,
                u.guideFlag          AS guideFlag,
-               u.clubStatus         AS clubStatus,
+               (select status from club where userId = u.userId limit 1) AS clubStatus,
                u.manufacturerStatus AS shopStatus,
                u.manufacturerStatus AS shopStatus,
                u.serviceProviderStatus as serviceStatus,
                u.serviceProviderStatus as serviceStatus,
                cu.id                AS operationId,
                cu.id                AS operationId,
@@ -152,14 +147,12 @@
                u.mobile             as mobile,
                u.mobile             as mobile,
                u.bindMobile         as bindMobile,
                u.bindMobile         as bindMobile,
                u.email              as email,
                u.email              as email,
-               u.userPermission     as userPermission,
                u.userIdentity       as userIdentity,
                u.userIdentity       as userIdentity,
                u.password           as password,
                u.password           as password,
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
-               u.clubStatus         as clubStatus,
                u.manufacturerStatus as shopStatus,
                u.manufacturerStatus as shopStatus,
                cu.id                as operationId,
                cu.id                as operationId,
-               cu.status            as operationStatus,
+               (select status from club where userId = u.userId limit 1) as clubStatus,
                cu.mobile            as operationMobile
                cu.mobile            as operationMobile
         from user u
         from user u
                  left join cm_mall_operation_user cu on cu.userID = u.userID
                  left join cm_mall_operation_user cu on cu.userID = u.userID
@@ -176,10 +169,10 @@
                u.mobile            as mobile,
                u.mobile            as mobile,
                u.bindMobile        as bindMobile,
                u.bindMobile        as bindMobile,
                u.email             as email,
                u.email             as email,
-               u.userPermission    as userPermission,
                u.userIdentity      as userIdentity,
                u.userIdentity      as userIdentity,
                u.guideFlag         as guideFlag,
                u.guideFlag         as guideFlag,
-               u.password          as password
+               u.password          as password,
+               s.insiderFlag       as insideFlag
         from serviceprovider s
         from serviceprovider s
                  left join user u on s.userID = u.userID
                  left join user u on s.userID = u.userID
         where s.openid = #{openId}
         where s.openid = #{openId}
@@ -210,11 +203,10 @@
         u.mobile as mobile,
         u.mobile as mobile,
         u.bindMobile as bindMobile,
         u.bindMobile as bindMobile,
         u.email as email,
         u.email as email,
-        u.userPermission as userPermission,
         u.userIdentity as userIdentity,
         u.userIdentity as userIdentity,
         u.password as password,
         u.password as password,
         u.guideFlag as guideFlag,
         u.guideFlag as guideFlag,
-        u.clubStatus as clubStatus,
+        (select status from club where userId = u.userId limit 1) as clubStatus,
         u.manufacturerStatus as shopStatus,
         u.manufacturerStatus as shopStatus,
         o.unionId as unionId,
         o.unionId as unionId,
         o.status as operationStatus,
         o.status as operationStatus,
@@ -240,12 +232,11 @@
         u.mobile as mobile,
         u.mobile as mobile,
         u.bindMobile as bindMobile,
         u.bindMobile as bindMobile,
         u.email as email,
         u.email as email,
-        u.userPermission as userPermission,
         u.userIdentity as userIdentity,
         u.userIdentity as userIdentity,
         u.serviceProviderID as serviceProviderId,
         u.serviceProviderID as serviceProviderId,
         u.password as password,
         u.password as password,
         u.guideFlag as guideFlag,
         u.guideFlag as guideFlag,
-        u.clubStatus as clubStatus,
+        c.status as clubStatus,
         u.manufacturerStatus as shopStatus,
         u.manufacturerStatus as shopStatus,
         u.serviceProviderStatus as serviceStatus,
         u.serviceProviderStatus as serviceStatus,
         o.unionId as unionId,
         o.unionId as unionId,
@@ -274,11 +265,10 @@
         u.mobile as mobile,
         u.mobile as mobile,
         u.bindMobile as bindMobile,
         u.bindMobile as bindMobile,
         u.email as email,
         u.email as email,
-        u.userPermission as userPermission,
         u.userIdentity as userIdentity,
         u.userIdentity as userIdentity,
         u.password as password,
         u.password as password,
         u.guideFlag as guideFlag,
         u.guideFlag as guideFlag,
-        u.clubStatus as clubStatus,
+        (select status from club where userId = u.userId limit 1) as clubStatus,
         u.manufacturerStatus as shopStatus,
         u.manufacturerStatus as shopStatus,
         o.unionId as unionId,
         o.unionId as unionId,
         o.status as operationStatus,
         o.status as operationStatus,
@@ -314,12 +304,11 @@
         u.mobile as mobile,
         u.mobile as mobile,
         u.bindMobile as bindMobile,
         u.bindMobile as bindMobile,
         u.email as email,
         u.email as email,
-        u.userPermission as userPermission,
         u.userIdentity as userIdentity,
         u.userIdentity as userIdentity,
         u.serviceProviderID as serviceProviderId,
         u.serviceProviderID as serviceProviderId,
         u.password as password,
         u.password as password,
         u.guideFlag as guideFlag,
         u.guideFlag as guideFlag,
-        u.clubStatus as clubStatus,
+        c.status as clubStatus,
         u.manufacturerStatus as shopStatus,
         u.manufacturerStatus as shopStatus,
         o.unionId as unionId,
         o.unionId as unionId,
         o.status as operationStatus,
         o.status as operationStatus,
@@ -391,7 +380,7 @@
                ifnull(cou.userOrganizeID, 0) as organizeId,
                ifnull(cou.userOrganizeID, 0) as organizeId,
                u.userIdentity,
                u.userIdentity,
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
-               u.clubStatus         as clubStatus,
+               (select status from club where userId = u.userId limit 1) as clubStatus,
                u.manufacturerStatus as shopStatus,
                u.manufacturerStatus as shopStatus,
                cou.invitationCodeTime,
                cou.invitationCodeTime,
                cou.mobile           as operationMobile,
                cou.mobile           as operationMobile,
@@ -413,7 +402,7 @@
                ifnull(cou.userOrganizeID, 0) as organizeId,
                ifnull(cou.userOrganizeID, 0) as organizeId,
                u.userIdentity,
                u.userIdentity,
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
-               u.clubStatus         as clubStatus,
+               (select status from club where userId = u.userId limit 1) as clubStatus,
                u.manufacturerStatus as shopStatus,
                u.manufacturerStatus as shopStatus,
                cou.invitationCodeTime,
                cou.invitationCodeTime,
                cou.mobile           as operationMobile,
                cou.mobile           as operationMobile,
@@ -434,7 +423,7 @@
                u.name               as name,
                u.name               as name,
                u.userIdentity,
                u.userIdentity,
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
-               u.clubStatus         as clubStatus,
+               (select status from club where userId = u.userId limit 1) as clubStatus,
                u.manufacturerStatus as shopStatus,
                u.manufacturerStatus as shopStatus,
                cou.invitationCodeTime,
                cou.invitationCodeTime,
                cou.mobile           as operationMobile,
                cou.mobile           as operationMobile,

+ 27 - 12
src/main/resources/mapper/MessageCenter.xml

@@ -65,7 +65,7 @@
             <if test="userType == 2">
             <if test="userType == 2">
                 and  shopID=#{commonId}
                 and  shopID=#{commonId}
             </if>
             </if>
-            <if test="userType == 3">
+            <if test="userType == 3 or userType == 4">
                 and  thisId=#{commonId}
                 and  thisId=#{commonId}
             </if>
             </if>
             AND messageType=#{messageType}
             AND messageType=#{messageType}
@@ -83,7 +83,7 @@
             <if test="userType == 2">
             <if test="userType == 2">
                 and  shopID=#{commonId}
                 and  shopID=#{commonId}
             </if>
             </if>
-            <if test="userType == 3">
+            <if test="userType == 3 or userType == 4">
                 and  thisId=#{commonId}
                 and  thisId=#{commonId}
             </if>
             </if>
             and userType=#{userType}
             and userType=#{userType}
@@ -116,7 +116,7 @@
             <if test="userType == 2">
             <if test="userType == 2">
                 and shopID=#{commonId}
                 and shopID=#{commonId}
             </if>
             </if>
-            <if test="userType == 3">
+            <if test="userType == 3 or userType == 4 ">
                 and thisId=#{commonId}
                 and thisId=#{commonId}
             </if>
             </if>
             and userType=#{userType}
             and userType=#{userType}
@@ -171,6 +171,9 @@
             <if test="userType == 3">
             <if test="userType == 3">
                 and sp.serviceProviderID=#{commonId}
                 and sp.serviceProviderID=#{commonId}
             </if>
             </if>
+            <if test=" userType == 4">
+                and co.userID=#{commonId}
+            </if>
             and co.orderID=#{orderID}
             and co.orderID=#{orderID}
         </where>
         </where>
         LIMIT 1
         LIMIT 1
@@ -234,7 +237,7 @@
             <if test="userType == 2">
             <if test="userType == 2">
                 and shopID=#{commonId}
                 and shopID=#{commonId}
             </if>
             </if>
-            <if test="userType == 3">
+            <if test="userType == 3 or userType == 4">
                 and thisId=#{commonId}
                 and thisId=#{commonId}
             </if>
             </if>
             <if test="messageType !=null">
             <if test="messageType !=null">
@@ -267,22 +270,34 @@
     </select>
     </select>
 
 
     <select id="shopName" resultType="java.lang.String">
     <select id="shopName" resultType="java.lang.String">
-        SELECT name FROM `shop` WHERE shopID=#{shopID}
+        SELECT name
+        FROM `shop`
+        WHERE shopID = #{shopID}
     </select>
     </select>
     <select id="getMessageCenterListDay" resultType="java.lang.Integer">
     <select id="getMessageCenterListDay" resultType="java.lang.Integer">
-        select distinct  d.shopID as shopID from  cm_receipt as r
-        LEFT JOIN  cm_discern_receipt as d on r.receiptID=d.id
-        LEFT JOIN  shop as s on d.shopID=s.shopID
-        WHERE receStatct=0 and DATEDIFF(r.dateStrings,NOW())=#{day}
+        select distinct d.shopID as shopID
+        from cm_receipt as r
+                 LEFT JOIN cm_discern_receipt as d on r.receiptID = d.id
+                 LEFT JOIN shop as s on d.shopID = s.shopID
+        WHERE receStatct = 0
+          and DATEDIFF(r.dateStrings, NOW()) = #{day}
+    </select>
+    <select id="getMessageTypeValues" resultType="map">
+        <if test="type != null and type == 5 ">
+            select guidanceImage as image from info where id=#{id}
+        </if>
+        <if test="type != null and type == 6 ">
+            select image,appLink,link as pcLink from cm_page_image where id=#{id}
+        </if>
     </select>
     </select>
 
 
     <update id="updateMessageCenter" parameterType="com.caimei365.user.model.vo.MessageCenter">
     <update id="updateMessageCenter" parameterType="com.caimei365.user.model.vo.MessageCenter">
 
 
         update message_center
         update message_center
         <set>
         <set>
-<!--            <if test="id != null and id != 0">id = #{id},</if>-->
-<!--            <if test="shopID != null and shopID != ''">shopID = #{shopID},</if>-->
-<!--            <if test="clubID != null and clubID != ''">clubID = #{clubID},</if>-->
+            <!--            <if test="id != null and id != 0">id = #{id},</if>-->
+            <!--            <if test="shopID != null and shopID != ''">shopID = #{shopID},</if>-->
+            <!--            <if test="clubID != null and clubID != ''">clubID = #{clubID},</if>-->
             <if test="orderId != null and orderId != '' ">orderID = #{orderId},</if>
             <if test="orderId != null and orderId != '' ">orderID = #{orderId},</if>
             <if test="userType != null and userType != ''">userType = #{userType},</if>
             <if test="userType != null and userType != ''">userType = #{userType},</if>
             <if test="messageType != null and messageType != ''">messageType = #{messageType},</if>
             <if test="messageType != null and messageType != ''">messageType = #{messageType},</if>

+ 5 - 7
src/main/resources/mapper/RegisterMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.user.mapper.RegisterMapper">
 <mapper namespace="com.caimei365.user.mapper.RegisterMapper">
     <insert id="insertClubUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
     <insert id="insertClubUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
-        insert into user(`userOrganizeID`,`registerTime`,`registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `userPermission`,`guideFlag`,`clubStatus`, `password`, `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`, userBeans)
-                  values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{guideFlag},#{clubStatus},#{password},#{agreeFlag},#{validFlag},#{serviceProviderId},#{serviceProviderStatus}, #{userBeans})
+        insert into user(`userOrganizeID`,`registerTime`,`registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`,`guideFlag`, `password`, `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`, userBeans)
+                  values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{guideFlag},#{password},#{agreeFlag},#{validFlag},#{serviceProviderId},#{serviceProviderStatus}, #{userBeans})
     </insert>
     </insert>
     <select id="selUser" resultType="com.caimei365.user.model.po.UserPo">
     <select id="selUser" resultType="com.caimei365.user.model.po.UserPo">
         select * from user where registerTime = #{registerTime}
         select * from user where registerTime = #{registerTime}
@@ -34,8 +34,8 @@
                                     values(#{userId},#{clubId},#{shopId},#{organizeId},#{linkName},#{nickName},#{avatarUrl},#{userType},#{mobile} ,#{status},#{unionId},#{openId},#{pcOpenId},#{addTime},#{updateTime},#{bindTime},#{delFlag})
                                     values(#{userId},#{clubId},#{shopId},#{organizeId},#{linkName},#{nickName},#{avatarUrl},#{userType},#{mobile} ,#{status},#{unionId},#{openId},#{pcOpenId},#{addTime},#{updateTime},#{bindTime},#{delFlag})
     </insert>
     </insert>
     <insert id="insertShopUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
     <insert id="insertShopUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
-        insert into user(`userOrganizeID`,`registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `userPermission`, `manufacturerStatus` , `password`, `agreeFlag`, `validFlag`)
-        values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
+        insert into user(`userOrganizeID`,`registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `manufacturerStatus` , `password`, `agreeFlag`, `validFlag`)
+        values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
     </insert>
     </insert>
     <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
     <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
         insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`, `wxApplets`, `addTime`, `validFlag`, `status`,medicalPracticeLicenseImg1)
         insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`, `wxApplets`, `addTime`, `validFlag`, `status`,medicalPracticeLicenseImg1)
@@ -50,8 +50,7 @@
     <update id="updateClubUserByUpgrade">
     <update id="updateClubUserByUpgrade">
         update user set registerIP = #{registerIp},
         update user set registerIP = #{registerIp},
                         email = #{email},
                         email = #{email},
-                        name = #{name},
-                        clubStatus = #{clubStatus}
+                        name = #{name}
         where userID = #{userId}
         where userID = #{userId}
     </update>
     </update>
     <update id="updateShopUserByApply">
     <update id="updateShopUserByApply">
@@ -201,7 +200,6 @@
           user
           user
         SET
         SET
           bindMobile = #{bindMobile},
           bindMobile = #{bindMobile},
-          userPermission = #{userPermission},
           userIdentity = #{userIdentity},
           userIdentity = #{userIdentity},
           email = #{email},
           email = #{email},
           userName = #{userName},
           userName = #{userName},

+ 0 - 2
src/main/resources/mapper/SellerMapper.xml

@@ -11,7 +11,6 @@
                u.bindMobile     as bindMobile,
                u.bindMobile     as bindMobile,
                u.email          as email,
                u.email          as email,
                u.guideFlag      as guideFlag,
                u.guideFlag      as guideFlag,
-               u.userPermission as userPermission,
                u.userIdentity   as userIdentity,
                u.userIdentity   as userIdentity,
                u.serviceProviderID as serviceProviderId,
                u.serviceProviderID as serviceProviderId,
                u.serviceProviderStatus as serviceStatus,
                u.serviceProviderStatus as serviceStatus,
@@ -19,7 +18,6 @@
         from user u
         from user u
         where u.mobile = #{mobile}
         where u.mobile = #{mobile}
           and u.userIdentity = 1
           and u.userIdentity = 1
-          and u.userPermission = 4
           and u.validFlag = 1
           and u.validFlag = 1
     </select>
     </select>
     <update id="updateServiceProviderByUserId">
     <update id="updateServiceProviderByUserId">

+ 0 - 7
src/main/resources/mapper/SuperVipMapper.xml

@@ -26,13 +26,6 @@
         values (#{userBeans}, 2, 0, now(), 14, #{userId}, 0)
         values (#{userBeans}, 2, 0, now(), 14, #{userId}, 0)
     </insert>
     </insert>
 
 
-    <update id="updateUserPermission">
-        update user
-        set userPermission=#{userPermission}
-        where userId = #{userId}
-    </update>
-
-
     <update id="updateUserIdentity">
     <update id="updateUserIdentity">
         update user
         update user
         set userIdentity=#{userIdentity}
         set userIdentity=#{userIdentity}