Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

master
jianjun 3 years ago
parent
commit
d945cb1d2c
  1. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java
  2. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java
  3. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java
  4. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  5. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java
  6. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java
  7. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  8. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  9. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  10. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  11. 27
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  12. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  13. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  14. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  15. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  16. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  17. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java

@ -132,14 +132,20 @@ public class ExcelUtils {
return response.getOutputStream();
}
/**
* desc:easypoi导出多个sheet
* @param fileName
* @param list
* @param response
* @throws Exception
*/
public static void exportMultiSheetExcel(String fileName, List<ExportMultiView> list, HttpServletResponse response) throws Exception {
List<Map<String,Object>> excel = new ArrayList<>();
for(ExportMultiView view :list){
Map<String,Object> sheet = new HashMap<>();
sheet.put("title",view.getExportParams());
sheet.put("entity",view.getCls());
List<?> dataList = view.getDataList();
sheet.put("data", dataList);
sheet.put("data", view.getDataList());
excel.add(sheet);
}
Workbook workbook = ExcelExportUtil.exportExcel(excel, ExcelType.XSSF);

9
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java

@ -16,8 +16,17 @@ import java.util.List;
@Data
@AllArgsConstructor
public class ExportMultiView {
/**
* 导出的参数 比如设置表头
*/
private ExportParams exportParams;
/**
* 要导出的数据列
*/
private List<?> dataList;
/**
* excel对应的类
*/
private Class<?> cls;
}

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);

13
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,9 +186,9 @@ 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())){
gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getPids().concat(StrConstant.COLON).concat(dto.getAgencyId()));
//孔村和组织级别为街道的查询下级所有网格
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->{
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
@ -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;
}
}

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

@ -14,6 +14,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
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;
@ -24,7 +25,6 @@ import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO;
import com.epmet.dataaggre.dto.govproject.ProjectDTO;
import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO;
import com.epmet.dataaggre.dto.govproject.ResiEventDTO;
@ -81,6 +81,8 @@ public class GovProjectServiceImpl implements GovProjectService {
private EvaluationIndexService evaluationIndexService;
@Autowired
private EpmetUserService epmetUserService;
@Autowired
private LoginUserUtil loginUserUtil;
/**
* @Description 查询项目信息
@ -416,13 +418,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());
@ -432,7 +434,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()));
@ -440,11 +442,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()));
@ -455,6 +465,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()));
@ -519,7 +532,7 @@ public class GovProjectServiceImpl implements GovProjectService {
re.setUserId(to.getUserId());
}
});
});
}
resultDTO.setList(result.getList());
return resultDTO;

7
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>
@ -227,7 +232,7 @@
screen_customer_grid
WHERE
del_flag = '0'
AND all_parent_ids LIKE concat(#{fullAgencyPath},'%')
AND all_parent_ids LIKE concat('%',#{fullAgencyPath},'%')
order by parentAgencyId,gridName
</select>

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));
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -139,10 +139,11 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
}
/**
* 2022-03-29 需求改动单元号修改 eg 1 改为 1单元
* 做限制此字段中必须带有 "单元"2字不存在就不给导入
*/
if(StringUtils.isBlank(data.getBuildingUnit())){
if(StringUtils.isBlank(data.getBuildingUnit()) || !data.getBuildingUnit().contains("单元")){
nums.add(num);
disposeErrorMsg(info, "单元号的值未填写");
disposeErrorMsg(info, "单元号的值未填写或者格式不正确");
return;
}
// 应产品要求

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