Explorar o código

CRM系统升级优化

kaick hai 1 ano
pai
achega
74ac3b11a6
Modificáronse 23 ficheiros con 1022 adicións e 184 borrados
  1. 6 53
      src/main/java/com/caimei365/user/components/WeChatService.java
  2. 3 7
      src/main/java/com/caimei365/user/controller/BaseApi.java
  3. 23 1
      src/main/java/com/caimei365/user/controller/LoginApi.java
  4. 16 0
      src/main/java/com/caimei365/user/controller/SellerApi.java
  5. 13 0
      src/main/java/com/caimei365/user/feign/ToolsFeign.java
  6. 7 4
      src/main/java/com/caimei365/user/mapper/SellerMapper.java
  7. 12 0
      src/main/java/com/caimei365/user/model/po/ServiceProviderPo.java
  8. 96 0
      src/main/java/com/caimei365/user/model/vo/CmBehaviorRecordVo.java
  9. 17 1
      src/main/java/com/caimei365/user/model/vo/MessageCenter.java
  10. 3 0
      src/main/java/com/caimei365/user/service/LoginService.java
  11. 5 4
      src/main/java/com/caimei365/user/service/SellerService.java
  12. 47 0
      src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java
  13. 35 4
      src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java
  14. 54 9
      src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java
  15. 0 60
      src/main/java/com/caimei365/user/utils/FastDfsUtil.java
  16. 61 4
      src/main/java/com/caimei365/user/utils/RequestUtil.java
  17. 377 0
      src/main/java/com/caimei365/user/utils/message/InsideMessage.java
  18. 43 0
      src/main/java/com/caimei365/user/utils/message/MessageModel.java
  19. 41 0
      src/main/java/com/caimei365/user/utils/message/MessageType.java
  20. 65 0
      src/main/java/com/caimei365/user/utils/message/MqInfo.java
  21. 1 1
      src/main/resources/mapper/ArticleMapper.xml
  22. 33 18
      src/main/resources/mapper/MessageCenter.xml
  23. 64 18
      src/main/resources/mapper/SellerMapper.xml

+ 6 - 53
src/main/java/com/caimei365/user/components/WeChatService.java

@@ -4,10 +4,9 @@ import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.caimei365.user.feign.ToolsFeign;
 import com.caimei365.user.model.ResponseJson;
-import com.caimei365.user.utils.FastDfsUtil;
 import com.caimei365.user.utils.RequestUtil;
