|
|
@ -1104,9 +1104,6 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
public ResultBean billApplicatSaveCust(CrmCustomerBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)){//新增
|
|
|
|
|
|
|
|
} |
|
|
|
//手机号
|
|
|
|
String phone = dto.getPhone(); |
|
|
|
if (!phone.matches("^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$")) { |
|
|
@ -1119,20 +1116,20 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
String name = dto.getName(); |
|
|
|
//业务员sid
|
|
|
|
String staffSid = dto.getStaffSid(); |
|
|
|
//生成客户编码:分公司简称+部门编码+手机号+姓名首字母大写拼写
|
|
|
|
String customerNo = getPrefix(staffSid, name, phone); |
|
|
|
//查询该客户编码是否存在
|
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerNo(customerNo); |
|
|
|
if (crmCustomerTemp != null) {//存在
|
|
|
|
//查询该客户属于哪个业务员
|
|
|
|
String staffName = ""; |
|
|
|
SysUserVo sysCrmVo = sysUserFeign.fetchBySid(crmCustomerTemp.getCreateBySid()).getData(); |
|
|
|
if (sysCrmVo != null) { |
|
|
|
staffName = sysCrmVo.getName(); |
|
|
|
return rb.setMsg("该客户已存在,为" + staffName + "销售专员客户"); |
|
|
|
if (StringUtils.isBlank(dtoSid)){//新增
|
|
|
|
//生成客户编码:分公司简称+部门编码+手机号+姓名首字母大写拼写
|
|
|
|
String customerNo = getPrefix(staffSid, name, phone); |
|
|
|
//查询该客户编码是否存在
|
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerNo(customerNo); |
|
|
|
if (crmCustomerTemp != null) {//存在
|
|
|
|
//查询该客户属于哪个业务员
|
|
|
|
String staffName = ""; |
|
|
|
SysUserVo sysCrmVo = sysUserFeign.fetchBySid(crmCustomerTemp.getCreateBySid()).getData(); |
|
|
|
if (sysCrmVo != null) { |
|
|
|
staffName = sysCrmVo.getName(); |
|
|
|
return rb.setMsg("该客户已存在,为" + staffName + "销售专员客户"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else {//不存在
|
|
|
|
// 新增
|
|
|
|
SysUserVo sysUserVo = new SysUserVo(); |
|
|
|
sysUserVo.setStaffSid(staffSid); |
|
|
|
CrmCustomerTempDto crmCustomerTempDto = new CrmCustomerTempDto(); |
|
|
@ -1143,8 +1140,28 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
crmCustomerTempDto.setOrgPath(dto.getOrgSidPath()); |
|
|
|
crmCustomerTempDto.setCertificateTypeKey("01"); |
|
|
|
crmCustomerTempDto.setCertificateType("身份证"); |
|
|
|
crmCustomerTempDto.setCustomerTypeKey("1"); |
|
|
|
crmCustomerTempDto.setCustomerType("个人"); |
|
|
|
crmCustomerTempDto.setIsOnRemindkey("0"); |
|
|
|
crmCustomerTempDto.setIsOnRemind("否"); |
|
|
|
crmCustomerTempDto.setRemind_day("未设置提醒"); |
|
|
|
saveCrmCustomerTemp(crmCustomerTempDto, sysUserVo); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
CrmCustomerTempUpdateDto crmCustomerTempDto = new CrmCustomerTempUpdateDto(); |
|
|
|
crmCustomerTempDto.setName(name); |
|
|
|
crmCustomerTempDto.setIDNumber(dto.getTaxpayerNo()); |
|
|
|
crmCustomerTempDto.setMobile(phone); |
|
|
|
crmCustomerTempDto.setUserSid(dto.getCreateBySid()); |
|
|
|
crmCustomerTempDto.setOrgPath(dto.getOrgSidPath()); |
|
|
|
crmCustomerTempDto.setCertificateTypeKey("01"); |
|
|
|
crmCustomerTempDto.setCertificateType("身份证"); |
|
|
|
crmCustomerTempDto.setCustomerTypeKey("1"); |
|
|
|
crmCustomerTempDto.setCustomerType("个人"); |
|
|
|
ResultBean resultBean = updateCrmCustomer(crmCustomerTempDto, dtoSid); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
return rb.success().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
} |