|
|
@ -172,7 +172,11 @@ public class CustomerService {
|
|
|
|
insertCustomer.setWechatUniId(turnBackDTOS.getWx_data().getUnit_id());
|
|
|
|
insertCustomer.setWechatUniId(turnBackDTOS.getWx_data().getUnit_id());
|
|
|
|
insertCustomer.setName(turnBackDTOS.getName());
|
|
|
|
insertCustomer.setName(turnBackDTOS.getName());
|
|
|
|
insertCustomer.setAvatarUrl(turnBackDTOS.getWx_data().getAvatar_url());
|
|
|
|
insertCustomer.setAvatarUrl(turnBackDTOS.getWx_data().getAvatar_url());
|
|
|
|
|
|
|
|
insertCustomer.setPhone(turnBackDTOS.getPhone());
|
|
|
|
if(null != opCustomer){
|
|
|
|
if(null != opCustomer){
|
|
|
|
|
|
|
|
//更新一下
|
|
|
|
|
|
|
|
insertCustomer.setId(opCustomer.getId());
|
|
|
|
|
|
|
|
opCustomerDOMapper.updateById(insertCustomer);
|
|
|
|
//存在--1.处理客户导购关系。
|
|
|
|
//存在--1.处理客户导购关系。
|
|
|
|
sellerCustomerRelation(opCustomer,turnBackDTOS.getEa_code(),poiStore.getId(),poiStoreStaff.getUserId());
|
|
|
|
sellerCustomerRelation(opCustomer,turnBackDTOS.getEa_code(),poiStore.getId(),poiStoreStaff.getUserId());
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
@ -211,22 +215,24 @@ public class CustomerService {
|
|
|
|
QueryWrapper<OpVip> wrapper = new QueryWrapper<>();
|
|
|
|
QueryWrapper<OpVip> wrapper = new QueryWrapper<>();
|
|
|
|
wrapper.eq("phone",vipDataDTO.getPhone()).eq("name",vipDataDTO.getName());
|
|
|
|
wrapper.eq("phone",vipDataDTO.getPhone()).eq("name",vipDataDTO.getName());
|
|
|
|
OpVip opVip = opVipDOMapper.selectOne(wrapper);
|
|
|
|
OpVip opVip = opVipDOMapper.selectOne(wrapper);
|
|
|
|
|
|
|
|
OpVip opVip1 = new OpVip();
|
|
|
|
|
|
|
|
opVip1.setStatus(1L);
|
|
|
|
|
|
|
|
opVip1.setPhone(vipDataDTO.getPhone());
|
|
|
|
|
|
|
|
opVip1.setName(vipDataDTO.getName());
|
|
|
|
|
|
|
|
opVip1.setBirthday(vipDataDTO.getBirthday());
|
|
|
|
|
|
|
|
opVip1.setRegisterTime(new Date(vipDataDTO.getRegister_time()));
|
|
|
|
if(opVip == null){
|
|
|
|
if(opVip == null){
|
|
|
|
//数据库没有这个数据--新建数据
|
|
|
|
//数据库没有这个数据--新建数据
|
|
|
|
OpVip opVip1 = new OpVip();
|
|
|
|
|
|
|
|
opVip1.setStatus(1L);
|
|
|
|
|
|
|
|
opVip1.setPhone(vipDataDTO.getPhone());
|
|
|
|
|
|
|
|
opVip1.setName(vipDataDTO.getName());
|
|
|
|
|
|
|
|
opVip1.setBirthday(vipDataDTO.getBirthday());
|
|
|
|
|
|
|
|
opVip1.setRegisterTime(new Date(vipDataDTO.getRegister_time()));
|
|
|
|
|
|
|
|
opVip1.setCreateTime(new Date());
|
|
|
|
opVip1.setCreateTime(new Date());
|
|
|
|
opVip1.setUpdateTime(new Date());
|
|
|
|
|
|
|
|
opVip1.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
opVip1.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
opVip1.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
|
|
|
|
opVipDOMapper.insert(opVip1);
|
|
|
|
opVipDOMapper.insert(opVip1);
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
opCustomer.setMemberId(opVip1.getId());
|
|
|
|
opCustomer.setMemberId(opVip1.getId());
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
|
|
|
|
opVip1.setId(opVip.getId());
|
|
|
|
|
|
|
|
opVip1.setUpdateTime(new Date());
|
|
|
|
|
|
|
|
opVip1.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
|
|
|
|
opVipDOMapper.updateById(opVip1);
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
opCustomer.setMemberId(opVip.getId());
|
|
|
|
opCustomer.setMemberId(opVip.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -246,22 +252,24 @@ public class CustomerService {
|
|
|
|
QueryWrapper<OpVip> wrapper = new QueryWrapper<>();
|
|
|
|
QueryWrapper<OpVip> wrapper = new QueryWrapper<>();
|
|
|
|
wrapper.eq("phone",turnBackDTO.getVip_data().getPhone()).eq("name",turnBackDTO.getVip_data().getName());
|
|
|
|
wrapper.eq("phone",turnBackDTO.getVip_data().getPhone()).eq("name",turnBackDTO.getVip_data().getName());
|
|
|
|
OpVip opVip = opVipDOMapper.selectOne(wrapper);
|
|
|
|
OpVip opVip = opVipDOMapper.selectOne(wrapper);
|
|
|
|
|
|
|
|
OpVip opVip1 = new OpVip();
|
|
|
|
|
|
|
|
opVip1.setStatus(1L);
|
|
|
|
|
|
|
|
opVip1.setPhone(turnBackDTO.getVip_data().getPhone());
|
|
|
|
|
|
|
|
opVip1.setName(turnBackDTO.getVip_data().getName());
|
|
|
|
|
|
|
|
opVip1.setBirthday(turnBackDTO.getVip_data().getBirthday());
|
|
|
|
|
|
|
|
opVip1.setRegisterTime(new Date(turnBackDTO.getVip_data().getRegister_time()));
|
|
|
|
if(opVip == null){
|
|
|
|
if(opVip == null){
|
|
|
|
//数据库没有这个数据--新建数据
|
|
|
|
//数据库没有这个数据--新建数据
|
|
|
|
OpVip opVip1 = new OpVip();
|
|
|
|
|
|
|
|
opVip1.setStatus(1L);
|
|
|
|
|
|
|
|
opVip1.setPhone(turnBackDTO.getVip_data().getPhone());
|
|
|
|
|
|
|
|
opVip1.setName(turnBackDTO.getVip_data().getName());
|
|
|
|
|
|
|
|
opVip1.setBirthday(turnBackDTO.getVip_data().getBirthday());
|
|
|
|
|
|
|
|
opVip1.setRegisterTime(new Date(turnBackDTO.getVip_data().getRegister_time()));
|
|
|
|
|
|
|
|
opVip1.setCreateTime(new Date());
|
|
|
|
|
|
|
|
opVip1.setUpdateTime(new Date());
|
|
|
|
|
|
|
|
opVip1.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
opVip1.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
opVip1.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
opVip1.setCreateTime(new Date());
|
|
|
|
opVipDOMapper.insert(opVip1);
|
|
|
|
opVipDOMapper.insert(opVip1);
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
opCustomer.setMemberId(opVip1.getId());
|
|
|
|
opCustomer.setMemberId(opVip1.getId());
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
|
|
|
|
opVip1.setId(opVip.getId());
|
|
|
|
|
|
|
|
opVip1.setUpdateTime(new Date());
|
|
|
|
|
|
|
|
opVip1.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
|
|
|
|
opVipDOMapper.updateById(opVip1);
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
//有vip信息就绑定信息
|
|
|
|
opCustomer.setMemberId(opVip.getId());
|
|
|
|
opCustomer.setMemberId(opVip.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|