mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-03 21:48:13 +08:00
update 并充逻辑
This commit is contained in:
@@ -211,12 +211,13 @@ public class PaymentTestController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 提现方法
|
* 提现方法
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void withdraw() {
|
public void withdraw() {
|
||||||
String merchantId = "349";
|
String merchantId = "349";
|
||||||
String orderNo = "drawcash_" + merchantId + "_" + System.currentTimeMillis();
|
String orderNo = "drawcash_" + merchantId + "_" + System.currentTimeMillis();
|
||||||
BigDecimal cashAmt = new BigDecimal("560.17");
|
BigDecimal cashAmt = new BigDecimal("256.47");
|
||||||
String adapayMemberId = "ACM88073310";
|
String adapayMemberId = "ACM88073310";
|
||||||
// String adapayAppId = "app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa"; // 固定参数, 汇付配置的万车充小程序appId
|
// String adapayAppId = "app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa"; // 固定参数, 汇付配置的万车充小程序appId
|
||||||
String settleAccountId = "0744607938214272";
|
String settleAccountId = "0744607938214272";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.netty.handler.yunkuaichong;
|
package com.jsowell.netty.handler.yunkuaichong;
|
||||||
|
|
||||||
import com.google.common.primitives.Bytes;
|
import com.google.common.primitives.Bytes;
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||||
import com.jsowell.common.util.BytesUtil;
|
import com.jsowell.common.util.BytesUtil;
|
||||||
@@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,16 +118,22 @@ public class PileApplyMergeChargeHandler extends AbstractYkcHandler{
|
|||||||
.mergeChargeNumber(mergeChargeNumber)
|
.mergeChargeNumber(mergeChargeNumber)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
Map<String, Object> map = orderBasicInfoService.verifyMergeChargeOrder(dto);
|
|
||||||
|
|
||||||
|
String transactionCode = Constants.ILLEGAL_TRANSACTION_CODE;
|
||||||
|
byte[] authenticationFlagByteArr = Constants.zeroByteArray; // 鉴权成功标识
|
||||||
|
byte[] accountBalanceByteArr = Constants.zeroByteArray; // 账户余额
|
||||||
|
try {
|
||||||
|
map = orderBasicInfoService.verifyMergeChargeOrder(dto);
|
||||||
|
log.info("桩号:{}, 并充订单鉴权成功, 结果map:{}", pileSn, map);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("桩号:{}, 并充订单鉴权失败, ", pileSn, e);
|
log.error("桩号:{}, 并充订单鉴权失败, ", pileSn, e);
|
||||||
}
|
}
|
||||||
|
if (map != null) {
|
||||||
String transactionCode = "";
|
transactionCode = (String) map.get("transactionCode");
|
||||||
String accountAmount = "";
|
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(map.get("accountBalance")), 2);
|
||||||
String verifyFlag = "";
|
authenticationFlagByteArr = Constants.oneByteArray;
|
||||||
|
}
|
||||||
|
|
||||||
// 应答
|
// 应答
|
||||||
// 交易流水号
|
// 交易流水号
|
||||||
@@ -136,9 +144,9 @@ public class PileApplyMergeChargeHandler extends AbstractYkcHandler{
|
|||||||
// 鉴权成功标志
|
// 鉴权成功标志
|
||||||
// 失败原因
|
// 失败原因
|
||||||
// 并充序号
|
// 并充序号
|
||||||
|
byte[] defeatReasonByteArr = Constants.zeroByteArray; // 失败原因
|
||||||
byte[] msgBodyByteArr = Bytes.concat(BytesUtil.str2Bcd(transactionCode), pileSnByteArr, connectorNumByteArr, cardNumByteArr,
|
byte[] msgBodyByteArr = Bytes.concat(BytesUtil.str2Bcd(transactionCode), pileSnByteArr, connectorNumByteArr, cardNumByteArr,
|
||||||
BytesUtil.str2Bcd(accountAmount), BytesUtil.str2Bcd(verifyFlag), mergeChargeNumberByteArr);
|
accountBalanceByteArr, authenticationFlagByteArr, defeatReasonByteArr, mergeChargeNumberByteArr);
|
||||||
|
|
||||||
|
|
||||||
return getResult(ykcDataProtocol, msgBodyByteArr);
|
return getResult(ykcDataProtocol, msgBodyByteArr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user