Commit f893f0dc by ilal

提交

parent 20c25be5
......@@ -401,15 +401,15 @@ public class CrmController {
Integer clientSource = crmClientData.getClientSource();
Integer clientType = crmClientData.getClientType();
Integer industry = crmClientData.getIndustry();
if (clientSource != null) {
if (clientSource != null && clientSource > 0) {
String clientSourceName = ClientSourceClass.builder().id(clientSource).build().selectById().getName(); // 客户来源
crmClientData.setClientSourceName(clientSourceName);
}
if (clientType != null) {
if (clientType != null && clientType > 0) {
String clientTypeName = ClientTypeClass.builder().id(clientType).build().selectById().getName(); // 客户类型
crmClientData.setClientTypeName(clientTypeName);
}
if (industry != null) {
if (industry != null && industry > 0) {
String industryName = IndustryClass.builder().id(industry).build().selectById().getName();// 行业名
crmClientData.setIndustryName(industryName);
}
......@@ -417,11 +417,14 @@ public class CrmController {
return ResultUtil.error("新增失败");
Integer crmDataId = crmClientData.getId();
Integer[] ids = crmClientData.getIds();
if(ids != null) {
for (Integer id : ids) {
CrmClientAssociate.builder().cid(crmDataId).associateId(id).orgCode(getOrgCode(userBean)).build().insert();
}
}
List<CrmClientContacts> crmClientContacts = crmClientData.getCrmClientContacts();
int contactsnum = 0;
if(crmClientContacts != null) {
for (CrmClientContacts crmClientContact : crmClientContacts) {
if(crmClientContact.getName() != null) {
crmClientContact.setCid(crmDataId);
......@@ -429,6 +432,7 @@ public class CrmController {
contactsnum++;
}
}
}
crmClientData.setContactsNum(contactsnum);
crmClientData.updateById();
return ResultUtil.success("新增成功");
......@@ -474,6 +478,7 @@ public class CrmController {
CrmClientAssociate.builder().cid(cid).associateId(id).orgCode(getOrgCode(userBean)).build().insert();
}
crmClientData.setModifyUser(getEmpNum(userBean));
crmClientData.setOrgCode(userBean.getOrgCode());
if (crmClientData.updateById())
return ResultUtil.success("编辑成功");
return ResultUtil.error("编辑失败");
......@@ -1462,7 +1467,7 @@ public class CrmController {
}
crmClientData.setClientStatus(1);
if(linkname != null) {
if(!("").equals(linkname) && linkname != null) {
crmClientData.setContactsNum(1);
}
crmClientData.setBelongUser(empNum);
......@@ -1487,7 +1492,7 @@ public class CrmController {
Integer cid = crmClientData.getId();
if(linkname != null) {
if(!("").equals(linkname) && linkname != null) {
CrmClientContacts contacts = new CrmClientContacts();
contacts.setName(linkname);
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