mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-10 17:19:36 +08:00
update
This commit is contained in:
@@ -109,13 +109,12 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
BigDecimal totalElectricity = new BigDecimal("23.73");
|
BigDecimal totalElectricity = new BigDecimal("23.73");
|
||||||
if (totalElectricity.compareTo(BigDecimal.TEN) > 0 ) {
|
if (totalElectricity.compareTo(BigDecimal.TEN) > 0) {
|
||||||
// 充电度数大于10度
|
// 充电度数大于10度
|
||||||
System.out.println("123");
|
System.out.println("123");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取消息体
|
// 获取消息体
|
||||||
String msg = "000000000000000000000000000000008823000000030601a08c2e0d0404170000380d0404170000000000000000000000000000000000000000000000000000000000000000400d0300ee250000ee250000c84b000000000000000000000000000000000000e0bb040000cee1040000ee250000ee250000c84b00000000000000000000000000000000000000010000380d04041745a511101970000000";
|
String msg = "000000000000000000000000000000008823000000030601a08c2e0d0404170000380d0404170000000000000000000000000000000000000000000000000000000000000000400d0300ee250000ee250000c84b000000000000000000000000000000000000e0bb040000cee1040000ee250000ee250000c84b00000000000000000000000000000000000000010000380d04041745a511101970000000";
|
||||||
byte[] msgBody = BytesUtil.str2Bcd(msg);
|
byte[] msgBody = BytesUtil.str2Bcd(msg);
|
||||||
@@ -302,7 +301,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
// byte[] logicCardNum = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
// byte[] logicCardNum = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
||||||
String logicCard = BytesUtil.binary(cardNumByteArr, 16);
|
String logicCard = BytesUtil.binary(cardNumByteArr, 16);
|
||||||
log.info("桩号:{}发送交易记录物理卡号:{}", pileSn, logicCard);
|
log.info("桩号:{}, 发送交易记录物理卡号:{}", pileSn, logicCard);
|
||||||
|
|
||||||
log.info("[===交易记录===]交易流水号:{}, 桩编号:{}, 枪号:{}, 开始时间:{}, 结束时间:{}, 尖单价:{}, 尖电量:{}, 计损尖电量:{}, 尖金额:{}, " +
|
log.info("[===交易记录===]交易流水号:{}, 桩编号:{}, 枪号:{}, 开始时间:{}, 结束时间:{}, 尖单价:{}, 尖电量:{}, 计损尖电量:{}, 尖金额:{}, " +
|
||||||
"峰单价:{}, 峰电量:{}, 计损峰电量:{}, 峰金额:{}, 平单价:{}, 平电量:{}, 计损平电量:{}, 平金额:{}, " +
|
"峰单价:{}, 峰电量:{}, 计损峰电量:{}, 峰金额:{}, 平单价:{}, 平电量:{}, 计损平电量:{}, 平金额:{}, " +
|
||||||
@@ -542,7 +541,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
// byte[] logicCardNum = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
// byte[] logicCardNum = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
||||||
String logicCard = BytesUtil.binary(cardNumByteArr, 16);
|
String logicCard = BytesUtil.binary(cardNumByteArr, 16);
|
||||||
log.info("桩号:{}发送交易记录物理卡号:{}", pileSn, logicCard);
|
log.info("桩号:{}, 发送交易记录物理卡号:{}", pileSn, logicCard);
|
||||||
|
|
||||||
log.info("[===交易记录===]交易流水号:{}, 桩编号:{}, 枪号:{}, 开始时间:{}, 结束时间:{}, 尖单价:{}, 尖电量:{}, 计损尖电量:{}, 尖金额:{}, " +
|
log.info("[===交易记录===]交易流水号:{}, 桩编号:{}, 枪号:{}, 开始时间:{}, 结束时间:{}, 尖单价:{}, 尖电量:{}, 计损尖电量:{}, 尖金额:{}, " +
|
||||||
"峰单价:{}, 峰电量:{}, 计损峰电量:{}, 峰金额:{}, 平单价:{}, 平电量:{}, 计损平电量:{}, 平金额:{}, " +
|
"峰单价:{}, 峰电量:{}, 计损峰电量:{}, 峰金额:{}, 平单价:{}, 平电量:{}, 计损平电量:{}, 平金额:{}, " +
|
||||||
@@ -625,6 +624,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 收到交易记录 处理订单
|
* 收到交易记录 处理订单
|
||||||
|
*
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
private void processOrder(TransactionRecordsData data) {
|
private void processOrder(TransactionRecordsData data) {
|
||||||
@@ -667,12 +667,12 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
// 给车辆绑定优惠券
|
// 给车辆绑定优惠券
|
||||||
try {
|
try {
|
||||||
BigDecimal totalElectricity = new BigDecimal(data.getTotalElectricity());
|
BigDecimal totalElectricity = new BigDecimal(data.getTotalElectricity());
|
||||||
if (totalElectricity.compareTo(BigDecimal.TEN) > 0 ) {
|
if (totalElectricity.compareTo(BigDecimal.TEN) > 0) {
|
||||||
// 充电度数大于10度
|
// 充电度数大于10度
|
||||||
String bindResult = bindCoupon(orderBasicInfo);
|
String bindResult = bindCoupon(orderBasicInfo);
|
||||||
log.info("绑定优惠券 订单信息:{}, result:{}", orderBasicInfo, bindResult);
|
log.info("绑定优惠券 订单信息:{}, result:{}", orderBasicInfo, bindResult);
|
||||||
}
|
}
|
||||||
}catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
log.error("绑定优惠券 error, code:{}, msg:{}", e.getCode(), e.getMessage());
|
log.error("绑定优惠券 error, code:{}, msg:{}", e.getCode(), e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("绑定优惠券 error,", e);
|
log.error("绑定优惠券 error,", e);
|
||||||
@@ -729,6 +729,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定优惠券
|
* 绑定优惠券
|
||||||
|
*
|
||||||
* @param orderBasicInfo
|
* @param orderBasicInfo
|
||||||
* @return
|
* @return
|
||||||
* @throws UnsupportedEncodingException
|
* @throws UnsupportedEncodingException
|
||||||
|
|||||||
Reference in New Issue
Block a user