Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
d03b29ca
Commit
d03b29ca
authored
Oct 27, 2020
by
mengbali153
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
培训计划
parent
d97611b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
28 deletions
+33
-28
PlanTrainingServiceImpl.java
...cement/business/service/impl/PlanTrainingServiceImpl.java
+33
-28
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanTrainingServiceImpl.java
View file @
d03b29ca
...
...
@@ -94,35 +94,15 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
if
(
save
)
{
Integer
planId
=
cama
.
getId
();
//todo 培训关联表对象 ==>plant + 基本用户信息
//拆分用户id
String
userIds
=
query
.
getUserIds
();
String
[]
split
=
userIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd
=
new
ArrayList
<>();
//为每个用户id创建关联表信息s
for
(
String
userId
:
split
)
{
Integer
id
=
Integer
.
parseInt
(
userId
);
UserVo
user
=
sysUserMapper
.
getById
(
id
);
PlanPeople
planPeople
=
new
PlanPeople
();
planPeople
.
setPlanId
(
planId
);
planPeople
.
setUserId
(
user
.
getId
());
planPeople
.
setName
(
user
.
getName
());
planPeople
.
setAccount
(
user
.
getUsername
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()
+
user
.
getName
()
+
"、"
);
}
//传的GroupIds
String
groupIds
=
query
.
getGroupIds
();
String
[]
split1
=
groupIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd1
=
new
ArrayList
<>();
for
(
String
groupId
:
split1
)
{
int
gpId
=
Integer
.
parseInt
(
groupId
);
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"group_id"
,
gpId
);
List
<
SysUser
>
sysUsers
=
sysUserMapper
.
selectList
(
qw
);
for
(
SysUser
user
:
sysUsers
)
{
if
(
query
.
getUserIds
()!=
null
)
{
//拆分用户id
String
userIds
=
query
.
getUserIds
();
String
[]
split
=
userIds
.
split
(
"、"
);
//为每个用户id创建关联表信息s
for
(
String
userId
:
split
)
{
Integer
id
=
Integer
.
parseInt
(
userId
);
UserVo
user
=
sysUserMapper
.
getById
(
id
);
PlanPeople
planPeople
=
new
PlanPeople
();
planPeople
.
setPlanId
(
planId
);
planPeople
.
setUserId
(
user
.
getId
());
...
...
@@ -131,6 +111,31 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()
+
user
.
getName
()
+
"、"
);
}
}
if
(
query
.
getGroupIds
()!=
null
)
{
//传的GroupIds
String
groupIds
=
query
.
getGroupIds
();
String
[]
split1
=
groupIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd1
=
new
ArrayList
<>();
for
(
String
groupId
:
split1
)
{
int
gpId
=
Integer
.
parseInt
(
groupId
);
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"group_id"
,
gpId
);
List
<
SysUser
>
sysUsers
=
sysUserMapper
.
selectList
(
qw
);
for
(
SysUser
user
:
sysUsers
)
{
PlanPeople
planPeople
=
new
PlanPeople
();
planPeople
.
setPlanId
(
planId
);
planPeople
.
setUserId
(
user
.
getId
());
planPeople
.
setName
(
user
.
getName
());
planPeople
.
setAccount
(
user
.
getUsername
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()
+
user
.
getName
()
+
"、"
);
}
}
}
iPlantPeopleService
.
saveBatch
(
batchAdd
);
...
...
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