-import com.sun.org.apache.regexp.internal.RE;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang.StringUtils;
@@ -15,6 +14,7 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.crypto.Cipher;
@@ -64,9 +64,10 @@ public class WeChatService {
     private String mcareAppSecret;
     @Value("${spring.cloud.config.profile}")
     private String active;
+    @Value("${caimei.imageDomain}")
+    private String imageDomain;
     @Resource
-    private FastDfsUtil fastDfsUtil;
-
+    private ToolsFeign toolsFeign;
 
     public void setRedirectUri(String redirectUri) {
         redirectUri = redirectUri;
@@ -296,6 +297,7 @@ public class WeChatService {
         link = link.replace("APPID", crmAppId);
         link = link.replace("APPSECRET", crmAppSecret);
         String result = RequestUtil.sendGet(link);
+        log.info("微信公众号获取access_token>>>" + link);
         log.info("微信公众号获取access_token>>>" + result);
         Map<String, Object> map = JSONObject.parseObject(result, Map.class);
         return (String) map.get("access_token");
@@ -646,53 +648,4 @@ public class WeChatService {
         return ResponseJson.success(result);
     }
 
-    /**
-     * 根据accessToken生成小程序二维码
-     */
-    public ResponseJson<String> generateWxacode(String access_token,String params) throws Exception {
-        String requestUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + access_token;
-        ByteArrayInputStream inputStream = RequestUtil.sendPost(requestUrl, params);
-        try {
-            String fileUrl = null;
-            String url = saveFile(inputStream);
-            fileUrl = "https://img-b.caimei365.com" + "/" + url;
-            log.info("【图片上传】>>>>>>>>>>>>>>>>上传成功:" + fileUrl);
-            return ResponseJson.success(fileUrl);
-        } catch (IOException e) {
-            log.error("【图片上传】>>>>>>>>>>>>>>>>上传失败:" + e);
-            return ResponseJson.error("图片上传失败", null);
-        }
-    }
-
-
-    /**
-     * 保存文件到FastDFS
-     */
-    private String saveFile(ByteArrayInputStream inputStream) throws IOException {
-        String randomStr = UUID.randomUUID().toString();
-        String name = ".jpeg";
-        // 图片暂存本地服务器路径
-        String filePath = "/mnt/newdatadrive/data/runtime/jar-instance/mall2c/tempImage/";
-        if ("dev".equals(active)){
-            filePath = "D:\\";
-        }
-        filePath += randomStr + name;
-        FileOutputStream outputStream = new FileOutputStream(filePath);
-        int i = 0;
-        byte[] buffer = new byte[200];
-        while ((i = inputStream.read(buffer)) != -1) {
-            outputStream.write(buffer, 0, i);
-        }
-        outputStream.flush();
-        outputStream.close();
-        inputStream.close();
-        // 临时图片
-        File tempFile = new File(filePath);
-        log.info("【图片上传】>>>>>>>>>>>>>>>>图片临时路径:" + filePath);
-        String fileUrl = fastDfsUtil.uploadFile(filePath);
-        // 删除临时图片
-        boolean delete = tempFile.delete();
-        log.info("【图片上传】>>>>>>>>>>>>>>>>删除临时图片:" + delete);
-        return fileUrl;
-    }
 }

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

@@ -1,5 +1,6 @@
 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;
@@ -10,6 +11,7 @@ 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 lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Value;
@@ -251,13 +253,7 @@ public class BaseApi {
     public ResponseJson getWechatLink(String path, String query, String env) {
         return weChatService.getOpenLink(path, query, env);
     }
-    @ApiOperation("获取小程序二维码图片")
-    @PostMapping("/wxacode")
-    public ResponseJson<String> generateWxacode(@RequestBody String params) throws Exception {
-        String accessToken = weChatService.getAccessToken();
-        ResponseJson<String> result = weChatService.generateWxacode(accessToken, params);
-        return result;
-    }
+
     @ApiOperation("获取Dict")
     @GetMapping("/getDict")
     public ResponseJson getDict(String type) {

+ 23 - 1
src/main/java/com/caimei365/user/controller/LoginApi.java

@@ -182,6 +182,11 @@ public class LoginApi {
         return loginService.shopMessageCount(messageType, commonId);
     }
 
+    @ApiOperation("协销站内消息未读消息记录数")
+    @GetMapping("/auth/SpCount")
+    public ResponseJson<Map<String, Object>> SpCount(Integer messageType, Integer commonId) {
+        return loginService.SpCount(messageType, commonId);
+    }
     @ApiOperation("供应商站内消息未读消息总记录数")
     @GetMapping("/auth/ShopCount")
     public ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId) {
@@ -195,7 +200,15 @@ public class LoginApi {
 
         return loginService.ClubCount(messageType, commonId);
     }
-
+    @ApiOperation("协销站内消息列表")
+    @GetMapping("/auth/SpMessageList")
+    public ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId,
+                                                               Integer messageType,
+                                                               Integer source,
+                                                               @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                               @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
+        return loginService.SpMessageList(commonId, messageType, source, pageNum, pageSize);
+    }
 
     @ApiOperation("机构站内消息列表")
     @GetMapping("/auth/ClubMessageList")
@@ -239,6 +252,15 @@ public class LoginApi {
         }
         return ResponseJson.success("标记已读成功", null);
     }
+    @ApiOperation("协销站内消息改为已读")
+    @GetMapping("/auth/updateSpMessageAsRead")
+    public ResponseJson<Void> updateSpMessageAsRead(Integer messageType, Integer commonId) {
+        Integer i = loginService.updateSpMessageAsRead(messageType, commonId);
+        if (i <= 0) {
+            return ResponseJson.error("没有未读消息了!", null);
+        }
+        return ResponseJson.success("标记已读成功", null);
+    }
 
     @ApiOperation("删除站内消息")
     @PostMapping("/auth/deleteMessage")

+ 16 - 0
src/main/java/com/caimei365/user/controller/SellerApi.java

@@ -6,6 +6,7 @@ import com.caimei365.user.model.dto.OnlineDto;
 import com.caimei365.user.model.po.ServiceProviderPo;
 import com.caimei365.user.model.vo.ClubTemporaryVo;
 import com.caimei365.user.model.vo.ClubVo;
+import com.caimei365.user.model.vo.CmBehaviorRecordVo;
 import com.caimei365.user.model.vo.ServiceProviderVo;
 import com.caimei365.user.service.SellerService;
 import com.caimei365.user.utils.MathUtil;
@@ -197,5 +198,20 @@ public class SellerApi {
                 .setQrCode(serviceProviderPo.getQrCode()));
 
     }
+    /**
+     * 机构访问列表
+     */
+    @GetMapping("/getBehaviorRecordClub")
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer spId, String accessTime) {
+        return sellerService.getBehaviorRecordClub( spId, accessTime);
+
+    }
+    /**
+     * 机构访问详情
+     */
+    @GetMapping("/getBehaviorRecordClubFrom")
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer spId,Integer clubId,String accessTime) {
+        return sellerService.getBehaviorRecordClubFrom(spId,clubId, accessTime);
+    }
 
 }

+ 13 - 0
src/main/java/com/caimei365/user/feign/ToolsFeign.java

@@ -1,8 +1,14 @@
 package com.caimei365.user.feign;
 
+import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.utils.message.MessageModel;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.HttpHeaders;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * Description
@@ -28,4 +34,11 @@ public interface ToolsFeign {
     @PostMapping("/tools/mq/send")
     String sendCommonMessage(@RequestParam String topic, @RequestParam String content, @RequestParam String tag, @RequestParam Integer sort, @RequestParam Integer async, @RequestParam Integer oneway, @RequestParam Integer delay);
 
+    /**
+     * 请求发消息
+     */
+    @PostMapping("/tools//message/send")
+    String sendMessage(@RequestBody MessageModel messageModel);
+
+
 }

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

@@ -2,10 +2,7 @@ package com.caimei365.user.mapper;
 
 import com.caimei365.user.model.dto.ClubTemporaryDto;
 import com.caimei365.user.model.po.ServiceProviderPo;
-import com.caimei365.user.model.vo.ClubTemporaryVo;
-import com.caimei365.user.model.vo.ClubVo;
-import com.caimei365.user.model.vo.ServiceProviderVo;
-import com.caimei365.user.model.vo.UserLoginVo;
+import com.caimei365.user.model.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -109,4 +106,10 @@ public interface SellerMapper {
     List<ServiceProviderVo> findServices(@Param("spId")Integer spId,@Param("status")Integer status);
 
     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);
