|
|
@ -31,6 +31,7 @@ import com.yxt.anrui.portal.api.sysuser.app.AppUserOrgInfoVo; |
|
|
|
import com.yxt.anrui.portal.config.DictCommonType; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.HanZiConverterPinYin; |
|
|
|
import com.yxt.common.base.utils.HttpStatusEnum; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
@ -217,11 +218,6 @@ 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("该手机号已绑定其它客户,请重新添加");
|
|
|
|
// }
|
|
|
|
AppCrmCustomerTempInfoVo appCrmCustomerTempInfoVo = baseMapper.selectBySid(dto.getSid()); |
|
|
|
String mobile = appCrmCustomerTempInfoVo.getMobile(); |
|
|
|
if (!mobile.equals(dto.getMobile())) { |
|
|
@ -262,6 +258,9 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
customerTemp.setCustomerPhoto(customerTemp.getCustomerPhoto().replace(fileUploadComponent.getUrlPrefix(), "")); |
|
|
|
} |
|
|
|
customerTemp.setUpdateBySid(dto.getUserSid()); |
|
|
|
//客户编码
|
|
|
|
String customerNo = HanZiConverterPinYin.getPinYinFirst(customerTemp.getName()) + customerTemp.getMobile(); |
|
|
|
customerTemp.setCustomerNo(customerNo); |
|
|
|
boolean updateBoolean = updateById(customerTemp); |
|
|
|
if (updateBoolean) { |
|
|
|
// 更新附件表
|
|
|
@ -568,11 +567,11 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
if (StringUtils.isNotBlank(customerTemp.getCustomerPhoto())) { |
|
|
|
customerTemp.setCustomerPhoto(customerTemp.getCustomerPhoto().replace(fileUploadComponent.getUrlPrefix(), "")); |
|
|
|
} |
|
|
|
Map<String, String> map = genetrateCustomerNum(dto.getCustomerTypeKey(), userOrgInfoVo); |
|
|
|
// Map<String, String> map = genetrateCustomerNum(dto.getCustomerTypeKey(), userOrgInfoVo);
|
|
|
|
customerTemp.setCreateBySid(dto.getUserSid()); |
|
|
|
customerTemp.setStaffSid(userOrgInfoVo.getStaffSid()); |
|
|
|
customerTemp.setCreateOrgSid(userOrgInfoVo.getOrgSid()); |
|
|
|
customerTemp.setCustomerNo(map.get("code")); |
|
|
|
// customerTemp.setCustomerNo(map.get("code"));
|
|
|
|
customerTemp.setCertificateTypeKey(customerTemp.getCustomerTypeKey().equals("1") ? "01" : "02"); |
|
|
|
customerTemp.setCertificateType(customerTemp.getCustomerTypeKey().equals("1") ? "身份证" : "营业执照"); |
|
|
|
ResultBean resultBean = dictCommonFeign.getFirstDictKeyByType(DictCommonType.FOLLOW_STATE, "0"); |
|
|
@ -592,6 +591,9 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
} else if ("1".equals(dto.getIsOnRemindkey())) { |
|
|
|
customerTemp.setRemind_day(dto.getRemind_day()); |
|
|
|
} |
|
|
|
//客户编码
|
|
|
|
String customerNo = HanZiConverterPinYin.getPinYinFirst(customerTemp.getName()) + customerTemp.getMobile(); |
|
|
|
customerTemp.setCustomerNo(customerNo); |
|
|
|
save(customerTemp); |
|
|
|
// 增加跟进记录
|
|
|
|
Map<String, String> paramMap = new HashMap<>(); |
|
|
@ -756,14 +758,17 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
crmCustomerTemp.setCreateBySid(dto.getUserSid()); |
|
|
|
crmCustomerTemp.setStaffSid(sysUserInfoVo.getStaffSid()); |
|
|
|
crmCustomerTemp.setCreateOrgSid(sysUserInfoVo.getOrgSid()); |
|
|
|
Map<String, String> map = genetrateCustomerNumO(dto.getCustomerTypeKey(), sysUserInfoVo); |
|
|
|
crmCustomerTemp.setCustomerNo(map.get("code")); |
|
|
|
/*Map<String, String> map = genetrateCustomerNumO(dto.getCustomerTypeKey(), sysUserInfoVo); |
|
|
|
crmCustomerTemp.setCustomerNo(map.get("code"));*/ |
|
|
|
ResultBean resultBean = dictCommonFeign.getFirstDictKeyByType(DictCommonType.FOLLOW_STATE, "0"); |
|
|
|
if (resultBean.getSuccess() && resultBean.getData() != null) { |
|
|
|
String key = resultBean.getData().toString(); |
|
|
|
crmCustomerTemp.setFollow_state_key(key); |
|
|
|
crmCustomerTemp.setFollow_state(dictCommonFeign.selectBykey(key, DictCommonType.FOLLOW_STATE).getData().getDictValue()); |
|
|
|
} |
|
|
|
//客户编码
|
|
|
|
String customerNo = HanZiConverterPinYin.getPinYinFirst(crmCustomerTemp.getName()) + crmCustomerTemp.getMobile(); |
|
|
|
crmCustomerTemp.setCustomerNo(customerNo); |
|
|
|
save(crmCustomerTemp); |
|
|
|
// 增加跟进记录
|
|
|
|
String visitSid = crmVisitService.insertCrmVisitOne(dto.getUserSid(), crmCustomerTemp.getSid(), crmCustomerTemp.getIsOnRemindkey(), crmCustomerTemp.getIsOnRemind(), dto.getVisitWay(), dto.getVisitWayKey()); |
|
|
@ -839,8 +844,10 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
|
return rb.setMsg("该客户信息不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, customerTemp); |
|
|
|
//客户编码
|
|
|
|
String customerNo = HanZiConverterPinYin.getPinYinFirst(customerTemp.getName()) + customerTemp.getMobile(); |
|
|
|
customerTemp.setCustomerNo(customerNo); |
|
|
|
baseMapper.updateById(customerTemp); |
|
|
|
// int count = updateBySid(dto, sid);
|
|
|
|
//更新运营信息
|
|
|
|
CrmBusinessDto crmBusinessDto = dto.getCrmBusinessDto(); |
|
|
|
crmBusinessService.updateByCusSid(crmBusinessDto, sid); |
|
|
|