|
@@ -115,16 +115,17 @@ public class ChargingBillServiceImpl implements IChargingBillService {
|
|
if (null != chargingCfg) {
|
|
if (null != chargingCfg) {
|
|
if (meterDevice.getMeterCls() == 45) {
|
|
if (meterDevice.getMeterCls() == 45) {
|
|
bill.setMeteredPrice(calcPrice(rec.getIncrease(), chargingCfg.getElecUnitPrice()));
|
|
bill.setMeteredPrice(calcPrice(rec.getIncrease(), chargingCfg.getElecUnitPrice()));
|
|
|
|
+ bill.setSharedComputeType(chargingCfg.getElecGtComputeType());
|
|
clacElecSharedPrice(bill, meterDevice, chargingCfg, queryParam, coSet);
|
|
clacElecSharedPrice(bill, meterDevice, chargingCfg, queryParam, coSet);
|
|
}
|
|
}
|
|
else if (meterDevice.getMeterCls() == 70) {
|
|
else if (meterDevice.getMeterCls() == 70) {
|
|
bill.setMeteredPrice(calcPrice(rec.getIncrease(), chargingCfg.getWaterUnitPrice()));
|
|
bill.setMeteredPrice(calcPrice(rec.getIncrease(), chargingCfg.getWaterUnitPrice()));
|
|
|
|
+ bill.setSharedComputeType(chargingCfg.getWaterGtComputeType());
|
|
clacWaterSharedPrice(bill, meterDevice, chargingCfg, queryParam, coSet);
|
|
clacWaterSharedPrice(bill, meterDevice, chargingCfg, queryParam, coSet);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
bill.setTotalPrice(clacTotalPrice(bill));
|
|
bill.setTotalPrice(clacTotalPrice(bill));
|
|
-
|
|
|
|
retList.add(bill);
|
|
retList.add(bill);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -147,6 +148,7 @@ public class ChargingBillServiceImpl implements IChargingBillService {
|
|
|
|
|
|
private void clacElecSharedPrice(ChargingBill bill, MeterDevice meterDevice, CoChargingConfig chargingCfg,
|
|
private void clacElecSharedPrice(ChargingBill bill, MeterDevice meterDevice, CoChargingConfig chargingCfg,
|
|
QueryChargingBill queryParam, Set<String> coSet) {
|
|
QueryChargingBill queryParam, Set<String> coSet) {
|
|
|
|
+
|
|
// 电价公摊计算
|
|
// 电价公摊计算
|
|
if (chargingCfg.getElecGtComputeType() > 0 && coSet.contains(meterDevice.getObjCode())) {
|
|
if (chargingCfg.getElecGtComputeType() > 0 && coSet.contains(meterDevice.getObjCode())) {
|
|
QueryMeterReading param = new QueryMeterReading(meterDevice.getAreaCode(), MeterObjTag.SHARED.getTagValue(),
|
|
QueryMeterReading param = new QueryMeterReading(meterDevice.getAreaCode(), MeterObjTag.SHARED.getTagValue(),
|
|
@@ -156,7 +158,6 @@ public class ChargingBillServiceImpl implements IChargingBillService {
|
|
chargingCfg.getElecGtComputeType(), chargingCfg.getElecUnitPrice());
|
|
chargingCfg.getElecGtComputeType(), chargingCfg.getElecUnitPrice());
|
|
|
|
|
|
bill.setSharedPrice(price);
|
|
bill.setSharedPrice(price);
|
|
- bill.setShared(true);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -171,7 +172,6 @@ public class ChargingBillServiceImpl implements IChargingBillService {
|
|
chargingCfg.getWaterGtComputeType(), chargingCfg.getWaterUnitPrice());
|
|
chargingCfg.getWaterGtComputeType(), chargingCfg.getWaterUnitPrice());
|
|
|
|
|
|
bill.setSharedPrice(price);
|
|
bill.setSharedPrice(price);
|
|
- bill.setShared(true);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -259,12 +259,13 @@ public class ChargingBillServiceImpl implements IChargingBillService {
|
|
}
|
|
}
|
|
|
|
|
|
private Double clacTotalPrice(ChargingBill bill) {
|
|
private Double clacTotalPrice(ChargingBill bill) {
|
|
- Double tmp = bill.getMeteredPrice();
|
|
|
|
|
|
+ BigDecimal bd1 = new BigDecimal(bill.getMeteredPrice().toString());
|
|
|
|
|
|
if (null != bill.getSharedPrice()) {
|
|
if (null != bill.getSharedPrice()) {
|
|
- tmp += bill.getSharedPrice();
|
|
|
|
|
|
+ BigDecimal bd2 = new BigDecimal(bill.getSharedPrice().toString());
|
|
|
|
+ bd1 = bd1.add(bd2);
|
|
}
|
|
}
|
|
|
|
|
|
- return tmp;
|
|
|
|
|
|
+ return bd1.setScale(3, RoundingMode.HALF_UP).doubleValue();
|
|
}
|
|
}
|
|
}
|
|
}
|