Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz商业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz商业套件
iBiz商业中心
提交
9f05ad0a
提交
9f05ad0a
编写于
10月 28, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码,后台体系[Spring Boot]
上级
3af9428a
变更
11
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
379 行增加
和
2 行删除
+379
-2
Purchase_order_lineExService.java
...core/extensions/service/Purchase_order_lineExService.java
+10
-0
purchase_order_lineFallback.java
...ore/odoo_purchase/client/purchase_order_lineFallback.java
+8
-0
purchase_order_lineFeignClient.java
.../odoo_purchase/client/purchase_order_lineFeignClient.java
+8
-0
IPurchase_order_lineService.java
...re/odoo_purchase/service/IPurchase_order_lineService.java
+2
-0
Purchase_order_lineServiceImpl.java
...purchase/service/impl/Purchase_order_lineServiceImpl.java
+23
-0
IPurchase_order_linecalc_amountLogic.java
...e/service/logic/IPurchase_order_linecalc_amountLogic.java
+18
-0
Purchase_order_linecalc_amountLogicImpl.java
...e/logic/impl/Purchase_order_linecalc_amountLogicImpl.java
+75
-0
Purchase_order_linecalc_amountRule.drl
...in/resources/rules/Purchase_order_linecalc_amountRule.drl
+54
-0
Purchase_order_linecalc_amountRuleFlow.bpmn
...sources/rules/Purchase_order_linecalc_amountRuleFlow.bpmn
+25
-0
Purchase_orderResource.java
...lab/businesscentral/core/rest/Purchase_orderResource.java
+1
-1
Purchase_order_lineResource.java
...usinesscentral/core/rest/Purchase_order_lineResource.java
+155
-1
未找到文件。
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/extensions/service/Purchase_order_lineExService.java
浏览文件 @
9f05ad0a
...
...
@@ -21,6 +21,16 @@ public class Purchase_order_lineExService extends Purchase_order_lineServiceImpl
return
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ReflectionKit
.
getSuperClassGenericType
(
this
.
getClass
().
getSuperclass
(),
1
);
}
/**
* 自定义行为[Calc_amount]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public
Purchase_order_line
calc_amount
(
Purchase_order_line
et
)
{
return
super
.
calc_amount
(
et
);
}
/**
* 自定义行为[Product_change]用户扩展
* @param et
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_purchase/client/purchase_order_lineFallback.java
浏览文件 @
9f05ad0a
...
...
@@ -64,6 +64,14 @@ public class purchase_order_lineFallback implements purchase_order_lineFeignClie
public
Purchase_order_line
calc_amount
(
Long
id
,
Purchase_order_line
purchase_order_line
){
return
null
;
}
public
Purchase_order_line
calc_price
(
Long
id
,
Purchase_order_line
purchase_order_line
){
return
null
;
}
public
Boolean
checkKey
(
Purchase_order_line
purchase_order_line
){
return
false
;
}
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_purchase/client/purchase_order_lineFeignClient.java
浏览文件 @
9f05ad0a
...
...
@@ -60,6 +60,14 @@ public interface purchase_order_lineFeignClient {
Purchase_order_line
getDraft
();
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/purchase_order_lines/{id}/calc_amount"
)
Purchase_order_line
calc_amount
(
@PathVariable
(
"id"
)
Long
id
,
@RequestBody
Purchase_order_line
purchase_order_line
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/purchase_order_lines/{id}/calc_price"
)
Purchase_order_line
calc_price
(
@PathVariable
(
"id"
)
Long
id
,
@RequestBody
Purchase_order_line
purchase_order_line
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/purchase_order_lines/checkkey"
)
Boolean
checkKey
(
@RequestBody
Purchase_order_line
purchase_order_line
);
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_purchase/service/IPurchase_order_lineService.java
浏览文件 @
9f05ad0a
...
...
@@ -34,6 +34,8 @@ public interface IPurchase_order_lineService extends IService<Purchase_order_lin
void
removeBatch
(
Collection
<
Long
>
idList
)
;
Purchase_order_line
get
(
Long
key
)
;
Purchase_order_line
getDraft
(
Purchase_order_line
et
)
;
Purchase_order_line
calc_amount
(
Purchase_order_line
et
)
;
Purchase_order_line
calc_price
(
Purchase_order_line
et
)
;
boolean
checkKey
(
Purchase_order_line
et
)
;
Purchase_order_line
product_change
(
Purchase_order_line
et
)
;
boolean
save
(
Purchase_order_line
et
)
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_purchase/service/impl/Purchase_order_lineServiceImpl.java
浏览文件 @
9f05ad0a
...
...
@@ -93,6 +93,10 @@ public class Purchase_order_lineServiceImpl extends EBSServiceImpl<Purchase_orde
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_uom
.
service
.
IUom_uomService
uomUomService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
logic
.
IPurchase_order_linecalc_amountLogic
calc_amountLogic
;
protected
int
batchSize
=
500
;
public
String
getIrModel
(){
...
...
@@ -115,6 +119,7 @@ public class Purchase_order_lineServiceImpl extends EBSServiceImpl<Purchase_orde
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
);
calc_amountLogic
.
execute
(
et
);
if
(
messageinfo
&&
!
mail_create_nosubscribe
)
{
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
SpringContextHolder
.
getBean
(
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
.
Mail_followersExService
.
class
).
add_default_followers
(
this
,
et
);
...
...
@@ -148,6 +153,7 @@ public class Purchase_order_lineServiceImpl extends EBSServiceImpl<Purchase_orde
if
(!
update
(
et
,(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"id"
,
et
.
getId
())))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
);
calc_amountLogic
.
execute
(
et
);
if
(
messageinfo
&&
!
mail_notrack
)
{
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
SpringContextHolder
.
getBean
(
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
.
Mail_tracking_valueExService
.
class
).
message_track
(
this
,
old
,
et
);
}
...
...
@@ -164,7 +170,10 @@ public class Purchase_order_lineServiceImpl extends EBSServiceImpl<Purchase_orde
@Override
@Transactional
public
boolean
remove
(
Long
key
)
{
Purchase_order_line
et
=
new
Purchase_order_line
();
et
.
set
(
"id"
,
key
);
boolean
result
=
removeById
(
key
);
calc_amountLogic
.
execute
(
et
);
return
result
;
}
...
...
@@ -193,6 +202,20 @@ public class Purchase_order_lineServiceImpl extends EBSServiceImpl<Purchase_orde
return
et
;
}
@Override
@Transactional
public
Purchase_order_line
calc_amount
(
Purchase_order_line
et
)
{
//自定义代码
return
et
;
}
@Override
@Transactional
public
Purchase_order_line
calc_price
(
Purchase_order_line
et
)
{
calc_amountLogic
.
execute
(
et
);
return
et
;
}
@Override
public
boolean
checkKey
(
Purchase_order_line
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getId
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getId
())));
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_purchase/service/logic/IPurchase_order_linecalc_amountLogic.java
0 → 100644
浏览文件 @
9f05ad0a
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
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_purchase.domain.Purchase_order_line
;
/**
* 关系型数据实体[calc_amount] 对象
*/
public
interface
IPurchase_order_linecalc_amountLogic
{
void
execute
(
Purchase_order_line
et
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_purchase/service/logic/impl/Purchase_order_linecalc_amountLogicImpl.java
0 → 100644
浏览文件 @
9f05ad0a
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
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_purchase.service.logic.IPurchase_order_linecalc_amountLogic
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order_line
;
/**
* 关系型数据实体[calc_amount] 对象
*/
@Slf4j
@Service
public
class
Purchase_order_linecalc_amountLogicImpl
implements
IPurchase_order_linecalc_amountLogic
{
@Autowired
private
KieContainer
kieContainer
;
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_orderService
purchase_orderservice
;
public
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_orderService
getPurchase_orderService
()
{
return
this
.
purchase_orderservice
;
}
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_order_lineService
purchase_order_lineservice
;
public
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_order_lineService
getPurchase_order_lineService
()
{
return
this
.
purchase_order_lineservice
;
}
@Autowired
private
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_order_lineService
iBzSysDefaultService
;
public
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_order_lineService
getIBzSysDefaultService
()
{
return
this
.
iBzSysDefaultService
;
}
public
void
execute
(
Purchase_order_line
et
){
KieSession
kieSession
=
null
;
try
{
kieSession
=
kieContainer
.
newKieSession
();
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
domain
.
Purchase_order
purchase_order_linecalc_amountorder
=
new
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
domain
.
Purchase_order
();
kieSession
.
insert
(
purchase_order_linecalc_amountorder
);
kieSession
.
setGlobal
(
"purchase_order_linecalc_amountorder"
,
purchase_order_linecalc_amountorder
);
kieSession
.
insert
(
et
);
kieSession
.
setGlobal
(
"purchase_order_linecalc_amountdefault"
,
et
);
kieSession
.
setGlobal
(
"purchase_orderservice"
,
purchase_orderservice
);
kieSession
.
setGlobal
(
"purchase_order_lineservice"
,
purchase_order_lineservice
);
kieSession
.
setGlobal
(
"iBzSysPurchase_order_lineDefaultService"
,
iBzSysDefaultService
);
kieSession
.
setGlobal
(
"curuser"
,
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
());
kieSession
.
startProcess
(
"cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.purchase_order_linecalc_amount"
);
}
catch
(
Exception
e
){
throw
new
RuntimeException
(
"执行[计算订单金额]处理逻辑发生异常"
+
e
);
}
finally
{
if
(
kieSession
!=
null
)
kieSession
.
destroy
();
}
}
}
businesscentral-core/src/main/resources/rules/Purchase_order_linecalc_amountRule.drl
0 → 100644
浏览文件 @
9f05ad0a
package
cn
.
ibizlab
.
businesscentral
.
odoo_purchase
.
logic
.
purchase_order_linelogic
.
calc_amount
;
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_purchase
.
domain
.
Purchase_order
purchase_order_linecalc_amountorder
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
domain
.
Purchase_order_line
purchase_order_linecalc_amountdefault
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_orderService
purchase_orderservice
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_order_lineService
purchase_order_lineservice
;
global
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_purchase
.
service
.
IPurchase_order_lineService
iBzSysPurchase_order_lineDefaultService
;
global
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
AuthenticationUser
curuser
;
no
-
loop
//
逻辑处理节点
[
calc_amount
]
rule
"deaction1"
ruleflow
-
group
"purchase_order_linecalc_amountdeaction1"
when
then
purchase_orderservice
.
calc_amount
(
purchase_order_linecalc_amountdefault
);
update
(
purchase_order_linecalc_amountorder
);//
更新
fact
中变量值
update
(
purchase_order_linecalc_amountdefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
准备订单参数
]
rule
"prepareparam1"
ruleflow
-
group
"purchase_order_linecalc_amountprepareparam1"
when
then
purchase_order_linecalc_amountorder
.
set
(
"id"
,
purchase_order_linecalc_amountdefault
.
get
(
"orderid"
));
update
(
purchase_order_linecalc_amountorder
);//
更新
fact
中变量值
update
(
purchase_order_linecalc_amountdefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
get_line
]
rule
"deaction2"
ruleflow
-
group
"purchase_order_linecalc_amountdeaction2"
when
then
cn
.
ibizlab
.
businesscentral
.
util
.
helper
.
CachedBeanCopier
.
copy
(
purchase_order_lineservice
.
get
(
purchase_order_linecalc_amountdefault
.
getId
()),
purchase_order_linecalc_amountdefault
);
update
(
purchase_order_linecalc_amountorder
);//
更新
fact
中变量值
update
(
purchase_order_linecalc_amountdefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
开始
]
rule
"begin"
ruleflow
-
group
"purchase_order_linecalc_amountbegin"
when
then
end
businesscentral-core/src/main/resources/rules/Purchase_order_linecalc_amountRuleFlow.bpmn
0 → 100644
浏览文件 @
9f05ad0a
<?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_purchase.service.logic.purchase_order_linecalc_amount"
isClosed=
"false"
isExecutable=
"true"
name=
"ScoreRule"
processType=
"Private"
tns:packageName=
"cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.purchase_order_linecalc_amount"
>
<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=
"purchase_order_linecalc_amountorder"
type=
"cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order"
/>
<tns:global
identifier=
"purchase_order_linecalc_amountdefault"
type=
"cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order_line"
/>
</extensionElements>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"purchase_order_linecalc_amountdeaction1"
id=
"deaction1"
implementation=
"http://www.jboss.org/drools/rule"
name=
"calc_amount"
/>
<endEvent
id=
"deaction1_end"
name=
"end"
/>
<sequenceFlow
id=
"deaction1_end_line"
sourceRef=
"deaction1"
targetRef=
"deaction1_end"
/>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"purchase_order_linecalc_amountprepareparam1"
id=
"prepareparam1"
implementation=
"http://www.jboss.org/drools/rule"
name=
"准备订单参数"
/>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"purchase_order_linecalc_amountdeaction2"
id=
"deaction2"
implementation=
"http://www.jboss.org/drools/rule"
name=
"get_line"
/>
<startEvent
id=
"begin"
isInterrupting=
"true"
/>
<sequenceFlow
id=
"begin_deaction2"
sourceRef=
"begin"
targetRef=
"deaction2"
>
</sequenceFlow>
<sequenceFlow
id=
"deaction2_prepareparam1"
sourceRef=
"deaction2"
targetRef=
"prepareparam1"
>
</sequenceFlow>
<sequenceFlow
id=
"prepareparam1_deaction1"
sourceRef=
"prepareparam1"
targetRef=
"deaction1"
>
</sequenceFlow>
</process>
</definitions>
businesscentral-provider/businesscentral-provider-core/src/main/java/cn/ibizlab/businesscentral/core/rest/Purchase_orderResource.java
浏览文件 @
9f05ad0a
...
...
@@ -171,7 +171,7 @@ public class Purchase_orderResource {
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Calc_amount-all')"
)
@ApiOperation
(
value
=
"
calc_amount"
,
tags
=
{
"采购订单"
},
notes
=
"calc_amount
"
)
@ApiOperation
(
value
=
"
计算订单金额"
,
tags
=
{
"采购订单"
},
notes
=
"计算订单金额
"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/purchase_orders/{purchase_order_id}/calc_amount"
)
public
ResponseEntity
<
Purchase_orderDTO
>
calc_amount
(
@PathVariable
(
"purchase_order_id"
)
Long
purchase_order_id
,
@RequestBody
Purchase_orderDTO
purchase_orderdto
)
{
Purchase_order
domain
=
purchase_orderMapping
.
toDomain
(
purchase_orderdto
);
...
...
businesscentral-provider/businesscentral-provider-core/src/main/java/cn/ibizlab/businesscentral/core/rest/Purchase_order_lineResource.java
浏览文件 @
9f05ad0a
此差异已折叠。
点击以展开。
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录