mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 提取公共方法
This commit is contained in:
@@ -9,14 +9,12 @@ import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.CardStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.OrderMonitorData;
|
||||
import com.jsowell.pile.domain.OrderPayRecord;
|
||||
import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.dto.PayOrderDTO;
|
||||
import com.jsowell.pile.dto.PayOrderSuccessCallbackDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
@@ -409,4 +407,39 @@ public abstract class AbstractOrderLogic {
|
||||
logger.info("redis中取出实时记录保存到表发生异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡状态解锁
|
||||
* 【公共方法】
|
||||
*/
|
||||
protected void cardStatusUnlocked(String logicCard) {
|
||||
try {
|
||||
// 根据物理卡号查出当前为锁定状态的卡
|
||||
PileAuthCard cardInfo = pileAuthCardService.selectSomeStatusCardInfo(CardStatusEnum.START_LOCK.getCode(), logicCard);
|
||||
if (cardInfo != null) {
|
||||
// 将此卡状态改为正常
|
||||
cardInfo.setStatus(CardStatusEnum.NORMAL.getCode());
|
||||
pileAuthCardService.updatePileAuthCard(cardInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("解锁卡状态 error,", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁vin状态
|
||||
* 【公共方法】
|
||||
* @param vinCode
|
||||
*/
|
||||
protected void vinStatusUnlocked(String vinCode) {
|
||||
try {
|
||||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||||
if (plateInfo != null && (StringUtils.equals(plateInfo.getVinStatus(), "2"))) {
|
||||
plateInfo.setVinStatus("1");
|
||||
memberPlateNumberRelationService.updateMemberPlateNumberRelation(plateInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("解锁vin状态 error,", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,40 +198,6 @@ public class DelayMerchantOrderLogic extends AbstractOrderLogic {
|
||||
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderBasicInfo.getOrderCode(), JSONObject.toJSONString(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡状态解锁
|
||||
*/
|
||||
private void cardStatusUnlocked(String logicCard) {
|
||||
try {
|
||||
// 根据物理卡号查出当前为锁定状态的卡
|
||||
PileAuthCard cardInfo = pileAuthCardService.selectSomeStatusCardInfo(CardStatusEnum.START_LOCK.getCode(), logicCard);
|
||||
if (cardInfo != null) {
|
||||
// 将此卡状态改为正常
|
||||
cardInfo.setStatus(CardStatusEnum.NORMAL.getCode());
|
||||
pileAuthCardService.updatePileAuthCard(cardInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("解锁卡状态 error,", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁vin状态
|
||||
*
|
||||
* @param vinCode
|
||||
*/
|
||||
private void vinStatusUnlocked(String vinCode) {
|
||||
try {
|
||||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||||
if (plateInfo != null && (StringUtils.equals(plateInfo.getVinStatus(), "2"))) {
|
||||
plateInfo.setVinStatus("1");
|
||||
memberPlateNumberRelationService.updateMemberPlateNumberRelation(plateInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("解锁vin状态 error,", e);
|
||||
}
|
||||
}
|
||||
|
||||
// uniApp 发送停止充电订阅消息
|
||||
private void sendMsg(OrderBasicInfo orderBasicInfo) {
|
||||
try {
|
||||
|
||||
@@ -207,23 +207,6 @@ public class NotDelayMerchantOrderLogic extends AbstractOrderLogic{
|
||||
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderBasicInfo.getOrderCode(), JSONObject.toJSONString(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡状态解锁
|
||||
*/
|
||||
private void cardStatusUnlocked(String logicCard) {
|
||||
try {
|
||||
// 根据物理卡号查出当前为锁定状态的卡
|
||||
PileAuthCard cardInfo = pileAuthCardService.selectSomeStatusCardInfo(CardStatusEnum.START_LOCK.getCode(), logicCard);
|
||||
if (cardInfo != null) {
|
||||
// 将此卡状态改为正常
|
||||
cardInfo.setStatus(CardStatusEnum.NORMAL.getCode());
|
||||
pileAuthCardService.updatePileAuthCard(cardInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("解锁卡状态 error,", e);
|
||||
}
|
||||
}
|
||||
|
||||
// uniApp 发送停止充电订阅消息
|
||||
private void sendMsg(OrderBasicInfo orderBasicInfo) {
|
||||
try {
|
||||
@@ -236,23 +219,6 @@ public class NotDelayMerchantOrderLogic extends AbstractOrderLogic{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁vin状态
|
||||
*
|
||||
* @param vinCode
|
||||
*/
|
||||
private void vinStatusUnlocked(String vinCode) {
|
||||
try {
|
||||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||||
if (plateInfo != null && (StringUtils.equals(plateInfo.getVinStatus(), "2"))) {
|
||||
plateInfo.setVinStatus("1");
|
||||
memberPlateNumberRelationService.updateMemberPlateNumberRelation(plateInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("解锁vin状态 error,", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单分账逻辑
|
||||
* 订单结算完成,就执行清分and退款
|
||||
|
||||
Reference in New Issue
Block a user