This commit is contained in:
YAS\29473
2025-09-27 13:46:26 +08:00
parent 79e057703f
commit 79bd34d9f6
5 changed files with 102 additions and 42 deletions

View File

@@ -3,15 +3,21 @@ package com.jsowell.api.thirdparty;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.dto.thirdparty.JCTCommonParamsDTO;
import com.jsowell.common.dto.thirdparty.JCTPushRealTimeInfoDTO;
import com.jsowell.common.dto.thirdparty.JCTQueryStationInfoDTO;
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.service.ThirdPartyService;
import com.jsowell.common.util.bean.BeanUtils;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.common.CommonResult;
import com.jsowell.thirdparty.platform.dto.RetryOrderDTO;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;
@@ -35,6 +41,10 @@ public class ChangZhouController extends ThirdPartyBaseController {
@Qualifier("changZhouPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic;
@DubboReference(group = "third", version = "1.0.0", timeout = 10000)
private ThirdPartyService thirdPartyService;
/**
* getToken
@@ -43,8 +53,15 @@ public class ChangZhouController extends ThirdPartyBaseController {
public CommonResult<?> queryToken(@RequestBody CommonParamsDTO dto) {
logger.info("{}-请求令牌 params:{}" , platformName , JSON.toJSONString(dto));
try {
// Map<String, String> map = zdlService.generateToken(dto);
Map<String, String> map = platformLogic.queryToken(dto);
// Map<String, String> map = platformLogic.queryToken(dto);
// 新方法
JCTCommonParamsDTO jctCommonParamsDTO = new JCTCommonParamsDTO();
BeanUtils.copyProperties(dto, jctCommonParamsDTO);
jctCommonParamsDTO.setPlatformType(platformType);
logger.info("请求参数转换后:{}" , JSON.toJSONString(jctCommonParamsDTO));
Map<String, String> map = thirdPartyService.queryToken(jctCommonParamsDTO);
logger.info("{}-请求令牌 result:{}" , platformName , map);
return CommonResult.success(0 , "请求令牌成功!" , map.get("Data") , map.get("Sig"));
} catch (Exception e) {
@@ -78,8 +95,15 @@ public class ChangZhouController extends ThirdPartyBaseController {
// 解析入参
QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto , QueryStationInfoDTO.class);
JCTQueryStationInfoDTO jctQueryStationInfoDTO = new JCTQueryStationInfoDTO();
BeanUtils.copyProperties(queryStationInfoDTO, jctQueryStationInfoDTO);
jctQueryStationInfoDTO.setPlatformType(platformType);
logger.info("请求参数转换后:{}" , JSON.toJSONString(jctQueryStationInfoDTO));
// 执行逻辑
Map<String, String> map = platformLogic.queryStationsInfo(queryStationInfoDTO);
Map<String, String> map = thirdPartyService.queryStationsInfo(jctQueryStationInfoDTO);
// 执行逻辑
// Map<String, String> map = platformLogic.queryStationsInfo(queryStationInfoDTO);
logger.info("{}-查询充电站信息 result:{}" , platformName , JSON.toJSONString(map));
return CommonResult.success(0 , "查询充电站信息成功!" , map.get("Data") , map.get("Sig"));
} catch (Exception e) {
@@ -100,7 +124,14 @@ public class ChangZhouController extends ThirdPartyBaseController {
public RestApiResponse<?> notification_stationStatus(@RequestBody PushRealTimeInfoDTO pushRealTimeInfoDTO , HttpServletRequest request) {
RestApiResponse<?> response = null;
try {
String result = platformLogic.notificationStationStatus(pushRealTimeInfoDTO);
// String result = platformLogic.notificationStationStatus(pushRealTimeInfoDTO);
JCTPushRealTimeInfoDTO jctPushRealTimeInfoDTO = new JCTPushRealTimeInfoDTO();
BeanUtils.copyProperties(pushRealTimeInfoDTO, jctPushRealTimeInfoDTO);
jctPushRealTimeInfoDTO.setPlatformType(platformType);
logger.info("请求参数转换后:{}" , JSON.toJSONString(jctPushRealTimeInfoDTO));
Map<String, String> result = thirdPartyService.notificationStationStatus(jctPushRealTimeInfoDTO);
logger.info("【{}】推送设备状态 result:{}" , this.getClass().getSimpleName() , result);
response = new RestApiResponse<>(result);
} catch (BusinessException e) {