Browse Source

Merge remote-tracking branch 'remotes/origin/dev_bugfix_ljj' into dev_project_location

dev_shibei_match
jianjun 4 years ago
parent
commit
a2f6ece50d
  1. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  2. 13
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  3. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java

38
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.user.impl; package com.epmet.service.user.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
@ -748,35 +749,36 @@ public class UserServiceImpl implements UserService {
public void fillScreenProjectData(List<ScreenProjectDataDTO> list) { public void fillScreenProjectData(List<ScreenProjectDataDTO> list) {
List<String> topicUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(o.getOrigin())) List<String> topicUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(o.getOrigin()))
.map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); .map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(topicUserIdList)){ Map<String, ScreenProjectDataDTO> topicUserMap = new HashMap<>();
return; if (!CollectionUtils.isEmpty(topicUserIdList)){
}
List<ScreenProjectDataDTO> collection = userDao.selectScreenProjectData(topicUserIdList); List<ScreenProjectDataDTO> collection = userDao.selectScreenProjectData(topicUserIdList);
Map<String, ScreenProjectDataDTO> topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1)); logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(collection),topicUserIdList);
/* if(!CollectionUtils.isEmpty(collection)){ topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1));
list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) }
.map(merge -> {
target.setLinkName(merge.getLinkName());
target.setLinkMobile(merge.getLinkMobile());
return target;}));
}*/
List<String> staffUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(o.getOrigin())) List<String> staffUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(o.getOrigin()))
.map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); .map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(topicUserIdList)){
return; Map<String, ScreenProjectDataDTO> staffMap = new HashMap<>();
} if (!CollectionUtils.isEmpty(staffUserIdList)){
List<ScreenProjectDataDTO> staffList = userDao.selectStaffInfo(staffUserIdList); List<ScreenProjectDataDTO> staffList = userDao.selectStaffInfo(staffUserIdList);
Map<String, ScreenProjectDataDTO> collect = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1)); logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(staffList),staffUserIdList);
list.forEach(project->{ staffMap = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1));
ScreenProjectDataDTO userDTO = collect.get(project.getLinkName()); }
for (ScreenProjectDataDTO project : list) {
ScreenProjectDataDTO userDTO = staffMap.get(project.getLinkName());
if (userDTO == null) { if (userDTO == null) {
userDTO = topicUserMap.get(project.getLinkName()); userDTO = topicUserMap.get(project.getLinkName());
} }
if (userDTO != null) { if (userDTO != null) {
logger.info("fillScreenProjectData every user data:{}", JSON.toJSONString(userDTO));
project.setLinkName(userDTO.getLinkName()); project.setLinkName(userDTO.getLinkName());
project.setLinkMobile(userDTO.getLinkMobile()); project.setLinkMobile(userDTO.getLinkMobile());
} }
}); }
logger.info("fillScreenProjectData result list:{}", JSON.toJSONString(list));
} }
/** /**

13
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -235,12 +235,13 @@
<foreach collection="list" item="l" separator=" UNION ALL "> <foreach collection="list" item="l" separator=" UNION ALL ">
SELECT SELECT
#{l.projectId} AS projectId, #{l.projectId} AS projectId,
CATEGORY_NAME CONCAT(if(cd2.CATEGORY_CODE = '0','',CONCAT(cd2.CATEGORY_NAME,'-')),cd.CATEGORY_NAME) AS categoryName
FROM issue_project_category_dict FROM issue_project_category_dict cd
WHERE DEL_FLAG = '0' LEFT JOIN issue_project_category_dict cd2 ON cd2.CATEGORY_CODE = cd.PARENT_CATEGORY_CODE AND cd2.DEL_FLAG = '0' AND cd2.CUSTOMER_ID = #{customerId}
AND IS_DISABLE = 'enable' WHERE cd.DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId} AND cd.IS_DISABLE = 'enable'
AND CATEGORY_CODE = #{l.categoryCode} AND cd.CUSTOMER_ID = #{customerId}
AND cd.CATEGORY_CODE = #{l.categoryCode}
</foreach> </foreach>
</select> </select>

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java

@ -38,6 +38,7 @@ import com.epmet.dto.result.MassesDiscontentResultDTO;
import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO; import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO;
import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.dto.result.ProjectEvaluateScoreResultDTO;
import com.epmet.dto.result.ProjectScoreResultDTO; import com.epmet.dto.result.ProjectScoreResultDTO;
import com.epmet.entity.ProjectEntity;
import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import com.epmet.entity.ProjectSatisfactionStatisticsEntity;
import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.redis.ProjectSatisfactionStatisticsRedis; import com.epmet.redis.ProjectSatisfactionStatisticsRedis;
@ -138,6 +139,11 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl<Pr
*/ */
@Override @Override
public ProjectEvaluateScoreResultDTO projectEvaluateScore(ProjectEvaluateScoreFormDTO formDTO) { public ProjectEvaluateScoreResultDTO projectEvaluateScore(ProjectEvaluateScoreFormDTO formDTO) {
ProjectEntity projectEntity = projectDao.selectById(formDTO.getProjectId());
if (projectEntity.getOrigin().equals(ProjectConstant.AGENCY)){
// 直接立项的项目不能评价,所以给0分
return new ProjectEvaluateScoreResultDTO(NumConstant.EIGHTY);
}
ProjectSatisfactionStatisticsEntity entity = baseDao.selectInfoByProjectId(formDTO.getProjectId()); ProjectSatisfactionStatisticsEntity entity = baseDao.selectInfoByProjectId(formDTO.getProjectId());
Integer realEvalCount = entity.getBadCount() + entity.getGoodCount() + entity.getPerfectCount(); Integer realEvalCount = entity.getBadCount() + entity.getGoodCount() + entity.getPerfectCount();
Integer shouldEvaluateCount = entity.getShouldEvaluateCount(); Integer shouldEvaluateCount = entity.getShouldEvaluateCount();

Loading…
Cancel
Save