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 f87ac4c7
authored
Aug 10, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp2jpa
1 parent
9a09a738
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerServiceImpl.java
View file @
f87ac4c
...
@@ -20,7 +20,11 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -20,7 +20,11 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaUpdate
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -45,10 +49,10 @@ public class EngineerServiceImpl implements EngineerService {
...
@@ -45,10 +49,10 @@ public class EngineerServiceImpl implements EngineerService {
private
OrgGroupDao
orgGroupDao
;
private
OrgGroupDao
orgGroupDao
;
@Autowired
@Autowired
private
EngineerBusiness
MPDao
engineerBusinessMP
Dao
;
private
EngineerBusiness
Dao
engineerBusiness
Dao
;
@Autowired
@Autowired
private
En
gineerBusinessDao
engineerBusinessDao
;
private
En
tityManager
entityManager
;
@Transactional
@Transactional
@Override
@Override
...
@@ -209,17 +213,18 @@ public class EngineerServiceImpl implements EngineerService {
...
@@ -209,17 +213,18 @@ public class EngineerServiceImpl implements EngineerService {
int
minute
=
this
.
getMinuteDiff
(
TimeUtils
.
time2LocalTime
(
workOn
),
TimeUtils
.
time2LocalTime
(
workOff
));
int
minute
=
this
.
getMinuteDiff
(
TimeUtils
.
time2LocalTime
(
workOn
),
TimeUtils
.
time2LocalTime
(
workOff
));
// 技术员业务属性配置修改
// 技术员业务属性配置修改
LambdaUpdateWrapper
<
EngineerBusiness
>
wrapper
=
new
LambdaUpdateWrapper
<>();
CriteriaBuilder
cb
=
entityManager
.
getCriteriaBuilder
();
wrapper
.
eq
(
EngineerBusiness:
:
getEngineerCode
,
engineerCode
);
CriteriaUpdate
<
EngineerBusiness
>
update
=
cb
.
createCriteriaUpdate
(
EngineerBusiness
.
class
);
wrapper
.
set
(
EngineerBusiness:
:
getMaxNum
,
maxNum
);
Root
<
EngineerBusiness
>
root
=
update
.
from
(
EngineerBusiness
.
class
);
wrapper
.
set
(
EngineerBusiness:
:
getDeparture
,
departure
);
update
.
set
(
root
.
get
(
"maxNum"
),
maxNum
);
wrapper
.
set
(
EngineerBusiness:
:
getPriority
,
priority
);
update
.
set
(
root
.
get
(
"departure"
),
departure
);
wrapper
.
set
(
EngineerBusiness:
:
getWorkOn
,
workOn
);
update
.
set
(
root
.
get
(
"priority"
),
priority
);
wrapper
.
set
(
EngineerBusiness:
:
getWorkOff
,
workOff
);
update
.
set
(
root
.
get
(
"workOn"
),
workOn
);
wrapper
.
set
(
EngineerBusiness:
:
getMaxMinute
,
minute
);
update
.
set
(
root
.
get
(
"workOff"
),
workOff
);
wrapper
.
set
(
EngineerBusiness:
:
getVehicle
,
transportMode
);
update
.
set
(
root
.
get
(
"maxMinute"
),
minute
);
// 更新字段
update
.
set
(
root
.
get
(
"vehicle"
),
transportMode
);
engineerBusinessMPDao
.
update
(
null
,
wrapper
);
update
.
where
(
cb
.
equal
(
root
.
get
(
"engineerCode"
),
engineerCode
));
entityManager
.
createQuery
(
update
).
executeUpdate
();
return
Result
.
success
(
null
);
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