Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
a60854fc
Commit
a60854fc
authored
Mar 31, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改知识库档案存储bug
parent
7a38866b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
MetaHandler.java
...in/java/com/yeejoin/amos/boot/biz/config/MetaHandler.java
+14
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/config/MetaHandler.java
View file @
a60854fc
...
@@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.lang.reflect.Field
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -75,7 +75,7 @@ public class MetaHandler implements MetaObjectHandler {
...
@@ -75,7 +75,7 @@ public class MetaHandler implements MetaObjectHandler {
this
.
setFieldValByName
(
"recDate"
,
currentDate
,
metaObject
);
this
.
setFieldValByName
(
"recDate"
,
currentDate
,
metaObject
);
}
}
//以下为装备中转移过来的
//以下为装备中转移过来的
if
(
isExistField
(
"userId"
,
entity
))
{
if
(
isExistField
(
"userId"
,
entity
)
&&
isStringField
(
metaObject
,
"userId"
)
)
{
this
.
setFieldValByName
(
"userId"
,
String
.
valueOf
(
agencyUserModel
.
getUserId
()),
metaObject
);
this
.
setFieldValByName
(
"userId"
,
String
.
valueOf
(
agencyUserModel
.
getUserId
()),
metaObject
);
}
}
if
(
isExistField
(
"creatorId"
,
entity
))
{
if
(
isExistField
(
"creatorId"
,
entity
))
{
...
@@ -118,6 +118,18 @@ public class MetaHandler implements MetaObjectHandler {
...
@@ -118,6 +118,18 @@ public class MetaHandler implements MetaObjectHandler {
return
jsonObj
.
containsKey
(
field
);
return
jsonObj
.
containsKey
(
field
);
}
}
private
Boolean
isStringField
(
MetaObject
metaObject
,
String
fieldName
)
{
Class
clazz
=
metaObject
.
getOriginalObject
().
getClass
();
Field
[]
fields
=
clazz
.
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
if
(
fieldName
.
equals
(
field
.
getName
())
&&
(
"class java.lang.String"
).
equals
(
field
.
getGenericType
().
toString
()))
{
return
true
;
}
}
return
false
;
}
/**
/**
* 更新拦截
* 更新拦截
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment