mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update
This commit is contained in:
@@ -827,9 +827,138 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
BeanUtils.copyBeanProp(data, record);
|
BeanUtils.copyBeanProp(data, record);
|
||||||
data.setTransactionCode(record.getOrderCode());
|
data.setTransactionCode(record.getOrderCode());
|
||||||
logger.info("异常订单记录 data:{}", data);
|
logger.info("异常订单记录 data:{}", data);
|
||||||
|
tempSaveAbnormalOrder(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void tempSaveAbnormalOrder(TransactionRecordsData data) {
|
||||||
|
// 保存到订单主表
|
||||||
|
// 订单基本信息
|
||||||
|
PileInfoVO pileInfoVO = pileBasicInfoService.selectPileInfoBySn(data.getPileSn());
|
||||||
|
if (pileInfoVO == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String orderCode = IdUtils.getOrderCode();
|
||||||
|
OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder().build();
|
||||||
|
// 订单编号
|
||||||
|
orderBasicInfo.setOrderCode(orderCode);
|
||||||
|
// 交易流水号
|
||||||
|
orderBasicInfo.setTransactionCode(data.getTransactionCode());
|
||||||
|
// 订单状态 固定值异常
|
||||||
|
orderBasicInfo.setOrderStatus(OrderStatusEnum.SUSPICIOUS.getValue());
|
||||||
|
// 站点id
|
||||||
|
orderBasicInfo.setStationId(pileInfoVO.getStationId());
|
||||||
|
// 充电桩编号
|
||||||
|
orderBasicInfo.setPileSn(data.getPileSn());
|
||||||
|
// 枪口号
|
||||||
|
orderBasicInfo.setConnectorCode(data.getConnectorCode());
|
||||||
|
// 枪口编号
|
||||||
|
orderBasicInfo.setPileConnectorCode(pileInfoVO.getPileSn() + data.getConnectorCode());
|
||||||
|
// 启动方式
|
||||||
|
String transactionIdentifier = data.getTransactionIdentifier();
|
||||||
|
String startMode = null;
|
||||||
|
if (StringUtils.equals(transactionIdentifier, "01")) {
|
||||||
|
startMode = StartModeEnum.APP.getValue();
|
||||||
|
} else if (StringUtils.equals(transactionIdentifier, "02")) {
|
||||||
|
// 卡启动
|
||||||
|
startMode = StartModeEnum.CARD.getValue();
|
||||||
|
}
|
||||||
|
orderBasicInfo.setStartMode(startMode);
|
||||||
|
// 支付方式
|
||||||
|
orderBasicInfo.setPayMode(null);
|
||||||
|
// 支付金额
|
||||||
|
orderBasicInfo.setPayAmount(null);
|
||||||
|
// 支付状态
|
||||||
|
orderBasicInfo.setPayStatus(null);
|
||||||
|
// 支付时间
|
||||||
|
orderBasicInfo.setPayTime(null);
|
||||||
|
// 订单金额
|
||||||
|
orderBasicInfo.setOrderAmount(new BigDecimal(data.getConsumptionAmount()));
|
||||||
|
// 充电开始时间
|
||||||
|
orderBasicInfo.setChargeStartTime(DateUtils.parseDate(data.getStartTime()));
|
||||||
|
// 充电结束时间
|
||||||
|
orderBasicInfo.setChargeEndTime(DateUtils.parseDate(data.getEndTime()));
|
||||||
|
// 停止原因
|
||||||
|
orderBasicInfo.setReason(data.getStopReasonMsg());
|
||||||
|
// 结算时间
|
||||||
|
orderBasicInfo.setSettlementTime(DateUtils.getNowDate());
|
||||||
|
// 创建人
|
||||||
|
orderBasicInfo.setCreateBy(data.getLogicCard());
|
||||||
|
orderBasicInfo.setUpdateBy("system");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 订单详情
|
||||||
|
OrderDetail orderDetail = OrderDetail.builder().build();
|
||||||
|
// 订单编号
|
||||||
|
orderDetail.setOrderCode(orderCode);
|
||||||
|
// 订单总金额
|
||||||
|
orderDetail.setTotalOrderAmount(new BigDecimal(data.getConsumptionAmount()));
|
||||||
|
// 总用电量
|
||||||
|
orderDetail.setTotalUsedElectricity(new BigDecimal(data.getTotalElectricity()));
|
||||||
|
// 总服务费金额
|
||||||
|
// orderDetail.setTotalServiceAmount();
|
||||||
|
// 总电费金额
|
||||||
|
// orderDetail.setTotalElectricityAmount();
|
||||||
|
|
||||||
|
// 尖时段金额
|
||||||
|
orderDetail.setSharpAmount(new BigDecimal(data.getSharpAmount()));
|
||||||
|
// 尖时段单价
|
||||||
|
orderDetail.setSharpPrice(new BigDecimal(data.getSharpPrice()));
|
||||||
|
// 尖时段服务费单价
|
||||||
|
// orderDetail.setSharpServicePrice();
|
||||||
|
// 尖时段电费单价
|
||||||
|
// orderDetail.setSharpElectricityPrice();
|
||||||
|
// 尖时段用电量
|
||||||
|
orderDetail.setSharpUsedElectricity(new BigDecimal(data.getSharpUsedElectricity()));
|
||||||
|
|
||||||
|
// 峰时段金额
|
||||||
|
orderDetail.setPeakAmount(new BigDecimal(data.getPeakAmount()));
|
||||||
|
// 峰时段单价
|
||||||
|
orderDetail.setPeakPrice(new BigDecimal(data.getPeakPrice()));
|
||||||
|
// 峰时段服务费单价
|
||||||
|
// orderDetail.setPeakServicePrice();
|
||||||
|
// 峰时段电费单价
|
||||||
|
// orderDetail.setPeakElectricityPrice();
|
||||||
|
// 峰时段用电量
|
||||||
|
orderDetail.setPeakUsedElectricity(new BigDecimal(data.getPeakUsedElectricity()));
|
||||||
|
|
||||||
|
// 平时段金额
|
||||||
|
orderDetail.setFlatAmount(new BigDecimal(data.getFlatAmount()));
|
||||||
|
// 平时段单价
|
||||||
|
orderDetail.setFlatPrice(new BigDecimal(data.getFlatPrice()));
|
||||||
|
// 平时段服务费单价
|
||||||
|
// orderDetail.setFlatServicePrice();
|
||||||
|
// 平时段电费单价
|
||||||
|
// orderDetail.setFlatElectricityPrice();
|
||||||
|
// 平时段用电量
|
||||||
|
orderDetail.setFlatUsedElectricity(new BigDecimal(data.getFlatUsedElectricity()));
|
||||||
|
|
||||||
|
|
||||||
|
// 谷时段金额
|
||||||
|
orderDetail.setValleyAmount(new BigDecimal(data.getValleyAmount()));
|
||||||
|
// 谷时段单价
|
||||||
|
orderDetail.setValleyPrice(new BigDecimal(data.getValleyPrice()));
|
||||||
|
// 谷时段服务费单价
|
||||||
|
// orderDetail.setValleyServicePrice();
|
||||||
|
// 谷时段电费单价
|
||||||
|
// orderDetail.setValleyElectricityPrice();
|
||||||
|
// 谷时段用电量
|
||||||
|
orderDetail.setValleyUsedElectricity(new BigDecimal(data.getValleyUsedElectricity()));
|
||||||
|
orderDetail.setUpdateBy("system");
|
||||||
|
|
||||||
|
if (data.getCreateTime() != null) {
|
||||||
|
orderBasicInfo.setCreateTime(data.getCreateTime());
|
||||||
|
orderDetail.setCreateTime(data.getCreateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder()
|
||||||
|
.orderBasicInfo(orderBasicInfo)
|
||||||
|
.orderDetail(orderDetail)
|
||||||
|
.build();
|
||||||
|
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单编号获取充电实时数据 时间倒序
|
* 根据订单编号获取充电实时数据 时间倒序
|
||||||
* 订单只有在充电中,才会把实时数据保存到redis
|
* 订单只有在充电中,才会把实时数据保存到redis
|
||||||
|
|||||||
@@ -539,7 +539,7 @@
|
|||||||
peak_price, peak_used_electricity, peak_electricity_price, peak_service_price, peak_amount,
|
peak_price, peak_used_electricity, peak_electricity_price, peak_service_price, peak_amount,
|
||||||
flat_price, flat_used_electricity, flat_electricity_price, flat_service_price, flat_amount,
|
flat_price, flat_used_electricity, flat_electricity_price, flat_service_price, flat_amount,
|
||||||
valley_price, valley_used_electricity, valley_electricity_price, valley_service_price, valley_amount,
|
valley_price, valley_used_electricity, valley_electricity_price, valley_service_price, valley_amount,
|
||||||
create_by,update_by, createTime)
|
create_by,update_by, create_time)
|
||||||
values
|
values
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
(#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount}, #{item.totalElectricityAmount}, #{item.totalServiceAmount},
|
(#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount}, #{item.totalElectricityAmount}, #{item.totalServiceAmount},
|
||||||
|
|||||||
Reference in New Issue
Block a user