|
|
@ -1,13 +1,25 @@ |
|
|
|
package com.lzbi.wechat.service; |
|
|
|
|
|
|
|
import com.lzbi.asset.mapper.DcBaseAssetInfoMapper; |
|
|
|
import com.lzbi.common.constant.BizConstants; |
|
|
|
import com.lzbi.common.core.domain.entity.SysDept; |
|
|
|
import com.lzbi.common.constant.TargetModelCodeConstants; |
|
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftDaynewMapper; |
|
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; |
|
|
|
import com.lzbi.system.service.ISysDeptService; |
|
|
|
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper; |
|
|
|
import com.lzbi.wechat.domain.dto.TargetModelValueDTO; |
|
|
|
import com.lzbi.wechat.domain.vo.TargetPlanVO; |
|
|
|
import com.lzbi.wechat.domain.vo.TargetResultVO; |
|
|
|
import com.lzbi.wechat.domain.vo.TargetVO; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class TargetService { |
|
|
@ -15,126 +27,196 @@ public class TargetService { |
|
|
|
@Autowired |
|
|
|
private ISysDeptService sysDeptService; |
|
|
|
|
|
|
|
public Double getHeatRadiatingArea(Long deptId) { |
|
|
|
Double result = 314251101D; |
|
|
|
@Resource |
|
|
|
private DcBaseAssetInfoMapper dcBaseAssetInfoMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private DcBusiTargetDraftDaynewMapper dcBusiTargetDraftDaynewMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper; |
|
|
|
|
|
|
|
private TargetModelValueDTO buildeTargetModelValueDTO(List<String> targetModelCodeList, Long deptId, String date) { |
|
|
|
String year = null; |
|
|
|
String month = null; |
|
|
|
String day = null; |
|
|
|
if (StringUtils.isNotBlank(date)) { |
|
|
|
String[] arr = date.split("-"); |
|
|
|
if (arr.length == 3) { |
|
|
|
year = arr[0]; |
|
|
|
month = arr[1]; |
|
|
|
day = arr[2]; |
|
|
|
} else { |
|
|
|
throw new RuntimeException("日期格式不正确"); |
|
|
|
} |
|
|
|
} |
|
|
|
return new TargetModelValueDTO(targetModelCodeList, deptId, year, month, day); |
|
|
|
} |
|
|
|
|
|
|
|
public Double getHeatRadiatingArea(Long deptId, String date) { |
|
|
|
List<String> targetModelCodeList = new ArrayList<>(); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.总开栓面积); |
|
|
|
TargetModelValueDTO targetModelValueDTO = buildeTargetModelValueDTO(targetModelCodeList, deptId, date); |
|
|
|
List<TargetResultVO> targetResultVOList = dcBusiTargetDraftDaynewMapper.selectDayTargetModelValue(targetModelValueDTO); |
|
|
|
Double result = null; |
|
|
|
if (!CollectionUtils.isEmpty(targetResultVOList)) { |
|
|
|
result = targetResultVOList.get(0).getValue(); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
public Map<String, TargetVO> getComanyTarget(Long deptId) { |
|
|
|
Map<String, TargetVO> map = new HashMap<>(); |
|
|
|
SysDept selfDept = sysDeptService.selectDeptById(deptId); |
|
|
|
map.put("00023210", new TargetVO("00023210", "总产热量", "GJ", 14123123D)); |
|
|
|
map.put("00023211", new TargetVO("00023211", "水总耗", "GJ", 2697D)); |
|
|
|
map.put("00023212", new TargetVO("00023212", "电总耗", "GJ", 16791D)); |
|
|
|
map.put("00023213", new TargetVO("00023213", "煤总耗", "GJ", 11679D)); |
|
|
|
map.put("00023214", new TargetVO("00023214", "平均单耗", "GJ", 8971D)); |
|
|
|
public Map<String, TargetResultVO> getComanyTarget(Long deptId, String date) { |
|
|
|
List<String> targetModelCodeList = new ArrayList<>(); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.总产热量); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.一次网补水量); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.从大唐补一次网水量); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.总厂用电量); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.生产用标煤总量); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.热耗率); |
|
|
|
TargetModelValueDTO targetModelValueDTO = buildeTargetModelValueDTO(targetModelCodeList, deptId, date); |
|
|
|
List<TargetResultVO> targetResultVOList = dcBusiTargetDraftDaynewMapper.selectDayTargetModelValue(targetModelValueDTO); |
|
|
|
Map<String, TargetResultVO> map = listTransitionMap(targetResultVOList); |
|
|
|
TargetResultVO onceWater = map.get(TargetModelCodeConstants.一次网补水量); |
|
|
|
TargetResultVO onceWater2 = map.get(TargetModelCodeConstants.从大唐补一次网水量); |
|
|
|
if (null != onceWater.getValue() && null != onceWater2.getValue()) { |
|
|
|
onceWater.setValue(onceWater.getValue() + onceWater2.getValue()); |
|
|
|
} |
|
|
|
map.remove(TargetModelCodeConstants.从大唐补一次网水量); |
|
|
|
map.put(TargetModelCodeConstants.一次网补水量, onceWater); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
public Map<String, TargetVO> getHeatSourceTarget(Long deptId, String type) { |
|
|
|
Map<String, TargetVO> map = new HashMap<>(); |
|
|
|
SysDept selfDept = sysDeptService.selectDeptById(deptId); |
|
|
|
public Map<String, TargetResultVO> getHeatSourceTarget(Long deptId, String date, String type) { |
|
|
|
List<String> targetModelCodeList = new ArrayList<>(); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.一次网补水量); // 一次网水耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.从大唐补一次网水量); // 一次网水耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.总厂用电量); // 一次网电耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.生产用标煤总量); // 一次网煤耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.总产热量); // 总产热量
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.汽炉产汽量); // 总产气量
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.发电量); // 总发电量
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.二次网耗水量); // 二次网总水耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.二次网耗电量); // 二次网总电耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.一次网供水温度); // 一次网供温
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.一次网回水温度); // 一次网回温
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.一次网耗水率); // 一次网水单耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.热源厂电耗率); // 一次网电单耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.单位面积耗标煤); // 一次网煤单耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.二次网耗水率); // 二次网水单耗
|
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.二次网耗电率); // 二次网电单耗
|
|
|
|
TargetModelValueDTO targetModelValueDTO = buildeTargetModelValueDTO(targetModelCodeList, deptId, date); |
|
|
|
Map<String, TargetResultVO> map; |
|
|
|
if (BizConstants.TargetType.DAY.equals(type)) { |
|
|
|
map.put("ycwsh", new TargetVO("ycwsh", "一次网水耗", "GJ", 14123123D)); |
|
|
|
map.put("ycwdh", new TargetVO("ycwdh", "一次网电耗", "GJ", 2697D)); |
|
|
|
map.put("ycwmh", new TargetVO("ycwmh", "一次网煤耗", "GJ", 16791D)); |
|
|
|
map.put("zcrl", new TargetVO("zcrl", "总产热量", "GJ", 11679D)); |
|
|
|
map.put("zcql", new TargetVO("zcql", "总产汽量", "GJ", 8971D)); |
|
|
|
map.put("zfdl", new TargetVO("zfdl", "总发电量", "GJ", 14123123D)); |
|
|
|
map.put("ecwsh", new TargetVO("ecwsh", "二次网水耗", "GJ", 2697D)); |
|
|
|
map.put("ecwdh", new TargetVO("ecwdh", "二次网电耗", "GJ", 16791D)); |
|
|
|
map.put("xhll", new TargetVO("xhll", "循环流量", "GJ", 11679D)); |
|
|
|
map.put("ycwgw", new TargetVO("ycwgw", "一次网供温", "GJ", 8971D)); |
|
|
|
map.put("ycwhw", new TargetVO("ycwhw", "一次网回温", "GJ", 8971D)); |
|
|
|
map.put("ycwsdh", new TargetVO("ycwsdh", "一次网水单耗", "GJ", 14123123D)); |
|
|
|
map.put("ycwddh", new TargetVO("ycwddh", "一次网电单耗", "GJ", 2697D)); |
|
|
|
map.put("ycwmdh", new TargetVO("ycwmdh", "一次网煤单耗", "GJ", 16791D)); |
|
|
|
map.put("dcrl", new TargetVO("dcrl", "单产热量", "GJ", 11679D)); |
|
|
|
map.put("dcql", new TargetVO("dcql", "单产汽量", "GJ", 8971D)); |
|
|
|
map.put("dfdl", new TargetVO("dfdl", "单发电量", "GJ", 14123123D)); |
|
|
|
map.put("ecwsdh", new TargetVO("ecwsdh", "二次网水单耗", "GJ", 2697D)); |
|
|
|
map.put("ecwddh", new TargetVO("ecwddh", "二次网电单耗", "GJ", 16791D)); |
|
|
|
List<TargetResultVO> targetResultVOList = dcBusiTargetDraftDaynewMapper.selectDayTargetModelValue(targetModelValueDTO); |
|
|
|
map = listTransitionMap(targetResultVOList); |
|
|
|
} else { |
|
|
|
map.put("ycwshlj", new TargetVO("ycwshlj", "一次网水耗", "GJ", 14123123D)); |
|
|
|
map.put("ycwdhlj", new TargetVO("ycwdhlj", "一次网电耗", "GJ", 2697D)); |
|
|
|
map.put("ycwmhlj", new TargetVO("ycwmhlj", "一次网煤耗", "GJ", 16791D)); |
|
|
|
map.put("zcrllj", new TargetVO("zcrllj", "总产热量", "GJ", 11679D)); |
|
|
|
map.put("zcqllj", new TargetVO("zcqllj", "总产汽量", "GJ", 8971D)); |
|
|
|
map.put("zfdllj", new TargetVO("zfdllj", "总发电量", "GJ", 14123123D)); |
|
|
|
map.put("ecwshlj", new TargetVO("ecwshlj", "二次网水耗", "GJ", 2697D)); |
|
|
|
map.put("ecwdhlj", new TargetVO("ecwdhlj", "二次网电耗", "GJ", 16791D)); |
|
|
|
map.put("xhlllj", new TargetVO("xhllj", "循环流量", "GJ", 11679D)); |
|
|
|
map.put("ycwgwlj", new TargetVO("ycwgwlj", "一次网供温", "GJ", 8971D)); |
|
|
|
map.put("ycwhwlj", new TargetVO("ycwhwlj", "一次网回温", "GJ", 8971D)); |
|
|
|
map.put("ycwsdhlj", new TargetVO("ycwsdhlj", "一次网水单耗", "GJ", 14123123D)); |
|
|
|
map.put("ycwddhlj", new TargetVO("ycwddhlj", "一次网电单耗", "GJ", 2697D)); |
|
|
|
map.put("ycwmdhlj", new TargetVO("ycwmdhlj", "一次网煤单耗", "GJ", 16791D)); |
|
|
|
map.put("dcrllj", new TargetVO("dcrllj", "单产热量", "GJ", 11679D)); |
|
|
|
map.put("dcqllj", new TargetVO("dcqllj", "单产汽量", "GJ", 8971D)); |
|
|
|
map.put("dfdllj", new TargetVO("dfdllj", "单发电量", "GJ", 14123123D)); |
|
|
|
map.put("ecwsdhlj", new TargetVO("ecwsdhlj", "二次网水单耗", "GJ", 2697D)); |
|
|
|
map.put("ecwddhlj", new TargetVO("ecwddhlj", "二次网电单耗", "GJ", 16791D)); |
|
|
|
List<TargetResultVO> targetResultVOList = dcBusiTargetDraftDaynewMapper.selectTotalTargetModelValue(targetModelValueDTO); |
|
|
|
map = listTransitionMap(targetResultVOList); |
|
|
|
} |
|
|
|
TargetResultVO targetResultVO1 = map.get(TargetModelCodeConstants.一次网补水量); |
|
|
|
TargetResultVO targetResultVO2 = map.get(TargetModelCodeConstants.从大唐补一次网水量); |
|
|
|
if (null != targetResultVO1.getValue() && null != targetResultVO2.getValue()) { |
|
|
|
targetResultVO1.setValue(targetResultVO1.getValue() + targetResultVO2.getValue()); |
|
|
|
} else if (null == targetResultVO1.getValue() && null != targetResultVO2.getValue()) { |
|
|
|
targetResultVO1.setValue(targetResultVO2.getValue()); |
|
|
|
} |
|
|
|
map.remove(TargetModelCodeConstants.从大唐补一次网水量); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
public Map<String, TargetVO> getHeatExchangeStationParams(Long deptId) { |
|
|
|
Map<String, TargetVO> map = new HashMap<>(); |
|
|
|
map.put("014", new TargetVO("014", "一次网回压", "Mpa", 14123123D)); |
|
|
|
map.put("013", new TargetVO("013", "一次网供压", "Mpa", 2697D)); |
|
|
|
map.put("011", new TargetVO("011", "一次网供温", "°C", 16791D)); |
|
|
|
map.put("012", new TargetVO("012", "一次网回温", "°C", 11679D)); |
|
|
|
map.put("007", new TargetVO("007", "瞬时流量", "m³/h", 8971D)); |
|
|
|
map.put("008", new TargetVO("008", "瞬时热量", "kcal", 14123123D)); |
|
|
|
map.put("009", new TargetVO("009", "累计热量", "kcal", 2697D)); |
|
|
|
map.put("047", new TargetVO("047", "二次网供水压力", "Mpa", 16791D)); |
|
|
|
map.put("048", new TargetVO("048", "二次网回水压力", "Mpa", 11679D)); |
|
|
|
map.put("045", new TargetVO("045", "二次网供水温", "°C", 8971D)); |
|
|
|
map.put("046", new TargetVO("046", "二次网回水温", "°C", 8971D)); |
|
|
|
map.put("001", new TargetVO("001", "电调阀开度给定", "%", 14123123D)); |
|
|
|
map.put("002", new TargetVO("002", "电调阀开度反馈", "%", 2697D)); |
|
|
|
map.put("015", new TargetVO("015", "水箱水位计", "GJ", 16791D)); |
|
|
|
map.put("004", new TargetVO("004", "电调阀控制模式选择", "GJ", 11679D)); |
|
|
|
map.put("003", new TargetVO("003", "电调阀远控/就地", "°C", 8971D)); |
|
|
|
map.put("044", new TargetVO("044", "二次网压差设定", "%", 14123123D)); |
|
|
|
map.put("019", new TargetVO("019", "一次网管道泵上电", "", 2697D)); |
|
|
|
map.put("020", new TargetVO("020", "一次网管道泵下电", "", 16791D)); |
|
|
|
map.put("005", new TargetVO("005", "二次网供温设定", "", 16791D)); |
|
|
|
map.put("018", new TargetVO("018", "一次网管道泵远控/就地", "", 16791D)); |
|
|
|
map.put("021", new TargetVO("021", "一次网管道泵启动", "", 16791D)); |
|
|
|
map.put("010", new TargetVO("010", "热量累计清零", "kwh", 16791D)); |
|
|
|
map.put("017", new TargetVO("017", "总电表", "°C", 16791D)); |
|
|
|
map.put("006", new TargetVO("006", "二次网供回水平均温设定", "m³", 16791D)); |
|
|
|
map.put("031", new TargetVO("031", "水表(累计补水量)", "%", 16791D)); |
|
|
|
map.put("023", new TargetVO("023", "一次网管道泵频率给定", "%", 16791D)); |
|
|
|
map.put("028", new TargetVO("028", "一次网混水电调阀开度给定", "%", 16791D)); |
|
|
|
map.put("029", new TargetVO("029", "一次网混水电调阀开度反馈", "", 16791D)); |
|
|
|
map.put("035", new TargetVO("035", "补水泵1#故障状态", "m³", 16791D)); |
|
|
|
map.put("032", new TargetVO("032", "水表(累计补水量清零)", "", 16791D)); |
|
|
|
map.put("036", new TargetVO("036", "补水泵2#故障状态", "", 16791D)); |
|
|
|
map.put("037", new TargetVO("037", "循环泵远控/就地选择", "", 16791D)); |
|
|
|
map.put("038", new TargetVO("038", "循环泵1#/2#泵选择", "", 16791D)); |
|
|
|
map.put("039", new TargetVO("039", "循环泵控制模式选择", "", 16791D)); |
|
|
|
map.put("025", new TargetVO("025", "一次网管道泵运行/停止状态", "", 16791D)); |
|
|
|
map.put("026", new TargetVO("026", "一次网管道泵故障状态", "", 16791D)); |
|
|
|
map.put("027", new TargetVO("027", "一次网混水电调阀远控/就地", "", 16791D)); |
|
|
|
map.put("033", new TargetVO("033", "补水泵1#运行/停止状态", "", 16791D)); |
|
|
|
map.put("034", new TargetVO("034", "补水泵2#运行/停止状态", "", 16791D)); |
|
|
|
map.put("040", new TargetVO("040", "循环泵变频上电", "", 16791D)); |
|
|
|
map.put("041", new TargetVO("041", "循环泵变频下电", "", 16791D)); |
|
|
|
map.put("042", new TargetVO("042", "循环泵变频启动", "", 16791D)); |
|
|
|
map.put("043", new TargetVO("043", "循环泵变频停止", "", 16791D)); |
|
|
|
map.put("022", new TargetVO("022", "一次网管道泵停止", "", 16791D)); |
|
|
|
map.put("030", new TargetVO("030", "水表(瞬时补水量)", "m³", 16791D)); |
|
|
|
map.put("066", new TargetVO("066", "一次网管道泵启/停", "", 16791D)); |
|
|
|
map.put("024", new TargetVO("024", "一次网管道泵频率反馈", "", 16791D)); |
|
|
|
public Map<String, TargetResultVO> getHeatExchangeStationParams(Long deptId) { |
|
|
|
Map<String, TargetResultVO> map = new HashMap<>(); |
|
|
|
map.put("014", new TargetResultVO("014", "一次网回压", "Mpa", 14123123D)); |
|
|
|
map.put("013", new TargetResultVO("013", "一次网供压", "Mpa", 2697D)); |
|
|
|
map.put("011", new TargetResultVO("011", "一次网供温", "°C", 16791D)); |
|
|
|
map.put("012", new TargetResultVO("012", "一次网回温", "°C", 11679D)); |
|
|
|
map.put("007", new TargetResultVO("007", "瞬时流量", "m³/h", 8971D)); |
|
|
|
map.put("008", new TargetResultVO("008", "瞬时热量", "kcal", 14123123D)); |
|
|
|
map.put("009", new TargetResultVO("009", "累计热量", "kcal", 2697D)); |
|
|
|
map.put("047", new TargetResultVO("047", "二次网供水压力", "Mpa", 16791D)); |
|
|
|
map.put("048", new TargetResultVO("048", "二次网回水压力", "Mpa", 11679D)); |
|
|
|
map.put("045", new TargetResultVO("045", "二次网供水温", "°C", 8971D)); |
|
|
|
map.put("046", new TargetResultVO("046", "二次网回水温", "°C", 8971D)); |
|
|
|
map.put("001", new TargetResultVO("001", "电调阀开度给定", "%", 14123123D)); |
|
|
|
map.put("002", new TargetResultVO("002", "电调阀开度反馈", "%", 2697D)); |
|
|
|
map.put("015", new TargetResultVO("015", "水箱水位计", "GJ", 16791D)); |
|
|
|
map.put("004", new TargetResultVO("004", "电调阀控制模式选择", "GJ", 11679D)); |
|
|
|
map.put("003", new TargetResultVO("003", "电调阀远控/就地", "°C", 8971D)); |
|
|
|
map.put("044", new TargetResultVO("044", "二次网压差设定", "%", 14123123D)); |
|
|
|
map.put("019", new TargetResultVO("019", "一次网管道泵上电", "", 2697D)); |
|
|
|
map.put("020", new TargetResultVO("020", "一次网管道泵下电", "", 16791D)); |
|
|
|
map.put("005", new TargetResultVO("005", "二次网供温设定", "", 16791D)); |
|
|
|
map.put("018", new TargetResultVO("018", "一次网管道泵远控/就地", "", 16791D)); |
|
|
|
map.put("021", new TargetResultVO("021", "一次网管道泵启动", "", 16791D)); |
|
|
|
map.put("010", new TargetResultVO("010", "热量累计清零", "kwh", 16791D)); |
|
|
|
map.put("017", new TargetResultVO("017", "总电表", "°C", 16791D)); |
|
|
|
map.put("006", new TargetResultVO("006", "二次网供回水平均温设定", "m³", 16791D)); |
|
|
|
map.put("031", new TargetResultVO("031", "水表(累计补水量)", "%", 16791D)); |
|
|
|
map.put("023", new TargetResultVO("023", "一次网管道泵频率给定", "%", 16791D)); |
|
|
|
map.put("028", new TargetResultVO("028", "一次网混水电调阀开度给定", "%", 16791D)); |
|
|
|
map.put("029", new TargetResultVO("029", "一次网混水电调阀开度反馈", "", 16791D)); |
|
|
|
map.put("035", new TargetResultVO("035", "补水泵1#故障状态", "m³", 16791D)); |
|
|
|
map.put("032", new TargetResultVO("032", "水表(累计补水量清零)", "", 16791D)); |
|
|
|
map.put("036", new TargetResultVO("036", "补水泵2#故障状态", "", 16791D)); |
|
|
|
map.put("037", new TargetResultVO("037", "循环泵远控/就地选择", "", 16791D)); |
|
|
|
map.put("038", new TargetResultVO("038", "循环泵1#/2#泵选择", "", 16791D)); |
|
|
|
map.put("039", new TargetResultVO("039", "循环泵控制模式选择", "", 16791D)); |
|
|
|
map.put("025", new TargetResultVO("025", "一次网管道泵运行/停止状态", "", 16791D)); |
|
|
|
map.put("026", new TargetResultVO("026", "一次网管道泵故障状态", "", 16791D)); |
|
|
|
map.put("027", new TargetResultVO("027", "一次网混水电调阀远控/就地", "", 16791D)); |
|
|
|
map.put("033", new TargetResultVO("033", "补水泵1#运行/停止状态", "", 16791D)); |
|
|
|
map.put("034", new TargetResultVO("034", "补水泵2#运行/停止状态", "", 16791D)); |
|
|
|
map.put("040", new TargetResultVO("040", "循环泵变频上电", "", 16791D)); |
|
|
|
map.put("041", new TargetResultVO("041", "循环泵变频下电", "", 16791D)); |
|
|
|
map.put("042", new TargetResultVO("042", "循环泵变频启动", "", 16791D)); |
|
|
|
map.put("043", new TargetResultVO("043", "循环泵变频停止", "", 16791D)); |
|
|
|
map.put("022", new TargetResultVO("022", "一次网管道泵停止", "", 16791D)); |
|
|
|
map.put("030", new TargetResultVO("030", "水表(瞬时补水量)", "m³", 16791D)); |
|
|
|
map.put("066", new TargetResultVO("066", "一次网管道泵启/停", "", 16791D)); |
|
|
|
map.put("024", new TargetResultVO("024", "一次网管道泵频率反馈", "", 16791D)); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
public List<List<Object>> getFinishingRate(Long deptId) { |
|
|
|
List<List<Object>> list = new ArrayList<>(); |
|
|
|
List<Object> names = Arrays.asList("name", "水耗", "电耗", "煤耗"); |
|
|
|
List<Object> values = Arrays.asList("总完成率", 90D, 80D, 95D); |
|
|
|
List<String> targetModelCodeList = new ArrayList<>(); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.一次网耗水率); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.二次网耗水率); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.热源厂电耗率); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.二次网耗电率); |
|
|
|
targetModelCodeList.add(TargetModelCodeConstants.单位面积耗标煤); |
|
|
|
TargetModelValueDTO targetModelValueDTO = buildeTargetModelValueDTO(targetModelCodeList, deptId, null); |
|
|
|
List<TargetResultVO> targetResultVOList = dcBusiTargetDraftDaynewMapper.selectTotalTargetModelValue(targetModelValueDTO); |
|
|
|
List<TargetPlanVO> targetPlanVOList = dcBusiTargetDraftMonthMapper.selectTotalTargetModelPlanValue(targetModelValueDTO); |
|
|
|
Map<String, TargetResultVO> targetValueMap = null; |
|
|
|
Map<String, Double> targetPlanValueMap = null; |
|
|
|
if (!CollectionUtils.isEmpty(targetResultVOList)) { |
|
|
|
targetValueMap = listTransitionMap(targetResultVOList); |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(targetPlanVOList)) { |
|
|
|
targetPlanValueMap = targetPlanVOList.stream().collect(Collectors.toMap(TargetPlanVO::getTargetCode, TargetPlanVO::getValue)); |
|
|
|
} |
|
|
|
if (null == targetValueMap || null == targetPlanValueMap) { |
|
|
|
throw new RuntimeException("无数据"); |
|
|
|
} |
|
|
|
List<Object> names = new ArrayList<>(); |
|
|
|
names.add("name"); |
|
|
|
List<Object> values = new ArrayList<>(); |
|
|
|
values.add("总完成率"); |
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00"); |
|
|
|
for (String targetModelCode : targetModelCodeList) { |
|
|
|
TargetResultVO targetResultVO = targetValueMap.get(targetModelCode); |
|
|
|
Double value = targetResultVO.getValue(); |
|
|
|
Double planValue = targetPlanValueMap.get(targetModelCode); |
|
|
|
if (null == planValue) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
names.add(targetResultVO.getTargetName()); |
|
|
|
values.add(decimalFormat.format((value / planValue) * 100)); |
|
|
|
} |
|
|
|
list.add(names); |
|
|
|
list.add(values); |
|
|
|
return list; |
|
|
@ -154,4 +236,10 @@ public class TargetService { |
|
|
|
list.add(list5); |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
private <T extends TargetVO> Map<String, T> listTransitionMap(List<T> list) { |
|
|
|
Map<String, T> map = new HashMap<>(); |
|
|
|
list.forEach(obj -> map.put(obj.getTargetCode(), obj)); |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|