jinshihui 9 maanden geleden
bovenliggende
commit
245a75cf77

+ 47 - 0
linkwe-chinacoal/src/main/java/com/linkwechat/coal/modules/xxxt/system/controller/CustomerLeadsController.java

@@ -1,5 +1,7 @@
 package com.linkwechat.coal.modules.xxxt.system.controller;
 
+import com.linkwechat.coal.modules.xxxt.system.domain.vo.CustomerLeadsDetailsVo;
+import com.linkwechat.coal.modules.xxxt.system.domain.vo.CustomerLeadsFeedbackVo;
 import com.linkwechat.coal.modules.xxxt.system.service.ICustomerLeadsService;
 import com.linkwechat.common.annotation.Log;
 import com.linkwechat.common.core.controller.BaseController;
@@ -9,11 +11,13 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import com.linkwechat.common.core.page.TableDataInfo;
 import com.linkwechat.coal.modules.xxxt.system.domain.query.CustomerLeadsQuery;
@@ -80,6 +84,49 @@ public class CustomerLeadsController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询客户线索详情
+     *
+     * @param userId
+     * @return AjaxResult<CustomerLeadsDetailsVo>
+     */
+     @ApiOperation(value = "查询客户线索详情", notes = "根据用户ID查询客户线索详情")
+    @GetMapping("/detail")
+    public AjaxResult<CustomerLeadsDetailsVo> detail(@ApiParam(value = "用户ID", required = true) @RequestParam Long userId) {
+        try {
+            CustomerLeads customerLeads = customerLeadsService.getById(userId);
+            if (customerLeads == null) {
+                return AjaxResult.error("客户线索不存在");
+            }
+            CustomerLeadsDetailsVo vo = new CustomerLeadsDetailsVo();
+            BeanUtils.copyProperties(customerLeads, vo);
+            vo.setRegisterTime(customerLeads.getCreatedTime());
+            return AjaxResult.success(vo);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("查询客户线索详情异常: {}", e.getMessage(), e);
+            return AjaxResult.error("查询客户线索详情异常:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 查询客户线索反馈列表
+     * @param query
+     * @return 客户线索反馈列表
+     */
+     @ApiOperation(value = "查询客户线索反馈列表", notes = "根据用户ID查询客户线索反馈列表")
+    @GetMapping("/feedback")
+    public TableDataInfo<CustomerLeadsFeedbackVo> feedbackList(@RequestParam Long userId) {
+        List<CustomerLeads> list = customerLeadsService.selectCustomerLeadsFeedbackList(userId);
+        List<CustomerLeadsFeedbackVo> voList = list.stream().map(item -> {
+            CustomerLeadsFeedbackVo vo = new CustomerLeadsFeedbackVo();
+            BeanUtils.copyProperties(item, vo);
+            vo.setCreatedTime(item.getCreatedTime());
+            return vo;
+        }).collect(Collectors.toList());
+        return getDataTable(voList);
+    }
+
 
     /**
      * 处理客户线索

+ 58 - 0
linkwe-chinacoal/src/main/java/com/linkwechat/coal/modules/xxxt/system/domain/vo/CustomerLeadsDetailsVo.java

@@ -0,0 +1,58 @@
+package com.linkwechat.coal.modules.xxxt.system.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class CustomerLeadsDetailsVo implements Serializable {
+    private static final long serialVersionUID = 699131973216223160L;
+
+    /**
+     * 用户ID
+     */
+    private Long userId;
+
+    /**
+     * 用户姓名
+     */
+    private String userName;
+
+    /**
+     * 性别
+     */
+    private Integer gender;
+
+    /**
+     * 生日
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date birthDate;
+
+    /**
+     * 手机号码
+     */
+    private String phone;
+
+    /**
+     * 用户状态:1-正式用户,2-临时用户
+     */
+    private Integer userStatus;
+
+    /**
+     * 用户类型:1-正式用户,2-临时用户
+     */
+    private Integer userType;
+
+    /**
+     * 注册时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date registerTime;
+}

+ 32 - 0
linkwe-chinacoal/src/main/java/com/linkwechat/coal/modules/xxxt/system/domain/vo/CustomerLeadsFeedbackVo.java

@@ -0,0 +1,32 @@
+package com.linkwechat.coal.modules.xxxt.system.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class CustomerLeadsFeedbackVo implements Serializable {
+
+    private static final long serialVersionUID = 1003836384939336546L;
+
+    /**
+     * 客户意向(1:初步了解 2:确认投保)
+     */
+    private String customerIntent;
+
+    /**
+     * 关键信息描述
+     */
+    private String keyInfoDescription;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createdTime;
+}

+ 9 - 0
linkwe-chinacoal/src/main/java/com/linkwechat/coal/modules/xxxt/system/service/ICustomerLeadsService.java

@@ -4,6 +4,7 @@ import com.linkwechat.coal.modules.xxxt.system.domain.entity.CustomerLeads;
 import com.linkwechat.coal.modules.xxxt.system.domain.query.CustomerLeadsQuery;
 import java.util.List;
 import com.linkwechat.coal.modules.xxxt.system.domain.query.CustomerLeadsProcessRequest;
+import com.linkwechat.coal.modules.xxxt.system.domain.vo.CustomerLeadsFeedbackVo;
 
 /**
  * 客户线索服务接口
@@ -38,4 +39,12 @@ public interface ICustomerLeadsService extends IService<CustomerLeads> {
      * @return boolean 处理结果
      */
     boolean processCustomerLeads(CustomerLeadsProcessRequest request);
+
+    /**
+     * 查询客户线索反馈列表
+     *
+     * @param userId 用户ID
+     * @return List<CustomerLeads> 客户线索反馈列表
+     */
+    List<CustomerLeads> selectCustomerLeadsFeedbackList(Long userId);
 }

+ 19 - 0
linkwe-chinacoal/src/main/java/com/linkwechat/coal/modules/xxxt/system/service/impl/CustomerLeadsServiceImpl.java

@@ -11,6 +11,8 @@ import com.linkwechat.service.IWeUserService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
+import java.util.Collections;
 import java.util.Date;
 import com.linkwechat.coal.modules.xxxt.system.domain.query.CustomerLeadsQuery;
 import com.linkwechat.coal.modules.xxxt.system.domain.query.CustomerLeadsProcessRequest;
@@ -154,6 +156,10 @@ public class CustomerLeadsServiceImpl extends ServiceImpl<CustomerLeadsMapper, C
         if (query.getProcessingStatus() != null) {
             wrapper.eq(CustomerLeads::getProcessingStatus, query.getProcessingStatus());
         }
+        //客户意向
+        if (StringUtils.isNotEmpty(query.getCustomerIntent())) {
+            wrapper.eq(CustomerLeads::getCustomerIntent, query.getCustomerIntent());
+        }
         wrapper.orderByDesc(CustomerLeads::getCreatedTime);
         return this.list(wrapper);
     }
@@ -186,4 +192,17 @@ public class CustomerLeadsServiceImpl extends ServiceImpl<CustomerLeadsMapper, C
             return false;
         }
     }
+
+    /**
+     * 查询客户线索反馈列表
+     *
+     * @param userId 用户ID
+     * @return List<CustomerLeads> 客户线索反馈列表
+     */
+    @Override
+    public List<CustomerLeads> selectCustomerLeadsFeedbackList(Long userId) {
+        LambdaQueryWrapper<CustomerLeads> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CustomerLeads::getUserId, userId);
+        return this.list(wrapper);
+    }
 }