+
+    List<CmBehaviorRecordVo> getBehaviorRecordYesterdayClubFrom(@Param("spId") Integer spId, @Param("clubId") Integer clubId, @Param("accessTime")String accessTime);
+
+    List<CmBehaviorRecordVo> getBehaviorRecordYesterdayClub(@Param("spId") Integer spId,@Param("accessTime")String accessTime);
 }

+ 12 - 0
src/main/java/com/caimei365/user/model/po/ServiceProviderPo.java

@@ -1,9 +1,20 @@
 package com.caimei365.user.model.po;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.aliyuncs.http.HttpRequest;
+import com.caimei365.user.utils.RequestUtil;
+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 com.fasterxml.jackson.databind.ObjectMapper;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * 协销
@@ -92,4 +103,5 @@ public class ServiceProviderPo implements Serializable {
      * 创客经理Id
      */
     private Integer mainServiceProviderId;
+
 }

+ 96 - 0
src/main/java/com/caimei365/user/model/vo/CmBehaviorRecordVo.java

@@ -0,0 +1,96 @@
+package com.caimei365.user.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 用户行为记录对象 cm_behavior_record
+ *
+ * @author Kaick
+ * @date 2023-09-06
+ */
+@Accessors(chain  = true )
+@Data
+@Alias("CmBehaviorRecordVo")
+public class CmBehaviorRecordVo implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private String recordID;
+
+    /** 访问人IP地址 */
+    private String IP;
+
+    /** 用户id、0为游客 */
+    private Integer userID;
+
+    /** 页面路径 */
+    private String pagePath;
+
+    /** 页面类型 */
+    private String pageType;
+
+    /** 页面标签 */
+    private String pageLabel;
+
+    /** 用户行为类型1:用户行为记录、2:ROOS页面统计 */
+    private String behaviorType;
+
+    /** 商品ID */
+    private Integer productID;
+
+    /** 访问时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date accessTime;
+
+    /** 访问时长 */
+    private String accessDuration;
+
+    /** 访问日期 */
+    private String accessDate;
+
+    /** 浏览器链接 */
+    private String referer;
+
+    /** 0直接访问 1百度搜索 2360搜索 3谷歌搜索 4神马搜索 5头条搜索 6搜狗搜索 7小程序 */
+    private String accessSource;
+
+    /** 访问客户端  0:网站 1:小程序 */
+    private String accessClient;
+
+    /** 是否计算访问时长 0未计算 1已计算 */
+    private String isReckon;
+
+    /** ip所属地 */
+    private String region;
+
+    /** 请求头 userAgent */
+    private String userAgent;
+
+    /** 图片 */
+    private String image;
+
+    /** 标题Id */
+    private Integer titleId;
+    /** 标题 */
+    private String title;
+    /** 标题图片 */
+    private String titleImage;
+    /** 内容 */
+    private String content;
+    /** 机构Id */
+    private Integer clubId;
+    /** 名称 */
+    private String name;
+    /** 联系人 */
+    private String linkMan;
+    /** 手机号 */
+    private String contractMobile;
+
+}

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

@@ -70,7 +70,7 @@ public class MessageCenter implements Serializable {
      */
     private Integer shopMessType;
     /**
-     * 供应商服务消息类型 1.上架费
+     * 服务消息类型 1.上架费,2.机构重新分配通知,3.机构转移分配通知,4.机构分配通知,5.客户经理分配通知,6.客户经理重新分配通知,7.机构访问通知,8机构回收通知
      */
     private Integer shopTieredType;
     /**
@@ -111,4 +111,20 @@ public class MessageCenter implements Serializable {
      * 失败原因
      */
     private String reasonContent;
+
+
+    /** 手机号 */
+    private String mobile;
+
+    /** 名称 */
+    private String name;
+
+    /** 用户名称 */
+    private String userName;
+
+    /** 前用户名称 */
+    private String superUserName;
+
+    /** 当前id */
+    private Integer thisId;
 }

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

@@ -86,6 +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>> ClubMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
 
     ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
