Browse Source

zancun

dev_shibei_match
yinzuomei 4 years ago
parent
commit
504f293f6e
  1. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/IssueProjectCategory.java
  2. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/UserTopicPageFormDTO.java
  3. 26
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/UserTopicResDTO.java
  4. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java
  5. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java
  6. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java
  7. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java
  8. 33
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  9. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java
  10. 50
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java
  11. 21
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  12. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/IssueProjectCategory.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.dto.govproject.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Set;
@Data
public class IssueProjectCategory implements Serializable {
private static final long serialVersionUID = -2226298165882293959L;
private String issueId;
private String projectId;
private Set<String> categoryPidsList;
/**
* 这个项目对应的所有一级项目分类编码
*/
private Set<String> firstCategoryCodeList;
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/UserTopicPageFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.dto.resigroup.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@Data
public class UserTopicPageFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
//@NotBlank(message = "epmetUserId不能为空" , groups = AddUserInternalGroup.class)
private List<String> epmetUserIdList;
@NotNull(message = "pageNo不能为空",groups = AddUserInternalGroup.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空",groups = AddUserInternalGroup.class)
private Integer pageSize;
}

26
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/UserTopicResDTO.java

@ -0,0 +1,26 @@
package com.epmet.dataaggre.dto.resigroup.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
/**
* 个人分析发布话题分页列表
*/
@Data
public class UserTopicResDTO implements Serializable {
private String topicId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date releaseTime;
private String topicContent;
private Boolean shiftIssue;
private String issueId;
private Boolean shiftProject=false;
private String projectId="";
//不返给前端了。
private Set<String> projectFirstCategoryCodeList=new HashSet<>();
}

12
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java

@ -1,12 +1,15 @@
package com.epmet.dataaggre.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.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO;
import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO;
import com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO;
import com.epmet.dataaggre.service.resigroup.ResiGroupService;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -39,4 +42,13 @@ public class ResiGroupController {
return new Result<List<CandidateListResultDTO>>().ok(resiGroupService.candidateList(formDTO));
}
/**
* 数字赋能平台-个人分析发布话题分页列表
* @return
*/
@PostMapping("pageusertopic")
public Result<PageData<UserTopicResDTO>> pageUserTopic(@RequestBody PageUserReportEventFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PageUserReportEventFormDTO.AddUserInternalGroup.class);
return new Result<PageData<UserTopicResDTO>>().ok(resiGroupService.pageUserTopic(formDTO));
}
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govproject;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govproject.ProjectDTO;
import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO;
@ -25,7 +26,6 @@ import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectStatusListResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectTotalResultDTO;
import com.epmet.dataaggre.entity.govproject.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -79,4 +79,6 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @author sun
*/
List<ProjectStatusListResultDTO> getProjectStatusList(ProjectTotalFormDTO formDTO);
List<IssueProjectCategory> selectProjectIssueCategory(@Param("issueIds") List<String> issueIds);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java

@ -19,7 +19,9 @@ package com.epmet.dataaggre.dao.resigroup;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO;
import com.epmet.dataaggre.entity.resigroup.ResiTopicEntity;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -35,4 +37,12 @@ import java.util.List;
public interface ResiTopicDao extends BaseDao<ResiTopicEntity> {
List<ResiTopicDTO> selectTopicInfoByIds(@Param("list") List<String> topicIds);
/**
* 数据分析-个人档案-发布话题列表
*
* @param formDTO
* @return
*/
List<UserTopicResDTO> selectListTopic(PageUserReportEventFormDTO formDTO);
}

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.govproject;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govproject.form.*;
import com.epmet.dataaggre.dto.govproject.result.*;
@ -85,4 +86,12 @@ public interface GovProjectService {
* @author sun
*/
ProjectAnalysisResultDTO projectAnalysis(ProjectAnalysisFormDTO formDTO);
/**
* 找出这些议题中对应的项目id,以及项目对应的一级分类编码
*
* @param issueIds
* @return
*/
List<IssueProjectCategory> getIssueProjectFirstCategory(List<String> issueIds);
}

33
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.dataaggre.service.govproject.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -12,6 +13,7 @@ import com.epmet.dataaggre.constant.ProjectConstant;
import com.epmet.dataaggre.dao.govproject.ProjectDao;
import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectMonthResultDTO;
import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO;
import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
@ -384,4 +386,35 @@ public class GovProjectServiceImpl implements GovProjectService {
return null;
}
/**
* 找出这些议题中对应的项目id,以及项目对应的一级分类编码
*
* @param issueIds
* @return
*/
@Override
public List<IssueProjectCategory> getIssueProjectFirstCategory(List<String> issueIds) {
List<IssueProjectCategory> list=projectDao.selectProjectIssueCategory(issueIds);
if(CollectionUtils.isNotEmpty(list)){
for(IssueProjectCategory projectCategory:list){
Set<String> firt=new HashSet<>();
for(String pids:projectCategory.getCategoryPidsList()){
if(pids.contains(StrConstant.COLON)){
String[] pidAtt=pids.split(StrConstant.COLON);
firt.add(pidAtt[0]);
break;
}
if(pids.contains(StrConstant.COMMA)){
String[] pidAtt=pids.split(StrConstant.COMMA);
firt.add(pidAtt[0]);
break;
}
firt.add(pids);
}
projectCategory.setFirstCategoryCodeList(firt);
}
}
return list;
}
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java

