Browse Source

议题管理、项目跟踪-部门人员选择

dev_shibei_match
sunyuchao 5 years ago
parent
commit
66295e450f
  1. 15
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java
  2. 11
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  3. 7
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  4. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  5. 15
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  6. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java
  7. 45
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffListResultDTO.java
  8. 48
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java
  9. 51
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentStaffListResultDTO.java
  10. 49
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DeptListResultDTO.java
  11. 49
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListResultDTO.java
  12. 36
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffListResultDTO.java
  13. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java
  14. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  15. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  16. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
  17. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java
  18. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java
  19. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  20. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
  21. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  22. 149
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  23. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  24. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
  25. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml
  26. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml
  27. 6
      epmet-module/gov-project/gov-project-server/pom.xml
  28. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java
  29. 12
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  30. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  31. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java
  32. 15
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java
  33. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  34. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  35. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  36. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  37. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  38. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
  39. 17
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

15
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java

@ -7,6 +7,8 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CloseIssueFormDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.service.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -39,5 +41,18 @@ public class IssueManageController {
issueService.closeIssue(formDTO);
return new Result();
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-部门人员选择
**/
@PostMapping("departmentstafflist")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT)
public Result<DepartmentStaffListResultDTO> departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<DepartmentStaffListResultDTO>().ok(issueService.departmentStaffList(formDTO));
}
}

11
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -5,8 +5,10 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
@ -24,4 +26,13 @@ public interface GovOrgFeignClient {
**/
@PostMapping("/gov/org/customergrid/getcustomergridbygridid")
Result<AgencyGridResultDTO> getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO);
/**
* @param agencyId
* @return
* @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/
@PostMapping(value = "/gov/org/customeragency/departmentstafflist/{agencyId}")
Result<DepartmentStaffListResultDTO> departmentStaffList(@PathVariable("agencyId") String agencyId);
}

7
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
@ -13,8 +14,14 @@ import org.springframework.stereotype.Component;
*/
@Component
public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
@Override
public Result<AgencyGridResultDTO> getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getagencyandgrid", agencyGridResultDTO);
}
@Override
public Result<DepartmentStaffListResultDTO> departmentStaffList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", agencyId);
}
}

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java

@ -2,7 +2,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.CloseIssueFormDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.form.IssueDetailFormDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.dto.result.IssueResultDTO;
import com.epmet.entity.IssueEntity;
@ -28,4 +30,11 @@ public interface IssueService extends BaseService<IssueEntity> {
**/
void closeIssue(CloseIssueFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-部门人员选择
**/
DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO);
}

15
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -11,9 +11,11 @@ import com.epmet.constant.UserMessageConstant;
import com.epmet.dao.IssueDao;
import com.epmet.dao.IssueProcessDao;
import com.epmet.dto.form.CloseIssueFormDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.form.IssueDetailFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.dto.result.IssueResultDTO;
import com.epmet.entity.IssueEntity;
import com.epmet.entity.IssueProcessEntity;
@ -136,4 +138,17 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
msgList.add(msgDTO);
return messageFeignClient.saveUserMessageList(msgList);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-部门人员选择
**/
@Override
public DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO) {
//1:调用gov-org服务,分别查询组织下人员,组织下部门人员,组织下网格人员列表信息
Result<DepartmentStaffListResultDTO> resultDTOResult = govOrgFeignClient.departmentStaffList(formDTO.getAgencyId());
return resultDTOResult.getData();
}
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 项目跟踪-部门人员选择-接口入参
* @Author sun
*/
@Data
public class DepartmentStaffListFormDTO implements Serializable {
private static final long serialVersionUID = 4859779755214502427L;
@NotBlank(message = "机关组织Id不能为空")
private String agencyId;
}

45
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffListResultDTO.java

@ -0,0 +1,45 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 工作人员信息及角色
*
* @author sun
*/
@Data
public class CustomerStaffListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 工作人员信息集合
*/
private List<StaffListResultDTO> staffList;
/**
* 工作人员角色集合
*/
private List<CustomerStaffRoleResultDTO> roleList;
}

48
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java

@ -0,0 +1,48 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 工作人员角色
*
* @author sun
*/
@Data
public class CustomerStaffRoleResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 工作人员Id
*/
private String staffId = "";
/**
* 人员角色Key
*/
private String roleKey = "";
/**
* 人员角色名称
*/
private String roleName = "";
}

