From 11c9ba0c073df7958bba544fa9017950628eab97 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 12 Nov 2020 09:09:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=88=91=E5=8F=82=E4=B8=8E=E8=BF=87?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/topic/form/CustomerPageFormDTO.java | 30 +++++++++++++++++++ .../ParticipatedTopicUnitResultDTO.java | 26 ++++++++++++++++ .../group/feign/ResiGroupOpenFeignClient.java | 11 +++++++ .../ResiGroupOpenFeignClientFallback.java | 7 +++++ .../topic/controller/ResiTopicController.java | 13 ++++++++ .../epmet/modules/topic/dao/ResiTopicDao.java | 9 ++++++ .../topic/service/ResiTopicService.java | 9 ++++++ .../service/impl/ResiTopicServiceImpl.java | 27 +++++++++++++++++ .../resources/mapper/topic/ResiTopicDao.xml | 21 +++++++++++++ 9 files changed, 153 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java new file mode 100644 index 0000000000..5c824b35ff --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 客户Id 用户Id 分页 + * @ClassName CustomerPageFormDTO + * @Auth wangc + * @Date 2020-11-11 23:15 + */ +@Data +public class CustomerPageFormDTO implements Serializable { + private static final long serialVersionUID = 8678047078015445193L; + + @NotBlank(message = "客户Id不能为空") + private String customerId; + + @NotBlank(message = "用户Id不能为空") + private String userId; + + @Min(1) + private Integer pageNo; + + @Min(1) + private Integer pageSize; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java new file mode 100644 index 0000000000..d5c9f9bc24 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 个人中心 参与过的话题返参DTO + * @ClassName ParticipatedTopicUnitResultDTO + * @Auth wangc + * @Date 2020-11-11 23:00 + */ +@Data +public class ParticipatedTopicUnitResultDTO implements Serializable { + private static final long serialVersionUID = 1392205563783715932L; + + private String topicId; + + private String topicReleaseGridName; + + private String topicContent; + + private Long releaseTime; + + private String topicReleaseGroupName; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 92001cc862..8b5c663df6 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -4,7 +4,9 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; +import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -39,4 +41,13 @@ public interface ResiGroupOpenFeignClient { @PostMapping("resi/group/group/groupinfo") Result> selectGroupInfo(@RequestBody GroupInfoFormDTO groupInfoFormDTO); + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + @PostMapping("resi/group/topic/my-part-topics") + Result> myPartTopics(@RequestBody CustomerPageFormDTO param); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index f29e47292d..2300137e09 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -5,7 +5,9 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; +import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -31,4 +33,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectGroupInfo", groupInfoFormDTO); } + @Override + public Result> myPartTopics(CustomerPageFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "myPartTopics", param); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index de0f3a665d..917d3beab5 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -272,5 +272,18 @@ public class ResiTopicController { return new Result().ok(myTopics); } + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + @PostMapping("my-part-topics") + public Result> myPartTopics(@RequestBody CustomerPageFormDTO param){ + ValidatorUtils.validateEntity(param); + return new Result>().ok(topicService.getParticipatedTopics(param)); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index 1cc8f528fe..e7cd14a7eb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -161,4 +161,13 @@ public interface ResiTopicDao extends BaseDao { */ List selectIssueList(@Param("topicList") List topicList); + /** + * @Description 查询我参与过的话题 + * @param customerId + * @param userId + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:08 + */ + List selectParticipatedTopics(@Param("customerId") String customerId,@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index b366ac7109..4128358aa5 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -271,4 +271,13 @@ public interface ResiTopicService extends BaseService { * @date 2020.11.10 15:03 */ List listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize); + + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + List getParticipatedTopics(CustomerPageFormDTO param); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index c4b77e453d..c207a9f736 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -84,6 +84,7 @@ import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; import com.epmet.resi.group.dto.topic.result.*; import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -1413,6 +1414,32 @@ public class ResiTopicServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.11.11 23:20 + */ + @Override + public List getParticipatedTopics(CustomerPageFormDTO param) { + + PageInfo page = + PageHelper.startPage(Optional.ofNullable(param.getPageNo()).orElse(NumConstant.ONE), + Optional.ofNullable(param.getPageSize()).orElse(NumConstant.ONE)).doSelectPageInfo(() -> + baseDao.selectParticipatedTopics(param.getCustomerId(),param.getUserId())); + List result = page.getList(); + if(CollectionUtils.isEmpty(result)) return Collections.EMPTY_LIST; + Result> gridR = govOrgOpenFeignClient.selectOrgInfo( + new OrgInfoFormDTO(OrgInfoConstant.GRID,result.stream().map(ParticipatedTopicUnitResultDTO :: getTopicReleaseGridName).distinct().collect(Collectors.toList()))); + if(gridR.success() && !CollectionUtils.isEmpty(gridR.getData())){ + return result.stream().flatMap(topic -> gridR.getData().stream() .filter(grid -> StringUtils.equals(grid.getOrgId(),topic.getTopicReleaseGridName())).map(orgInfo -> { + topic.setTopicReleaseGridName(orgInfo.getOrgId()); + return topic; + })).collect(Collectors.toList()); + } return Collections.EMPTY_LIST; + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index 5678bda9ea..cb4d75b345 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -474,5 +474,26 @@ + + From 03867938dcf4153c3ffc5175bdbdc0e6f0fe5020 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 12 Nov 2020 13:25:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E6=88=91=E5=8F=91=E8=B5=B7=E7=9A=84=E8=AE=AE=E9=A2=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8-=E5=B7=B2=E5=85=B3=E9=97=AD+=E4=B8=80=E8=BD=AC?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IssueDTO.java | 4 ++ .../epmet/feign/GovIssueOpenFeignClient.java | 7 +-- .../src/main/resources/mapper/IssueDao.xml | 11 ++-- .../main/java/com/epmet/dto/ProjectDTO.java | 8 ++- .../feign/GovProjectOpenFeignClient.java | 11 ++++ .../GovProjectOpenFeignClientFallback.java | 13 ++++- .../epmet/controller/ProjectController.java | 10 ++-- .../com/epmet/service/ProjectService.java | 3 +- .../service/impl/ProjectServiceImpl.java | 43 +++++++++++----- .../person/service/impl/IssueServiceImpl.java | 50 +++++++++++++++++-- 10 files changed, 127 insertions(+), 33 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java index 960bf286a7..0da96662ee 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java @@ -154,4 +154,8 @@ public class IssueDTO implements Serializable { */ private Long closedTimeStamp; + /** + * 议题转项目后-对应的项目id + */ + private String projectId; } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 7b4878096a..72e517ba97 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -7,9 +7,6 @@ import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; -import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -24,8 +21,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) -//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") +// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 14deb3403d..1277481b79 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -398,20 +398,23 @@ SELECT i.*, UNIX_TIMESTAMP(i.CLOSED_TIME) AS closedTimeStamp, - UNIX_TIMESTAMP(i.SHIFTED_TIME) AS shiftedTimeStamp + UNIX_TIMESTAMP(i.SHIFTED_TIME) AS shiftedTimeStamp, + m.PROJECT_ID FROM issue i + left join issue_project_relation m + on(i.id=m.ISSUE_ID and m.del_flag='0') WHERE i.DEL_FLAG = '0' AND i.CREATED_BY = #{userId} and i.ISSUE_STATUS=#{issueStatus} - + ORDER BY - i.SHIFTED_TIME DESC + m.CREATED_TIME DESC - + ORDER BY i.CLOSED_TIME DESC diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java index ef8c8f0d11..1d75e9adfe 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java @@ -17,9 +17,11 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; +import java.util.List; /** @@ -113,4 +115,8 @@ public class ProjectDTO implements Serializable { */ private Date updatedTime; + /** + * 当前处理部门名称列表 + */ + private List currentDepartmentNameList; } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index ed9bbab6ed..fc0adf94cd 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -22,6 +22,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:32 */ +// @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class,url = "localhost:8102") @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class) public interface GovProjectOpenFeignClient { /** @@ -53,4 +54,14 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/issuetoprojectlist") Result> issueToProjectList(MyPartProjectsFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param projectIds 项目id数组 + * @author yinzuomei + * @description 根据项目id查询项目基本信息 + * @Date 2020/11/11 17:40 + **/ + @PostMapping("gov/project/project/queryprojectinfobyids") + Result> queryProjectInfoByIds(@RequestBody List projectIds); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 9326b0cdaa..05201b8e22 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -9,7 +9,6 @@ import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; -import com.epmet.dto.result.ProcesslistResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -51,4 +50,16 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> issueToProjectList(MyPartProjectsFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "issueToProjectList", formDTO); } + + /** + * @param projectIds 项目id数组 + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 根据项目id查询项目基本信息 + * @Date 2020/11/11 17:40 + **/ + @Override + public Result> queryProjectInfoByIds(List projectIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "queryProjectInfoByIds", projectIds); + } } 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 d8309d93af..0261e4a7ba 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 @@ -17,18 +17,14 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.RequirePermission; -import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; @@ -192,4 +188,8 @@ public class ProjectController { return new Result>().ok(projectService.issueToProjectList(formDTO)); } + @PostMapping("queryprojectinfobyids") + public Result> queryProjectInfoByIds(@RequestBody List projectIds){ + return new Result>().ok(projectService.queryProjectInfoByIds(projectIds)); + } } \ No newline at end of file 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 4f339c3a3f..35f81839d8 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 @@ -19,7 +19,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -224,4 +223,6 @@ public interface ProjectService extends BaseService { * @Description 根据议题Id集合查询对应的项目信息 **/ List issueToProjectList(MyPartProjectsFormDTO formDTO); + + List queryProjectInfoByIds(List projectIds); } \ 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 f247526cff..fefc457aa8 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 @@ -688,6 +688,18 @@ public class ProjectServiceImpl extends BaseServiceImpl getClosedProjectList(LatestListFormDTO formDTO) { + + return baseDao.selectClosedProjectList(formDTO); + } + /** * @param formDTO * @return @@ -804,7 +816,7 @@ public class ProjectServiceImpl extends BaseServiceImpl projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList()); if(!CollectionUtils.isEmpty(projectStaffIds)){ List container = new LinkedList<>(); @@ -842,18 +854,6 @@ public class ProjectServiceImpl extends BaseServiceImpl getClosedProjectList(LatestListFormDTO formDTO) { - - return baseDao.selectClosedProjectList(formDTO); - } - @Override public void response(ProjectResponseFormDTO formDTO) { //公开回复内容审核 @@ -1388,4 +1388,21 @@ public class ProjectServiceImpl extends BaseServiceImpl queryProjectInfoByIds(List projectIds) { + List entityList=baseDao.selectBatchIds(projectIds); + List projectDTOList=ConvertUtils.sourceToTarget(entityList, ProjectDTO.class); + //2.使用已有方法查询项目当前处理部门信息 + projectDTOList.forEach(l -> { + if (ProjectConstant.CLOSED.equals(l.getStatus())) { + l.setCurrentDepartmentNameList(new ArrayList()); + } else { + ProjectDTO dto = new ProjectDTO(); + dto.setId(l.getId()); + l.setCurrentDepartmentNameList(baseDao.selectDepartmentNameList(dto)); + } + }); + return projectDTOList; + } + } \ No newline at end of file diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index aaa6043612..8f321cceb9 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.IssueOpenConstant; import com.epmet.constant.OrgInfoConstant; import com.epmet.dto.IssueDTO; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.form.OrgInfoFormDTO; @@ -151,13 +152,56 @@ public class IssueServiceImpl implements IssueService { /** * @param formDTO * @author yinzuomei - * @description 个人中心-我发起的议题列表-已转项目 + * @description 个人中心-我发起的议题列表-已转项目 按照转项目时间排序 * @Date 2020/11/11 13:35 **/ @Override public List getMyPubIssuesShiftProject(MyPubIssuesAuditingFormDTO formDTO) { - //todo - return null; + //查询我发起的议题,并且 已转项目 + formDTO.setIssueStatus(IssueOpenConstant.ISSUE_SHIFT_PROJECT); + Result> issueResult=issueOpenFeignClient.getMyPubIssues(formDTO); + if(null==issueResult||CollectionUtils.isEmpty(issueResult.getData())){ + return new ArrayList<>(); + } + //议题来源话题id集合 + List topicIds=new ArrayList<>(); + List projectIds=new ArrayList<>(); + issueResult.getData().forEach(issueDTO ->{ + if(IssueOpenConstant.SOURCE_TYPE_RT.equals(issueDTO.getSourceType())&& StringUtils.isNotBlank(issueDTO.getSourceId())){ + topicIds.add(issueDTO.getSourceId()); + projectIds.add(issueDTO.getProjectId()); + } + } ); + //查询网格名称 + Result> gridNameList = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, issueResult.getData().stream().map(m -> m.getGridId()).collect(Collectors.toList()))); + if (!gridNameList.success()){ + logger.error("查询议题来源网格名称失败......"); + } + //查询话题来源小组名称 + Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(topicIds)); + if (!groupNameList.success()){ + logger.error("查询议题来源小组名称失败......"); + } + //查询项目基本信息 + Result> projectRes=govProjectOpenFeignClient.queryProjectInfoByIds(projectIds); + if(!projectRes.success()){ + logger.error("查询项目信息失败......"); + } + List list=new ArrayList<>(); + for(IssueDTO issueDTO:issueResult.getData()){ + MyPubIssuesShiftProjectResultDTO resultDTO=new MyPubIssuesShiftProjectResultDTO(); + resultDTO.setProjectId(issueDTO.getProjectId()); + gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getOrgId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getOrgName())); + groupNameList.getData().stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); + resultDTO.setShiftProjectTime(issueDTO.getShiftedTimeStamp()); + + + projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setProjectTitle(projectDTO.getTitle())); + //当前处理部门名称列表 + projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setDepartmentNameList(projectDTO.getCurrentDepartmentNameList())); + list.add(resultDTO); + } + return list; } /** From 0f1ecd802813a9d560538dc6b452c8f39e4ca2b8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 12 Nov 2020 13:28:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=BB=E9=99=A4url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/feign/GovIssueOpenFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 72e517ba97..9e01905c9e 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -21,8 +21,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) -@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) +// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { /**