Browse Source

新增:个人中心-我创建的话题列表、个人中心-我创建的话题列表(已转议题)

master
wxz 5 years ago
parent
commit
3c389a646e
  1. 20
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectByCreateTopicUserFormDTO.java
  2. 18
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectOfCreateTopicUserResultDTO.java
  3. 11
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
  4. 7
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
  5. 20
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
  6. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  7. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  8. 13
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  9. 9
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql
  10. 17
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  11. 2
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectRelatedPersonnelDao.xml
  12. 20
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyCreateTopicsFormDTO.java
  13. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java
  14. 11
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  15. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  16. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  17. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java
  18. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
  19. 32
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  20. 2
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml
  21. 13
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyCreateTopicsFormDTO.java
  22. 8
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java
  23. 13
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java
  24. 15
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java
  25. 35
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java
  26. 27
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java
  27. 83
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java

20
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectByCreateTopicUserFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class ProjectByCreateTopicUserFormDTO {
public interface ListByUserGroup {}
@NotBlank(message = "客户ID不能为空", groups = { ListByUserGroup.class })
private String customerId;
@NotBlank(message = "用户ID不能为空", groups = { ListByUserGroup.class })
private String userId;
private Integer pageNo = 1;
private Integer pageSize = 10;
}

18
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectOfCreateTopicUserResultDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.result;
import lombok.Data;
import java.util.List;
@Data
public class ProjectOfCreateTopicUserResultDTO {
private String topicId;
private String projectId;
private String gridId;
private Long shiftProjectTime;
private List<String> departmentNameList;
private String projectTitle;
private String releaseGridId;
}

11
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java

@ -4,10 +4,12 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO;
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.ProjectOfCreateTopicUserResultDTO;
import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.springframework.cloud.openfeign.FeignClient;
@ -64,4 +66,13 @@ public interface GovProjectOpenFeignClient {
**/
@PostMapping("gov/project/project/queryprojectinfobyids")
Result<List<ProjectDTO>> queryProjectInfoByIds(@RequestBody List<String> projectIds);
/**
* @Description 根据话题创建人查询项目列表
* @return
* @author wxz
* @date 2020.11.13 11:09
*/
@PostMapping("gov/project/project/list-by-createtopic-userid")
Result<List<ProjectOfCreateTopicUserResultDTO>> listProjectsByCreateTopicUserId(@RequestBody ProjectByCreateTopicUserFormDTO form);
}

7
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java

@ -5,10 +5,12 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO;
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.ProjectOfCreateTopicUserResultDTO;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.springframework.stereotype.Component;
@ -62,4 +64,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli
public Result<List<ProjectDTO>> queryProjectInfoByIds(List<String> projectIds) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "queryProjectInfoByIds", projectIds);
}
@Override
public Result<List<ProjectOfCreateTopicUserResultDTO>> listProjectsByCreateTopicUserId(ProjectByCreateTopicUserFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "listProjectsByCreateTopicUserId", form);
}
}

20
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
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;
@ -26,10 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
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;
import com.epmet.dto.form.ShiftProjectFormDTO;
import com.epmet.dto.form.ShiftProjectsFromDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.excel.ProjectExcel;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
@ -192,4 +191,17 @@ public class ProjectController {
public Result<List<ProjectDTO>> queryProjectInfoByIds(@RequestBody List<String> projectIds){
return new Result<List<ProjectDTO>>().ok(projectService.queryProjectInfoByIds(projectIds));
}
/**
* @Description
* @return
* @author wxz
* @date 2020.11.13 09:49
*/
@PostMapping("list-by-createtopic-userid")
public Result<List<ProjectOfCreateTopicUserResultDTO>> listProjectsByCreateTopicUserId(@RequestBody ProjectByCreateTopicUserFormDTO form) {
ValidatorUtils.validateEntity(form, ProjectByCreateTopicUserFormDTO.ListByUserGroup.class);
List<ProjectOfCreateTopicUserResultDTO> projects = projectService.listProjectsByCreateTopicUserId(form.getUserId(), form.getCustomerId(), form.getPageNo(), form.getPageSize());
return new Result().ok(projects);
}
}

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java

@ -26,6 +26,7 @@ import com.epmet.dto.form.ShiftProjectsFromDTO;
import com.epmet.dto.result.LatestListResultDTO;
import com.epmet.dto.result.MyPartProjectsResultDTO;
import com.epmet.dto.result.ProjectDetailResultDTO;
import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO;
import com.epmet.entity.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -139,4 +140,12 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
List<MyPartProjectsResultDTO> selectIssueProjectList(@Param("customerId") String customerId, @Param("issueList") List<String> issueList,
@Param("pageIndex") int pageIndex, @Param("pageSize") Integer pageSize);
/**
* @Description 根据话题创建人查询项目列表
* @return
* @author wxz
* @date 2020.11.13 09:38
*/
List<ProjectOfCreateTopicUserResultDTO> listProjectsByCreateTopicUserId(@Param("userId") String userId,
@Param("customerId") String customerId);
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java

@ -225,4 +225,12 @@ public interface ProjectService extends BaseService<ProjectEntity> {
List<MyPartProjectsResultDTO> issueToProjectList(MyPartProjectsFormDTO formDTO);
List<ProjectDTO> queryProjectInfoByIds(List<String> projectIds);
/**
* @Description 查询用户的项目列表
* @return
* @author wxz
* @date 2020.11.13 09:12
*/
List<ProjectOfCreateTopicUserResultDTO> listProjectsByCreateTopicUserId(String userId, String customerId, Integer pageNo, Integer pageSize);
}

13
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -44,6 +44,7 @@ import com.epmet.feign.*;
import com.epmet.redis.ProjectRedis;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections4.CollectionUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
@ -1409,4 +1410,16 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return projectDTOList;
}
@Override
public List<ProjectOfCreateTopicUserResultDTO> listProjectsByCreateTopicUserId(String userId, String customerId, Integer pageNo, Integer pageSize) {
PageHelper.startPage(pageNo, pageSize);
List<ProjectOfCreateTopicUserResultDTO> projects = baseDao.listProjectsByCreateTopicUserId(userId, customerId);
projects.stream().forEach(p -> {
ProjectDTO dto = new ProjectDTO();
dto.setId(p.getProjectId());
List<String> depts = baseDao.selectDepartmentNameList(dto);
p.setDepartmentNameList(depts);
});
return projects;
}
}

9
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql

