Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into 市北生产

feature/teamB_zz_wgh
jianjun 3 years ago
parent
commit
8f85865a16
  1. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java
  2. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  3. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java
  5. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  6. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  7. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  8. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  9. 26
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  10. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  11. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  12. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  13. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  14. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

3
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java

@ -3,6 +3,7 @@ package com.epmet.dataaggre.dto.evaluationindex;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
@ -19,7 +20,7 @@ public class ScreenAgencyOrGridListDTO implements Serializable {
/**
* 所有下级网格列表
*/
private List<AgencyGrid> allGridList;
private List<AgencyGrid> allGridList = new ArrayList<>();
@Data
public static class AgencyGrid {

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

@ -54,6 +54,8 @@ public class CategoryProjectResultDTO implements Serializable {
//二级分类code
@JsonIgnore
private String categoryCode;
private String topicId;
}
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java

@ -39,15 +39,15 @@ import java.util.List;
public interface IssueDao extends BaseDao<IssueEntity> {
/**
* @Description 查询议题表决中已关闭
* @Description 查询议题表决中已关闭
* @Param gridIds
* @author zxc
* @date 2020/12/25 下午2:19
*/
List<IssueListResultDTO> issueStatusClosedOrVoting(@Param("gridIds") List<String> gridIds, @Param("issueStatus")String issueStatus);
List<IssueListResultDTO> issueStatusClosedOrVoting(@Param("gridIds") List<String> gridIds, @Param("issueStatus") String issueStatus);
/**
* @Description 查询已转项目议题
* @Description 查询已转项目议题
* @Param gridIds
* @author zxc
* @date 2020/12/25 下午5:27
@ -72,7 +72,7 @@ public interface IssueDao extends BaseDao<IssueEntity> {
**/
List<ClosedIssueListResultDTO> selectClosedListGov(ClosedIssueListFormDTO fromDTO);
Integer selectIssueCount(@Param("gridIds") List<String> gridIds,@Param("issueType")String issueType);
Integer selectIssueCount(@Param("gridIds") List<String> gridIds, @Param("issueType") String issueType);
List<IssueInfoDTO> selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId);
@ -81,4 +81,12 @@ public interface IssueDao extends BaseDao<IssueEntity> {
* @author sun
**/
List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId, @Param("level") String level, @Param("isDisable") String isDisable);
}
/**
* desc:根据议题id获取对应的话题id
*
* @param ids
* @return
*/
List<IssueInfoDTO> selectIssueTopicIdType(@Param("ids") List<String> ids);
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java

@ -11,7 +11,7 @@ import lombok.Data;
@Data
public class CustomerDataManageExcel {
@Excel(name = "组织",width = 20)
@Excel(name = "组织",width = 25)
private String orgName;
@Excel(name = "用户数",width = 10)
@ -35,7 +35,7 @@ public class CustomerDataManageExcel {
@Excel(name = "项目数",width = 10)
private Integer projectCount;
@Excel(name = "结案项目数",width = 10)
@Excel(name = "结案项目数",width = 12)
private Integer closedProjectCount;
@Excel(name = "巡查人数",width = 10)

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -1887,20 +1887,16 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
String fileName = excelName(formDTO);
ExportParams exportParams = new ExportParams(fileName,fileName);
//exportParams.setAutoSize(true);
List<ExportMultiView> exportList = new ArrayList<>();
List<CustomerDataManageExcel> excelList = ConvertUtils.sourceToTarget(result, CustomerDataManageExcel.class);
exportList.add(new ExportMultiView(exportParams,excelList,CustomerDataManageExcel.class));
if (formDTO.isExport()){
if (CollectionUtils.isNotEmpty(operateExport.getAllGridList())){
List<CustomerDataManageResultDTO.CustomerDataManage> gridResult = operateExport.getAllGridList();
setTotal(gridResult);
ExportParams exportParams2 = new ExportParams(fileName,"网格数据");
//exportParams2.setAutoSize(true);
List<CustomerDataManageExcel> excelList2 = ConvertUtils.sourceToTarget(gridResult, CustomerDataManageExcel.class);
exportList.add(new ExportMultiView(exportParams2,excelList2,CustomerDataManageExcel.class));
}
//ExcelUtils.exportExcelToTargetDisposeAll(response,fileName,result, CustomerDataManageExcel.class);
ExcelUtils.exportMultiSheetExcel(fileName, exportList, response);
}
@ -2008,7 +2004,8 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
//获取组织级别数据
CustomerDataManageResultDTO resultDTO = getDataManageResultDTO(formDTO, startTimeForm, agencyGrid.getAgencyGridList(),agencyGrid.getLevel());
resultDTO.setTotal(idList.size());
if (formDTO.isExport()){
//网格List不为空则 查询网格数据 (仅限查询组织id为街道级别时)
if (CollectionUtils.isNotEmpty(agencyGrid.getAllGridList())){
formDTO.setDataType(OrgTypeEnum.GRID.getCode());
idList = agencyGrid.getAllGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList());
formDTO.setIdList(idList);

11
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.dataaggre.service.evaluationindex.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.dataaggre.constant.DataSourceConstant;
@ -187,8 +186,8 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
//2.根据组织级别判断查询直属组织或网格列表
List<ScreenCustomerAgencyDTO> agencyList = new ArrayList<>();
List<ScreenCustomerGridDTO> gridList = new ArrayList<>();
List<ScreenAgencyOrGridListDTO.AgencyGrid> finalAgencyGridList = agencyGridList;
if (isGetSubAllGrid && OrgLevelEnum.STREET.getCode().equals(dto.getLevel())){
//孔村和组织级别为街道的查询下级所有网格
if (isGetSubAllGrid && (OrgLevelEnum.STREET.getCode().equals(dto.getLevel()) || "1234085031077498881".equals(agencyId))){
gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getAgencyId());
List<ScreenAgencyOrGridListDTO.AgencyGrid> allGridList = new ArrayList<>();
gridList.forEach(gr->{
@ -203,7 +202,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
//2-1.直属下级组织列表
//2.判断客户是否存在子客户
List<String> list = customerRelation.haveSubCustomer(dto.getCustomerId());
if (!CollectionUtils.isNotEmpty(list)) {
if (CollectionUtils.isEmpty(list)) {
agencyList = evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null);
} else {
list.add(dto.getCustomerId());
@ -213,7 +212,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getAgencyId());
org.setOrgName(gr.getAgencyName());
finalAgencyGridList.add(org);
agencyGridList.add(org);
});
} else {
//2-2.直属下级网格列表
@ -222,7 +221,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName());
finalAgencyGridList.add(org);
agencyGridList.add(org);
});
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java

@ -52,4 +52,11 @@ public interface GovIssueService {
* @author sun
**/
List<IssueProjectCategoryDictDTO> categoryList(String customerId, String level, String isDisable);
/**
* desc:根据id 获取议题的话题的话题Id
* @param collect
* @return
*/
List<IssueInfoDTO> selectIssueTopicIdType(List<String> collect);
}

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java

@ -333,4 +333,13 @@ public class GovIssueServiceImpl implements GovIssueService {
return issueDao.getCategoryList(customerId, level, isDisable);
}
@Override
public List<IssueInfoDTO> selectIssueTopicIdType(List<String> ids) {
List<IssueInfoDTO> dtoList = issueDao.selectIssueTopicIdType(ids);
if (CollectionUtils.isEmpty(dtoList)){
return new ArrayList<>();
}
return dtoList;
}
}

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

@ -13,6 +13,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
@ -79,6 +80,8 @@ public class GovProjectServiceImpl implements GovProjectService {
private EvaluationIndexService evaluationIndexService;
@Autowired
private EpmetUserService epmetUserService;
@Autowired
private LoginUserUtil loginUserUtil;
/**
* @Description 查询项目信息
@ -414,13 +417,13 @@ public class GovProjectServiceImpl implements GovProjectService {
formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1));
//1.查询客户下分类信息
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null);
List<String> categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.getCategoryCode()).collect(Collectors.toList());
List<String> categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(IssueProjectCategoryDictDTO::getCategoryCode).collect(Collectors.toList());
formDTO.setCategoreCodeList(categoreCodeList);
//2.查询组织及下级截止某一天的某个一级分类下的项目列表
PageInfo<CategoryProjectResultDTO.Project> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO));
if (org.springframework.util.CollectionUtils.isEmpty(result.getList())) {
if (CollectionUtils.isEmpty(result.getList())) {
return resultDTO;
}
resultDTO.setTotal((int) result.getTotal());
@ -430,7 +433,7 @@ public class GovProjectServiceImpl implements GovProjectService {
List<CategoryProjectResultDTO.Project> list = projectDao.getCategoryList(projectIds);
//4.查询来源事件的项目上报的组织信息
List<String> eventIds = result.getList().stream().filter(re -> "resi_event".equals(re.getOrigin())).map(m -> m.getOriginId()).collect(Collectors.toList());
List<String> eventIds = result.getList().stream().filter(re -> "resi_event".equals(re.getOrigin())).map(CategoryProjectResultDTO.Project::getOriginId).collect(Collectors.toList());
List<ResiEventReportOrgDTO> eventOrgList = projectDao.getEventOrgList(eventIds);
Map<String, ResiEventReportOrgDTO> eventMap = eventOrgList.stream().collect(Collectors.toMap(ResiEventReportOrgDTO::getResiEventId, Function.identity()));
@ -438,11 +441,19 @@ public class GovProjectServiceImpl implements GovProjectService {
List<ResiEventDTO> eventUser = projectDao.getEventList(projectIds);
List<ProjectRelatedPersonnelDTO> topicUser = projectDao.getTopicUser(projectIds);
//市北客户查询 下议题区分下来源 设置topicId
Map<String, String> issueTopicSourceMap = new HashMap<>();
if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(loginUserUtil.getLoginUserCustomerId())){
issueTopicSourceMap = govIssueService.selectIssueTopicIdType(result.getList().stream()
.filter(re -> "issue".equals(re.getOrigin()))
.map(CategoryProjectResultDTO.Project::getOriginId)
.collect(Collectors.toList())).stream().collect(Collectors.toMap(IssueInfoDTO::getIssueId,IssueInfoDTO::getTopicId));
}
//5.封装数据
//组织或网格id->组织或网格名称
Map<String, String> map = new HashMap<>();
result.getList().forEach(re -> {
//所属组织
for (CategoryProjectResultDTO.Project re : result.getList()) {//所属组织
if ("issue".equals(re.getOrigin())) {
if (map.containsKey(re.getGridId())) {
re.setOrgName(map.get(re.getGridId()));
@ -453,6 +464,9 @@ public class GovProjectServiceImpl implements GovProjectService {
map.put(re.getGridId(), gridInfo.getGridName());
}
}
//市北议题来源的设置话题Id
re.setTopicId(issueTopicSourceMap.get(re.getOriginId()));
} else if ("agency".equals(re.getOrigin())) {
if (map.containsKey(re.getAgencyId())) {
re.setOrgName(map.get(re.getAgencyId()));
@ -517,7 +531,7 @@ public class GovProjectServiceImpl implements GovProjectService {
re.setUserId(to.getUserId());
}
});
});
}
resultDTO.setList(result.getList());
return resultDTO;

5
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -165,6 +165,11 @@
<when test="areaCode != null and areaCode.trim() != ''">
AND parent_area_code = #{areaCode}
</when>
<!--要孔村的党支部有啥用 还要导出排掉-->
<when test="agencyId == '1234085031077498881'">
AND PIDS like concat(#{agencyId},'%')
AND LEVEL = 'community'
</when>
<otherwise>
AND pid = #{agencyId}
</otherwise>

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

@ -139,5 +139,20 @@
</if>
ORDER BY category_code
</select>
<select id="selectIssueTopicIdType" resultType="com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO">
SELECT
i.ID as issueId,
i.GRID_ID as gridId,
i.SOURCE_ID as topicId
FROM
issue i
WHERE
i.id IN
<foreach collection="ids" separator="," item="item" close=")" open="(" >
#{item}
</foreach>
and i.DEL_FLAG = '0'
and i.SOURCE_TYPE='resi_topic'
</select>
</mapper>
</mapper>

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -561,6 +561,8 @@ public class AgencyServiceImpl implements AgencyService {
return nodes.get(0);
}
private void convertOrgTreeNode(List<OrgTreeNode> nodeList, ScreenCustomerAgencyDTO currentAgency) {
OrgTreeNode orgTreeNode = ConvertUtils.sourceToTarget(currentAgency, OrgTreeNode.class);
orgTreeNode.setOrgId(currentAgency.getAgencyId());

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java

@ -137,11 +137,14 @@ public class DataReportingServiceImpl implements DataReportingService {
public List<EventInfoResultDTO> getEventInfo(EventInfoFormDTO formDTO) {
List<EventInfoResultDTO> list;
//根据入参,获取项目
long start = System.currentTimeMillis();
List<ScreenProjectDataDTO> projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize());
log.error("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start);
//项目列表为空,返回空数组
if(CollectionUtils.isEmpty(projectList)) {
return Collections.emptyList();
}
start = System.currentTimeMillis();
Map<String, CustomerProjectCategoryDictEntity> epmetCodeMap = new HashMap<>();
Result<String> parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(formDTO.getCustomerId());
if (StringUtils.isNotBlank(parentCustomer.getData())) {
@ -194,6 +197,7 @@ public class DataReportingServiceImpl implements DataReportingService {
return dto;
}).collect(Collectors.toList());
}
log.error("事件上报-组装数据耗时:{}ms",System.currentTimeMillis()-start);
return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new));
}

20
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -172,7 +172,23 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
//根据buildingID,tableName he columnName获取名字
//限制条数 一栋楼内最多显示1000 即可
PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_THOUSAND,false).doSelectPage(()->{
for (String s : buildingIdList) {
PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_HUNDRED,false).doSelectPage(()->{
List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, Arrays.asList(s), icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName());
if (!CollectionUtils.isEmpty(dtos)){
Map<String, List<UserWarnNameListResultDTO>> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId));
result.forEach(item->{
item.setConfigId(configId);
groupByBuild.forEach((k,v) -> {
if (item.getBuildingId().equals(k)){
item.setUserList(v);
}
});
});
}
});
}
/*PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_THOUSAND,false).doSelectPage(()->{
List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName());
if (!CollectionUtils.isEmpty(dtos)){
Map<String, List<UserWarnNameListResultDTO>> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId));
@ -185,7 +201,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
});
});
}
});
});*/
return mapResult;
}

Loading…
Cancel
Save