Commit 079c3349 authored by zhangfeng's avatar zhangfeng

feat-510: 会员注册,关联客户档案日志中的会员ID改为会员编号

parent bb21be36
...@@ -32,7 +32,7 @@ public class CustomerApiImpl implements CustomerApi { ...@@ -32,7 +32,7 @@ public class CustomerApiImpl implements CustomerApi {
@Resource @Resource
private CountryService countryService; private CountryService countryService;
public void associateCustomerAuto(String areaCode, String phone, Long memberUserId, String newName) { public void associateCustomerAuto(String areaCode, String phone, Long memberUserId, String newName ,String memberCode) {
//先查询此用户是否有关联老客户 //先查询此用户是否有关联老客户
CustomerContactsDO customerContactsDO = customerContactsService.getUniqueOneAndValidate(areaCode, phone, null); CustomerContactsDO customerContactsDO = customerContactsService.getUniqueOneAndValidate(areaCode, phone, null);
...@@ -85,7 +85,7 @@ public class CustomerApiImpl implements CustomerApi { ...@@ -85,7 +85,7 @@ public class CustomerApiImpl implements CustomerApi {
customerCreateReqVO.setCustomerContacts(Arrays.asList(customerContactsCreateReqVO)); customerCreateReqVO.setCustomerContacts(Arrays.asList(customerContactsCreateReqVO));
customerCreateReqVO.setCustomerOperateLogRemark("会员注册关联创建客户. 会员id:" + memberUserId + "; 电话:" + phone); customerCreateReqVO.setCustomerOperateLogRemark("会员注册关联创建客户. 会员编号:" + memberCode + "; 电话:" + phone);
// app创建 // app创建
customerCreateReqVO.setCreateFrom(CustomerCreateFromEnum.APP_REGISTER.getValue()); customerCreateReqVO.setCreateFrom(CustomerCreateFromEnum.APP_REGISTER.getValue());
......
...@@ -4,8 +4,10 @@ import java.util.Date; ...@@ -4,8 +4,10 @@ import java.util.Date;
public interface CustomerApi { public interface CustomerApi {
void associateCustomerAuto(String areaCode, String phone, Long userId, String newName); void associateCustomerAuto(String areaCode, String phone, Long userId, String newName, String memberCode);
void approvalCustomerDelay(String approveId, Integer result); void approvalCustomerDelay(String approveId, Integer result);
void approvalCustomerTransfer(String approveId, Integer result); void approvalCustomerTransfer(String approveId, Integer result);
void fillFirstDealTimeIfNull(Long customerId, Date firstDealTime); void fillFirstDealTimeIfNull(Long customerId, Date firstDealTime);
......
...@@ -50,5 +50,6 @@ public class UserRespDTO { ...@@ -50,5 +50,6 @@ public class UserRespDTO {
private Integer country; private Integer country;
private Integer city; private Integer city;
private String code;
} }
...@@ -236,7 +236,7 @@ public class MemberUserServiceImpl implements MemberUserService { ...@@ -236,7 +236,7 @@ public class MemberUserServiceImpl implements MemberUserService {
clientInternalMessageApi.createInternalMessage(dto); clientInternalMessageApi.createInternalMessage(dto);
//关联或创建后端客户 //关联或创建后端客户
customerApi.associateCustomerAuto(areacode, mobile, user.getId(), englishName); customerApi.associateCustomerAuto(areacode, mobile, user.getId(), englishName, user.getCode());
applicationContext.publishEvent(new MemberRegEvent(user.getId())); applicationContext.publishEvent(new MemberRegEvent(user.getId()));
......
...@@ -516,7 +516,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -516,7 +516,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 如果客户联系人为空,则创建新的客户信息,重新查询 // 如果客户联系人为空,则创建新的客户信息,重新查询
customerApi.associateCustomerAuto(memberUserDO.getAreaCode(), customerApi.associateCustomerAuto(memberUserDO.getAreaCode(),
memberUserDO.getMobile(), memberUserDO.getId(), memberUserDO.getMobile(), memberUserDO.getId(),
memberUserDO.getNickname()); memberUserDO.getNickname(), memberUserDO.getCode());
customerContacts = customerContactsService.getOne(new LambdaQueryWrapper<CustomerContactsDO>() customerContacts = customerContactsService.getOne(new LambdaQueryWrapper<CustomerContactsDO>()
.and(we -> we.eq(CustomerContactsDO::getUserid, memberUserDO.getId()) .and(we -> we.eq(CustomerContactsDO::getUserid, memberUserDO.getId())
.or() .or()
...@@ -3092,7 +3092,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -3092,7 +3092,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorDO.setUpdater(updater); orderConsignorDO.setUpdater(updater);
if (Objects.isNull(customerContacts)) { if (Objects.isNull(customerContacts)) {
// 如果客户联系人为空,则创建新的客户信息,重新查询 // 如果客户联系人为空,则创建新的客户信息,重新查询
customerApi.associateCustomerAuto(memberUserDO.getAreaCode(), memberUserDO.getMobile(), memberUserDO.getId(), memberUserDO.getNickname()); customerApi.associateCustomerAuto(memberUserDO.getAreaCode(), memberUserDO.getMobile(), memberUserDO.getId(), memberUserDO.getNickname(), memberUserDO.getCode());
customerContacts = customerContactsService.getOne(new LambdaQueryWrapper<CustomerContactsDO>() customerContacts = customerContactsService.getOne(new LambdaQueryWrapper<CustomerContactsDO>()
.and(we -> we.eq(CustomerContactsDO::getUserid, memberUserDO.getId()) .and(we -> we.eq(CustomerContactsDO::getUserid, memberUserDO.getId())
.or() .or()
......
...@@ -1433,7 +1433,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl ...@@ -1433,7 +1433,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
customerContactsDOList = customerContactsService.getByPhone(userRespDTO.getAreaCode(), userRespDTO.getMobile()); customerContactsDOList = customerContactsService.getByPhone(userRespDTO.getAreaCode(), userRespDTO.getMobile());
// 当此客户端用户不存在绑定的有效客户信息时需要去关联创建 // 当此客户端用户不存在绑定的有效客户信息时需要去关联创建
if (CollectionUtil.isEmpty(customerContactsDOList) || customerContactsDOList.size() == 0) { if (CollectionUtil.isEmpty(customerContactsDOList) || customerContactsDOList.size() == 0) {
customerApi.associateCustomerAuto(userRespDTO.getAreaCode(), userRespDTO.getMobile(), userRespDTO.getId(), userRespDTO.getNickname()); customerApi.associateCustomerAuto(userRespDTO.getAreaCode(), userRespDTO.getMobile(), userRespDTO.getId(), userRespDTO.getNickname(), userRespDTO.getCode());
customerContactsDOList = customerContactsService.getByMemberUserId(loginUser.getId()); customerContactsDOList = customerContactsService.getByMemberUserId(loginUser.getId());
} else { } else {
customerContactsService.update(new LambdaUpdateWrapper<CustomerContactsDO>() customerContactsService.update(new LambdaUpdateWrapper<CustomerContactsDO>()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment