Quellcode durchsuchen

数据统计记录

huangzhiguo vor 1 Jahr
Ursprung
Commit
248a3781eb

+ 41 - 5
src/main/java/com/caimei365/user/controller/ClubApi.java

@@ -208,13 +208,19 @@ public class ClubApi {
     }
 
     @ApiOperation("关键词库联想查询")
-    @ApiImplicitParam(required = true, name = "remarks", value = "联想词")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = true, name = "remarks", value = "联想词"),
+            @ApiImplicitParam(required = true, name = "type", value = "联想类型 0 动态标签 1 静态标签")
+    })
     @GetMapping("/remarks/cmremarkslist")
-    public ResponseJson getCmRemarksList(String remarks) {
-        if (null == remarks || remarks == "") {
+    public ResponseJson getCmRemarksList(String remarks, Integer type) {
+        if (StringUtils.isBlank(remarks)) {
             return ResponseJson.error("参数异常,关键词不能为空!", null);
         }
-        return clubService.getCmRemarksList(remarks);
+        if (null == type) {
+            return ResponseJson.error("参数异常,联想类型不能为空!", null);
+        }
+        return clubService.getCmRemarksList(remarks, type);
     }
 
     @ApiOperation("机构资料备注详情")
@@ -224,6 +230,23 @@ public class ClubApi {
         return clubService.getRemarksDetail(remarksId);
     }
 
+    @ApiOperation("优先展示标签 -- 咨询记录 -> 标签记录")
+    @GetMapping("/remarks/getPriorKeyword")
+    public ResponseJson<List<String>> getPriorKeyword(){
+
+        return clubService.getPriorKeyword();
+    }
+
+    @ApiOperation("查询机构历史填写信息")
+    @ApiImplicitParam(required = true, name = "clubId", value = "机构Id")
+    @GetMapping("/remarks/getHistoryInfo")
+    public ResponseJson<Map<String, String>> getHistoryInfo(Integer clubId) {
+        if (null == clubId) {
+            return ResponseJson.error(-1, "机构Id不能为空", null);
+        }
+        return clubService.getHistoryInfo(clubId);
+    }
+
     /**
      * @param jsonParamsDto:{ remarksId:           备注id,
      *                        机构id:               机构id,
@@ -602,7 +625,7 @@ public class ClubApi {
     }
 
     /**
-     * 机构初始出局
+     * 机构初始数据
      * @param clubId
      * @return
      */
@@ -613,6 +636,19 @@ public class ClubApi {
         }
         return clubService.selTotal(clubId);
     }
+
+    /**
+     * 用户需求
+     * @param clubId
+     * @param dateType
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    @GetMapping("/getCustomDemand")
+    public ResponseJson getCustomDemand(Integer clubId, Integer dateType, String startTime, String endTime) {
+        return clubService.getCustomDemand(clubId, dateType, startTime, endTime);
+    }
     /**
      * 机构画像
      * @param cmPortrait

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

@@ -2,6 +2,7 @@ package com.caimei365.user.controller;
 
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.RoosInformationDto;
+import com.caimei365.user.model.vo.CmShopPopUpVo;
 import com.caimei365.user.service.RoosInformationService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +35,19 @@ public class RoosInformationApi {
         return ResponseJson.success(!isClick);
     }
 
+    /**
+     * 供应商弹框信息
+     * @param shopId
+     * @param productId
+     * @param infoId
+     * @param keyword
+     * @return
+     */
+    @GetMapping("/getPopUpInfo")
+    public ResponseJson<CmShopPopUpVo> getPopUpInfo(Integer shopId, Integer productId, Integer infoId, String keyword) {
+        return roosInformationService.getPopUpInfo(shopId, productId, infoId, keyword);
+    }
+
     /**
      * 插入填写咨询人基本信息
      * @param roosInformationDto
@@ -41,11 +55,13 @@ public class RoosInformationApi {
      */
     @PostMapping("/insertRoos")
     public ResponseJson<String> insertRoosInformation(RoosInformationDto roosInformationDto) {
+        if (null == roosInformationDto.getShopId()) {
+            return ResponseJson.error(-1, "供应商Id不能为空", null);
+        }
         // 获取访问ip
         String ip = roosInformationService.obtainIp();
         roosInformationDto.setIp(ip);
-        roosInformationService.insRoosInformation(roosInformationDto);
-        return ResponseJson.success("咨询信息插入成功");
+        return roosInformationService.insRoosInformation(roosInformationDto);
     }
 
     /**

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

@@ -233,6 +233,32 @@ public interface ClubMapper {
      */
     List<RemarksFileVo> getRemarksFileList(Integer remarksId);
 
+    /**
+     * 机构咨询记录历史信息
+     * @param clubId
+     * @return
+     */
+    ClubRemarksPo getRemarksInfo(@Param("clubId") Integer clubId);
+
+    /**
+     * 优先展示标签
+     * @return
+     */
+    List<String> getPriorKeywordList();
+
+    /**
+     * 标签是否已存在
+     * @param keyword
+     * @return
+     */
+    Integer findKeywordExist(@Param("keyword") String keyword);
+    /**
+     * 保存静态动态标签
+     * @param keyword
+     * @param dynamicStatus
+     */
+    void insertLabel(@Param("keyword") String keyword, @Param("dynamicStatus") Integer dynamicStatus);
+
     /**
      * 删除资料备注
      *
@@ -323,7 +349,7 @@ public interface ClubMapper {
 
     Integer findLeaderId(Integer serviceProviderId);
 
-    List<CmRemarksVo> getCmRemarksList(String remarks);
+    List<String> getCmRemarksList(@Param("keyword") String keyword, @Param("type") Integer type);
 
     ClubVo recordClubage(Integer clubId);
 
@@ -365,6 +391,8 @@ public interface ClubMapper {
 
     List<BehaviorRecodeVo> recordDetail(@Param("clubId") Integer clubId, @Param("accessDate") String accessDate);
 
+    List<String> getClubRemarksInfo(Integer clubId, String startTime, String endTime);
+
     List<NewOrderPo> selOrderList(CmPortraitDto cmPortrait);
 
     List<BehaviorRecodeVo> selBehaviorList(CmPortraitDto cmPortrait);

+ 11 - 0
src/main/java/com/caimei365/user/mapper/RoosInformationMapper.java

@@ -2,6 +2,7 @@ package com.caimei365.user.mapper;
 
 import com.caimei365.user.model.dto.BehaviorRecordDto;
 import com.caimei365.user.model.dto.RoosInformationDto;
+import com.caimei365.user.model.vo.CmShopPopUpVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -23,6 +24,16 @@ public interface RoosInformationMapper {
      */
    List<Integer> selIsClick(@Param("IP") String IP,@Param("createTime") String createTime);
 
+    /**
+     * 弹框样式
+     * @param shopId
+     * @param productId
+     * @param infoId
+     * @param keyword
+     * @return
+     */
+   CmShopPopUpVo getShopPop(@Param("shopId") Integer shopId,@Param("productId")  Integer productId,@Param("infoId")  Integer infoId,@Param("keyword")  String keyword);
+
     /**
      * 插入填写咨询人基本信息
      * @param roosInformationDto

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

@@ -15,6 +15,10 @@ public class RoosInformationDto {
      * 访问人ip
      */
     private String ip;
+    /**
+     * 供应商Id
+     */
+    private Integer shopId;
     /**
      * 咨询姓名
      */

+ 32 - 0
src/main/java/com/caimei365/user/model/po/ClubRemarksPo.java

@@ -71,4 +71,36 @@ public class ClubRemarksPo implements Serializable {
      *报备关联ID
      */
     private Integer reportID;
+    /**
+     * 沟通情况
+     */
+    private Integer communicationSituation;
+    /**
+     * 沟通方式
+     */
+    private Integer communicationMethods;
+    /**
+     * 客户来源
+     */
+    private Integer customerSource;
+    /**
+     * 客户性别
+     */
+    private Integer customerGender;
+    /**
+     * 客户年龄
+     */
+    private String customerAge;
+    /**
+     * 加群情况
+     */
+    private Integer groupAddition;
+    /**
+     * 动态标签
+     */
+    private String trendsKeyword;
+    /**
+     * 静态标签
+     */
+    private String stateKeyword;
 }

+ 29 - 0
src/main/java/com/caimei365/user/model/vo/ClubVo.java

@@ -200,4 +200,33 @@ public class ClubVo implements Serializable {
      */
     private String ipAddress;
 
+    /**
+     * 沟通情况
+     */
+    private Integer communicationSituation;
+    /**
+     * 沟通方式
+     */
+    private Integer communicationMethods;
+    /**
+     * 客户来源
+     */
+    private Integer customerSource;
+    /**
+     * 客户性别
+     */
+    private Integer customerGender;
+    /**
+     * 客户年龄
+     */
+    private String customerAge;
+    /**
+     * 加群情况
+     */
+    private Integer groupAddition;
+    /**
+     * 资料完整度
+     */
+    private Integer number;
+
 }

+ 34 - 0
src/main/java/com/caimei365/user/model/vo/CmShopPopUpVo.java

@@ -0,0 +1,34 @@
+package com.caimei365.user.model.vo;
+
+import lombok.Data;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/9/13
+ */
+@Data
+public class CmShopPopUpVo {
+    private Integer id;
+    /**
+     * 供应商Id
+     */
+    private Integer shopId;
+    /**
+     * 图片
+     */
+    private String image;
+    /**
+     * 引导语1
+     */
+    private String guidingOne;
+    /**
+     * 引导语2
+     */
+    private String guidingTwo;
+    /**
+     * 添加时间
+     */
+    private String addTime;
+}

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

@@ -106,6 +106,18 @@ public interface ClubService {
      */
     ResponseJson archiveDeduction(Integer userId, Integer archiveId);
 
+    /**
+     * 优先展示标签 -- 咨询记录 -》 标签记录
+     * @return
+     */
+    ResponseJson<List<String>> getPriorKeyword();
+
+    /**
+     * 查询机构历史填写信息
+     * @param clubId
+     * @return
+     */
+    ResponseJson<Map<String, String>> getHistoryInfo(Integer clubId);
     /**
      * 保存机构资料备注
      *
@@ -277,7 +289,7 @@ public interface ClubService {
 
     ResponseJson findGroups(Integer leaderId);
 
-    ResponseJson getCmRemarksList(String remarks);
+    ResponseJson getCmRemarksList(String remarks, Integer type);
 
     ResponseJson<PaginationVo<ReportVo>> reportRemarks(Integer manager, Integer serviceProviderId, String keyWord, int pageNum, int pageSize);
 
@@ -295,6 +307,8 @@ public interface ClubService {
 
     ResponseJson selTotal(Integer clubId);
 
+    ResponseJson<List<String>> getCustomDemand(Integer clubId, Integer dateType, String startTime, String endTime);
+
     ResponseJson dataList(CmPortraitDto cmPortrait);
 
     ResponseJson<List<BanksVo>> getUserBanks(Integer userId);

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

@@ -1,7 +1,9 @@
 package com.caimei365.user.service;
 
+import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.BehaviorRecordDto;
 import com.caimei365.user.model.dto.RoosInformationDto;
+import com.caimei365.user.model.vo.CmShopPopUpVo;
 
 import java.util.List;
 
@@ -19,11 +21,21 @@ public interface RoosInformationService {
      */
     Boolean boolIsClick(String IP);
 
+    /**
+     * 供应商弹框信息
+     * @param shopId
+     * @param productId
+     * @param infoId
+     * @param keyword
+     * @return
+     */
+    ResponseJson<CmShopPopUpVo> getPopUpInfo(Integer shopId, Integer productId, Integer infoId, String keyword);
+
     /**
      * 插入填写咨询人基本信息
      * @param roosInformationDto
      */
-    void insRoosInformation(RoosInformationDto roosInformationDto);
+    ResponseJson<String> insRoosInformation(RoosInformationDto roosInformationDto);
 
     /**
      * 查看访问者是否浏览过roos相关页面

+ 212 - 2
src/main/java/com/caimei365/user/service/impl/ClubServiceImpl.java

@@ -99,6 +99,64 @@ public class ClubServiceImpl implements ClubService {
             club.setProvinceId(province.getProvinceId());
             club.setProvincialAddress(province.getName() + "" + city.getName() + "" + town.getName());
         }
+        // 机构咨询记录信息
+        ClubRemarksPo remarksInfo = clubMapper.getRemarksInfo(club.getClubId());
+        if (null != remarksInfo) {
+            club.setCommunicationSituation(remarksInfo.getCommunicationSituation());
+            club.setCommunicationMethods(remarksInfo.getCommunicationMethods());
+            club.setCustomerSource(remarksInfo.getCustomerSource());
+            club.setCustomerGender(remarksInfo.getCustomerGender());
+            club.setCustomerAge(remarksInfo.getCustomerAge());
+            club.setGroupAddition(remarksInfo.getGroupAddition());
+        }
+        // 资料完整度
+        Integer number = 0;
+        if (null != club) {
+            // 计算资料完整度
+            if (StringUtils.isNotBlank(club.getName())) {
+                number += 10;
+            }
+            if (StringUtils.isNotBlank(club.getLinkMan())) {
+                number += 10;
+            }
+            if (StringUtils.isNotBlank(club.getContractMobile())) {
+                number += 10;
+            }
+            if (null != club.getLinkManIdentity()) {
+                number += 10;
+            }
+            if (StringUtils.isNotBlank(club.getAddress())) {
+                number += 10;
+            }
+            if (StringUtils.isNotBlank(club.getBusinessLicense())) {
+                number += 10;
+            }
+            if (null != club.getUserIdentity()) {
+                number += 10;
+            }
+            if (StringUtils.isNotBlank(club.getShortName())) {
+                number += 3;
+            }
+            if (StringUtils.isNotBlank(club.getContractEmail())) {
+                number += 5;
+            }
+            if (StringUtils.isNotBlank(club.getContractPhone())) {
+                number += 4;
+            }
+            if (StringUtils.isNotBlank(club.getFax())) {
+                number += 3;
+            }
+            if (StringUtils.isNotBlank(club.getShopPhoto())) {
+                number += 5;
+            }
+            if (StringUtils.isNotBlank(club.getSocialCreditCode())) {
+                number += 5;
+            }
+            if (StringUtils.isNotBlank(club.getProfile())) {
+                number += 5;
+            }
+        }
+        club.setNumber(number);
         Map<String, Object> map = new HashMap(2);
         map.put("user", user);
         map.put("club", club);
@@ -901,6 +959,43 @@ public class ClubServiceImpl implements ClubService {
         return ResponseJson.success("抵扣成功");
     }
 
+    /**
+     * 优先展示标签 -- 咨询记录 -》 标签记录
+     *
+     * @return
+     */
+    @Override
+    public ResponseJson<List<String>> getPriorKeyword() {
+        return ResponseJson.success(clubMapper.getPriorKeywordList());
+    }
+
+    /**
+     * 查询机构历史填写信息
+     *
+     * @param clubId
+     * @return
+     */
+    @Override
+    public ResponseJson<Map<String, String>> getHistoryInfo(Integer clubId) {
+        ClubRemarksPo remarksInfo = clubMapper.getRemarksInfo(clubId);
+        Map<String, String> map = new HashMap<>();
+        if (null != remarksInfo) {
+            if (null != remarksInfo.getCustomerSource()) {
+                map.put("customerSource", remarksInfo.getCustomerSource().toString());
+            }
+            if (null != remarksInfo.getCustomerGender()) {
+                map.put("customerGender", remarksInfo.getCustomerGender().toString());
+            }
+            if (null != remarksInfo.getCustomerAge()) {
+                map.put("customerAge", remarksInfo.getCustomerAge());
+            }
+            if (null != remarksInfo.getGroupAddition()) {
+                map.put("groupAddition", remarksInfo.getGroupAddition().toString());
+            }
+        }
+        return ResponseJson.success(map);
+    }
+
     /**
      * 保存机构资料备注
      *
@@ -933,6 +1028,22 @@ public class ClubServiceImpl implements ClubService {
             String extra = jsonObject.getString("extra");
             Integer productID = jsonObject.getInteger("productId");
             Integer reportID = jsonObject.getInteger("reportId");
+            // 沟通情况
+            Integer communicationSituation = jsonObject.getInteger("communicationSituation");
+            // 沟通方式
+            Integer communicationMethods = jsonObject.getInteger("communicationMethods");
+            /// 客户来源
+            Integer customerSource = jsonObject.getInteger("customerSource");
+            // 客户性别
+            Integer customerGender = jsonObject.getInteger("customerGender");
+            // 客户年龄
+            String customerAge = jsonObject.getString("customerAge");
+            // 加群情况
+            Integer groupAddition = jsonObject.getInteger("groupAddition");
+            // 动态标签
+            String trendsKeyword = jsonObject.getString("trendsKeyword");
+            // 静态标签
+            String stateKeyword = jsonObject.getString("stateKeyword");
             if (null == clubId) {
                 return ResponseJson.error("参数异常,机构id不能为空");
             }
@@ -974,6 +1085,14 @@ public class ClubServiceImpl implements ClubService {
             clubRemarksPo.setExtra(extra);
             clubRemarksPo.setProductID(productID);
             clubRemarksPo.setReportID(reportID);
+            clubRemarksPo.setCommunicationSituation(communicationSituation);
+            clubRemarksPo.setCommunicationMethods(communicationMethods);
+            clubRemarksPo.setCustomerSource(customerSource);
+            clubRemarksPo.setCustomerGender(customerGender);
+            clubRemarksPo.setCustomerAge(customerAge);
+            clubRemarksPo.setGroupAddition(groupAddition);
+            clubRemarksPo.setTrendsKeyword(trendsKeyword);
+            clubRemarksPo.setStateKeyword(stateKeyword);
             if (newRemarks) {
                 // 新增备注
                 clubMapper.insertRemarks(clubRemarksPo);
@@ -1009,6 +1128,40 @@ public class ClubServiceImpl implements ClubService {
             if (newRemarks && pushMessage) {
                 asyncService.sendChoseServiceMessage(2, clubId, serviceProviderId, clubRemarksPo.getRemarksId());
             }
+            //  保存动态标签
+            if (StringUtils.isNotBlank(trendsKeyword)) {
+                if (trendsKeyword.contains(",")) {
+                    String[] split = trendsKeyword.split(",");
+                    for (String keyword : split) {
+                        Integer keywordExist = clubMapper.findKeywordExist(keyword);
+                        if(null == keywordExist) {
+                            clubMapper.insertLabel(keyword, 0);
+                        }
+                    }
+                } else {
+                    Integer keywordExist = clubMapper.findKeywordExist(trendsKeyword);
+                    if(null == keywordExist) {
+                        clubMapper.insertLabel(trendsKeyword, 0);
+                    }
+                }
+            }
+            // 保存静态标签
+            if (StringUtils.isNotBlank(stateKeyword)) {
+                if (stateKeyword.contains(",")) {
+                    String[] split = stateKeyword.split(",");
+                    for (String keyword : split) {
+                        Integer keywordExist = clubMapper.findKeywordExist(keyword);
+                        if(null == keywordExist) {
+                            clubMapper.insertLabel(keyword, 1);
+                        }
+                    }
+                } else {
+                    Integer keywordExist = clubMapper.findKeywordExist(stateKeyword);
+                    if(null == keywordExist) {
+                        clubMapper.insertLabel(stateKeyword, 1);
+                    }
+                }
+            }
             return ResponseJson.success("保存资料备注成功");
         } catch (Exception e) {
             log.info("保存机构资料备注参数:" + jsonParamsDto.toString());
@@ -2082,8 +2235,8 @@ public class ClubServiceImpl implements ClubService {
     }
 
     @Override
-    public ResponseJson getCmRemarksList(String remarks) {
-        List<CmRemarksVo> remarklist = clubMapper.getCmRemarksList(remarks);
+    public ResponseJson getCmRemarksList(String remarks, Integer type) {
+        List<String> remarklist = clubMapper.getCmRemarksList(remarks, type);
         return ResponseJson.success(remarklist);
     }
 
@@ -2161,6 +2314,63 @@ public class ClubServiceImpl implements ClubService {
         return ResponseJson.success(cmPortraitDto);
     }
 
+    /**
+     * 用户需求
+     * @param clubId
+     * @param dateType
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    @Override
+    public ResponseJson<List<String>> getCustomDemand(Integer clubId, Integer dateType, String startTime, String endTime) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = new Date();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DAY_OF_MONTH, -1);
+        Date time = calendar.getTime();
+        endTime = dateFormat.format(time);
+        boolean expty = StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime);
+        if (expty) {
+            Date start = null;
+            // 日期参数为    日
+            if (0 ==  dateType || 1 == dateType) {
+                startTime = endTime;
+            }
+            if (1 == dateType) {
+                calendar.setTime(time);
+                calendar.add(Calendar.MONTH, -1);
+                start = calendar.getTime();
+                startTime = dateFormat.format(start);
+            }
+            if (2 == dateType) {
+                calendar.setTime(time);
+                calendar.add(Calendar.MONTH, -6);
+                start = calendar.getTime();
+                startTime = dateFormat.format(start);
+            }
+            if (3 == dateType) {
+                calendar.setTime(time);
+                calendar.add(Calendar.YEAR, -1);
+                start = calendar.getTime();
+                startTime = dateFormat.format(start);
+            }
+        }
+        // 用户需求
+        List<String> list = new ArrayList<>();
+        List<String> clubRemarksInfo = clubMapper.getClubRemarksInfo(clubId, startTime, endTime);
+        for (String remark : clubRemarksInfo) {
+            if (remark.contains(",")) {
+                String[] split = remark.split(",");
+                list.addAll(Arrays.asList(split));
+            } else {
+                list.add(remark);
+            }
+        }
+        return ResponseJson.success(list);
+    }
+
     @Override
     public ResponseJson dataList(CmPortraitDto cmPortrait) {
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

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

@@ -1,7 +1,9 @@
 package com.caimei365.user.service.impl;
 
 import com.caimei365.user.mapper.RoosInformationMapper;
+import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.RoosInformationDto;
+import com.caimei365.user.model.vo.CmShopPopUpVo;
 import com.caimei365.user.service.RoosInformationService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,18 +51,34 @@ public class RoosInformationServiceImpl implements RoosInformationService {
         return isClick;
     }
 
+    /**
+     * 供应商弹框信息
+     *
+     * @param shopId
+     * @param productId
+     * @param infoId
+     * @param keyword
+     * @return
+     */
+    @Override
+    public ResponseJson<CmShopPopUpVo> getPopUpInfo(Integer shopId, Integer productId, Integer infoId, String keyword) {
+        CmShopPopUpVo shopPop = roosInformationMapper.getShopPop(shopId, productId, infoId, keyword);
+        return ResponseJson.success(shopPop);
+    }
+
     /**
      * 插入填写咨询人基本信息
      *
      * @param roosInformationDto
      */
     @Override
-    public void insRoosInformation(RoosInformationDto roosInformationDto) {
+    public ResponseJson<String> insRoosInformation(RoosInformationDto roosInformationDto) {
         // 设置创建时间
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String format = simpleDateFormat.format(new Date());
         roosInformationDto.setCreateTime(format);
         roosInformationMapper.insRoosInformation(roosInformationDto);
+        return ResponseJson.success("咨询信息插入成功");
     }
 
     /**

+ 70 - 19
src/main/resources/mapper/ClubMapper.xml

@@ -4,9 +4,11 @@
     <insert id="insertRemarks" parameterType="com.caimei365.user.model.po.ClubRemarksPo" keyProperty="remarksId"
             useGeneratedKeys="true">
         insert into cm_club_remarks(clubId, serviceProviderId, remarks, addTime, questionMan, consultType, clubType,
-                                    pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID, reportID)
+                                    pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID, reportID,
+                                    communicationSituation, communicationMethods, customerSource, customerGender, customerAge, groupAddition)
         values (#{clubId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{consult}, #{clubType},
-                #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{serviceProviderId}, #{productID}, #{reportID})
+                #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{serviceProviderId}, #{productID}, #{reportID},
+                #{communicationSituation}, #{communicationMethods},#{customerSource},#{customerGender},#{customerAge},#{groupAddition} )
     </insert>
     <insert id="insertRemarksImage">
         insert into cm_club_remarks_file(remarksId, fileType, imageUrl)
@@ -239,9 +241,10 @@
                addTime,
                status,
                lastCheckOrderDate,
-               newDeal                   as newDeal
-
-        from club
+               newDeal                   as newDeal,
+                (select activeState from cm_organ_value_system where stage = 0 and delType = 1 and userId = c.userId) as activeState,
+                (select customerValue from cm_organ_value_system where stage = 0 and delType = 1 and userId = c.userId) as customerValue
+        from club c
         where clubID = #{clubId}
     </select>
     <!--    <select id="getOrderCount" resultType="com.caimei365.user.model.vo.OrderCountVo">-->
@@ -299,16 +302,22 @@
     </update>
     <update id="updateRemarks">
         update cm_club_remarks
-        set remarks      = #{remarks},
-            questionMan  = #{questionMan},
-            consultType  = #{consult},
-            clubType=#{clubType},
-            pinceSensitve=#{pinceSensitve},
-            satisfied=#{satisfied},
-            followup=#{followup},
-            extra=#{extra},
-            productID=#{productID},
-            reportID=#{reportID}
+        set remarks         = #{remarks},
+            questionMan     = #{questionMan},
+            consultType     = #{consult},
+            clubType        = #{clubType},
+            pinceSensitve   = #{pinceSensitve},
+            satisfied       = #{satisfied},
+            followup        = #{followup},
+            extra           = #{extra},
+            productID       = #{productID},
+            reportID        = #{reportID},
+            communicationSituation  = #{communicationSituation},
+            communicationMethods    = #{communicationMethods},
+            customerSource          = #{customerSource},
+            customerGender          = #{customerGender},
+            customerAge             = #{customerAge},
+            groupAddition           = #{groupAddition}
         where id = #{remarksId}
     </update>
     <update id="updateQuestionMan">
@@ -471,6 +480,33 @@
         where remarksId = #{remarksId}
           and fileType = 2
     </select>
+
+    <select id="getRemarksInfo" resultType="com.caimei365.user.model.po.ClubRemarksPo">
+        select communicationSituation, communicationMethods, customerSource, customerGender, groupAddition, customerAge
+        from cm_club_remarks where clubId = #{clubId} order by addTime desc limit 1
+    </select>
+
+    <select id="getPriorKeywordList" resultType="java.lang.String">
+        select cusf.keyword as keyword
+        from cm_prior_keyword cpk
+        left join cm_user_search_frequency cusf on cpk.searchId = cusf.id
+        WHERE cpk.delFlag = 0 AND cusf.delStatus = 1
+        order by cpk.addTime desc
+    </select>
+
+    <select id="findKeywordExist" resultType="java.lang.Integer">
+        select id
+        from cm_user_search_frequency
+        where keyword = #{keyword}
+          and delstatus = 1
+    </select>
+
+    <insert id="insertLabel">
+        insert into cm_user_search_frequency(fromSearch, keyword, frequency, trueStatus, dynamicStatus, addTime)
+        values (4, #{keyword}, 0, 0, #{dynamicStatus}, now())
+    </insert>
+
+
     <select id="getAfterSale" resultType="com.caimei365.user.model.vo.AfterSaleVo">
         SELECT id,
                organizeName,
@@ -879,10 +915,13 @@
                  LEFT JOIN serviceprovider s ON s.serviceProviderId = csr.leaderId
         WHERE s.serviceProviderID = #{serviceProviderId}
     </select>
-    <select id="getCmRemarksList" resultType="com.caimei365.user.model.vo.CmRemarksVo">
-        SELECT remarks
-        FROM cm_remarks csr
-        WHERE remarks like concat('%', #{remarks}, '%')
+
+    <select id="getCmRemarksList" resultType="java.lang.String">
+        SELECT keyword
+        FROM cm_user_search_frequency
+        WHERE keyword like concat('%', #{keyword}, '%')
+        and dynamicStatus = #{type}
+        and delStatus = 1
         order by addtime DESC
     </select>
 
@@ -1040,6 +1079,18 @@
           AND b.accessDate = #{accessDate}
         order by b.accessTime desc
     </select>
+
+    <select id="getClubRemarksInfo" resultType="java.lang.String">
+        SELECT remarks FROM cm_club_remarks
+        WHERE clubId = #{clubId}
+        <if test="startTime != null and startTime != ''">
+            and addTime <![CDATA[ >= ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            and addTime <![CDATA[ <= ]]> #{endTime}
+        </if>
+    </select>
+
     <select id="selOrderList" resultType="com.caimei365.user.model.po.NewOrderPo">
         SELECT
         (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,

+ 41 - 0
src/main/resources/mapper/RoosInformationMapper.xml

@@ -8,10 +8,50 @@
             </where>
     </select>
 
+    <select id="getShopPop" resultType="com.caimei365.user.model.vo.CmShopPopUpVo">
+        SELECT
+          csp.id,
+          csp.shopId,
+          csp.image,
+          csp.guidingOne,
+          csp.guidingTwo,
+          csp.addTime
+        FROM cm_shop_popUp csp
+        <if test="productId != null">
+            LEFT JOIN product p ON p.shopId = csp.shopId
+        </if>
+         <if test="infoId != null">
+            LEFT JOIN cm_shop_info csi ON csi.shopId = csp.shopId
+         </if>
+        <if test="keyword != null and keyword != ''">
+            LEFT JOIN cm_shop_keyword csk ON csk.shopId = csp.shopId
+            left join cm_user_search_frequency cusf on cusf.id = csk.searchId
+        </if>
+        <where>
+            csp.status = 0
+            <if test="shopId != null">
+                and csp.shopId = #{shopId}
+            </if>
+            <if test="productId != null">
+                and s.productId = #{productId}
+            </if>
+            <if test="infoId != null">
+                and csi.status = 0
+                and csi.id = #{infoId}
+            </if>
+            <if test="keyword != null and keyword != ''">
+                and csk.status = 0
+                and cusf.keyword like concat('%',#{keyword},'%')
+            </if>
+        </where>
+        limit 1
+    </select>
+
     <insert id="insRoosInformation">
         INSERT INTO cm_roos_information
             (
              IP,
+             shopId,
              <if test="consultName != null and consultName != ''">
                  consultName,
              </if>
@@ -23,6 +63,7 @@
              )
         VALUES(
                #{ip},
+               #{shopId},
                <if test="consultName != null and consultName != ''">
                 #{consultName},
                </if>