Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz商业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz商业套件
iBiz商业中心
提交
6167b8f4
提交
6167b8f4
编写于
10月 23, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
8c293470
变更
9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
163 行增加
和
0 行删除
+163
-0
mail_messageFallback.java
...sscentral/core/odoo_mail/client/mail_messageFallback.java
+4
-0
mail_messageFeignClient.java
...entral/core/odoo_mail/client/mail_messageFeignClient.java
+4
-0
IMail_messageService.java
...scentral/core/odoo_mail/service/IMail_messageService.java
+1
-0
Mail_messageServiceImpl.java
.../core/odoo_mail/service/impl/Mail_messageServiceImpl.java
+12
-0
IMail_messagegenerate_tracking_message_idLogic.java
...logic/IMail_messagegenerate_tracking_message_idLogic.java
+18
-0
Mail_messagegenerate_tracking_message_idLogicImpl.java
...pl/Mail_messagegenerate_tracking_message_idLogicImpl.java
+64
-0
Mail_messagegenerate_tracking_message_idRule.drl
...es/rules/Mail_messagegenerate_tracking_message_idRule.drl
+31
-0
Mail_messagegenerate_tracking_message_idRuleFlow.bpmn
...les/Mail_messagegenerate_tracking_message_idRuleFlow.bpmn
+18
-0
Mail_messageResource.java
...izlab/businesscentral/core/rest/Mail_messageResource.java
+11
-0
未找到文件。
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/client/mail_messageFallback.java
浏览文件 @
6167b8f4
...
@@ -69,6 +69,10 @@ public class mail_messageFallback implements mail_messageFeignClient{
...
@@ -69,6 +69,10 @@ public class mail_messageFallback implements mail_messageFeignClient{
}
}
public
Mail_message
generate_tracking_message_id
(
Long
id
,
Mail_message
mail_message
){
return
null
;
}
public
Boolean
save
(
Mail_message
mail_message
){
public
Boolean
save
(
Mail_message
mail_message
){
return
false
;
return
false
;
}
}
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/client/mail_messageFeignClient.java
浏览文件 @
6167b8f4
...
@@ -64,6 +64,10 @@ public interface mail_messageFeignClient {
...
@@ -64,6 +64,10 @@ public interface mail_messageFeignClient {
Boolean
checkKey
(
@RequestBody
Mail_message
mail_message
);
Boolean
checkKey
(
@RequestBody
Mail_message
mail_message
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/mail_messages/{id}/generate_tracking_message_id"
)
Mail_message
generate_tracking_message_id
(
@PathVariable
(
"id"
)
Long
id
,
@RequestBody
Mail_message
mail_message
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/mail_messages/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/mail_messages/save"
)
Boolean
save
(
@RequestBody
Mail_message
mail_message
);
Boolean
save
(
@RequestBody
Mail_message
mail_message
);
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/service/IMail_messageService.java
浏览文件 @
6167b8f4
...
@@ -35,6 +35,7 @@ public interface IMail_messageService extends IService<Mail_message>{
...
@@ -35,6 +35,7 @@ public interface IMail_messageService extends IService<Mail_message>{
Mail_message
get
(
Long
key
)
;
Mail_message
get
(
Long
key
)
;
Mail_message
getDraft
(
Mail_message
et
)
;
Mail_message
getDraft
(
Mail_message
et
)
;
boolean
checkKey
(
Mail_message
et
)
;
boolean
checkKey
(
Mail_message
et
)
;
Mail_message
generate_tracking_message_id
(
Mail_message
et
)
;
boolean
save
(
Mail_message
et
)
;
boolean
save
(
Mail_message
et
)
;
void
saveBatch
(
List
<
Mail_message
>
list
)
;
void
saveBatch
(
List
<
Mail_message
>
list
)
;
Page
<
Mail_message
>
searchDefault
(
Mail_messageSearchContext
context
)
;
Page
<
Mail_message
>
searchDefault
(
Mail_messageSearchContext
context
)
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/service/impl/Mail_messageServiceImpl.java
浏览文件 @
6167b8f4
...
@@ -89,6 +89,10 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
...
@@ -89,6 +89,10 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
@Lazy
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_base
.
service
.
IRes_usersService
resUsersService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_base
.
service
.
IRes_usersService
resUsersService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
logic
.
IMail_messagegenerate_tracking_message_idLogic
generate_tracking_message_idLogic
;
protected
int
batchSize
=
500
;
protected
int
batchSize
=
500
;
public
String
getIrModel
(){
public
String
getIrModel
(){
...
@@ -102,6 +106,7 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
...
@@ -102,6 +106,7 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
boolean
mail_create_nolog
=
et
.
get
(
"mail_create_nolog"
)
!=
null
;
boolean
mail_create_nolog
=
et
.
get
(
"mail_create_nolog"
)
!=
null
;
boolean
mail_notrack
=
et
.
get
(
"mail_notrack"
)
!=
null
;
boolean
mail_notrack
=
et
.
get
(
"mail_notrack"
)
!=
null
;
fillParentData
(
et
);
fillParentData
(
et
);
generate_tracking_message_idLogic
.
execute
(
et
);
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
return
false
;
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
);
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
);
...
@@ -187,6 +192,13 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
...
@@ -187,6 +192,13 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
public
boolean
checkKey
(
Mail_message
et
)
{
public
boolean
checkKey
(
Mail_message
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getId
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getId
())));
return
(!
ObjectUtils
.
isEmpty
(
et
.
getId
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getId
())));
}
}
@Override
@Transactional
public
Mail_message
generate_tracking_message_id
(
Mail_message
et
)
{
//自定义代码
return
et
;
}
@Override
@Override
@Transactional
@Transactional
public
boolean
save
(
Mail_message
et
)
{
public
boolean
save
(
Mail_message
et
)
{
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/service/logic/IMail_messagegenerate_tracking_message_idLogic.java
0 → 100644
浏览文件 @
6167b8f4
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
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.odoo_mail.domain.Mail_message
;
/**
* 关系型数据实体[generate_tracking_message_id] 对象
*/
public
interface
IMail_messagegenerate_tracking_message_idLogic
{
void
execute
(
Mail_message
et
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/service/logic/impl/Mail_messagegenerate_tracking_message_idLogicImpl.java
0 → 100644
浏览文件 @
6167b8f4
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
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.odoo_mail.service.logic.IMail_messagegenerate_tracking_message_idLogic
;
import
cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_message
;
/**
* 关系型数据实体[generate_tracking_message_id] 对象
*/
@Slf4j
@Service
public
class
Mail_messagegenerate_tracking_message_idLogicImpl
implements
IMail_messagegenerate_tracking_message_idLogic
{
@Autowired
private
KieContainer
kieContainer
;
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_messageService
mail_messageservice
;
public
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_messageService
getMail_messageService
()
{
return
this
.
mail_messageservice
;
}
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_messageService
iBzSysDefaultService
;
public
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_messageService
getIBzSysDefaultService
()
{
return
this
.
iBzSysDefaultService
;
}
public
void
execute
(
Mail_message
et
){
KieSession
kieSession
=
null
;
try
{
kieSession
=
kieContainer
.
newKieSession
();
kieSession
.
insert
(
et
);
kieSession
.
setGlobal
(
"mail_messagegenerate_tracking_message_iddefault"
,
et
);
kieSession
.
setGlobal
(
"mail_messageservice"
,
mail_messageservice
);
kieSession
.
setGlobal
(
"iBzSysMail_messageDefaultService"
,
iBzSysDefaultService
);
kieSession
.
setGlobal
(
"curuser"
,
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
());
kieSession
.
startProcess
(
"cn.ibizlab.businesscentral.core.odoo_mail.service.logic.mail_messagegenerate_tracking_message_id"
);
}
catch
(
Exception
e
){
throw
new
RuntimeException
(
"执行[generate_tracking_message_id]处理逻辑发生异常"
+
e
);
}
finally
{
if
(
kieSession
!=
null
)
kieSession
.
destroy
();
}
}
}
businesscentral-core/src/main/resources/rules/Mail_messagegenerate_tracking_message_idRule.drl
0 → 100644
浏览文件 @
6167b8f4
package
cn
.
ibizlab
.
businesscentral
.
odoo_mail
.
logic
.
mail_messagelogic
.
generate_tracking_message_id
;
import
java
.
util
.
Map
;
import
java
.
util
.
HashMap
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
util
.
ObjectUtils
;
import
cn
.
ibizlab
.
businesscentral
.
util
.
errors
.
BadRequestAlertException
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
domain
.
Mail_message
mail_messagegenerate_tracking_message_iddefault
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_messageService
mail_messageservice
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_messageService
iBzSysMail_messageDefaultService
;
global
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
curuser
;
no
-
loop
//
逻辑处理节点
[
generate_tracking_message_id
]
rule
"deaction1"
ruleflow
-
group
"mail_messagegenerate_tracking_message_iddeaction1"
when
then
mail_messageservice
.
generate_tracking_message_id
(
mail_messagegenerate_tracking_message_iddefault
);
update
(
mail_messagegenerate_tracking_message_iddefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
开始
]
rule
"begin"
ruleflow
-
group
"mail_messagegenerate_tracking_message_idbegin"
when
then
end
businesscentral-core/src/main/resources/rules/Mail_messagegenerate_tracking_message_idRuleFlow.bpmn
0 → 100644
浏览文件 @
6167b8f4
<?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.odoo_mail.service.logic.mail_messagegenerate_tracking_message_id"
isClosed=
"false"
isExecutable=
"true"
name=
"ScoreRule"
processType=
"Private"
tns:packageName=
"cn.ibizlab.businesscentral.core.odoo_mail.service.logic.mail_messagegenerate_tracking_message_id"
>
<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=
"mail_messagegenerate_tracking_message_iddefault"
type=
"cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_message"
/>
</extensionElements>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"mail_messagegenerate_tracking_message_iddeaction1"
id=
"deaction1"
implementation=
"http://www.jboss.org/drools/rule"
name=
"generate_tracking_message_id"
/>
<endEvent
id=
"deaction1_end"
name=
"end"
/>
<sequenceFlow
id=
"deaction1_end_line"
sourceRef=
"deaction1"
targetRef=
"deaction1_end"
/>
<startEvent
id=
"begin"
isInterrupting=
"true"
/>
<sequenceFlow
id=
"begin_deaction1"
sourceRef=
"begin"
targetRef=
"deaction1"
>
</sequenceFlow>
</process>
</definitions>
businesscentral-provider/businesscentral-provider-core/src/main/java/cn/ibizlab/businesscentral/core/rest/Mail_messageResource.java
浏览文件 @
6167b8f4
...
@@ -121,6 +121,17 @@ public class Mail_messageResource {
...
@@ -121,6 +121,17 @@ public class Mail_messageResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
mail_messageService
.
checkKey
(
mail_messageMapping
.
toDomain
(
mail_messagedto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
mail_messageService
.
checkKey
(
mail_messageMapping
.
toDomain
(
mail_messagedto
)));
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_message-Generate_tracking_message_id-all')"
)
@ApiOperation
(
value
=
"generate_tracking_message_id"
,
tags
=
{
"消息"
},
notes
=
"generate_tracking_message_id"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/mail_messages/{mail_message_id}/generate_tracking_message_id"
)
public
ResponseEntity
<
Mail_messageDTO
>
generate_tracking_message_id
(
@PathVariable
(
"mail_message_id"
)
Long
mail_message_id
,
@RequestBody
Mail_messageDTO
mail_messagedto
)
{
Mail_message
domain
=
mail_messageMapping
.
toDomain
(
mail_messagedto
);
domain
.
setId
(
mail_message_id
);
domain
=
mail_messageService
.
generate_tracking_message_id
(
domain
);
mail_messagedto
=
mail_messageMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
mail_messagedto
);
}
@PreAuthorize
(
"hasPermission(this.mail_messageMapping.toDomain(#mail_messagedto),'iBizBusinessCentral-Mail_message-Save')"
)
@PreAuthorize
(
"hasPermission(this.mail_messageMapping.toDomain(#mail_messagedto),'iBizBusinessCentral-Mail_message-Save')"
)
@ApiOperation
(
value
=
"保存消息"
,
tags
=
{
"消息"
},
notes
=
"保存消息"
)
@ApiOperation
(
value
=
"保存消息"
,
tags
=
{
"消息"
},
notes
=
"保存消息"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/mail_messages/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/mail_messages/save"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录