mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
📖 CRM:线索模块的 review
This commit is contained in:
parent
8d2008f2b5
commit
df29f0682f
@ -141,17 +141,13 @@ public class CrmClueServiceImpl implements CrmClueService {
|
|||||||
// 遍历线索(过滤掉已转化的线索),创建对应的客户
|
// 遍历线索(过滤掉已转化的线索),创建对应的客户
|
||||||
clues.stream().filter(clue -> ObjectUtil.notEqual(Boolean.TRUE, clue.getTransformStatus()))
|
clues.stream().filter(clue -> ObjectUtil.notEqual(Boolean.TRUE, clue.getTransformStatus()))
|
||||||
.forEach(clue -> {
|
.forEach(clue -> {
|
||||||
// 1.创建客户
|
// 1. 创建客户
|
||||||
CrmCustomerSaveReqVO customerSaveReqVO = BeanUtils.toBean(clue, CrmCustomerSaveReqVO.class)
|
CrmCustomerSaveReqVO customerSaveReqVO = BeanUtils.toBean(clue, CrmCustomerSaveReqVO.class).setId(null);
|
||||||
.setId(null);
|
|
||||||
Long customerId = customerService.createCustomer(customerSaveReqVO, userId);
|
Long customerId = customerService.createCustomer(customerSaveReqVO, userId);
|
||||||
// TODO @puhui999:如果有跟进记录,需要一起转过去;
|
// TODO @puhui999:如果有跟进记录,需要一起转过去;
|
||||||
// 2.更新线索,新建一个 CrmClueDO 去更新。尽量规避直接用原本的对象去更新。因为这样万一并发更新,会存在覆盖的问题。
|
// 2. 更新线索
|
||||||
clueMapper.updateById(BeanUtils.toBean(clue, CrmClueDO.class)
|
clueMapper.updateById(new CrmClueDO().setId(clue.getId())
|
||||||
// 线索状态设置为已转化
|
.setTransformStatus(Boolean.TRUE).setCustomerId(customerId));
|
||||||
.setTransformStatus(Boolean.TRUE)
|
|
||||||
// 设置关联的客户编号
|
|
||||||
.setCustomerId(customerId));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user