Browse Source

组织下不允许看到非组织添加的人员、部门网格下添加的人不允许再部门网格下移除

dev_shibei_match
sunyuchao 4 years ago
parent
commit
a61fd17deb
  1. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java
  2. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  3. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java

@ -31,5 +31,7 @@ public class ListStaffResultDTO implements Serializable {
private String orgName = ""; private String orgName = "";
//职责名称列表 //职责名称列表
private List<String> roles; private List<String> roles;
//工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
private String orgType = "";
} }

14
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.dataaggre.service.govorg.impl; package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -12,11 +11,6 @@ import com.epmet.dataaggre.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.*; import com.epmet.dataaggre.dto.govorg.*;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
@ -38,6 +32,7 @@ import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @Author zxc * @Author zxc
@ -401,6 +396,13 @@ public class GovOrgServiceImpl implements GovOrgService {
//2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】 //2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】
List<ListStaffResultDTO> staffList = epmetUserService.getStaffInfoList(formDTO); List<ListStaffResultDTO> staffList = epmetUserService.getStaffInfoList(formDTO);
//3.查询工作人员注册组织关系信息
List<String> staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(staffIdList)){
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList);
staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType())));
}
//3.封装数据并返回 //3.封装数据并返回
resultDTO.setStaffCount(staffIds.size()); resultDTO.setStaffCount(staffIds.size());
resultDTO.setStaffList((null == staffList ? new ArrayList<>() : staffList)); resultDTO.setStaffList((null == staffList ? new ArrayList<>() : staffList));

12
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -77,14 +77,16 @@
</when> </when>
<otherwise> <otherwise>
SELECT SELECT
user_id csa.user_id
FROM FROM
customer_staff_agency customer_staff_agency csa
INNER JOIN staff_org_relation sor ON csa.user_id = sor.staff_id
WHERE WHERE
del_flag = '0' csa.del_flag = '0'
AND agency_id = #{orgId} AND sor.org_type = 'agency'
AND csa.agency_id = #{orgId}
ORDER BY ORDER BY
created_time ASC csa.created_time ASC
</otherwise> </otherwise>
</choose> </choose>
</select> </select>

Loading…
Cancel
Save