mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 交易记录逻辑
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package com.jsowell.common.enums.ykc;
|
||||
|
||||
/**
|
||||
* 卡状态枚举
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/6 9:17
|
||||
*/
|
||||
public enum CardStatusEnum {
|
||||
|
||||
WAIT_ACTIVATION("0", "待激活"),
|
||||
NORMAL("1", "正常使用"),
|
||||
START_LOCK("2", "启动锁定"),
|
||||
STOP_USE("9", "停用"),
|
||||
;
|
||||
|
||||
|
||||
private String code;
|
||||
private String value;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
CardStatusEnum(String code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getCardStatus(String code) {
|
||||
for (CardStatusEnum cardStatusEnum : CardStatusEnum.values()) {
|
||||
if (cardStatusEnum.getCode().equals(code)) {
|
||||
return cardStatusEnum.getValue();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ public enum StartModeEnum {
|
||||
WEB("0", "后管启动"),
|
||||
APP("1","用户app启动"),
|
||||
CARD("2", "卡启动"),
|
||||
|
||||
OFFLINE_CARD("3", "离线卡启动"),
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.YKCFrameTypeCode;
|
||||
import com.jsowell.common.enums.ykc.CardStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
@@ -130,7 +131,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_NOT_BIND_USER);
|
||||
}
|
||||
// 判断卡状态
|
||||
if (!StringUtils.equals("1", pileAuthCardInfo.getStatus())) {
|
||||
if (!StringUtils.equals(CardStatusEnum.NORMAL.getCode(), pileAuthCardInfo.getStatus())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.CardStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.StartModeEnum;
|
||||
import com.jsowell.common.enums.ykc.YKCChargingStopReasonEnum;
|
||||
@@ -594,11 +595,11 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
||||
}
|
||||
if (!StringUtils.equals("0000000000000000", data.getLogicCard())) {
|
||||
// 根据物理卡号查出当前为锁定状态的卡
|
||||
PileAuthCard cardInfo = pileAuthCardService.selectSomeStatusCardInfo("2", orderBasicInfo.getLogicCard());
|
||||
PileAuthCard cardInfo = pileAuthCardService.selectSomeStatusCardInfo(CardStatusEnum.START_LOCK.getCode(), orderBasicInfo.getLogicCard());
|
||||
if (cardInfo != null) {
|
||||
// orderBasicInfo.setMemberId(cardInfo.getMemberId());
|
||||
// 将此卡状态改为正常
|
||||
cardInfo.setStatus("1");
|
||||
cardInfo.setStatus(CardStatusEnum.NORMAL.getCode());
|
||||
pileAuthCardService.updatePileAuthCard(cardInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -744,8 +744,8 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
orderBasicInfo.setOrderCode(orderCode);
|
||||
// 交易流水号
|
||||
orderBasicInfo.setTransactionCode(data.getTransactionCode());
|
||||
// 订单状态 固定值异常
|
||||
orderBasicInfo.setOrderStatus(OrderStatusEnum.SUSPICIOUS.getValue());
|
||||
// 订单状态 固定值异常 (2023.4.6 要求改成“订单完成”)
|
||||
orderBasicInfo.setOrderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue());
|
||||
// 站点id
|
||||
orderBasicInfo.setStationId(pileInfoVO.getStationId());
|
||||
// 充电桩编号
|
||||
@@ -757,18 +757,18 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
// 启动方式
|
||||
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);
|
||||
// if (StringUtils.equals(transactionIdentifier, "01")) {
|
||||
// startMode = StartModeEnum.APP.getValue();
|
||||
// } else if (StringUtils.equals(transactionIdentifier, "02")) {
|
||||
// // 卡启动
|
||||
// startMode = StartModeEnum.CARD.getValue();
|
||||
// }
|
||||
// 卡号
|
||||
if (StringUtils.isNotBlank(data.getLogicCard())) {
|
||||
startMode = StartModeEnum.CARD.getValue();
|
||||
startMode = StartModeEnum.OFFLINE_CARD.getValue();
|
||||
orderBasicInfo.setLogicCard(data.getLogicCard());
|
||||
}
|
||||
orderBasicInfo.setStartMode(startMode);
|
||||
// 支付方式
|
||||
orderBasicInfo.setPayMode(null);
|
||||
// 支付金额
|
||||
|
||||
Reference in New Issue
Block a user