This commit is contained in:
Lemon
2023-10-27 10:30:51 +08:00
parent d08f130b99
commit 3234590200

View File

@@ -103,6 +103,14 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
private IThirdPartyParkingConfigService thirdPartyParkingConfigService;
public static void main(String[] args) {
BigDecimal totalElectricity = new BigDecimal("23.73");
if (totalElectricity.compareTo(BigDecimal.TEN) > 0 ) {
// 充电度数大于10度
System.out.println("123");
}
// 获取消息体
String msg = "000000000000000000000000000000008823000000030601a08c2e0d0404170000380d0404170000000000000000000000000000000000000000000000000000000000000000400d0300ee250000ee250000c84b000000000000000000000000000000000000e0bb040000cee1040000ee250000ee250000c84b00000000000000000000000000000000000000010000380d04041745a511101970000000";
byte[] msgBody = BytesUtil.str2Bcd(msg);
@@ -239,7 +247,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
startIndex += length;
length = 4;
byte[] totalElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String totalElectricity = YKCUtils.convertDecimalPoint(totalElectricityByteArr, 4);
// String totalElectricity = YKCUtils.convertDecimalPoint(totalElectricityByteArr, 4);
// 计损总电量
startIndex += length;
@@ -326,7 +334,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
.valleyAmount(valleyAmount)
.ammeterTotalStart(ammeterTotalStart)
.ammeterTotalEnd(ammeterTotalEnd)
.totalElectricity(totalElectricity)
// .totalElectricity(totalElectricity)
.planLossTotalElectricity(planLossTotalElectricity)
.consumptionAmount(consumptionAmount)
.vinCode(vinCode)
@@ -646,6 +654,20 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
log.error("结算订单发生异常", e);
}
// 给车辆绑定优惠券
try {
BigDecimal totalElectricity = new BigDecimal(data.getTotalElectricity());
if (totalElectricity.compareTo(BigDecimal.TEN) > 0 ) {
// 充电度数大于10度
String bindResult = bindCoupon(orderBasicInfo);
log.info("绑定优惠券 订单信息:{}, result:{}", orderBasicInfo, bindResult);
}
}catch (BusinessException e) {
log.error("绑定优惠券 error, code:{}, msg:{}", e.getCode(), e.getMessage());
} catch (Exception e) {
log.error("绑定优惠券 error,", e);
}
// 联联平台 推送订单信息 notification_orderInfo
try {
// 查询该站点是否推送第三方平台
@@ -683,19 +705,6 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
log.warn("充电桩传来的交易记录,根据交易流水号:{}查询不到订单,判定为可疑账单", transactionCode);
}
// 给车辆绑定优惠券
try {
BigDecimal totalElectricity = new BigDecimal(data.getTotalElectricity());
if (totalElectricity.compareTo(BigDecimal.TEN) > 0 ) {
// 充电度数大于10度
String bindResult = bindCoupon(orderBasicInfo);
log.info("绑定优惠券 订单信息:{}, result:{}", orderBasicInfo, bindResult);
}
}catch (BusinessException e) {
log.error("绑定优惠券 error, code:{}, msg:{}", e.getCode(), e.getMessage());
} catch (Exception e) {
log.error("绑定优惠券 error,", e);
}
}