dev:岗位管理-接口联调
parent
f83f8cb323
commit
0be93af579
|
|
@ -18,6 +18,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -72,6 +73,8 @@ public class PostController {
|
|||
}
|
||||
if(qry.getPostIdsString() != null && qry.getPostIdsString().length > 0){
|
||||
qry.setPostIds(Arrays.stream(qry.getPostIdsString())
|
||||
.filter(Objects::nonNull) // 过滤掉null
|
||||
.filter(str -> !str.trim().isEmpty()) // 过滤掉空字符串
|
||||
.map(Long::valueOf)
|
||||
.toArray(Long[]::new));
|
||||
}
|
||||
|
|
@ -104,6 +107,8 @@ public class PostController {
|
|||
// 数据类型转换
|
||||
if(cmd.getIdsString() != null && cmd.getIdsString().length > 0){
|
||||
cmd.setIds(Arrays.stream(cmd.getIdsString())
|
||||
.filter(Objects::nonNull) // 过滤掉null
|
||||
.filter(str -> !str.trim().isEmpty()) // 过滤掉空字符串
|
||||
.map(Long::valueOf)
|
||||
.toArray(Long[]::new));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ public class PostAddExe {
|
|||
}
|
||||
if(cmd.getDepartmentIdsString() != null && cmd.getDepartmentIdsString().length > 0){
|
||||
cmd.setDepartmentIds(Arrays.stream(cmd.getDepartmentIdsString())
|
||||
.filter(Objects::nonNull) // 过滤掉null
|
||||
.filter(str -> !str.trim().isEmpty()) // 过滤掉空字符串
|
||||
.map(Long::valueOf)
|
||||
.toArray(Long[]::new));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -48,6 +49,8 @@ public class PostUpdateExe {
|
|||
}
|
||||
if(postUpdateCmd.getDepartmentIdsString() != null && postUpdateCmd.getDepartmentIdsString().length > 0){
|
||||
postUpdateCmd.setDepartmentIds(Arrays.stream(postUpdateCmd.getDepartmentIdsString())
|
||||
.filter(Objects::nonNull) // 过滤掉null
|
||||
.filter(str -> !str.trim().isEmpty()) // 过滤掉空字符串
|
||||
.map(Long::valueOf)
|
||||
.toArray(Long[]::new));
|
||||
}
|
||||
|
|
@ -76,22 +79,6 @@ public class PostUpdateExe {
|
|||
}
|
||||
}
|
||||
|
||||
// if(res && postUpdateCmd.getSupervisionFlag() != null && postUpdateCmd.getSupervisionFlag() == 1){
|
||||
// postDepartmentGateway.deletedPostDepartment(postE.getId());
|
||||
// List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postE.getId(), postUpdateCmd.getDepartmentIds());
|
||||
// if(CollUtil.isNotEmpty(postDepartmentEList)){
|
||||
// res = postDepartmentGateway.addList(postDepartmentEList);
|
||||
// }
|
||||
// }else {
|
||||
// // 修改时如果改为不是监管岗位, 则删除岗位-部门关联表数据
|
||||
// if(res && postUpdateCmd.getSupervisionFlag() != null && postUpdateCmd.getSupervisionFlag() == 0){
|
||||
// postDepartmentGateway.deletedPostDepartment(postE.getId());
|
||||
// }
|
||||
// if(res && postUpdateCmd.getSupervisionFlag() == null){
|
||||
// postDepartmentGateway.deletedPostDepartment(postE.getId());
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue