|
@ -9,20 +9,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.lzbi.bi.domain.DcBusiDataScreenDto; |
|
|
import com.lzbi.bi.domain.DcBusiDataScreenDto; |
|
|
import com.lzbi.bi.domain.SysDeptLocation; |
|
|
import com.lzbi.bi.domain.SysDeptLocation; |
|
|
import com.lzbi.bi.domain.dto.MultiOrgSomeReportEverydayData; |
|
|
import com.lzbi.bi.domain.dto.MultiOrgSomeReportEverydayData; |
|
|
import com.lzbi.bi.domain.dto.SomeOrgSomedaySomeParamSummarizingDataDTO; |
|
|
import com.lzbi.bi.domain.dto.SomeOrgSomedayMultiReportDataDTO; |
|
|
|
|
|
import com.lzbi.bi.domain.dto.SomeTypeChildrenOrgSomedayMultiReportDataDTO; |
|
|
import com.lzbi.bi.domain.req.ParamSummarizingDataReq; |
|
|
import com.lzbi.bi.domain.req.ParamSummarizingDataReq; |
|
|
|
|
|
import com.lzbi.bi.domain.req.ReportDataReq; |
|
|
import com.lzbi.bi.domain.vo.*; |
|
|
import com.lzbi.bi.domain.vo.*; |
|
|
import com.lzbi.bi.mapper.DcBusiDataScreenMainMapper; |
|
|
import com.lzbi.bi.mapper.DcBusiDataScreenMainMapper; |
|
|
import com.lzbi.bi.mapper.ScreenMockDataMapper; |
|
|
|
|
|
import com.lzbi.common.constant.BizConstants; |
|
|
import com.lzbi.common.constant.BizConstants; |
|
|
import com.lzbi.common.constant.ParamsModelCodeConstants; |
|
|
import com.lzbi.common.constant.ParamsModelCodeConstants; |
|
|
import com.lzbi.common.core.domain.entity.SysDept; |
|
|
import com.lzbi.common.core.domain.entity.SysDept; |
|
|
import com.lzbi.common.enums.ReportNameEnum; |
|
|
import com.lzbi.common.enums.ReportNameEnum; |
|
|
import com.lzbi.bi.domain.dto.SomeOrgSomedayMultiReportDataDTO; |
|
|
|
|
|
import com.lzbi.bi.domain.dto.SomeTypeChildrenOrgSomedayMultiReportDataDTO; |
|
|
|
|
|
import com.lzbi.bi.domain.req.ReportDataReq; |
|
|
|
|
|
import com.lzbi.common.utils.bean.BeanUtils; |
|
|
import com.lzbi.common.utils.bean.BeanUtils; |
|
|
import com.lzbi.draft.domain.vo.*; |
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo; |
|
|
import com.lzbi.draft.service.DcBusiTargetDraftDaynewService; |
|
|
import com.lzbi.draft.service.DcBusiTargetDraftDaynewService; |
|
|
import com.lzbi.system.service.ISysDeptService; |
|
|
import com.lzbi.system.service.ISysDeptService; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
@ -35,7 +33,9 @@ import java.math.BigDecimal; |
|
|
import java.time.LocalDate; |
|
|
import java.time.LocalDate; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.time.temporal.ChronoUnit; |
|
|
import java.time.temporal.ChronoUnit; |
|
|
import java.util.*; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Stream; |
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
@ -87,12 +87,12 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
|
|
|
|
|
|
static { |
|
|
static { |
|
|
SPECIAL_REPORT_LIST = new ArrayList<>(); |
|
|
SPECIAL_REPORT_LIST = new ArrayList<>(); |
|
|
SPECIAL_REPORT_LIST.add(GRMJ); |
|
|
// SPECIAL_REPORT_LIST.add(GRMJ);
|
|
|
SPECIAL_REPORT_LIST.add(LWMJ); |
|
|
// SPECIAL_REPORT_LIST.add(LWMJ);
|
|
|
SPECIAL_REPORT_LIST.add(AQGR); |
|
|
SPECIAL_REPORT_LIST.add(AQGR); |
|
|
SPECIAL_REPORT_LIST.add(RY); |
|
|
SPECIAL_REPORT_LIST.add(RY); |
|
|
SPECIAL_REPORT_LIST.add(HRZ); |
|
|
SPECIAL_REPORT_LIST.add(HRZ); |
|
|
SPECIAL_REPORT_LIST.add(ZMJ); |
|
|
// SPECIAL_REPORT_LIST.add(ZMJ);
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -100,16 +100,31 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
* @param reportDataReq |
|
|
* @param reportDataReq |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
public SomeOrgSomedaySomeReportDataVO selectSomeOrgSomedaySomeReportData(ReportDataReq reportDataReq) { |
|
|
public JSONObject selectSomeOrgSomedaySomeReportData(ReportDataReq reportDataReq) { |
|
|
this.buildReportDataReq(reportDataReq); |
|
|
this.buildReportDataReq(reportDataReq); |
|
|
|
|
|
SomeOrgSomedaySomeReportDataVO someOrgSomedaySomeReportDataVO; |
|
|
if (SPECIAL_REPORT_LIST.contains(reportDataReq.getReportName())) { |
|
|
if (SPECIAL_REPORT_LIST.contains(reportDataReq.getReportName())) { |
|
|
return this.selectSpecialReportData(reportDataReq); |
|
|
someOrgSomedaySomeReportDataVO = this.selectSpecialReportData(reportDataReq); |
|
|
} else { |
|
|
} else { |
|
|
return baseMapper.selectSomeOrgSomedaySomeReportData(reportDataReq); |
|
|
someOrgSomedaySomeReportDataVO = baseMapper.selectSomeOrgSomedaySomeReportData(reportDataReq); |
|
|
|
|
|
} |
|
|
|
|
|
if (null != someOrgSomedaySomeReportDataVO) { |
|
|
|
|
|
log.info("结果:{}", someOrgSomedaySomeReportDataVO.toString()); |
|
|
|
|
|
JSONObject result = new JSONObject(); |
|
|
|
|
|
BigDecimal valueResult = someOrgSomedaySomeReportDataVO.getValueResult(); |
|
|
|
|
|
BigDecimal valuePlan = someOrgSomedaySomeReportDataVO.getValuePlan(); |
|
|
|
|
|
if (null != valueResult) { |
|
|
|
|
|
result.put("valueResult", someOrgSomedaySomeReportDataVO.getValueResult().toPlainString()); |
|
|
|
|
|
} |
|
|
|
|
|
if (null != valuePlan) { |
|
|
|
|
|
result.put("valuePlan", someOrgSomedaySomeReportDataVO.getValuePlan().toPlainString()); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public SomeOrgSomedaySomeReportDataVO selectSpecialReportData(ReportDataReq reportDataReq) { |
|
|
private SomeOrgSomedaySomeReportDataVO selectSpecialReportData(ReportDataReq reportDataReq) { |
|
|
ParamSummarizingDataReq paramSummarizingDataReq = new ParamSummarizingDataReq(); |
|
|
ParamSummarizingDataReq paramSummarizingDataReq = new ParamSummarizingDataReq(); |
|
|
BeanUtils.copyBeanProp(paramSummarizingDataReq, reportDataReq); |
|
|
BeanUtils.copyBeanProp(paramSummarizingDataReq, reportDataReq); |
|
|
BigDecimal value = null; |
|
|
BigDecimal value = null; |
|
@ -172,13 +187,18 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
*/ |
|
|
*/ |
|
|
public List<ChildrenOrgSomedaySomeReportDataVO> selectChildrenOrgSomedaySomeReportDataList(ReportDataReq reportDataReq) { |
|
|
public List<ChildrenOrgSomedaySomeReportDataVO> selectChildrenOrgSomedaySomeReportDataList(ReportDataReq reportDataReq) { |
|
|
this.buildChildrenOrgReportDataReq(reportDataReq); |
|
|
this.buildChildrenOrgReportDataReq(reportDataReq); |
|
|
return baseMapper.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
List<ChildrenOrgSomedaySomeReportDataVO> result = baseMapper.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
|
|
|
if (CollectionUtils.isEmpty(result)) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<JSONArray> selectChildrenOrgSomedaySomeReportDataEchart(ReportDataReq reportDataReq) { |
|
|
public List<JSONArray> selectChildrenOrgSomedaySomeReportDataEchart(ReportDataReq reportDataReq) { |
|
|
List<JSONArray> result = new ArrayList<>(); |
|
|
List<JSONArray> result = null; |
|
|
List<ChildrenOrgSomedaySomeReportDataVO> data = this.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
List<ChildrenOrgSomedaySomeReportDataVO> data = this.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
|
|
|
result = new ArrayList<>(); |
|
|
JSONArray head = new JSONArray(); |
|
|
JSONArray head = new JSONArray(); |
|
|
head.add("name"); |
|
|
head.add("name"); |
|
|
JSONArray body = new JSONArray(); |
|
|
JSONArray body = new JSONArray(); |
|
@ -194,9 +214,10 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<JSONArray> selectChildrenOrgSomedaySomeReportDataEchartHaveOrgId(ReportDataReq reportDataReq) { |
|
|
public List<JSONArray> selectChildrenOrgSomedaySomeReportDataEchartHaveOrgId(ReportDataReq reportDataReq) { |
|
|
List<JSONArray> result = new ArrayList<>(); |
|
|
List<JSONArray> result = null; |
|
|
List<ChildrenOrgSomedaySomeReportDataVO> data = this.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
List<ChildrenOrgSomedaySomeReportDataVO> data = this.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
|
|
|
result = new ArrayList<>(); |
|
|
JSONArray head = new JSONArray(); |
|
|
JSONArray head = new JSONArray(); |
|
|
head.add("name"); |
|
|
head.add("name"); |
|
|
JSONArray body = new JSONArray(); |
|
|
JSONArray body = new JSONArray(); |
|
@ -216,9 +237,10 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<JSONArray> selectChildrenOrgSomedaySomeReportDataEchartStacking(ReportDataReq reportDataReq) { |
|
|
public List<JSONArray> selectChildrenOrgSomedaySomeReportDataEchartStacking(ReportDataReq reportDataReq) { |
|
|
List<JSONArray> result = new ArrayList<>(); |
|
|
List<JSONArray> result = null; |
|
|
List<ChildrenOrgSomedaySomeReportDataVO> data = this.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
List<ChildrenOrgSomedaySomeReportDataVO> data = this.selectChildrenOrgSomedaySomeReportDataList(reportDataReq); |
|
|
if (!CollectionUtils.isEmpty(data)) {; |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
|
|
|
result = new ArrayList<>(); |
|
|
JSONArray head = new JSONArray(); |
|
|
JSONArray head = new JSONArray(); |
|
|
head.add("name"); |
|
|
head.add("name"); |
|
|
result.add(head); |
|
|
result.add(head); |
|
@ -247,13 +269,14 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
if (!CollectionUtils.isEmpty(someOrgSomedayMultiReportDataDTOS)) { |
|
|
if (!CollectionUtils.isEmpty(someOrgSomedayMultiReportDataDTOS)) { |
|
|
return JSONArray.parseArray(JSONArray.toJSONString(someOrgSomedayMultiReportDataDTOS), SomeOrgSomedayMultiReportDataVO.class); |
|
|
return JSONArray.parseArray(JSONArray.toJSONString(someOrgSomedayMultiReportDataDTOS), SomeOrgSomedayMultiReportDataVO.class); |
|
|
} |
|
|
} |
|
|
return new ArrayList<>(); |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<JSONArray> selectChildrenOrgSomedayMultiReportDataBar(ReportDataReq reportDataReq) { |
|
|
public List<JSONArray> selectChildrenOrgSomedayMultiReportDataBar(ReportDataReq reportDataReq) { |
|
|
List<JSONArray> result = new ArrayList<>(); |
|
|
List<JSONArray> result; |
|
|
List<SomeTypeChildrenOrgSomedayMultiReportDataDTO> data = this.selectSomeTypeChildrenOrgSomedayMultiReportDataDTOList(reportDataReq); |
|
|
List<SomeTypeChildrenOrgSomedayMultiReportDataDTO> data = this.selectSomeTypeChildrenOrgSomedayMultiReportDataDTOList(reportDataReq); |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
|
|
|
result = new ArrayList<>(); |
|
|
List<String> reportNames = reportDataReq.getReportNames(); |
|
|
List<String> reportNames = reportDataReq.getReportNames(); |
|
|
JSONArray head = new JSONArray(); |
|
|
JSONArray head = new JSONArray(); |
|
|
head.add("name"); |
|
|
head.add("name"); |
|
@ -271,15 +294,18 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
result.get(i).add(reportNameValueMap.get(String.valueOf(result.get(i).get(0)))); |
|
|
result.get(i).add(reportNameValueMap.get(String.valueOf(result.get(i).get(0)))); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
result = null; |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<JSONArray> selectSomeOrgSomeMultiReportYearlyDataMultiEchart(ReportDataReq reportDataReq) { |
|
|
public List<JSONArray> selectSomeOrgSomeMultiReportYearlyDataMultiEchart(ReportDataReq reportDataReq) { |
|
|
List<JSONArray> result = new ArrayList<>(); |
|
|
List<JSONArray> result; |
|
|
List<String> reportNames = reportDataReq.getReportNames(); |
|
|
List<String> reportNames = reportDataReq.getReportNames(); |
|
|
List<SomeOrgSomeReportYearlyDataVO> data = this.selectSomeOrgSomeReportYearlyDataList(reportDataReq); |
|
|
List<SomeOrgSomeReportYearlyDataVO> data = this.selectSomeOrgSomeReportYearlyDataList(reportDataReq); |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
|
|
|
result = new ArrayList<>(); |
|
|
JSONArray head = new JSONArray(); |
|
|
JSONArray head = new JSONArray(); |
|
|
head.add("name"); |
|
|
head.add("name"); |
|
|
result.add(head); |
|
|
result.add(head); |
|
@ -300,22 +326,29 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
result = null; |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<MapOrgVO> selectMapOrgList(ReportDataReq reportDataReq) { |
|
|
public List<MapOrgVO> selectMapOrgList(ReportDataReq reportDataReq) { |
|
|
this.buildChildrenOrgReportDataReq(reportDataReq); |
|
|
this.buildChildrenOrgReportDataReq(reportDataReq); |
|
|
return baseMapper.selectMapOrgList(reportDataReq); |
|
|
List<MapOrgVO> result = baseMapper.selectMapOrgList(reportDataReq); |
|
|
|
|
|
if (CollectionUtils.isEmpty(result)) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<SomeReportDataRankingVO> selectSomeReportDataRankingList(ReportDataReq reportDataReq) { |
|
|
public List<SomeReportDataRankingVO> selectSomeReportDataRankingList(ReportDataReq reportDataReq) { |
|
|
List<SomeReportDataRankingVO> result = new ArrayList<>(); |
|
|
List<SomeReportDataRankingVO> result; |
|
|
this.buildChildrenOrgReportDataReq(reportDataReq); |
|
|
this.buildChildrenOrgReportDataReq(reportDataReq); |
|
|
this.buildHeatingDate(reportDataReq); |
|
|
this.buildHeatingDate(reportDataReq); |
|
|
List<MultiOrgSomeReportEverydayData> data = baseMapper.selectChildOrgSomeReportEverydayDataList(reportDataReq); |
|
|
List<MultiOrgSomeReportEverydayData> data = baseMapper.selectChildOrgSomeReportEverydayDataList(reportDataReq); |
|
|
log.info("排名数据:{}", JSONArray.toJSONString(data)); |
|
|
log.info("排名数据:{}", JSONArray.toJSONString(data)); |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
if (!CollectionUtils.isEmpty(data)) { |
|
|
|
|
|
result = new ArrayList<>(); |
|
|
// 排序后的日期列表
|
|
|
// 排序后的日期列表
|
|
|
List<String> dateSoredList = data.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列表
|
|
|
// 排序后的组织id列表
|
|
@ -343,6 +376,8 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
someReportDataRankingVO.setCut(StringUtils.join(valueList, ",")); |
|
|
someReportDataRankingVO.setCut(StringUtils.join(valueList, ",")); |
|
|
result.add(someReportDataRankingVO); |
|
|
result.add(someReportDataRankingVO); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
result = null; |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|