@ -1,9 +1,11 @@
package com.epmet.dataaggre.service.resigroup;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.dto.resigroup.form.*;
import com.epmet.dataaggre.dto.resigroup.result.*;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import java.util.List;
@ -61,4 +63,6 @@ public interface ResiGroupService {
* @return com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO
*/
List<GroupActRankResultDTO> querySubRankList(GroupActRankFormDTO formDTO);
PageData<UserTopicResDTO> pageUserTopic(PageUserReportEventFormDTO formDTO);
}

50
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java

@ -3,12 +3,15 @@ package com.epmet.dataaggre.service.resigroup.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.resigroup.ResiGroupDao;
import com.epmet.dataaggre.dao.resigroup.ResiTopicDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO;
import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.dto.resigroup.form.*;
@ -18,7 +21,9 @@ import com.epmet.dataaggre.redis.ResiGroupRedis;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dataaggre.service.resigroup.ResiGroupService;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -27,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -53,6 +55,8 @@ public class ResiGroupServiceImpl implements ResiGroupService {
private DataStatsService dataStatsService;
@Autowired
private GovOrgService govOrgService;
@Autowired
private GovProjectService govProjectService;
@Override
public List<ResiTopicDTO> selectTopicInfoByIds(List<String> topicIds) {
@ -358,4 +362,42 @@ public class ResiGroupServiceImpl implements ResiGroupService {
}
return resultDTOList;
}
/**
* 数据分析-个人档案-发布话题列表
*
* @param formDTO
* @return
*/
@Override
public PageData<UserTopicResDTO> pageUserTopic(PageUserReportEventFormDTO formDTO) {
if (org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) {
return new PageData<UserTopicResDTO>(new ArrayList<>(), NumConstant.ZERO);
}
PageInfo<UserTopicResDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> resiTopicDao.selectListTopic(formDTO));
List<UserTopicResDTO> list =pageInfo.getList();
//根据议题id查询出每个议题对应的项目id,以及项目分类编码
List<String> issueIds=list.stream().filter(dto -> StringUtils.isNotBlank(dto.getIssueId())).map(UserTopicResDTO::getIssueId).collect(Collectors.toList());
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(issueIds)){
List<IssueProjectCategory> categoryList= govProjectService.getIssueProjectFirstCategory(issueIds);
for(UserTopicResDTO topicResDTO :pageInfo.getList()){
topicResDTO.setShiftProject(false);
topicResDTO.setProjectId(StrConstant.EPMETY_STR);
topicResDTO.setProjectFirstCategoryCodeList(new HashSet<>());
for(IssueProjectCategory category:categoryList){
if(StringUtils.isNotBlank(category.getProjectId())){
topicResDTO.setShiftProject(true);
topicResDTO.setProjectId(category.getProjectId());
topicResDTO.setProjectFirstCategoryCodeList(category.getFirstCategoryCodeList());
break;
}
}
}
}
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
}

21
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -174,4 +174,25 @@
ORDER BY created_time DESC
</select>
<resultMap id="IssueProjectCategoryMap" type="com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory">
<id property="issueId" column="issueId" />
<result property="projectId" column="projectId"/>
<collection property="categoryPidsList" ofType="java.util.Set" >
</collection>
</resultMap>
<select id="selectProjectIssueCategory" parameterType="map" resultMap="IssueProjectCategoryMap">
SELECT
p.ORIGIN_ID AS issueId,
p.id AS projectId,
pc.CATEGORY_PIDS
FROM
project p
inner join project_category pc
on(p.id=pc.PROJECT_ID and pc.DEL_FLAG='0')
WHERE
p.DEL_FLAG = '0'
<foreach item="issueId" collection="issueIds" separator="OR" open="AND (" close=")" index="">
p.ORIGIN_ID = #{issueId}
</foreach>
</select>
</mapper>

18
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml

@ -22,4 +22,22 @@
#{topicId}
</foreach>
</select>
<!-- 发布话题,分页-->
<select id="selectListTopic" parameterType="com.epmet.dto.form.PageUserReportEventFormDTO"
resultType="com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO">
SELECT
rt.id as topicId,
rt.TOPIC_CONTENT as topicContent,
rt.SHIFT_ISSUE as shiftIssue,
IFNULL(rt.ISSUE_ID,'') AS issueId,
rt.CREATED_TIME as releaseTime
FROM
resi_topic RT
WHERE
rt.DEL_FLAG = '0'
<foreach item="epmetUserId" collection="epmetUserIdList" open="AND (" separator="or" close=")" index="">
rt.CREATED_BY = #{epmetUserId}
</foreach>
</select>
</mapper>
Loading…
Cancel
Save