Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
c6f8e218
提交
c6f8e218
编写于
11月 16, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码格式化
上级
0659452a
变更
17
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
87 行增加
和
95 行删除
+87
-95
%APP%Application.java.ftl
...ava/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
+2
-2
%APP%SecurityConfig.java.ftl
...KGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
+4
-4
DevBootApplication.java.ftl
...t/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
+4
-4
DevBootSecurityConfig.java.ftl
.../java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
+2
-2
%DE%%ITEM%.java.ftl
...S_PKGPATH%/core/%MOD_PKGPATH%/mapping/%DE%%ITEM%.java.ftl
+2
-2
%DE%%ITEM%LogicImpl.java.ftl
..._PKGPATH%/service/logic/impl/%DE%%ITEM%LogicImpl.java.ftl
+16
-23
%API%AutoConfiguration.java.ftl
...%/%SYSAPI_PKGPATH%/config/%API%AutoConfiguration.java.ftl
+1
-1
%API%SecurityConfig.java.ftl
...ATH%/%SYSAPI_PKGPATH%/config/%API%SecurityConfig.java.ftl
+2
-2
AuthenticationUserService.java.ftl
..._PKGPATH%/util/service/AuthenticationUserService.java.ftl
+3
-3
IBZConfigService.java.ftl
...java/%SYS_PKGPATH%/util/service/IBZConfigService.java.ftl
+15
-15
IBZDataAuditService.java.ftl
...a/%SYS_PKGPATH%/util/service/IBZDataAuditService.java.ftl
+2
-2
IBZUAAUserService.java.ftl
...ava/%SYS_PKGPATH%/util/service/IBZUAAUserService.java.ftl
+8
-8
IBZUSERServiceImpl.java.ftl
...va/%SYS_PKGPATH%/util/service/IBZUSERServiceImpl.java.ftl
+16
-15
RemoteService.java.ftl
...in/java/%SYS_PKGPATH%/util/service/RemoteService.java.ftl
+4
-6
SimpleAuditService.java.ftl
...va/%SYS_PKGPATH%/util/service/SimpleAuditService.java.ftl
+1
-1
SimpleFileService.java.ftl
...ava/%SYS_PKGPATH%/util/service/SimpleFileService.java.ftl
+1
-1
SearchContextHandlerMethodArgumentResolver.java.ftl
...l/web/SearchContextHandlerMethodArgumentResolver.java.ftl
+4
-4
未找到文件。
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
浏览文件 @
c6f8e218
...
@@ -55,13 +55,13 @@ import java.util.List;
...
@@ -55,13 +55,13 @@ import java.util.List;
com
.
alibaba
.
druid
.
spring
.
boot
.
autoconfigure
.
DruidDataSourceAutoConfigure
.
class
com
.
alibaba
.
druid
.
spring
.
boot
.
autoconfigure
.
DruidDataSourceAutoConfigure
.
class
</#
if
>
</#
if
>
})
})
public
class
${
app
.
getPKGCodeName
()}
Application
extends
WebMvcConfigurerAdapter
{
public
class
${
app
.
getPKGCodeName
()}
Application
extends
WebMvcConfigurerAdapter
{
@
Autowired
@
Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(${
app
.
getPKGCodeName
()}
Application
.
class
,
args
);
SpringApplication
.
run
(${
app
.
getPKGCodeName
()}
Application
.
class
,
args
);
}
}
@
Override
@
Override
...
...
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
浏览文件 @
c6f8e218
...
@@ -115,10 +115,10 @@ public class ${app.getPKGCodeName()}SecurityConfig extends WebSecurityConfigurer
...
@@ -115,10 +115,10 @@ public class ${app.getPKGCodeName()}SecurityConfig extends WebSecurityConfigurer
"/**/svg/**"
,
"/**/svg/**"
,
"/"
"/"
).
permitAll
()
).
permitAll
()
//
放行登录请求
//
放行登录请求
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
//
放行注销请求
//
放行注销请求
.
antMatchers
(
HttpMethod
.
GET
,
"/"
+
logoutPath
).
permitAll
()
.
antMatchers
(
HttpMethod
.
GET
,
"/"
+
logoutPath
).
permitAll
()
//
文件操作
//
文件操作
.
antMatchers
(
"/"
+
downloadpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/"
+
downloadpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
...
...
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
浏览文件 @
c6f8e218
...
@@ -50,8 +50,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -50,8 +50,8 @@ import org.springframework.beans.factory.annotation.Autowired;
</#
if
>
</#
if
>
})
})
@
ComponentScan
(
basePackages
=
{
"${pub.getPKGCodeName()}"
}
@
ComponentScan
(
basePackages
=
{
"${pub.getPKGCodeName()}"
}
//
,
excludeFilters
=
{
//
,
excludeFilters
=
{
//
@
ComponentScan
.
Filter
(
type
=
org
.
springframework
.
context
.
annotation
.
FilterType
.
REGEX
,
pattern
=
"${pub.getPKGCodeName()}.xxx.rest.xxx"
),
//
@
ComponentScan
.
Filter
(
type
=
org
.
springframework
.
context
.
annotation
.
FilterType
.
REGEX
,
pattern
=
"${pub.getPKGCodeName()}.xxx.rest.xxx"
),
//
}
//
}
)
)
@
Import
({
@
Import
({
...
@@ -59,13 +59,13 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -59,13 +59,13 @@ import org.springframework.beans.factory.annotation.Autowired;
})
})
@
EnableAsync
@
EnableAsync
@
EnableScheduling
@
EnableScheduling
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
@
Autowired
@
Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
DevBootApplication
.
class
,
args
);
SpringApplication
.
run
(
DevBootApplication
.
class
,
args
);
}
}
@
Override
@
Override
...
...
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
浏览文件 @
c6f8e218
...
@@ -113,9 +113,9 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -113,9 +113,9 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
"/v2/**"
"/v2/**"
).
permitAll
()
).
permitAll
()
//
放行登录请求
//
放行登录请求
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
//
放行注销请求
//
放行注销请求
.
antMatchers
(
HttpMethod
.
GET
,
"/"
+
logoutPath
).
permitAll
()
.
antMatchers
(
HttpMethod
.
GET
,
"/"
+
logoutPath
).
permitAll
()
//
文件操作
//
文件操作
.
antMatchers
(
"/"
+
downloadpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/"
+
downloadpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
...
...
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/mapping/%DE%%ITEM%.java.ftl
浏览文件 @
c6f8e218
...
@@ -12,11 +12,11 @@ public interface ${de.codeName}${item.codeName} {
...
@@ -12,11 +12,11 @@ public interface ${de.codeName}${item.codeName} {
<#
assign
keyFieldName
=
srfcaseformat
(
de
.
getKeyPSDEField
().
getCodeName
(),
'l_u2lC'
)>
<#
assign
keyFieldName
=
srfcaseformat
(
de
.
getKeyPSDEField
().
getCodeName
(),
'l_u2lC'
)>
<#
if
item
.
getPSDEDataImportItems
??
&&
item
.
getPSDEDataImportItems
()??>
<#
if
item
.
getPSDEDataImportItems
??
&&
item
.
getPSDEDataImportItems
()??>
@
Mappings
({
@
Mappings
({
@
Mapping
(
target
=
"${keyFieldName}"
,
source
=
"${keyFieldName}"
),
@
Mapping
(
target
=
"${keyFieldName}"
,
source
=
"${keyFieldName}"
),
<#
list
item
.
getPSDEDataImportItems
()
as
importItem
>
<#
list
item
.
getPSDEDataImportItems
()
as
importItem
>
<#
if
importItem
.
getPSDEField
()??
&&
importItem
.
getPSDEField
().
isKeyDEField
()==
false
>
<#
if
importItem
.
getPSDEField
()??
&&
importItem
.
getPSDEField
().
isKeyDEField
()==
false
>
<#
assign
deFieldName
=
srfcaseformat
(
importItem
.
getPSDEField
().
getCodeName
(),
'l_u2lC'
)>
<#
assign
deFieldName
=
srfcaseformat
(
importItem
.
getPSDEField
().
getCodeName
(),
'l_u2lC'
)>
@
Mapping
(
target
=
"${deFieldName}"
,
source
=
"${deFieldName}"
),
@
Mapping
(
target
=
"${deFieldName}"
,
source
=
"${deFieldName}"
),
</#
if
>
</#
if
>
</#
list
>
</#
list
>
})
})
...
...
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/service/logic/impl/%DE%%ITEM%LogicImpl.java.ftl
浏览文件 @
c6f8e218
...
@@ -5,19 +5,13 @@ TARGET=PSDELOGIC
...
@@ -5,19 +5,13 @@ TARGET=PSDELOGIC
<#
assign
startWF
=
false
>
<#
assign
startWF
=
false
>
package
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSDataEntity
().
getPSSystemModule
().
getCodeName
()?
lower_case
}.
service
.
logic
.
impl
;
package
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSDataEntity
().
getPSSystemModule
().
getCodeName
()?
lower_case
}.
service
.
logic
.
impl
;
import
java
.
sql
.
Timestamp
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
List
;
import
java
.
util
.
Map
;
import
java
.
util
.
Map
;
import
java
.
util
.
HashMap
;
import
java
.
util
.
HashMap
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
kie
.
api
.
runtime
.
KieSession
;
import
org
.
kie
.
api
.
runtime
.
KieSession
;
import
org
.
kie
.
api
.
runtime
.
KieContainer
;
import
org
.
kie
.
api
.
runtime
.
KieContainer
;
import
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSDataEntity
().
getPSSystemModule
().
getCodeName
()?
lower_case
}.
service
.
logic
.
I
${
de
.
codeName
}${
item
.
codeName
}
Logic
;
import
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSDataEntity
().
getPSSystemModule
().
getCodeName
()?
lower_case
}.
service
.
logic
.
I
${
de
.
codeName
}${
item
.
codeName
}
Logic
;
import
${
pub
.
getPKGCodeName
()}.
core
.${
de
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
de
.
getCodeName
()};
import
${
pub
.
getPKGCodeName
()}.
core
.${
de
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
de
.
getCodeName
()};
...
@@ -68,9 +62,9 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
...
@@ -68,9 +62,9 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
@
Override
@
Override
public
void
execute
(${
de
.
codeName
}
et
)
{
public
void
execute
(${
de
.
codeName
}
et
)
{
KieSession
kieSession
=
null
;
KieSession
kieSession
=
null
;
try
{
try
{
kieSession
=
kieContainer
.
newKieSession
();
kieSession
=
kieContainer
.
newKieSession
();
<#
comment
>
插入逻辑参数
</#
comment
>
<#
comment
>
插入逻辑参数
</#
comment
>
<#
if
item
.
getPSDELogicParams
??
&&
item
.
getPSDELogicParams
()??>
<#
if
item
.
getPSDELogicParams
??
&&
item
.
getPSDELogicParams
()??>
<#
assign
logicName
=(
de
.
codeName
+
item
.
codeName
)?
lower_case
>
<#
assign
logicName
=(
de
.
codeName
+
item
.
codeName
)?
lower_case
>
...
@@ -81,12 +75,12 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
...
@@ -81,12 +75,12 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
<#
assign
paramObjValue
=
"et"
>
<#
assign
paramObjValue
=
"et"
>
<#
elseif
logicParam
.
getParamPSDataEntity
??
&&
logicParam
.
getParamPSDataEntity
()??>
<#
elseif
logicParam
.
getParamPSDataEntity
??
&&
logicParam
.
getParamPSDataEntity
()??>
<#
assign
ParamPSDataEntity
=
logicParam
.
getParamPSDataEntity
()>
<#
assign
ParamPSDataEntity
=
logicParam
.
getParamPSDataEntity
()>
${
pub
.
getPKGCodeName
()}.
core
.${
ParamPSDataEntity
.
getPSSystemModule
().
codeName
?
lower_case
}.
domain
.${
ParamPSDataEntity
.
codeName
}
${(
logicName
+
logicParam
.
codeName
)?
lower_case
}
=
new
${
pub
.
getPKGCodeName
()}.
core
.${
ParamPSDataEntity
.
getPSSystemModule
().
codeName
?
lower_case
}.
domain
.${
ParamPSDataEntity
.
codeName
}();
${
pub
.
getPKGCodeName
()}.
core
.${
ParamPSDataEntity
.
getPSSystemModule
().
codeName
?
lower_case
}.
domain
.${
ParamPSDataEntity
.
codeName
}
${(
logicName
+
logicParam
.
codeName
)?
lower_case
}
=
new
${
pub
.
getPKGCodeName
()}.
core
.${
ParamPSDataEntity
.
getPSSystemModule
().
codeName
?
lower_case
}.
domain
.${
ParamPSDataEntity
.
codeName
}();
<#
else
>
<#
else
>
Map
${(
logicName
+
logicParam
.
codeName
)?
lower_case
}
=
new
HashMap
();
Map
${(
logicName
+
logicParam
.
codeName
)?
lower_case
}
=
new
HashMap
();
</#
if
>
</#
if
>
kieSession
.
insert
(${
paramObjValue
});
<#
comment
>
将逻辑参数存储到
fact
中
</#
comment
>
kieSession
.
insert
(${
paramObjValue
});
<#
comment
>
将逻辑参数存储到
fact
中
</#
comment
>
kieSession
.
setGlobal
(
"${paramObj}"
,
${
paramObjValue
});<#
comment
>
将逻辑参数存储到
global
中
</#
comment
>
kieSession
.
setGlobal
(
"${paramObj}"
,
${
paramObjValue
});<#
comment
>
将逻辑参数存储到
global
中
</#
comment
>
</#
list
>
</#
list
>
</#
if
>
</#
if
>
<#
comment
>
插入处理逻辑中所用到的
service
对象
</#
comment
>
<#
comment
>
插入处理逻辑中所用到的
service
对象
</#
comment
>
...
@@ -94,29 +88,28 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
...
@@ -94,29 +88,28 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
<#
list
item
.
getPSDELogicNodes
()
as
deLogicNode
>
<#
list
item
.
getPSDELogicNodes
()
as
deLogicNode
>
<#
if
deLogicNode
.
getDstPSDataEntity
??
&&
deLogicNode
.
getDstPSDataEntity
()??>
<#
if
deLogicNode
.
getDstPSDataEntity
??
&&
deLogicNode
.
getDstPSDataEntity
()??>
<#
if
!P.exists(item.codeName,"kieSessionGlobalService",deLogicNode.getDstPSDataEntity().getCodeName()?lower_case)>
<#
if
!P.exists(item.codeName,"kieSessionGlobalService",deLogicNode.getDstPSDataEntity().getCodeName()?lower_case)>
kieSession
.
setGlobal
(
"${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service"
,
${
deLogicNode
.
getDstPSDataEntity
().
getCodeName
()?
lower_case
}
service
);<#
comment
>
将逻辑中引用到的
service
存储到
global
中
</#
comment
>
kieSession
.
setGlobal
(
"${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service"
,
${
deLogicNode
.
getDstPSDataEntity
().
getCodeName
()?
lower_case
}
service
);<#
comment
>
将逻辑中引用到的
service
存储到
global
中
</#
comment
>
</#
if
>
</#
if
>
</#
if
>
</#
if
>
</#
list
>
</#
list
>
</#
if
>
</#
if
>
<#
comment
>
插入当前实体的
defaultService
对象,供自定义查询使用
</#
comment
>
<#
comment
>
插入当前实体的
defaultService
对象,供自定义查询使用
</#
comment
>
kieSession
.
setGlobal
(
"iBzSys${de.codeName?lower_case?cap_first}DefaultService"
,
iBzSysDefaultService
);<#
comment
>
将逻辑中引用到的
service
存储到
global
中
</#
comment
>
kieSession
.
setGlobal
(
"iBzSys${de.codeName?lower_case?cap_first}DefaultService"
,
iBzSysDefaultService
);<#
comment
>
将逻辑中引用到的
service
存储到
global
中
</#
comment
>
kieSession
.
setGlobal
(
"curuser"
,
${
pub
.
getPKGCodeName
()}.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
());
kieSession
.
setGlobal
(
"curuser"
,
${
pub
.
getPKGCodeName
()}.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
());
<#
comment
>
插入
wfclient
</#
comment
>
<#
comment
>
插入
wfclient
</#
comment
>
<#
if
startWF
>
<#
if
startWF
>
kieSession
.
setGlobal
(
"wfClient"
,
wfClient
);
kieSession
.
setGlobal
(
"wfClient"
,
wfClient
);
</#
if
>
</#
if
>
kieSession
.
startProcess
(
"${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${item.getCodeName()?lower_case}"
);<#
comment
>
执行所要执行的流程
</#
comment
>
kieSession
.
startProcess
(
"${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${item.getCodeName()?lower_case}"
);<#
comment
>
执行所要执行的流程
</#
comment
>
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"执行[${item.getName()}]处理逻辑发生异常"
+
e
);
throw
new
RuntimeException
(
"执行[${item.getName()}]处理逻辑发生异常"
+
e
);
<#--
throw
new
BadRequestAlertException
(
""
+
e
,
""
,
""
);-->
<#--
throw
new
BadRequestAlertException
(
""
+
e
,
""
,
""
);-->
}
finally
{
}
finally
{
if
(
kieSession
!=
null) {
if
(
kieSession
!=
null) {
kieSession
.
destroy
();
kieSession
.
destroy
();
}
}
}
}
}
}
}
}
</#
if
>
</#
if
>
\ No newline at end of file
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/config/%API%AutoConfiguration.java.ftl
浏览文件 @
c6f8e218
...
@@ -27,7 +27,7 @@ import org.springframework.context.annotation.Import;
...
@@ -27,7 +27,7 @@ import org.springframework.context.annotation.Import;
@
ConditionalOnClass
(${
item
.
codeName
}
RestConfiguration
.
class
)
@
ConditionalOnClass
(${
item
.
codeName
}
RestConfiguration
.
class
)
@
ConditionalOnWebApplication
@
ConditionalOnWebApplication
@
EnableConfigurationProperties
(${
item
.
codeName
}
ServiceProperties
.
class
)
@
EnableConfigurationProperties
(${
item
.
codeName
}
ServiceProperties
.
class
)
public
class
${
item
.
codeName
}
AutoConfiguration
implements
ApplicationContextAware
{
public
class
${
item
.
codeName
}
AutoConfiguration
implements
ApplicationContextAware
{
protected
ApplicationContext
applicationContext
;
protected
ApplicationContext
applicationContext
;
...
...
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/config/%API%SecurityConfig.java.ftl
浏览文件 @
c6f8e218
...
@@ -118,9 +118,9 @@ public class ${item.codeName}SecurityConfig extends WebSecurityConfigurerAdapter
...
@@ -118,9 +118,9 @@ public class ${item.codeName}SecurityConfig extends WebSecurityConfigurerAdapter
"/v2/**"
"/v2/**"
).
permitAll
()
).
permitAll
()
//
放行登录请求
//
放行登录请求
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
//
放行注销请求
//
放行注销请求
.
antMatchers
(
HttpMethod
.
GET
,
"/"
+
logoutPath
).
permitAll
()
.
antMatchers
(
HttpMethod
.
GET
,
"/"
+
logoutPath
).
permitAll
()
//
文件操作
//
文件操作
.
antMatchers
(
"/"
+
downloadpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/"
+
downloadpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/AuthenticationUserService.java.ftl
浏览文件 @
c6f8e218
...
@@ -23,12 +23,12 @@ public interface AuthenticationUserService extends UserDetailsService {
...
@@ -23,12 +23,12 @@ public interface AuthenticationUserService extends UserDetailsService {
</#
if
>
</#
if
>
@
Override
@
Override
@
Cacheable
(
value
=
"${cachename}"
,
key
=
"'getByUsername:'+#p0"
)
@
Cacheable
(
value
=
"${cachename}"
,
key
=
"'getByUsername:'+#p0"
)
AuthenticationUser
loadUserByUsername
(
String
username
);
AuthenticationUser
loadUserByUsername
(
String
username
);
@
Cacheable
(
value
=
"${cachename}"
,
key
=
"'getByUsername:'+#p0"
)
@
Cacheable
(
value
=
"${cachename}"
,
key
=
"'getByUsername:'+#p0"
)
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
);
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
);
@
CacheEvict
(
value
=
"${cachename}"
,
key
=
"'getByUsername:'+#p0"
)
@
CacheEvict
(
value
=
"${cachename}"
,
key
=
"'getByUsername:'+#p0"
)
void
resetByUsername
(
String
username
);
void
resetByUsername
(
String
username
);
}
}
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/IBZConfigService.java.ftl
浏览文件 @
c6f8e218
...
@@ -34,39 +34,39 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
...
@@ -34,39 +34,39 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
@
Value
(
"${r'${'}ibiz.admin.userid:0100}"
)
@
Value
(
"${r'${'}ibiz.admin.userid:0100}"
)
private
String
adminuserid
;
private
String
adminuserid
;
@
Cacheable
(
value
=
"${cachename}"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
@
Cacheable
(
value
=
"${cachename}"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
public
JSONObject
getConfig
(
String
cfgType
,
String
targetType
,
String
userId
)
public
JSONObject
getConfig
(
String
cfgType
,
String
targetType
,
String
userId
)
{
{
if
(
StringUtils
.
isEmpty
(
userId
)
||
StringUtils
.
isEmpty
(
cfgType
)||
StringUtils
.
isEmpty
(
targetType
))
{
if
(
StringUtils
.
isEmpty
(
userId
)
||
StringUtils
.
isEmpty
(
cfgType
)
||
StringUtils
.
isEmpty
(
targetType
))
{
throw
new
BadRequestAlertException
(
"获取配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
throw
new
BadRequestAlertException
(
"获取配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
}
}
IBZConfig
config
=
this
.
getOne
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()),
false
);
IBZConfig
config
=
this
.
getOne
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()),
false
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
this
.
getOne
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
adminuserid
).
build
()),
false
);
config
=
this
.
getOne
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
adminuserid
).
build
()),
false
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
return
new
JSONObject
();
return
new
JSONObject
();
}
}
}
}
return
JSON
.
parseObject
(
config
.
getCfg
());
return
JSON
.
parseObject
(
config
.
getCfg
());
}
}
@
CacheEvict
(
value
=
"${cachename}"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
@
CacheEvict
(
value
=
"${cachename}"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
public
boolean
saveConfig
(
String
cfgType
,
String
targetType
,
String
userId
,
JSONObject
config
)
public
boolean
saveConfig
(
String
cfgType
,
String
targetType
,
String
userId
,
JSONObject
config
)
{
{
if
(
StringUtils
.
isEmpty
(
userId
)
||
StringUtils
.
isEmpty
(
cfgType
)||
StringUtils
.
isEmpty
(
targetType
))
{
if
(
StringUtils
.
isEmpty
(
userId
)
||
StringUtils
.
isEmpty
(
cfgType
)
||
StringUtils
.
isEmpty
(
targetType
))
{
throw
new
BadRequestAlertException
(
"保存配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
throw
new
BadRequestAlertException
(
"保存配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
}
}
String
cfg
=
"{}"
;
String
cfg
=
"{}"
;
if
(
config
!=null)
{
if
(
config
!= null)
{
cfg
=
JSONObject
.
toJSONString
(
config
);
cfg
=
JSONObject
.
toJSONString
(
config
);
}
}
return
this
.
saveOrUpdate
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
cfg
(
cfg
).
updateDate
(
DataObject
.
getNow
()).
build
());
return
this
.
saveOrUpdate
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
cfg
(
cfg
).
updateDate
(
DataObject
.
getNow
()).
build
());
}
}
@
CacheEvict
(
value
=
"${cachename}"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
@
CacheEvict
(
value
=
"${cachename}"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
public
void
resetConfig
(
String
cfgType
,
String
targetType
,
String
userId
)
public
void
resetConfig
(
String
cfgType
,
String
targetType
,
String
userId
)
{
{
if
(
StringUtils
.
isEmpty
(
userId
)
||
StringUtils
.
isEmpty
(
cfgType
)||
StringUtils
.
isEmpty
(
targetType
))
{
if
(
StringUtils
.
isEmpty
(
userId
)
||
StringUtils
.
isEmpty
(
cfgType
)
||
StringUtils
.
isEmpty
(
targetType
))
{
throw
new
BadRequestAlertException
(
"重置配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
throw
new
BadRequestAlertException
(
"重置配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
}
}
this
.
remove
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()));
this
.
remove
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()));
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/IBZDataAuditService.java.ftl
浏览文件 @
c6f8e218
...
@@ -14,9 +14,9 @@ import java.util.Map;
...
@@ -14,9 +14,9 @@ import java.util.Map;
*/
*/
public
interface
IBZDataAuditService
{
public
interface
IBZDataAuditService
{
@
Async
(
"asyncExecutor"
)
@
Async
(
"asyncExecutor"
)
void
createAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
void
createAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
@
Async
(
"asyncExecutor"
)
@
Async
(
"asyncExecutor"
)
void
updateAudit
(
HttpServletRequest
request
,
EntityBase
beforeEntity
,
Object
serviceObj
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
void
updateAudit
(
HttpServletRequest
request
,
EntityBase
beforeEntity
,
Object
serviceObj
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
@
Async
(
"asyncExecutor"
)
@
Async
(
"asyncExecutor"
)
void
removeAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
void
removeAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
}
}
\ No newline at end of file
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/IBZUAAUserService.java.ftl
浏览文件 @
c6f8e218
...
@@ -29,8 +29,8 @@ public class IBZUAAUserService implements AuthenticationUserService{
...
@@ -29,8 +29,8 @@ public class IBZUAAUserService implements AuthenticationUserService{
@
Override
@
Override
public
AuthenticationUser
loadUserByUsername
(
String
username
)
{
public
AuthenticationUser
loadUserByUsername
(
String
username
)
{
AuthenticationUser
user
=
uaaFeignClient
.
loginByUsername
(
username
);
AuthenticationUser
user
=
uaaFeignClient
.
loginByUsername
(
username
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
throw
new
BadRequestAlertException
(
"登录失败"
,
"IBZUAAUser"
,
username
);
throw
new
BadRequestAlertException
(
"登录失败"
,
"IBZUAAUser"
,
username
);
}
}
return
user
;
return
user
;
...
@@ -38,9 +38,9 @@ public class IBZUAAUserService implements AuthenticationUserService{
...
@@ -38,9 +38,9 @@ public class IBZUAAUserService implements AuthenticationUserService{
@
Override
@
Override
public
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
)
{
public
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
)
{
String
[]
data
=
username
.
split
(
"[|]"
);
String
[]
data
=
username
.
split
(
"[|]"
);
String
loginname
=
username
;
String
loginname
=
username
;
String
domains
=
""
;
String
domains
=
""
;
if
(
data
.
length
==
2
)
{
if
(
data
.
length
==
2
)
{
loginname
=
data
[
0
].
trim
();
loginname
=
data
[
0
].
trim
();
...
@@ -50,9 +50,9 @@ public class IBZUAAUserService implements AuthenticationUserService{
...
@@ -50,9 +50,9 @@ public class IBZUAAUserService implements AuthenticationUserService{
logininfo
.
setDomain
(
domains
);
logininfo
.
setDomain
(
domains
);
logininfo
.
setLoginname
(
loginname
);
logininfo
.
setLoginname
(
loginname
);
logininfo
.
setPassword
(
password
);
logininfo
.
setPassword
(
password
);
AuthenticationUser
user
=
uaaFeignClient
.
login
(
logininfo
);
AuthenticationUser
user
=
uaaFeignClient
.
login
(
logininfo
);
if
(
user
==
null
){
if
(
user
==
null
){
throw
new
BadRequestAlertException
(
"登录失败"
,
"IBZUAAUser"
,
username
);
throw
new
BadRequestAlertException
(
"登录失败"
,
"IBZUAAUser"
,
username
);
}
}
return
user
;
return
user
;
}
}
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/IBZUSERServiceImpl.java.ftl
浏览文件 @
c6f8e218
...
@@ -31,22 +31,23 @@ public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> impl
...
@@ -31,22 +31,23 @@ public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> impl
@
Override
@
Override
public
AuthenticationUser
loadUserByUsername
(
String
username
)
{
public
AuthenticationUser
loadUserByUsername
(
String
username
)
{
if
(
StringUtils
.
isEmpty
(
username
))
if
(
StringUtils
.
isEmpty
(
username
))
{
throw
new
UsernameNotFoundException
(
"用户名为空"
);
throw
new
UsernameNotFoundException
(
"用户名为空"
);
QueryWrapper
<
IBZUSER
>
conds
=
new
QueryWrapper
<
IBZUSER
>();
String
[]
data
=
username
.
split
(
"[|]"
);
String
loginname
=
""
;
String
domains
=
""
;
if
(
data
.
length
>
0
){
loginname
=
data
[
0
].
trim
();
}
}
if
(
data
.
length
>
1
){
QueryWrapper
<
IBZUSER
>
conds
=
new
QueryWrapper
<
IBZUSER
>();
domains
=
data
[
1
].
trim
();
String
[]
data
=
username
.
split
(
"[|]"
);
String
loginname
=
""
;
String
domains
=
""
;
if
(
data
.
length
>
0
)
{
loginname
=
data
[
0
].
trim
();
}
}
if
(
!StringUtils.isEmpty(loginname)){
if
(
data
.
length
>
1
)
{
domains
=
data
[
1
].
trim
();
}
if
(
!StringUtils.isEmpty(loginname)) {
conds
.
eq
(
"loginname"
,
loginname
);
conds
.
eq
(
"loginname"
,
loginname
);
}
}
if
(
!StringUtils.isEmpty(domains)){
if
(
!StringUtils.isEmpty(domains))
{
conds
.
eq
(
"domains"
,
domains
);
conds
.
eq
(
"domains"
,
domains
);
}
}
IBZUSER
user
=
this
.
getOne
(
conds
);
IBZUSER
user
=
this
.
getOne
(
conds
);
...
@@ -62,13 +63,13 @@ public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> impl
...
@@ -62,13 +63,13 @@ public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> impl
@
Override
@
Override
public
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
){
public
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
){
AuthenticationUser
authuserdetail
=
loadUserByUsername
(
username
);
AuthenticationUser
authuserdetail
=
loadUserByUsername
(
username
);
if
(
pwencrymode
==
1
){
if
(
pwencrymode
==
1
){
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
}
}
else
if
(
pwencrymode
==
2
){
else
if
(
pwencrymode
==
2
){
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
}
}
if
(
!authuserdetail.getPassword().equals(
password ))
{
if
(
!authuserdetail.getPassword().equals(
password))
{
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
username
);
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
username
);
}
}
return
authuserdetail
;
return
authuserdetail
;
...
@@ -82,7 +83,7 @@ public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> impl
...
@@ -82,7 +83,7 @@ public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> impl
public
AuthenticationUser
createUserDetails
(
IBZUSER
user
)
{
public
AuthenticationUser
createUserDetails
(
IBZUSER
user
)
{
AuthenticationUser
userdatail
=
new
AuthenticationUser
();
AuthenticationUser
userdatail
=
new
AuthenticationUser
();
CachedBeanCopier
.
copy
(
user
,
userdatail
);
CachedBeanCopier
.
copy
(
user
,
userdatail
);
if
(
userdatail
.
getSuperuser
()
==
1
){
if
(
userdatail
.
getSuperuser
()
==
1
){
userdatail
.
setAuthorities
(
AuthorityUtils
.
createAuthorityList
(
"ROLE_SUPERADMIN"
));
userdatail
.
setAuthorities
(
AuthorityUtils
.
createAuthorityList
(
"ROLE_SUPERADMIN"
));
}
}
return
userdatail
;
return
userdatail
;
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/RemoteService.java.ftl
浏览文件 @
c6f8e218
...
@@ -52,19 +52,19 @@ public class RemoteService {
...
@@ -52,19 +52,19 @@ public class RemoteService {
*/
*/
public
interface
RemoteFeignClient
{
public
interface
RemoteFeignClient
{
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{path}"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{path}"
)
JSONObject
post
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
,
@
RequestBody
Map
param
);
JSONObject
post
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
,
@
RequestBody
Map
param
);
@
RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{path}"
)
@
RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{path}"
)
JSONObject
request
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
,
Map
param
);
JSONObject
request
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
,
Map
param
);
@
RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{path}"
)
@
RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{path}"
)
JSONObject
get
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
);
JSONObject
get
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
);
@
RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/{path}"
)
@
RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/{path}"
)
JSONObject
put
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
,@
RequestBody
Map
param
);
JSONObject
put
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
,@
RequestBody
Map
param
);
@
RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/{path}"
)
@
RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/{path}"
)
JSONObject
delete
(
@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
);
JSONObject
delete
(@
PathVariable
(
"path"
)
String
path
,
@
RequestHeader
(
"Authorization"
)
String
token
);
}
}
/**
/**
...
@@ -118,6 +118,4 @@ public class RemoteService {
...
@@ -118,6 +118,4 @@ public class RemoteService {
final
HttpMessageConverters
httpMessageConverters
=
new
HttpMessageConverters
(
jsonConverter
);
final
HttpMessageConverters
httpMessageConverters
=
new
HttpMessageConverters
(
jsonConverter
);
return
()
->
httpMessageConverters
;
return
()
->
httpMessageConverters
;
}
}
}
}
\ No newline at end of file
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleAuditService.java.ftl
浏览文件 @
c6f8e218
...
@@ -71,7 +71,7 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
...
@@ -71,7 +71,7 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
public
void
createAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
)
{
public
void
createAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
)
{
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
dataAudit
.
setOppersonid
(
AuthenticationUser
.
getAuthenticationUser
().
getUserid
());
dataAudit
.
setOppersonid
(
AuthenticationUser
.
getAuthenticationUser
().
getUserid
());
dataAudit
.
setOppersonname
(
String
.
format
(
"%s[%s]"
,
AuthenticationUser
.
getAuthenticationUser
().
getPersonname
(),
AuthenticationUser
.
getAuthenticationUser
().
getOrgname
()));
dataAudit
.
setOppersonname
(
String
.
format
(
"%s[%s]"
,
AuthenticationUser
.
getAuthenticationUser
().
getPersonname
(),
AuthenticationUser
.
getAuthenticationUser
().
getOrgname
()));
dataAudit
.
setAudittype
(
"CREATE"
);
dataAudit
.
setAudittype
(
"CREATE"
);
dataAudit
.
setAuditobject
(
entity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobject
(
entity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobjectdata
(
idValue
);
dataAudit
.
setAuditobjectdata
(
idValue
);
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleFileService.java.ftl
浏览文件 @
c6f8e218
...
@@ -30,7 +30,7 @@ public class SimpleFileService implements FileService {
...
@@ -30,7 +30,7 @@ public class SimpleFileService implements FileService {
//
获取文件名
//
获取文件名
String
fileName
=
multipartFile
.
getOriginalFilename
();
String
fileName
=
multipartFile
.
getOriginalFilename
();
//
获取文件后缀
//
获取文件后缀
String
extname
=
"."
+
getExtensionName
(
fileName
);
String
extname
=
"."
+
getExtensionName
(
fileName
);
try
{
try
{
String
fileid
=
DigestUtils
.
md5DigestAsHex
(
multipartFile
.
getInputStream
());
String
fileid
=
DigestUtils
.
md5DigestAsHex
(
multipartFile
.
getInputStream
());
String
fileFullPath
=
this
.
fileRoot
+
"ibizutil"
+
File
.
separator
+
fileid
+
File
.
separator
+
fileName
;
String
fileFullPath
=
this
.
fileRoot
+
"ibizutil"
+
File
.
separator
+
fileid
+
File
.
separator
+
fileName
;
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/web/SearchContextHandlerMethodArgumentResolver.java.ftl
浏览文件 @
c6f8e218
...
@@ -34,14 +34,14 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
...
@@ -34,14 +34,14 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
public
Object
resolveArgument
(
MethodParameter
parameter
,
ModelAndViewContainer
mavContainer
,
public
Object
resolveArgument
(
MethodParameter
parameter
,
ModelAndViewContainer
mavContainer
,
NativeWebRequest
webRequest
,
WebDataBinderFactory
binderFactory
)
throws
Exception
{
NativeWebRequest
webRequest
,
WebDataBinderFactory
binderFactory
)
throws
Exception
{
Map
<
String
,
String
[]>
params
=
webRequest
.
getParameterMap
();
Map
<
String
,
String
[]>
params
=
webRequest
.
getParameterMap
();
LinkedHashMap
<
String
,
Object
>
set
=
new
LinkedHashMap
<>();
LinkedHashMap
<
String
,
Object
>
set
=
new
LinkedHashMap
<>();
for
(
String
key
:
params
.
keySet
())
{
for
(
String
key
:
params
.
keySet
())
{
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
}
}
if
((
!set.containsKey("size")) ){
if
((
!set.containsKey("size")) ){
set
.
put
(
"size"
,
pageLimit
);
set
.
put
(
"size"
,
pageLimit
);
}
}
String
json
=
objectMapper
.
writeValueAsString
(
set
);
String
json
=
objectMapper
.
writeValueAsString
(
set
);
return
objectMapper
.
readValue
(
json
,
parameter
.
getParameterType
());
return
objectMapper
.
readValue
(
json
,
parameter
.
getParameterType
());
}
}
}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录