Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
5ae1c658
Commit
5ae1c658
authored
Mar 16, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分小组选择部门
parent
b1da7d55
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
BReleaseValueRepository.java
...t/business/breleasevalue/dao/BReleaseValueRepository.java
+2
-1
BReleaseValueDto.java
.../rcisoft/business/breleasevalue/dto/BReleaseValueDto.java
+3
-0
BReleaseValueServiceImpl.java
.../breleasevalue/service/impl/BReleaseValueServiceImpl.java
+19
-9
No files found.
src/main/java/org/rcisoft/business/breleasevalue/dao/BReleaseValueRepository.java
View file @
5ae1c658
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
/**
/**
* Created with on 2019-11-13 13:28:38.
* Created with on 2019-11-13 13:28:38.
...
@@ -68,7 +69,7 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
...
@@ -68,7 +69,7 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
@Delete
(
"<script><foreach collection=\"userId\" item=\"item\" separator=\";\">"
+
@Delete
(
"<script><foreach collection=\"userId\" item=\"item\" separator=\";\">"
+
" delete from b_release_value_son where user_id = #{item}"
+
" delete from b_release_value_son where user_id = #{item}"
+
"</foreach></script>"
)
"</foreach></script>"
)
int
deleteSonForUserId
(
@Param
(
"userId"
)
S
tring
[]
userId
);
int
deleteSonForUserId
(
@Param
(
"userId"
)
S
et
<
String
>
userId
);
/**
/**
* 根据releaseId删除子表中相关数据
* 根据releaseId删除子表中相关数据
...
...
src/main/java/org/rcisoft/business/breleasevalue/dto/BReleaseValueDto.java
View file @
5ae1c658
...
@@ -24,4 +24,7 @@ public class BReleaseValueDto {
...
@@ -24,4 +24,7 @@ public class BReleaseValueDto {
@ApiModelProperty
(
value
=
"用户ids(用 , 隔开)"
)
@ApiModelProperty
(
value
=
"用户ids(用 , 隔开)"
)
private
String
userIds
;
private
String
userIds
;
@ApiModelProperty
(
value
=
"部门ids(用 , 隔开)"
)
private
String
deptIds
;
}
}
src/main/java/org/rcisoft/business/breleasevalue/service/impl/BReleaseValueServiceImpl.java
View file @
5ae1c658
...
@@ -71,7 +71,7 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
...
@@ -71,7 +71,7 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
// 删除子表中的相关记录
// 删除子表中的相关记录
bReleaseValueRepository
.
deleteSonForReleaseId
(
bReleaseValueDto
.
getBusinessId
());
bReleaseValueRepository
.
deleteSonForReleaseId
(
bReleaseValueDto
.
getBusinessId
());
if
(
StringUtils
.
isNotEmpty
(
bReleaseValueDto
.
getUserIds
())){
if
(
StringUtils
.
isNotEmpty
(
bReleaseValueDto
.
getUserIds
())){
this
.
splitUser
(
bReleaseValueDto
.
getUserIds
(),
bReleaseValueDto
.
getBusinessId
());
this
.
splitUser
(
bReleaseValueDto
.
getUserIds
(),
bReleaseValueDto
.
get
DeptIds
(),
bReleaseValueDto
.
get
BusinessId
());
}
}
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
...
@@ -84,8 +84,8 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
...
@@ -84,8 +84,8 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
bReleaseValue
.
setLessonValue
(
bReleaseValueDto
.
getLessonValue
());
bReleaseValue
.
setLessonValue
(
bReleaseValueDto
.
getLessonValue
());
UserUtil
.
setCurrentPersistOperation
(
bReleaseValue
);
UserUtil
.
setCurrentPersistOperation
(
bReleaseValue
);
if
(
StringUtils
.
isNotEmpty
(
bReleaseValueDto
.
getUserIds
())){
if
(
StringUtils
.
isNotEmpty
(
bReleaseValueDto
.
getUserIds
())
||
StringUtils
.
isNotEmpty
(
bReleaseValueDto
.
getDeptIds
())
){
this
.
splitUser
(
bReleaseValueDto
.
getUserIds
(),
bReleaseValue
.
getBusinessId
());
this
.
splitUser
(
bReleaseValueDto
.
getUserIds
(),
bReleaseValue
Dto
.
getDeptIds
(),
bReleaseValue
.
getBusinessId
());
}
}
int
line
=
bReleaseValueRepository
.
insert
(
bReleaseValue
);
int
line
=
bReleaseValueRepository
.
insert
(
bReleaseValue
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
...
@@ -283,17 +283,27 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
...
@@ -283,17 +283,27 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
/**
/**
* 去掉子表中已有用户信息,插入新的数据
* 去掉子表中已有用户信息,插入新的数据
* @param userIds
* @param userIds
* @param deptIds
* @param businessId
* @param businessId
*/
*/
public
void
splitUser
(
String
userIds
,
String
businessId
){
public
void
splitUser
(
String
userIds
,
String
deptIds
,
String
businessId
){
List
<
String
>
ids
=
new
ArrayList
<>();
String
[]
ids
=
userIds
.
split
(
","
);
if
(
StringUtils
.
isNotEmpty
(
userIds
)){
ids
.
addAll
(
Arrays
.
asList
(
userIds
.
split
(
","
)));
}
if
(
StringUtils
.
isNotEmpty
(
deptIds
)){
List
<
String
>
deptList
=
Arrays
.
asList
(
deptIds
.
split
(
","
));
Set
<
String
>
deptSets
=
new
HashSet
<>(
deptList
);
List
<
String
>
data
=
mtCotactApiRequestClient
.
getSubUserIdsByDeptIds
(
UserUtil
.
getCurUser
().
getCorpId
(),
deptSets
);
ids
.
addAll
(
data
);
}
Set
<
String
>
idSet
=
new
HashSet
<>(
ids
);
// 删除子表中与当前选中用户相关的信息
// 删除子表中与当前选中用户相关的信息
bReleaseValueRepository
.
deleteSonForUserId
(
id
s
);
bReleaseValueRepository
.
deleteSonForUserId
(
id
Set
);
//将关联信息插入子表
//将关联信息插入子表
List
<
BReleaseValueSon
>
list
=
new
ArrayList
<>();
List
<
BReleaseValueSon
>
list
=
new
ArrayList
<>();
if
(
id
s
.
length
>
0
){
if
(
id
Set
.
size
()
>
0
){
for
(
String
id
:
id
s
){
for
(
String
id
:
id
Set
){
BReleaseValueSon
bReleaseValueSon
=
new
BReleaseValueSon
();
BReleaseValueSon
bReleaseValueSon
=
new
BReleaseValueSon
();
bReleaseValueSon
.
setBusinessId
(
IdGen
.
uuid
());
bReleaseValueSon
.
setBusinessId
(
IdGen
.
uuid
());
bReleaseValueSon
.
setReleaseId
(
businessId
);
bReleaseValueSon
.
setReleaseId
(
businessId
);
...
...
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