@@ -94,6 +95,7 @@ public interface LoginService {
 
     ResponseJson<Map<String, Object>> shopMessageCount(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>> ClubCount(Integer messageType,Integer commonId);
@@ -101,6 +103,7 @@ public interface LoginService {
      Integer updateMessageAsRead(Integer messageType,Integer commonId);
 
     Integer updateShopMessageAsRead(Integer messageType,Integer commonId);
+    Integer updateSpMessageAsRead(Integer messageType,Integer commonId);
 
      Integer updateRead(Integer userType,String Id);
 

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

@@ -4,10 +4,7 @@ import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.ClubTemporaryDto;
 import com.caimei365.user.model.dto.LoginCodeDto;
 import com.caimei365.user.model.po.ServiceProviderPo;
-import com.caimei365.user.model.vo.ClubTemporaryVo;
-import com.caimei365.user.model.vo.ClubVo;
-import com.caimei365.user.model.vo.ServiceProviderVo;
-import com.caimei365.user.model.vo.UserLoginVo;
+import com.caimei365.user.model.vo.*;
 import com.github.pagehelper.PageInfo;
 
 import java.util.List;
@@ -119,5 +116,9 @@ 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<ServiceProviderVo>> getServiceTeam(Integer spId,Integer status);
 }

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

@@ -553,6 +553,21 @@ public class LoginServiceImpl implements LoginService {
         return ResponseJson.success(map);
     }
 
+    @Override
+    public ResponseJson<Map<String, Object>> SpCount(Integer messageType, Integer commonId) {
+        Integer count = messageCenterMapper.Count(3, commonId);
+        Integer tradeCount = messageCenterMapper.MessageCount(3, 1, commonId);
+        Integer accountCount = messageCenterMapper.MessageCount(3, 2, commonId);
+        Integer notificationCount = messageCenterMapper.MessageCount(3, 3, commonId);
+        Integer promotionCount = messageCenterMapper.MessageCount(3, 4, commonId);
+        Map<String, Object> map = new HashMap(10);
+        map.put("count", count);
+        map.put("tradeCount", tradeCount);
+        map.put("accountCount", accountCount);
+        map.put("notificationCount", notificationCount);
+        map.put("promotionCount", promotionCount);
+        return ResponseJson.success(map);
+    }
     @Override
     public ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId) {
         Integer count = messageCenterMapper.Count(2, commonId);
@@ -579,6 +594,10 @@ public class LoginServiceImpl implements LoginService {
     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
     public Integer deleteMessage(String id) {
@@ -601,6 +620,34 @@ public class LoginServiceImpl implements LoginService {
     }
 
 
+    @Override
+    public ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<MessageCenter> list = messageCenterMapper.MessageList(3, messageType, commonId);
+        list.forEach(mess -> {
+            if (null != mess.getClubId()) {
+                MessageCenter messageCenter = messageCenterMapper.MainImage(3, 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());
+                }
+            }
+        });
+        if (source == 2) {
+            messageCenterMapper.updateMessageAsRead(3, messageType, commonId);
+        }
+        PageInfo<MessageCenter> pageData = new PageInfo<>(list);
+        return ResponseJson.success(pageData);
+    }
     @Override
     public ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);

+ 35 - 4
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -12,6 +12,10 @@ import com.caimei365.user.model.vo.*;
 import com.caimei365.user.service.RegisterService;
 import com.caimei365.user.service.RemoteCallService;
 import com.caimei365.user.utils.*;
+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 org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
@@ -278,12 +282,39 @@ public class RegisterServiceImpl implements RegisterService {
         // 添加机构协销记录
         if (StringUtils.isNotBlank(club.getLinkMan())) {
             clubMapper.inProvider(spId, club.getClubId(), spId!=1342?"系统自动分配":club.getLinkMan(), 0);
-            if(spId!=1342){
-                //短信
-                String spMessage = "【采美365】系统已为你分配机构客户,请及时跟进。机构名称【"+user.getUserName()+"】,联系人【"+user.getUserName()+"】,手机号【"+user.getBindMobile()+"】。微信小程序https://....com,退订回T。";
+            if(spId!=1342) {
+                String selSpName = clubMapper.selSpName(spId);
+                String spMessage = "【采美365】系统已为你分配机构客户,请及时跟进。机构名称【" + user.getUserName() + "】,联系人【" + user.getUserName() + "】,手机号【" + user.getBindMobile() + "】。";
                 String mobile = vipMapper.findMobile(clubMapper.getSpUserId(spId));
-                String clubMessage = "【采美365】采美平台已为您提供专属客户经理,为您提供专业服务。客户经理【"+clubMapper.selSpName(spId)+"】,手机号【"+mobile+"】。微信小程序https://....com,退订回T。";
+                String clubMessage = "【采美365】采美平台已为您提供专属客户经理,为您提供专业服务。客户经理【" + selSpName + "】,手机号【" + mobile + "】。";
                 if (mobile != null && mobile != "") {
+                    //站内信
+                    MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
+                    insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
+                            .mqInfo(new MqInfo().topic("MessageLine").delay(1).async(0))
+                            .info(new InsideMessage()
+                                    .userType(3)
+                                    .messageType(3)
+                                    .shopTieredType(4)
+                                    .name(user.getUserName())
+                                    .userName(user.getUserName())
+                                    .mobile(user.getBindMobile())
+                                    .thisId(spId)
+                                    .clubId(club.getClubId())
+                            );
+                    smsFeign.sendMessage(insideMessageMessageModel);
+
+                    insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
+                            .info(new InsideMessage()
+                                    .userType(1)
+                                    .messageType(3)
+                                    .shopTieredType(5)
+                                    .userName(selSpName)
+                                    .mobile(mobile)
+                                    .clubId(club.getClubId())
+                            );
+                    smsFeign.sendMessage(insideMessageMessageModel);
+                    //短信
                     remoteCallService.remoteSendSms(25, 1, mobile, spMessage);
                     remoteCallService.remoteSendSms(25, 1, user.getBindMobile(), clubMessage);
                 }

+ 54 - 9
src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java

@@ -2,9 +2,7 @@ package com.caimei365.user.service.impl;
 
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.WeChatService;
-import com.caimei365.user.mapper.LoginMapper;
-import com.caimei365.user.mapper.SellerMapper;
-import com.caimei365.user.mapper.SuperVipMapper;
+import com.caimei365.user.mapper.*;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.ClubTemporaryDto;
 import com.caimei365.user.model.dto.LoginCodeDto;
@@ -17,6 +15,7 @@ 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,6 +25,8 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * Description
@@ -44,6 +45,10 @@ public class SellerServiceImpl implements SellerService {
     @Resource
     private SellerMapper sellerMapper;
     @Resource
+    private ShopMapper shopMapper;
+    @Resource
+    private ArticleMapper articleMapper;
+    @Resource
     private SuperVipMapper vipMapper;
     @Resource
     private LoginMapper loginMapper;
@@ -339,23 +344,63 @@ public class SellerServiceImpl implements SellerService {
     @Override
     public ResponseJson setSellerHome(ServiceProviderPo serviceProviderPo) {
         // 协销用户
-        sellerMapper.setSellerHome(serviceProviderPo);
-        if(StringUtils.isNotBlank(serviceProviderPo.getImage())){
-            sellerMapper.setSellerUserHome(serviceProviderPo.getUserId(),serviceProviderPo.getImage());
+        if (StringUtils.isNotBlank(serviceProviderPo.getImage())) {
+            sellerMapper.setSellerUserHome(serviceProviderPo.getUserId(), serviceProviderPo.getImage());
+        }
+        if (StringUtils.isNotBlank(serviceProviderPo.getQrCode())) {
+            sellerMapper.setSellerHome(serviceProviderPo);
         }
         return ResponseJson.success("");
     }
 
     @Override
-    public ResponseJson<List<ServiceProviderVo>> getServiceTeam(Integer spId,Integer status) {
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClub(Integer spId, String accessTime) {
+        List<CmBehaviorRecordVo> behaviorRecordYesterdayClub = sellerMapper.getBehaviorRecordYesterdayClub(spId, accessTime);
+        for (CmBehaviorRecordVo cmBehaviorRecordVo : behaviorRecordYesterdayClub) {
+            String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
+            cmBehaviorRecordVo.setPageLabel(pageLabel);
+        }
+        return ResponseJson.success(behaviorRecordYesterdayClub);
+    }
+
+    @Override
+    public ResponseJson<List<CmBehaviorRecordVo>> getBehaviorRecordClubFrom(Integer spId, Integer clubId, String accessTime) {
+        List<CmBehaviorRecordVo> behaviorRecordYesterdayClubFrom = sellerMapper.getBehaviorRecordYesterdayClubFrom(spId, clubId, accessTime);
+        for (CmBehaviorRecordVo cmBehaviorRecordVo : behaviorRecordYesterdayClubFrom) {
+            String pageLabel = sellerMapper.getBehaviorRecordYesterdayPageLabel(spId, cmBehaviorRecordVo.getClubId(), accessTime);
+            cmBehaviorRecordVo.setPageLabel(pageLabel);
+            if (cmBehaviorRecordVo.getProductID() != 0 && cmBehaviorRecordVo.getPageType().equals("6") ) {
+                ProductItemVo productShown = shopMapper.getProductShown(cmBehaviorRecordVo.getProductID());
+                cmBehaviorRecordVo.setTitleId(cmBehaviorRecordVo.getProductID());
+                cmBehaviorRecordVo.setTitle(productShown.getName());
+                cmBehaviorRecordVo.setTitleImage(productShown.getImage());
+            }else if ( cmBehaviorRecordVo.getPageType().equals("11") ) {
+                //获取文章id
+                Integer id = null;
+                Pattern pattern = Pattern.compile("info/detail-(.*?)-");
+                Matcher matcher = pattern.matcher(cmBehaviorRecordVo.getPagePath());
+                if (matcher.find()) {
+                    id= Integer.valueOf(matcher.group(1));
+                }
+                ShopArticleVo info = articleMapper.getShopArticleById(id);
+                cmBehaviorRecordVo.setTitleId(id);
+                cmBehaviorRecordVo.setTitle(info.getTitle());
+                cmBehaviorRecordVo.setTitleImage(info.getGuidanceImage());
+            }
+        }
+        return ResponseJson.success(behaviorRecordYesterdayClubFrom);
+    }
+
+    @Override
+    public ResponseJson<List<ServiceProviderVo>> getServiceTeam(Integer spId, Integer status) {
         Integer leaderId = sellerMapper.findLeaderIdByServiceId(spId);
         Integer managerId = sellerMapper.findmanagerIdByServiceId(spId);
         List<ServiceProviderVo> serviceProviderVos = new ArrayList<>();
         if (null != leaderId) {
-            serviceProviderVos = sellerMapper.findServices(spId,status);
+            serviceProviderVos = sellerMapper.findServices(spId, status);
         }
         if (null != managerId) {
-            serviceProviderVos = sellerMapper.findAllServices(spId,status);
+            serviceProviderVos = sellerMapper.findAllServices(spId, status);
         }
         //个人返回空,组长返回小组所有人
         return ResponseJson.success(serviceProviderVos);

+ 0 - 60
src/main/java/com/caimei365/user/utils/FastDfsUtil.java

@@ -1,60 +0,0 @@
-package com.caimei365.user.utils;
-
-import com.github.tobato.fastdfs.domain.fdfs.StorePath;
-import com.github.tobato.fastdfs.domain.proto.storage.DownloadByteArray;
-import com.github.tobato.fastdfs.service.FastFileStorageClient;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.io.*;
-
-/**
- * Description
- *
- * @author : Charles
- * @date : 2021/10/25
- */
-@Component
-public class FastDfsUtil {
-    @Resource
-    private FastFileStorageClient storageClient;
-
-
-    // 文件上传
-    public String uploadFile(String path) throws FileNotFoundException {
-        File file = new File(path);
-        InputStream input = new FileInputStream(file);
-        long size = FileUtils.sizeOf(file);
-        String name = file.getName();
-        String fileName = name.substring(name.lastIndexOf("/") + 1);
-        StorePath storePath = storageClient.uploadFile(input, size, FilenameUtils.getExtension(fileName), null);
-        return storePath.getFullPath();
-    }
-
-    // 文件上传
-    public String uploadStream(String path) throws FileNotFoundException {
-        File file = new File(path);
-        InputStream input = new FileInputStream(file);
-        long size = FileUtils.sizeOf(file);
-        String name = file.getName();
-        String fileName = name.substring(name.lastIndexOf("/") + 1);
-        StorePath storePath = storageClient.uploadFile(input, size, FilenameUtils.getExtension(fileName), null);
-        return storePath.getFullPath();
-    }
-
-    // 文件下载
-    public boolean downloadFile(String path, String downloadFilePath) throws IOException {
-        File file = new File(downloadFilePath);
-        FileOutputStream outputStream = null;
-        // fastdfs 文件读取
-        String filepath = path.substring(path.lastIndexOf("group1/") + 7);
-        DownloadByteArray callback = new DownloadByteArray();
-        byte[] content = storageClient.downloadFile("group1", filepath, callback);
-        // 数据写入指定文件夹中
-        outputStream = new FileOutputStream(file);
-        outputStream.write(content);
-        return true;
-    }
-}

+ 61 - 4
src/main/java/com/caimei365/user/utils/RequestUtil.java

@@ -14,10 +14,7 @@ import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 import java.io.*;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLConnection;
+import java.net.*;
 import java.nio.charset.StandardCharsets;
 import java.security.cert.X509Certificate;
 import java.util.List;
@@ -217,4 +214,64 @@ public class RequestUtil {
         } catch (Exception ignored) {}
         return null;
     }
+
+    public static String sendPost(String url, String param, String contentType) {
+        OutputStreamWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            conn.setRequestProperty("Content-Type", contentType);
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+
+            /*************************************************************************/
+            // 获取URLConnection对象对应的输出流
+            // out = new PrintWriter(conn.getOutputStream());
+            out = new OutputStreamWriter(conn.getOutputStream(), "utf-8"); // 8859_1
+            /*************************************************************************/
+
+            out.write(param); // post的关键所在
+            // 发送请求参数
+            // out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            int code = conn.getResponseCode();
+            if(code == 200) {
+                in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+            }else{
+                in = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
+            }
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送 POST 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+
 }

+ 377 - 0
src/main/java/com/caimei365/user/utils/message/InsideMessage.java

@@ -0,0 +1,377 @@
+package com.caimei365.user.utils.message;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @author Administrator
+ * 站内信model
+ */
+@Data
+@Accessors(fluent = true)
+public class InsideMessage implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 消息id
+     */
+    private Integer id;
+    /**
+     * 供应商id
+     */
+    private Integer shopId;
+    /**
+     * 机构id
+     */
+    private Integer clubId;
+    /**
+     * 订单ID
+     */
+    private Integer orderId;
+    /**
+     * 用户类型1.机构2.供应商
+     */
+    private Integer userType;
+    /**
+     * 消息类型1.交易物流2.账户通知3.服务通知4.优惠促销
+     */
+    private Integer messageType;
+    /**
+     * 消息内容
+     */
+    private String content;
+
+    /**
+     * 失败原因
+     */
+    private String reasonContent;
+    /**
+     * 操作完成时间
+     */
+    private String time;
+    /**
+     * 账户通知类型 1.注册成功通知 2.购买超级会员成功 3.超级会员到期提醒 4.超级会员到期提醒 5.升级资质机构成功 6.升级资质机构失败 7.成为机构运营人员通知
+     */
+    private Integer accountType;
+    /**
+     * 优惠券类型 1.优惠券待领取通知 2.优惠券过期通知
+     */
+    private Integer couponType;
+    /**
+     * 优惠券金额
+     */
+    private Double couponFee;
+    /**
+     * 主图
+     */
+    private String mainImage;
+    /**
+     * 是否能走线上支付 0可以 1不可以 只能线下
+     */
+    private Integer onlinePayFlag;
+    /**
+     * 商品名称
+     */
+    private String productName;
+    /**
+     * 供应商消息类型 1,账号审核通知,2.成为公司运营人员通知,3.商品上架审核通知,4.新品展示审核通知,5.上架费到期通知 6.商品资质到期通知
+     */
+    private Integer shopMessType;
+    /**
+     * 供应商服务消息类型 1.上架费
+     */
+    private Integer shopTieredType;
+    /**
+     * 交易物流1.下单成功通知  2.订单支付完成 3.退款/货成功通知 4.订单取消通知 5.订单发货通知 6.自动收货通知
+     */
+    private Integer orderMessageType;
+    /**
+     * 0.未读 , 1.已读
+     */
+    private Integer saved;
+    /**
+     * 优惠券类型 1.优惠券待领取通知 2.优惠券过期通知
+     */
+    private Integer couponMessageType;
+    /**
+     * 商品记录数
+     */
+    private Integer productCount;
+    /**
+     * 退货退款类型:1部分退、2全部退
+     */
+    private Integer refundType;
+
+    /**
+     * 订单状态
+     */
+    private Integer status;
+    /**
+     * 商品ID
+     */
+    private Integer productId;
+
+    /** 手机号 */
+    private String mobile;
+
+    /** 名称 */
+    private String name;
+
+    /** 用户名称 */
+    private String userName;
+
+    /** 前用户名称 */
+    private String superUserName;
+
+    /** 当前id */
+    private Integer thisId;
+
+    /**
+     * 供应商公司名称
+     */
+
+    private String shopName;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getShopId() {
+        return shopId;
+    }
+
+    public void setShopId(Integer shopId) {
+        this.shopId = shopId;
+    }
+
+    public Integer getClubId() {
+        return clubId;
+    }
+
+    public void setClubId(Integer clubId) {
+        this.clubId = clubId;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public Integer getUserType() {
+        return userType;
+    }
+
+    public void setUserType(Integer userType) {
+        this.userType = userType;
+    }
+
+    public Integer getMessageType() {
+        return messageType;
+    }
+
+    public void setMessageType(Integer messageType) {
+        this.messageType = messageType;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getReasonContent() {
+        return reasonContent;
+    }
+
+    public void setReasonContent(String reasonContent) {
+        this.reasonContent = reasonContent;
+    }
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public Integer getAccountType() {
+        return accountType;
+    }
+
+    public void setAccountType(Integer accountType) {
+        this.accountType = accountType;
+    }
+
+    public Integer getCouponType() {
+        return couponType;
+    }
+
+    public void setCouponType(Integer couponType) {
+        this.couponType = couponType;
+    }
+
+    public Double getCouponFee() {
+        return couponFee;
+    }
+
+    public void setCouponFee(Double couponFee) {
+        this.couponFee = couponFee;
+    }
+
+    public String getMainImage() {
+        return mainImage;
+    }
+
+    public void setMainImage(String mainImage) {
+        this.mainImage = mainImage;
+    }
+
+    public Integer getOnlinePayFlag() {
+        return onlinePayFlag;
+    }
+
+    public void setOnlinePayFlag(Integer onlinePayFlag) {
+        this.onlinePayFlag = onlinePayFlag;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public Integer getShopMessType() {
+        return shopMessType;
+    }
+
+    public void setShopMessType(Integer shopMessType) {
+        this.shopMessType = shopMessType;
+    }
+
+    public Integer getShopTieredType() {
+        return shopTieredType;
+    }
+
+    public void setShopTieredType(Integer shopTieredType) {
+        this.shopTieredType = shopTieredType;
+    }
+
+    public Integer getOrderMessageType() {
+        return orderMessageType;
+    }
+
+    public void setOrderMessageType(Integer orderMessageType) {
+        this.orderMessageType = orderMessageType;
+    }
+
+    public Integer getSaved() {
+        return saved;
+    }
+
+    public void setSaved(Integer saved) {
+        this.saved = saved;
+    }
+
+    public Integer getCouponMessageType() {
+        return couponMessageType;
+    }
+
+    public void setCouponMessageType(Integer couponMessageType) {
+        this.couponMessageType = couponMessageType;
+    }
+
+    public Integer getProductCount() {
+        return productCount;
+    }
+
+    public void setProductCount(Integer productCount) {
+        this.productCount = productCount;
+    }
+
+    public Integer getRefundType() {
+        return refundType;
+    }
+
+    public void setRefundType(Integer refundType) {
+        this.refundType = refundType;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getSuperUserName() {
+        return superUserName;
+    }
+
+    public void setSuperUserName(String superUserName) {
+        this.superUserName = superUserName;
+    }
+
+    public Integer getThisId() {
+        return thisId;
+    }
+
+    public void setThisId(Integer thisId) {
+        this.thisId = thisId;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+}

+ 43 - 0
src/main/java/com/caimei365/user/utils/message/MessageModel.java

@@ -0,0 +1,43 @@
+package com.caimei365.user.utils.message;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+/**
+ * @author Administrator
+ */
+@Data
+@Accessors(fluent = true)
+@NoArgsConstructor
+public class MessageModel<T> {
+    private MessageType code;
+
+    private MqInfo mqInfo;
+
+    private T info;
+
+    public MessageType getCode() {
+        return code;
+    }
+
+    public void setCode(MessageType code) {
+        this.code = code;
+    }
+
+    public MqInfo getMqInfo() {
+        return mqInfo;
+    }
+
+    public void setMqInfo(MqInfo mqInfo) {
+        this.mqInfo = mqInfo;
+    }
+
+    public T getInfo() {
+        return info;
+    }
+
+    public void setInfo(T info) {
+        this.info = info;
+    }
+}

+ 41 - 0
src/main/java/com/caimei365/user/utils/message/MessageType.java

@@ -0,0 +1,41 @@
+package com.caimei365.user.utils.message;
+
+import lombok.AllArgsConstructor;
+import lombok.ToString;
+
+/**
+ * @author Administrator
+ */
+
+@ToString
+@AllArgsConstructor
+public enum MessageType {
+    /**
+     * 1.微信模板消息
+     * 2.站内消息
+     * 3.邮件
+     * 4.短信
+     */
+    WECHAT_TEMPLATE_MESSAGE(1, "微信模板消息"),
+    WEB_INSIDE_MESSAGE(2, "站内消息"),
+    EMAILS(3, "邮件"),
+    SYS_MESSAGE(4, "短信");
+    private Integer code;
+    private String description;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 65 - 0
src/main/java/com/caimei365/user/utils/message/MqInfo.java

@@ -0,0 +1,65 @@
+package com.caimei365.user.utils.message;
+
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Range;
+
+
+@Data
+@Accessors(fluent = true)
+public class MqInfo {
+    /**
+     * 异步消息(可选):1是,0否
+     */
+    @Range(min = 0, max = 1)
+    private Integer async;
+
+    /**
+     * 1-18,0否,对应时间依次:1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h
+     */
+    @Range(min = 0, max = 18)
+    private Integer delay;
+
+    /**
+     * 消息主题
+     */
+    private String topic;
+
+    /**
+     * 消息标签(可选)
+     */
+    private String tag;
+
+    public Integer getAsync() {
+        return async;
+    }
+
+    public void setAsync(Integer async) {
+        this.async = async;
+    }
+
+    public Integer getDelay() {
+        return delay;
+    }
+
+    public void setDelay(Integer delay) {
+        this.delay = delay;
+    }
+
+    public String getTopic() {
+        return topic;
+    }
+
+    public void setTopic(String topic) {
+        this.topic = topic;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+}

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

@@ -19,7 +19,7 @@
                guidanceImage,
                enabledStatus as status,
                labelIds
-        from info
+            from info
         where id = #{articleId}
     </select>
     <select id="getArticleTypeList" resultType="com.caimei365.user.model.vo.ArticleTypeVo">

+ 33 - 18
src/main/resources/mapper/MessageCenter.xml

@@ -65,6 +65,9 @@
             <if test="userType == 2">
                 and  shopID=#{commonId}
             </if>
+            <if test="userType == 3">
+                and  thisId=#{commonId}
+            </if>
             AND messageType=#{messageType}
             and userType=#{userType}
             AND saved=0
@@ -80,6 +83,9 @@
             <if test="userType == 2">
                 and  shopID=#{commonId}
             </if>
+            <if test="userType == 3">
+                and  thisId=#{commonId}
+            </if>
             and userType=#{userType}
             AND saved=0
         </where>
@@ -102,15 +108,18 @@
         SELECT * FROM `message_center`
         <where>
             <if test="messageType !=null">
-            AND messageType=#{messageType}
-           </if>
+                AND messageType=#{messageType}
+            </if>
             <if test="userType == 1">
-                and  clubID=#{commonId}
+                and clubID=#{commonId}
             </if>
             <if test="userType == 2">
-                and  shopID=#{commonId}
+                and shopID=#{commonId}
+            </if>
+            <if test="userType == 3">
+                and thisId=#{commonId}
             </if>
-           and userType=#{userType}
+            and userType=#{userType}
         </where>
         ORDER BY id DESC
     </select>
@@ -154,12 +163,15 @@
         <where>
 
             <if test="userType == 1">
-              and  c.clubID=#{commonId}
+                and c.clubID=#{commonId}
             </if>
             <if test="userType == 2">
-              and  p.shopID=#{commonId}
+                and p.shopID=#{commonId}
+            </if>
+            <if test="userType == 3">
+                and sp.serviceProviderID=#{commonId}
             </if>
-        and co.orderID=#{orderID}
+            and co.orderID=#{orderID}
         </where>
         LIMIT 1
     </select>
@@ -216,16 +228,19 @@
     <update id="updateMessageAsRead">
         UPDATE message_center SET saved = 1
         <where>
-      <if test="userType == 1">
-          and  clubID=#{commonId}
-      </if>
-      <if test="userType == 2">
-          and  shopID=#{commonId}
-      </if>
-        <if test="messageType !=null">
-           and messageType = #{messageType}
-        </if>
-          and userType=#{userType}
+            <if test="userType == 1">
+                and clubID=#{commonId}
+            </if>
+            <if test="userType == 2">
+                and shopID=#{commonId}
+            </if>
+            <if test="userType == 3">
+                and thisId=#{commonId}
+            </if>
+            <if test="messageType !=null">
+                and messageType = #{messageType}
+            </if>
+            and userType=#{userType}
         </where>
     </update>
 

+ 64 - 18
src/main/resources/mapper/SellerMapper.xml

@@ -31,25 +31,9 @@
     <update id="setSellerHome" parameterType="com.caimei365.user.model.po.ServiceProviderPo">
         update serviceprovider
         <trim prefix="SET" suffixOverrides=",">
-            <if test="organizeID != null">organizeID = #{organizeID},</if>
-            <if test="openid != null and openid != ''">openid = #{openid},</if>
-            <if test="unionId != null and unionId != ''">unionId = #{unionId},</if>
-            <if test="name != null and name != ''">name = #{name},</if>
-            <if test="linkMan != null and linkMan != ''">linkMan = #{linkMan},</if>
-            <if test="contractPhone != null and contractPhone != ''">contractPhone = #{contractPhone},</if>
-            <if test="contractMobile != null and contractMobile != ''">contractMobile = #{contractMobile},</if>
-            <if test="contractEmail != null and contractEmail != ''">contractEmail = #{contractEmail},</if>
-            <if test="duty != null and duty != ''">duty = #{duty},</if>
-            <if test="auditStatus != null and auditStatus != ''">auditStatus = #{auditStatus},</if>
-            <if test="auditTime != null and auditTime != ''">auditTime = #{auditTime},</if>
-            <if test="auditNote != null and auditNote != ''">auditNote = #{auditNote},</if>
-            <if test="validFlag != null and validFlag != ''">validFlag = #{validFlag},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="addTime != null and addTime != ''">addTime = #{addTime},</if>
-            <if test="mainServiceProviderID != null">mainServiceProviderID = #{mainServiceProviderID},</if>
             <if test="qrCode != null and qrCode != ''">qrCode = #{qrCode},</if>
         </trim>
-        where userID = #{userID}
+        where userID = #{userId}
     </update>
     <update id="setSellerUserHome" >
         update user
@@ -317,5 +301,67 @@
             </if>
         </where>
     </select>
-
+    <select id="getBehaviorRecordYesterdayPageLabel" 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
+        WHERE b.userId !=0
+        and c.spId=#{spId}
+        <if test="clubId != null">
+            AND c.clubId =#{clubId}
+        </if>
+        and b.pageType in(6,8,11)
+        and  DATE(b.accessTime) = DATE(#{accessTime})
+        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,8,11)
+        and  DATE(b.accessTime) = DATE(#{accessTime})
+    </select>
+    <select id="getBehaviorRecordYesterdayClub" 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 b.pageType in(6,8,11)
+          and  DATE(b.accessTime) = DATE(#{accessTime})
+        GROUP BY c.clubId
+    </select>
 </mapper>