Commit 079c3349 authored by zhangfeng's avatar zhangfeng

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

parent bb21be36
......@@ -32,7 +32,7 @@ public class CustomerApiImpl implements CustomerApi {
@Resource
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);
......@@ -85,7 +85,7 @@ public class CustomerApiImpl implements CustomerApi {
customerCreateReqVO.setCustomerContacts(Arrays.asList(customerContactsCreateReqVO));
customerCreateReqVO.setCustomerOperateLogRemark("会员注册关联创建客户. 会员id:" + memberUserId + "; 电话:" + phone);
customerCreateReqVO.setCustomerOperateLogRemark("会员注册关联创建客户. 会员编号:" + memberCode + "; 电话:" + phone);
// app创建
customerCreateReqVO.setCreateFrom(CustomerCreateFromEnum.APP_REGISTER.getValue());
......
......@@ -4,8 +4,10 @@ import java.util.Date;
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 approvalCustomerTransfer(String approveId, Integer result);
void fillFirstDealTimeIfNull(Long customerId, Date firstDealTime);
......
......@@ -50,5 +50,6 @@ public class UserRespDTO {
private Integer country;
private Integer city;
private String code;
}
......@@ -236,7 +236,7 @@ public class MemberUserServiceImpl implements MemberUserService {
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()));
......
......@@ -516,7 +516,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 如果客户联系人为空,则创建新的客户信息,重新查询
customerApi.associateCustomerAuto(memberUserDO.getAreaCode(),
memberUserDO.getMobile(), memberUserDO.getId(),
memberUserDO.getNickname());
memberUserDO.getNickname(), memberUserDO.getCode());
customerContacts = customerContactsService.getOne(new LambdaQueryWrapper<CustomerContactsDO>()
.and(we -> we.eq(CustomerContactsDO::getUserid, memberUserDO.getId())
.or()
......@@ -3092,7 +3092,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorDO.setUpdater(updater);
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>()
.and(we -> we.eq(CustomerContactsDO::getUserid, memberUserDO.getId())
.or()
......
......@@ -1433,7 +1433,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
customerContactsDOList = customerContactsService.getByPhone(userRespDTO.getAreaCode(), userRespDTO.getMobile());
// 当此客户端用户不存在绑定的有效客户信息时需要去关联创建
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());
} else {
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