|
|
|
|
@ -31,6 +31,8 @@ import java.time.ZoneId;
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Set; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
@Service |
|
|
|
|
@ -50,25 +52,16 @@ public class RpcApplyService extends ServiceImpl<RpcApplyMapper, RpcApply> {
|
|
|
|
|
public Page<RpcApplyVo> page(RpcApplyQueryParam queryParam, String type) { |
|
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
QueryWrapper<RpcApply> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
// if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) {
|
|
|
|
|
// List<RpcRightPerson> rightPeoples = rpcRightPersonService.list(user.getUserName());
|
|
|
|
|
// if (rightPeoples.isEmpty()) {
|
|
|
|
|
// return new Page<RpcApplyVo>().setTotal(0).setRecords(new ArrayList<>());
|
|
|
|
|
// }
|
|
|
|
|
// // 是否是市局维权专干
|
|
|
|
|
// if (rightPeoples.stream().noneMatch(item -> "1".equals(item.getCouncil()))) {
|
|
|
|
|
// Set<String> departIds = rightPeoples.stream().map(RpcRightPerson::getDepartId).collect(Collectors.toSet());
|
|
|
|
|
// List<String> childrenIds = departService.getAllNodeIds(departIds);
|
|
|
|
|
// queryWrapper.in("a.handle_depart_id", childrenIds);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) { |
|
|
|
|
List<String> orgIds = new ArrayList<>(); |
|
|
|
|
if(StrUtil.isNotBlank(user.getDepartId())){ |
|
|
|
|
orgIds.add(user.getDepartId()); |
|
|
|
|
List<RpcRightPerson> rightPeoples = rpcRightPersonService.list(user.getUserName()); |
|
|
|
|
if (rightPeoples.isEmpty()) { |
|
|
|
|
return new Page<RpcApplyVo>().setTotal(0).setRecords(new ArrayList<>()); |
|
|
|
|
} |
|
|
|
|
if(CollectionUtil.isNotEmpty(orgIds)){ |
|
|
|
|
orgIds.addAll(departService.getAllNodeIds(user.getAuthDepartIds())); |
|
|
|
|
// 是否是市局维权专干
|
|
|
|
|
if (rightPeoples.stream().noneMatch(item -> "1".equals(item.getCouncil()))) { |
|
|
|
|
Set<String> departIds = rightPeoples.stream().map(RpcRightPerson::getDepartId).collect(Collectors.toSet()); |
|
|
|
|
List<String> childrenIds = departService.getAllNodeIds(departIds); |
|
|
|
|
queryWrapper.in("a.handle_depart_id", childrenIds); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
queryWrapper.like(StrUtil.isNotBlank(queryParam.getApplicantEmpName()), "a.applicant_emp_name", queryParam.getApplicantEmpName()) |
|
|
|
|
|