mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-15 04:39:50 +08:00
update
This commit is contained in:
@@ -103,6 +103,14 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
private IThirdPartyParkingConfigService thirdPartyParkingConfigService;
|
private IThirdPartyParkingConfigService thirdPartyParkingConfigService;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
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";
|
String msg = "000000000000000000000000000000008823000000030601a08c2e0d0404170000380d0404170000000000000000000000000000000000000000000000000000000000000000400d0300ee250000ee250000c84b000000000000000000000000000000000000e0bb040000cee1040000ee250000ee250000c84b00000000000000000000000000000000000000010000380d04041745a511101970000000";
|
||||||
byte[] msgBody = BytesUtil.str2Bcd(msg);
|
byte[] msgBody = BytesUtil.str2Bcd(msg);
|
||||||
@@ -239,7 +247,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
startIndex += length;
|
startIndex += length;
|
||||||
length = 4;
|
length = 4;
|
||||||
byte[] totalElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] totalElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
String totalElectricity = YKCUtils.convertDecimalPoint(totalElectricityByteArr, 4);
|
// String totalElectricity = YKCUtils.convertDecimalPoint(totalElectricityByteArr, 4);
|
||||||
|
|
||||||
// 计损总电量
|
// 计损总电量
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
@@ -326,7 +334,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
.valleyAmount(valleyAmount)
|
.valleyAmount(valleyAmount)
|
||||||
.ammeterTotalStart(ammeterTotalStart)
|
.ammeterTotalStart(ammeterTotalStart)
|
||||||
.ammeterTotalEnd(ammeterTotalEnd)
|
.ammeterTotalEnd(ammeterTotalEnd)
|
||||||
.totalElectricity(totalElectricity)
|
// .totalElectricity(totalElectricity)
|
||||||
.planLossTotalElectricity(planLossTotalElectricity)
|
.planLossTotalElectricity(planLossTotalElectricity)
|
||||||
.consumptionAmount(consumptionAmount)
|
.consumptionAmount(consumptionAmount)
|
||||||
.vinCode(vinCode)
|
.vinCode(vinCode)
|
||||||
@@ -646,6 +654,20 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
log.error("结算订单发生异常", e);
|
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
|
// 联联平台 推送订单信息 notification_orderInfo
|
||||||
try {
|
try {
|
||||||
// 查询该站点是否推送第三方平台
|
// 查询该站点是否推送第三方平台
|
||||||
@@ -683,19 +705,6 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
log.warn("充电桩传来的交易记录,根据交易流水号:{}查询不到订单,判定为可疑账单", transactionCode);
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user