@ -3,3 +3,12 @@ SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源类型(话题:topic
ADD COLUMN `SOURCE_ID` VARCHAR (64) CHARACTER
SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源Id(话题或议题Id)' AFTER `SOURCE_TYPE`;
-- 更改项目库的字符集
alter table customer_project_parameter convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table project convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table project_org_relation convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table project_process convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table project_related_personnel convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table project_satisfaction_detail convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table project_satisfaction_statistics convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table project_staff convert to character set utf8mb4 collate utf8mb4_general_ci;

17
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -226,4 +226,21 @@
LIMIT #{pageIndex}, #{pageSize}
</select>
<select id="listProjectsByCreateTopicUserId"
resultType="com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO">
select
rp.SOURCE_ID as topicId,
unix_timestamp(p.CREATED_TIME) as shiftProjectTime,
p.id as projectId,
rp.GRID_ID gridId,
p.TITLE as projectTitle,
rp.GRID_ID releaseGridId
from project_related_personnel rp
inner join project p on (rp.PROJECT_ID = p.ID and p.DEL_FLAG = 0)
where USER_ID = #{userId}
and p.CUSTOMER_ID=#{customerId}
and p.DEL_FLAG=0
and SOURCE_TYPE = 'topic'
</select>
</mapper>

2
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectRelatedPersonnelDao.xml

@ -8,6 +8,8 @@
<result property="projectId" column="PROJECT_ID"/>
<result property="app" column="APP"/>
<result property="gridId" column="GRID_ID"/>
<result property="sourceId" column="SOURCE_ID"/>
<result property="sourceType" column="SOURCE_TYPE"/>
<result property="userId" column="USER_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>

20
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyCreateTopicsFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.resi.group.dto.topic;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class MyCreateTopicsFormDTO {
@NotBlank(message = "客户id不能为空")
private String customerId;
@NotBlank(message = "用户id不能为空")
private String userId;
private Integer pageSize = 10;
private Integer pageNo = 1;
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java → epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java

@ -3,7 +3,7 @@ package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
@Data
public class MyTopicsResultDTO {
public class MyCreateTopicsResultDTO {
private String topicId;
private Long releaseTime;

11
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -4,8 +4,10 @@ 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.MyCreateTopicsFormDTO;
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.MyCreateTopicsResultDTO;
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;
@ -50,4 +52,13 @@ public interface ResiGroupOpenFeignClient {
*/
@PostMapping("resi/group/topic/my-part-topics")
Result<List<ParticipatedTopicUnitResultDTO>> myPartTopics(@RequestBody CustomerPageFormDTO param);
/**
* @Description 我创建的话题列表
* @return
* @author wxz
* @date 2020.11.10 14:58
*/
@PostMapping("resi/group/topic/my-create-topics")
Result<List<MyCreateTopicsResultDTO>> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO formDTO);
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -5,6 +5,7 @@ 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.MyCreateTopicsFormDTO;
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;
@ -38,4 +39,8 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "myPartTopics", param);
}
@Override
public Result listMyCreateTopics(MyCreateTopicsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listMyTopics", formDTO);
}
}

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java

@ -5,7 +5,7 @@ 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.modules.topic.service.ResiTopicService;
import com.epmet.resi.group.dto.topic.MyTopicsFormDTO;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.TopicInfoDTO;
import com.epmet.resi.group.dto.topic.form.*;
@ -265,10 +265,10 @@ public class ResiTopicController {
* @author wxz
* @date 2020.11.10 14:58
*/
@PostMapping("my-topics")
public Result listMyTopics(@RequestBody MyTopicsFormDTO formDTO, @LoginUser TokenDto tokenDto) {
@PostMapping("my-create-topics")
public Result<List<MyCreateTopicsResultDTO>> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
List<MyTopicsResultDTO> myTopics = topicService.listMyTopics(formDTO.getCustomerId(), tokenDto.getUserId(), formDTO.getPageNo(), formDTO.getPageSize());
List<MyCreateTopicsResultDTO> myTopics = topicService.listMyCreateTopics(formDTO.getCustomerId(), formDTO.getUserId(), formDTO.getPageNo(), formDTO.getPageSize());
return new Result().ok(myTopics);
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java

@ -153,7 +153,7 @@ public interface ResiTopicDao extends BaseDao<ResiTopicEntity> {
*/
CheckTopicPublisherResultDTO checkTopicPublisher(CheckTopicPublisherFormDTO formDTO);
List<MyTopicsResultDTO> listMyTopics(@Param("userId") String userId, @Param("customerId") String customerId);
List<MyCreateTopicsResultDTO> listMyCreateTopics(@Param("userId") String userId, @Param("customerId") String customerId);
/**
* @Description 根据话题Id集合查询对应的已转成议题的议题Id集合

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java

@ -270,7 +270,7 @@ public interface ResiTopicService extends BaseService<ResiTopicEntity> {
* @author wxz
* @date 2020.11.10 15:03
*/
List<MyTopicsResultDTO> listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize);
List<MyCreateTopicsResultDTO> listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize);
/**
* @Description 个人中心-我参与过的话题

32
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -40,10 +40,7 @@ import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CommonDataFilterResultDTO;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.OrgInfoResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.constant.GroupMemberConstant;
@ -83,6 +80,8 @@ import com.epmet.resi.group.dto.topic.form.*;
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.epmet.resi.group.dto.topic.result.CheckTopicPublisherResultDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -1419,25 +1418,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
}
@Override
public List<MyTopicsResultDTO> listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize) {
public List<MyCreateTopicsResultDTO> listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize) {
PageHelper.startPage(pageNo, pageSize);
List<MyTopicsResultDTO> myTopics = resiTopicDao.listMyTopics(userId, customerId);
List<MyCreateTopicsResultDTO> myTopics = resiTopicDao.listMyCreateTopics(userId, customerId);
HashMap<String, String> gridIdAndNames = new HashMap<>();
Set<String> gridIds = myTopics.stream().map(c -> c.getReleaseGridId()).collect(Collectors.toSet());
OrgInfoFormDTO form = new OrgInfoFormDTO();
form.setOrgType(OrgInfoConstant.GRID);
form.setOrgIds(new ArrayList<>(gridIds));
Result<List<OrgInfoResultDTO>> gridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form);
if (gridInfoResult.success()) {
List<OrgInfoResultDTO> grids = gridInfoResult.getData();
for (OrgInfoResultDTO grid : grids) {
gridIdAndNames.put(grid.getOrgId(), grid.getOrgName());
}
List<String> gridIds = myTopics.stream().map(c -> c.getReleaseGridId()).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridsResult = govOrgOpenFeignClient.getGridListByGridIds(gridIds);
if (gridsResult.success()) {
List<AllGridsByUserIdResultDTO> grids = gridsResult.getData();
grids.stream().forEach(g -> gridIdAndNames.put(g.getGridId(), g.getGridName()));
} else {
log.error("【我创建的话题列表】,查询组织-网格名称出错,没有抛出,内部处理。内部消息:{},外部消息:{}", gridsResult.getInternalMsg(), gridsResult.getMsg());
}
for (MyTopicsResultDTO myTopic : myTopics) {
for (MyCreateTopicsResultDTO myTopic : myTopics) {
myTopic.setReleaseGridName(gridIdAndNames.get(myTopic.getReleaseGridId()));
}

2
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

@ -447,7 +447,7 @@
AND id = #{topicId}
</select>
<select id="listMyTopics" resultType="com.epmet.resi.group.dto.topic.result.MyTopicsResultDTO">
<select id="listMyCreateTopics" resultType="com.epmet.resi.group.dto.topic.result.MyCreateTopicsResultDTO">
select t.id as topicId,
t.topic_content as topicContent,
unix_timestamp(t.created_time) as releaseTime,

13
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyCreateTopicsFormDTO.java

@ -0,0 +1,13 @@
package com.epmet.resi.mine.dto.from;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class MyCreateTopicsFormDTO {
@NotBlank(message = "客户id不能为空")
private String customerId;
private Integer pageNo = 1;
private Integer pageSize = 10;
}

8
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java → epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java

@ -1,14 +1,14 @@
package com.epmet.resi.group.dto.topic;
package com.epmet.resi.mine.dto.from;
import lombok.Data;
@Data
public class MyTopicsFormDTO {
public class MyShiftProjectTopicsFormDTO {
private String customerId;
private Integer pageSize = 10;
private Integer pageNo = 1;
private Integer pageSize = 10;
}

13
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java

@ -0,0 +1,13 @@
package com.epmet.resi.mine.dto.result;
import lombok.Data;
@Data
public class MyCreateTopicsResultDTO {
private String topicId;
private Long releaseTime;
private String topicContent;
private String releaseGroupName;
private String releaseGridId;
private String releaseGridName;
}

15
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java

@ -0,0 +1,15 @@
package com.epmet.resi.mine.dto.result;
import lombok.Data;
import java.util.List;
@Data
public class MyShiftProjectTopicsResultDTO {
private String topicId;
private String gridId;
private Long shiftProjectTime;
private List<String> departmentNameList;
private String projectTitle;
private String releaseGridName;
}

35
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java

@ -4,9 +4,14 @@ import com.epmet.commons.tools.annotation.LoginUser;
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.modules.person.service.TopicService;
import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO;
import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.mine.dto.from.MyCreateTopicsFormDTO;
import com.epmet.resi.mine.dto.from.MyShiftProjectTopicsFormDTO;
import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO;
import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -28,6 +33,9 @@ public class TopicController {
@Autowired
private ResiGroupOpenFeignClient groupFeign;
@Autowired
private TopicService topicService;
/**
* @Description 个人中心-我参与过的话题
* @param param
@ -41,4 +49,31 @@ public class TopicController {
ValidatorUtils.validateEntity(param);
return groupFeign.myPartTopics(param);
}
/**
* @Description 查询我的已转项目的话题列表
* @return
* @author wxz
* @date 2020.11.13 10:13
*/
@PostMapping("my-shiftproject-topics")
public Result<List<MyShiftProjectTopicsResultDTO>> listMyShiftProjectTopics(@RequestBody MyShiftProjectTopicsFormDTO form, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(form);
List<MyShiftProjectTopicsResultDTO> topics = topicService.listMyShiftProjectTopics(tokenDto.getUserId(), form.getCustomerId(), form.getPageNo(), form.getPageSize());
return new Result<List<MyShiftProjectTopicsResultDTO>>().ok(topics);
}
/**
* @Description 我创建的话题列表
* @return
* @author wxz
* @date 2020.11.13 15:09
*/
@PostMapping("my-create-topics")
public Result<List<MyCreateTopicsResultDTO>> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO form, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(form);
List<MyCreateTopicsResultDTO> topics = topicService.listMyCreateTopics(form.getCustomerId(), tokenDto.getUserId(), form.getPageNo(), form.getPageSize());
return new Result<List<MyCreateTopicsResultDTO>>().ok(topics);
}
}

