新增 华为相关接口调用入口

This commit is contained in:
Lemon
2024-01-17 16:12:11 +08:00
parent 536939b722
commit 5a35135500
6 changed files with 37 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ import com.jsowell.pile.service.ThirdPartyStationRelationService;
import com.jsowell.pile.service.ThirdPartySettingInfoService;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.service.PileService;
import com.jsowell.thirdparty.huawei.HuaWeiService;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.nanrui.service.NRService;
import com.jsowell.thirdparty.xindiantu.service.XDTService;
@@ -74,6 +75,9 @@ public class PileStationInfoController extends BaseController {
@Autowired
private XDTService xdtService;
@Autowired
private HuaWeiService huaWeiService;
@Autowired
private ThirdPartyStationRelationService thirdPartyStationRelationService;
@@ -315,6 +319,10 @@ public class PileStationInfoController extends BaseController {
// 新电途平台
result = xdtService.pushStationInfo(dto);
}
if(StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), dto.getThirdPartyType())) {
// 华为
result = huaWeiService.notificationOperationSystemInfo(dto);
}
response = new RestApiResponse<>(result);
}catch (BusinessException e) {
logger.error("推送第三方平台充电站信息 error",e);

View File

@@ -15,6 +15,7 @@ public enum ThirdPartyOperatorIdEnum {
YONG_CHENG_BO_CHE("4", "330205020"),
NING_XIA_JIAO_TOU("5", "MA771QENX"),
XIN_DIAN_TU("6", "MA25CNM38"),
HUA_WEI("7", ""),
;
private String type;

View File

@@ -31,6 +31,7 @@ import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
import com.jsowell.pile.service.programlogic.ProgramLogicFactory;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.huawei.HuaWeiService;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
import com.jsowell.thirdparty.nanrui.service.NRService;
@@ -108,6 +109,9 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
@Autowired
private RJService rjService;
@Autowired
private HuaWeiService huaWeiService;
@Autowired
private ThirdPartyParkingConfigService thirdPartyParkingConfigService;
@@ -718,6 +722,13 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
// 推送订单信息
xdtService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
// 华为
// 推送停止充电结果
huaWeiService.notificationStopChargeResult(orderBasicInfo.getOrderCode());
// 推送订单信息
huaWeiService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(orderBasicInfo.getStartMode(), StartModeEnum.THIRD_PARTY_PLATFORM.getValue())) {

View File

@@ -23,6 +23,7 @@ import com.jsowell.pile.service.PileConnectorInfoService;
import com.jsowell.pile.service.ThirdPartyStationRelationService;
import com.jsowell.pile.service.OrderBasicInfoService;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.thirdparty.huawei.HuaWeiService;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.nanrui.service.NRService;
import com.jsowell.thirdparty.xindiantu.service.XDTService;
@@ -85,6 +86,9 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
@Autowired
private XDTService xdtService;
@Autowired
private HuaWeiService huaWeiService;
@Override
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) {
// log.info("[===获取桩上传的实时监测数据===] param:{}, channel:{}", JSONObject.toJSONString(ykcDataProtocol), channel.toString());
@@ -409,6 +413,15 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
String result = xdtService.notificationEquipChargeStatus(orderInfo.getOrderCode());
log.info("推送新电途平台 充电状态 result:{}", result);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), relationInfo.getThirdPartyType())) {
// 华为平台
huaWeiService.notificationStationStatus(pileConnectorCode, changedStatus);
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
if (orderInfo == null) {
return;
}
huaWeiService.notificationEquipChargeStatus(orderInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), relationInfo.getThirdPartyType())) {
// 甬城泊车

View File

@@ -200,7 +200,7 @@ public interface HuaWeiService {
/**
* 平台充电设备编码同步
* 平台充电设备编码同步 (相当于pushStationInfo)
* 平台 --> 华为
*
* notification_operation_system_info

View File

@@ -108,7 +108,9 @@ public class HttpRequestUtil {
String dataSecretIV, String operatorId, String sigSecret){
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(operatorId);
String label = ThirdPlatformTypeEnum.getLabelByCode(type);
if(StringUtils.isBlank(label)) {
label = operatorId + "(" + url + ")";
}
log.info(label + "发送请求 data:{}", data);
//加密
byte[] encryptText = Cryptos.aesEncrypt(data.getBytes(),