|
@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.linkwechat.coal.modules.bdshdb.customer.domain.entity.LocalAppUser;
|
|
import com.linkwechat.coal.modules.bdshdb.customer.domain.entity.LocalAppUser;
|
|
|
import com.linkwechat.coal.modules.bdshdb.customer.service.ILocalAppUserService;
|
|
import com.linkwechat.coal.modules.bdshdb.customer.service.ILocalAppUserService;
|
|
|
import com.linkwechat.coal.modules.xxxt.system.domain.entity.CustomerLeads;
|
|
import com.linkwechat.coal.modules.xxxt.system.domain.entity.CustomerLeads;
|
|
|
|
|
+import com.linkwechat.coal.modules.xxxt.system.domain.entity.CustomerLeadsProcess;
|
|
|
import com.linkwechat.coal.modules.xxxt.system.mapper.CustomerLeadsMapper;
|
|
import com.linkwechat.coal.modules.xxxt.system.mapper.CustomerLeadsMapper;
|
|
|
|
|
+import com.linkwechat.coal.modules.xxxt.system.mapper.CustomerLeadsProcessMapper;
|
|
|
import com.linkwechat.coal.modules.xxxt.system.service.ICustomerLeadsService;
|
|
import com.linkwechat.coal.modules.xxxt.system.service.ICustomerLeadsService;
|
|
|
import com.linkwechat.domain.WeUser;
|
|
import com.linkwechat.domain.WeUser;
|
|
|
import com.linkwechat.service.IWeUserService;
|
|
import com.linkwechat.service.IWeUserService;
|
|
@@ -34,6 +36,9 @@ public class CustomerLeadsServiceImpl extends ServiceImpl<CustomerLeadsMapper, C
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ILocalAppUserService localAppUserService;
|
|
private ILocalAppUserService localAppUserService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CustomerLeadsProcessMapper customerLeadsProcessMapper;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 从主数据库(SCRM)查询用户
|
|
* 从主数据库(SCRM)查询用户
|
|
|
* @param phone 手机号码
|
|
* @param phone 手机号码
|
|
@@ -137,13 +142,15 @@ public class CustomerLeadsServiceImpl extends ServiceImpl<CustomerLeadsMapper, C
|
|
|
@Override
|
|
@Override
|
|
|
public List<CustomerLeads> selectCustomerLeadsList(CustomerLeadsQuery query) {
|
|
public List<CustomerLeads> selectCustomerLeadsList(CustomerLeadsQuery query) {
|
|
|
LambdaQueryWrapper<CustomerLeads> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CustomerLeads> wrapper = new LambdaQueryWrapper<>();
|
|
|
-
|
|
|
|
|
|
|
+ //用户ID
|
|
|
if (query.getUserId() != null) {
|
|
if (query.getUserId() != null) {
|
|
|
wrapper.eq(CustomerLeads::getUserId, query.getUserId());
|
|
wrapper.eq(CustomerLeads::getUserId, query.getUserId());
|
|
|
}
|
|
}
|
|
|
|
|
+ //客户姓名
|
|
|
if (StringUtils.isNotEmpty(query.getUserName())) {
|
|
if (StringUtils.isNotEmpty(query.getUserName())) {
|
|
|
wrapper.like(CustomerLeads::getUserName, query.getUserName());
|
|
wrapper.like(CustomerLeads::getUserName, query.getUserName());
|
|
|
}
|
|
}
|
|
|
|
|
+ //手机号
|
|
|
if (StringUtils.isNotEmpty(query.getPhone())) {
|
|
if (StringUtils.isNotEmpty(query.getPhone())) {
|
|
|
wrapper.eq(CustomerLeads::getPhone, query.getPhone());
|
|
wrapper.eq(CustomerLeads::getPhone, query.getPhone());
|
|
|
}
|
|
}
|
|
@@ -167,26 +174,25 @@ public class CustomerLeadsServiceImpl extends ServiceImpl<CustomerLeadsMapper, C
|
|
|
@Override
|
|
@Override
|
|
|
public boolean processCustomerLeads(CustomerLeadsProcessRequest request) {
|
|
public boolean processCustomerLeads(CustomerLeadsProcessRequest request) {
|
|
|
try {
|
|
try {
|
|
|
- if (request.getUserId() == null) {
|
|
|
|
|
- log.warn("处理客户线索失败:用户ID不能为空");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// 查询客户线索
|
|
// 查询客户线索
|
|
|
CustomerLeads customerLeads = this.getById(request.getUserId());
|
|
CustomerLeads customerLeads = this.getById(request.getUserId());
|
|
|
if (customerLeads == null) {
|
|
if (customerLeads == null) {
|
|
|
- log.warn("处理客户线索失败:未找到用户ID为 {} 的客户线索", request.getUserId());
|
|
|
|
|
|
|
+ log.error("处理客户线索失败:未找到用户ID为 {} 的客户线索", request.getUserId());
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 更新处理信息
|
|
|
|
|
- customerLeads.setProcessingStatus(1); // 1-已处理
|
|
|
|
|
customerLeads.setCustomerIntent(request.getCustomerIntent());
|
|
customerLeads.setCustomerIntent(request.getCustomerIntent());
|
|
|
|
|
+ //关键信息描述
|
|
|
customerLeads.setKeyInfoDescription(request.getKeyInfoDescription());
|
|
customerLeads.setKeyInfoDescription(request.getKeyInfoDescription());
|
|
|
- customerLeads.setUpdatedBy("system");
|
|
|
|
|
- customerLeads.setUpdatedTime(new Date());
|
|
|
|
|
-
|
|
|
|
|
- return this.updateById(customerLeads);
|
|
|
|
|
|
|
+ //处理状态
|
|
|
|
|
+ customerLeads.setProcessingStatus(1);
|
|
|
|
|
+ this.updateById(customerLeads);
|
|
|
|
|
+
|
|
|
|
|
+ CustomerLeadsProcess customerLeadsProcess = new CustomerLeadsProcess();
|
|
|
|
|
+ customerLeadsProcess.setUserId(request.getUserId());
|
|
|
|
|
+ customerLeadsProcess.setCustomerIntent(request.getCustomerIntent());
|
|
|
|
|
+ customerLeadsProcess.setKeyInfoDescription(request.getKeyInfoDescription());
|
|
|
|
|
+ customerLeadsProcess.setProcessTime(new Date());
|
|
|
|
|
+ return customerLeadsProcessMapper.insert(customerLeadsProcess) > 0;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("处理客户线索失败: userId={}, error={}", request.getUserId(), e.getMessage(), e);
|
|
log.error("处理客户线索失败: userId={}, error={}", request.getUserId(), e.getMessage(), e);
|
|
|
return false;
|
|
return false;
|
|
@@ -197,12 +203,12 @@ public class CustomerLeadsServiceImpl extends ServiceImpl<CustomerLeadsMapper, C
|
|
|
* 查询客户线索反馈列表
|
|
* 查询客户线索反馈列表
|
|
|
*
|
|
*
|
|
|
* @param userId 用户ID
|
|
* @param userId 用户ID
|
|
|
- * @return List<CustomerLeads> 客户线索反馈列表
|
|
|
|
|
|
|
+ * @return CustomerLeads 客户线索反馈列表
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<CustomerLeads> selectCustomerLeadsFeedbackList(Long userId) {
|
|
|
|
|
- LambdaQueryWrapper<CustomerLeads> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- wrapper.eq(CustomerLeads::getUserId, userId);
|
|
|
|
|
- return this.list(wrapper);
|
|
|
|
|
|
|
+ public List<CustomerLeadsProcess> selectCustomerLeadsFeedbackList(Long userId) {
|
|
|
|
|
+ LambdaQueryWrapper<CustomerLeadsProcess> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ wrapper.eq(CustomerLeadsProcess::getUserId, userId);
|
|
|
|
|
+ return customerLeadsProcessMapper.selectList(wrapper);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|