新增 甬城泊车相关接口、controller

This commit is contained in:
Lemon
2023-11-06 15:28:34 +08:00
parent 23e52ca90c
commit f73806955d
10 changed files with 147 additions and 39 deletions

View File

@@ -3,6 +3,7 @@ package com.jsowell.netty.handler;
import com.alibaba.fastjson2.JSONObject;
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.enums.ykc.OrderStatusEnum;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.common.util.StringUtils;
@@ -15,6 +16,7 @@ import com.jsowell.pile.service.IThirdPartyStationRelationService;
import com.jsowell.pile.service.IThirdPartySettingInfoService;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +46,9 @@ public class ChargeEndHandler extends AbstractHandler{
@Autowired
private LianLianService lianLianService;
@Autowired
private YCBCService ycbcService;
@Autowired
private IThirdPartyStationRelationService thirdPartyStationRelationService;
@@ -137,10 +142,19 @@ public class ChargeEndHandler extends AbstractHandler{
relation.setStationId(Long.parseLong(orderInfo.getStationId()));
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
// ThirdPartySettingInfo info = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
if (Objects.nonNull(relationInfo)) {
if (Objects.isNull(relationInfo)) {
return null;
}
// 联联平台
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), relationInfo.getThirdPartyType())) {
// 推送停止充电结果
lianLianService.pushStopChargeResult(orderInfo.getOrderCode());
}
// 甬城泊车平台
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), relationInfo.getThirdPartyType())) {
ycbcService.pushStopChargeResult(orderInfo.getOrderCode());
}
} catch (Exception e) {
log.error("联联平台推送停止充电结果异常", e);
}