Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj' into develop

dev_shibei_match
yinzuomei 4 years ago
parent
commit
3dacef8c26
  1. 21
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  2. 11
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java
  3. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  6. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  7. 85
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
  8. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  9. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

21
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java

@ -54,11 +54,6 @@ public class ScreenProjectDataDTO implements Serializable {
*/ */
private String orgId; private String orgId;
/**
* 来源议题issue组织agency
*/
private String origin;
/** /**
* 上级组织Id * 上级组织Id
*/ */
@ -112,6 +107,16 @@ public class ScreenProjectDataDTO implements Serializable {
*/ */
private String projectAddress; private String projectAddress;
/**
* add 20211014
* 项目所属编码如果有多个以英文顿号隔开
*/
private String categoryCode;
/**
* add 20211014
* 来源议题issue 项目立项:agency 事件:resi_event
*/
private String origin;
/** /**
* 所有分类名 - 连接 * 所有分类名 - 连接
*/ */
@ -185,4 +190,10 @@ public class ScreenProjectDataDTO implements Serializable {
*/ */
private BigDecimal satisfactionScore; private BigDecimal satisfactionScore;
/**
* fact_origin_project_main_daily.grid_id对应的网格名称
*/
private String tempGridName;
} }

11
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java

@ -81,6 +81,17 @@ public class ScreenProjectDataInfoFormDTO implements Serializable {
*/ */
private String projectAddress; private String projectAddress;
/**
* add 20211014
* 项目所属编码如果有多个以英文顿号隔开
*/
private String categoryCode;
/**
* add 20211014
* 来源议题issue 项目立项:agency 事件:resi_event
*/
private String origin;
/** /**
* 所有分类名 - 连接 * 所有分类名 - 连接
*/ */

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -891,7 +891,6 @@ public class DemoController {
formDTO.setCustomerId(customerId); formDTO.setCustomerId(customerId);
formDTO.setDateId(param.getDateId()); formDTO.setDateId(param.getDateId());
screenProjectSettleService.extractScreenData(param); screenProjectSettleService.extractScreenData(param);
log.error(String.format("/data/stats/demo/project-test,screen_project_**表抽取完毕,customerId:%s", customerId));
} }
return new Result(); return new Result();
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java

@ -109,6 +109,17 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity {
*/ */
private String projectAddress; private String projectAddress;
/**
* add 20211014
* 项目所属编码如果有多个以英文顿号隔开
*/
private String categoryCode;
/**
* add 20211014
* 来源议题issue 项目立项:agency 事件:resi_event
*/
private String origin;
/** /**
* 所有分类名 - 连接 * 所有分类名 - 连接
*/ */

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -182,7 +182,7 @@ public interface IssueService {
* @author wangc * @author wangc
* @date 2021.03.09 00:23 * @date 2021.03.09 00:23
*/ */
Map<String,String> getIntegratedProjectCategory(Map<String, Set<String>> param,String customerId); Map<String,List<String>> getIntegratedProjectCategory(Map<String, Set<String>> param,String customerId);
/** /**
* 获取议题总数 * 获取议题总数

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -17,10 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* @author zhaoqifeng * @author zhaoqifeng
@ -157,18 +154,23 @@ public class IssueServiceImpl implements IssueService {
* @date 2021.03.09 00:23 * @date 2021.03.09 00:23
*/ */
@Override @Override
public Map<String, String> getIntegratedProjectCategory(Map<String, Set<String>> param,String customerId) { public Map<String, List<String>> getIntegratedProjectCategory(Map<String, Set<String>> param,String customerId) {
Map<String, String> map = new HashMap<>(); Map<String, List<String>> map = new HashMap<>();
param.forEach((projectId,categoryIds) -> { param.forEach((projectId,categoryIds) -> {
//以下查询只适用于二级分类,如果分类层级变多了要修改此查询 //以下查询只适用于二级分类,如果分类层级变多了要修改此查询
List<IssueProjectCategoryDictDTO> categories = statsIssueDao.selectCategory(customerId, categoryIds); List<IssueProjectCategoryDictDTO> categories = statsIssueDao.selectCategory(customerId, categoryIds);
if(!CollectionUtils.isEmpty(categories)){ if(!CollectionUtils.isEmpty(categories)){
StringBuilder str = new StringBuilder(); StringBuilder allCategoryName = new StringBuilder();
StringBuilder categoryCode = new StringBuilder();
categories.forEach(category -> { categories.forEach(category -> {
str.append(category.getCategoryName()).append(StrConstant.COMMA); allCategoryName.append(category.getCategoryName()).append(StrConstant.COMMA);
categoryCode.append(category.getCategoryCode()).append(StrConstant.COMMA);
//log.info(str.toString()); //log.info(str.toString());
}); });
map.put(projectId,str.substring(NumConstant.ZERO,str.length() - NumConstant.ONE)); List<String> list=new ArrayList<>();
list.add(allCategoryName.substring(NumConstant.ZERO,allCategoryName.length() - NumConstant.ONE));
list.add(categoryCode.substring(NumConstant.ZERO,categoryCode.length() - NumConstant.ONE));
map.put(projectId,list);
} }
}); });

85
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java

@ -81,30 +81,47 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
List<ProjectEntity> info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); List<ProjectEntity> info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList()));
if(!CollectionUtils.isEmpty(info)){ if(!CollectionUtils.isEmpty(info)){
metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(),
nature.getId())).map(projectInfo -> { nature.getId())).map(projectInfo -> {
meta.setProjectCreateTime(projectInfo.getCreatedTime()); meta.setProjectCreateTime(projectInfo.getCreatedTime());
meta.setProjectTitle(projectInfo.getTitle()); meta.setProjectTitle(projectInfo.getTitle());
meta.setOrigin(projectInfo.getOrigin()); meta.setOrigin(projectInfo.getOrigin());
//直接立项的话 项目内容是项目背景 经纬度添加 if (ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(projectInfo.getOrigin())) {
if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())){
meta.setOrgType(OrgTypeConstant.AGENCY); //来源于议题的,上面的initNewScreenProjectData,已经赋值orgType=grid, orgId:gridId
meta.setOrgId(projectInfo.getAgencyId()); meta.setOrgName(meta.getTempGridName());
meta.setProjectContent(projectInfo.getBackGround()); //A:如果是来源于议题,linkUserId为话题的发布人id;
meta.setLinkUserId(projectInfo.getCreatedBy()); meta.setLinkUserId(meta.getLinkName());
meta.setLinkName(projectInfo.getCreatedBy());
if (StringUtils.isNotBlank(projectInfo.getLocateDimension())){ }else if(ProjectConstant.PROJECT_ORIGIN_EVENT.equals(projectInfo.getOrigin())){
meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension()));
} meta.setProjectContent(projectInfo.getBackGround());
if (StringUtils.isNotBlank(projectInfo.getLocateLongitude())){ meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension()));
meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude())); meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude()));
} meta.setProjectAddress(projectInfo.getLocateAddress());
meta.setProjectAddress(projectInfo.getLocateAddress()); meta.setOrgType(OrgTypeConstant.AGENCY);
} else { meta.setOrgId(projectInfo.getAgencyId());
meta.setLinkUserId(meta.getLinkName()); //B:如果是来源是居民端报事,此列实际为空;
} meta.setLinkUserId(meta.getLinkName());
//项目满意度得分
meta.setSatisfactionScore(projectService.calProjectSatisfactionScore(param.getCustomerId(),meta.getProjectId())); }else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())) {
return meta; //直接立项的话 项目内容是项目背景 经纬度添加
meta.setOrgType(OrgTypeConstant.AGENCY);
meta.setOrgId(projectInfo.getAgencyId());
//上面的initNewScreenProjectData已经赋值了orgName=组织名称
meta.setProjectContent(projectInfo.getBackGround());
meta.setLinkUserId(projectInfo.getCreatedBy());
meta.setLinkName(projectInfo.getCreatedBy());
if (StringUtils.isNotBlank(projectInfo.getLocateDimension())) {
meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension()));
}
if (StringUtils.isNotBlank(projectInfo.getLocateLongitude())) {
meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude()));
}
meta.setProjectAddress(projectInfo.getLocateAddress());
}
//项目满意度得分
meta.setSatisfactionScore(projectService.calProjectSatisfactionScore(param.getCustomerId(),meta.getProjectId()));
return meta;
})).collect(Collectors.toList()); })).collect(Collectors.toList());
} }
//设置项目经纬度和项目内容 //设置项目经纬度和项目内容
@ -129,13 +146,25 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
} }
Map<String, Set<String>> categoryMap = projectService.getProjectCategory(projectIds); Map<String, Set<String>> categoryMap = projectService.getProjectCategory(projectIds);
if(!CollectionUtils.isEmpty(categoryMap)){ if(!CollectionUtils.isEmpty(categoryMap)){
Map<String, String> integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); Map<String, List<String>> integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId());
if(!CollectionUtils.isEmpty(integratedProjectCategoryMap)){ if(!CollectionUtils.isEmpty(integratedProjectCategoryMap)){
metaData.forEach(meta -> { metaData.forEach(meta -> {
meta.setAllCategoryName(integratedProjectCategoryMap.get(meta.getProjectId())); List<String> list1=integratedProjectCategoryMap.get(meta.getProjectId());
if(!CollectionUtils.isEmpty(list1)){
meta.setAllCategoryName(list1.get(0));
meta.setCategoryCode(list1.get(1));
}else{
log.warn("1、projectId="+meta.getProjectId()+" category is null");
}
}); });
orientData.forEach(orient -> { orientData.forEach(orient -> {
orient.setAllCategoryName(integratedProjectCategoryMap.get(orient.getProjectId())); List<String> list2=integratedProjectCategoryMap.get(orient.getProjectId());
if(!CollectionUtils.isEmpty(list2)){
orient.setAllCategoryName(list2.get(0));
orient.setCategoryCode(list2.get(1));
}else{
log.warn("2、projectId="+orient.getProjectId()+" category is null");
}
}); });
} }
} }
@ -168,7 +197,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
} }
} }
log.error(String.format("/data/stats/demo/project-test,screen_project_**表抽取完毕,customerId:%s", param.getCustomerId()));
} }
/** /**

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -578,10 +578,12 @@
data.PIDS as allParentIds, data.PIDS as allParentIds,
data.TOPIC_ID, data.TOPIC_ID,
IFNULL(log.response, 0) AS responseCount, IFNULL(log.response, 0) AS responseCount,
#{dataEndTime} as dataEndTime #{dataEndTime} as dataEndTime,
data.ORIGIN as origin,
grid.GRID_NAME as tempGridName
FROM `fact_origin_project_main_daily` data FROM `fact_origin_project_main_daily` data
LEFT JOIN DIM_AGENCY agency on data.agency_id = agency.id LEFT JOIN DIM_AGENCY agency on (data.agency_id = agency.id and agency.del_flag='0')
LEFT JOIN DIM_GRID grid on (data.grid_id=grid.id and grid.del_flag='0')
LEFT JOIN ( LEFT JOIN (
SELECT PROJECT_ID, COUNT(IS_ACTIVE) AS response FROM fact_origin_project_log_daily SELECT PROJECT_ID, COUNT(IS_ACTIVE) AS response FROM fact_origin_project_log_daily
WHERE (ACTION_CODE = 'close' OR ACTION_CODE = 'response' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'return') WHERE (ACTION_CODE = 'close' OR ACTION_CODE = 'response' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'return')

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

@ -311,7 +311,8 @@
<select id="selectCategory" resultType="com.epmet.dto.issue.IssueProjectCategoryDictDTO"> <select id="selectCategory" resultType="com.epmet.dto.issue.IssueProjectCategoryDictDTO">
SELECT SELECT
a.ID, a.ID,
IF(a.CATEGORY_TYPE = '2',concat(b.CATEGORY_NAME,'-',a.CATEGORY_NAME),a.CATEGORY_NAME) as categoryName IF(a.CATEGORY_TYPE = '2',concat(b.CATEGORY_NAME,'-',a.CATEGORY_NAME),a.CATEGORY_NAME) as categoryName,
a.category_code as categoryCode
FROM issue_project_category_dict a FROM issue_project_category_dict a
LEFT JOIN issue_project_category_dict b on a.pid = b.id and a.customer_id = b.customer_id LEFT JOIN issue_project_category_dict b on a.pid = b.id and a.customer_id = b.customer_id
WHERE a.DEL_FLAG = '0' WHERE a.DEL_FLAG = '0'

Loading…
Cancel
Save