From 66295e450fcb2d9699e3aed60b73c43732e24c09 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 13 May 2020 15:19:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B7=9F=E8=B8=AA-=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IssueManageController.java | 15 ++ .../com/epmet/feign/GovOrgFeignClient.java | 11 ++ .../fallback/GovOrgFeignClientFallBack.java | 7 + .../java/com/epmet/service/IssueService.java | 9 ++ .../epmet/service/impl/IssueServiceImpl.java | 15 ++ .../dto/form/DepartmentStaffListFormDTO.java | 20 +++ .../result/CustomerStaffListResultDTO.java | 45 ++++++ .../result/CustomerStaffRoleResultDTO.java | 48 ++++++ .../result/DepartmentStaffListResultDTO.java | 51 ++++++ .../epmet/dto/result/DeptListResultDTO.java | 49 ++++++ .../epmet/dto/result/GridListResultDTO.java | 49 ++++++ .../epmet/dto/result/StaffListResultDTO.java | 36 +++++ .../constant/CustomerAgencyConstant.java | 13 ++ .../controller/CustomerAgencyController.java | 12 ++ .../java/com/epmet/dao/CustomerGridDao.java | 11 +- .../com/epmet/dao/CustomerStaffAgencyDao.java | 7 + .../epmet/dao/CustomerStaffDepartmentDao.java | 8 + .../com/epmet/dao/CustomerStaffGridDao.java | 8 + .../com/epmet/feign/EpmetUserFeignClient.java | 10 ++ .../EpmetUserFeignClientFallBack.java | 5 + .../epmet/service/CustomerAgencyService.java | 9 ++ .../impl/CustomerAgencyServiceImpl.java | 149 ++++++++++++++++-- .../main/resources/mapper/CustomerGridDao.xml | 10 ++ .../mapper/CustomerStaffAgencyDao.xml | 10 +- .../mapper/CustomerStaffDepartmentDao.xml | 14 ++ .../resources/mapper/CustomerStaffGridDao.xml | 14 ++ .../gov-project/gov-project-server/pom.xml | 6 + .../controller/ProjectTraceController.java | 17 ++ .../com/epmet/feign/GovOrgFeignClient.java | 12 ++ .../fallback/GovOrgFeignClientFallBack.java | 8 + .../epmet/service/ProjectStaffService.java | 10 ++ .../service/impl/ProjectStaffServiceImpl.java | 15 +- .../controller/CustomerStaffController.java | 11 ++ .../java/com/epmet/dao/CustomerStaffDao.java | 9 ++ .../main/java/com/epmet/dao/StaffRoleDao.java | 9 ++ .../epmet/service/CustomerStaffService.java | 8 + .../impl/CustomerStaffServiceImpl.java | 21 +++ .../resources/mapper/CustomerStaffDao.xml | 16 ++ .../main/resources/mapper/StaffRoleDao.xml | 17 ++ 39 files changed, 781 insertions(+), 13 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentStaffListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DeptListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffListResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java index 6ad967cdca..9738c4272d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java +++ b/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 departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(issueService.departmentStaffList(formDTO)); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 9cd829abe4..448afc2e58 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/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 getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 + **/ + @PostMapping(value = "/gov/org/customeragency/departmentstafflist/{agencyId}") + Result departmentStaffList(@PathVariable("agencyId") String agencyId); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 8aec17593a..336832326b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/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 getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getagencyandgrid", agencyGridResultDTO); } + + @Override + public Result departmentStaffList(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", agencyId); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index ab38c329c5..a7d58e66e9 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/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 { **/ void closeIssue(CloseIssueFormDTO formDTO); + /** + * @param formDTO + * @return + * @Author sun + * @Description 议题管理-部门人员选择 + **/ + DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 536a12307e..64d9759f67 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/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 imp msgList.add(msgDTO); return messageFeignClient.saveUserMessageList(msgList); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 议题管理-部门人员选择 + **/ + @Override + public DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO) { + //1:调用gov-org服务,分别查询组织下人员,组织下部门人员,组织下网格人员列表信息 + Result resultDTOResult = govOrgFeignClient.departmentStaffList(formDTO.getAgencyId()); + return resultDTOResult.getData(); + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java new file mode 100644 index 0000000000..4542a587db --- /dev/null +++ b/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; + +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffListResultDTO.java new file mode 100644 index 0000000000..4ca73628f7 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 staffList; + /** + * 工作人员角色集合 + */ + private List roleList; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java new file mode 100644 index 0000000000..f54628f303 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentStaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentStaffListResultDTO.java new file mode 100644 index 0000000000..6f706566c3 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 agencyStaffList; + + /** + * 部门人员选择-组织下部门及人员列表 + */ + private List departmentList; + + /** + * 部门人员选择-组织下网格及人员列表 + */ + private List gridList; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DeptListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DeptListResultDTO.java new file mode 100644 index 0000000000..480b6ac408 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 departmentStaffList; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListResultDTO.java new file mode 100644 index 0000000000..49be734771 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 gridStaffList; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffListResultDTO.java new file mode 100644 index 0000000000..27ff1b358b --- /dev/null +++ b/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; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java index 330185b612..f30c8c65ce 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java +++ b/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"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index ee839de020..50cfe3c5be 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/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().ok(customerAgencyService.getAgencyAndGrid(agencyGridResultDTO)); } + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 + **/ + @PostMapping("departmentstafflist/{agencyId}") + public Result departmentStaffList(@PathVariable("agencyId") String agencyId) { + return new Result().ok(customerAgencyService.departmentStaffList(agencyId)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index cc9f544cfb..669664481c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/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 { * @date 2020/5/11 18:50 */ BelongGridNameResultDTO getGridNameByGridId(BelongGridNameFormDTO formDTO); + + /** + * @Description 根据组织机关Id查询机关下网格列表 + * @author sun + */ + List selectGridList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 9de920b942..7be691d69f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/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 getSelectableStaffsForDept(@Param("departmentId") String departmentId); + + /** + * 查询组织下人员列表 + * @Author sun + */ + List selectAgencyStaffList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index 0c6fc36a4b..88fc246656 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/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 selectDeptStaffs(@Param("deptIdList") List deptIdList); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index 7a01c76048..2a160f8a90 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/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 { * @Author sun */ List selectByGridId(@Param("gridId")String gridId); + + /** + * + * @Author sun + * @Description 遍历查询每个部门下人员 + */ + List selectGridStaffs(@Param("gridIdList") List gridIdList); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 2f9fbb99c9..297df14501 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/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 getCustomerStaffRoles(CommonUserFormDTO commonUserFormDTO); + + /** + * @param staffIdList + * @return + * @Author sun + * @Description 根据staffId集合查询工作人员基础信息 + **/ + @PostMapping(value = "/epmetuser/customerstaff/getcustomerstafflist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getCustomerStaffList(List staffIdList); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index bac3fd9024..f6ac8153ce 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/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 getCustomerStaffRoles(CommonUserFormDTO commonUserFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoles", commonUserFormDTO); } + + @Override + public Result getCustomerStaffList(List staffIdList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffList", staffIdList); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index dceb37c12e..7af4c11691 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/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 * @Description 根据组织Id、网格Id查询组织、网格名称 **/ AgencyGridResultDTO getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 + **/ + DepartmentStaffListResultDTO departmentStaffList(String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 43d442b32e..8a7607b942 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/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 page(Map params) { IPage page = baseDao.selectPage( @@ -167,4 +175,127 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyStaffList = customerStaffAgencyDao.selectAgencyStaffList(agencyId); + //2:根据组织Id查询该组织下部门、人员列表 + //2.1:查询组织下部门列表 + List listDept = customerDepartmentDao.selectDepartmentList(agencyId); + List departmentList = ConvertUtils.sourceToTarget(listDept, DeptListResultDTO.class); + //2.2:查询每一个部门下人员列表 + List deptIdList = departmentList.stream().map(DeptListResultDTO::getDepartmentId).collect(Collectors.toList()); + List deptStaffs = customerStaffDepartmentDao.selectDeptStaffs(deptIdList); + departmentList.forEach(dept->{ + List 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 gridList = customerGridDao.selectGridList(agencyId); + //3.2:查询每一个网格下人员列表 + List gridIdList = gridList.stream().map(GridListResultDTO::getGridId).collect(Collectors.toList()); + List gridStaffs = customerStaffGridDao.selectGridStaffs(gridIdList); + gridList.forEach(grid->{ + List 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 staffIdList1 = agencyStaffList.stream().map(StaffListResultDTO::getStaffId).collect(Collectors.toList()); + List staffIdList2 = deptStaffs.stream().map(CustomerStaffDepartmentDTO::getUserId).collect(Collectors.toList()); + List staffIdList3 = gridStaffs.stream().map(CustomerStaffGridDTO::getUserId).collect(Collectors.toList()); + List staffIdList = new ArrayList<>(); + staffIdList.addAll(staffIdList1); staffIdList.addAll(staffIdList2); staffIdList.addAll(staffIdList3); + staffIdList = new ArrayList(new LinkedHashSet<>(staffIdList)); + Result userList = epmetUserFeignClient.getCustomerStaffList(staffIdList); + //5:循环数据,将人员数据放到对应数据结构下 + CustomerStaffListResultDTO dto = userList.getData(); + List staffList = dto.getStaffList(); + List 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 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 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; + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 5f40d5c0d8..9723d1e3f0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -285,4 +285,14 @@ AND cg.del_flag = 0 + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 9f09e6ab22..0a721b3f77 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -95,6 +95,14 @@ DEPARTMENT_ID = #{departmentId} ) - + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 7702cf9aa0..254cbc4ab2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -14,6 +14,20 @@ + + UPDATE diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 9a4290d11c..1e6501c6bb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -63,6 +63,20 @@ AND csg.grid_id = #{gridId} + + insert into customer_staff_grid diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index ef9a20e890..1588d4238f 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -72,6 +72,12 @@ 2.0.0 compile + + com.epmet + gov-org-client + 2.0.0 + compile + diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java index 9f2e75ed7f..3f88868a85 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java +++ b/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>().ok(projectSatisfactionDetailService.evaluationList(formDTO)); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 项目跟踪-部门人员选择 + **/ + @PostMapping("departmentstafflist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER) + public Result departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(projectStaffService.departmentStaffList(formDTO)); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index e4ae2ffc95..27a818330e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/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 departmentStaffList(@PathVariable("agencyId") String agencyId); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 6eccf9cb4a..b75b3c8b1d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/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 departmentStaffList(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", agencyId); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java index 62d3b66965..605cc05f06 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java +++ b/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 { * @date 2020/5/12 16:40 */ List getDepartmentNameList(ProjectStaffDTO dto); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 项目跟踪-部门人员选择 + **/ + DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java index bfab5baef5..b6518c8684 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java +++ b/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 page(Map params) { @@ -107,4 +113,11 @@ public class ProjectStaffServiceImpl extends BaseServiceImpl resultDTOResult = govOrgFeignClient.departmentStaffList(formDTO.getAgencyId()); + return resultDTOResult.getData(); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index ca2bd6d210..375c4abd26 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/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 getCustomerStaffList(@RequestBody List staffIdList){ + return new Result().ok(customerStaffService.getCustomerStaffList(staffIdList)); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 7b056bfea2..c5dbec183f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/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 { * @Date 2020.04.24 15:34 **/ List selectEnableStaffMsg(@Param("userIds") List userIds,@Param("customerId")String customerId); + + /** + * @param staffIdList + * @return + * @Author sun + * @Description 根据staffId集合查询工作人员基础信息 + **/ + List selectStaffByIds(@Param("staffIdList") List staffIdList); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 8f1f6a9d5b..c7e1be6e9c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/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 { **/ List selectSpecificRolesStaffs(@Param("roleKeys")List roleKeys,@Param("userIds")List userIds,@Param("customerId")String customerId); + /** + * @param staffIdList + * @return + * @Author sun + * @Description 根据staffId集合查询人员拥有的所有角色信息 + **/ + List selectStaffRoleList(@Param("staffIdList") List staffIdList); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 331cbf7223..cddd2a8c9a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -223,4 +223,12 @@ public interface CustomerStaffService extends BaseService { * @Date 2020.04.24 15:44 **/ Result> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList); + + /** + * @param staffIdList + * @return + * @Author sun + * @Description 根据staffId集合查询工作人员基础信息 + **/ + CustomerStaffListResultDTO getCustomerStaffList(List staffIdList); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index e6d681851e..518697e1f6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/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 page(Map params) { @@ -419,4 +422,22 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(), userIdList.getCustomerId())); } + /** + * @param staffIdList + * @return + * @Author sun + * @Description 根据staffId集合查询工作人员基础信息 + **/ + @Override + public CustomerStaffListResultDTO getCustomerStaffList(List staffIdList) { + //1:批量查询人员基本信息 + List staffList = baseDao.selectStaffByIds(staffIdList); + //2:批量查询人员拥有的所有角色信息 + List roleList = staffRoleDao.selectStaffRoleList(staffIdList); + CustomerStaffListResultDTO list = new CustomerStaffListResultDTO(); + list.setStaffList(staffList); + list.setRoleList(roleList); + return list; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 6fbcd71df4..9b1dbc5c54 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -179,4 +179,20 @@ #{userId} + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 518b6ed7d8..e7a2ce2fa9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -102,4 +102,21 @@ + + \ No newline at end of file