|
|
@ -1,6 +1,8 @@ |
|
|
|
package com.lzbi.bi.service; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.core.date.DatePattern; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.ObjUtil; |
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
@ -13,15 +15,19 @@ import com.lzbi.bi.domain.SysDeptLocation; |
|
|
|
import com.lzbi.bi.mapper.DcBusiDataScreenMainMapper; |
|
|
|
import com.lzbi.common.constant.BizConstants; |
|
|
|
import com.lzbi.common.core.domain.entity.SysDept; |
|
|
|
import com.lzbi.common.enums.HeatingPeriodEnum; |
|
|
|
import com.lzbi.common.enums.ReportNameEnum; |
|
|
|
import com.lzbi.common.utils.StringUtils; |
|
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo; |
|
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo; |
|
|
|
import com.lzbi.draft.service.DcBusiTargetDraftDaynewService; |
|
|
|
import com.lzbi.system.service.ISysDeptService; |
|
|
|
import org.apache.commons.compress.utils.Lists; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -308,4 +314,25 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai |
|
|
|
public List<DcBusiDataScreenVo> selectSquareGroup(String qdate){ |
|
|
|
return baseMapper.selectSquareGroup(qdate); |
|
|
|
} |
|
|
|
|
|
|
|
public List<Map> getHeatingPeriodData(TargetDraftDaynewReqVo vo){ |
|
|
|
List<Map> res = Lists.newArrayList(); |
|
|
|
if (!HeatingPeriodEnum.HEATING_ALL_PERIOD.getMonths().contains(Integer.parseInt(vo.getDateMonth()))) { |
|
|
|
return res; |
|
|
|
} |
|
|
|
List<SysDept> sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build()); |
|
|
|
if (CollUtil.isEmpty(sysDepts)) { |
|
|
|
return res; |
|
|
|
} |
|
|
|
List<Long> orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList()); |
|
|
|
vo.setAssetType("0").setAssetLevel("10").setOrgIds(orgIds); |
|
|
|
String dateYear = vo.getDateYear(); |
|
|
|
if (HeatingPeriodEnum.HEATING_NEXT_YREA_PERIOD.getMonths().contains(Integer.parseInt(vo.getDateMonth()))) { |
|
|
|
dateYear = String.valueOf(Integer.parseInt(vo.getDateYear())-1); |
|
|
|
} |
|
|
|
vo.setBeginDate(StringUtils.join(dateYear, "1101")).setAssetType("0").setAssetLevel("10").setOrgIds(orgIds) |
|
|
|
.setEndDate(StringUtils.join(vo.getDateYear(),vo.getDateMonth(),vo.getDateDay())); |
|
|
|
res = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewRangeList(vo); |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |