mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-04 14:08:01 +08:00
update 江苏省平台接口
This commit is contained in:
@@ -8,6 +8,7 @@ import com.jsowell.common.core.domain.AjaxResult;
|
|||||||
import com.jsowell.common.core.page.TableDataInfo;
|
import com.jsowell.common.core.page.TableDataInfo;
|
||||||
import com.jsowell.common.enums.BusinessType;
|
import com.jsowell.common.enums.BusinessType;
|
||||||
import com.jsowell.common.enums.DelFlagEnum;
|
import com.jsowell.common.enums.DelFlagEnum;
|
||||||
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
@@ -29,6 +30,7 @@ import com.jsowell.pile.service.IThirdPartySettingInfoService;
|
|||||||
import com.jsowell.pile.vo.web.PileStationVO;
|
import com.jsowell.pile.vo.web.PileStationVO;
|
||||||
import com.jsowell.service.PileService;
|
import com.jsowell.service.PileService;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
|
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -61,6 +63,9 @@ public class PileStationInfoController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ZDLService zdlService;
|
private ZDLService zdlService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NRService nrService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IThirdPartyStationRelationService thirdPartyStationRelationService;
|
private IThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||||
|
|
||||||
@@ -282,13 +287,18 @@ public class PileStationInfoController extends BaseController {
|
|||||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
}
|
}
|
||||||
String result = "";
|
String result = "";
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
|
||||||
// 推送联联
|
// 推送联联
|
||||||
if (StringUtils.equals("1", dto.getThirdPartyType())) {
|
|
||||||
result = lianLianService.pushStationInfo(dto);
|
result = lianLianService.pushStationInfo(dto);
|
||||||
} else if (StringUtils.equals("2", dto.getThirdPartyType())) {
|
}
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
|
||||||
// 中电联
|
// 中电联
|
||||||
result = zdlService.pushStationInfo(dto);
|
result = zdlService.pushStationInfo(dto);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), dto.getThirdPartyType())) {
|
||||||
|
// 江苏省平台
|
||||||
|
result = nrService.pushStationInfo(dto);
|
||||||
|
}
|
||||||
response = new RestApiResponse<>(result);
|
response = new RestApiResponse<>(result);
|
||||||
}catch (BusinessException e) {
|
}catch (BusinessException e) {
|
||||||
logger.error("推送第三方平台充电站信息 error",e);
|
logger.error("推送第三方平台充电站信息 error",e);
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: jsowell_dev
|
# username: jsowell_dev
|
||||||
# url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# username: jsowell_prd_copy
|
username: jsowell_prd_copy
|
||||||
password: 123456
|
password: 123456
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
|
|||||||
57
jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java
vendored
Normal file
57
jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package com.jsowell.common.enums.thirdparty;
|
||||||
|
|
||||||
|
import com.jsowell.common.enums.ykc.ChargingFailedReasonEnum;
|
||||||
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方对接平台 type
|
||||||
|
*
|
||||||
|
* @author Lemon
|
||||||
|
* @Date 2023/10/23 8:21:33
|
||||||
|
*/
|
||||||
|
public enum ThirdPlatformTypeEnum {
|
||||||
|
LIAN_LIAN_PLATFORM("1", "联联平台"),
|
||||||
|
ZHONG_DIAN_LIAN_PLATFORM("2", "中电联平台"),
|
||||||
|
JIANG_SU_PLATFORM("3", "江苏省平台"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
ThirdPlatformTypeEnum(String code, String label) {
|
||||||
|
this.code = code;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取停止原因描述
|
||||||
|
*
|
||||||
|
* @param code 编码
|
||||||
|
* @return 停止原因描述
|
||||||
|
*/
|
||||||
|
public static String getMsgByCode(String code) {
|
||||||
|
for (ThirdPlatformTypeEnum item : ThirdPlatformTypeEnum.values()) {
|
||||||
|
if (StringUtils.equals(item.getCode(), code)) {
|
||||||
|
return item.getLabel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ 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.core.redis.RedisCache;
|
import com.jsowell.common.core.redis.RedisCache;
|
||||||
import com.jsowell.common.enums.parkplatform.ParkingEnum;
|
import com.jsowell.common.enums.parkplatform.ParkingEnum;
|
||||||
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
import com.jsowell.common.enums.ykc.YKCChargingStopReasonEnum;
|
import com.jsowell.common.enums.ykc.YKCChargingStopReasonEnum;
|
||||||
@@ -31,7 +32,9 @@ import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
|||||||
import com.jsowell.pile.vo.web.PileStationVO;
|
import com.jsowell.pile.vo.web.PileStationVO;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
||||||
|
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||||
import com.jsowell.thirdparty.ruanjie.service.RJService;
|
import com.jsowell.thirdparty.ruanjie.service.RJService;
|
||||||
|
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -78,6 +81,12 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private LianLianService lianLianService;
|
private LianLianService lianLianService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ZDLService zdlService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NRService nrService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IThirdPartyStationRelationService thirdPartyStationRelationService;
|
private IThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||||
|
|
||||||
@@ -639,17 +648,31 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
|
|
||||||
// 联联平台 推送订单信息 notification_orderInfo
|
// 联联平台 推送订单信息 notification_orderInfo
|
||||||
try {
|
try {
|
||||||
// 查询该站点是否推送联联平台
|
// 查询该站点是否推送第三方平台
|
||||||
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
||||||
relation.setStationId(Long.parseLong(orderBasicInfo.getStationId()));
|
relation.setStationId(Long.parseLong(orderBasicInfo.getStationId()));
|
||||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
||||||
// ThirdPartySettingInfo infoByStationId = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(stationId));
|
// ThirdPartySettingInfo infoByStationId = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(stationId));
|
||||||
if (Objects.nonNull(relationInfo)) {
|
if (Objects.isNull(relationInfo)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String thirdPartyType = relation.getThirdPartyType();
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
|
||||||
|
// 联联平台
|
||||||
// 推送订单信息
|
// 推送订单信息
|
||||||
lianLianService.pushOrderInfo(orderBasicInfo.getOrderCode());
|
lianLianService.pushOrderInfo(orderBasicInfo.getOrderCode());
|
||||||
// 推送充电订单信息
|
// 推送充电订单信息
|
||||||
lianLianService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
|
lianLianService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
|
||||||
|
// 中电联
|
||||||
|
zdlService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
|
||||||
|
}
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), thirdPartyType)) {
|
||||||
|
// 江苏平台
|
||||||
|
// 推送订单信息
|
||||||
|
nrService.pushOrderInfo(orderBasicInfo.getOrderCode());
|
||||||
|
}
|
||||||
// 调用相关接口
|
// 调用相关接口
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("联联平台 推送订单信息发生异常", e);
|
log.error("联联平台 推送订单信息发生异常", e);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
|||||||
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.core.redis.RedisCache;
|
import com.jsowell.common.core.redis.RedisCache;
|
||||||
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||||
import com.jsowell.common.enums.ykc.YKCPileFaultReasonEnum;
|
import com.jsowell.common.enums.ykc.YKCPileFaultReasonEnum;
|
||||||
import com.jsowell.common.util.BytesUtil;
|
import com.jsowell.common.util.BytesUtil;
|
||||||
@@ -19,6 +20,7 @@ import com.jsowell.pile.domain.ThirdPartyStationRelation;
|
|||||||
import com.jsowell.pile.service.*;
|
import com.jsowell.pile.service.*;
|
||||||
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
|
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -69,6 +71,9 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ZDLService zdlService;
|
private ZDLService zdlService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NRService nrService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) {
|
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) {
|
||||||
log.info("[===获取桩上传的实时监测数据===] param:{}, channel:{}", JSONObject.toJSONString(ykcDataProtocol), channel.toString());
|
log.info("[===获取桩上传的实时监测数据===] param:{}, channel:{}", JSONObject.toJSONString(ykcDataProtocol), channel.toString());
|
||||||
@@ -318,7 +323,7 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String pileConnectorCode = pileSn + connectorCode;
|
String pileConnectorCode = pileSn + connectorCode;
|
||||||
if (StringUtils.equals("1", relationInfo.getThirdPartyType())) {
|
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), relationInfo.getThirdPartyType())) {
|
||||||
// 联联
|
// 联联
|
||||||
log.info("推送联联平台实时数据 params: orderBasicInfo:{}", JSON.toJSONString(orderInfo));
|
log.info("推送联联平台实时数据 params: orderBasicInfo:{}", JSON.toJSONString(orderInfo));
|
||||||
// 设备状态变化推送 notification_stationStatus
|
// 设备状态变化推送 notification_stationStatus
|
||||||
@@ -329,11 +334,17 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
|
|||||||
}
|
}
|
||||||
// 推送充电状态
|
// 推送充电状态
|
||||||
lianLianService.pushChargeStatus(orderInfo.getOrderCode());
|
lianLianService.pushChargeStatus(orderInfo.getOrderCode());
|
||||||
}else if (StringUtils.equals("2", relationInfo.getThirdPartyType())) {
|
}
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), relationInfo.getThirdPartyType())) {
|
||||||
// 中电联
|
// 中电联
|
||||||
log.info("推送中电联平台实时数据 params: orderBasicInfo:{}", JSON.toJSONString(orderInfo));
|
log.info("推送中电联平台实时数据 params: orderBasicInfo:{}", JSON.toJSONString(orderInfo));
|
||||||
zdlService.notificationStationStatus(pileConnectorCode, connectorStatus);
|
zdlService.notificationStationStatus(pileConnectorCode, connectorStatus);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), relation.getThirdPartyType())) {
|
||||||
|
// 江苏省平台
|
||||||
|
String result = nrService.pushPileStatus(realTimeMonitorData);
|
||||||
|
log.info("推送江苏省平台实时数据 result:{}", result);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("推送第三方平台 实时数据 异常", e);
|
log.error("推送第三方平台 实时数据 异常", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user