修改同步添加联系人

This commit is contained in:
zhangwenzan 2025-09-16 14:46:03 +08:00
parent 1c43e1dd61
commit a2ff304ae0
1 changed files with 37 additions and 38 deletions

View File

@ -391,16 +391,17 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
/** /**
* 数据脱敏 * 数据脱敏
*
* @param crmModel * @param crmModel
*/ */
private CrmModel encryptSensitiveData(CrmModel crmModel){ private CrmModel encryptSensitiveData(CrmModel crmModel) {
//遍历数据 //遍历数据
//crmModel.forEach((key, value) -> System.out.println("Key: " + key + ", Value: " + value)); //crmModel.forEach((key, value) -> System.out.println("Key: " + key + ", Value: " + value));
// 获取数据 // 获取数据
String contactsMobile = (String)crmModel.get("contactsMobile"); String contactsMobile = (String) crmModel.get("contactsMobile");
String name = (String)crmModel.get("telephone");//详情页的联系人姓名 String name = (String) crmModel.get("telephone");//详情页的联系人姓名
String contactsName = (String)crmModel.get("contactsName"); String contactsName = (String) crmModel.get("contactsName");
String email = (String)crmModel.get("email"); String email = (String) crmModel.get("email");
String fliedKjhmgc = (String) crmModel.get("fliedKjhmgc");//详情页的详细地址 String fliedKjhmgc = (String) crmModel.get("fliedKjhmgc");//详情页的详细地址
//String contactsAddress = (String) crmModel.get("contactsAddress"); //String contactsAddress = (String) crmModel.get("contactsAddress");
// 脱敏处理 // 脱敏处理
@ -422,6 +423,7 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
/** /**
* 获取客户明文 * 获取客户明文
*
* @param plaintextVO * @param plaintextVO
* @return * @return
*/ */
@ -456,14 +458,14 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
//遍历数据 //遍历数据
//crmModel.forEach((key, value) -> System.out.println("Key: " + key + ", Value: " + value)); //crmModel.forEach((key, value) -> System.out.println("Key: " + key + ", Value: " + value));
String plaintext = null; String plaintext = null;
if (plaintextVO.getField().equals("mobile")){ if (plaintextVO.getField().equals("mobile")) {
plaintext = (String) crmModel.get("mobile"); plaintext = (String) crmModel.get("mobile");
} else if (plaintextVO.getField().equals("email")){ } else if (plaintextVO.getField().equals("email")) {
plaintext = (String) crmModel.get("email"); plaintext = (String) crmModel.get("email");
} else if (plaintextVO.getField().equals("telephone")){ //详情页联系人姓名 } else if (plaintextVO.getField().equals("telephone")) { //详情页联系人姓名
int contactsId = (Integer) crmModel.get("contactsId"); int contactsId = (Integer) crmModel.get("contactsId");
plaintext = crmContactsService.getContactsName(contactsId); plaintext = crmContactsService.getContactsName(contactsId);
} else if (plaintextVO.getField().equals("fliedKjhmgc")){ } else if (plaintextVO.getField().equals("fliedKjhmgc")) {
plaintext = (String) crmModel.get("fliedKjhmgc"); plaintext = (String) crmModel.get("fliedKjhmgc");
} }
return plaintext; return plaintext;
@ -471,10 +473,11 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
/** /**
* 判断crmType * 判断crmType
*
* @param plaintextVO * @param plaintextVO
*/ */
@Override @Override
public String getPlaintext(CrmGetPlaintextVO plaintextVO){ public String getPlaintext(CrmGetPlaintextVO plaintextVO) {
// 判断类型 // 判断类型
String plaintext = null; String plaintext = null;
if (plaintextVO.getCrmType().equals("customer")) { if (plaintextVO.getCrmType().equals("customer")) {
@ -598,28 +601,24 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
CrmCustomer finalCrmCustomer = crmCustomer; CrmCustomer finalCrmCustomer = crmCustomer;
CrmModelFiledVO crmModelFiled = crmModel.getField().get(6); CrmModelFiledVO crmModelFiled = crmModel.getField().get(6);
new Thread(() -> { if (finalCrmCustomer.getTelephone() != null && !finalCrmCustomer.getTelephone().isEmpty()) {
if (finalCrmCustomer.getTelephone() != null && !finalCrmCustomer.getTelephone().isEmpty()) { // 客户填写
// 客户填写 addContacts(finalCrmCustomer.getCustomerId(), finalCrmCustomer.getTelephone(), crmModelFiled.getValue().toString(), finalCrmCustomer.getMobile(), "", finalCrmCustomer.getEmail());
addContacts(finalCrmCustomer.getCustomerId(), finalCrmCustomer.getTelephone(), crmModelFiled.getValue().toString(), finalCrmCustomer.getMobile(), "", finalCrmCustomer.getEmail()); }
}
// 税局信息 // 税局信息
// 法定代表人 // 法定代表人
if (StrUtil.isNotEmpty(qyjbxxByNsrmc.getFddbrxm()) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getFddbryddh())) { if (Objects.nonNull(qyjbxxByNsrmc) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getFddbrxm()) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getFddbryddh())) {
addContacts(finalCrmCustomer.getCustomerId(), qyjbxxByNsrmc.getFddbrxm(), "法定代表人", qyjbxxByNsrmc.getFddbryddh(), qyjbxxByNsrmc.getFddbrgddh(), qyjbxxByNsrmc.getFddbrdzxx()); addContacts(finalCrmCustomer.getCustomerId(), qyjbxxByNsrmc.getFddbrxm(), "法定代表人", qyjbxxByNsrmc.getFddbryddh(), qyjbxxByNsrmc.getFddbrgddh(), qyjbxxByNsrmc.getFddbrdzxx());
} }
// 财务负责人 // 财务负责人
if (StrUtil.isNotEmpty(qyjbxxByNsrmc.getCwfzrxm()) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getCwfzryddh())) { if (Objects.nonNull(qyjbxxByNsrmc) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getCwfzrxm()) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getCwfzryddh())) {
addContacts(finalCrmCustomer.getCustomerId(), qyjbxxByNsrmc.getCwfzrxm(), "财务负责人", qyjbxxByNsrmc.getCwfzryddh(), qyjbxxByNsrmc.getCwfzrgddh(), qyjbxxByNsrmc.getCwfzrdzxx()); addContacts(finalCrmCustomer.getCustomerId(), qyjbxxByNsrmc.getCwfzrxm(), "财务负责人", qyjbxxByNsrmc.getCwfzryddh(), qyjbxxByNsrmc.getCwfzrgddh(), qyjbxxByNsrmc.getCwfzrdzxx());
} }
// 办税人 // 办税人
if (StrUtil.isNotEmpty(qyjbxxByNsrmc.getBsrxm()) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getBsryddh())) { if (Objects.nonNull(qyjbxxByNsrmc) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getBsrxm()) && StrUtil.isNotEmpty(qyjbxxByNsrmc.getBsryddh())) {
addContacts(finalCrmCustomer.getCustomerId(), qyjbxxByNsrmc.getBsrxm(), "办税人", qyjbxxByNsrmc.getBsryddh(), qyjbxxByNsrmc.getBsrgddh(), qyjbxxByNsrmc.getBsrdzxx()); addContacts(finalCrmCustomer.getCustomerId(), qyjbxxByNsrmc.getBsrxm(), "办税人", qyjbxxByNsrmc.getBsryddh(), qyjbxxByNsrmc.getBsrgddh(), qyjbxxByNsrmc.getBsrdzxx());
}
}
}).start();
map.put("customerId", crmCustomer.getCustomerId()); map.put("customerId", crmCustomer.getCustomerId());
@ -631,13 +630,13 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
public void addCustomerByDjxx(CrmGsdjxx gsdjxx) { public void addCustomerByDjxx(CrmGsdjxx gsdjxx) {
CrmBusinessSaveBO crmModel = new CrmBusinessSaveBO(); CrmBusinessSaveBO crmModel = new CrmBusinessSaveBO();
Map<String, Object> entity = new HashMap<>(); Map<String, Object> entity = new HashMap<>();
entity.put("customerName",gsdjxx.getNsrmc()); entity.put("customerName", gsdjxx.getNsrmc());
entity.put("telephone",""); entity.put("telephone", "");
entity.put("mobile",""); entity.put("mobile", "");
entity.put("email",""); entity.put("email", "");
entity.put("website",""); entity.put("website", "");
entity.put("remark",""); entity.put("remark", "");
entity.put("address",""); entity.put("address", "");
crmModel.setEntity(entity); crmModel.setEntity(entity);
List<CrmModelFiledVO> list = new ArrayList<>(); List<CrmModelFiledVO> list = new ArrayList<>();
//加入时间 //加入时间