Commit 7ae183ac by leialin

Merge branch 'lal' into 'develop'

提交

See merge request 8timerv2/8timerapiv200!466
parents 092c78de f893f0dc
...@@ -401,15 +401,15 @@ public class CrmController { ...@@ -401,15 +401,15 @@ public class CrmController {
Integer clientSource = crmClientData.getClientSource(); Integer clientSource = crmClientData.getClientSource();
Integer clientType = crmClientData.getClientType(); Integer clientType = crmClientData.getClientType();
Integer industry = crmClientData.getIndustry(); Integer industry = crmClientData.getIndustry();
if (clientSource != null) { if (clientSource != null && clientSource > 0) {
String clientSourceName = ClientSourceClass.builder().id(clientSource).build().selectById().getName(); // 客户来源 String clientSourceName = ClientSourceClass.builder().id(clientSource).build().selectById().getName(); // 客户来源
crmClientData.setClientSourceName(clientSourceName); crmClientData.setClientSourceName(clientSourceName);
} }
if (clientType != null) { if (clientType != null && clientType > 0) {
String clientTypeName = ClientTypeClass.builder().id(clientType).build().selectById().getName(); // 客户类型 String clientTypeName = ClientTypeClass.builder().id(clientType).build().selectById().getName(); // 客户类型
crmClientData.setClientTypeName(clientTypeName); crmClientData.setClientTypeName(clientTypeName);
} }
if (industry != null) { if (industry != null && industry > 0) {
String industryName = IndustryClass.builder().id(industry).build().selectById().getName();// 行业名 String industryName = IndustryClass.builder().id(industry).build().selectById().getName();// 行业名
crmClientData.setIndustryName(industryName); crmClientData.setIndustryName(industryName);
} }
...@@ -417,16 +417,20 @@ public class CrmController { ...@@ -417,16 +417,20 @@ public class CrmController {
return ResultUtil.error("新增失败"); return ResultUtil.error("新增失败");
Integer crmDataId = crmClientData.getId(); Integer crmDataId = crmClientData.getId();
Integer[] ids = crmClientData.getIds(); Integer[] ids = crmClientData.getIds();
for (Integer id : ids) { if(ids != null) {
CrmClientAssociate.builder().cid(crmDataId).associateId(id).orgCode(getOrgCode(userBean)).build().insert(); for (Integer id : ids) {
CrmClientAssociate.builder().cid(crmDataId).associateId(id).orgCode(getOrgCode(userBean)).build().insert();
}
} }
List<CrmClientContacts> crmClientContacts = crmClientData.getCrmClientContacts(); List<CrmClientContacts> crmClientContacts = crmClientData.getCrmClientContacts();
int contactsnum = 0; int contactsnum = 0;
for (CrmClientContacts crmClientContact : crmClientContacts) { if(crmClientContacts != null) {
if(crmClientContact.getName() != null) { for (CrmClientContacts crmClientContact : crmClientContacts) {
crmClientContact.setCid(crmDataId); if(crmClientContact.getName() != null) {
crmClientContact.insert(); crmClientContact.setCid(crmDataId);
contactsnum++; crmClientContact.insert();
contactsnum++;
}
} }
} }
crmClientData.setContactsNum(contactsnum); crmClientData.setContactsNum(contactsnum);
...@@ -474,6 +478,7 @@ public class CrmController { ...@@ -474,6 +478,7 @@ public class CrmController {
CrmClientAssociate.builder().cid(cid).associateId(id).orgCode(getOrgCode(userBean)).build().insert(); CrmClientAssociate.builder().cid(cid).associateId(id).orgCode(getOrgCode(userBean)).build().insert();
} }
crmClientData.setModifyUser(getEmpNum(userBean)); crmClientData.setModifyUser(getEmpNum(userBean));
crmClientData.setOrgCode(userBean.getOrgCode());
if (crmClientData.updateById()) if (crmClientData.updateById())
return ResultUtil.success("编辑成功"); return ResultUtil.success("编辑成功");
return ResultUtil.error("编辑失败"); return ResultUtil.error("编辑失败");
...@@ -1462,7 +1467,7 @@ public class CrmController { ...@@ -1462,7 +1467,7 @@ public class CrmController {
} }
crmClientData.setClientStatus(1); crmClientData.setClientStatus(1);
if(linkname != null) { if(!("").equals(linkname) && linkname != null) {
crmClientData.setContactsNum(1); crmClientData.setContactsNum(1);
} }
crmClientData.setBelongUser(empNum); crmClientData.setBelongUser(empNum);
...@@ -1487,7 +1492,7 @@ public class CrmController { ...@@ -1487,7 +1492,7 @@ public class CrmController {
Integer cid = crmClientData.getId(); Integer cid = crmClientData.getId();
if(linkname != null) { if(!("").equals(linkname) && linkname != null) {
CrmClientContacts contacts = new CrmClientContacts(); CrmClientContacts contacts = new CrmClientContacts();
contacts.setName(linkname); contacts.setName(linkname);
contacts.setCellphone(linkcellphone); contacts.setCellphone(linkcellphone);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment