Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3ed67bfb
authored
Aug 18, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复时间字段为空问题
1 parent
bc637c23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
project-order/src/main/java/com/dituhui/pea/order/entity/MapBlockInfoEntity.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/entity/MapBlockInfoEntity.java
View file @
3ed67bf
...
...
@@ -56,7 +56,7 @@ public class MapBlockInfoEntity {
@Column
(
name
=
"create_time"
,
nullable
=
false
,
columnDefinition
=
"datetime DEFAULT CURRENT_TIMESTAMP"
)
private
LocalDateTime
createTime
;
@Column
(
name
=
"update_time"
,
nullable
=
fals
e
,
columnDefinition
=
"datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
)
@Column
(
name
=
"update_time"
,
nullable
=
tru
e
,
columnDefinition
=
"datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
)
private
LocalDateTime
updateTime
;
// Getters and Setters
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
View file @
3ed67bf
...
...
@@ -25,6 +25,8 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.Predicate
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -199,6 +201,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
block
.
setLayer
(
layerName
);
block
.
setStatus
(
true
);
block
.
setArea
(
0L
);
block
.
setCreateTime
(
LocalDateTime
.
now
());
entityManager
.
persist
(
block
);
return
Result
.
success
(
null
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment