Quellcode durchsuchen

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

# Conflicts:
#	src/main/resources/mapper/SellerMapper.xml
huangzhiguo vor 1 Jahr
Ursprung
Commit
aec7fc5d6f

+ 10 - 7
src/main/java/com/caimei365/user/controller/BaseApi.java

@@ -1,6 +1,5 @@
 package com.caimei365.user.controller;
 
-import com.alibaba.fastjson.JSONObject;
 import com.aliyuncs.exceptions.ClientException;
 import com.caimei365.user.components.WeChatService;
 import com.caimei365.user.idempotent.IpSave;
@@ -9,19 +8,17 @@ import com.caimei365.user.model.dto.MobileDto;
 import com.caimei365.user.model.dto.PasswordDto;
 import com.caimei365.user.model.po.CmUser;
 import com.caimei365.user.model.po.SysDict;
-import com.caimei365.user.model.vo.SysDictVO;
 import com.caimei365.user.service.BaseService;
 import com.caimei365.user.service.SysDictService;
-import com.caimei365.user.utils.RequestUtil;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -288,4 +285,10 @@ public class BaseApi {
     public Integer getByUserCount(CmUser user) {
         return baseService.getByUserCount(user);
     }
+
+    @ApiOperation("获取userId身份")
+    @GetMapping("/getUserType")
+    public int getUserType(String userId) {
+        return baseService.getUserType(userId);
+    }
 }

+ 5 - 4
src/main/java/com/caimei365/user/controller/CmBehaviorRecordApi.java

@@ -2,9 +2,10 @@ package com.caimei365.user.controller;
 
 import com.caimei365.user.idempotent.IpSave;
 import com.caimei365.user.model.ResponseJson;
-import com.caimei365.user.model.dto.BehaviorRecordDto;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
@@ -35,7 +36,7 @@ public class CmBehaviorRecordApi {
      */
     @IpSave(saveName = "用户行为记录", saveParams = true)
     @GetMapping("/Statistics")
-    public ResponseJson<String> behaviorRecordApp(HttpServletRequest request, Integer userId, String pagePath, String pageType, String pageLabel, String behaviorType, Integer productId, String accessDuration, Integer accessClient, Integer shopId, String openId) {
+    public ResponseJson<String> behaviorRecordApp(HttpServletRequest request, Integer userId, String pagePath, String pageType, String pageLabel, String behaviorType, Integer productId, String accessDuration, Integer accessClient, Integer shopId, String headUserId, String productArchiveId, String openId) {
         HttpSession session = request.getSession();
         Cookie[] cookies = request.getCookies();
         if (null != cookies) {
@@ -46,7 +47,7 @@ public class CmBehaviorRecordApi {
             }
         }
         String touristId = (String) session.getAttribute("touristId");
-        log.info("用户行为记录=======userId==》" + userId + "==pagePath==" + pagePath + "==pageType==" + pageType + "==pageLabel==" + pageLabel + "==behaviorType==" + behaviorType + "==productId==" + productId + "==accessDuration==" + accessDuration + "==accessClient==" + accessClient + "==shopId==" + shopId + "==openId=="+openId);
+        log.info("用户行为记录=======userId==》" + userId + "==pagePath==" + pagePath + "==pageType==" + pageType + "==pageLabel==" + pageLabel + "==behaviorType==" + behaviorType + "==productId==" + productId + "==accessDuration==" + accessDuration + "==accessClient==" + accessClient + "==shopId==" + shopId + "==headUserId=="+headUserId+ "==productArchiveId=="+productArchiveId+ "==openId=="+openId);
         return ResponseJson.success("用户行为记录完成");
     }
 

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

@@ -141,7 +141,8 @@ public class LoginApi {
         String mobile = loginPasswordDto.getMobileOrEmail();
         String password = loginPasswordDto.getPassword();
         String unionId = loginPasswordDto.getUnionId();
-        return sellerService.passwordLogin(mobile, password, unionId);
+        Integer isUnion = loginPasswordDto.getIsUnion();
+        return sellerService.passwordLogin(mobile, password, unionId, isUnion);
     }
 
 
@@ -299,9 +300,10 @@ public class LoginApi {
     public ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId,
                                                                Integer messageType,
                                                                Integer source,
+                                                               Integer type,
                                                                @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                                                @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
-        return loginService.SpMessageList(commonId, messageType, source, pageNum, pageSize);
+        return loginService.SpMessageList(commonId, messageType, source,type, pageNum, pageSize);
     }
 
     @ApiOperation("机构站内消息列表")

+ 6 - 8
src/main/java/com/caimei365/user/controller/SellerApi.java

@@ -6,7 +6,6 @@ import com.caimei365.user.model.dto.OnlineDto;
 import com.caimei365.user.model.po.ServiceProviderPo;
 import com.caimei365.user.model.vo.*;
 import com.caimei365.user.service.SellerService;
-import com.caimei365.user.utils.MathUtil;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -16,9 +15,6 @@ import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -241,20 +237,22 @@ public class SellerApi {
                 .setQrCode(serviceProviderPo.getQrCode()));
 
     }
+
     /**
      * 机构访问列表
      */
     @GetMapping("/getBehaviorRecordClub")
-    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer spId, String accDateTime) {
-        return sellerService.getBehaviorRecordClub( spId, accDateTime);
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer type, Integer spId, String accDateTime) {
+        return sellerService.getBehaviorRecordClub(type, spId, accDateTime);
 
     }
+
     /**
      * 机构访问详情
      */
     @GetMapping("/getBehaviorRecordClubFrom")
-    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer spId,Integer clubId,String accessTime) {
-        return sellerService.getBehaviorRecordClubFrom(spId,clubId, accessTime);
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer type, Integer spId, Integer clubId, String accessTime) {
+        return sellerService.getBehaviorRecordClubFrom(type, spId, clubId, accessTime);
     }
 
     /**

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

@@ -214,6 +214,8 @@ public interface BaseMapper {
      */
     public int updateClubStatus(Integer userId,Integer status);
 
+    public int getUserType(String userId);
+
     /**
      * 用户信息
      *

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

@@ -50,7 +50,7 @@ public interface MessageCenterMapper {
      */
     Integer listingfeeExpire(Integer shopID);
 
-    List<MessageCenter> MessageList(Integer userType,Integer messageType,Integer commonId);
+    List<MessageCenter> MessageList(Integer userType,Integer messageType,Integer commonId,Integer type);
 
     String contractMobile(Integer clubID);
 

+ 4 - 0
src/main/java/com/caimei365/user/mapper/SellerMapper.java

@@ -147,11 +147,15 @@ public interface SellerMapper {
     List<ServiceProviderVo> findAllServices(@Param("spId")Integer spId,@Param("status")Integer status);
 
     String getBehaviorRecordYesterdayPageLabel(@Param("spId") Integer spId,@Param("clubId") Integer clubId,@Param("accessTime")String accessTime);
+    String getBehaviorRecordMinutePageLabel(@Param("spId") Integer spId,@Param("clubId") Integer clubId,@Param("accessTime")String accessTime);
 
     List<CmBehaviorRecordVo> getBehaviorRecordYesterdayClubFrom(@Param("spId") Integer spId, @Param("clubId") Integer clubId, @Param("accessTime")String accessTime);
+    List<CmBehaviorRecordVo> getBehaviorRecordMinuteClubFrom(@Param("spId") Integer spId, @Param("clubId") Integer clubId, @Param("accessTime")String accessTime);
 
     List<CmBehaviorRecordVo> getBehaviorRecordYesterdayClub(@Param("spId") Integer spId,@Param("accessTime")String accessTime);
 
+    List<CmBehaviorRecordVo> getBehaviorRecordMinuteClub(@Param("spId") Integer spId,@Param("accessTime")String accessTime);
+
     /**
      * 获取机构有访问记录的日期
      * @param clubId

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

@@ -35,6 +35,10 @@ public class LoginPasswordDto implements Serializable {
      */
     @ApiModelProperty("微信unionId")
     private String unionId;
+    /**
+     * 是否需要unionId
+     */
+    private Integer isUnion;
     /**
      * 游客id
      */

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

@@ -5,7 +5,6 @@ import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.MobileDto;
 import com.caimei365.user.model.dto.PasswordDto;
 import com.caimei365.user.model.po.CmUser;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -144,5 +143,6 @@ public interface BaseService {
 
     CmUser getByUser(CmUser user);
 
+    int getUserType(String userId);
     CmUser findUserByMobile(String mobile, Integer oldUserId, Integer userIdentity);
 }

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

@@ -86,7 +86,7 @@ public interface LoginService {
      */
     ResponseJson<UserLoginVo> appletsOrganizeAuthorization(String code, String encryptedData, String iv, HttpHeaders headers) throws ParseException;
 
-    ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
+    ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId,Integer messageType,Integer source,Integer type, int pageNum, int pageSize);
     ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
 
     /**

+ 3 - 3
src/main/java/com/caimei365/user/service/SellerService.java

@@ -76,7 +76,7 @@ public interface SellerService {
      * @param unionId  微信unionId
      * @return UserLoginVo
      */
-    ResponseJson<UserLoginVo> passwordLogin(String mobile, String password, String unionId);
+    ResponseJson<UserLoginVo> passwordLogin(String mobile, String password, String unionId,Integer isUnion);
 
     /**
      * 采购员验证码登录 --组织
@@ -134,8 +134,8 @@ public interface SellerService {
 
     ResponseJson setSellerHome(ServiceProviderPo serviceProviderPo);
 
-    ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer spId,String accessTime);
-    ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer spId, Integer clubId, String accessTime);
+    ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer type,Integer spId,String accessTime);
+    ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer type,Integer spId, Integer clubId, String accessTime);
 
     ResponseJson<List<ServiceProviderVo>> getServiceTeam(Integer spId,Integer status);
 

+ 7 - 3
src/main/java/com/caimei365/user/service/impl/BaseServiceImpl.java

@@ -1,6 +1,5 @@
 package com.caimei365.user.service.impl;
 
-import com.aliyun.oss.internal.OSSUtils;
 import com.aliyuncs.exceptions.ClientException;
 import com.caimei365.user.components.CommonService;
 import com.caimei365.user.components.RedisService;
@@ -25,14 +24,15 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -842,4 +842,8 @@ public class BaseServiceImpl implements BaseService {
     public CmUser findUserByMobile(String mobile, Integer oldUserId, Integer userIdentity) {
         return baseMapper.findUserByMobile(mobile, oldUserId, userIdentity);
     }
+    @Override
+    public int getUserType(String userId) {
+        return baseMapper.getUserType(userId);
+    }
 }

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

@@ -651,9 +651,9 @@ public class LoginServiceImpl implements LoginService {
         return messageCenterMapper.updateMessageAsRead(userType, messageType, commonId);
     }
     @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,Integer type, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
-        List<MessageCenter> list = messageCenterMapper.MessageList(3, messageType, commonId);
+        List<MessageCenter> list = messageCenterMapper.MessageList(3, messageType, commonId,type);
         list.forEach(mess -> {
             if (null != mess.getClubId()) {
                 MessageCenter messageCenter = messageCenterMapper.MainImage(3, commonId, mess.getOrderId());
@@ -682,7 +682,7 @@ public class LoginServiceImpl implements LoginService {
     @Override
     public ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
-        List<MessageCenter> list = messageCenterMapper.MessageList(1, messageType, commonId);
+        List<MessageCenter> list = messageCenterMapper.MessageList(1, messageType, commonId,null);
         list.forEach(mess -> {
             if (null != mess.getClubId()) {
                 MessageCenter messageCenter = messageCenterMapper.MainImage(1, commonId, mess.getOrderId());
@@ -745,7 +745,7 @@ public class LoginServiceImpl implements LoginService {
     @Override
     public ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
-        List<MessageCenter> list = messageCenterMapper.MessageList(2, messageType, commonId);
+        List<MessageCenter> list = messageCenterMapper.MessageList(2, messageType, commonId,null);
         list.forEach(mess -> {
             String shopName = messageCenterMapper.shopName(commonId);
             MessageCenter messageCenter = messageCenterMapper.productImage(mess.getProductId(), commonId);
@@ -1692,7 +1692,7 @@ public class LoginServiceImpl implements LoginService {
      * 初始化站内信
      */
     private List<MessageCenter> setMessageList(Integer userType,Integer messageType,Integer commonId) {
-        List<MessageCenter> list = messageCenterMapper.MessageList(userType, messageType, commonId);
+        List<MessageCenter> list = messageCenterMapper.MessageList(userType, messageType, commonId,null);
         list.forEach(mess -> {
             if (null != mess.getOrderId()) {
                 MessageCenter messageCenter = messageCenterMapper.MainImage(userType, commonId, mess.getOrderId());

+ 31 - 33
src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java

@@ -4,7 +4,6 @@ import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.WeChatService;
 import com.caimei365.user.mapper.*;
 import com.caimei365.user.model.ResponseJson;
-import com.caimei365.user.model.dto.ArrDateDto;
 import com.caimei365.user.model.dto.ClubTemporaryDto;
 import com.caimei365.user.model.dto.LoginCodeDto;
 import com.caimei365.user.model.po.CmBehaviorInfoPo;
@@ -18,7 +17,6 @@ import com.caimei365.user.utils.MathUtil;
 import com.caimei365.user.utils.Md5Util;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import io.swagger.models.auth.In;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
@@ -26,12 +24,8 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -347,26 +341,32 @@ public class SellerServiceImpl implements SellerService {
      * @return UserLoginVo
      */
     @Override
-    public ResponseJson<UserLoginVo> passwordLogin(String mobile, String password, String unionId) {
+    public ResponseJson<UserLoginVo> passwordLogin(String mobile, String password, String unionId, Integer isUnion) {
         if (StringUtils.isBlank(mobile) || StringUtils.isBlank(password)) {
             return ResponseJson.error("请输入账号密码", null);
         }
-        if (StringUtils.isBlank(unionId)) {
+        if (StringUtils.isBlank(unionId) && isUnion == null) {
             return ResponseJson.error("请输入微信unionId", null);
         }
         UserLoginVo seller = sellerMapper.getLoginSellerByMobile(mobile);
+
         if (null == seller || !Md5Util.md5(password).equals(seller.getPassword())) {
-            return ResponseJson.error("密码和账户名不匹配", null);
+            return ResponseJson.error("账号密码不正确", null);
+        }
+        if (null == seller || 90!=seller.getServiceStatus()) {
+            return ResponseJson.error("登录账号已下线,请联系客服", null);
         }
         // 生成token
         String token = JwtUtil.createToken(seller.getUserId());
         // 为了过期续签,将token存入redis,并设置超时时间
         redisService.set(token, token, JwtUtil.getExpireTime());
         seller.setToken(token);
-        Map<Object, Object> infoData = redisService.getEntries("wxInfo:applets:" + unionId);
-        String openId = (String) infoData.get(WeChatService.Keys.OPEN_ID);
-        sellerMapper.updateServiceProviderByUserId(seller.getUserId(), openId, unionId);
-        log.info("协销账号密码登录openid>>>>" + openId + " ,unionId>>>>>" + unionId);
+        if (isUnion == null) {
+            Map<Object, Object> infoData = redisService.getEntries("wxInfo:applets:" + unionId);
+            String openId = (String) infoData.get(WeChatService.Keys.OPEN_ID);
+            sellerMapper.updateServiceProviderByUserId(seller.getUserId(), openId, unionId);
+            log.info("协销账号密码登录openid>>>>" + openId + " ,unionId>>>>>" + unionId);
+        }
         seller.setManager(sellerMapper.findManager(mobile));
         return ResponseJson.success(seller);
     }
@@ -407,6 +407,9 @@ public class SellerServiceImpl implements SellerService {
                     redisService.remove("code:" + mobile);
                     // 根据手机号获取协销
                     UserLoginVo seller = sellerMapper.getLoginSellerByMobile(mobile);
+                    if (null == seller || 90!=seller.getServiceStatus()) {
+                        return ResponseJson.error("登录账号已下线,请联系客服", null);
+                    }
                     // 生成token
                     String token = JwtUtil.createToken(seller.getUserId());
                     // 为了过期续签,将token存入redis,并设置超时时间
@@ -529,34 +532,29 @@ public class SellerServiceImpl implements SellerService {
     }
 
     @Override
-    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer spId, String accessTime) {
-        // 设置日期格式
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        LocalDate date = LocalDate.parse(accessTime, formatter);
-        // 获取前一天的日期
-        LocalDate dayBeforeYesterday = date.minusDays(1);
-        // 格式化日期
-        accessTime = dayBeforeYesterday.format(formatter);
-        List<CmBehaviorRecordVo> behaviorRecordYesterdayClub = sellerMapper.getBehaviorRecordYesterdayClub(spId, accessTime);
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer type, Integer spId, String accessTime) {
+        List<CmBehaviorRecordVo> behaviorRecordYesterdayClub = null == type  //null 机构访问通知, 1内容库访问通知
+                ? sellerMapper.getBehaviorRecordYesterdayClub(spId, accessTime)
+                : sellerMapper.getBehaviorRecordMinuteClub(spId, accessTime);
         for (CmBehaviorRecordVo cmBehaviorRecordVo : behaviorRecordYesterdayClub) {
-            String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
+            String pageLabel = null == type
+                    ? sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime)
+                    : sellerMapper.getBehaviorRecordMinutePageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
             cmBehaviorRecordVo.setPageLabel(pageLabel);
         }
         return ResponseJson.success(behaviorRecordYesterdayClub);
     }
 
     @Override
-    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer spId, Integer clubId, String accessTime) {
-//        // 设置日期格式
-//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-//        LocalDate date = LocalDate.parse(accessTime, formatter);
-//        // 获取前一天的日期
-//        LocalDate dayBeforeYesterday = date.minusDays(1);
-//        // 格式化日期
-//        accessTime= dayBeforeYesterday.format(formatter);
-        List<CmBehaviorRecordVo> behaviorRecordYesterdayClubFrom = sellerMapper.getBehaviorRecordYesterdayClubFrom(spId, clubId, accessTime);
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer type, Integer spId, Integer clubId, String accessTime) {
+
+        List<CmBehaviorRecordVo> behaviorRecordYesterdayClubFrom = null == type  //null 机构访问通知, 1内容库访问通知
+                ? sellerMapper.getBehaviorRecordYesterdayClubFrom(spId, clubId, accessTime)
+                : sellerMapper.getBehaviorRecordMinuteClubFrom(spId, clubId, accessTime);
         for (CmBehaviorRecordVo cmBehaviorRecordVo : behaviorRecordYesterdayClubFrom) {
-            String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
+            String pageLabel = null == type
+                    ? sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime)
+                    : sellerMapper.getBehaviorRecordMinutePageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
             cmBehaviorRecordVo.setPageLabel(pageLabel);
             cmBehaviorRecordVo.setAccessDuration(calculationTime(cmBehaviorRecordVo.getAccessDuration()));
             if (cmBehaviorRecordVo.getProductID() != 0 && cmBehaviorRecordVo.getPageType().equals("6")) {

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

@@ -23,7 +23,7 @@ public class BeanUtil {
     }
 
     public static <T, S> List<T> setValues(List<S> sourceList, Class<T> target) {
-        if (CollectionUtils.isEmpty(sourceList)&&sourceList.size()>0) {
+        if (CollectionUtils.isEmpty(sourceList)) {
             return new ArrayList<>();
         }
         List<T> targetList = new ArrayList<>(sourceList.size());

+ 12 - 6
src/main/resources/mapper/BaseMapper.xml

@@ -652,17 +652,23 @@
             <if test="appKey != null  and appKey != ''"> and user.appKey = #{appKey}</if>
             <if test="appSecret != null  and appSecret != ''"> and user.appSecret = #{appSecret}</if>
             <if test="scanFlag != null "> and user.scanFlag = #{scanFlag}</if>
-            <if test="userBeans != null "> and user.userBeans = #{userBeans}</if>
-            <if test="guideFlag != null "> and user.guideFlag = #{guideFlag}</if>
-            <if test="loginFailTime != null "> and user.loginFailTime = #{loginFailTime}</if>
-            <if test="tipStatus != null  and tipStatus != ''"> and user.tipStatus = #{tipStatus}</if>
-            <if test="onlineMoney != null "> and user.onlineMoney = #{onlineMoney}</if>
+            <if test="userBeans != null ">and user.userBeans = #{userBeans}</if>
+            <if test="guideFlag != null ">and user.guideFlag = #{guideFlag}</if>
+            <if test="loginFailTime != null ">and user.loginFailTime = #{loginFailTime}</if>
+            <if test="tipStatus != null  and tipStatus != ''">and user.tipStatus = #{tipStatus}</if>
+            <if test="onlineMoney != null ">and user.onlineMoney = #{onlineMoney}</if>
         </where>
         group by user.userID
         order by user.loginTime desc
         limit 0,1
     </select>
-    <select id="findUserByMobile"  resultMap="UserResult">
+    <select id="getUserType" resultType="int">
+        select user.userIdentity
+        FROM user user
+        WHERE user.userId = #{userId}
+    </select>
+
+    <select id="findUserByMobile" resultMap="UserResult">
         <include refid="selectUserVo"/>
         FROM user user
         WHERE user.bindMobile=#{mobile}

+ 8 - 0
src/main/resources/mapper/MessageCenter.xml

@@ -109,6 +109,14 @@
         <where>
             <if test="messageType !=null">
                 AND messageType=#{messageType}
+                <if test="messageType == 3 ">
+                    <if test="type ==1 ">
+                        and shopTieredType in(9,10)
+                    </if>
+                    <if test="type ==null ">
+                        and shopTieredType not in(9,10)
+                    </if>
+                </if>
             </if>
             <if test="userType == 1">
                 and clubID=#{commonId}

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

@@ -99,7 +99,7 @@
             LEFT JOIN cm_shop_info csi ON csi.shopProductId = cspd.id
          </if>
         <if test="keyword != null and keyword != ''">
-            LEFT JOIN cm_shop_keyword csk ON csk.shopId = cspd.id
+            LEFT JOIN cm_shop_keyword csk ON csk.shopProductId = cspd.id
             left join cm_user_search_frequency cusf on cusf.id = csk.searchId
         </if>
         <where>

+ 118 - 65
src/main/resources/mapper/SellerMapper.xml

@@ -505,10 +505,80 @@
             AND c.clubId =#{clubId}
         </if>
         and b.pageType in(6,8,11)
-        and DATE(b.accessTime) = DATE(#{accessTime})
+        and  DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
+        GROUP BY b.pageLabel LIMIT 10) as a
+    </select>
+    <select id="getBehaviorRecordMinutePageLabel" resultType="string">
+        SELECT GROUP_CONCAT(a.pageLabel)
+        FROM (SELECT b.pageLabel
+        FROM cm_behavior_record b
+        LEFT JOIN club c ON b.userID = c.userID
+        LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
+        WHERE  sp.status=90 and sp.serviceProviderID=#{spId}
+        and b.pageType in (69,70,71)
+        and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and  #{accessTime}
+        <if test="clubId != null">
+            AND c.clubId =#{clubId}
+        </if>
         GROUP BY b.pageLabel LIMIT 10) as a
     </select>
     <select id="getBehaviorRecordYesterdayClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
+        SELECT
+            b.recordID,
+            b.userID,
+            b.pagePath,
+            b.pageType,
+            b.pageLabel,
+            b.productID,
+            b.accessTime,
+            b.accessDuration,
+            b.accessDate,
+            b.referer,
+            b.accessClient,
+            b.isReckon,
+            b.region,
+            c.name,c.linkMan,c.contractMobile,c.clubId,u.image
+        FROM cm_behavior_record b
+        LEFT JOIN club c ON b.userID = c.userID
+        LEFT JOIN user u ON u.userID = c.userID
+        WHERE b.userId !=0
+        and c.spId=#{spId}
+        and c.clubId=#{clubId}
+        and b.pageType in(6,11)
+        and  DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
+    </select>
+    <select id="getBehaviorRecordMinuteClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
+        SELECT
+            b.recordID,
+            b.userID,
+            b.pagePath,
+            b.pageType,
+            b.pageLabel,
+            b.productID,
+            b.accessTime,
+            b.accessDuration,
+            b.accessDate,
+            b.referer,
+            b.accessClient,
+            b.isReckon,
+            b.region,
+            (select cpaf.fileName from cm_product_archive_content cpac
+            left join cm_product_archive_file cpaf on cpaf.archiveContentId=cpac.id
+            where cpac.id=b.productArchiveId limit 1)as title,
+            ifnull(c.name,b.IP),
+            c.linkMan,c.contractMobile,c.clubId,u.image
+        FROM cm_behavior_record b
+        LEFT JOIN club c ON b.userID = c.userID
+        LEFT JOIN user u ON u.userID = c.userID
+        LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
+        WHERE  sp.status=90 and sp.serviceProviderID=#{spId}
+          and b.pageType in (69,70,71)
+          and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and  #{accessTime}
+        <if test="clubId != null">
+            AND c.clubId =#{clubId}
+        </if>
+    </select>
+    <select id="getBehaviorRecordYesterdayClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
         SELECT b.recordID,
                b.userID,
                b.pagePath,
@@ -522,21 +592,17 @@
                b.accessClient,
                b.isReckon,
                b.region,
-               c.name,
-               c.linkMan,
-               c.contractMobile,
-               c.clubId,
-               u.image
+               c.name,c.linkMan,c.contractMobile,c.clubId,u.image
         FROM cm_behavior_record b
                  LEFT JOIN club c ON b.userID = c.userID
                  LEFT JOIN user u ON u.userID = c.userID
-        WHERE b.userId != 0
-          and c.spId = #{spId}
-          and c.clubId = #{clubId}
-          and b.pageType in (6, 11)
-          and DATE(b.accessTime) = DATE(#{accessTime})
+        WHERE b.userId !=0
+        and c.spId=#{spId}
+          and b.pageType in(6,8,11)
+          and  DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
+        GROUP BY c.clubId
     </select>
-    <select id="getBehaviorRecordYesterdayClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
+    <select id="getBehaviorRecordMinuteClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
         SELECT b.recordID,
                b.userID,
                b.pagePath,
@@ -550,28 +616,23 @@
                b.accessClient,
                b.isReckon,
                b.region,
-               c.name,
-               c.linkMan,
-               c.contractMobile,
-               c.clubId,
-               u.image
+               ifnull(c.name,b.region)
+               ,c.linkMan,c.contractMobile,c.clubId,u.image
         FROM cm_behavior_record b
                  LEFT JOIN club c ON b.userID = c.userID
                  LEFT JOIN user u ON u.userID = c.userID
-        WHERE b.userId != 0
-          and c.spId = #{spId}
-          and b.pageType in (6, 8, 11)
-          and DATE(b.accessTime) = DATE(#{accessTime})
-        GROUP BY c.clubId
+                 LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
+        WHERE  sp.status=90 and sp.serviceProviderID=#{spId}
+          and b.pageType in (69,70,71)
+          and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and  #{accessTime}
+        GROUP BY b.region
     </select>
 
     <select id="getClubAccessDate" resultType="com.caimei365.user.model.vo.RetuenDataVo">
         select cbr.accessDate
         from cm_behavior_record cbr
-                 LEFT JOIN club c ON cbr.userID = c.userID
-        where c.clubID = #{clubId}
-        group by cbr.accessDate
-        order by cbr.accessDate desc
+        LEFT JOIN club c ON cbr.userID = c.userID
+        where c.clubID = #{clubId} group by cbr.accessDate order by cbr.accessDate desc
     </select>
     <select id="getClubKeynoteRecord" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
         SELECT
@@ -588,68 +649,60 @@
         b.accessClient,
         b.isReckon,
         b.region,
-        p.name AS productName,
+        p.name      AS productName,
         p.mainImage AS productImage
         FROM cm_behavior_record b
         LEFT JOIN club c ON b.userID = c.userID
         LEFT JOIN product p ON b.productID = p.productID
         LEFT JOIN cm_page_type pt ON b.pageType = pt.id
         WHERE c.clubID = #{clubId}
-        and b.pageType IN (6,11)
-        <if test="accessDateList.size()>0">
-            and
-            <foreach collection="accessDateList" item="accessDate" open="(" separator="or" close=")">
-                b.accessTime like concat('%', #{accessDate}, '%')
-            </foreach>
-        </if>
+            and b.pageType IN (6,11)
+            <if test="accessDateList.size()>0">
+                and
+                <foreach collection="accessDateList" item="accessDate" open="(" separator="or" close=")">
+                    b.accessTime like concat('%', #{accessDate}, '%')
+                </foreach>
+            </if>
         order by b.accessTime desc
     </select>
 
     <select id="getUnActiveClub" resultType="com.caimei365.user.model.vo.ClubVo">
-        SELECT c.clubID                    as clubId,
-               c.userID                    as userId,
+        SELECT c.clubID as clubId,
+               c.userID as userId,
                c.name,
-               c.sname                     as shortName,
+               c.sname as shortName,
                c.contractMobile,
-               c.contractEmail             as contractEmail,
+               c.contractEmail as contractEmail,
                c.contractPhone,
                c.linkMan,
-               c.provinceID                as proviceId,
-               c.cityID                    as cityId,
-               c.townID                    as townId,
+               c.provinceID as proviceId,
+               c.cityID as cityId,
+               c.townID as townId,
                c.address,
-               c.headpic                   as shopPhoto,
-               c.businessLicenseImage      as businessLicense,
+               c.headpic as shopPhoto,
+               c.businessLicenseImage as businessLicense,
                c.socialCreditCode,
                c.firstClubType,
                c.secondClubType,
                c.department,
                c.medicalPracticeLicenseImg as medicalPracticeLicense,
-               c.mainpro                   as mainProduct,
+               c.mainpro as mainProduct,
                c.fax,
-               c.info                      as profile,
-               c.spID                      as serviceProviderId,
-               c.addTime,
-               c.status,
+               c.info as profile,
+               c.spID as serviceProviderId,
+               c.addTime, c.status,
                c.lastCheckOrderDate,
                u.userIdentity,
-               c.newDeal                   as newDeal,
-               IF(r.id IS NOT NULL, 1, 0)  AS recordCount,
-               sp.name                     AS serviceName,
-               coas.activeState            AS activeState,
-               covs.customerValue          AS customerValue
-        from club c
-                 left join user u on c.userID = u.userID
-                 LEFT JOIN record_link r ON r.`clubId` = c.`clubID`
-                 LEFT JOIN (SELECT userId, activeState, activeStatus
-                            FROM cm_organ_active_system
-                            WHERE stage = 0
-                              AND delType = 1) AS coas ON coas.userId = c.userId
-                 LEFT JOIN (SELECT userId, customerValue
-                            FROM cm_organ_value_system
-                            WHERE stage = 0
-                              AND delType = 1) AS covs ON covs.userId = c.userId
-                 LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
+               c.newDeal as newDeal,IF(r.id IS NOT NULL,1,0) AS recordCount,
+               sp.name AS serviceName,
+               coas.activeState AS activeState,
+               covs.customerValue AS customerValue
+            from club c
+            left join user u on c.userID = u.userID
+            LEFT JOIN record_link r ON r.`clubId`=c.`clubID`
+            LEFT JOIN (SELECT userId, activeState, activeStatus FROM cm_organ_active_system WHERE stage = 0 AND delType = 1) AS coas ON coas.userId = c.userId
+            LEFT JOIN (SELECT userId, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) AS covs ON covs.userId = c.userId
+            LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
         WHERE coas.activeStatus = 1
           AND sp.serviceProviderID = #{serviceProviderId}
         GROUP BY covs.userID