51
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentStaffListResultDTO.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 项目跟踪-部门人员选择-接口返参
*
* @author sun
*/
@Data
public class DepartmentStaffListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组织下工作人员信息
*/
private List<StaffListResultDTO> agencyStaffList;
/**
* 部门人员选择-组织下部门及人员列表
*/
private List<DeptListResultDTO> departmentList;
/**
* 部门人员选择-组织下网格及人员列表
*/
private List<GridListResultDTO> gridList;
}

49
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DeptListResultDTO.java

@ -0,0 +1,49 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 部门人员选择-组织下部门及人员列表
*
* @author sun
*/
@Data
public class DeptListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 部门Id
*/
private String departmentId;
/**
* 部门名称
*/
private String departmentName;
/**
* 部门下人员集合
*/
private List<StaffListResultDTO> departmentStaffList;
}

49
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListResultDTO.java

@ -0,0 +1,49 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 部门人员选择-组织下网格及人员列表
*
* @author sun
*/
@Data
public class GridListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格Id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 网格下工作人员集合
*/
private List<StaffListResultDTO> gridStaffList;
}

36
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffListResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @dscription 工作人员信息
* @author sun
*/
@Data
public class StaffListResultDTO implements Serializable {
private static final long serialVersionUID = 5957826616179876849L;
/**
* 人员Id
*/
private String staffId;
/**
* 人员名称
*/
private String staffName;
/**
* 人员头像
*/
private String staffHeadPhoto;
/**
* 性别
*/
private String gender;
/**
* 角色名称(机关领导部门领导网格长)
*/
private String roleName;
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java

@ -38,4 +38,17 @@ public interface CustomerAgencyConstant {
* 组织信息查询失败
*/
String SELECT_EXCEPTION = "根据组织ID未查询到机构组织信息";
/**
* 工作人员角色-单位领导
*/
String AGENCY_LEADER = "agency_leader";
/**
* 工作人员角色-部门领导
*/
String DEPT_LEADER = "dept_leader";
/**
* 工作人员角色-网格长
*/
String GRID_MANAGER = "grid_manager";
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.excel.CustomerAgencyExcel;
import com.epmet.service.CustomerAgencyService;
@ -117,4 +118,15 @@ public class CustomerAgencyController {
return new Result<AgencyGridResultDTO>().ok(customerAgencyService.getAgencyAndGrid(agencyGridResultDTO));
}
/**
* @param agencyId
* @return
* @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/
@PostMapping("departmentstafflist/{agencyId}")
public Result<DepartmentStaffListResultDTO> departmentStaffList(@PathVariable("agencyId") String agencyId) {
return new Result<DepartmentStaffListResultDTO>().ok(customerAgencyService.departmentStaffList(agencyId));
}
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -18,10 +18,11 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.*;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.UserIdAndPidDTO;
import com.epmet.dto.UserIdDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -160,4 +161,10 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @date 2020/5/11 18:50
*/
BelongGridNameResultDTO getGridNameByGridId(BelongGridNameFormDTO formDTO);
/**
* @Description 根据组织机关Id查询机关下网格列表
* @author sun
*/
List<GridListResultDTO> selectGridList(@Param("agencyId") String agencyId);
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.StaffListResultDTO;
import com.epmet.entity.CustomerStaffAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -68,4 +69,10 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @Date 2020.04.26 16:33
**/
List<String> getSelectableStaffsForDept(@Param("departmentId") String departmentId);
/**
* 查询组织下人员列表
* @Author sun
*/
List<StaffListResultDTO> selectAgencyStaffList(@Param("agencyId") String agencyId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.entity.CustomerStaffDepartmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -58,4 +59,11 @@ public interface CustomerStaffDepartmentDao extends BaseDao<CustomerStaffDepartm
* @Date 2020.04.27 16:54
**/
void updateByDeptIdAndUserId(CustomerStaffDepartmentDTO staffDepartmentDTO);
/**
*
* @Author sun
* @Description 遍历查询每个部门下人员
*/
List<CustomerStaffDepartmentDTO> selectDeptStaffs(@Param("deptIdList") List<String> deptIdList);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.entity.CustomerStaffGridEntity;
@ -82,4 +83,11 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @Author sun
*/
List<CustomerStaffGridDTO> selectByGridId(@Param("gridId")String gridId);
/**
*
* @Author sun
* @Description 遍历查询每个部门下人员
*/
List<CustomerStaffGridDTO> selectGridStaffs(@Param("gridIdList") List<String> gridIdList);
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -22,6 +22,7 @@ import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.feign.fallback.EpmetUserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -159,4 +160,13 @@ public interface EpmetUserFeignClient {
**/
@PostMapping("/epmetuser/staffrole/getcustomerstaffroles")
Result<StaffRolesResultDTO> getCustomerStaffRoles(CommonUserFormDTO commonUserFormDTO);
/**
* @param staffIdList
* @return
* @Author sun
* @Description 根据staffId集合查询工作人员基础信息
**/
@PostMapping(value = "/epmetuser/customerstaff/getcustomerstafflist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<CustomerStaffListResultDTO> getCustomerStaffList(List<String> staffIdList);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java

@ -101,4 +101,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
public Result<StaffRolesResultDTO> getCustomerStaffRoles(CommonUserFormDTO commonUserFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoles", commonUserFormDTO);
}
@Override
public Result<CustomerStaffListResultDTO> getCustomerStaffList(List<String> staffIdList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffList", staffIdList);
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.entity.CustomerAgencyEntity;
@ -113,4 +114,12 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Description 根据组织Id网格Id查询组织网格名称
**/
AgencyGridResultDTO getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO);
/**
* @param agencyId
* @return
* @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/
DepartmentStaffListResultDTO departmentStaffList(String agencyId);
}

149
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -27,16 +27,14 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmFeignClient;
import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.service.CustomerAgencyService;
@ -47,9 +45,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* 机关单位信息表
@ -67,6 +64,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
private OperCrmFeignClient operCrmFeignClient;
@Autowired
private CustomerGridDao customerGridDao;
@Autowired
private CustomerStaffAgencyDao customerStaffAgencyDao;
@Autowired
private CustomerDepartmentDao customerDepartmentDao;
@Autowired
private CustomerStaffDepartmentDao customerStaffDepartmentDao;
@Autowired
private CustomerStaffGridDao customerStaffGridDao;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Override
public PageData<CustomerAgencyDTO> page(Map<String, Object> params) {
IPage<CustomerAgencyEntity> page = baseDao.selectPage(
@ -167,4 +175,127 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return agencyGridResultDTO;
}
/**
* @param agencyId
* @return
* @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/
@Override
public DepartmentStaffListResultDTO departmentStaffList(String agencyId) {
//根据组织Id查询该组织的工作人员列表;该组织的部门列表、部门下人员(带部门领导角色)列表;该组织的网格列表、网格下人员(带网格长角色)列表。人员都不做去重处理。
DepartmentStaffListResultDTO resultDTO = new DepartmentStaffListResultDTO();
//1:根据组织Id查询该组织下工作人员列表
List<StaffListResultDTO> agencyStaffList = customerStaffAgencyDao.selectAgencyStaffList(agencyId);
//2:根据组织Id查询该组织下部门、人员列表
//2.1:查询组织下部门列表
List<DepartmentListResultDTO> listDept = customerDepartmentDao.selectDepartmentList(agencyId);
List<DeptListResultDTO> departmentList = ConvertUtils.sourceToTarget(listDept, DeptListResultDTO.class);
//2.2:查询每一个部门下人员列表
List<String> deptIdList = departmentList.stream().map(DeptListResultDTO::getDepartmentId).collect(Collectors.toList());
List<CustomerStaffDepartmentDTO> deptStaffs = customerStaffDepartmentDao.selectDeptStaffs(deptIdList);
departmentList.forEach(dept->{
List<StaffListResultDTO> departmentStaffList = new ArrayList<>();
deptStaffs.forEach(ds->{
if(dept.getDepartmentId().equals(ds.getDepartmentId())){
StaffListResultDTO sf = new StaffListResultDTO();
sf.setStaffId(ds.getUserId());
departmentStaffList.add(sf);
}
});
dept.setDepartmentStaffList(departmentStaffList);
});
//3:根据组织Id查询该组织下网格、人员列表
//3.1:查询组织下网格列表
List<GridListResultDTO> gridList = customerGridDao.selectGridList(agencyId);
//3.2:查询每一个网格下人员列表
List<String> gridIdList = gridList.stream().map(GridListResultDTO::getGridId).collect(Collectors.toList());
List<CustomerStaffGridDTO> gridStaffs = customerStaffGridDao.selectGridStaffs(gridIdList);
gridList.forEach(grid->{
List<StaffListResultDTO> gridStaffList = new ArrayList<>();
gridStaffs.forEach(gs->{
if(grid.getGridId().equals(gs.getGridId())){
StaffListResultDTO sf = new StaffListResultDTO();
sf.setStaffId(gs.getUserId());
gridStaffList.add(sf);
}
});
grid.setGridStaffList(gridStaffList);
});
//4:汇总组织下人员、组织下部门下人员、组织下网格下人员Id集合,调用epmet-user服务查询工作人员基本信息
List<String> staffIdList1 = agencyStaffList.stream().map(StaffListResultDTO::getStaffId).collect(Collectors.toList());
List<String> staffIdList2 = deptStaffs.stream().map(CustomerStaffDepartmentDTO::getUserId).collect(Collectors.toList());
List<String> staffIdList3 = gridStaffs.stream().map(CustomerStaffGridDTO::getUserId).collect(Collectors.toList());
List<String> staffIdList = new ArrayList<>();
staffIdList.addAll(staffIdList1); staffIdList.addAll(staffIdList2); staffIdList.addAll(staffIdList3);
staffIdList = new ArrayList<String>(new LinkedHashSet<>(staffIdList));
Result<CustomerStaffListResultDTO> userList = epmetUserFeignClient.getCustomerStaffList(staffIdList);
//5:循环数据,将人员数据放到对应数据结构下
CustomerStaffListResultDTO dto = userList.getData();
List<StaffListResultDTO> staffList = dto.getStaffList();
List<CustomerStaffRoleResultDTO> roleList = dto.getRoleList();
//有时间再优化成jdk8的遍历方式
//5.1装载组织下人员数据
for(StaffListResultDTO sf : agencyStaffList){
//人员信息
for(StaffListResultDTO stf : staffList){
if(sf.getStaffId().equals(stf.getStaffId())){
sf = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class);
break;
}
}
//人员角色信息
for(CustomerStaffRoleResultDTO role : roleList){
if(sf.getStaffId().equals(role.getStaffId())&&CustomerAgencyConstant.AGENCY_LEADER.equals(role.getRoleKey())){
sf.setRoleName(role.getRoleName());
break;
}
}
}
//5.2装载组织下部门下人员数据
for(DeptListResultDTO dept : departmentList){
List<StaffListResultDTO> departmentStaffList = dept.getDepartmentStaffList();
for(StaffListResultDTO ds : departmentStaffList){
//人员信息
for(StaffListResultDTO stf : staffList){
if(ds.getStaffId().equals(stf.getStaffId())){
ds = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class);
break;
}
}
//人员角色信息
for(CustomerStaffRoleResultDTO role : roleList){
if(ds.getStaffId().equals(role.getStaffId())&&CustomerAgencyConstant.DEPT_LEADER.equals(role.getRoleKey())){
ds.setRoleName(role.getRoleName());
break;
}
}
}
}
//5.3装载组织下网格下人员数据
for(GridListResultDTO grid : gridList){
List<StaffListResultDTO> gridStaffList = grid.getGridStaffList();
for(StaffListResultDTO gs : gridStaffList){
//人员信息
for(StaffListResultDTO stf : staffList){
if(gs.getStaffId().equals(stf.getStaffId())){
gs = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class);
break;
}
}
//人员角色信息
for(CustomerStaffRoleResultDTO role : roleList){
if(gs.getStaffId().equals(role.getStaffId())&&CustomerAgencyConstant.GRID_MANAGER.equals(role.getRoleKey())){
gs.setRoleName(role.getRoleName());
break;
}
}
}
}
resultDTO.setAgencyStaffList(agencyStaffList);
resultDTO.setDepartmentList(departmentList);
resultDTO.setGridList(gridList);
return resultDTO;
}
}

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -285,4 +285,14 @@
AND cg.del_flag = 0
</select>
<select id="selectGridList" resultType="com.epmet.dto.result.GridListResultDTO">
SELECT
id AS "gridId",
grid_name AS "gridName"
FROM customer_grid
WHERE del_flag = '0'
AND pid = #{agencyId}
ORDER BY created_time DESC
</select>
</mapper>

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -95,6 +95,14 @@
DEPARTMENT_ID = #{departmentId} )
</select>
<select id="selectAgencyStaffList" resultType="com.epmet.dto.result.StaffListResultDTO">
SELECT
user_id AS "staffId"
FROM
customer_staff_agency
WHERE
del_flag = '0'
AND agency_id =#{agencyId}
</select>
</mapper>

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml

@ -14,6 +14,20 @@
</select>
<select id="selectDeptStaffs" resultType="com.epmet.dto.CustomerStaffDepartmentDTO">
SELECT
department_id,
user_id
FROM
customer_staff_department
WHERE
del_flag = '0'
AND
<foreach item="departmentId" collection="deptIdList" open="(" separator="or" close=")">
department_id = #{departmentId}
</foreach>
</select>
<!-- 修改部门人数 -->
<update id="updateDepartmentStaffCount">
UPDATE

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml

@ -63,6 +63,20 @@
AND csg.grid_id = #{gridId}
</select>
<select id="selectGridStaffs" resultType="com.epmet.dto.CustomerStaffGridDTO">
SELECT
grid_id,
user_id
FROM
customer_staff_grid
WHERE
del_flag = '0'
AND
<foreach item="gridId" collection="gridIdList" open="(" separator="or" close=")">
grid_id = #{gridId}
</foreach>
</select>
<!-- 批量插入网格工作人员 -->
<insert id="insertBatch" parameterType="java.util.List">
insert into customer_staff_grid

6
epmet-module/gov-project/gov-project-server/pom.xml

@ -72,6 +72,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java

@ -10,6 +10,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.service.ProjectProcessService;
import com.epmet.service.ProjectSatisfactionDetailService;
import com.epmet.service.ProjectStaffService;
import com.epmet.service.ProjectTraceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -37,6 +38,9 @@ public class ProjectTraceController {
@Autowired
private ProjectSatisfactionDetailService projectSatisfactionDetailService;
@Autowired
private ProjectStaffService projectStaffService;
/**
* 待处理项目列表
*
@ -166,5 +170,18 @@ public class ProjectTraceController {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<EvaluationListResultDTO>>().ok(projectSatisfactionDetailService.evaluationList(formDTO));
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 项目跟踪-部门人员选择
**/
@PostMapping("departmentstafflist")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER)
public Result<DepartmentStaffListResultDTO> departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<DepartmentStaffListResultDTO>().ok(projectStaffService.departmentStaffList(formDTO));
}
}

12
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -2,8 +2,12 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
@ -13,5 +17,13 @@ import org.springframework.cloud.openfeign.FeignClient;
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class)
public interface GovOrgFeignClient {
/**
* @param agencyId
* @return
* @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/
@PostMapping(value = "/gov/org/customeragency/departmentstafflist/{agencyId}")
Result<DepartmentStaffListResultDTO> departmentStaffList(@PathVariable("agencyId") String agencyId);
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -1,5 +1,9 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
@ -10,4 +14,8 @@ import org.springframework.stereotype.Component;
@Component
public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
@Override
public Result<DepartmentStaffListResultDTO> departmentStaffList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", agencyId);
}
}

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java

@ -20,7 +20,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.result.DepartmentResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.entity.ProjectStaffEntity;
import java.util.List;
@ -103,4 +105,12 @@ public interface ProjectStaffService extends BaseService<ProjectStaffEntity> {
* @date 2020/5/12 16:40
*/
List<DepartmentResultDTO> getDepartmentNameList(ProjectStaffDTO dto);
/**
* @param formDTO
* @return
* @Author sun
* @Description 项目跟踪-部门人员选择
**/
DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO);
}

