Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
30477cdc
提交
30477cdc
编写于
7月 08, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
6fd0b216
变更
12
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
309 行增加
和
3 行删除
+309
-3
lost-logic-base.ts
app_CRM/src/service/opportunity/lost-logic-base.ts
+83
-0
lost-logic.ts
app_CRM/src/service/opportunity/lost-logic.ts
+22
-0
opportunity-service-base.ts
app_CRM/src/service/opportunity/opportunity-service-base.ts
+1
-0
win-logic-base.ts
app_CRM/src/service/opportunity/win-logic-base.ts
+59
-1
Account.java
.../cn/ibizlab/businesscentral/core/base/domain/Account.java
+2
-0
IOpportunityLostLogic.java
...ntral/core/sales/service/logic/IOpportunityLostLogic.java
+18
-0
OpportunityLostLogicImpl.java
...re/sales/service/logic/impl/OpportunityLostLogicImpl.java
+56
-0
OpportunityWinLogicImpl.java
...ore/sales/service/logic/impl/OpportunityWinLogicImpl.java
+8
-0
OpportunityLostRule.drl
...ral-core/src/main/resources/rules/OpportunityLostRule.drl
+18
-0
OpportunityLostRuleFlow.bpmn
...ore/src/main/resources/rules/OpportunityLostRuleFlow.bpmn
+15
-0
OpportunityWinRule.drl
...tral-core/src/main/resources/rules/OpportunityWinRule.drl
+19
-0
OpportunityWinRuleFlow.bpmn
...core/src/main/resources/rules/OpportunityWinRuleFlow.bpmn
+8
-2
未找到文件。
app_CRM/src/service/opportunity/lost-logic-base.ts
0 → 100644
浏览文件 @
30477cdc
import
{
Verify
}
from
'@/utils/verify/verify'
;
/**
* 作为丢单结束
*
* @export
* @class LostLogicBase
*/
export
default
class
LostLogicBase
{
/**
* 名称
*
* @memberof LostLogicBase
*/
private
name
:
string
=
"Lost"
;
/**
* 唯一标识
*
* @memberof LostLogicBase
*/
private
id
:
string
=
"B1D85A42-1233-42FF-A463-1506BAE6FB4E"
;
/**
* 默认参数名称
*
* @memberof LostLogicBase
*/
private
defaultParamName
:
string
=
"Default"
;
/**
* 参数集合
*
* @memberof LostLogicBase
*/
private
paramsMap
:
Map
<
string
,
any
>
=
new
Map
();
/**
* Creates an instance of LostLogicBase.
*
* @param {*} [opts={}]
* @memberof LostLogicBase
*/
constructor
(
opts
:
any
=
{})
{
this
.
initParams
(
opts
);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof LostLogicBase
*/
public
initParams
(
opts
:
any
){
this
.
paramsMap
.
set
(
'Default'
,
opts
);
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public
onExecute
(
context
:
any
,
params
:
any
,
isloading
:
boolean
){
return
this
.
executeBegin
(
context
,
params
,
isloading
);
}
/**
* 开始
*
* @param params 传入参数
*/
private
async
executeBegin
(
context
:
any
,
params
:
any
,
isloading
:
boolean
){
//开始节点
return
this
.
paramsMap
.
get
(
this
.
defaultParamName
).
data
;
}
}
\ No newline at end of file
app_CRM/src/service/opportunity/lost-logic.ts
0 → 100644
浏览文件 @
30477cdc
import
{
Http
,
Util
}
from
'@/utils'
;
import
LostLogicBase
from
'./lost-logic-base'
;
/**
* 作为丢单结束
*
* @export
* @class LostLogic
*/
export
default
class
LostLogic
extends
LostLogicBase
{
/**
* Creates an instance of LostLogic
*
* @param {*} [opts={}]
* @memberof LostLogic
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_CRM/src/service/opportunity/opportunity-service-base.ts
浏览文件 @
30477cdc
import
{
Http
,
Util
}
from
'@/utils'
;
import
EntityService
from
'../entity-service'
;
import
LostLogic
from
'@/service/opportunity/lost-logic'
;
import
WinLogic
from
'@/service/opportunity/win-logic'
;
...
...
app_CRM/src/service/opportunity/win-logic-base.ts
浏览文件 @
30477cdc
import
OpportunityService
from
'@/service/opportunity/opportunity-service'
;
import
{
Verify
}
from
'@/utils/verify/verify'
;
...
...
@@ -58,6 +59,24 @@ export default class WinLogicBase {
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public
compute0Cond
(
params
:
any
):
boolean
{
return
true
;
}
/**
* 计算1节点结果
*
* @param params 传入参数
*/
public
compute1Cond
(
params
:
any
):
boolean
{
return
true
;
}
/**
* 执行逻辑
*
...
...
@@ -69,6 +88,43 @@ export default class WinLogicBase {
}
/**
* 准备参数
*
* @param context 应用上下文
* @param params 传入参数
*/
private
async
executePrepareparam1
(
context
:
any
,
params
:
any
,
isloading
:
boolean
){
// 准备参数节点
let
tempDstParam0Context
:
any
=
this
.
paramsMap
.
get
(
'Default'
).
context
?
this
.
paramsMap
.
get
(
'Default'
).
context
:{};
let
tempDstParam0Data
:
any
=
this
.
paramsMap
.
get
(
'Default'
).
data
?
this
.
paramsMap
.
get
(
'Default'
).
data
:{};
Object
.
assign
(
tempDstParam0Data
,{
statecode
:
"1"
});
this
.
paramsMap
.
set
(
'Default'
,{
data
:
tempDstParam0Data
,
context
:
tempDstParam0Context
});
if
(
this
.
compute1Cond
(
params
)){
return
this
.
executeDeaction1
(
context
,
params
,
isloading
);
}
}
/**
* 更新商机状态
*
* @param context 应用上下文
* @param params 传入参数
*/
private
async
executeDeaction1
(
context
:
any
,
params
:
any
,
isloading
:
boolean
){
// 行为处理节点
let
result
:
any
;
let
actionParam
:
any
=
this
.
paramsMap
.
get
(
'Default'
);
const
targetService
:
OpportunityService
=
new
OpportunityService
();
if
(
targetService
[
'Update'
]
&&
targetService
[
'Update'
]
instanceof
Function
)
{
result
=
await
targetService
[
'Update'
](
actionParam
.
context
,
actionParam
.
data
,
false
);
}
if
(
result
&&
result
.
status
==
200
){
Object
.
assign
(
actionParam
.
data
,
result
.
data
);
return
this
.
paramsMap
.
get
(
this
.
defaultParamName
).
data
;
}
}
/**
* 开始
*
...
...
@@ -76,7 +132,9 @@ export default class WinLogicBase {
*/
private
async
executeBegin
(
context
:
any
,
params
:
any
,
isloading
:
boolean
){
//开始节点
return
this
.
paramsMap
.
get
(
this
.
defaultParamName
).
data
;
if
(
this
.
compute0Cond
(
params
)){
return
this
.
executePrepareparam1
(
context
,
params
,
isloading
);
}
}
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/base/domain/Account.java
浏览文件 @
30477cdc
...
...
@@ -512,6 +512,7 @@ public class Account extends EntityMP implements Serializable {
/**
* 状态描述
*/
@DEField
(
defaultValue
=
"1"
)
@TableField
(
value
=
"statuscode"
)
@JSONField
(
name
=
"statuscode"
)
@JsonProperty
(
"statuscode"
)
...
...
@@ -756,6 +757,7 @@ public class Account extends EntityMP implements Serializable {
/**
* 状态
*/
@DEField
(
defaultValue
=
"1"
)
@TableField
(
value
=
"statecode"
)
@JSONField
(
name
=
"statecode"
)
@JsonProperty
(
"statecode"
)
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/logic/IOpportunityLostLogic.java
0 → 100644
浏览文件 @
30477cdc
package
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
logic
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
cn.ibizlab.businesscentral.core.sales.domain.Opportunity
;
/**
* 关系型数据实体[Lost] 对象
*/
public
interface
IOpportunityLostLogic
{
void
execute
(
Opportunity
opportunity
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/logic/impl/OpportunityLostLogicImpl.java
0 → 100644
浏览文件 @
30477cdc
package
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
logic
.
impl
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.kie.api.runtime.KieSession
;
import
org.kie.api.runtime.KieContainer
;
import
cn.ibizlab.businesscentral.core.sales.service.logic.IOpportunityLostLogic
;
import
cn.ibizlab.businesscentral.core.sales.domain.Opportunity
;
/**
* 关系型数据实体[Lost] 对象
*/
@Slf4j
@Service
public
class
OpportunityLostLogicImpl
implements
IOpportunityLostLogic
{
@Autowired
private
KieContainer
kieContainer
;
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
iBzSysDefaultService
;
public
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
getIBzSysDefaultService
()
{
return
this
.
iBzSysDefaultService
;
}
public
void
execute
(
Opportunity
et
){
KieSession
kieSession
=
null
;
try
{
kieSession
=
kieContainer
.
newKieSession
();
kieSession
.
insert
(
et
);
kieSession
.
setGlobal
(
"opportunitylostdefault"
,
et
);
kieSession
.
setGlobal
(
"iBzSysOpportunityDefaultService"
,
iBzSysDefaultService
);
kieSession
.
setGlobal
(
"curuser"
,
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
());
kieSession
.
startProcess
(
"cn.ibizlab.businesscentral.core.sales.service.logic.opportunitylost"
);
}
catch
(
Exception
e
){
throw
new
RuntimeException
(
"执行[作为丢单结束]处理逻辑发生异常"
+
e
);
}
finally
{
if
(
kieSession
!=
null
)
kieSession
.
destroy
();
}
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/logic/impl/OpportunityWinLogicImpl.java
浏览文件 @
30477cdc
...
...
@@ -26,6 +26,13 @@ public class OpportunityWinLogicImpl implements IOpportunityWinLogic{
@Autowired
private
KieContainer
kieContainer
;
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
opportunityservice
;
public
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
getOpportunityService
()
{
return
this
.
opportunityservice
;
}
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
iBzSysDefaultService
;
...
...
@@ -41,6 +48,7 @@ public class OpportunityWinLogicImpl implements IOpportunityWinLogic{
kieSession
=
kieContainer
.
newKieSession
();
kieSession
.
insert
(
et
);
kieSession
.
setGlobal
(
"opportunitywindefault"
,
et
);
kieSession
.
setGlobal
(
"opportunityservice"
,
opportunityservice
);
kieSession
.
setGlobal
(
"iBzSysOpportunityDefaultService"
,
iBzSysDefaultService
);
kieSession
.
setGlobal
(
"curuser"
,
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
());
kieSession
.
startProcess
(
"cn.ibizlab.businesscentral.core.sales.service.logic.opportunitywin"
);
...
...
businesscentral-core/src/main/resources/rules/OpportunityLostRule.drl
0 → 100644
浏览文件 @
30477cdc
package
cn
.
ibizlab
.
businesscentral
.
sales
.
logic
.
opportunitylogic
.
lost
;
import
java
.
util
.
Map
;
import
java
.
util
.
HashMap
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
Opportunity
opportunitylostdefault
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
iBzSysOpportunityDefaultService
;
global
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
curuser
;
no
-
loop
//
逻辑处理节点
[
开始
]
rule
"begin"
ruleflow
-
group
"opportunitylostbegin"
when
then
end
businesscentral-core/src/main/resources/rules/OpportunityLostRuleFlow.bpmn
0 → 100644
浏览文件 @
30477cdc
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<process
id=
"cn.ibizlab.businesscentral.core.sales.service.logic.opportunitylost"
isClosed=
"false"
isExecutable=
"true"
name=
"ScoreRule"
processType=
"Private"
tns:packageName=
"cn.ibizlab.businesscentral.core.sales.service.logic.opportunitylost"
>
<extensionElements>
<tns:import
name=
"java.util.Map"
/>
<tns:import
name=
"org.springframework.util.StringUtils"
/>
<tns:import
name=
"cn.ibizlab.businesscentral.util.helper.RuleUtils"
/>
<tns:global
identifier=
"opportunitylostdefault"
type=
"cn.ibizlab.businesscentral.core.sales.domain.Opportunity"
/>
</extensionElements>
<startEvent
id=
"B1D85A42-1233-42FF-A463-1506BAE6FB4E"
isInterrupting=
"true"
/>
<endEvent
id=
"B1D85A42-1233-42FF-A463-1506BAE6FB4E_End"
name=
"End"
/>
<sequenceFlow
id=
"B1D85A42-1233-42FF-A463-1506BAE6FB4E_End_Line"
sourceRef=
"B1D85A42-1233-42FF-A463-1506BAE6FB4E"
targetRef=
"B1D85A42-1233-42FF-A463-1506BAE6FB4E_End"
/>
</process>
</definitions>
businesscentral-core/src/main/resources/rules/OpportunityWinRule.drl
浏览文件 @
30477cdc
...
...
@@ -4,11 +4,30 @@ import java.util.Map;
import
java
.
util
.
HashMap
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
Opportunity
opportunitywindefault
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
opportunityservice
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
IOpportunityService
iBzSysOpportunityDefaultService
;
global
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
curuser
;
no
-
loop
//
逻辑处理节点
[
准备参数
]
rule
"prepareparam1"
ruleflow
-
group
"opportunitywinprepareparam1"
when
then
opportunitywindefault
.
set
(
"statecode"
,
"1"
);
update
(
opportunitywindefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
更新商机状态
]
rule
"deaction1"
ruleflow
-
group
"opportunitywindeaction1"
when
then
opportunityservice
.
update
(
opportunitywindefault
);
update
(
opportunitywindefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
开始
]
rule
"begin"
ruleflow
-
group
"opportunitywinbegin"
...
...
businesscentral-core/src/main/resources/rules/OpportunityWinRuleFlow.bpmn
浏览文件 @
30477cdc
...
...
@@ -7,9 +7,15 @@
<tns:import
name=
"cn.ibizlab.businesscentral.util.helper.RuleUtils"
/>
<tns:global
identifier=
"opportunitywindefault"
type=
"cn.ibizlab.businesscentral.core.sales.domain.Opportunity"
/>
</extensionElements>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"opportunitywinprepareparam1"
id=
"9AF21B6E-E640-462C-BEB7-73DB98CCA415"
implementation=
"http://www.jboss.org/drools/rule"
name=
"准备参数"
/>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"opportunitywindeaction1"
id=
"82449038-E49E-4D7C-A2E9-80652938DF37"
implementation=
"http://www.jboss.org/drools/rule"
name=
"更新商机状态"
/>
<endEvent
id=
"82449038-E49E-4D7C-A2E9-80652938DF37_End"
name=
"End"
/>
<sequenceFlow
id=
"82449038-E49E-4D7C-A2E9-80652938DF37_End_Line"
sourceRef=
"82449038-E49E-4D7C-A2E9-80652938DF37"
targetRef=
"82449038-E49E-4D7C-A2E9-80652938DF37_End"
/>
<startEvent
id=
"67643EA0-5920-48F8-8411-251152430059"
isInterrupting=
"true"
/>
<endEvent
id=
"67643EA0-5920-48F8-8411-251152430059_End"
name=
"End"
/>
<sequenceFlow
id=
"67643EA0-5920-48F8-8411-251152430059_End_Line"
sourceRef=
"67643EA0-5920-48F8-8411-251152430059"
targetRef=
"67643EA0-5920-48F8-8411-251152430059_End"
/>
<sequenceFlow
id=
"B950E7C9-997B-4606-A7F7-8469CCB133AC"
sourceRef=
"67643EA0-5920-48F8-8411-251152430059"
targetRef=
"9AF21B6E-E640-462C-BEB7-73DB98CCA415"
>
</sequenceFlow>
<sequenceFlow
id=
"8D9A63FE-EBE4-4DBD-B55E-E741DD40CF1C"
sourceRef=
"9AF21B6E-E640-462C-BEB7-73DB98CCA415"
targetRef=
"82449038-E49E-4D7C-A2E9-80652938DF37"
>
</sequenceFlow>
</process>
</definitions>
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录