mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-28 19:18:00 +08:00
bugfix 人工结算订单空指针异常
This commit is contained in:
@@ -807,20 +807,36 @@ public class OrderService {
|
|||||||
// 如果订单的交易记录为空
|
// 如果订单的交易记录为空
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
data = new TransactionRecordsData();
|
data = new TransactionRecordsData();
|
||||||
// TODO 以前端传的值为准,如果没有传值则查最后一次实时数据
|
// 获取最后一次实时数据
|
||||||
if (StringUtils.equals(chargingAmount, Constants.ZERO) || StringUtils.equals(chargingDegree, Constants.ZERO)) {
|
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
|
||||||
// 获取最后一次实时数据
|
// if (CollectionUtils.isEmpty(chargingRealTimeData)) {
|
||||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
|
// log.error("人工结算订单 最后一次实时数据为空 error");
|
||||||
if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
// return false;
|
||||||
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
// }
|
||||||
chargingAmount = realTimeMonitorData.getChargingAmount();
|
// RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
||||||
chargingDegree = realTimeMonitorData.getChargingDegree();
|
// 以前端传的值为准,如果没有传值则查最后一次实时数据
|
||||||
|
if (StringUtils.equals(chargingAmount, Constants.ZERO) && CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||||
data.setConsumptionAmount(chargingAmount); // 总消费金额
|
chargingAmount = chargingRealTimeData.get(0).getChargingAmount();
|
||||||
data.setTotalElectricity(chargingDegree); // 总用电量
|
|
||||||
data.setStopReasonMsg("人工结算订单,操作人:" + SecurityUtils.getUsername()); // 停止原因
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (StringUtils.equals(chargingDegree, Constants.ZERO) && CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||||
|
chargingDegree = chargingRealTimeData.get(0).getChargingDegree();
|
||||||
|
}
|
||||||
|
data.setConsumptionAmount(chargingAmount); // 总消费金额
|
||||||
|
data.setTotalElectricity(chargingDegree); // 总用电量
|
||||||
|
data.setStopReasonMsg("人工结算订单,操作人:" + SecurityUtils.getUsername()); // 停止原因
|
||||||
|
|
||||||
|
// if (StringUtils.equals(chargingAmount, Constants.ZERO) || StringUtils.equals(chargingDegree, Constants.ZERO)) {
|
||||||
|
//
|
||||||
|
// if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||||
|
// RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
||||||
|
// chargingAmount = realTimeMonitorData.getChargingAmount();
|
||||||
|
// chargingDegree = realTimeMonitorData.getChargingDegree();
|
||||||
|
//
|
||||||
|
// data.setConsumptionAmount(chargingAmount); // 总消费金额
|
||||||
|
// data.setTotalElectricity(chargingDegree); // 总用电量
|
||||||
|
// data.setStopReasonMsg("人工结算订单,操作人:" + SecurityUtils.getUsername()); // 停止原因
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询订单退款记录,如存在退款说明已经结算过,不能再次结算
|
// 查询订单退款记录,如存在退款说明已经结算过,不能再次结算
|
||||||
|
|||||||
Reference in New Issue
Block a user