Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
b25422fa
提交
b25422fa
编写于
7月 13, 2020
作者:
misaka
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
潜在客户转换
上级
387539fa
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
160 行增加
和
0 行删除
+160
-0
AccountExService.java
...nesscentral/core/extensions/service/AccountExService.java
+36
-0
LeadExService.java
...usinesscentral/core/extensions/service/LeadExService.java
+124
-0
未找到文件。
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/extensions/service/AccountExService.java
浏览文件 @
b25422fa
package
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
;
import
cn.ibizlab.businesscentral.core.base.service.impl.AccountServiceImpl
;
import
cn.ibizlab.businesscentral.core.scheduling.domain.FISAccount
;
import
cn.ibizlab.businesscentral.core.scheduling.domain.PSAccount
;
import
cn.ibizlab.businesscentral.core.scheduling.service.IFISAccountService
;
import
cn.ibizlab.businesscentral.core.scheduling.service.IPSAccountService
;
import
liquibase.pro.packaged.A
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.businesscentral.core.base.domain.Account
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Primary
;
...
...
@@ -31,5 +37,35 @@ public class AccountExService extends AccountServiceImpl {
public
Account
addList
(
Account
et
)
{
return
super
.
addList
(
et
);
}
@Autowired
IPSAccountService
ipsAccountService
;
@Autowired
IFISAccountService
ifisAccountService
;
@Override
public
boolean
update
(
Account
et
)
{
//更新 account
boolean
bOk
=
super
.
update
(
et
);
//调用服务 project 更新 psaccount
//调用失败、错误 --> 回滚 account 的更新
// PSAccount psAccount = new PSAccount() ;
// psAccount.setAccountid(et.getAccountid());
// psAccount.setPsaexternalaccountid("pssaexternalaccountid");
//
// ipsAccountService.update(psAccount) ;
//调用服务 filed 更新 fisaccount
//调用失败、错误 --> 回滚 project 的 psaccount 更新 ; 回滚 account 的更新
// FISAccount fisAccount = new FISAccount() ;
// fisAccount.setAccountid(et.getAccountid());
// fisAccount.setFisworkorderinstructions("fisworkorderinstructions");
//
// ifisAccountService.update(fisAccount) ;
return
bOk
;
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/extensions/service/LeadExService.java
浏览文件 @
b25422fa
package
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
;
import
cn.ibizlab.businesscentral.core.base.domain.Account
;
import
cn.ibizlab.businesscentral.core.base.domain.Contact
;
import
cn.ibizlab.businesscentral.core.runtime.domain.Connection
;
import
cn.ibizlab.businesscentral.core.runtime.domain.ConnectionRole
;
import
cn.ibizlab.businesscentral.core.runtime.filter.ConnectionRoleSearchContext
;
import
cn.ibizlab.businesscentral.core.runtime.filter.ConnectionSearchContext
;
import
cn.ibizlab.businesscentral.core.runtime.service.IConnectionRoleService
;
import
cn.ibizlab.businesscentral.core.runtime.service.IConnectionService
;
import
cn.ibizlab.businesscentral.core.runtime.service.impl.ConnectionServiceImpl
;
import
cn.ibizlab.businesscentral.core.sales.domain.LeadCompetitor
;
import
cn.ibizlab.businesscentral.core.sales.domain.Opportunity
;
import
cn.ibizlab.businesscentral.core.sales.domain.OpportunityCompetitor
;
import
cn.ibizlab.businesscentral.core.sales.service.IOpportunityCompetitorService
;
import
cn.ibizlab.businesscentral.core.sales.service.impl.LeadServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.businesscentral.core.sales.domain.Lead
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Primary
;
...
...
@@ -16,6 +31,15 @@ import java.util.*;
@Service
(
"LeadExService"
)
public
class
LeadExService
extends
LeadServiceImpl
{
@Autowired
IOpportunityCompetitorService
opportunityCompetitorService
;
@Autowired
IConnectionRoleService
connectionRoleService
;
@Autowired
IConnectionService
connectionService
;
@Override
protected
Class
currentModelClass
()
{
return
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ReflectionKit
.
getSuperClassGenericType
(
this
.
getClass
().
getSuperclass
(),
1
);
...
...
@@ -59,6 +83,106 @@ public class LeadExService extends LeadServiceImpl {
@Override
@Transactional
public
Lead
qualification
(
Lead
et
)
{
et
=
this
.
get
(
et
.
getLeadid
())
;
Contact
contact
=
new
Contact
()
;
Account
account
=
new
Account
();
if
(
StringUtils
.
isBlank
(
et
.
getParentcontactid
())
&&
StringUtils
.
isNotBlank
(
et
.
getFullname
())){
contact
.
setFullname
(
et
.
getFullname
());
contact
.
setOriginatingleadid
(
et
.
getLeadid
());
contact
.
setFullname
(
et
.
getFullname
());
contactService
.
create
(
contact
);
}
else
{
contact
=
contactService
.
get
(
et
.
getParentcontactid
())
;
}
if
(
StringUtils
.
isBlank
(
et
.
getParentaccountid
())
&&
StringUtils
.
isNotBlank
(
et
.
getCompanyname
())){
account
.
setAccountname
(
et
.
getCompanyname
());
account
.
setOriginatingleadid
(
et
.
getLeadid
());
account
.
setOriginatingleadname
(
et
.
getCompanyname
());
account
.
setPrimarycontactid
(
contact
.
getContactid
());
account
.
setPrimarycontactname
(
contact
.
getFullname
());
account
.
setWebsiteurl
(
et
.
getWebsiteurl
());
accountService
.
create
(
account
)
;
}
else
{
account
=
accountService
.
get
(
et
.
getParentaccountid
())
;
}
contact
.
setCustomerid
(
account
.
getAccountid
());
contact
.
setCusomername
(
account
.
getAccountname
());
contactService
.
update
(
contact
);
ConnectionRoleSearchContext
rolecxt
=
new
ConnectionRoleSearchContext
()
;
rolecxt
.
setN_category_eq
(
"1000"
);
rolecxt
.
setN_statecode_eq
(
0
);
List
<
ConnectionRole
>
connectionRoles
=
connectionRoleService
.
searchDefault
(
rolecxt
).
getContent
()
;
//潜在客户 利益干系人
ConnectionSearchContext
cxt
=
new
ConnectionSearchContext
()
;
Map
<
String
,
Object
>
params
=
new
HashMap
<>()
;
params
.
put
(
"srfparentkey"
,
et
.
getLeadid
())
;
cxt
.
setParams
(
params
);
List
<
Connection
>
connections
=
connectionService
.
searchByParentKey
(
cxt
).
getContent
()
;
if
(
connections
.
size
()
==
0
){
Connection
connection
=
new
Connection
()
;
connection
.
setRecord1id
(
et
.
getLeadid
());
connection
.
setRecord1idobjecttypecode
(
et
.
getFullname
());
connection
.
setRecord1objecttypecode
(
"LEAD"
);
connection
.
setRecord2id
(
contact
.
getContactid
());
connection
.
setRecord2idobjecttypecode
(
contact
.
getFullname
());
connection
.
setRecord2objecttypecode
(
"CONTACT"
);
if
(
connectionRoles
.
size
()>
0
){
connection
.
setRecord1roleid
(
connectionRoles
.
get
(
0
).
getConnectionroleid
());
connection
.
setRecord1rolename
(
connectionRoles
.
get
(
0
).
getConnectionrolename
());
}
connectionService
.
create
(
connection
);
connections
.
add
(
connection
);
}
// 建立商机
Opportunity
opportunity
=
new
Opportunity
()
;
opportunity
.
setParentcontactid
(
contact
.
getContactid
());
opportunity
.
setParentcontactname
(
contact
.
getFullname
());
opportunity
.
setParentaccountid
(
account
.
getAccountid
());
opportunity
.
setParentaccountname
(
account
.
getAccountname
());
opportunity
.
setOriginatingleadid
(
et
.
getLeadid
());
opportunity
.
setOriginatingleadname
(
et
.
getFullname
());
opportunity
.
setBudgetamount
(
et
.
getBudgetamount
());
opportunity
.
setDecisionmaker
(
et
.
getDecisionmaker
());
opportunity
.
setDescription
(
et
.
getDescription
());
opportunity
.
setPurchaseprocess
(
et
.
getPurchaseprocess
());
opportunity
.
setPurchasetimeframe
(
et
.
getPurchasetimeframe
());
opportunity
.
setStatecode
(
0
);
opportunity
.
setStatuscode
(
1
);
opportunityService
.
create
(
opportunity
)
;
//商机 利益干系人
for
(
Connection
connection:
connections
)
{
connection
.
setConnectionid
(
null
);
connection
.
setRecord1id
(
opportunity
.
getOpportunityid
());
connection
.
setRecord1idobjecttypecode
(
opportunity
.
getOpportunityname
());
connection
.
setRecord1objecttypecode
(
"OPPORTUNITY"
);
connectionService
.
create
(
connection
);
}
//对手
List
<
LeadCompetitor
>
leadCompetitors
=
leadcompetitorService
.
selectByEntityid
(
et
.
getLeadid
())
;
for
(
LeadCompetitor
ladCompetitor:
leadCompetitors
)
{
OpportunityCompetitor
opportunityCompetitor
=
new
OpportunityCompetitor
()
;
opportunityCompetitor
.
setEntityid
(
opportunity
.
getOpportunityid
());
opportunityCompetitor
.
setEntityname
(
opportunity
.
getOpportunityname
());
opportunityCompetitor
.
setEntity2id
(
ladCompetitor
.
getEntity2id
());
opportunityCompetitor
.
setEntity2name
(
ladCompetitor
.
getEntity2name
());
opportunityCompetitorService
.
create
(
opportunityCompetitor
)
;
}
et
.
setStatecode
(
1
);
et
.
setStatuscode
(
3
);
this
.
update
(
et
)
;
return
super
.
qualification
(
et
);
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录