Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
486d3c94
提交
486d3c94
编写于
8月 31, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'dev' 到 'master'
Dev合并到master 查看合并请求
!22
上级
f23471a3
dc3db940
变更
13
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
153 行增加
和
19 行删除
+153
-19
CHANGELOG.md
CHANGELOG.md
+4
-0
application-%APP_PKGPATH%-prod.yml.ftl
...src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
+4
-0
application-dev.yml.ftl
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
+4
-0
I%DE%Service.java.ftl
...PKGPATH%/core/%MOD_PKGPATH%/service/I%DE%Service.java.ftl
+4
-0
%DE%ServiceImpl.java.ftl
.../core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
+30
-0
h2_table.xml.ftl
...UBPRJ%-core/src/main/resources/liquibase/h2_table.xml.ftl
+5
-1
systemMsgTempl.json.ftl
...-core/src/main/resources/msgtempl/systemMsgTempl.json.ftl
+25
-0
%ITEM%.bpmn.ftl
...%PUBPRJ%-core/src/main/resources/workflow/%ITEM%.bpmn.ftl
+6
-0
%ITEM%Resource.java.ftl
...YS_PKGPATH%/%SYSAPI_PKGPATH%/rest/%ITEM%Resource.java.ftl
+0
-17
IBZNotifyFallback.java.ftl
...java/%SYS_PKGPATH%/util/client/IBZNotifyFallback.java.ftl
+22
-0
IBZNotifyFeignClient.java.ftl
...a/%SYS_PKGPATH%/util/client/IBZNotifyFeignClient.java.ftl
+18
-0
PermissionSyncJob.java.ftl
...in/java/%SYS_PKGPATH%/util/job/PermissionSyncJob.java.ftl
+30
-0
AuthorizationTokenFilter.java.ftl
..._PKGPATH%/util/security/AuthorizationTokenFilter.java.ftl
+1
-1
未找到文件。
CHANGELOG.md
浏览文件 @
486d3c94
# **iBiz4j Spring R7 Template ChangeLog**
## [v2020.08.31]
-
消息集成:适配RT消息接口,通过钉钉、微信消息及短信等方式发送工作流待办消息
-
数据导入:批量数据采用异步方式进行导入,避免因数据量过大导致前端请求超时问题
## [v2020.08.18]
-
实体数据查询支持配置服务插件
...
...
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
浏览文件 @
486d3c94
...
...
@@ -89,6 +89,10 @@ zuul:
path: /dictionarys/**
serviceId: ${r'${ibiz.ref.service.dict:ibzdict-api}'}
stripPrefix: false
disk:
path: /net-disk/**
serviceId: ${r'${ibiz.ref.service.disk:ibzdisk-api}'}
stripPrefix: false
</#if>
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
...
...
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
浏览文件 @
486d3c94
...
...
@@ -99,6 +99,10 @@ zuul:
path: /dictionarys/**
serviceId: ${r'${ibiz.ref.service.dict:ibzdict-api}'}
stripPrefix: false
disk:
path: /net-disk/**
serviceId: ${r'${ibiz.ref.service.disk:ibzdisk-api}'}
stripPrefix: false
</#if>
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
...
...
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/service/I%DE%Service.java.ftl
浏览文件 @
486d3c94
...
...
@@ -29,6 +29,7 @@ import java.math.BigInteger;
import
org
.
springframework
.
data
.
domain
.
Page
;
import
org
.
springframework
.
data
.
domain
.
Pageable
;
import
org
.
springframework
.
scheduling
.
annotation
.
Async
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
org
.
springframework
.
cache
.
annotation
.
CacheEvict
;
...
...
@@ -205,6 +206,9 @@ public interface I${item.codeName}Service{
<#
comment
>
实体数据导入
</#
comment
>
<#
if
hasDEImport
>
JSONObject
importData
(
List
<${
de
.
codeName
}>
entities
,
int
batchSize
,
boolean
isIgnoreError
);
@
Async
(
"asyncExecutor"
)
void
asyncImportData
(
List
<${
de
.
codeName
}>
entities
,
int
batchSize
,
boolean
isIgnoreError
);
</#
if
>
</#
macro
>
...
...
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
浏览文件 @
486d3c94
...
...
@@ -89,6 +89,7 @@ import org.springframework.data.domain.Page;
import
org
.
springframework
.
data
.
domain
.
PageImpl
;
import
org
.
springframework
.
data
.
domain
.
Pageable
;
import
org
.
springframework
.
util
.
ObjectUtils
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Value
;
<#
if
pub
.
isEnableGlobalTransaction
??
&&
pub
.
isEnableGlobalTransaction
()??
&&
pub
.
isEnableGlobalTransaction
()==
true
>
import
io
.
seata
.
spring
.
annotation
.
GlobalTransactional
;
</#
if
>
...
...
@@ -2458,6 +2459,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
<#
macro
deImportData
>
<#
if
hasDEImport
>
<@
autowiredProxyService
/>
@
Value
(
"${r'${ibiz.syncImportLimit:1000}'}"
)
private
int
syncImportLimit
;
/**
*
上传数据检查
*
@
param
entities
...
...
@@ -2556,6 +2561,31 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
@
Override
@
Transactional
public
JSONObject
importData
(
List
<${
de
.
codeName
}>
entities
,
int
batchSize
,
boolean
isIgnoreError
)
{
if
(
entities
.
size
()>
syncImportLimit
){
proxyService
.
asyncImportData
(
entities
,
batchSize
,
isIgnoreError
);
JSONObject
rs
=
new
JSONObject
();
rs
.
put
(
"rst"
,
0
);
rs
.
put
(
"msg"
,
String
.
format
(
"当前导入数据已超过同步导入数量上限[%s],系统正在进行异步导入,请稍后!"
,
syncImportLimit
));
rs
.
put
(
"data"
,
entities
);
return
rs
;
}
else
{
return
syncImportData
(
entities
,
batchSize
,
isIgnoreError
);
}
}
@
Transactional
public
void
asyncImportData
(
List
<${
de
.
codeName
}>
entities
,
int
batchSize
,
boolean
isIgnoreError
){
executeImportData
(
entities
,
batchSize
,
isIgnoreError
);
}
@
Transactional
public
JSONObject
syncImportData
(
List
<${
de
.
codeName
}>
entities
,
int
batchSize
,
boolean
isIgnoreError
){
return
executeImportData
(
entities
,
batchSize
,
isIgnoreError
);
}
@
Transactional
public
JSONObject
executeImportData
(
List
<${
de
.
codeName
}>
entities
,
int
batchSize
,
boolean
isIgnoreError
)
{
JSONObject
rs
=
testImportData
(
entities
,
isIgnoreError
);
if
(
rs
.
getInteger
(
"rst"
)==
1
&&
!isIgnoreError)
...
...
SLN/%PUBPRJ%-core/src/main/resources/liquibase/h2_table.xml.ftl
浏览文件 @
486d3c94
...
...
@@ -33,8 +33,9 @@ TARGET=PSSYSTEM
<#list de.getAllPSDEFields() as defield>
<#if defield.isPhisicalDEField()==true><#comment>物理属性</#comment>
<#assign dataType="${srfdatatype(defield.getStdDataType())}">
<#assign javaType="${srfjavatype(defield.stdDataType)}">
<#comment>varchar需要设置字段长度,若不设置,则liquibase比较时会自动填充,最终恢复到生产库会报错</#comment>
<#if
srfjavatype(defield.stdDataType)
=='String'>
<#if
javaType
=='String'>
<#if defield.getLength()?? && defield.getLength()?c!='-1'>
<#assign dataType="${srfdatatype(defield.getStdDataType())}(${defield.getLength()?c})" >
<#else>
...
...
@@ -43,6 +44,9 @@ TARGET=PSSYSTEM
<#elseif dataType?lower_case=='decimal'>
<#assign dataType="${srfdatatype(defield.getStdDataType())}(38,2)"><#comment>设置数值类型精度</#comment>
</#if>
<#if javaType='BigDecimal'>
<#assign dataType="DECIMAL(38,2)"><#comment>数据类型转换varchar-->decimal</#comment>
</#if>
<#comment>由于liquibase不支持修改mysql的remarks,修改remarks会导致启动报错,所以mysql数据库暂时不发remarks</#comment>
<column name="${defield.getName()}" remarks="<#if (dbinst.getDBType()!='MYSQL5')>${defield.getLogicName()}</#if>" type="${dataType}">
<#if defield.isKeyDEField()==true>
...
...
SLN/%PUBPRJ%-core/src/main/resources/msgtempl/systemMsgTempl.json.ftl
0 → 100644
浏览文件 @
486d3c94
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign hasMsgTemplate=false>
<#if sys.getAllPSSysMsgTempls()??>
<#list sys.getAllPSSysMsgTempls() as msgTempl>
<#assign hasMsgTemplate=true>
<#break>
</#list>
</#if>
<#if hasMsgTemplate>
[
<#list sys.getAllPSSysMsgTempls() as msgTempl>
{
"tid":"${msgTempl.getCodeName()?lower_case}",
"template_name":"${msgTempl.getName()}",
"content":"${msgTempl.getContent()}"
}
<#if msgTempl_has_next>
,
</#if>
</#list>
]
</#if>
SLN/%PUBPRJ%-core/src/main/resources/workflow/%ITEM%.bpmn.ftl
浏览文件 @
486d3c94
...
...
@@ -205,6 +205,12 @@ TARGET=PSWFVERSION
</#if>
<userTask flowable:category="${r'${businessKey}'}" flowable:candidateUsers="${assignCond}" flowable:exclusive="true" id="tid-${WFProcess.getWFStepValue()}-${WFProcess.getDeployId()}" name="${WFProcess.getName()}" <#if WFProcess.getWFProcessType()?? && (WFProcess.getWFProcessType()=="CALLORGACTIVITY" || WFProcess.getWFProcessType()=="EMBED")>flowable:formKey="${WFProcess.getWFProcessType()}"</#if>><#comment>标记子流程节点</#comment>
<documentation>${r'${majortext}'}</documentation>
<#if WFProcess.isSendInform()>
<#assign msgTempl=WFProcess.getPSSysMsgTempl()>
<extensionElements>
<flowable:formProperty id="${msgTempl.getCodeName()?lower_case}" name="${msgTempl.getName()}" variable="${assignGroupCond}" type="${WFProcess.getMsgType()}" />
</extensionElements>
</#if>
<#--<#if assignGroupCond!="">-->
<#--<extensionElements>-->
<#--<flowable:field name="assignGroups"><flowable:string>${assignGroupCond}</flowable:string></flowable:field>-->
...
...
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/rest/%ITEM%Resource.java.ftl
浏览文件 @
486d3c94
...
...
@@ -43,7 +43,6 @@ import com.alibaba.fastjson.JSONObject;
import
javax
.
servlet
.
ServletRequest
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
cglib
.
beans
.
BeanCopier
;
<#
if
de
.
getStorageMode
()==
4
><#
else
>
import
org
.
springframework
.
transaction
.
annotation
.
Transactional
;</#
if
>
import
org
.
springframework
.
http
.
ResponseEntity
;
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
import
org
.
springframework
.
http
.
HttpStatus
;
...
...
@@ -155,7 +154,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"新建${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"新建${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"${fullPath}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<${
itemCodeName
}
DTO
>
create
(${
etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
${
deCodeNameLC
}
Service
.
create
(
domain
);
...
...
@@ -176,7 +174,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"更新${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"更新${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<${
itemCodeName
}
DTO
>
update
(${
id_etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
domain
.
set
${
dePKCodeName
}(${
itemCodeNameLC
+
keyCNLC
});
...
...
@@ -213,7 +210,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"删除${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"删除${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
remove
(${
idParams
})
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(${
deCodeNameLC
}
Service
.
remove
(${
itemCodeNameLC
+
keyCNLC
}));
}
...
...
@@ -259,7 +255,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${deaction.getLogicName()}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${deaction.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.${
reqMtd
},
value
=
"${fullPath}<#if deaction.getRequestParamType() == 'NOKEY'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>/${deactionCodeName?lower_case}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<${
itemCodeName
}
DTO
>
${
deactionCodeName
?
uncap_first
}(<#
if
deaction
.
getRequestParamType
()
==
'NOKEY'
>${
id_etParams4
}<#
else
>${
id_etParams
}</#
if
>)
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
<#
if
deaction
.
getRequestParamType
()
==
'NOKEY'
><#
else
>
domain
.
set
${
dePKCodeName
}(${
itemCodeNameLC
+
keyCNLC
});</#
if
>
...
...
@@ -405,7 +400,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}建立${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}建立${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"${fullPath}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<${
itemCodeName
}
DTO
>
${
deactionCodeName
?
uncap_first
}${
byParams
}(${
etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
${
parentSetParams
}
...
...
@@ -431,7 +425,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}更新${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}更新${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<${
itemCodeName
}
DTO
>
${
deactionCodeName
?
uncap_first
}${
byParams
}(${
id_etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
${
parentSetParams
}
...
...
@@ -496,7 +489,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}删除${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}删除${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
${
deactionCodeName
?
uncap_first
}${
byParams
}(${
idParams
})
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(${
deCodeNameLC
}
Service
.
remove
(${
itemCodeNameLC
+
keyCNLC
}));
}
...
...
@@ -566,7 +558,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.${
reqMtd
},
value
=
"${fullPath}<#if deaction.getRequestParamType() == 'NOKEY'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>/${deactionCodeName?lower_case}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<${
itemCodeName
}
DTO
>
${
deactionCodeName
?
uncap_first
}${
byParams
}(<#
if
deaction
.
getRequestParamType
()
==
'NOKEY'
>${
id_etParams4
}<#
else
>${
id_etParams
}</#
if
>)
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
${
parentSetParams
}
...
...
@@ -731,7 +722,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"新建${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"新建${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"${fullPath}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
testCreate
(${
etParams
})
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(${
deCodeNameLC
}
Service
.
testCreate
(${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
)));
}
...
...
@@ -747,7 +737,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"更新${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"更新${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
testUpdate
(${
id_etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
domain
.
set
${
dePKCodeName
}(${
itemCodeNameLC
+
keyCNLC
});
...
...
@@ -780,7 +769,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"删除${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"删除${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
testRemove
(${
idParams
})
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(${
deCodeNameLC
}
Service
.
testRemove
(${
itemCodeNameLC
+
keyCNLC
}));
}
...
...
@@ -823,7 +811,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${deaction.getLogicName()}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${deaction.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.${
reqMtd
},
value
=
"${fullPath}<#if deaction.getRequestParamType() == 'NOKEY'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>/${deactionCodeName?lower_case}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
test
${
deactionCodeName
?
cap_first
}(<#
if
deaction
.
getRequestParamType
()
==
'NOKEY'
>${
id_etParams4
}<#
else
>${
id_etParams
}</#
if
>)
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(${
deCodeNameLC
}
Service
.
test
${
srfmethodname
(
deactionCodeName
)?
cap_first
}(
domain
));
...
...
@@ -843,7 +830,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}建立${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}建立${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"${fullPath}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
testCreate
${
byParams
}(${
etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
${
parentSetParams
}
...
...
@@ -865,7 +851,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}更新${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}更新${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
testUpdate
${
byParams
}(${
id_etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
${
parentSetParams
}
...
...
@@ -888,7 +873,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}删除${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}删除${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
testRemove
${
byParams
}(${
idParams
})
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(${
deCodeNameLC
}
Service
.
testRemove
(${
itemCodeNameLC
+
keyCNLC
}));
}
...
...
@@ -954,7 +938,6 @@ public class ${itemCodeName}Resource {
<@
SecurityAnnotation
deaction
/>
@
ApiOperation
(
value
=
"${byTagParams}${deLogicName}"
,
tags
=
{
"${deLogicName}"
},
notes
=
"${byTagParams}${deLogicName}"
)
@
RequestMapping
(
method
=
RequestMethod
.${
reqMtd
},
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}/${deactionCodeName?lower_case}/test"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
public
ResponseEntity
<
Boolean
>
test
${
deactionCodeName
?
cap_first
}${
byParams
}(${
id_etParams
})
{
${
deCodeName
}
domain
=
${
itemCodeNameLC
}
Mapping
.
toDomain
(${
itemCodeNameLC
}
dto
);
${
parentSetParams
}
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/client/IBZNotifyFallback.java.ftl
0 → 100644
浏览文件 @
486d3c94
<#
ibiztemplate
>
TARGET
=
PSSYSTEM
</#
ibiztemplate
>
package
${
pub
.
getPKGCodeName
()}.
util
.
client
;
import
com
.
alibaba
.
fastjson
.
JSONArray
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
org
.
springframework
.
stereotype
.
Component
;
@
Component
public
class
IBZNotifyFallback
implements
IBZNotifyFeignClient
{
@
Override
public
Boolean
SendMsg
(
JSONObject
msg
)
{
return
null
;
}
@
Override
public
Boolean
createMsgTemplate
(
JSONObject
template
)
{
return
null
;
}
}
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/client/IBZNotifyFeignClient.java.ftl
0 → 100644
浏览文件 @
486d3c94
<#
ibiztemplate
>
TARGET
=
PSSYSTEM
</#
ibiztemplate
>
package
${
pub
.
getPKGCodeName
()}.
util
.
client
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
org
.
springframework
.
cloud
.
openfeign
.
FeignClient
;
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
@
FeignClient
(
value
=
"${r'${ibiz.ref.service.notify:ibznotify-api}'}"
,
fallback
=
IBZNotifyFallback
.
class
)
public
interface
IBZNotifyFeignClient
{
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/SendMsg"
)
Boolean
SendMsg
(@
RequestBody
JSONObject
msg
);
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/createMsgTemplate"
)
Boolean
createMsgTemplate
(@
RequestBody
JSONObject
template
);
}
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/job/PermissionSyncJob.java.ftl
浏览文件 @
486d3c94
...
...
@@ -13,10 +13,18 @@ TARGET=PSSYSTEM
</#
if
>
</#
list
>
</#
if
>
<#
assign
hasMsgTemplate
=
false
>
<#
if
sys
.
getAllPSSysMsgTempls
()??>
<#
list
sys
.
getAllPSSysMsgTempls
()
as
msgTempl
>
<#
assign
hasMsgTemplate
=
true
>
<#
break
>
</#
list
>
</#
if
>
package
${
pub
.
getPKGCodeName
()}.
util
.
job
;
import
${
pub
.
getPKGCodeName
()}.
util
.
client
.
IBZUAAFeignClient
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
com
.
alibaba
.
fastjson
.
JSONArray
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
org
.
apache
.
commons
.
io
.
IOUtils
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
...
...
@@ -54,6 +62,12 @@ public class PermissionSyncJob implements ApplicationRunner {
private
${
pub
.
getPKGCodeName
()}.
util
.
client
.
IBZWFFeignClient
client2
;
</#
if
>
<#
if
hasMsgTemplate
>
@
Autowired
@
Lazy
private
${
pub
.
getPKGCodeName
()}.
util
.
client
.
IBZNotifyFeignClient
notifyFeignClient
;
</#
if
>
@
Override
public
void
run
(
ApplicationArguments
args
)
{
try
{
...
...
@@ -94,5 +108,21 @@ public class PermissionSyncJob implements ApplicationRunner {
log
.
error
(
String
.
format
(
"部署流程失败,请检查[WF]服务是否正常! [%s]"
,
ex
));
}
</#
if
>
<#
if
hasMsgTemplate
>
try
{
InputStream
msgTemplate
=
this
.
getClass
().
getResourceAsStream
(
"/msgtempl/systemMsgTempl.json"
);
//
获取当前系统所有实体资源能力
String
strMsgTemplate
=
IOUtils
.
toString
(
msgTemplate
,
"UTF-8"
);
JSONObject
template
=
new
JSONObject
();
template
.
put
(
"template"
,
JSONArray
.
parseArray
(
strMsgTemplate
));
if
(
notifyFeignClient
.
createMsgTemplate
(
template
)){
log
.
info
(
"推送消息模板成功"
);
}
else
{
log
.
error
(
"推送消息模板失败"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"推送消息模板失败"
);
}
</#
if
>
}
}
\ No newline at end of file
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/security/AuthorizationTokenFilter.java.ftl
浏览文件 @
486d3c94
...
...
@@ -63,7 +63,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
if (authTokenUtil.validateToken(authToken, userDetails)) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
log.info("authorizated user '
{}
', setting security context", username);
//
log.info("authorizated user '
{}
', setting security context", username);
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录