From 373ac76d5f18350d8141640fe7f3cbb7ffd2cfc7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 21 Mar 2022 16:19:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9C=AA=E7=BB=93=E6=A1=88?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/feign/GovOrgOpenFeignClient.java | 9 +++++ .../GovOrgOpenFeignClientFallback.java | 5 +++ .../CustomerStaffGridController.java | 11 ++++++ .../com/epmet/dao/CustomerStaffGridDao.java | 9 +++++ .../service/CustomerStaffGridService.java | 9 +++++ .../impl/CustomerStaffGridServiceImpl.java | 11 ++++++ .../resources/mapper/CustomerStaffGridDao.xml | 9 +++++ .../result/ProjectAuditResetResultDTO.java | 25 +++++++++++++ .../epmet/controller/ProjectController.java | 4 +-- .../main/java/com/epmet/dao/ProjectDao.java | 13 ++++--- .../com/epmet/service/ProjectService.java | 2 +- .../service/impl/ProjectServiceImpl.java | 36 +++++++++++++++---- .../src/main/resources/mapper/ProjectDao.xml | 26 ++++++++++++++ 13 files changed, 155 insertions(+), 14 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 1d82763373..edfc0bdcb7 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -596,4 +596,13 @@ public interface GovOrgOpenFeignClient { */ @GetMapping("/gov/org/icbuildingunit/{id}") Result getUnitById(@PathVariable("id") String id); + + /** + * Desc: 查询网格下所有的工作人员 + * @param gridId + * @author zxc + * @date 2022/3/21 16:02 + */ + @PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid") + Result> getAllStaffByGridId(@RequestParam("gridId")String gridId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 21067cb674..d66317aa2b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -388,4 +388,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result getUnitById(String id) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getUnitById", id); } + + @Override + public Result> getAllStaffByGridId(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllStaffByGridId", gridId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java index cba514d051..8858cac625 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java @@ -145,4 +145,15 @@ public class CustomerStaffGridController { public Result> eventOrg(@LoginUser TokenDto tokenDto){ return new Result>().ok(customerStaffGridService.eventOrg(tokenDto.getUserId())); } + + /** + * Desc: 查询网格下所有的工作人员 + * @param gridId + * @author zxc + * @date 2022/3/21 16:02 + */ + @PostMapping("getallstaffbygridid") + public Result> getAllStaffByGridId(@RequestParam("gridId")String gridId){ + return new Result>().ok(customerStaffGridService.getAllStaffByGridId(gridId)); + } } \ 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 238e8e9c16..ed00369f86 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 @@ -121,4 +121,13 @@ public interface CustomerStaffGridDao extends BaseDao { * @return */ List getGridStaffList(String gridId); + + /** + * Desc: 查询网格下所有的工作人员 + * @param gridId + * @author zxc + * @date 2022/3/21 16:02 + */ + List getAllStaffByGridId(String gridId); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index 1e78f3725b..99076f48e9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -135,4 +135,13 @@ public interface CustomerStaffGridService extends BaseService eventOrg(String userId); + + /** + * Desc: 查询网格下所有的工作人员 + * @param gridId + * @author zxc + * @date 2022/3/21 16:02 + */ + List getAllStaffByGridId(String gridId); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index c744a1b0a2..4cc572edc8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -191,4 +191,15 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl eventOrg(String userId) { return baseDao.eventOrg(userId); } + + /** + * Desc: 查询网格下所有的工作人员 + * @param gridId + * @author zxc + * @date 2022/3/21 16:02 + */ + @Override + public List getAllStaffByGridId(String gridId) { + return baseDao.getAllStaffByGridId(gridId); + } } 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 cf57cc708f..db1fa9571b 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 @@ -187,4 +187,13 @@ csg.del_flag = '0' AND csg.GRID_ID = #{gridId} + + + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java new file mode 100644 index 0000000000..7ff2a51a2c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/3/21 15:48 + * @DESC + */ +@Data +public class ProjectAuditResetResultDTO implements Serializable { + + private static final long serialVersionUID = -4523314881244005376L; + + private Boolean projectStatus; + + private Boolean resiEventStatus; + + public ProjectAuditResetResultDTO() { + this.projectStatus = false; + this.resiEventStatus = false; + } +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 7aa1ae7501..372ff5fb5c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -333,7 +333,7 @@ public class ProjectController { * @date 2022/3/15 5:05 下午 */ @PostMapping("audit-reset") - public Result eventAuditReset(@RequestParam("gridId")String gridId){ - return new Result().ok(projectService.eventAuditReset(gridId)); + public Result eventAuditReset(@RequestParam("gridId")String gridId){ + return new Result().ok(projectService.eventAuditReset(gridId)); } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 650d598e1b..3aaabdf485 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.EventProjectInfoDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectStaffDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.form.PatrolProjectFormDTO; -import com.epmet.dto.form.ProjectListFromDTO; -import com.epmet.dto.form.ShiftProjectsFromDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.ProjectEntity; import org.apache.ibatis.annotations.Mapper; @@ -50,6 +47,14 @@ public interface ProjectDao extends BaseDao { **/ List selectPendList(ProjectListFromDTO fromDTO); + /** + * Desc: 待处理项目列表 + * @param userIds + * @author zxc + * @date 2022/3/21 14:12 + */ + List selectPendListByUserIds(@Param("userIds")List userIds); + /** * 我发起的项目列表 * diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 139fba06c8..d5f4ec3154 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -383,6 +383,6 @@ public interface ProjectService extends BaseService { * @author zxc * @date 2022/3/15 5:05 下午 */ - Boolean eventAuditReset(String gridId); + ProjectAuditResetResultDTO eventAuditReset(String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 336095f215..12c88a2b3a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -234,14 +234,28 @@ public class ProjectServiceImpl extends BaseServiceImpl userIds) { + if (CollectionUtils.isNotEmpty(userIds)){ + List projectList = baseDao.selectPendListByUserIds(userIds); + if (projectList.size() == 0){ + return false; + }else { + return true; + } + } + return false; + } + @Override public List getCreatedList(ProjectListFromDTO fromDTO) { List list = new ArrayList<>(); - //查询条件 - int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); - fromDTO.setPageNo(pageIndex); - List projectList = baseDao.selectCreatedList(fromDTO); //获取客户定制的可滞留天数 Integer finalDays = getDays(fromDTO); @@ -3140,12 +3154,20 @@ public class ProjectServiceImpl extends BaseServiceImpl> allStaffByGridId = govOrgOpenFeignClient.getAllStaffByGridId(gridId); + if (!allStaffByGridId.success()){ + throw new EpmetException("查询网格下的工作人员失败"); + } + if (CollectionUtils.isNotEmpty(allStaffByGridId.getData())){ + result.setProjectStatus(getPendProjectListByUserIds(allStaffByGridId.getData())); + } + return result; } /** diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 5c17dad31d..f4ead24b22 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -41,6 +41,32 @@ ORDER BY psp.created_time, p.created_time ASC LIMIT #{pageNo}, #{pageSize} + + + +