|
|
@ -24,6 +24,7 @@ import com.yxt.anrui.crm.biz.crmfile.CrmFileService; |
|
|
|
import com.yxt.anrui.crm.biz.crmvehicledemand.CrmVehicledemandService; |
|
|
|
import com.yxt.anrui.crm.biz.crmvisit.CrmVisitService; |
|
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; |
|
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserInfoVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
@ -220,17 +221,28 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
} |
|
|
|
} else { // 修改
|
|
|
|
if (StringUtils.isNotBlank(dto.getMobile())) { |
|
|
|
map.put("mobile", dto.getMobile()); |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = baseMapper.selectByMobileOrWx(map); |
|
|
|
if (crmCustomerTempVo != null && crmCustomerTempVo.getStaffSid().equals(userOrgInfoVo.getStaffSid())) { |
|
|
|
return new ResultBean().fail().setMsg("该手机号已绑定其它客户,请重新添加"); |
|
|
|
// map.put("mobile", dto.getMobile());
|
|
|
|
// CrmCustomerTempVo crmCustomerTempVo = baseMapper.selectByMobileOrWx(map);
|
|
|
|
// if (crmCustomerTempVo != null && !crmCustomerTempVo.getStaffSid().equals(userOrgInfoVo.getStaffSid())) {
|
|
|
|
// return new ResultBean().fail().setMsg("该手机号已绑定其它客户,请重新添加");
|
|
|
|
// }
|
|
|
|
AppCrmCustomerTempInfoVo appCrmCustomerTempInfoVo = baseMapper.selectBySid(dto.getSid()); |
|
|
|
String mobile = appCrmCustomerTempInfoVo.getMobile(); |
|
|
|
if (!mobile.equals(dto.getMobile())) { |
|
|
|
int count = baseMapper.selBySidAndMobile(dto.getSid(), dto.getMobile()); |
|
|
|
if (count > 0) { |
|
|
|
return new ResultBean().fail().setMsg("该手机号已绑定其它客户,请重新添加"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(dto.getWeixin())) { |
|
|
|
map.put("weixin", dto.getWeixin()); |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = baseMapper.selectByMobileOrWx(map); |
|
|
|
if (crmCustomerTempVo != null && crmCustomerTempVo.getStaffSid().equals(userOrgInfoVo.getStaffSid())) { |
|
|
|
return new ResultBean().fail().setMsg("该微信号已绑定其它客户,请重新添加"); |
|
|
|
if (crmCustomerTempVo.getWeixin().equals(dto.getWeixin())) { |
|
|
|
return new ResultBean().fail().setMsg("该微信号已绑定其它客户,请重新添加"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
CrmCustomerTemp customerTemp = fetchBySid(dto.getSid()); |
|
|
@ -398,7 +410,11 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
String city = appCrmCustomerTempVo.getCity(); |
|
|
|
String county = appCrmCustomerTempVo.getCounty(); |
|
|
|
String address = appCrmCustomerTempVo.getAddress(); |
|
|
|
appCrmCustomerTempVo.setAddressNss(province + city + county + address); |
|
|
|
if (StringUtils.isNotBlank(province) || StringUtils.isNotBlank(city) || StringUtils.isNotBlank(county) || StringUtils.isNotBlank(address)) { |
|
|
|
appCrmCustomerTempVo.setAddressNss(province + city + county + address); |
|
|
|
} else { |
|
|
|
appCrmCustomerTempVo.setAddressNss(""); |
|
|
|
} |
|
|
|
String customerPhoto = appCrmCustomerTempVo.getCustomerPhoto(); |
|
|
|
if (customerPhoto != null) { |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
@ -542,6 +558,11 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
customerTemp.setAddress_city(adCode.substring(2, 4)); |
|
|
|
customerTemp.setAddress_county(adCode.substring(4, 6)); |
|
|
|
} |
|
|
|
if ("0".equals(dto.getIsOnRemindkey())) { |
|
|
|
customerTemp.setRemind_day("未设置提醒"); |
|
|
|
} else if ("1".equals(dto.getIsOnRemindkey())) { |
|
|
|
customerTemp.setRemind_day(dto.getRemind_day()); |
|
|
|
} |
|
|
|
save(customerTemp); |
|
|
|
// 增加跟进记录
|
|
|
|
Map<String, String> paramMap = new HashMap<>(); |
|
|
@ -776,8 +797,16 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
*/ |
|
|
|
public AppCrmCustomerTempBasicsDetailsVo customerTempDetailsBySid(String sid) { |
|
|
|
AppCrmCustomerTempBasicsDetailsVo vo = baseMapper.customerTempDetailsBySid(sid); |
|
|
|
vo.setSid(sid); |
|
|
|
String adCode = vo.getAddress_province() + vo.getAddress_city() + vo.getAddress_county(); |
|
|
|
vo.setAdCode(adCode); |
|
|
|
if (StringUtils.isNotBlank(adCode)) { |
|
|
|
vo.setAdCode(adCode); |
|
|
|
} else { |
|
|
|
vo.setAdCode(""); |
|
|
|
} |
|
|
|
String type = "customerType"; |
|
|
|
DictCommonVo customerType = dictCommonFeign.selectBykey(vo.getCustomerTypeKey(), type).getData(); |
|
|
|
vo.setParentSid(customerType.getSid()); |
|
|
|
List<CrmFileDetailsVo> crmFileDetailsVos = crmFileService.fetchByLinkSid(sid); |
|
|
|
List<String> list = new ArrayList<>(); |
|
|
|
if (crmFileDetailsVos != null) { |
|
|
|