master
commit
9f1fee2e04
@ -0,0 +1,38 @@ |
||||
target/ |
||||
!.mvn/wrapper/maven-wrapper.jar |
||||
!**/src/main/**/target/ |
||||
!**/src/test/**/target/ |
||||
|
||||
### IntelliJ IDEA ### |
||||
.idea/modules.xml |
||||
.idea/jarRepositories.xml |
||||
.idea/compiler.xml |
||||
.idea/libraries/ |
||||
*.iws |
||||
*.iml |
||||
*.ipr |
||||
|
||||
### Eclipse ### |
||||
.apt_generated |
||||
.classpath |
||||
.factorypath |
||||
.project |
||||
.settings |
||||
.springBeans |
||||
.sts4-cache |
||||
|
||||
### NetBeans ### |
||||
/nbproject/private/ |
||||
/nbbuild/ |
||||
/dist/ |
||||
/nbdist/ |
||||
/.nb-gradle/ |
||||
build/ |
||||
!**/src/main/**/build/ |
||||
!**/src/test/**/build/ |
||||
|
||||
### VS Code ### |
||||
.vscode/ |
||||
|
||||
### Mac OS ### |
||||
.DS_Store |
@ -0,0 +1,8 @@ |
||||
# 默认忽略的文件 |
||||
/shelf/ |
||||
/workspace.xml |
||||
# 基于编辑器的 HTTP 客户端请求 |
||||
/httpRequests/ |
||||
# Datasource local storage ignored files |
||||
/dataSources/ |
||||
/dataSources.local.xml |
@ -0,0 +1,19 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="Encoding"> |
||||
<file url="file://$PROJECT_DIR$/dntd-common/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-common/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-model-buildsence/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-model-buildsence/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-model-heatboiler/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-model-heatboiler/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-model-traffic/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-model-traffic/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-modelI/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-modelI/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-tool/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/dntd-tool/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> |
||||
</component> |
||||
</project> |
@ -0,0 +1,19 @@ |
||||
<project version="4"> |
||||
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
||||
<component name="MavenProjectsManager"> |
||||
<option name="originalFiles"> |
||||
<list> |
||||
<option value="$PROJECT_DIR$/pom.xml" /> |
||||
</list> |
||||
</option> |
||||
<option name="ignoredFiles"> |
||||
<set> |
||||
<option value="$PROJECT_DIR$/dntd-model-buildsence/pom.xml" /> |
||||
<option value="$PROJECT_DIR$/dntd-model-traffic/pom.xml" /> |
||||
</set> |
||||
</option> |
||||
</component> |
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK"> |
||||
<output url="file://$PROJECT_DIR$/out" /> |
||||
</component> |
||||
</project> |
@ -0,0 +1,6 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="VcsDirectoryMappings"> |
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" /> |
||||
</component> |
||||
</project> |
@ -0,0 +1,28 @@ |
||||
<?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"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<parent> |
||||
<groupId>com.dky</groupId> |
||||
<artifactId>dntd-model-tool1</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
</parent> |
||||
|
||||
<artifactId>dntd-common</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> |
||||
</dependencies> |
||||
|
||||
</project> |
@ -0,0 +1,22 @@ |
||||
package com.dky.utils; |
||||
|
||||
import java.io.*; |
||||
import java.util.Properties; |
||||
|
||||
public class ConfigReader { |
||||
private static Properties prop = new Properties(); |
||||
|
||||
public static String getProperty(String key) { |
||||
InputStream input = ConfigReader.class.getClassLoader().getResourceAsStream("modelCode.properties"); |
||||
if(input!= null) { |
||||
try { |
||||
prop.load(input); |
||||
} catch (IOException e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
}else { |
||||
throw new RuntimeException("Failed to find modelCode.properties"); |
||||
} |
||||
return prop.getProperty(key); |
||||
} |
||||
} |
@ -0,0 +1,78 @@ |
||||
package com.dky.utils.entity; |
||||
|
||||
|
||||
public class DevPrice { |
||||
|
||||
private Integer id; |
||||
private String devType; |
||||
private Double devPrice; |
||||
private String priceUnit; |
||||
private Double unitVal; |
||||
private String unitUnit; |
||||
private String heatRange; |
||||
private String remark; |
||||
|
||||
public Integer getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Integer id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getDevType() { |
||||
return devType; |
||||
} |
||||
|
||||
public void setDevType(String devType) { |
||||
this.devType = devType; |
||||
} |
||||
|
||||
public Double getDevPrice() { |
||||
return devPrice; |
||||
} |
||||
|
||||
public void setDevPrice(Double devPrice) { |
||||
this.devPrice = devPrice; |
||||
} |
||||
|
||||
public String getPriceUnit() { |
||||
return priceUnit; |
||||
} |
||||
|
||||
public void setPriceUnit(String priceUnit) { |
||||
this.priceUnit = priceUnit; |
||||
} |
||||
|
||||
public Double getUnitVal() { |
||||
return unitVal; |
||||
} |
||||
|
||||
public void setUnitVal(Double unitVal) { |
||||
this.unitVal = unitVal; |
||||
} |
||||
|
||||
public String getUnitUnit() { |
||||
return unitUnit; |
||||
} |
||||
|
||||
public void setUnitUnit(String unitUnit) { |
||||
this.unitUnit = unitUnit; |
||||
} |
||||
|
||||
public String getHeatRange() { |
||||
return heatRange; |
||||
} |
||||
|
||||
public void setHeatRange(String heatRange) { |
||||
this.heatRange = heatRange; |
||||
} |
||||
|
||||
public String getRemark() { |
||||
return remark; |
||||
} |
||||
|
||||
public void setRemark(String remark) { |
||||
this.remark = remark; |
||||
} |
||||
} |
@ -0,0 +1,79 @@ |
||||
package com.dky.utils.entity; |
||||
|
||||
import cn.hutool.json.JSONObject; |
||||
|
||||
public class DevSpec { |
||||
//id
|
||||
private Integer id; |
||||
//设备类型
|
||||
private String devType; |
||||
//设备价格
|
||||
private Double devModel; |
||||
//单位
|
||||
private Double capacity; |
||||
//单元单位
|
||||
private String output; |
||||
//制热范围
|
||||
private String voltage; |
||||
//备注
|
||||
|
||||
public Integer getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Integer id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getDevType() { |
||||
return devType; |
||||
} |
||||
|
||||
public void setDevType(String devType) { |
||||
this.devType = devType; |
||||
} |
||||
|
||||
public Double getDevModel() { |
||||
return devModel; |
||||
} |
||||
|
||||
public void setDevModel(Double devModel) { |
||||
this.devModel = devModel; |
||||
} |
||||
|
||||
public Double getCapacity() { |
||||
return capacity; |
||||
} |
||||
|
||||
public void setCapacity(Double capacity) { |
||||
this.capacity = capacity; |
||||
} |
||||
|
||||
public String getOutput() { |
||||
return output; |
||||
} |
||||
|
||||
public void setOutput(String output) { |
||||
this.output = output; |
||||
} |
||||
|
||||
public String getVoltage() { |
||||
return voltage; |
||||
} |
||||
|
||||
public void setVoltage(String voltage) { |
||||
this.voltage = voltage; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return "DevSpec{" + |
||||
"id=" + id + |
||||
", devType='" + devType + '\'' + |
||||
", devModel=" + devModel + |
||||
", capacity=" + capacity + |
||||
", output='" + output + '\'' + |
||||
", voltage='" + voltage + '\'' + |
||||
'}'; |
||||
} |
||||
} |
@ -0,0 +1,33 @@ |
||||
package com.dky.utils.enums; |
||||
|
||||
|
||||
public enum Code { |
||||
|
||||
|
||||
SUCCESS(1001, "成功"), |
||||
KEY_EXPIRATION(1002, "密钥已过期"), |
||||
KEY_UNAUTHORIZED(1003, "密钥本机未授权"); |
||||
|
||||
|
||||
/** |
||||
* 返回结果编码 |
||||
*/ |
||||
private final Integer code; |
||||
/** |
||||
* 描述 |
||||
*/ |
||||
private final String desc; |
||||
|
||||
public Integer getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public String getDesc() { |
||||
return desc; |
||||
} |
||||
|
||||
Code(Integer code, String desc) { |
||||
this.code = code; |
||||
this.desc = desc; |
||||
} |
||||
} |
@ -0,0 +1,37 @@ |
||||
package com.dky.utils.result; |
||||
|
||||
import com.dky.utils.entity.DevSpec; |
||||
|
||||
public class MatchedDevice { |
||||
private DevSpec devSpec; |
||||
private int count; // 匹配的设备数量
|
||||
|
||||
public MatchedDevice(DevSpec devSpec, int count) { |
||||
this.devSpec = devSpec; |
||||
this.count = count; |
||||
} |
||||
|
||||
public DevSpec getDevSpec() { |
||||
return devSpec; |
||||
} |
||||
|
||||
public void setDevSpec(DevSpec devSpec) { |
||||
this.devSpec = devSpec; |
||||
} |
||||
|
||||
public int getCount() { |
||||
return count; |
||||
} |
||||
|
||||
public void setCount(int count) { |
||||
this.count = count; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return "MatchedDevice{" + |
||||
"devSpec=" + devSpec + |
||||
", count=" + count + |
||||
'}'; |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.dky.utils.result; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
public class MatchedDeviceResult { |
||||
private List<MatchedDevice> matchedDevices; |
||||
private double totalPriceInTenThousand; // 总价,单位:万元
|
||||
|
||||
public MatchedDeviceResult(List<MatchedDevice> matchedDevices, double totalPriceInTenThousand) { |
||||
this.matchedDevices = matchedDevices; |
||||
this.totalPriceInTenThousand = totalPriceInTenThousand; |
||||
} |
||||
|
||||
public List<MatchedDevice> getMatchedDevices() { |
||||
return matchedDevices; |
||||
} |
||||
|
||||
public void setMatchedDevices(List<MatchedDevice> matchedDevices) { |
||||
this.matchedDevices = matchedDevices; |
||||
} |
||||
|
||||
public double getTotalPriceInTenThousand() { |
||||
return totalPriceInTenThousand; |
||||
} |
||||
|
||||
public void setTotalPriceInTenThousand(double totalPriceInTenThousand) { |
||||
this.totalPriceInTenThousand = totalPriceInTenThousand; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return "Result{" + |
||||
"matchedDevices=" + Arrays.toString(matchedDevices.toArray() )+ |
||||
", totalPriceInTenThousand=" + totalPriceInTenThousand + |
||||
'}'; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,14 @@ |
||||
package com.dky.utils.result; |
||||
|
||||
|
||||
import cn.hutool.json.JSONObject; |
||||
|
||||
public class ResponseUtil { |
||||
public static JSONObject createResponse(int code, String message, Object data) { |
||||
JSONObject jsonObjectResult = new JSONObject(); |
||||
jsonObjectResult.put("code", code); |
||||
jsonObjectResult.put("message", message); |
||||
jsonObjectResult.put("report", data); |
||||
return jsonObjectResult; |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
<?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"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<parent> |
||||
<groupId>com.dky</groupId> |
||||
<artifactId>dntd-model-tool1</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
</parent> |
||||
|
||||
<artifactId>dntd-model-heatboiler</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> |
@ -0,0 +1,22 @@ |
||||
package com.dky.calculate; |
||||
//方案优势
|
||||
public class Advantage { |
||||
//安全性
|
||||
public String safety(){ |
||||
return "无"; |
||||
} |
||||
//经济性
|
||||
public String economy(Double firstInvestFee,Double yearTotalFee,Double yearRunFee,Double lastYearFee){ |
||||
Double hsq = Math.round(firstInvestFee/yearTotalFee*100.0)/100.0; |
||||
double js = Math.round(lastYearFee - yearRunFee*100.0)/100.0; |
||||
return "本次改造投资回收期为"+hsq+"年,本改造方案相比较原技术节省年运行费用成本"+js+"元。"; |
||||
} |
||||
//智能性
|
||||
public String intelligence(){ |
||||
return "以电锅炉替代和实现精准控温。"; |
||||
} |
||||
//环保性
|
||||
public String environment(Double yearReduceCarbon){ |
||||
return "本次改造方案减排"+yearReduceCarbon+"吨"; |
||||
} |
||||
} |
@ -0,0 +1,30 @@ |
||||
package com.dky.calculate; |
||||
|
||||
|
||||
public class Overall { |
||||
|
||||
//年运行费用
|
||||
public Double yearRunFee(Double yearEnergy,Double electricityPrice) { |
||||
// 1蒸吨蒸汽需要770kWh电。
|
||||
//年总用电yearEnergy*770
|
||||
//根据传入得替代前年能源用量计算出年用电量
|
||||
//年用电量用电量乘以电价
|
||||
return yearEnergy*770*electricityPrice; |
||||
} |
||||
//年总费用
|
||||
public Double yearTotalFee(Double yearRunFee) { |
||||
// 年运行费用*系数+年运行费用。(10%)
|
||||
return yearRunFee*0.1+yearRunFee; |
||||
} |
||||
//年减碳量(吨)
|
||||
public Double yearReduceCarbon(Double yearEnergy) { |
||||
// 年用电量*1.229
|
||||
return yearEnergy*770*1.229; |
||||
} |
||||
//替代电量
|
||||
public Double replaceEnergy(Double yearEnergy) { |
||||
|
||||
return yearEnergy*770; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,61 @@ |
||||
package com.dky.calculate; |
||||
|
||||
import com.dky.utils.entity.DevSpec; |
||||
import com.dky.utils.entity.DevPrice; |
||||
import com.dky.utils.result.MatchedDevice; |
||||
import com.dky.utils.result.MatchedDeviceResult; |
||||
|
||||
import java.util.*; |
||||
|
||||
public class RequireDevice { |
||||
public static MatchedDeviceResult matchDevices(double demandCapacity,List<DevSpec> deviceList,List<DevPrice> priceList) { |
||||
// 对设备按照容量从大到小排序
|
||||
deviceList.sort((d1, d2) -> Double.compare(d2.getCapacity(), d1.getCapacity())); |
||||
|
||||
double remainingCapacity = demandCapacity; |
||||
double totalPrice = 0; |
||||
List<MatchedDevice> matchedDevices = new ArrayList<>(); |
||||
// 遍历设备列表.根据需求容量匹配设备
|
||||
for (DevSpec spec : deviceList) { |
||||
if (spec.getCapacity() <= remainingCapacity) { |
||||
int count = (int) Math.floor(remainingCapacity / spec.getCapacity()); |
||||
remainingCapacity = remainingCapacity - (spec.getCapacity() * count); |
||||
matchedDevices.add(new MatchedDevice(spec, count)); |
||||
if (count > 0) { |
||||
DevPrice price = priceList.stream() |
||||
.filter(p -> p.getId() == spec.getId()) |
||||
.findFirst() |
||||
.orElse(null); |
||||
|
||||
if (price != null) { |
||||
double devicePrice = price.getDevPrice() * count; |
||||
totalPrice += devicePrice; |
||||
} |
||||
} |
||||
}else { |
||||
for (int i = deviceList.size()-1; i >= 0; i--){ |
||||
if (deviceList.get(i).getCapacity() >= remainingCapacity){ |
||||
matchedDevices.add(new MatchedDevice(deviceList.get(i), 1)); |
||||
int finalI = i; |
||||
DevPrice price = priceList.stream() |
||||
.filter(p -> p.getId() == deviceList.get(finalI).getId()) |
||||
.findFirst() |
||||
.orElse(null); |
||||
|
||||
if (price != null) { |
||||
double devicePrice = price.getDevPrice(); |
||||
totalPrice += devicePrice; |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
break; |
||||
} |
||||
if (remainingCapacity <= 0) { |
||||
break; // 当总容量已经满足需求时,跳出循环,不再选择其他设备
|
||||
} |
||||
} |
||||
|
||||
return new MatchedDeviceResult(matchedDevices, totalPrice); |
||||
} |
||||
} |
@ -0,0 +1,62 @@ |
||||
package com.dky.entity; |
||||
|
||||
public class Heatboiler { |
||||
private Double exportTemperature; |
||||
private String hotMedium; |
||||
|
||||
private Double hotDevicePower; |
||||
//年能源用量
|
||||
private Double yearEnergy; |
||||
//执行电价
|
||||
private Double electricityPrice; |
||||
private OriginalDevice originalDevice; |
||||
|
||||
public OriginalDevice getOriginalDevice() { |
||||
return originalDevice; |
||||
} |
||||
|
||||
public void setOriginalDevice(OriginalDevice originalDevice) { |
||||
this.originalDevice = originalDevice; |
||||
} |
||||
|
||||
public Double getYearEnergy() { |
||||
return yearEnergy; |
||||
} |
||||
|
||||
public void setYearEnergy(Double yearEnergy) { |
||||
this.yearEnergy = yearEnergy; |
||||
} |
||||
|
||||
public Double getElectricityPrice() { |
||||
return electricityPrice; |
||||
} |
||||
|
||||
public void setElectricityPrice(Double electricityPrice) { |
||||
this.electricityPrice = electricityPrice; |
||||
} |
||||
|
||||
public Double getExportTemperature() { |
||||
return exportTemperature; |
||||
} |
||||
|
||||
public void setExportTemperature(Double exportTemperature) { |
||||
this.exportTemperature = exportTemperature; |
||||
} |
||||
|
||||
public String getHotMedium() { |
||||
return hotMedium; |
||||
} |
||||
|
||||
public void setHotMedium(String hotMedium) { |
||||
this.hotMedium = hotMedium; |
||||
} |
||||
|
||||
public Double getHotDevicePower() { |
||||
return hotDevicePower; |
||||
} |
||||
|
||||
public void setHotDevicePower(Double hotDevicePower) { |
||||
this.hotDevicePower = hotDevicePower; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,40 @@ |
||||
package com.dky.entity; |
||||
|
||||
public class OriginalDevice { |
||||
private String deviceType; |
||||
private Integer deviceNum; |
||||
private String deviceEnergyType; |
||||
private Double lastYearFee; |
||||
|
||||
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 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; |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
<?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"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<parent> |
||||
<groupId>com.dky</groupId> |
||||
<artifactId>dntd-model-tool1</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
</parent> |
||||
|
||||
<artifactId>dntd-modelI</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> |
||||
</dependencies> |
||||
|
||||
</project> |
@ -0,0 +1,7 @@ |
||||
package com.dky.modelI; |
||||
|
||||
import cn.hutool.json.JSONObject; |
||||
|
||||
public interface DntdModelI { |
||||
JSONObject createReport(JSONObject jsonObject); |
||||
} |
@ -0,0 +1,82 @@ |
||||
<?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"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<parent> |
||||
<groupId>com.dky</groupId> |
||||
<artifactId>dntd-model-tool1</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
</parent> |
||||
|
||||
<artifactId>dntd-tool</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
|
||||
<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>org.bouncycastle</groupId> |
||||
<artifactId>bcprov-jdk15on</artifactId> |
||||
<version>1.68</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.dky</groupId> |
||||
<artifactId>dntd-model-heatboiler</artifactId> |
||||
<version>1.0-SNAPSHOT</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> |
||||
<dependency> |
||||
<groupId>com.dky</groupId> |
||||
<artifactId>dntd-model-buildsence</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
</dependency> |
||||
</dependencies> |
||||
<build> |
||||
<resources> |
||||
<resource> |
||||
<directory>src/main/resources</directory> |
||||
<filtering>true</filtering> |
||||
<includes> |
||||
<include>*.properties</include> |
||||
</includes> |
||||
</resource> |
||||
</resources> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-compiler-plugin</artifactId> |
||||
<version>3.8.1</version> |
||||
<configuration> |
||||
<source>8</source> |
||||
<target>8</target> |
||||
</configuration> |
||||
</plugin> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-resources-plugin</artifactId> |
||||
<version>3.1.0</version> |
||||
<configuration> |
||||
<nonFilteredFileExtensions>xlsx</nonFilteredFileExtensions> |
||||
</configuration> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
</project> |
@ -0,0 +1,63 @@ |
||||
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(1); |
||||
specObj1.setDevType("直热式电锅炉"); |
||||
specObj1.setCapacity(1.5); |
||||
specObj2.setId(2); |
||||
specObj2.setDevType("直热式电锅炉"); |
||||
specObj2.setCapacity(2.5); |
||||
specObj3.setId(3); |
||||
specObj3.setDevType("直热式电锅炉"); |
||||
specObj3.setCapacity(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 = "vcH5hprSR9VkzneCzkBI3pD0D8plBBmLc927UW8/CY+NmfEi5e0zRH2iU6E8l1HCS/c+EVOzQeOGmgNshVgOpYUFUV5VUaECpWy6O2mE6fLeaeydA5tuGebX9kKp4UH6Oo5TeMC/mjQNpo8d1aho82+eIcOIE1CkVm9Ec875YrijyNz7P7hd9EYlnzJwVsf1Ks4Gzcnl0XRx2n3PN/tvCA=="; |
||||
JSONObject jsonObject = modelTool.exeModel2Report(param,key);//exeModel2Report
|
||||
System.out.println(jsonObject.toString()); |
||||
} |
||||
} |
@ -0,0 +1,84 @@ |
||||
package com.dky.generate; |
||||
|
||||
import cn.hutool.json.JSONObject; |
||||
import com.dky.calculate.Advantage; |
||||
import com.dky.calculate.Overall; |
||||
import com.dky.calculate.RequireDevice; |
||||
import com.dky.entity.Heatboiler; |
||||
import com.dky.modelI.DntdModelI; |
||||
import com.dky.tool.ModelTool; |
||||
import com.dky.utils.entity.DevPrice; |
||||
import com.dky.utils.entity.DevSpec; |
||||
import com.dky.utils.result.MatchedDevice; |
||||
import com.dky.utils.result.MatchedDeviceResult; |
||||
|
||||
import java.util.*; |
||||
|
||||
public class HeatBoilerSence implements DntdModelI { |
||||
@Override |
||||
public JSONObject createReport(JSONObject jsonObject) { |
||||
JSONObject jsonReport = new JSONObject(); |
||||
Heatboiler heatboiler = jsonObject.toBean(Heatboiler.class); |
||||
//生成报告
|
||||
List<DevSpec> specList = ModelTool.specList; |
||||
List<DevPrice> priceList = ModelTool.priceList; |
||||
MatchedDeviceResult matchedDeviceResult = RequireDevice.matchDevices(heatboiler.getHotDevicePower(), specList, priceList); |
||||
Overall overall = new Overall(); |
||||
//初次投资费用(万元)
|
||||
Double firstInvestFee = Math.round(matchedDeviceResult.getTotalPriceInTenThousand()*100.0)/100.0; |
||||
//年运行费用(万元)
|
||||
Double yearRunFee = Math.round(overall.yearRunFee(heatboiler.getYearEnergy(), heatboiler.getElectricityPrice())*100.0)/100.0; |
||||
//年总费用(万元)
|
||||
Double yearTotalFee = Math.round(overall.yearTotalFee(yearRunFee)*100.0)/100.0; |
||||
//年减碳(吨)
|
||||
Double yearReduceCarbon = Math.round(overall.yearReduceCarbon(heatboiler.getYearEnergy())*100.0)/100.0; |
||||
//替代电量
|
||||
Double replaceEnergy = Math.round(overall.replaceEnergy(heatboiler.getYearEnergy())*100.0)/100.0; |
||||
//需配置设备情况
|
||||
//方案详情
|
||||
String reportDetail = "用直热式电锅炉替代原设备"; |
||||
//设备类型
|
||||
String deviceType = ""; |
||||
//设备规格
|
||||
String deviceSpec = ""; |
||||
//设备数量
|
||||
String deviceNum = ""; |
||||
//单位(元/台、元/套)
|
||||
String unit = ""; |
||||
Set<String> devTypeSet = new HashSet<>(); |
||||
for (MatchedDevice matchedDevice : matchedDeviceResult.getMatchedDevices()) { |
||||
devTypeSet.add(matchedDevice.getDevSpec().getDevType()); |
||||
deviceSpec = deviceSpec + matchedDevice.getDevSpec().getDevType() + ":"+matchedDevice.getDevSpec().getCapacity()+"蒸吨、"; |
||||
deviceNum = deviceNum + matchedDevice.getCount() + "台/"+matchedDevice.getDevSpec().getDevType()+";"; |
||||
int devId = matchedDevice.getDevSpec().getId(); |
||||
for (DevPrice devPrice : priceList) { |
||||
if (devId == devPrice.getId()) { |
||||
unit = unit+devPrice.getDevPrice()+"元/台;"; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
for (String s : devTypeSet) { |
||||
deviceType = deviceType + s + "、"; |
||||
} |
||||
Advantage advantage = new Advantage(); |
||||
//总价
|
||||
String totalPrice = matchedDeviceResult.getTotalPriceInTenThousand()+"万元"; |
||||
jsonReport.put("firstInvestFee", firstInvestFee); |
||||
jsonReport.put("yearRunFee", yearRunFee); |
||||
jsonReport.put("yearTotalFee", yearTotalFee); |
||||
jsonReport.put("yearReduceCarbon", yearReduceCarbon); |
||||
jsonReport.put("replaceEnergy", replaceEnergy); |
||||
jsonReport.put("reportDetail", reportDetail); |
||||
jsonReport.put("deviceType", deviceType); |
||||
jsonReport.put("deviceSpec", deviceSpec); |
||||
jsonReport.put("deviceNum", deviceNum); |
||||
jsonReport.put("unit", unit); |
||||
jsonReport.put("totalPrice", totalPrice); |
||||
jsonReport.put("safety", advantage.safety()); |
||||
jsonReport.put("economy", advantage.economy(firstInvestFee,yearTotalFee,yearRunFee,heatboiler.getOriginalDevice().getLastYearFee())); |
||||
jsonReport.put("intelligence", advantage.intelligence()); |
||||
jsonReport.put("environment", advantage.environment(yearReduceCarbon)); |
||||
return jsonReport; |
||||
} |
||||
} |
@ -0,0 +1,75 @@ |
||||
package com.dky.security; |
||||
|
||||
import java.io.BufferedReader; |
||||
import java.io.InputStream; |
||||
import java.io.InputStreamReader; |
||||
import java.util.Scanner; |
||||
|
||||
public class GetCpuInfo { |
||||
/** |
||||
* 获取当前系统CPU序列,可区分linux系统和windows系统 |
||||
*/ |
||||
public static String getCpuId() throws Exception { |
||||
String cpuId; |
||||
// 获取当前操作系统名称
|
||||
String os = System.getProperty("os.name"); |
||||
os = os.toUpperCase(); |
||||
|
||||
// linux系统用Runtime.getRuntime().exec()执行 dmidecode -t processor 查询cpu序列
|
||||
// windows系统用 wmic cpu get ProcessorId 查看cpu序列
|
||||
if ("LINUX".equals(os)) { |
||||
cpuId = getLinuxCpuId("dmidecode -t processor | grep 'ID'", "ID", ":"); |
||||
} else { |
||||
cpuId = getWindowsCpuId(); |
||||
} |
||||
|
||||
return cpuId.toUpperCase().replace(" ", ""); |
||||
} |
||||
|
||||
/** |
||||
* 获取linux系统CPU序列 |
||||
*/ |
||||
public static String getLinuxCpuId(String cmd, String record, String symbol) throws Exception { |
||||
String execResult = executeLinuxCmd(cmd); |
||||
String[] infos = execResult.split("\n"); |
||||
for (String info : infos) { |
||||
info = info.trim(); |
||||
if (info.indexOf(record) != -1) { |
||||
info.replace(" ", ""); |
||||
String[] sn = info.split(symbol); |
||||
return sn[1]; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static String executeLinuxCmd(String cmd) throws Exception { |
||||
Runtime run = Runtime.getRuntime(); |
||||
Process process; |
||||
process = run.exec(cmd); |
||||
InputStream in = process.getInputStream(); |
||||
BufferedReader bs = new BufferedReader(new InputStreamReader(in)); |
||||
StringBuffer out = new StringBuffer(); |
||||
byte[] b = new byte[8192]; |
||||
for (int n; (n = in.read(b)) != -1; ) { |
||||
out.append(new String(b, 0, n)); |
||||
} |
||||
in.close(); |
||||
process.destroy(); |
||||
return out.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 获取windows系统CPU序列 |
||||
*/ |
||||
public static String getWindowsCpuId() throws Exception { |
||||
Process process = Runtime.getRuntime().exec( |
||||
new String[]{"wmic", "cpu", "get", "ProcessorId"}); |
||||
process.getOutputStream().close(); |
||||
Scanner sc = new Scanner(process.getInputStream()); |
||||
sc.next(); |
||||
String serial = sc.next(); |
||||
return serial; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,74 @@ |
||||
package com.dky.security; |
||||
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider; |
||||
|
||||
import javax.crypto.Cipher; |
||||
import javax.crypto.spec.SecretKeySpec; |
||||
import java.nio.charset.StandardCharsets; |
||||
import java.security.Security; |
||||
import java.util.ArrayList; |
||||
import java.util.Base64; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
public class SM4Utils { |
||||
static { |
||||
Security.addProvider(new BouncyCastleProvider()); |
||||
} |
||||
|
||||
private static final String SM4_KEY = "sm4demo123456789"; // 16 bytes key
|
||||
private static final String ALGORITHM = "AES/ECB/PKCS5Padding"; |
||||
|
||||
public static String encrypt(Map<String, String> map) throws Exception { |
||||
|
||||
Cipher cipher = Cipher.getInstance(ALGORITHM, "BC"); |
||||
SecretKeySpec secretKey = new SecretKeySpec(SM4_KEY.getBytes(StandardCharsets.UTF_8), "AES"); |
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey); |
||||
byte[] encrypted = cipher.doFinal(mapToString(map).getBytes(StandardCharsets.UTF_8)); |
||||
return Base64.getEncoder().encodeToString(encrypted); |
||||
} |
||||
|
||||
public static Map<String, String> decrypt(String encrypted) throws Exception { |
||||
Cipher cipher = Cipher.getInstance(ALGORITHM, "BC"); |
||||
SecretKeySpec secretKey = new SecretKeySpec(SM4_KEY.getBytes(StandardCharsets.UTF_8), "SM4"); |
||||
cipher.init(Cipher.DECRYPT_MODE, secretKey); |
||||
byte[] decoded = Base64.getDecoder().decode(encrypted); |
||||
byte[] decrypted = cipher.doFinal(decoded); |
||||
return stringToMap(new String(decrypted, StandardCharsets.UTF_8)); |
||||
} |
||||
|
||||
private static String mapToString(Map<String, String> map) { |
||||
StringBuilder sb = new StringBuilder(); |
||||
for (Map.Entry<String, String> entry : map.entrySet()) { |
||||
sb.append(entry.getKey()).append('=').append(entry.getValue()).append('&'); |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
|
||||
private static Map<String, String> stringToMap(String str) { |
||||
Map<String, String> map = new HashMap<>(); |
||||
String[] entries = str.split("&"); |
||||
for (String entry : entries) { |
||||
String[] keyValue = entry.split("=", 2); |
||||
if (keyValue.length == 2) { |
||||
map.put(keyValue[0], keyValue[1]); |
||||
} |
||||
} |
||||
return map; |
||||
} |
||||
|
||||
public static void main(String[] args) throws Exception { |
||||
Map map = new HashMap<>(); |
||||
ArrayList<String> cpuIds = new ArrayList<>(); |
||||
cpuIds.add("duahduejdiejidi"); |
||||
cpuIds.add("ddnfjuufhurhffr"); |
||||
cpuIds.add("frfrjfirjfirjfir"); |
||||
cpuIds.add("BFEBFBFF000506E3"); |
||||
cpuIds.add("BFEBFBFF000806EA"); |
||||
map.put("name", "模型1工具"); |
||||
map.put("cpuIds", cpuIds.toString()); |
||||
map.put("expireTime","2024-12-16 00:00:00"); |
||||
String encrypted = encrypt(map); |
||||
System.out.println(encrypted); |
||||
} |
||||
} |
@ -0,0 +1,80 @@ |
||||
package com.dky.tool; |
||||
|
||||
import cn.hutool.json.JSONArray; |
||||
import cn.hutool.json.JSONObject; |
||||
import com.dky.modelI.DntdModelI; |
||||
import com.dky.security.GetCpuInfo; |
||||
import com.dky.utils.ConfigReader; |
||||
import com.dky.utils.enums.Code; |
||||
import com.dky.utils.entity.DevSpec; |
||||
import com.dky.utils.entity.DevPrice; |
||||
import com.dky.utils.result.ResponseUtil; |
||||
import java.lang.reflect.InvocationTargetException; |
||||
import java.text.SimpleDateFormat; |
||||
import java.util.*; |
||||
|
||||
|
||||
public class ModelTool { |
||||
public static List<DevSpec> specList = new ArrayList<>(); |
||||
public static List<DevPrice> priceList = new ArrayList<>(); |
||||
//制热锅炉,单功率单价,单位。建缓冲区。List实体。
|
||||
public ModelTool(JSONObject list) { |
||||
|
||||
JSONArray specArray = list.getJSONArray("devSpecList"); |
||||
for (int i = 0; i < specArray.size(); i++) { |
||||
DevSpec devSpec = specArray.getJSONObject(i).toBean(DevSpec.class); |
||||
specList.add(devSpec); |
||||
} |
||||
JSONArray priceArray = list.getJSONArray("devPriceList"); |
||||
for (int i = 0; i < priceArray.size(); i++) { |
||||
DevPrice devPrice = priceArray.getJSONObject(i).toBean(DevPrice.class); |
||||
priceList.add(devPrice); |
||||
} |
||||
} |
||||
public static JSONObject exeModel2Report(JSONObject jsonObject, String key) { |
||||
JSONObject jsonObjectResult = new JSONObject(); |
||||
try { |
||||
// 根据给定的类名初始化类 加密不需要反实例化new
|
||||
Class sm4UtilsClass = Class.forName("com.dky.security.SM4Utils"); |
||||
// 实例化这个类
|
||||
Object obj = sm4UtilsClass.newInstance(); |
||||
// 调用指定方法
|
||||
Map map = (Map) sm4UtilsClass.getMethod("decrypt", String.class).invoke(obj, key); |
||||
String cpuIds = (String) map.get("cpuIds"); |
||||
String expireTime = (String) map.get("expireTime"); |
||||
// 定义日期时间格式
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
||||
Date date = formatter.parse(expireTime); |
||||
//拿到解析后的cpuid。获取本地的cpuid.
|
||||
String localCpuId = GetCpuInfo.getCpuId(); |
||||
if (cpuIds.contains(localCpuId)){ |
||||
if (new Date().before(date)){ |
||||
//判断模型使用权限
|
||||
// 根据给定的类名初始化类 加密不需要反实例化new
|
||||
Class modelI = Class.forName("com.dky"+"."+ ConfigReader.getProperty(jsonObject.getStr("type"))); |
||||
// 实例化这个类
|
||||
DntdModelI modelI1 = (DntdModelI)modelI.newInstance(); |
||||
// 调用指定方法
|
||||
jsonObjectResult = modelI1.createReport(jsonObject); |
||||
}else { |
||||
jsonObjectResult = ResponseUtil.createResponse(Code.KEY_EXPIRATION.getCode(), Code.KEY_EXPIRATION.getDesc(), null); |
||||
} |
||||
}else { |
||||
jsonObjectResult = ResponseUtil.createResponse(Code.KEY_UNAUTHORIZED.getCode(), Code.KEY_UNAUTHORIZED.getDesc(), null); |
||||
} |
||||
} catch (ClassNotFoundException e) { |
||||
e.printStackTrace(); |
||||
} catch (InstantiationException e) { |
||||
e.printStackTrace(); |
||||
} catch (IllegalAccessException e) { |
||||
e.printStackTrace(); |
||||
} catch (InvocationTargetException e) { |
||||
e.printStackTrace(); |
||||
} catch (NoSuchMethodException e) { |
||||
e.printStackTrace(); |
||||
} catch (Exception e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
return jsonObjectResult; |
||||
} |
||||
} |
@ -0,0 +1 @@ |
||||
0101=generate.HeatBoilerSence |
@ -0,0 +1,61 @@ |
||||
<?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"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<groupId>com.dky</groupId> |
||||
<artifactId>dntd-model-tool1</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
<packaging>pom</packaging> |
||||
<modules> |
||||
<module>dntd-tool</module> |
||||
<module>dntd-model-heatboiler</module> |
||||
<module>dntd-modelI</module> |
||||
<module>dntd-common</module> |
||||
</modules> |
||||
|
||||
<properties> |
||||
<maven.compiler.source>8</maven.compiler.source> |
||||
<maven.compiler.target>8</maven.compiler.target> |
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
</properties> |
||||
|
||||
<dependencyManagement> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>cn.hutool</groupId> |
||||
<artifactId>hutool-all</artifactId> |
||||
<version>5.4.5</version> |
||||
</dependency> |
||||
</dependencies> |
||||
</dependencyManagement> |
||||
<build> |
||||
<plugins> |
||||
<!-- 代码混淆插件 --> |
||||
<plugin> |
||||
<groupId>com.dwp</groupId> |
||||
<artifactId>obfuscation</artifactId> |
||||
<version>1.0.0</version> |
||||
<executions> |
||||
<execution> |
||||
<phase>compile</phase> |
||||
<goals> |
||||
<goal>obfuscation</goal> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
<configuration> |
||||
<basePath>${basedir}</basePath> |
||||
<classPath>${basedir}/target/classes</classPath> |
||||
</configuration> |
||||
</plugin> |
||||
</plugins> |
||||
<resources> |
||||
<resource> |
||||
<directory>src/main/resources/</directory> |
||||
<filtering>true</filtering> |
||||
</resource> |
||||
</resources> |
||||
</build> |
||||
</project> |
Loading…
Reference in new issue