Browse Source

运营端数据导出 孔村的级别不对 导致的bug

release
jianjun 3 years ago
parent
commit
8f93f6e1a9
  1. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java
  3. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  4. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  5. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.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 {

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(resultDTO.getAllGridList())){
formDTO.setDataType(OrgTypeEnum.GRID.getCode());
idList = agencyGrid.getAllGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList());
formDTO.setIdList(idList);

9
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->{
@ -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);
});
}

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

Loading…
Cancel
Save