|
|
|
@ -19,6 +19,10 @@ public class BuildHeatingSence implements DntdModelI { |
|
|
|
|
|
|
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("#.00"); |
|
|
|
|
|
|
|
|
|
//首先A=由运行/合同容量折合成kW(x0.9)x85%,
|
|
|
|
|
static final Double COEFFICIENT_1 = 0.9; |
|
|
|
|
static final Double COEFFICIENT_2 = 0.85; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public JSONObject createReport(JSONObject jsonObject2) { |
|
|
|
|
List<SysDeviceHeatScene> list = ModelTool.specList; |
|
|
|
@ -36,10 +40,13 @@ public class BuildHeatingSence implements DntdModelI { |
|
|
|
|
// 上年运行费用(万元)
|
|
|
|
|
Double lastYearFee = Double.parseDouble(buildInfo.get("lastYearFee").toString()); |
|
|
|
|
|
|
|
|
|
Double A = runCapacity * 0.9 * 0.85; |
|
|
|
|
// A=由运行/合同容量折合成kW(x0.9)x85%,
|
|
|
|
|
Double A = runCapacity * COEFFICIENT_1 * COEFFICIENT_2; |
|
|
|
|
// 冗余容量
|
|
|
|
|
Double B = A - lastYearNeed; |
|
|
|
|
//投入供热设备总功率C
|
|
|
|
|
AtomicReference<Double> C = new AtomicReference<>(); |
|
|
|
|
//投入供热设备总功率C1
|
|
|
|
|
AtomicReference<Double> C1 = new AtomicReference<>(); |
|
|
|
|
List<Map<String, List<List<MatchedDevice>>>> calScheme = Scheme.calScheme(heatingArea, list); |
|
|
|
|
List<Map<String, Double>> mapsC = CalC.getC(calScheme); |
|
|
|
@ -54,24 +61,36 @@ public class BuildHeatingSence implements DntdModelI { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Double D = lastYearNeed + C.get(); |
|
|
|
|
Double D1 = lastYearNeed + C1.get(); |
|
|
|
|
|
|
|
|
|
List<MatchedDevice> matchedDeviceList; |
|
|
|
|
Map<Double, List<MatchedDevice>> listMap; |
|
|
|
|
// 判断只能用热泵
|
|
|
|
|
Double costRatio = 0.2; |
|
|
|
|
Double effRatio = 0.8; |
|
|
|
|
//获取计算占比
|
|
|
|
|
try{ |
|
|
|
|
Double costRatio1 = Double.parseDouble(jsonObject2.get("costRatio").toString()); |
|
|
|
|
Double effRatio1 = Double.parseDouble(jsonObject2.get("effRatio").toString()); |
|
|
|
|
if(costRatio1 < 1 && costRatio1 + costRatio1 == 1){ |
|
|
|
|
costRatio = costRatio1; |
|
|
|
|
effRatio = effRatio1; |
|
|
|
|
} |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
if (D1 < A && A < D) { |
|
|
|
|
// 判断只能用热泵
|
|
|
|
|
List<SysDeviceHeatScene> deviceList = new ArrayList<>(); |
|
|
|
|
list.parallelStream().forEach((sysDeviceHeatScene -> { |
|
|
|
|
if (!sysDeviceHeatScene.getDevTechType().contains("电锅炉")) { |
|
|
|
|
deviceList.add(sysDeviceHeatScene); |
|
|
|
|
} |
|
|
|
|
})); |
|
|
|
|
listMap = SchemeRating.getOptimalList(Scheme.calScheme(heatingArea, deviceList)); |
|
|
|
|
listMap = SchemeRating.getOptimalList(Scheme.calScheme(heatingArea, deviceList),costRatio,effRatio); |
|
|
|
|
matchedDeviceList = SchemeRating.getOptimalScheme(listMap); |
|
|
|
|
} else { |
|
|
|
|
listMap = SchemeRating.getOptimalList(calScheme); |
|
|
|
|
listMap = SchemeRating.getOptimalList(calScheme,costRatio,effRatio); |
|
|
|
|
matchedDeviceList = SchemeRating.getOptimalScheme(listMap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -85,44 +104,50 @@ public class BuildHeatingSence implements DntdModelI { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
AtomicReference<String> planInfos = new AtomicReference<>(); |
|
|
|
|
AtomicReference<String> devTechType = new AtomicReference<>(); |
|
|
|
|
AtomicReference<String> devSubType = new AtomicReference<>(); |
|
|
|
|
AtomicReference<String> devCount = new AtomicReference<>(); |
|
|
|
|
AtomicReference<String> devPrice = new AtomicReference<>(); |
|
|
|
|
AtomicReference<Double> startCost = new AtomicReference<>(0.0); |
|
|
|
|
AtomicReference<Double> runCost = new AtomicReference<>(0.0); |
|
|
|
|
AtomicReference<Double> allCost = new AtomicReference<>(0.0); |
|
|
|
|
AtomicReference<Double> calculateAnnualCarbon = new AtomicReference<>(0.0); |
|
|
|
|
AtomicReference<Double> electric = new AtomicReference<>(0.0); |
|
|
|
|
matchedDeviceList.parallelStream().forEach((matchedDevice -> { |
|
|
|
|
planInfos.set(planInfos.get() + "设备: " + matchedDevice.getDeviceHeatScene().getDevType() + ",技术: " + matchedDevice.getDeviceHeatScene().getDevTechType() + ",数量 = " + matchedDevice.getCount() + "。"); |
|
|
|
|
devTechType.set(devTechType.get() + "设备: " + matchedDevice.getDeviceHeatScene().getDevType() + ",技术: " + matchedDevice.getDeviceHeatScene().getDevTechType() + "。"); |
|
|
|
|
devSubType.set(devSubType.get() + "设备: " + matchedDevice.getDeviceHeatScene().getDevType() + ",设备细类: " + matchedDevice.getDeviceHeatScene().getDevSubType() + "。"); |
|
|
|
|
devCount.set(devCount.get() + "设备: " + matchedDevice.getDeviceHeatScene().getDevType() + ",数量 = " + matchedDevice.getCount() + "。"); |
|
|
|
|
devPrice.set(devPrice.get() + "设备: " + matchedDevice.getDeviceHeatScene().getDevType() + ",单价 = " + matchedDevice.getDeviceHeatScene().getDevPrice() + "。"); |
|
|
|
|
startCost.set(startCost.get() + (matchedDevice.getCount() * matchedDevice.getDeviceHeatScene().getDevPrice())); |
|
|
|
|
runCost.set(runCost.get() + (BuildHeatingModel.getRunCost(matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPower(), days, matchedDevice.getDeviceHeatScene().getDevSubstituteLaborCost()))); |
|
|
|
|
allCost.set(allCost.get() + (BuildHeatingModel.getYearCost(matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPrice(), matchedDevice.getDeviceHeatScene().getDevServiceLife(), matchedDevice.getDeviceHeatScene().getDevPower(), days, matchedDevice.getDeviceHeatScene().getDevSubstituteLaborCost()))); |
|
|
|
|
calculateAnnualCarbon.set(calculateAnnualCarbon.get() + (BuildHeatingModel.calculateAnnualCarbonReduction(lastYearFee, matchedDevice.getDeviceHeatScene().getLaborCost(), matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPower(), days))); |
|
|
|
|
electric.set(electric.get() + (BuildHeatingModel.getElectric(matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPower(), days))); |
|
|
|
|
})); |
|
|
|
|
jsonObject.put("startCost", decimalFormat.format(startCost.get())); |
|
|
|
|
jsonObject.put("yearRunCost", decimalFormat.format(runCost.get())); |
|
|
|
|
jsonObject.put("yearCost", decimalFormat.format(allCost.get())); |
|
|
|
|
jsonObject.put("calculate", decimalFormat.format(calculateAnnualCarbon.get())); |
|
|
|
|
jsonObject.put("electric", decimalFormat.format(electric.get())); |
|
|
|
|
jsonObject.put("planInfos", planInfos.get().replace("null","")); |
|
|
|
|
jsonObject.put("devTechType", devTechType.get().replace("null","")); |
|
|
|
|
jsonObject.put("devSubType", devSubType.get().replace("null","")); |
|
|
|
|
jsonObject.put("devCount", devCount.get().replace("null","")); |
|
|
|
|
jsonObject.put("devPrice", devPrice.get().replace("null","")); |
|
|
|
|
jsonObject.put("devCost", decimalFormat.format(startCost.get())); |
|
|
|
|
jsonObject.put("safety", "精准控温"); |
|
|
|
|
Double startCost = 0.0; |
|
|
|
|
Double runCost = 0.0; |
|
|
|
|
Double allCost = 0.0; |
|
|
|
|
Double calculateAnnualCarbon = 0.0; |
|
|
|
|
Double electric = 0.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<HashMap<String,Object>> deviceList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
//封装整体情况
|
|
|
|
|
for (MatchedDevice matchedDevice : matchedDeviceList){ |
|
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("devSubType",matchedDevice.getDeviceHeatScene().getDevSubType()); |
|
|
|
|
map.put("devTechType",matchedDevice.getDeviceHeatScene().getDevTechType()); |
|
|
|
|
map.put("devCount",matchedDevice.getCount()); |
|
|
|
|
map.put("devPrice",matchedDevice.getDeviceHeatScene().getDevPrice()); |
|
|
|
|
deviceList.add(map); |
|
|
|
|
startCost = startCost + (matchedDevice.getCount() * matchedDevice.getDeviceHeatScene().getDevPrice()); |
|
|
|
|
runCost = runCost + (BuildHeatingModel.getRunCost(matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPower(), days, matchedDevice.getDeviceHeatScene().getDevSubstituteLaborCost())); |
|
|
|
|
allCost = allCost + (BuildHeatingModel.getYearCost(matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPrice(), matchedDevice.getDeviceHeatScene().getDevServiceLife(), matchedDevice.getDeviceHeatScene().getDevPower(), days, matchedDevice.getDeviceHeatScene().getDevSubstituteLaborCost())); |
|
|
|
|
calculateAnnualCarbon = calculateAnnualCarbon + (BuildHeatingModel.calculateAnnualCarbonReduction(lastYearFee, matchedDevice.getDeviceHeatScene().getLaborCost(), matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPower(), days)); |
|
|
|
|
electric = electric + (BuildHeatingModel.getElectric(matchedDevice.getCount(), matchedDevice.getDeviceHeatScene().getDevPower(), days)); |
|
|
|
|
} |
|
|
|
|
//初次投资费用
|
|
|
|
|
jsonObject.put("startCost", decimalFormat.format(startCost)); |
|
|
|
|
//年运行费用
|
|
|
|
|
jsonObject.put("yearRunCost", decimalFormat.format(runCost)); |
|
|
|
|
//年总费用
|
|
|
|
|
jsonObject.put("yearCost", decimalFormat.format(allCost)); |
|
|
|
|
//年减碳量
|
|
|
|
|
jsonObject.put("calculate", decimalFormat.format(calculateAnnualCarbon)); |
|
|
|
|
//替代电量
|
|
|
|
|
jsonObject.put("electric", decimalFormat.format(electric)); |
|
|
|
|
//封装需配置设备情况
|
|
|
|
|
jsonObject.put("deviceList",deviceList); |
|
|
|
|
|
|
|
|
|
//封装方案优势
|
|
|
|
|
jsonObject.put("safety", BuildHeatingAdvantage.safety()); |
|
|
|
|
jsonObject.put("economy", BuildHeatingAdvantage.economy(startCost, allCost, runCost, lastYearFee)); |
|
|
|
|
jsonObject.put("intelligence", BuildHeatingAdvantage.intelligence()); |
|
|
|
|
jsonObject.put("environment", BuildHeatingAdvantage.environment(Double.valueOf(decimalFormat.format(calculateAnnualCarbon)))); |
|
|
|
|
|
|
|
|
|
//封装方案评分
|
|
|
|
|
jsonObject.put("matchedDeviceList", maps); |
|
|
|
|
jsonObject.put("economy", Advantage.economy(startCost.get(), allCost.get(), runCost.get(), lastYearFee)); |
|
|
|
|
jsonObject.put("intelligence", Advantage.intelligence()); |
|
|
|
|
jsonObject.put("environment", Advantage.environment(Double.valueOf(decimalFormat.format(calculateAnnualCarbon.get())))); |
|
|
|
|
|
|
|
|
|
return jsonObject; |
|
|
|
|
} |
|
|
|
|