update 新运平台Service

This commit is contained in:
Lemon
2025-01-13 09:15:43 +08:00
parent a094a866d0
commit 569b78bca6
3 changed files with 17 additions and 17 deletions

View File

@@ -20,21 +20,21 @@ import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
/** /**
* 新运平台Controller * 新运平台Controller
* *
* @author Lemon * @author Lemon
* @Date 2025/1/11 15:55:34 * @Date 2025/1/11 15:55:34
*/ */
@Anonymous @Anonymous
@RestController @RestController
@RequestMapping("/xinyunwei") @RequestMapping("/xinyun")
public class XinYunWeiPlatformController extends ThirdPartyBaseController{ public class XinYunPlatformController extends ThirdPartyBaseController{
private final String platformName = "新运平台"; private final String platformName = "新运平台";
private final String platformType = ThirdPlatformTypeEnum.XIN_YUN_WEI_PLATFORM.getTypeCode(); private final String platformType = ThirdPlatformTypeEnum.XIN_YUN_PLATFORM.getTypeCode();
@Autowired @Autowired
@Qualifier("xinYunWeiPlatformServiceImpl") @Qualifier("xinYunPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic; private ThirdPartyPlatformService platformLogic;
/** /**

View File

@@ -30,7 +30,7 @@ public enum ThirdPlatformTypeEnum {
NAN_RUI_PLATFORM("19", "南瑞平台", ""), NAN_RUI_PLATFORM("19", "南瑞平台", ""),
GUANG_XI_PLATFORM("20", "广西平台", "450000000"), GUANG_XI_PLATFORM("20", "广西平台", "450000000"),
XIN_YUN_WEI_PLATFORM("21", "新运平台", ""), XIN_YUN_PLATFORM("21", "新运平台", "MADKXL8FX"),
; ;
private String typeCode; private String typeCode;

View File

@@ -60,7 +60,7 @@ import java.util.stream.Collectors;
* @Date 2025/1/10 8:28:43 * @Date 2025/1/10 8:28:43
*/ */
@Service @Service
public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService { public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
@Autowired @Autowired
private PileStationInfoService pileStationInfoService; private PileStationInfoService pileStationInfoService;
@@ -80,7 +80,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
private RedisCache redisCache; private RedisCache redisCache;
// 平台类型 // 平台类型
private final String thirdPlatformType = ThirdPlatformTypeEnum.XIN_YUN_WEI_PLATFORM.getTypeCode(); private final String thirdPlatformType = ThirdPlatformTypeEnum.XIN_YUN_PLATFORM.getTypeCode();
@Override @Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
@@ -104,7 +104,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
// token缓存key值 // token缓存key值
String redisKey = operatorId + "_token:"; String redisKey = operatorId + "_token:";
// 通过operatorId 查出 operatorSecret // 通过operatorId 查出 operatorSecret
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo(); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
if (thirdPartySecretInfoVO == null) { if (thirdPartySecretInfoVO == null) {
failReason = 1; failReason = 1;
succStat = 1; succStat = 1;
@@ -164,7 +164,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
return null; return null;
} }
// ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); // ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo(); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
PageInfo<ThirdPartyStationInfoVO> pageInfo = new PageInfo<>(stationInfos); PageInfo<ThirdPartyStationInfoVO> pageInfo = new PageInfo<>(stationInfos);
List<SupStationInfo> resultList = new ArrayList<>(); List<SupStationInfo> resultList = new ArrayList<>();
for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) { for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) {
@@ -231,7 +231,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
List<String> stationIds = dto.getStationIds(); List<String> stationIds = dto.getStationIds();
List<StationStatusInfo> StationStatusInfos = new ArrayList<>(); List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
List<Object> ConnectorStatusInfos = new ArrayList<>(); List<Object> ConnectorStatusInfos = new ArrayList<>();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo(); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ConnectorStatusInfo connectorStatusInfo; ConnectorStatusInfo connectorStatusInfo;
for (String stationId : stationIds) { for (String stationId : stationIds) {
@@ -299,7 +299,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public Map<String, String> queryStationStats(QueryStationInfoDTO dto) { public Map<String, String> queryStationStats(QueryStationInfoDTO dto) {
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo(); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
// 根据站点id 查出这段时间的充电量 // 根据站点id 查出这段时间的充电量
List<AccumulativeInfoVO> list = orderBasicInfoService.getAccumulativeInfoForLianLian(dto); List<AccumulativeInfoVO> list = orderBasicInfoService.getAccumulativeInfoForLianLian(dto);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
@@ -390,7 +390,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
if (orderInfo == null) { if (orderInfo == null) {
return null; return null;
} }
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo(); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode()); OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
// 通过订单号查询实时数据 // 通过订单号查询实时数据
List<RealTimeMonitorData> realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode()); List<RealTimeMonitorData> realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
@@ -454,7 +454,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public String notificationStationStatus(String stationId, String pileConnectorCode, String status, ThirdPartySecretInfoVO secretInfoVO) { public String notificationStationStatus(String stationId, String pileConnectorCode, String status, ThirdPartySecretInfoVO secretInfoVO) {
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo(); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
String operatorId = Constants.OPERATORID_JIANG_SU; String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret(); String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret(); String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
@@ -512,7 +512,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
BigDecimal voltage = realTimeMonitorData.getOutputVoltage() == null ? BigDecimal.ZERO : new BigDecimal(realTimeMonitorData.getOutputVoltage()); BigDecimal voltage = realTimeMonitorData.getOutputVoltage() == null ? BigDecimal.ZERO : new BigDecimal(realTimeMonitorData.getOutputVoltage());
String soc = realTimeMonitorData.getSOC() == null ? Constants.ZERO : realTimeMonitorData.getSOC(); String soc = realTimeMonitorData.getSOC() == null ? Constants.ZERO : realTimeMonitorData.getSOC();
// 查询相关配置信息 // 查询相关配置信息
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo(); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
String operatorId = Constants.OPERATORID_JIANG_SU; String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret(); String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
@@ -621,7 +621,7 @@ public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
* *
* @return * @return
*/ */
private ThirdPartySecretInfoVO getXinYunWeiPlatformSecretInfo() { private ThirdPartySecretInfoVO getXinYunPlatformSecretInfo() {
// 通过第三方平台类型查询相关配置信息 // 通过第三方平台类型查询相关配置信息
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
if (thirdPartySecretInfoVO == null) { if (thirdPartySecretInfoVO == null) {