15
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java

@ -20,13 +20,17 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.ProjectStaffDao;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.result.DepartmentResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.entity.ProjectStaffEntity;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.redis.ProjectStaffRedis;
import com.epmet.service.ProjectStaffService;
import org.apache.commons.lang3.StringUtils;
@ -49,6 +53,8 @@ public class ProjectStaffServiceImpl extends BaseServiceImpl<ProjectStaffDao, Pr
@Autowired
private ProjectStaffRedis projectStaffRedis;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Override
public PageData<ProjectStaffDTO> page(Map<String, Object> params) {
@ -107,4 +113,11 @@ public class ProjectStaffServiceImpl extends BaseServiceImpl<ProjectStaffDao, Pr
return baseDao.selectDepartmentNameList(dto);
}
@Override
public DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO) {
//1:调用gov-org服务,分别查询组织下人员,组织下部门人员,组织下网格人员列表信息
Result<DepartmentStaffListResultDTO> resultDTOResult = govOrgFeignClient.departmentStaffList(formDTO.getAgencyId());
return resultDTOResult.getData();
}
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -269,4 +269,15 @@ public class CustomerStaffController {
ValidatorUtils.validateEntity(userIdList);
return customerStaffService.getEnableStaffMsgList(userIdList);
}
/**
* @param staffIdList
* @return
* @Author sun
* @Description 根据staffId集合查询工作人员基础信息
**/
@PostMapping(value = "getcustomerstafflist")
public Result<CustomerStaffListResultDTO> getCustomerStaffList(@RequestBody List<String> staffIdList){
return new Result<CustomerStaffListResultDTO>().ok(customerStaffService.getCustomerStaffList(staffIdList));
}
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.DepartInStaffListResultDTO;
import com.epmet.dto.result.StaffInfoResultDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.result.StaffListResultDTO;
import com.epmet.entity.CustomerStaffEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -123,4 +124,12 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @Date 2020.04.24 15:34
**/
List<CommonStaffInfoResultDTO> selectEnableStaffMsg(@Param("userIds") List<String> userIds,@Param("customerId")String customerId);
/**
* @param staffIdList
* @return
* @Author sun
* @Description 根据staffId集合查询工作人员基础信息
**/
List<StaffListResultDTO> selectStaffByIds(@Param("staffIdList") List<String> staffIdList);
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -22,7 +22,9 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.StaffListResultDTO;
import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.entity.StaffRoleEntity;
import org.apache.ibatis.annotations.Mapper;
@ -76,4 +78,11 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
**/
List<String> selectSpecificRolesStaffs(@Param("roleKeys")List<String> roleKeys,@Param("userIds")List<String> userIds,@Param("customerId")String customerId);
/**
* @param staffIdList
* @return
* @Author sun
* @Description 根据staffId集合查询人员拥有的所有角色信息
**/
List<CustomerStaffRoleResultDTO> selectStaffRoleList(@Param("staffIdList") List<String> staffIdList);
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -223,4 +223,12 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
* @Date 2020.04.24 15:44
**/
Result<List<CommonStaffInfoResultDTO>> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList);
/**
* @param staffIdList
* @return
* @Author sun
* @Description 根据staffId集合查询工作人员基础信息
**/
CustomerStaffListResultDTO getCustomerStaffList(List<String> staffIdList);
}

