huangzhiguo 1 rok temu
rodzic
commit
2c4973b65e

+ 2 - 8
src/main/java/com/caimei365/manager/controller/caimei/user/CmClubRemarksApi.java

@@ -49,8 +49,8 @@ public class CmClubRemarksApi {
      * @return
      */
     @GetMapping("/getServiceList")
-    public ResponseJson<Map<String, Object>> getServiceList(String accessDate) {
-        return cmClubRemarksService.getServiceList(accessDate);
+    public ResponseJson<Map<String, Object>> getServiceList(String startTime, String endTime) {
+        return cmClubRemarksService.getServiceList(startTime, endTime);
     }
 
     /**
@@ -66,12 +66,6 @@ public class CmClubRemarksApi {
         if (null == cmClubRemarks)  {
             return ResponseJson.error(-1, "参数为空", null);
         }
-        if (null == cmClubRemarks.getServiceProviderId())  {
-            return ResponseJson.error(-1, "协销Id为空", null);
-        }
-        if (null == cmClubRemarks.getTodayTime())  {
-            return ResponseJson.error(-1, "咨询记录时间为空", null);
-        }
         return cmClubRemarksService.findRegistList(cmClubRemarks, pageNum, pageSize);
     }
 

+ 128 - 2
src/main/java/com/caimei365/manager/controller/caimei/user/CustomerApi.java

@@ -1,5 +1,7 @@
 package com.caimei365.manager.controller.caimei.user;
 
+import com.caimei365.manager.config.security.ConstantKey;
+import com.caimei365.manager.config.security.JwtService;
 import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
 import com.caimei365.manager.entity.caimei.CmShop;
@@ -10,6 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * Description
  *
@@ -21,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
 public class CustomerApi {
 
     @Autowired private CustomerService customerService;
+    @Resource private JwtService jwtService;
 
     /**
      * 潜客收集供应商列表
@@ -99,17 +105,52 @@ public class CustomerApi {
      * 设置跟进状态
      * @param id
      * @param followUpStatus
+     * @param serviceProviderId
      * @return
      */
     @GetMapping("/renewFollowUpStatus")
-    public ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus) {
+    public ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus, Integer serviceProviderId) {
         if (null == id) {
             return ResponseJson.error(-1, "id不能为空", null);
         }
         if (null == followUpStatus) {
             return ResponseJson.error(-1, "状态不能为空", null);
         }
-        return customerService.renewFollowUpStatus(id, followUpStatus);
+        return customerService.renewFollowUpStatus(id, followUpStatus, serviceProviderId);
+    }
+
+    /**
+     * 添加游客备注
+     * @param request
+     * @param cmInformationNotes
+     * @return
+     */
+    @PostMapping("/saveInformation")
+    public ResponseJson saveInformationNotes(HttpServletRequest request, CmInformationNotes cmInformationNotes) {
+        if (null == cmInformationNotes.getInformationId()) {
+            return ResponseJson.error(-1, "游客Id不能为空", null);
+        }
+        String token = request.getHeader(ConstantKey.TOKEN_NAME);
+        String username = jwtService.getUsername(token);
+        cmInformationNotes.setNoteUser(username);
+        return customerService.saveInformationNotes(cmInformationNotes);
+    }
+
+    /**
+     * 获取游客备注信息
+     * @param informationId
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/getInformationNoteList")
+    public ResponseJson<PaginationVo<CmInformationNotes>> getInformationNotes(Integer informationId,
+                                                                              @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                              @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
+        if (null == informationId) {
+            return ResponseJson.error(-1, "游客Id不能为空", null);
+        }
+        return customerService.getInformationNotes(informationId, pageNum, pageSize);
     }
 
     /**
@@ -451,4 +492,89 @@ public class CustomerApi {
         }
         return customerService.getPageShopKeyword(shopId, startTime, endTime, pageNum, pageSize);
     }
+
+    /**
+     * 意向数据列表
+     * @param shopId
+     * @param startTime
+     * @param endTime
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/getIntentionUserList")
+    public ResponseJson<PaginationVo<CmShopIntentionUser>> getIntentionUserList(Integer shopId, String startTime, String endTime,
+                                                                    @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                    @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
+        if (null == shopId) {
+            return ResponseJson.error(-1, "供应商Id不能为空", null);
+        }
+        return customerService.getIntentionUserList(shopId, startTime, endTime, pageNum, pageSize);
+    }
+
+    /**
+     * 保存意向客户数据
+     * @param cmShopIntentionUser
+     * @return
+     */
+    @PostMapping("/saveIntentionUser")
+    public ResponseJson saveIntentionUser(CmShopIntentionUser cmShopIntentionUser) {
+        if (null == cmShopIntentionUser.getShopId()) {
+            return ResponseJson.error(-1, "供应商Id不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getStartTime()) {
+            return ResponseJson.error(-1, "统计开始时间不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getEndTime()) {
+            return ResponseJson.error(-1, "统计结束时间不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getAppReadingVolume()) {
+            return ResponseJson.error(-1, "公众号阅读量不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getRedReadingVolume()) {
+            return ResponseJson.error(-1, "小红书阅读量不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getWbReadingVolume()) {
+            return ResponseJson.error(-1, "微博阅读量不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getOtherReadingVolume()) {
+            return ResponseJson.error(-1, "其他渠道阅读量不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getIntentionStrong()) {
+            return ResponseJson.error(-1, "意向强烈人数不能为空", null);
+        }
+        if (null == cmShopIntentionUser.getIntentionOrdinary()) {
+            return ResponseJson.error(-1, "意向普通人数不能为空", null);
+        }
+        return customerService.saveIntentionUser(cmShopIntentionUser);
+    }
+
+    /**
+     * 删除意向客户数据
+     * @param id
+     * @return
+     */
+    @GetMapping("/renewIntentionUser")
+    public ResponseJson renewIntentionUser(Integer id) {
+        if (null == id) {
+            return ResponseJson.error(-1, "id不能为空", null);
+        }
+        return customerService.renewIntentionUser(id);
+    }
+
+    /**
+     * 添加意向客户数据总结
+     * @param id
+     * @return
+     */
+    @GetMapping("/renewIntentionNote")
+    public ResponseJson renewIntentionNote(Integer id, String note) {
+        if (null == id) {
+            return ResponseJson.error(-1, "意向客户数据id不能为空", null);
+        }
+        if (StringUtils.isBlank(note)) {
+            return ResponseJson.error(-1, "意向客户数据总结不能为空", null);
+        }
+        return customerService.renewIntentionNote(id, note);
+    }
 }

+ 2 - 2
src/main/java/com/caimei365/manager/dao/user/CmClubRemarksDao.java

@@ -26,14 +26,14 @@ public interface CmClubRemarksDao {
      * @param serviceProviderId
      * @return
      */
-    Integer getRegisteredNumber(@Param("serviceProviderId") Integer serviceProviderId,@Param("addTime") String addTime);
+    Integer getRegisteredNumber(@Param("serviceProviderId") Integer serviceProviderId,@Param("startTime") String startTime,@Param("endTime") String endTime);
 
     /**
      * 协销未注册用户数
      * @param serviceProviderId
      * @return
      */
-    Integer getUnregisteredNumber(@Param("serviceProviderId") Integer serviceProviderId, @Param("addTime") String addTime);
+    Integer getUnregisteredNumber(@Param("serviceProviderId") Integer serviceProviderId, @Param("startTime") String startTime,@Param("endTime") String endTime);
 
     /**
      * 咨询记录类别

+ 49 - 1
src/main/java/com/caimei365/manager/dao/user/CustomerServiceDao.java

@@ -60,7 +60,20 @@ public interface CustomerServiceDao {
      * @param id
      * @param followUpStatus
      */
-    void updateInformation(@Param("id") Integer id, @Param("followUpStatus") Integer followUpStatus);
+    void updateInformation(@Param("id") Integer id, @Param("followUpStatus") Integer followUpStatus, @Param("serviceProviderId") Integer serviceProviderId);
+
+    /**
+     * 添加游客备注
+     * @param cmInformationNotes
+     */
+    void insertInformationNote(CmInformationNotes cmInformationNotes);
+
+    /**
+     * 查询游客备注
+     * @param informationId
+     * @return
+     */
+    List<CmInformationNotes> getInformationNotes(@Param("informationId") Integer informationId);
 
     /**
      * 相关文章列表
@@ -234,4 +247,39 @@ public interface CustomerServiceDao {
      * @return
      */
     List<CmPageShopKeyword> getPageShopKeyword(@Param("shopId") Integer shopId, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    /**
+     * 意向客户数据列表
+     * @param shopId
+     * @param startTime
+     * @param endTIme
+     * @return
+     */
+    List<CmShopIntentionUser> getIntentionUserList(@Param("shopId") Integer shopId, @Param("startTime") String startTime, @Param("endTime") String endTIme);
+
+    /**
+     * 插入意向客户数据
+     * @param cmShopIntentionUser
+     */
+    void insertIntention(CmShopIntentionUser cmShopIntentionUser);
+
+    /**
+     * 修改意向客户数据
+     * @param cmShopIntentionUser
+     */
+    void updateIntention(CmShopIntentionUser cmShopIntentionUser);
+
+    /**
+     * 删除意向客户数据
+     * @param id
+     */
+    void deleteIntentionUser(@Param("id") Integer id);
+
+    /**
+     * 数据总结
+     * @param id
+     * @param note
+     */
+    void updateIntentionNote(@Param("id") Integer id, @Param("note") String note);
+
 }

+ 0 - 2
src/main/java/com/caimei365/manager/entity/caimei/cmUser/CmClubRemarks.java

@@ -82,8 +82,6 @@ public class CmClubRemarks {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date addTime;
 
-    private String todayTime;
-
     private String startAddTime;
 
 

+ 30 - 0
src/main/java/com/caimei365/manager/entity/caimei/cmUser/CmInformationNotes.java

@@ -0,0 +1,30 @@
+package com.caimei365.manager.entity.caimei.cmUser;
+
+import lombok.Data;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/10/31
+ */
+@Data
+public class CmInformationNotes {
+    private Integer id;
+    /**
+     * 游客统计Id
+     */
+    private Integer informationId;
+    /**
+     * 备注
+     */
+    private String note;
+    /**
+     * 备注人
+     */
+    private String noteUser;
+    /**
+     * 添加时间
+     */
+    private Integer addTime;
+}

+ 65 - 0
src/main/java/com/caimei365/manager/entity/caimei/cmUser/CmShopIntentionUser.java

@@ -0,0 +1,65 @@
+package com.caimei365.manager.entity.caimei.cmUser;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/10/30
+ */
+@Data
+public class CmShopIntentionUser {
+    private Integer id;
+    /**
+     * 供应商Id
+     */
+    private Integer shopId;
+    /**
+     * 统计开始时间
+     */
+    private Date startTime;
+    /**
+     * 统计结束时间
+     */
+    private Date endTime;
+    /**
+     * 公众号阅读量
+     */
+    private Integer appReadingVolume;
+    /**
+     * 小红书阅读量
+     */
+    private Integer redReadingVolume;
+    /**
+     * 微博阅读量
+     */
+    private Integer wbReadingVolume;
+    /**
+     * 其他渠道阅读量
+     */
+    private Integer otherReadingVolume;
+    /**
+     * 意向强烈人数
+     */
+    private Integer intentionStrong;
+    /**
+     * 意向普通人数
+     */
+    private Integer intentionOrdinary;
+    /**
+     * 总结
+     */
+    private String note;
+    /**
+     * 添加时间
+     */
+    private Integer addTime;
+    /**
+     * 删除标志 0:未删除、1:已删除
+     */
+    private Integer delFlag;
+
+}

+ 3 - 2
src/main/java/com/caimei365/manager/service/caimei/user/CmClubRemarksService.java

@@ -27,10 +27,11 @@ public interface CmClubRemarksService {
     ResponseJson<List<CmConsulttype>> getClassName();
     /**
      * 获取当天协销咨询记录信息
-     * @param time
+     * @param startTime
+     * @param endTime
      * @return
      */
-    ResponseJson<Map<String, Object>> getServiceList(String time);
+    ResponseJson<Map<String, Object>> getServiceList(String startTime, String endTime);
     /**
      * 已注册用户咨询记录
      * @param cmClubRemarks

+ 48 - 1
src/main/java/com/caimei365/manager/service/caimei/user/CustomerService.java

@@ -57,7 +57,21 @@ public interface CustomerService {
      * @param followUpStatus
      * @return
      */
-    ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus);
+    ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus, Integer serviceProviderId);
+
+    /**
+     * 添加游客备注
+     * @param cmInformationNotes
+     * @return
+     */
+    ResponseJson saveInformationNotes(CmInformationNotes cmInformationNotes);
+
+    /**
+     * 获取游客备注信息
+     * @param informationId
+     * @return
+     */
+    ResponseJson<PaginationVo<CmInformationNotes>> getInformationNotes(Integer informationId, int pageNum, int pageSize);
 
     /**
      * 相关文章列表
@@ -231,4 +245,37 @@ public interface CustomerService {
      * @return
      */
     ResponseJson<PaginationVo<CmPageShopKeyword>> getPageShopKeyword(Integer shopId, String startTime, String endTime, Integer pageNum, Integer pageSize);
+
+    /**
+     * 意向客户数据列表
+     * @param shopId
+     * @param startTime
+     * @param endTime
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    ResponseJson<PaginationVo<CmShopIntentionUser>> getIntentionUserList(Integer shopId, String startTime, String endTime, int pageNum, int pageSize);
+
+    /**
+     * 保存意向客户数据
+     * @param cmShopIntentionUser
+     * @return
+     */
+    ResponseJson saveIntentionUser(CmShopIntentionUser cmShopIntentionUser);
+
+    /**
+     * 删除意向客户数据
+     * @param id
+     * @return
+     */
+    ResponseJson renewIntentionUser(Integer id);
+
+    /**
+     * 添加意向客户数据总结
+     * @param id
+     * @param note
+     * @return
+     */
+    ResponseJson renewIntentionNote(Integer id, String note);
 }

+ 26 - 9
src/main/java/com/caimei365/manager/service/caimei/user/impl/CmClubRemarksServiceImpl.java

@@ -23,6 +23,8 @@ import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * Description
@@ -50,32 +52,47 @@ public class CmClubRemarksServiceImpl implements CmClubRemarksService {
 
     /**
      * 获取当天协销咨询记录信息
-     * @param time
+     * @param startTime
+     * @param endTime
      * @return
      */
     @Override
-    public ResponseJson<Map<String, Object>> getServiceList(String time) {
+    public ResponseJson<Map<String, Object>> getServiceList(String startTime, String endTime) {
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        if (StringUtils.isBlank(time)) {
-            time = dateFormat.format(new Date());
+        // 格式时间
+        try {
+            Date startDate = dateFormat.parse(startTime);
+            Date endDate = dateFormat.parse(endTime);
+            startTime = dateFormat.format(startDate) + "00:00:00";
+            endTime = dateFormat.format(endDate) + "23:59:59";
+        } catch ( Exception e ) {
+            e.printStackTrace();
         }
         // 协销数据
         List<ServiceProviderModel> serviceList = cmClubRemarksDao.getServiceList();
+        // 注册咨询记录总数
         AtomicInteger registeredNumber = new AtomicInteger(0);
+        // 未注册咨询记录总数
         AtomicInteger unRegisteredNumber = new AtomicInteger(0);
         for (ServiceProviderModel s : serviceList){
             // 已注册用户咨询记录
-            s.setRegisteredNumber(cmClubRemarksDao.getRegisteredNumber(s.getServiceProviderId(), time));
+            s.setRegisteredNumber(cmClubRemarksDao.getRegisteredNumber(s.getServiceProviderId(), startTime, endTime));
             // 未注册用户咨询记录
-            s.setUnregisteredNumber(cmClubRemarksDao.getUnregisteredNumber(s.getServiceProviderId(), time));
+            s.setUnregisteredNumber(cmClubRemarksDao.getUnregisteredNumber(s.getServiceProviderId(), startTime, endTime));
             registeredNumber.set(MathUtil.add(registeredNumber.get(), s.getRegisteredNumber()).intValue());
             unRegisteredNumber.set(MathUtil.add(unRegisteredNumber.get(), s.getUnregisteredNumber()).intValue());
         }
+        // 全部协销的数据
+        ServiceProviderModel service = new ServiceProviderModel();
+        service.setRegisteredNumber(registeredNumber.get());
+        service.setUnregisteredNumber(unRegisteredNumber.get());
+        // 在首位加入总数数据
+        serviceList.add(0, service);
         Map<String, Object> map = new HashMap<>();
         map.put("serviceList", serviceList);
-        map.put("registeredNumber", registeredNumber);
-        map.put("unRegisteredNumber", unRegisteredNumber);
-        map.put("number", MathUtil.add(registeredNumber, unRegisteredNumber).intValue());
+        map.put("registeredNumber", registeredNumber.get());
+        map.put("unRegisteredNumber", unRegisteredNumber.get());
+        map.put("number", MathUtil.add(registeredNumber.get(), unRegisteredNumber.get()).intValue());
         return ResponseJson.success(map);
     }
 

+ 92 - 2
src/main/java/com/caimei365/manager/service/caimei/user/impl/CustomerServiceImpl.java

@@ -2,6 +2,7 @@ package com.caimei365.manager.service.caimei.user.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.caimei365.manager.config.security.JwtLoginFilter;
 import com.caimei365.manager.dao.user.CustomerServiceDao;
 import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
@@ -129,11 +130,39 @@ public class CustomerServiceImpl implements CustomerService {
      * @return
      */
     @Override
-    public ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus) {
-        customerServiceDao.updateInformation(id, followUpStatus);
+    public ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus, Integer serviceProviderId) {
+        customerServiceDao.updateInformation(id, followUpStatus, serviceProviderId);
         return ResponseJson.success();
     }
 
+    /**
+     * 添加游客备注
+     *
+     * @param cmInformationNotes
+     * @return
+     */
+    @Override
+    public ResponseJson saveInformationNotes(CmInformationNotes cmInformationNotes) {
+        customerServiceDao.insertInformationNote(cmInformationNotes);
+        return ResponseJson.success();
+    }
+
+    /**
+     * 获取游客备注信息
+     *
+     * @param informationId
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @Override
+    public ResponseJson<PaginationVo<CmInformationNotes>> getInformationNotes(Integer informationId, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<CmInformationNotes> informationNotes = customerServiceDao.getInformationNotes(informationId);
+        PaginationVo<CmInformationNotes> page = new PaginationVo<>(informationNotes);
+        return ResponseJson.success(page);
+    }
+
     /**
      * 相关文章列表
      *
@@ -536,6 +565,67 @@ public class CustomerServiceImpl implements CustomerService {
         return ResponseJson.success(page);
     }
 
+    /**
+     * 意向客户数据列表
+     *
+     * @param shopId
+     * @param startTime
+     * @param endTime
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @Override
+    public ResponseJson<PaginationVo<CmShopIntentionUser>> getIntentionUserList(Integer shopId, String startTime, String endTime, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<CmShopIntentionUser> shopIntentionUserList = customerServiceDao.getIntentionUserList(shopId, startTime, endTime);
+        PaginationVo<CmShopIntentionUser> page = new PaginationVo<>(shopIntentionUserList);
+        return ResponseJson.success(page);
+    }
+
+    /**
+     * 保存意向客户数据
+     *
+     * @param cmShopIntentionUser
+     * @return
+     */
+    @Override
+    public ResponseJson saveIntentionUser(CmShopIntentionUser cmShopIntentionUser) {
+        if (null == cmShopIntentionUser.getId()) {
+            // 修改
+            customerServiceDao.updateIntention(cmShopIntentionUser);
+        } else {
+            // 新增
+            customerServiceDao.insertIntention(cmShopIntentionUser);
+        }
+        return ResponseJson.success();
+    }
+
+    /**
+     * 删除意向客户数据
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public ResponseJson renewIntentionUser(Integer id) {
+        customerServiceDao.deleteIntentionUser(id);
+        return ResponseJson.success();
+    }
+
+    /**
+     * 添加意向客户数据总结
+     *
+     * @param id
+     * @param note
+     * @return
+     */
+    @Override
+    public ResponseJson renewIntentionNote(Integer id, String note) {
+        customerServiceDao.updateIntentionNote(id, note);
+        return ResponseJson.success();
+    }
+
 
     /**
      * 时间计算

+ 42 - 13
src/main/resources/mapper/user/CmClubRemarksDao.xml

@@ -19,13 +19,48 @@
 
     <select id="getRegisteredNumber" resultType="java.lang.Integer">
         SELECT
-                (SELECT COUNT(id) FROM cm_club_remarks WHERE createServiceProviderId = #{serviceProviderId} and addTime LIKE concat('%',#{addTime},'%') AND clubId IS NOT NULL)
-                    + (SELECT COUNT(id) FROM cm_visitor_remarks WHERE serviceProviderId = #{serviceProviderId} AND addTime LIKE concat('%',#{addTime},'%') AND clubId IS NOT NULL)
+            (SELECT COUNT(id) FROM cm_club_remarks
+                WHERE clubId IS NOT NULL
+                <if test="serviceProviderId != null">
+                    and createServiceProviderId = #{serviceProviderId}
+                </if>
+              and (<if test="startTime != null and startTime != ''">
+                        ADDTIME <![CDATA[ >= ]]> #{startTime}
+                   </if>
+                   <if test="endTime != null and endTime != ''">
+                        AND ADDTIME <![CDATA[ <= ]]> #{endTime})
+                   </if>
+                  )
+                +
+            (SELECT COUNT(id) FROM cm_visitor_remarks
+                    WHERE clubId IS NOT NULL
+                    <if test="serviceProviderId!= null">
+                        and serviceProviderId = #{serviceProviderId}
+                    </if>
+                    and (<if test="startTime != null and startTime != ''">
+                            ADDTIME <![CDATA[ >= ]]> #{startTime}
+                        </if>
+                        <if test="endTime != null and endTime != ''">
+                            AND ADDTIME <![CDATA[ <= ]]> #{endTime})
+                        </if>)
+            )
     </select>
 
     <select id="getUnregisteredNumber" resultType="java.lang.Integer">
         SELECT
-                (SELECT COUNT(id) FROM cm_visitor_remarks WHERE serviceProviderId = #{serviceProviderId} and addTime LIKE concat('%',#{addTime},'%') AND clubId IS NULL)
+            (SELECT COUNT(id) FROM cm_visitor_remarks
+                WHERE clubId IS NULL
+                <if test="serviceProviderId != null">
+                    and serviceProviderId = #{serviceProviderId}
+                </if>
+                and (<if test="startTime != null and startTime != ''">
+                        ADDTIME <![CDATA[ >= ]]> #{startTime}
+                    </if>
+                    <if test="endTime != null and endTime != ''">
+                            AND ADDTIME <![CDATA[ <= ]]> #{endTime}
+                    </if>
+                    )
+            )
     </select>
 
     <select id="getClassName" resultType="com.caimei365.manager.entity.caimei.cmUser.CmConsulttype">
@@ -72,14 +107,11 @@
             <if test="consult != null">
                 and ccr.consultType like concat('%',#{consult},'%')
             </if>
-            <if test="todayTime != null and todayTime != ''">
-                and ccr.addTime like concat('%', #{todayTime}, '%')
-            </if>
             <if test="startAddTime != '' and startAddTime != null">
-                and ccr.addTime <![CDATA[  >  ]]> #{startAddTime}
+                and ccr.addTime <![CDATA[  >=  ]]> #{startAddTime}
             </if>
             <if test="endAddTime != '' and endAddTime != null">
-                and ccr.addTime <![CDATA[  <  ]]> #{endAddTime}
+                and ccr.addTime <![CDATA[  <=  ]]> #{endAddTime}
             </if>
             <if test="newDeal !=null">
                 and c.newDeal=#{newDeal}
@@ -137,14 +169,11 @@
             <if test="consult != null">
                 and ccr.consultType like concat('%',#{consult},'%')
             </if>
-            <if test="todayTime != null and todayTime != ''">
-                and ccr.addTime like concat('%', #{todayTime}, '%')
-            </if>
             <if test="startAddTime != '' and startAddTime != null">
-                and ccr.addTime <![CDATA[  >  ]]> #{startAddTime}
+                and ccr.addTime <![CDATA[  >=  ]]> #{startAddTime}
             </if>
             <if test="endAddTime != '' and endAddTime != null">
-                and ccr.addTime <![CDATA[  <  ]]> #{endAddTime}
+                and ccr.addTime <![CDATA[  <=  ]]> #{endAddTime}
             </if>
             <if test="newDeal !=null">
                 and c.newDeal=#{newDeal}

+ 99 - 0
src/main/resources/mapper/user/CustomerServiceDao.xml

@@ -82,9 +82,28 @@
     <select id="updateInformation">
         update cm_roos_information
         set followUpStatus = #{followUpStatus}
+        <if test="serviceProviderId != null">
+            , serviceProviderId = #{serviceProviderId}
+        </if>
         where id = #{id}
     </select>
 
+    <insert id="insertInformationNote">
+        insert into cm_information_notes(informationId, note, noteUser, addTime)
+        values (#{informationId}, #{note}, #{noteUser}, now())
+    </insert>
+
+    <select id="getInformationNotes" resultType="com.caimei365.manager.entity.caimei.cmUser.CmInformationNotes">
+        select
+            id,
+            informationId,
+            note,
+            noteUser,
+            addTime
+        from cm_information_notes
+        where informationId = #{informationId}
+    </select>
+
     <select id="getShopInfoList" resultType="com.caimei365.manager.entity.caimei.cmUser.CmShopInfo">
         SELECT
             csi.id,
@@ -368,4 +387,84 @@
         </if>
         group by cpsk.searchId
     </select>
+
+    <select id="getIntentionUserList" resultType="com.caimei365.manager.entity.caimei.cmUser.CmShopIntentionUser">
+        select
+            id,
+            shopId,
+            startTime,
+            endTime,
+            appReadingVolume,
+            redReadingVolume,
+            wbReadingVolume,
+            otherReadingVolume,
+            intentionStrong,
+            intentionOrdinary,
+            addTime,
+            delFlag
+        from cm_shop_intention_user
+        <where>
+            shopId = #{shopId}
+            <if test="startTime != null and startTime != ''">
+                and startTime <![CDATA[ >= ]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and endTime <![CDATA[ <= ]]> #{endTime}
+            </if>
+        </where>
+    </select>
+
+    <insert id="insertIntention">
+        insert into cm_shop_intention_user(
+            shopId,
+            startTime,
+            endTime,
+            appReadingVolume,
+            redReadingVolume,
+            wbReadingVolume,
+            otherReadingVolume,
+            intentionStrong,
+            intentionOrdinary,
+            addTime,
+            delFlag
+            ) values (
+                 #{shopId},
+                 #{startTime},
+                 #{endTime},
+                 #{appReadingVolume},
+                 #{redReadingVolume},
+                 #{wbReadingVolume},
+                 #{otherReadingVolume},
+                 #{intentionStrong},
+                 #{intentionOrdinary},
+                 now(),
+                 0
+            )
+    </insert>
+
+    <update id="updateIntention">
+        update cm_shop_intention_user
+            set startTime   = #{startTime},
+            endTime = #{endTime},
+            appReadingVolume    = #{appReadingVolume},
+            redReadingVolume    = #{redReadingVolume},
+            wbReadingVolume     = #{wbReadingVolume},
+            otherReadingVolume  = #{otherReadingVolume},
+            intentionStrong     = #{intentionStrong},
+            intentionOrdinary   = #{intentionOrdinary}
+        where id = #{id}
+    </update>
+
+    <update id="deleteIntentionUser">
+        update cm_shop_intention_user
+        set delFlag = 1
+        where id = #{id}
+    </update>
+
+    <insert id="updateIntentionNote">
+        update cm_shop_intention_user
+        set note = #{note}
+        where id = #{id}
+    </insert>
+
 </mapper>