|
@@ -1,6 +1,8 @@
|
|
package com.ruoyi.project.production.service.impl.thread;
|
|
package com.ruoyi.project.production.service.impl.thread;
|
|
|
|
|
|
|
|
+import com.ruoyi.project.production.domain.TMonthlyProductionPrice;
|
|
import com.ruoyi.project.production.domain.TMonthlyProductionReport;
|
|
import com.ruoyi.project.production.domain.TMonthlyProductionReport;
|
|
|
|
+import com.ruoyi.project.production.mapper.TMonthlyProductionPriceMapper;
|
|
import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
|
|
import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -21,6 +23,8 @@ public class SyncAfterMonthlyUpdateThread extends Thread {
|
|
|
|
|
|
private TMonthlyProductionReportMapper tMonthlyProductionReportMapper;
|
|
private TMonthlyProductionReportMapper tMonthlyProductionReportMapper;
|
|
|
|
|
|
|
|
+ private TMonthlyProductionPriceMapper tMonthlyProductionPriceMapper;
|
|
|
|
+
|
|
public SyncAfterMonthlyUpdateThread() {
|
|
public SyncAfterMonthlyUpdateThread() {
|
|
super();
|
|
super();
|
|
}
|
|
}
|
|
@@ -35,6 +39,18 @@ public class SyncAfterMonthlyUpdateThread extends Thread {
|
|
this.tMonthlyProductionReportMapper = tMonthlyProductionReportMapper;
|
|
this.tMonthlyProductionReportMapper = tMonthlyProductionReportMapper;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public SyncAfterMonthlyUpdateThread(
|
|
|
|
+ int reportYear,
|
|
|
|
+ int reportMonth,
|
|
|
|
+ TMonthlyProductionReportMapper tMonthlyProductionReportMapper,
|
|
|
|
+ TMonthlyProductionPriceMapper tMonthlyProductionPriceMapper) {
|
|
|
|
+ super();
|
|
|
|
+ this.reportYear = reportYear;
|
|
|
|
+ this.reportMonth = reportMonth;
|
|
|
|
+ this.tMonthlyProductionReportMapper = tMonthlyProductionReportMapper;
|
|
|
|
+ this.tMonthlyProductionPriceMapper = tMonthlyProductionPriceMapper;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
this.syncMonthlyData();
|
|
this.syncMonthlyData();
|
|
@@ -44,8 +60,7 @@ public class SyncAfterMonthlyUpdateThread extends Thread {
|
|
* 同步更新月报数据
|
|
* 同步更新月报数据
|
|
*/
|
|
*/
|
|
private void syncMonthlyData() {
|
|
private void syncMonthlyData() {
|
|
- TMonthlyProductionReport report = tMonthlyProductionReportMapper
|
|
|
|
- .selectTMonthlyProductionReportByDate(this.reportYear, this.reportMonth);
|
|
|
|
|
|
+ TMonthlyProductionReport report = tMonthlyProductionReportMapper.selectTMonthlyProductionReportByDate(this.reportYear, this.reportMonth);
|
|
|
|
|
|
String ethylenProducedStr = report.getEthylenProduced();
|
|
String ethylenProducedStr = report.getEthylenProduced();
|
|
String fuelGasOffgasCrackerStr = report.getFuelGasOffgasCracker();
|
|
String fuelGasOffgasCrackerStr = report.getFuelGasOffgasCracker();
|
|
@@ -214,6 +229,68 @@ public class SyncAfterMonthlyUpdateThread extends Thread {
|
|
report.setSubConCc(subConCc.toString());
|
|
report.setSubConCc(subConCc.toString());
|
|
report.setSubConSc(subConSc.toString());
|
|
report.setSubConSc(subConSc.toString());
|
|
|
|
|
|
|
|
+ String subConElectricStr = report.getSubConElectric();
|
|
|
|
+ String subConNgStr = report.getSubConNg();
|
|
|
|
+ String subConFgFrEuStr = report.getSubConFgFrEu();
|
|
|
|
+ String subConLpgStr = report.getSubConLpg();
|
|
|
|
+ String subConPCondensateStr = report.getSubConPCondensate();
|
|
|
|
+ String subConCwStr = report.getSubConCw();
|
|
|
|
+ String subConIaPaStr = report.getSubConIaPa();
|
|
|
|
+ String subConBfwStr = report.getSubConBfw();
|
|
|
|
+ String subConEoEgPurgeGasStr = report.getSubConEoEgPurgeGas();
|
|
|
|
+ String subConH2FrSyngasAsFuleStr = report.getSubConH2FrSyngasAsFule();
|
|
|
|
+ BigDecimal subConElectric = new BigDecimal(subConElectricStr == null ? "0" : subConElectricStr);
|
|
|
|
+ BigDecimal subConNg = new BigDecimal(subConNgStr == null ? "0" : subConNgStr);
|
|
|
|
+ BigDecimal subConFgFrEu = new BigDecimal(subConFgFrEuStr == null ? "0" : subConFgFrEuStr);
|
|
|
|
+ BigDecimal subConLpg = new BigDecimal(subConLpgStr == null ? "0" : subConLpgStr);
|
|
|
|
+ BigDecimal subConPCondensate = new BigDecimal(subConPCondensateStr == null ? "0" : subConPCondensateStr);
|
|
|
|
+ BigDecimal subConCw = new BigDecimal(subConCwStr == null ? "0" : subConCwStr);
|
|
|
|
+ BigDecimal subConIaPa = new BigDecimal(subConIaPaStr == null ? "0" : subConIaPaStr);
|
|
|
|
+ BigDecimal subConBfw = new BigDecimal(subConBfwStr == null ? "0" : subConBfwStr);
|
|
|
|
+ BigDecimal subConEoEgPurgeGas = new BigDecimal(subConEoEgPurgeGasStr == null ? "0" : subConEoEgPurgeGasStr);
|
|
|
|
+ BigDecimal subConH2FrSyngasAsFule = new BigDecimal(subConH2FrSyngasAsFuleStr == null ? "0" : subConH2FrSyngasAsFuleStr);
|
|
|
|
+ BigDecimal subConCostOutput = new BigDecimal("0");
|
|
|
|
+ // 查询单价
|
|
|
|
+ TMonthlyProductionPrice price = tMonthlyProductionPriceMapper.selectTMonthlyProductionPriceByDate(this.reportYear, this.reportMonth);
|
|
|
|
+ String subConElectricPriceStr = price.getSubConElectricPrice();
|
|
|
|
+ String subConNgPriceStr = price.getSubConNgPrice();
|
|
|
|
+ String subConFgFrEuPriceStr = price.getSubConFgFrEuPrice();
|
|
|
|
+ String subConLpgPriceStr = price.getSubConLpgPrice();
|
|
|
|
+ String subConHhpSteamPriceStr = price.getSubConHhpSteamPrice();
|
|
|
|
+ String subConPCondensatePriceStr = price.getSubConPCondensatePrice();
|
|
|
|
+ String subConCwPriceStr = price.getSubConCwPrice();
|
|
|
|
+ String subConIaPaPriceStr = price.getSubConIaPaPrice();
|
|
|
|
+ String subConBfwPriceStr = price.getSubConBfwPrice();
|
|
|
|
+ String subConEoEgPurgeGasPriceStr = price.getSubConEoEgPurgeGasPrice();
|
|
|
|
+ String subConH2FulePriceStr = price.getSubConH2FulePrice();
|
|
|
|
+ BigDecimal subConElectricPrice = new BigDecimal(subConElectricPriceStr == null ? "0" : subConElectricPriceStr);
|
|
|
|
+ BigDecimal subConNgPrice = new BigDecimal(subConNgPriceStr == null ? "0" : subConNgPriceStr);
|
|
|
|
+ BigDecimal subConFgFrEuPrice = new BigDecimal(subConFgFrEuPriceStr == null ? "0" : subConFgFrEuPriceStr);
|
|
|
|
+ BigDecimal subConLpgPrice = new BigDecimal(subConLpgPriceStr == null ? "0" : subConLpgPriceStr);
|
|
|
|
+ BigDecimal subConHhpSteamPrice = new BigDecimal(subConHhpSteamPriceStr == null ? "0" : subConHhpSteamPriceStr);
|
|
|
|
+ BigDecimal subConPCondensatePrice = new BigDecimal(subConPCondensatePriceStr == null ? "0" : subConPCondensatePriceStr);
|
|
|
|
+ BigDecimal subConCwPrice = new BigDecimal(subConCwPriceStr == null ? "0" : subConCwPriceStr);
|
|
|
|
+ BigDecimal subConIaPaPrice = new BigDecimal(subConIaPaPriceStr == null ? "0" : subConIaPaPriceStr);
|
|
|
|
+ BigDecimal subConBfwPrice = new BigDecimal(subConBfwPriceStr == null ? "0" : subConBfwPriceStr);
|
|
|
|
+ BigDecimal subConEoEgPurgeGasPrice = new BigDecimal(subConEoEgPurgeGasPriceStr == null ? "0" : subConEoEgPurgeGasPriceStr);
|
|
|
|
+ BigDecimal subConH2FulePrice = new BigDecimal(subConH2FulePriceStr == null ? "0" : subConH2FulePriceStr);
|
|
|
|
+ if (subConHpSteamFrSubNet.compareTo(BigDecimal.ZERO) != 0 && subConHhpSteam.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
+ subConCostOutput = (subConElectricPrice.multiply(subConElectric)
|
|
|
|
+ .add(subConNgPrice.multiply(subConNg))
|
|
|
|
+ .add(subConFgFrEuPrice.multiply(subConFgFrEu))
|
|
|
|
+ .add(subConLpgPrice.multiply(subConLpg))
|
|
|
|
+ .add(subConPCondensatePrice.multiply(subConPCondensate))
|
|
|
|
+ .add(subConCwPrice.multiply(subConCw))
|
|
|
|
+ .add(subConIaPaPrice.multiply(subConIaPa))
|
|
|
|
+ .add(subConBfwPrice.multiply(subConBfw))
|
|
|
|
+ .add(subConEoEgPurgeGasPrice.multiply(subConEoEgPurgeGas))
|
|
|
|
+ .add(subConH2FulePrice.multiply(subConH2FrSyngasAsFule)))
|
|
|
|
+ .divide((subConHpSteamFrSubNet.add(subConHhpSteam)), 2, RoundingMode.HALF_UP);
|
|
|
|
+ }
|
|
|
|
+ BigDecimal subConZfy = subConCostOutput.multiply(subConGljcl);
|
|
|
|
+ report.setSubConCostOutput(subConCostOutput.toString());
|
|
|
|
+ report.setSubConZfy(subConZfy.toString());
|
|
|
|
+
|
|
report.setKbiPcur(crackerLoad.toString());
|
|
report.setKbiPcur(crackerLoad.toString());
|
|
report.setKbiEnergyConsumption(crackerEnergyTeTeo.toString());
|
|
report.setKbiEnergyConsumption(crackerEnergyTeTeo.toString());
|
|
report.setKbiAeuEnergyConsumption(crackerEnergyEeKgect.toString());
|
|
report.setKbiAeuEnergyConsumption(crackerEnergyEeKgect.toString());
|