Browse Source

1、指标日计划加遮罩

2、指标日计划将公司去掉
develop
bobol 5 months ago
parent
commit
b17ca3f8b2
  1. 2
      lzbi-admin/src/main/resources/application.yml
  2. 4
      lzbi-module/src/main/java/com/lzbi/bi/domain/dto/MultiOrgSomeReportEverydayData.java
  3. 7
      lzbi-module/src/main/java/com/lzbi/bi/mapper/ScreenMockDataMapper.java
  4. 20
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenMainService.java

2
lzbi-admin/src/main/resources/application.yml

@ -60,7 +60,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: dev
active: test
# 文件上传
servlet:
multipart:

4
lzbi-module/src/main/java/com/lzbi/bi/domain/dto/MultiOrgSomeReportEverydayData.java

@ -1,12 +1,16 @@
package com.lzbi.bi.domain.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* 多组织某个图标每一天的数据
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class MultiOrgSomeReportEverydayData {

7
lzbi-module/src/main/java/com/lzbi/bi/mapper/ScreenMockDataMapper.java

@ -1,6 +1,7 @@
package com.lzbi.bi.mapper;
import com.alibaba.fastjson2.JSONObject;
import com.lzbi.bi.domain.dto.MultiOrgSomeReportEverydayData;
import com.lzbi.bi.domain.req.ParamSummarizingDataReq;
import com.lzbi.bi.domain.vo.MapOrgVO;
import com.lzbi.common.constant.BizConstants;
@ -189,4 +190,10 @@ public class ScreenMockDataMapper {
public int selectSomeOrgHeatExchangeStationCount(Long orgId) {
return 50;
}
public List<MultiOrgSomeReportEverydayData> selectChildOrgSomeReportEverydayDataList(ReportDataReq reportDataReq) {
List<MultiOrgSomeReportEverydayData> result = new ArrayList<>();
result.add(new MultiOrgSomeReportEverydayData(103L, "浑南一号源", "2023-11-01", BigDecimal.valueOf(2500)));
return result;
}
}

20
lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenMainService.java

@ -25,6 +25,7 @@ import com.lzbi.common.utils.bean.BeanUtils;
import com.lzbi.draft.domain.vo.*;
import com.lzbi.draft.service.DcBusiTargetDraftDaynewService;
import com.lzbi.system.service.ISysDeptService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -45,6 +46,7 @@ import static java.util.stream.Collectors.groupingBy;
* @author : zhousq
* @date : 2023-11-16
*/
@Slf4j
@Service
public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMainMapper, DcBusiDataScreenDto> implements IService<DcBusiDataScreenDto> {
@ -56,6 +58,7 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai
private DcBusiTargetDraftDaynewService dcBusiTargetDraftDaynewService;
// @Resource
// private ScreenMockDataMapper baseMapper;
private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
/**
* 供暖起始日期--月日
@ -310,21 +313,22 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai
List<SomeReportDataRankingVO> result = new ArrayList<>();
this.buildChildrenOrgReportDataReq(reportDataReq);
this.buildHeatingDate(reportDataReq);
List<MultiOrgSomeReportEverydayData> multiOrgSomeReportEverydayDataList = baseMapper.selectChildOrgSomeReportEverydayDataList(reportDataReq);
if (!CollectionUtils.isEmpty(multiOrgSomeReportEverydayDataList)) {
List<MultiOrgSomeReportEverydayData> data = baseMapper.selectChildOrgSomeReportEverydayDataList(reportDataReq);
log.info("排名数据:{}", JSONArray.toJSONString(data));
if (!CollectionUtils.isEmpty(data)) {
// 排序后的日期列表
List<String> dateSoredList = multiOrgSomeReportEverydayDataList.stream().map(MultiOrgSomeReportEverydayData::getDate).collect(Collectors.toSet()).stream().sorted().collect(Collectors.toList());
List<String> dateSoredList = data.stream().map(MultiOrgSomeReportEverydayData::getDate).collect(Collectors.toSet()).stream().sorted().collect(Collectors.toList());
// 排序后的组织id列表
List<Long> orgIdSoredList = multiOrgSomeReportEverydayDataList.stream().map(MultiOrgSomeReportEverydayData::getOrgId).collect(Collectors.toSet()).stream().sorted().collect(Collectors.toList());
List<Long> orgIdSoredList = data.stream().map(MultiOrgSomeReportEverydayData::getOrgId).collect(Collectors.toSet()).stream().sorted().collect(Collectors.toList());
// 组织map
Map<Long, String> orgMap = multiOrgSomeReportEverydayDataList.stream().collect(Collectors.toMap(MultiOrgSomeReportEverydayData::getOrgId, MultiOrgSomeReportEverydayData::getOrgName, (v1, v2) -> v2));
Map<Long, String> orgMap = data.stream().collect(Collectors.toMap(MultiOrgSomeReportEverydayData::getOrgId, MultiOrgSomeReportEverydayData::getOrgName, (v1, v2) -> v2));
// 按日期分组的map
Map<String, List<MultiOrgSomeReportEverydayData>> groupDateMap = multiOrgSomeReportEverydayDataList.stream().collect(groupingBy(MultiOrgSomeReportEverydayData::getDate));
Map<String, List<MultiOrgSomeReportEverydayData>> groupDateMap = data.stream().collect(groupingBy(MultiOrgSomeReportEverydayData::getDate));
dateSoredList.forEach(date -> {
SomeReportDataRankingVO someReportDataRankingVO = new SomeReportDataRankingVO();
someReportDataRankingVO.setCdate(date);
List<MultiOrgSomeReportEverydayData> data = groupDateMap.get(date);
Map<Long, MultiOrgSomeReportEverydayData> orgIdMap = data.stream().collect(Collectors.toMap(MultiOrgSomeReportEverydayData::getOrgId, item -> item, (v1, v2) -> v1));
List<MultiOrgSomeReportEverydayData> dateData = groupDateMap.get(date);
Map<Long, MultiOrgSomeReportEverydayData> orgIdMap = dateData.stream().collect(Collectors.toMap(MultiOrgSomeReportEverydayData::getOrgId, item -> item, (v1, v2) -> v1));
List<String> orgNameList = new ArrayList<>();
List<BigDecimal> valueList = new ArrayList<>();
orgIdSoredList.forEach(orgId -> {

Loading…
Cancel
Save