parent
e6c3164bb0
commit
2725199dd2
@ -1,13 +1,41 @@ |
|||||||
package com.dky.calculate; |
package com.dky.calculate; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import com.dky.utils.result.MatchedDevice; |
import com.dky.utils.result.MatchedDevice; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.HashMap; |
||||||
import java.util.List; |
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
public class CalC { |
public class CalC { |
||||||
//投入供热设备总功率计算
|
|
||||||
public double calTotalPower(List<MatchedDevice> matchedDevices,Double buildArea) { |
|
||||||
|
|
||||||
return floor * heatArea * devPrice; |
public static List<Map<String, Double>> getC(List<Map<String, List<List<MatchedDevice>>>> list) { |
||||||
|
List<Map<String, Double>> maps = new ArrayList<>(); |
||||||
|
list.parallelStream().forEach(stringListMap -> { |
||||||
|
// 区分热泵、电锅炉
|
||||||
|
stringListMap.forEach((k,v)->{ |
||||||
|
// 循环遍历各个方案
|
||||||
|
final Double[] maxPower = {0.0}; |
||||||
|
v.parallelStream().forEach((plan)->{ |
||||||
|
Double power = 0.0; |
||||||
|
for (MatchedDevice device : plan){ |
||||||
|
power = power + (device.getCount() * device.getDeviceHeatScene().getDevPower()) ; |
||||||
|
} |
||||||
|
if (power >= maxPower[0]){ |
||||||
|
maxPower[0] = power; |
||||||
|
} |
||||||
|
}); |
||||||
|
Map<String, Double> map = new HashMap<>(); |
||||||
|
map.put(k, maxPower[0]); |
||||||
|
maps.add(map); |
||||||
|
}); |
||||||
|
}); |
||||||
|
return maps; |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
|
@ -0,0 +1,30 @@ |
|||||||
|
package com.dky.calculate; |
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
public class CalD { |
||||||
|
|
||||||
|
/** |
||||||
|
* 改造后最大需量 |
||||||
|
* @param lastYearNeed 上年最大需量 |
||||||
|
* @param list 设备总功率集合 |
||||||
|
*/ |
||||||
|
public static List<Map> getD(Double lastYearNeed, List<Map<String, Double>> list) { |
||||||
|
List<Map> maps = new ArrayList<>(); |
||||||
|
list.parallelStream().forEach((s)->{ |
||||||
|
Map<String, Double> map = new HashMap<>(); |
||||||
|
s.forEach((k,v)->{ |
||||||
|
map.put(k, lastYearNeed + v); |
||||||
|
maps.add(map); |
||||||
|
}); |
||||||
|
}); |
||||||
|
return maps; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -1,35 +1,59 @@ |
|||||||
package com.dky.calculate; |
package com.dky.calculate; |
||||||
|
|
||||||
|
|
||||||
import com.dky.utils.entity.SysDeviceHeatScene; |
import com.dky.utils.entity.SysDeviceHeatScene; |
||||||
import com.dky.utils.result.MatchedDevice; |
import com.dky.utils.result.MatchedDevice; |
||||||
|
|
||||||
import java.util.ArrayList; |
import java.util.ArrayList; |
||||||
|
import java.util.HashMap; |
||||||
import java.util.List; |
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
public class Scheme { |
public class Scheme { |
||||||
|
|
||||||
public List<MatchedDevice> calSchemeByTechType(Double buildArea, List<SysDeviceHeatScene> deviceList, String techType){ |
public static List<Map<String, List<List<MatchedDevice>>>> calScheme(Double buildArea, List<SysDeviceHeatScene> list) { |
||||||
|
// 区分电锅炉、热泵
|
||||||
|
Map<String, List<SysDeviceHeatScene>> grouped = list.stream() |
||||||
|
.collect(Collectors.groupingBy(SysDeviceHeatScene::getDevSubType)); |
||||||
|
List<Map<String, List<List<MatchedDevice>>>> maps = new ArrayList<>(); |
||||||
|
// 区分技术类型
|
||||||
|
grouped.forEach((k, v) -> { |
||||||
|
Map<String, List<List<MatchedDevice>>> map = new HashMap<>(); |
||||||
|
List<List<MatchedDevice>> planList = new ArrayList<>(); |
||||||
|
Map<String, List<SysDeviceHeatScene>> collect = v.stream().collect(Collectors.groupingBy(SysDeviceHeatScene::getDevTechType)); |
||||||
|
collect.forEach((k2, v2) -> { |
||||||
|
List<MatchedDevice> matchedDevices = calSchemeByTechType(buildArea, v2); |
||||||
|
planList.add(matchedDevices); |
||||||
|
}); |
||||||
|
map.put(k, planList); |
||||||
|
maps.add(map); |
||||||
|
}); |
||||||
|
return maps; |
||||||
|
} |
||||||
|
|
||||||
List<SysDeviceHeatScene> list = new ArrayList(); |
public static List<MatchedDevice> calSchemeByTechType(Double buildArea, List<SysDeviceHeatScene> list) { |
||||||
for (int i = 0; i < deviceList.size(); i++){ |
// 对List按照单台设备可参考供暖面积进行排序
|
||||||
if (deviceList.get(i).getDevTechType().equals(techType)){ |
list.sort((o1, o2) -> Double.compare(o2.getDevReferenceArea(), o1.getDevReferenceArea())); |
||||||
list.add(deviceList.get(i)); |
|
||||||
} |
|
||||||
} |
|
||||||
//对list按照单台设备可参考供暖面积进行排序
|
|
||||||
list.sort((o1, o2) -> Double.compare(o2.getDevReferenceArea(),o1.getDevReferenceArea())); |
|
||||||
Double remainArea = buildArea; |
Double remainArea = buildArea; |
||||||
//遍历设备,根据建筑面积进行匹配设备数量
|
// 遍历设备,根据建筑面积进行匹配设备数量
|
||||||
List<MatchedDevice> matchedDeviceList = new ArrayList(); |
List<MatchedDevice> matchedDeviceList = new ArrayList<>(); |
||||||
for (SysDeviceHeatScene deviceHeatScene:list){ |
for (SysDeviceHeatScene deviceHeatScene : list) { |
||||||
if (deviceHeatScene.getDevReferenceArea() <= remainArea){ |
double v = remainArea / deviceHeatScene.getDevReferenceArea(); |
||||||
int count = (int) (buildArea/deviceHeatScene.getDevReferenceArea()); |
int count = (int) (v); |
||||||
remainArea = remainArea - count*deviceHeatScene.getDevReferenceArea(); |
if (v < 1){ |
||||||
matchedDeviceList.add(new MatchedDevice(deviceHeatScene,count)); |
count = count + 1; |
||||||
} |
} |
||||||
if (remainArea <= 0) { |
remainArea = remainArea - count * deviceHeatScene.getDevReferenceArea(); |
||||||
break; // 当总供暖面积已经满足需求时,跳出循环,不再选择其他设备
|
matchedDeviceList.add(new MatchedDevice(count, deviceHeatScene)); |
||||||
|
if (remainArea <= 0){ |
||||||
|
// 当总供暖面积已经满足需求时,跳出循环,不再选择其他设备
|
||||||
|
break; |
||||||
} |
} |
||||||
} |
} |
||||||
return matchedDeviceList; |
return matchedDeviceList; |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
|
@ -0,0 +1,93 @@ |
|||||||
|
package com.dky.calculate; |
||||||
|
|
||||||
|
|
||||||
|
import com.dky.utils.result.MatchedDevice; |
||||||
|
|
||||||
|
import java.util.*; |
||||||
|
import java.util.concurrent.atomic.AtomicReference; |
||||||
|
|
||||||
|
public class SchemeRating { |
||||||
|
|
||||||
|
|
||||||
|
public static Map<Double, List<MatchedDevice>> getOptimalList(List<Map<String, List<List<MatchedDevice>>>> list) { |
||||||
|
Map<Double, List<MatchedDevice>> optimalMap = new HashMap<>(); |
||||||
|
list.parallelStream().forEach(stringListMap -> { |
||||||
|
// 区分热泵、电锅炉
|
||||||
|
stringListMap.forEach((k,v)->{ |
||||||
|
// 循环遍历各个方案
|
||||||
|
v.parallelStream().forEach((plan)->{ |
||||||
|
AtomicReference<Double> rating = new AtomicReference<>(0.0); |
||||||
|
List<Map<String, Double[]>> maps = getIndex(list); |
||||||
|
for (Map<String, Double[]> map : maps) { |
||||||
|
map.forEach((k1, v1) -> { |
||||||
|
if (k1.equals(k)){ |
||||||
|
Double eff = 0.0; |
||||||
|
Double cost = 0.0; |
||||||
|
for (MatchedDevice device : plan) { |
||||||
|
eff = device.getDeviceHeatScene().getHeatEfficiency(); |
||||||
|
} |
||||||
|
for (MatchedDevice device : plan) { |
||||||
|
cost = cost + ((device.getCount() * device.getDeviceHeatScene().getDevPrice()) + (device.getCount()) * device.getDeviceHeatScene().getDevSubstituteLaborCost() * device.getDeviceHeatScene().getDevServiceLife()); |
||||||
|
} |
||||||
|
rating.set(((1 - ((v1[0] - eff) / v1[0])) * 100 * 0.8) + ((1 - ((cost - v1[1]) / v1[1])) * 100 * 0.2)); |
||||||
|
System.out.println("方案: " + plan + ",评分 = " + rating + "\n"); |
||||||
|
|
||||||
|
optimalMap.put(rating.get(), plan); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
||||||
|
return optimalMap; |
||||||
|
} |
||||||
|
|
||||||
|
public static List<MatchedDevice> getOptimalScheme(Map<Double, List<MatchedDevice>> map) { |
||||||
|
Set<Double> keySet = map.keySet(); |
||||||
|
Double maxValue = keySet.iterator().next(); |
||||||
|
for (Iterator<Double> iterator = keySet.iterator(); iterator.hasNext(); ) { |
||||||
|
Double value = iterator.next(); |
||||||
|
if (value > maxValue) { |
||||||
|
maxValue = value; |
||||||
|
} |
||||||
|
} |
||||||
|
return map.get(maxValue); |
||||||
|
} |
||||||
|
|
||||||
|
public static List<Map<String, Double[]>> getIndex(List<Map<String, List<List<MatchedDevice>>>> list) { |
||||||
|
List<Map<String, Double[]>> maps = new ArrayList<>(); |
||||||
|
list.parallelStream().forEach(stringListMap -> { |
||||||
|
// 区分热泵、电锅炉
|
||||||
|
stringListMap.forEach((k, v) -> { |
||||||
|
// 循环遍历各个方案
|
||||||
|
// 热效率、成本
|
||||||
|
final Double[] index = {0.0, Double.MAX_VALUE}; |
||||||
|
v.parallelStream().forEach((plan) -> { |
||||||
|
Double eff = 0.0; |
||||||
|
Double cost = 0.0; |
||||||
|
for (MatchedDevice device : plan) { |
||||||
|
eff = device.getDeviceHeatScene().getHeatEfficiency(); |
||||||
|
} |
||||||
|
for (MatchedDevice device : plan) { |
||||||
|
cost = cost + ((device.getCount() * device.getDeviceHeatScene().getDevPrice()) + (device.getCount()) * device.getDeviceHeatScene().getDevSubstituteLaborCost() * device.getDeviceHeatScene().getDevServiceLife()); |
||||||
|
} |
||||||
|
if (eff >= index[0]) { |
||||||
|
index[0] = eff; |
||||||
|
} |
||||||
|
if (cost <= index[1]) { |
||||||
|
index[1] = cost; |
||||||
|
} |
||||||
|
}); |
||||||
|
Map<String, Double[]> map = new HashMap<>(); |
||||||
|
map.put(k, index); |
||||||
|
maps.add(map); |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
return maps; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -1,27 +0,0 @@ |
|||||||
package com.dky.entity; |
|
||||||
|
|
||||||
|
|
||||||
public class Construction { |
|
||||||
|
|
||||||
// 建筑类型(1机关,2医院,3学校,4商业办公楼,5酒店,6其他)
|
|
||||||
private Integer constrType; |
|
||||||
|
|
||||||
// 建筑面积(平方米)
|
|
||||||
private Double floor; |
|
||||||
|
|
||||||
public Integer getConstrType() { |
|
||||||
return constrType; |
|
||||||
} |
|
||||||
|
|
||||||
public void setConstrType(Integer constrType) { |
|
||||||
this.constrType = constrType; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getFloor() { |
|
||||||
return floor; |
|
||||||
} |
|
||||||
|
|
||||||
public void setFloor(Double floor) { |
|
||||||
this.floor = floor; |
|
||||||
} |
|
||||||
} |
|
@ -1,147 +0,0 @@ |
|||||||
package com.dky.entity; |
|
||||||
|
|
||||||
|
|
||||||
public class CoolHeat { |
|
||||||
|
|
||||||
// 年采暖时间(天)
|
|
||||||
private Integer yearGetHeatDays; |
|
||||||
|
|
||||||
// 是否有蒸汽/生活热水需求(1是,2否)
|
|
||||||
private Integer isHeatWater; |
|
||||||
|
|
||||||
// 每小时最大需求量(吨蒸汽)
|
|
||||||
private Double hourMaxXqlDZQ; |
|
||||||
|
|
||||||
// 每小时最大需求量(吨热水)
|
|
||||||
private Double hourMaxXqlDRS; |
|
||||||
|
|
||||||
// 是否有供冷需求(1是,2否)
|
|
||||||
private Integer isCool; |
|
||||||
|
|
||||||
// 年供冷时间(天)
|
|
||||||
private Integer yearGetCoolDays; |
|
||||||
|
|
||||||
// 末端形式(1风机盘管,2地暖,3暖气片,4无末端)
|
|
||||||
private Integer endForm; |
|
||||||
|
|
||||||
// 单台电锅炉的需求功率
|
|
||||||
private Double needPower; |
|
||||||
|
|
||||||
// 单台电设备参考的可供暖面积
|
|
||||||
private Double heatArea; |
|
||||||
|
|
||||||
// 单台电设备价格
|
|
||||||
private Double devPrice; |
|
||||||
|
|
||||||
// 电替代设备人工费用成本
|
|
||||||
private Double laborCost; |
|
||||||
|
|
||||||
// 电锅炉的使用年限
|
|
||||||
private Integer useYears; |
|
||||||
|
|
||||||
private OriginalDevice originalDevice; |
|
||||||
|
|
||||||
public Integer getYearGetHeatDays() { |
|
||||||
return yearGetHeatDays; |
|
||||||
} |
|
||||||
|
|
||||||
public void setYearGetHeatDays(Integer yearGetHeatDays) { |
|
||||||
this.yearGetHeatDays = yearGetHeatDays; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getIsHeatWater() { |
|
||||||
return isHeatWater; |
|
||||||
} |
|
||||||
|
|
||||||
public void setIsHeatWater(Integer isHeatWater) { |
|
||||||
this.isHeatWater = isHeatWater; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getHourMaxXqlDZQ() { |
|
||||||
return hourMaxXqlDZQ; |
|
||||||
} |
|
||||||
|
|
||||||
public void setHourMaxXqlDZQ(Double hourMaxXqlDZQ) { |
|
||||||
this.hourMaxXqlDZQ = hourMaxXqlDZQ; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getHourMaxXqlDRS() { |
|
||||||
return hourMaxXqlDRS; |
|
||||||
} |
|
||||||
|
|
||||||
public void setHourMaxXqlDRS(Double hourMaxXqlDRS) { |
|
||||||
this.hourMaxXqlDRS = hourMaxXqlDRS; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getIsCool() { |
|
||||||
return isCool; |
|
||||||
} |
|
||||||
|
|
||||||
public void setIsCool(Integer isCool) { |
|
||||||
this.isCool = isCool; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getYearGetCoolDays() { |
|
||||||
return yearGetCoolDays; |
|
||||||
} |
|
||||||
|
|
||||||
public void setYearGetCoolDays(Integer yearGetCoolDays) { |
|
||||||
this.yearGetCoolDays = yearGetCoolDays; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getEndForm() { |
|
||||||
return endForm; |
|
||||||
} |
|
||||||
|
|
||||||
public void setEndForm(Integer endForm) { |
|
||||||
this.endForm = endForm; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getNeedPower() { |
|
||||||
return needPower; |
|
||||||
} |
|
||||||
|
|
||||||
public void setNeedPower(Double needPower) { |
|
||||||
this.needPower = needPower; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getHeatArea() { |
|
||||||
return heatArea; |
|
||||||
} |
|
||||||
|
|
||||||
public void setHeatArea(Double heatArea) { |
|
||||||
this.heatArea = heatArea; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getDevPrice() { |
|
||||||
return devPrice; |
|
||||||
} |
|
||||||
|
|
||||||
public void setDevPrice(Double devPrice) { |
|
||||||
this.devPrice = devPrice; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getLaborCost() { |
|
||||||
return laborCost; |
|
||||||
} |
|
||||||
|
|
||||||
public void setLaborCost(Double laborCost) { |
|
||||||
this.laborCost = laborCost; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getUseYears() { |
|
||||||
return useYears; |
|
||||||
} |
|
||||||
|
|
||||||
public void setUseYears(Integer useYears) { |
|
||||||
this.useYears = useYears; |
|
||||||
} |
|
||||||
|
|
||||||
public OriginalDevice getOriginalDevice() { |
|
||||||
return originalDevice; |
|
||||||
} |
|
||||||
|
|
||||||
public void setOriginalDevice(OriginalDevice originalDevice) { |
|
||||||
this.originalDevice = originalDevice; |
|
||||||
} |
|
||||||
} |
|
@ -1,8 +0,0 @@ |
|||||||
package com.dky.entity; |
|
||||||
|
|
||||||
public class HeatingDevice { |
|
||||||
|
|
||||||
//id
|
|
||||||
private String id; |
|
||||||
//
|
|
||||||
} |
|
@ -1,68 +0,0 @@ |
|||||||
package com.dky.entity; |
|
||||||
|
|
||||||
|
|
||||||
public class OriginalDevice { |
|
||||||
|
|
||||||
// 设备类型(1锅炉,2市政)
|
|
||||||
private String deviceType; |
|
||||||
// 设备数量(台)
|
|
||||||
private Integer deviceNum; |
|
||||||
// 功能(1供暖,2供冷,3热水)
|
|
||||||
private Integer deviceFun; |
|
||||||
// 设备能源类型(1煤,2油,3气,4汽)
|
|
||||||
private String deviceEnergyType; |
|
||||||
// 上年运行费用(万元)
|
|
||||||
private Double lastYearFee; |
|
||||||
// 原设备的人工费用(万元)
|
|
||||||
private Double oldDaborCost; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getDeviceType() { |
|
||||||
return deviceType; |
|
||||||
} |
|
||||||
|
|
||||||
public void setDeviceType(String deviceType) { |
|
||||||
this.deviceType = deviceType; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getDeviceNum() { |
|
||||||
return deviceNum; |
|
||||||
} |
|
||||||
|
|
||||||
public void setDeviceNum(Integer deviceNum) { |
|
||||||
this.deviceNum = deviceNum; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getDeviceFun() { |
|
||||||
return deviceFun; |
|
||||||
} |
|
||||||
|
|
||||||
public void setDeviceFun(Integer deviceFun) { |
|
||||||
this.deviceFun = deviceFun; |
|
||||||
} |
|
||||||
|
|
||||||
public String getDeviceEnergyType() { |
|
||||||
return deviceEnergyType; |
|
||||||
} |
|
||||||
|
|
||||||
public void setDeviceEnergyType(String deviceEnergyType) { |
|
||||||
this.deviceEnergyType = deviceEnergyType; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getLastYearFee() { |
|
||||||
return lastYearFee; |
|
||||||
} |
|
||||||
|
|
||||||
public void setLastYearFee(Double lastYearFee) { |
|
||||||
this.lastYearFee = lastYearFee; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getOldDaborCost() { |
|
||||||
return oldDaborCost; |
|
||||||
} |
|
||||||
|
|
||||||
public void setOldDaborCost(Double oldDaborCost) { |
|
||||||
this.oldDaborCost = oldDaborCost; |
|
||||||
} |
|
||||||
} |
|
@ -1,38 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
||||||
<parent> |
|
||||||
<artifactId>dntd-model-tools</artifactId> |
|
||||||
<groupId>com.dky</groupId> |
|
||||||
<version>1.0-SNAPSHOT</version> |
|
||||||
</parent> |
|
||||||
<modelVersion>4.0.0</modelVersion> |
|
||||||
|
|
||||||
<artifactId>dntd-model-madekiln</artifactId> |
|
||||||
|
|
||||||
<properties> |
|
||||||
<maven.compiler.source>8</maven.compiler.source> |
|
||||||
<maven.compiler.target>8</maven.compiler.target> |
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|
||||||
</properties> |
|
||||||
|
|
||||||
<dependencies> |
|
||||||
<dependency> |
|
||||||
<groupId>cn.hutool</groupId> |
|
||||||
<artifactId>hutool-all</artifactId> |
|
||||||
<version>5.4.5</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>com.dky</groupId> |
|
||||||
<artifactId>dntd-modelI</artifactId> |
|
||||||
<version>1.0-SNAPSHOT</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>com.dky</groupId> |
|
||||||
<artifactId>dntd-common</artifactId> |
|
||||||
<version>1.0-SNAPSHOT</version> |
|
||||||
</dependency> |
|
||||||
</dependencies> |
|
||||||
|
|
||||||
</project> |
|
@ -1,92 +0,0 @@ |
|||||||
package com.dky.calculate; |
|
||||||
|
|
||||||
|
|
||||||
public class Overall { |
|
||||||
|
|
||||||
/** |
|
||||||
* 初次投资费用(万元) |
|
||||||
* @param yearOut 预计年产量 |
|
||||||
* @param madeHours 单台电设备制造一批产品的周期小时 |
|
||||||
* @param proOut 单台电设备制造一批产品的产量 |
|
||||||
* @param runHours 单台设备年运行时间 |
|
||||||
* @param devicePrice 单台电设备价格 |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
public Double investment(Double yearOut, |
|
||||||
Integer madeHours, |
|
||||||
Integer proOut, |
|
||||||
Integer runHours, |
|
||||||
Double devicePrice){ |
|
||||||
double d1 = yearOut * madeHours; |
|
||||||
double d2 = proOut * runHours; |
|
||||||
int remainder = (int)(d1/d2) + (d1%d2==0?0:1); |
|
||||||
return remainder * devicePrice; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 年运行费用(万元) |
|
||||||
* @param deviceNum 电设备设备台数 |
|
||||||
* @param devicePower 单台电设备的功率 |
|
||||||
* @param days 电设备年运行时间 |
|
||||||
* @param laborCost 电替代设备人工费用成本 |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
public Double getRunCost(Integer deviceNum, |
|
||||||
Double devicePower, |
|
||||||
Integer days, |
|
||||||
Double laborCost){ |
|
||||||
return deviceNum * devicePower * days * 0.5 + laborCost; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 年总费用(万元) |
|
||||||
* @param deviceNum 电设备设备台数 |
|
||||||
* @param devicePrice 单台电设备价格 |
|
||||||
* @param useYears 使用年限 |
|
||||||
* @param devicePower 单台电设备的功率 |
|
||||||
* @param days 电设备年运行时间(天) |
|
||||||
* @param laborCost 电替代设备人工费用成本 |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
public Double getYearCost(Integer deviceNum, |
|
||||||
Double devicePrice, |
|
||||||
Integer useYears, |
|
||||||
Double devicePower, |
|
||||||
Integer days, |
|
||||||
Double laborCost){ |
|
||||||
double run = deviceNum * devicePower * days * 0.5 + laborCost; |
|
||||||
return ((deviceNum * devicePrice) / useYears) + run; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 年减碳 |
|
||||||
* @param lastYearFee 上年运行费用(万元) |
|
||||||
* @param oldDaborCost 原设备的人工费用(万元) |
|
||||||
* @param deviceNum 电锅炉设备台数 |
|
||||||
* @param devicePower 单台电锅炉的功率 |
|
||||||
* @param days 年采暖(供冷)时间(天) |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
public Double calculateAnnualCarbonReduction(Double lastYearFee, |
|
||||||
Double oldDaborCost, |
|
||||||
Integer deviceNum, |
|
||||||
Double devicePower, |
|
||||||
Integer days){ |
|
||||||
double d1 = (((lastYearFee - oldDaborCost) / 0.9) * 0.7143); |
|
||||||
double d2 = deviceNum * devicePower * days ; |
|
||||||
return (d1 - (d2 * 0.1229)) * 1.9003; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 替代电量(千瓦时) |
|
||||||
* @param deviceNum 电锅炉设备台数 |
|
||||||
* @param devicePower 单台电锅炉的功率 |
|
||||||
* @param days 年采暖(供冷)时间(天) |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
public Double getElectric(Integer deviceNum, |
|
||||||
Double devicePower, |
|
||||||
Integer days){ |
|
||||||
return deviceNum * devicePower * days ; |
|
||||||
} |
|
||||||
} |
|
@ -1,116 +0,0 @@ |
|||||||
package com.dky.entity; |
|
||||||
|
|
||||||
|
|
||||||
public class MadeKiln { |
|
||||||
|
|
||||||
// 电替代设备的功率
|
|
||||||
private Double devicePower; |
|
||||||
// 单台电设备制造一批产品的周期(小时)
|
|
||||||
private Integer madeHours; |
|
||||||
// 单台电设备制造一批产品的产量
|
|
||||||
private Integer proOut; |
|
||||||
// 单台电设备价格
|
|
||||||
private Double devPrice; |
|
||||||
// 电替代设备人工费用
|
|
||||||
private Double laborCost; |
|
||||||
// 电设备年运行时间
|
|
||||||
private Double runHours; |
|
||||||
// 制造类型(1金属,2陶瓷,3其它)
|
|
||||||
private Integer madeType; |
|
||||||
// 预计年产量(吨)
|
|
||||||
private Double yearOut; |
|
||||||
// 工作容积(升)(合计)
|
|
||||||
private Double volAge; |
|
||||||
// 温度要求(摄氏度)
|
|
||||||
private Double needTemp; |
|
||||||
|
|
||||||
private OriginalDevice originalDevice; |
|
||||||
|
|
||||||
public Double getDevicePower() { |
|
||||||
return devicePower; |
|
||||||
} |
|
||||||
|
|
||||||
public void setDevicePower(Double devicePower) { |
|
||||||
this.devicePower = devicePower; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getMadeHours() { |
|
||||||
return madeHours; |
|
||||||
} |
|
||||||
|
|
||||||
public void setMadeHours(Integer madeHours) { |
|
||||||
this.madeHours = madeHours; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getProOut() { |
|
||||||
return proOut; |
|
||||||
} |
|
||||||
|
|
||||||
public void setProOut(Integer proOut) { |
|
||||||
this.proOut = proOut; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getDevPrice() { |
|
||||||
return devPrice; |
|
||||||
} |
|
||||||
|
|
||||||
public void setDevPrice(Double devPrice) { |
|
||||||
this.devPrice = devPrice; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getLaborCost() { |
|
||||||
return laborCost; |
|
||||||
} |
|
||||||
|
|
||||||
public void setLaborCost(Double laborCost) { |
|
||||||
this.laborCost = laborCost; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getRunHours() { |
|
||||||
return runHours; |
|
||||||
} |
|
||||||
|
|
||||||
public void setRunHours(Double runHours) { |
|
||||||
this.runHours = runHours; |
|
||||||
} |
|
||||||
|
|
||||||
public Integer getMadeType() { |
|
||||||
return madeType; |
|
||||||
} |
|
||||||
|
|
||||||
public void setMadeType(Integer madeType) { |
|
||||||
this.madeType = madeType; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getYearOut() { |
|
||||||
return yearOut; |
|
||||||
} |
|
||||||
|
|
||||||
public void setYearOut(Double yearOut) { |
|
||||||
this.yearOut = yearOut; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getVolAge() { |
|
||||||
return volAge; |
|
||||||
} |
|
||||||
|
|
||||||
public void setVolAge(Double volAge) { |
|
||||||
this.volAge = volAge; |
|
||||||
} |
|
||||||
|
|
||||||
public Double getNeedTemp() { |
|
||||||
return needTemp; |
|
||||||
} |
|
||||||
|
|
||||||
public void setNeedTemp(Double needTemp) { |
|
||||||
this.needTemp = needTemp; |
|
||||||
} |
|
||||||
|
|
||||||
public OriginalDevice getOriginalDevice() { |
|
||||||
return originalDevice; |
|
||||||
} |
|
||||||
|
|
||||||
public void setOriginalDevice(OriginalDevice originalDevice) { |
|
||||||
this.originalDevice = originalDevice; |
|
||||||
} |
|
||||||
} |
|
@ -1,52 +0,0 @@ |
|||||||
package com.dky.entity; |
|
||||||
|
|
||||||
|
|
||||||
public class OriginalDevice { |
|
||||||
|
|
||||||
private int equipmentType; // 设备类型(1锅炉,2窑炉,3灶台)
|
|
||||||
private int quantity; // 台数(台)
|
|
||||||
private int energyType; // 能源类型(1煤,2油,3气)
|
|
||||||
private double previousYearOperatingCost; // 上年运行费用(万元)
|
|
||||||
|
|
||||||
private double oldLaborCost; // 原设备的人工费用
|
|
||||||
|
|
||||||
public double getOldLaborCost() { |
|
||||||
return oldLaborCost; |
|
||||||
} |
|
||||||
|
|
||||||
public void setOldLaborCost(double oldLaborCost) { |
|
||||||
this.oldLaborCost = oldLaborCost; |
|
||||||
} |
|
||||||
|
|
||||||
public int getEquipmentType() { |
|
||||||
return equipmentType; |
|
||||||
} |
|
||||||
|
|
||||||
public void setEquipmentType(int equipmentType) { |
|
||||||
this.equipmentType = equipmentType; |
|
||||||
} |
|
||||||
|
|
||||||
public int getQuantity() { |
|
||||||
return quantity; |
|
||||||
} |
|
||||||
|
|
||||||
public void setQuantity(int quantity) { |
|
||||||
this.quantity = quantity; |
|
||||||
} |
|
||||||
|
|
||||||
public int getEnergyType() { |
|
||||||
return energyType; |
|
||||||
} |
|
||||||
|
|
||||||
public void setEnergyType(int energyType) { |
|
||||||
this.energyType = energyType; |
|
||||||
} |
|
||||||
|
|
||||||
public double getPreviousYearOperatingCost() { |
|
||||||
return previousYearOperatingCost; |
|
||||||
} |
|
||||||
|
|
||||||
public void setPreviousYearOperatingCost(double previousYearOperatingCost) { |
|
||||||
this.previousYearOperatingCost = previousYearOperatingCost; |
|
||||||
} |
|
||||||
} |
|
@ -1,63 +0,0 @@ |
|||||||
package com.dky; |
|
||||||
|
|
||||||
import cn.hutool.json.JSONArray; |
|
||||||
import cn.hutool.json.JSONObject; |
|
||||||
import com.dky.tool.ModelTool; |
|
||||||
import com.dky.utils.entity.DevPrice; |
|
||||||
import com.dky.utils.entity.DevSpec; |
|
||||||
|
|
||||||
public class Test { |
|
||||||
public static void main(String[] args) { |
|
||||||
JSONObject list = new JSONObject(); |
|
||||||
JSONArray devSpecList = new JSONArray(); |
|
||||||
JSONArray devPriceList = new JSONArray(); |
|
||||||
DevSpec specObj1 = new DevSpec(); |
|
||||||
DevSpec specObj2 = new DevSpec(); |
|
||||||
DevSpec specObj3 = new DevSpec(); |
|
||||||
specObj1.setId(1L); |
|
||||||
specObj1.setTechnologyType("直热式电锅炉"); |
|
||||||
specObj1.setHeatingArea(1.5); |
|
||||||
specObj2.setId(2L); |
|
||||||
specObj2.setTechnologyType("直热式电锅炉"); |
|
||||||
specObj2.setHeatingArea(2.5); |
|
||||||
specObj3.setId(3L); |
|
||||||
specObj3.setTechnologyType("直热式电锅炉"); |
|
||||||
specObj3.setHeatingArea(3.0); |
|
||||||
devSpecList.add(specObj1); |
|
||||||
devSpecList.add(specObj2); |
|
||||||
devSpecList.add(specObj3); |
|
||||||
list.put("devSpecList",devSpecList); |
|
||||||
DevPrice devPrice1 = new DevPrice(); |
|
||||||
DevPrice devPrice2 = new DevPrice(); |
|
||||||
DevPrice devPrice3 = new DevPrice(); |
|
||||||
devPrice1.setId(1); |
|
||||||
devPrice1.setDevType("直热式电锅炉"); |
|
||||||
devPrice1.setDevPrice(0.05); |
|
||||||
devPrice2.setId(2); |
|
||||||
devPrice2.setDevType("直热式电锅炉"); |
|
||||||
devPrice2.setDevPrice(0.06); |
|
||||||
devPrice3.setId(3); |
|
||||||
devPrice3.setDevType("直热式电锅炉"); |
|
||||||
devPrice3.setDevPrice(0.07); |
|
||||||
devPriceList.add(devPrice1); |
|
||||||
devPriceList.add(devPrice2); |
|
||||||
devPriceList.add(devPrice3); |
|
||||||
list.put("devPriceList",devPriceList); |
|
||||||
ModelTool modelTool = new ModelTool(list); |
|
||||||
JSONObject param = new JSONObject(); |
|
||||||
param.put("type", "0101"); |
|
||||||
param.put("exportTemperature", 28); |
|
||||||
param.put("hotMedium", "1"); |
|
||||||
param.put("hotDevicePower", "20.26"); |
|
||||||
param.put("yearEnergy", "20.26"); |
|
||||||
param.put("electricityPrice", "20.26"); |
|
||||||
param.put("originalDevice", new JSONObject() |
|
||||||
.put("deviceType", "1") |
|
||||||
.put("deviceNum", 2) |
|
||||||
.put("deviceEnergyType", "1") |
|
||||||
.put("lastYearFee", "76.25")); |
|
||||||
String key = "GWnQ4RqqTc8n1Uj59xLoUq0YsJLmzgyVzBvI35uj+DaDjdU0HZoU2fCd33JFsVG+3tWpkuojap/b5eeutSp6d4x4juou3yhCF7yhLBqYs1tdr2DF5QqL8uTsLJuKf1Ys8iufExureFAQw+qjMN+W5UlKE5id39PDi2nsPJGUbwkrvkywf2wqaqwZy+i/QBOl"; |
|
||||||
JSONObject jsonObject = ModelTool.exeModel2Report(param,key);//exeModel2Report
|
|
||||||
System.out.println(jsonObject.toString()); |
|
||||||
} |
|
||||||
} |
|
@ -1,2 +1,2 @@ |
|||||||
0101=generate.HeatBoilerSence |
0101=generate.BuildHeatingSence |
||||||
0102=generate.CoolHeatSence |
0102=generate.HeatBoilerSence |
@ -1 +1 @@ |
|||||||
0101=generate.HeatBoilerSence |
|
||||||
|
Loading…
Reference in new issue