|
|
@@ -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);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 处理客户线索
|