27
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java

@ -0,0 +1,27 @@
package com.epmet.modules.person.service;
import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO;
import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO;
import java.util.List;
/**
* 话题service
*/
public interface TopicService {
/**
* @Description 列出我的已转项目的话题列表
* @return
* @author wxz
* @date 2020.11.13 10:17
*/
List<MyShiftProjectTopicsResultDTO> listMyShiftProjectTopics(String userId, String customerId, Integer pageNo, Integer pageSize);
/**
* @Description 我创建的话题列表
* @return
* @author wxz
* @date 2020.11.13 15:00
*/
List<MyCreateTopicsResultDTO> listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize);
}

83
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java

@ -0,0 +1,83 @@
package com.epmet.modules.person.service.impl;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.modules.person.service.TopicService;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO;
import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class TopicServiceImpl implements TopicService {
private static Logger logger = LoggerFactory.getLogger(TopicServiceImpl.class);
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Override
public List<MyShiftProjectTopicsResultDTO> listMyShiftProjectTopics(String userId, String customerId, Integer pageNo, Integer pageSize) {
ProjectByCreateTopicUserFormDTO form = new ProjectByCreateTopicUserFormDTO();
form.setCustomerId(customerId);
form.setUserId(userId);
form.setPageNo(pageNo);
form.setPageSize(pageSize);
Result<List<ProjectOfCreateTopicUserResultDTO>> result = govProjectOpenFeignClient.listProjectsByCreateTopicUserId(form);
if (!result.success()) {
throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg());
}
List<ProjectOfCreateTopicUserResultDTO> projects = result.getData();
List<MyShiftProjectTopicsResultDTO> projectTopics = ConvertUtils.sourceToTarget(projects, MyShiftProjectTopicsResultDTO.class);
List<String> gridIds = projects.stream().map(p -> p.getGridId()).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> rst = govOrgOpenFeignClient.getGridListByGridIds(gridIds);
if (!rst.success()) {
logger.error("查询我创建的话题列表(已转议题),根据网格id查询网格名称失败, InternalMsg:{},Msg:{}", rst.getInternalMsg(), rst.getMsg());
} else {
List<AllGridsByUserIdResultDTO> gridInfos = rst.getData();
HashMap<String, String> gridIdAndNames = new HashMap<>();
gridInfos.stream().forEach(g -> gridIdAndNames.put(g.getGridId(), g.getGridName()));
projectTopics.stream().forEach(pt -> pt.setReleaseGridName(gridIdAndNames.get(pt.getGridId())));
}
return projectTopics;
}
@Override
public List<MyCreateTopicsResultDTO> listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize) {
MyCreateTopicsFormDTO form = new MyCreateTopicsFormDTO();
form.setCustomerId(customerId);
form.setUserId(userId);
form.setPageNo(pageNo);
form.setPageSize(pageSize);
Result<List<com.epmet.resi.group.dto.topic.result.MyCreateTopicsResultDTO >> result = resiGroupOpenFeignClient.listMyCreateTopics(form);
if (!result.success()) {
throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg());
}
List<com.epmet.resi.group.dto.topic.result.MyCreateTopicsResultDTO > topics = result.getData();
return ConvertUtils.sourceToTarget(topics, MyCreateTopicsResultDTO.class);
}
}
Loading…
Cancel
Save