21
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.constant.CustomerStaffConstant;
import com.epmet.constant.UserConstant;
import com.epmet.constant.UserRoleConstant;
import com.epmet.dao.CustomerStaffDao;
import com.epmet.dao.StaffRoleDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -91,6 +92,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
private UserService userService;
@Autowired
private StaffRoleService staffRoleService;
@Autowired
private StaffRoleDao staffRoleDao;
@Override
public PageData<CustomerStaffDTO> page(Map<String, Object> params) {
@ -419,4 +422,22 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return new Result<List<CommonStaffInfoResultDTO>>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(), userIdList.getCustomerId()));
}
/**
* @param staffIdList
* @return
* @Author sun
* @Description 根据staffId集合查询工作人员基础信息
**/
@Override
public CustomerStaffListResultDTO getCustomerStaffList(List<String> staffIdList) {
//1:批量查询人员基本信息
List<StaffListResultDTO> staffList = baseDao.selectStaffByIds(staffIdList);
//2:批量查询人员拥有的所有角色信息
List<CustomerStaffRoleResultDTO> roleList = staffRoleDao.selectStaffRoleList(staffIdList);
CustomerStaffListResultDTO list = new CustomerStaffListResultDTO();
list.setStaffList(staffList);
list.setRoleList(roleList);
return list;
}
}

16
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -179,4 +179,20 @@
#{userId}
</foreach>
</select>
<select id="selectStaffByIds" resultType="com.epmet.dto.result.StaffListResultDTO">
SELECT
user_id AS staffId,
IFNULL(real_name,"") AS staffName,
IFNULL(head_photo,"") AS staffHeadPhoto ,
IFNULL(gender,0) AS gender
FROM
customer_staff
WHERE
del_flag = '0'
AND
<foreach item="userId" collection="staffIdList" separator="or" open="(" close=")" index="">
user_id = #{userId}
</foreach>
</select>
</mapper>

17
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -102,4 +102,21 @@
</if>
</where>
</select>
<select id="selectStaffRoleList" resultType="com.epmet.dto.result.CustomerStaffRoleResultDTO">
SELECT
sr.staff_id AS "staffId",
gsr.role_key AS "roleKey",
gsr.role_name AS "roleName"
FROM
staff_role sr
INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id
WHERE
sr.del_flag = '0'
AND gsr.del_flag = '0'
AND
<foreach item="staffId" collection="staffIdList" separator="or" open="(" close=")" index="">
sr.staff_id = #{staffId}
</foreach>
</select>
</mapper>
Loading…
Cancel
Save