Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
b80e2b6d
提交
b80e2b6d
编写于
11月 12, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码规范检查
上级
91733830
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
97 行增加
和
98 行删除
+97
-98
%ITEM%Mapping.java.ftl
..._PKGPATH%/%SYSAPI_PKGPATH%/mapping/%ITEM%Mapping.java.ftl
+2
-3
SimpleAuditService.java.ftl
...va/%SYS_PKGPATH%/util/service/SimpleAuditService.java.ftl
+82
-82
SimpleFileService.java.ftl
...ava/%SYS_PKGPATH%/util/service/SimpleFileService.java.ftl
+6
-6
SimpleUserService.java.ftl
...ava/%SYS_PKGPATH%/util/service/SimpleUserService.java.ftl
+7
-7
未找到文件。
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/mapping/%ITEM%Mapping.java.ftl
浏览文件 @
b80e2b6d
...
...
@@ -13,11 +13,10 @@ import org.mapstruct.*;
import
${
pub
.
getPKGCodeName
()}.
core
.${
de
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
de
.
codeName
};
import
${
pubPkgCodeName
}.${
itemSysApiCodeNameLC
}.
dto
.${
item
.
getCodeName
()}
DTO
;
import
${
pub
.
getPKGCodeName
()}.
util
.
domain
.
MappingBase
;
import
org
.
mapstruct
.
factory
.
Mappers
;
@
Mapper
(
componentModel
=
"spring"
,
uses
=
{},
implementationName
=
"${mappingName}"
,
nullValuePropertyMappingStrategy
=
NullValuePropertyMappingStrategy
.
IGNORE
,
nullValueCheckStrategy
=
NullValueCheckStrategy
.
ALWAYS
)
nullValuePropertyMappingStrategy
=
NullValuePropertyMappingStrategy
.
IGNORE
,
nullValueCheckStrategy
=
NullValueCheckStrategy
.
ALWAYS
)
public
interface
${
item
.
getCodeName
()}
Mapping
extends
MappingBase
<${
item
.
codeName
}
DTO
,
${
de
.
codeName
}>
{
<#--<#
comment
>
输出关系数据(子实体)
</#
comment
>-->
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleAuditService.java.ftl
浏览文件 @
b80e2b6d
...
...
@@ -45,13 +45,13 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*/
@
Scheduled
(
fixedRate
=
10000
)
public
void
saveAudit
()
{
if
(
cacheMap
.
size
()>
0
){
if
(
cacheMap
.
size
()>
0
)
{
log
.
info
(
String
.
format
(
"正在保存审计数据,当前审计集合数量为[%s]"
,
cacheMap
.
size
()));
List
temp
=
new
ArrayList
();
if
(
cacheMap
.
size
()<
500
){
if
(
cacheMap
.
size
()<
500
)
{
temp
.
addAll
(
cacheMap
);
}
else
{
else
{
temp
.
addAll
(
cacheMap
.
subList
(
0
,
500
));
}
this
.
saveBatch
(
temp
);
...
...
@@ -69,17 +69,17 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*/
@
Override
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
.
setOppersonname
(
String
.
format
(
"%s[%s]"
,
AuthenticationUser
.
getAuthenticationUser
().
getPersonname
(),
AuthenticationUser
.
getAuthenticationUser
().
getOrgname
()));
dataAudit
.
setAudittype
(
"CREATE"
);
dataAudit
.
setAuditobject
(
entity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobjectdata
(
idValue
);
dataAudit
.
setOptime
(
new
Timestamp
(
new
Date
().
getTime
()));
if
(
request
!=null)
{
if
(
request
!= null)
{
dataAudit
.
setIpaddress
(
getIpAddress
(
request
,
AuthenticationUser
.
getAuthenticationUser
()));
}
dataAudit
.
setAuditinfo
(
getAuditInfo
(
entity
,
auditFields
));
dataAudit
.
setAuditinfo
(
getAuditInfo
(
entity
,
auditFields
));
dataAudit
.
setIsdatachanged
(
1
);
cacheMap
.
add
(
dataAudit
);
}
...
...
@@ -93,24 +93,24 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*
@
param
auditFields
*/
@
SneakyThrows
public
void
updateAudit
(
HttpServletRequest
request
,
EntityBase
beforeEntity
,
Object
serviceObj
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
){
public
void
updateAudit
(
HttpServletRequest
request
,
EntityBase
beforeEntity
,
Object
serviceObj
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
)
{
//
获取更新后的实体
EntityBase
afterEntity
=
getEntity
(
serviceObj
,
idValue
);
EntityBase
afterEntity
=
getEntity
(
serviceObj
,
idValue
);
//
获取更新后的审计内容
String
auditInfo
=
getUpdateAuditInfo
(
beforeEntity
,
afterEntity
,
auditFields
);//
比较更新前后差异内容
int
isDataChanged
=
1
;
String
auditInfo
=
getUpdateAuditInfo
(
beforeEntity
,
afterEntity
,
auditFields
);//
比较更新前后差异内容
int
isDataChanged
=
1
;
//
审计内容是否发生变化
if
(
StringUtils
.
isEmpty
(
auditInfo
)){
isDataChanged
=
0
;
if
(
StringUtils
.
isEmpty
(
auditInfo
))
{
isDataChanged
=
0
;
}
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
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
(
"UPDATE"
);
dataAudit
.
setAuditobject
(
afterEntity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobjectdata
(
idValue
);
dataAudit
.
setOptime
(
new
Timestamp
(
new
Date
().
getTime
()));
if
(
request
!=null){
if
(
request
!=null)
{
dataAudit
.
setIpaddress
(
getIpAddress
(
request
,
AuthenticationUser
.
getAuthenticationUser
()));
}
dataAudit
.
setAuditinfo
(
auditInfo
);
...
...
@@ -125,55 +125,55 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*
@
param
idValue
*
@
param
auditFields
*/
public
void
removeAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
)
{
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
public
void
removeAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
)
{
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
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
(
"REMOVE"
);
dataAudit
.
setAuditobject
(
entity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobjectdata
(
idValue
);
dataAudit
.
setOptime
(
new
Timestamp
(
new
Date
().
getTime
()));
if
(
request
!=null){
if
(
request
!=null)
{
dataAudit
.
setIpaddress
(
getIpAddress
(
request
,
AuthenticationUser
.
getAuthenticationUser
()));
}
dataAudit
.
setAuditinfo
(
getAuditInfo
(
entity
,
auditFields
));
dataAudit
.
setAuditinfo
(
getAuditInfo
(
entity
,
auditFields
));
dataAudit
.
setIsdatachanged
(
1
);
cacheMap
.
add
(
dataAudit
);
}
private
String
getAuditInfo
(
EntityBase
entity
,
Map
<
String
,
Audit
>
auditFields
){
String
auditResult
=
""
;
if
(
auditFields
.
size
()
==
0
)
{
private
String
getAuditInfo
(
EntityBase
entity
,
Map
<
String
,
Audit
>
auditFields
)
{
String
auditResult
=
""
;
if
(
auditFields
.
size
()
==
0
)
{
return
auditResult
;
}
Map
<
String
,
DEField
>
deFields
=
DEFieldCacheMap
.
getDEFields
(
entity
.
getClass
());
if
(
deFields
.
size
()
==
0
)
{
Map
<
String
,
DEField
>
deFields
=
DEFieldCacheMap
.
getDEFields
(
entity
.
getClass
());
if
(
deFields
.
size
()
==
0
)
{
return
auditResult
;
}
JSONArray
auditFieldArray
=
new
JSONArray
();
JSONArray
auditFieldArray
=
new
JSONArray
();
for
(
Map
.
Entry
<
String
,
Audit
>
auditField
:
auditFields
.
entrySet
())
{
Object
objFieldName
=
auditField
.
getKey
();
String
fieldName
=
String
.
valueOf
(
objFieldName
);
DEField
deField
=
null
;
if
(
deFields
.
containsKey
(
fieldName
)){
deField
=
deFields
.
get
(
fieldName
);
Object
objFieldName
=
auditField
.
getKey
();
String
fieldName
=
String
.
valueOf
(
objFieldName
);
DEField
deField
=
null
;
if
(
deFields
.
containsKey
(
fieldName
))
{
deField
=
deFields
.
get
(
fieldName
);
}
if
(
ObjectUtils
.
isEmpty
(
deField
)){
if
(
ObjectUtils
.
isEmpty
(
deField
))
{
continue
;
}
Object
value
=
dataTransfer
(
entity
.
get
(
fieldName
),
deField
.
fieldType
(),
deField
.
format
());
if
(
!StringUtils.isEmpty(value)){
JSONObject
auditFieldObj
=
new
JSONObject
();
auditFieldObj
.
put
(
"field"
,
deField
.
value
());
auditFieldObj
.
put
(
"value"
,
value
);
if
(
!StringUtils.isEmpty(deField.dict())){
auditFieldObj
.
put
(
"dict"
,
deField
.
dict
());
Object
value
=
dataTransfer
(
entity
.
get
(
fieldName
),
deField
.
fieldType
(),
deField
.
format
());
if
(
!StringUtils.isEmpty(value))
{
JSONObject
auditFieldObj
=
new
JSONObject
();
auditFieldObj
.
put
(
"field"
,
deField
.
value
());
auditFieldObj
.
put
(
"value"
,
value
);
if
(
!StringUtils.isEmpty(deField.dict()))
{
auditFieldObj
.
put
(
"dict"
,
deField
.
dict
());
}
auditFieldArray
.
add
(
auditFieldObj
);
}
}
if
(
auditFieldArray
.
size
()>
0
){
auditResult
=
auditFieldArray
.
toString
();
if
(
auditFieldArray
.
size
()>
0
)
{
auditResult
=
auditFieldArray
.
toString
();
}
return
auditResult
;
}
...
...
@@ -186,44 +186,44 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*
@
return
*/
private
String
getUpdateAuditInfo
(
EntityBase
oldData
,
EntityBase
newData
,
Map
<
String
,
Audit
>
auditFields
){
String
auditResult
=
""
;
JSONArray
auditFieldArray
=
new
JSONArray
();
if
(
auditFields
.
size
()
==
0
)
{
String
auditResult
=
""
;
JSONArray
auditFieldArray
=
new
JSONArray
();
if
(
auditFields
.
size
()
==
0
)
{
return
auditResult
;
}
Map
<
String
,
DEField
>
deFields
=
DEFieldCacheMap
.
getDEFields
(
oldData
.
getClass
());
if
(
deFields
.
size
()
==
0
){
Map
<
String
,
DEField
>
deFields
=
DEFieldCacheMap
.
getDEFields
(
oldData
.
getClass
());
if
(
deFields
.
size
()
==
0
){
return
auditResult
;
}
for
(
Map
.
Entry
<
String
,
Audit
>
auditField
:
auditFields
.
entrySet
())
{
Object
objFieldName
=
auditField
.
getKey
();//
获取注解字段
String
fieldName
=
String
.
valueOf
(
objFieldName
);
//
属性名称
DEField
deField
=
null
;
if
(
deFields
.
containsKey
(
fieldName
)){
deField
=
deFields
.
get
(
fieldName
);
Object
objFieldName
=
auditField
.
getKey
();//
获取注解字段
String
fieldName
=
String
.
valueOf
(
objFieldName
);
//
属性名称
DEField
deField
=
null
;
if
(
deFields
.
containsKey
(
fieldName
))
{
deField
=
deFields
.
get
(
fieldName
);
}
if
(
ObjectUtils
.
isEmpty
(
deField
)){
if
(
ObjectUtils
.
isEmpty
(
deField
))
{
continue
;
}
Object
oldValue
=
oldData
.
get
(
fieldName
);//
老属性值
Object
newValue
=
newData
.
get
(
fieldName
);//
新属性值
if
(
!compare(oldValue,
newValue))
{
oldValue
=
dataTransfer
(
oldValue
,
deField
.
fieldType
(),
deField
.
format
());//
属性值转换
newValue
=
dataTransfer
(
newValue
,
deField
.
fieldType
(),
deField
.
format
());//
属性值转换
JSONObject
auditFieldObj
=
new
JSONObject
();
auditFieldObj
.
put
(
"field"
,
deField
.
value
());
auditFieldObj
.
put
(
"beforevalue"
,
oldValue
);
auditFieldObj
.
put
(
"value"
,
newValue
);
if
(
!StringUtils.isEmpty(deField.dict())){
auditFieldObj
.
put
(
"dict"
,
deField
.
dict
());
Object
oldValue
=
oldData
.
get
(
fieldName
);//
老属性值
Object
newValue
=
newData
.
get
(
fieldName
);//
新属性值
if
(
!compare(oldValue,
newValue))
{
oldValue
=
dataTransfer
(
oldValue
,
deField
.
fieldType
(),
deField
.
format
());//
属性值转换
newValue
=
dataTransfer
(
newValue
,
deField
.
fieldType
(),
deField
.
format
());//
属性值转换
JSONObject
auditFieldObj
=
new
JSONObject
();
auditFieldObj
.
put
(
"field"
,
deField
.
value
());
auditFieldObj
.
put
(
"beforevalue"
,
oldValue
);
auditFieldObj
.
put
(
"value"
,
newValue
);
if
(
!StringUtils.isEmpty(deField.dict()))
{
auditFieldObj
.
put
(
"dict"
,
deField
.
dict
());
}
auditFieldArray
.
add
(
auditFieldObj
);
}
}
if
(
auditFieldArray
.
size
()>
0
){
auditResult
=
auditFieldArray
.
toString
();
if
(
auditFieldArray
.
size
()>
0
)
{
auditResult
=
auditFieldArray
.
toString
();
}
return
auditResult
;
}
...
...
@@ -235,16 +235,16 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*
@
param
strFormat
转换字段格式化文本
*
@
return
*/
private
String
dataTransfer
(
Object
value
,
String
dataType
,
String
strFormat
)
{
if
(
value
==
null
){
private
String
dataTransfer
(
Object
value
,
String
dataType
,
String
strFormat
)
{
if
(
value
==
null
)
{
return
""
;
}
String
transResult
=
value
.
toString
();
if
((
dataType
.
equals
(
"DATE"
)
||
dataType
.
equals
(
"DATETIME"
)
||
dataType
.
equals
(
"TIME"
))
&&
(
!StringUtils.isEmpty(strFormat))){ //时间类型转换
Timestamp
timestamp
=(
Timestamp
)
value
;
Date
date
=
timestamp
;
SimpleDateFormat
format
=
new
SimpleDateFormat
(
strFormat
);
transResult
=
format
.
format
(
date
);
if
((
dataType
.
equals
(
"DATE"
)
||
dataType
.
equals
(
"DATETIME"
)
||
dataType
.
equals
(
"TIME"
))
&&
(
!StringUtils.isEmpty(strFormat)))
{ //时间类型转换
Timestamp
timestamp
=
(
Timestamp
)
value
;
Date
date
=
timestamp
;
SimpleDateFormat
format
=
new
SimpleDateFormat
(
strFormat
);
transResult
=
format
.
format
(
date
);
}
return
transResult
;
}
...
...
@@ -255,11 +255,11 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*
@
param
targetObj
比较目标对象
*
@
return
*/
private
boolean
compare
(
Object
sourceObj
,
Object
targetObj
)
{
if
(
sourceObj
==
null
&&
targetObj
==
null
)
{
private
boolean
compare
(
Object
sourceObj
,
Object
targetObj
)
{
if
(
sourceObj
==
null
&&
targetObj
==
null
)
{
return
true
;
}
if
(
sourceObj
==
null
&&
targetObj
!=null)
{
if
(
sourceObj
==
null
&&
targetObj
!= null)
{
return
false
;
}
return
sourceObj
.
equals
(
targetObj
);
...
...
@@ -272,9 +272,9 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*
@
return
*/
@
SneakyThrows
private
EntityBase
getEntity
(
Object
service
,
Object
id
){
EntityBase
entity
=
null
;
if
(
!ObjectUtils.isEmpty(service)){
private
EntityBase
getEntity
(
Object
service
,
Object
id
)
{
EntityBase
entity
=
null
;
if
(
!ObjectUtils.isEmpty(service))
{
EvaluationContext
oldContext
=
new
StandardEvaluationContext
();
oldContext
.
setVariable
(
"service"
,
service
);
oldContext
.
setVariable
(
"id"
,
id
);
...
...
@@ -291,15 +291,15 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
*/
public
String
getIpAddress
(
HttpServletRequest
request
,
AuthenticationUser
authenticationUser
)
{
//
客户端有提交
ip
,以提交的
ip
为准
if
(
authenticationUser
!= null && !StringUtils.isEmpty(authenticationUser.getAddr())){
if
(
authenticationUser
!= null && !StringUtils.isEmpty(authenticationUser.getAddr()))
{
return
authenticationUser
.
getAddr
();
}
if
(
request
==
null
){
if
(
request
==
null
)
{
return
""
;
}
String
Xip
=
request
.
getHeader
(
"X-Real-IP"
);
String
XFor
=
request
.
getHeader
(
"X-Forwarded-For"
);
if
(
!StringUtils.isEmpty(XFor) && !"unKnown".equalsIgnoreCase(XFor)){
if
(
!StringUtils.isEmpty(XFor) && !"unKnown".equalsIgnoreCase(XFor))
{
//
多次反向代理后会有多个
ip
值,第一个
ip
才是真实
ip
int
index
=
XFor
.
indexOf
(
","
);
if
(
index
!= -1){
...
...
@@ -309,7 +309,7 @@ public class SimpleAuditService extends ServiceImpl<IBZDataAuditMapper, IBZDataA
}
}
XFor
=
Xip
;
if
(
!StringUtils.isEmpty(XFor) && !"unKnown".equalsIgnoreCase(XFor)){
if
(
!StringUtils.isEmpty(XFor) && !"unKnown".equalsIgnoreCase(XFor))
{
return
XFor
;
}
if
(
StringUtils
.
isEmpty
(
XFor
)
||
"unknown"
.
equalsIgnoreCase
(
XFor
))
{
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleFileService.java.ftl
浏览文件 @
b80e2b6d
...
...
@@ -26,21 +26,21 @@ public class SimpleFileService implements FileService {
@
Override
public
FileItem
saveFile
(
MultipartFile
multipartFile
)
{
FileItem
item
=
null
;
FileItem
item
=
null
;
//
获取文件名
String
fileName
=
multipartFile
.
getOriginalFilename
();
//
获取文件后缀
String
extname
=
"."
+
getExtensionName
(
fileName
);
String
extname
=
"."
+
getExtensionName
(
fileName
);
try
{
String
fileid
=
DigestUtils
.
md5DigestAsHex
(
multipartFile
.
getInputStream
());
String
fileid
=
DigestUtils
.
md5DigestAsHex
(
multipartFile
.
getInputStream
());
String
fileFullPath
=
this
.
fileRoot
+
"ibizutil"
+
File
.
separator
+
fileid
+
File
.
separator
+
fileName
;
File
file
=
new
File
(
fileFullPath
);
File
parent
=
new
File
(
file
.
getParent
());
if
(
!parent.exists()){
if
(
!parent.exists())
{
parent
.
mkdirs
();
}
FileCopyUtils
.
copy
(
multipartFile
.
getInputStream
(),
Files
.
newOutputStream
(
file
.
toPath
()));
item
=
new
FileItem
(
fileid
,
fileName
,
fileid
,
fileName
,(
int
)
multipartFile
.
getSize
(),
extname
);
FileCopyUtils
.
copy
(
multipartFile
.
getInputStream
(),
Files
.
newOutputStream
(
file
.
toPath
()));
item
=
new
FileItem
(
fileid
,
fileName
,
fileid
,
fileName
,
(
int
)
multipartFile
.
getSize
(),
extname
);
}
catch
(
IOException
e
)
{
throw
new
InternalServerErrorException
(
"文件上传失败,"
+
e
);
}
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleUserService.java.ftl
浏览文件 @
b80e2b6d
...
...
@@ -27,19 +27,19 @@ import org.springframework.security.core.authority.AuthorityUtils;
@
Primary
@
Service
(
"SimpleUserService"
)
@
ConditionalOnExpression
(
"(!${r'${ibiz.enablePermissionValid:false}'})&&'${r'${ibiz.auth.service:'}<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>IBZUAAUserService<#else>SimpleUserService</#if>${r'}'}'.equals('SimpleUserService')"
)
public
class
SimpleUserService
implements
AuthenticationUserService
{
public
class
SimpleUserService
implements
AuthenticationUserService
{
@
Override
public
AuthenticationUser
loadUserByUsername
(
String
username
)
{
AuthenticationUser
user
=
new
AuthenticationUser
();
String
[]
data
=
username
.
split
(
"[|]"
);
String
loginname
=
username
;
String
domains
=
""
;
String
password
=
""
;
String
[]
data
=
username
.
split
(
"[|]"
);
String
loginname
=
username
;
String
domains
=
""
;
String
password
=
""
;
if
(
data
.
length
==
2
)
{
loginname
=
data
[
0
].
trim
();
domains
=
data
[
1
].
trim
();
loginname
=
data
[
0
].
trim
();
domains
=
data
[
1
].
trim
();
}
user
.
setUserid
(
username
);
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录