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..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 @@ -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; @@ -25,7 +22,7 @@ import java.util.List; * @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,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 681242272c..b68ac683ed 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 @@ -399,20 +399,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-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 3df7fee1a1..c049128343 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 com.epmet.commons.tools.utils.Result; @@ -75,4 +77,13 @@ public interface ResiGroupOpenFeignClient { @PostMapping("/resi/group/group/gov-audit-edit") Result govAuditEdit(@RequestBody GroupEditionAuditFormDTO param); + /** + * @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 4987f369ad..954fe48c21 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 @@ -13,7 +13,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; @@ -53,4 +55,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 @@ + + 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; } /**