mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
新增 青海省平台推送站点信息接口
This commit is contained in:
@@ -32,6 +32,7 @@ import com.jsowell.thirdparty.huawei.HuaweiServiceV2;
|
||||
import com.jsowell.thirdparty.platform.hainan.service.HaiNanPlatformServiceImpl;
|
||||
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import com.jsowell.thirdparty.platform.qinghai.service.QingHaiPlatformServiceImpl;
|
||||
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
|
||||
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
||||
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||
@@ -106,6 +107,9 @@ public class CommonService {
|
||||
@Autowired
|
||||
private HaiNanPlatformServiceImpl haiNanChargeService;
|
||||
|
||||
@Autowired
|
||||
private QingHaiPlatformServiceImpl qingHaiPlatformService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@@ -308,6 +312,13 @@ public class CommonService {
|
||||
// log.info("推送甬城泊车充电订单状态 result:{}", result2);
|
||||
}
|
||||
}
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.QING_HAI_PLATFORM.getTypeCode(), thirdPartyType)) {
|
||||
// 青海省平台
|
||||
String result = qingHaiPlatformService.notificationStationStatus(pileConnectorCode, changedStatus);
|
||||
log.info("推送甬城泊车平台设备状态变化推送 pileConnectorCode:{}, changedStatus:{}, result:{}"
|
||||
, pileConnectorCode, changedStatus, result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
package com.jsowell.thirdparty.platform.qinghai.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
||||
import com.jsowell.pile.domain.ThirdPartyStationRelation;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.service.PileBasicInfoService;
|
||||
import com.jsowell.pile.service.PileStationInfoService;
|
||||
import com.jsowell.pile.service.ThirdPartyPlatformConfigService;
|
||||
import com.jsowell.pile.service.ThirdPartyStationRelationService;
|
||||
import com.jsowell.pile.thirdparty.ZDLEquipmentInfo;
|
||||
import com.jsowell.pile.thirdparty.ZDLStationInfo;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
|
||||
import com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
|
||||
import com.jsowell.thirdparty.platform.hainan.domain.HNStationInfo;
|
||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||
import com.jsowell.thirdparty.platform.util.Encodes;
|
||||
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||
@@ -23,6 +29,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -42,6 +51,9 @@ public class QingHaiPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
@Autowired
|
||||
private PileStationInfoService pileStationInfoService;
|
||||
|
||||
@Autowired
|
||||
private PileBasicInfoService pileBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
|
||||
|
||||
@@ -58,6 +70,7 @@ public class QingHaiPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
|
||||
List<ZDLStationInfo> resultList = new ArrayList<>();
|
||||
// 查询出要查询的充电站id并set进 dto 的stationIds
|
||||
if (StringUtils.isNotBlank(dto.getThirdPlatformType())) {
|
||||
List<ThirdPartyStationRelation> xdtList = thirdPartyStationRelationService.selectThirdPartyStationRelationList(dto.getThirdPlatformType());
|
||||
@@ -79,12 +92,87 @@ public class QingHaiPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// 未查到数据
|
||||
return null;
|
||||
}
|
||||
PageInfo<ThirdPartyStationInfoVO> pageInfo = new PageInfo<>(stationInfos);
|
||||
ZDLStationInfo stationInfo = null;
|
||||
for (ThirdPartyStationInfoVO stationInfoVO : pageInfo.getList()) {
|
||||
Long stationId = stationInfoVO.getId();
|
||||
stationInfo = ZDLStationInfo.builder()
|
||||
.stationId(String.valueOf(stationId))
|
||||
.operatorId(Constants.OPERATORID_JIANG_SU)
|
||||
.stationName(stationInfoVO.getStationName())
|
||||
.countryCode(stationInfoVO.getCountryCode())
|
||||
.address(stationInfoVO.getAddress())
|
||||
.serviceTel(stationInfoVO.getServiceTel())
|
||||
.stationClassification(Constants.one) // 1-充电站
|
||||
.stationType(Integer.parseInt(stationInfoVO.getStationType()))
|
||||
.stationStatus(Integer.parseInt(stationInfoVO.getStationStatus()))
|
||||
.parkNums(Integer.parseInt(stationInfoVO.getParkNums()))
|
||||
.stationLat(new BigDecimal(stationInfoVO.getStationLat()))
|
||||
.stationLng(new BigDecimal(stationInfoVO.getStationLng()))
|
||||
.construction(Integer.parseInt(stationInfoVO.getConstruction()))
|
||||
.openAllDay(Integer.parseInt(stationInfoVO.getOpenAllDay()))
|
||||
.parkFeeType(255) // 255-参考场地实际收费标准
|
||||
.electricityType(1) // 用电类型 1-商业用电
|
||||
.isAloneApply(Integer.parseInt(stationInfoVO.getAloneApply()))
|
||||
// .ratedPower() // 站点额定总功率
|
||||
.periodFee(1) // 峰谷分时 0-否;1-是
|
||||
.runTime(String.valueOf(stationInfoVO.getCreateTime()))
|
||||
.videoMonitor(0) // 视频监控配套情况 0-无;1-有
|
||||
|
||||
.build();
|
||||
|
||||
return null;
|
||||
String organizationCode = stationInfoVO.getOrganizationCode();
|
||||
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
stationInfo.setEquipmentOwnerId(equipmentOwnerId);
|
||||
} else {
|
||||
stationInfo.setEquipmentOwnerId(Constants.OPERATORID_JIANG_SU);
|
||||
}
|
||||
|
||||
String areaCode = stationInfoVO.getAreaCode(); // 330000,330200,330213
|
||||
// 根据逗号分组
|
||||
String[] split = StringUtils.split(areaCode, ",");
|
||||
// 只取最后一部分 330213
|
||||
String subAreaCode = split[split.length - 1];
|
||||
stationInfo.setAreaCode(subAreaCode);
|
||||
|
||||
// TODO areaCodeCountryside
|
||||
|
||||
// 查询桩列表
|
||||
List<ZDLEquipmentInfo> pileList = pileBasicInfoService.getPileListForZDL(String.valueOf(stationId));
|
||||
stationInfo.setEquipmentInfos(pileList);
|
||||
|
||||
// 汇总站点额定总功率
|
||||
BigDecimal sumPower = pileList.stream()
|
||||
.map(ZDLEquipmentInfo::getPower)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stationInfo.setRatedPower(sumPower);
|
||||
|
||||
resultList.add(stationInfo);
|
||||
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("PageNo", pageInfo.getPageNum());
|
||||
jsonObject.put("PageCount", pageInfo.getPages());
|
||||
jsonObject.put("ItemSize", resultList.size());
|
||||
jsonObject.put("StationInfos", resultList);
|
||||
|
||||
// 加密
|
||||
Map<String, String> resultMap = getResultMap(jsonObject);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设备状态变化推送(在0x13中调用统一推送接口)
|
||||
* @param pileConnectorCode 充电枪口编号
|
||||
* @param status 枪口状态
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationStatus(String pileConnectorCode, String status) {
|
||||
return ThirdPartyPlatformService.super.notificationStationStatus(pileConnectorCode, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将需要发送至对接平台的的返回参数加密返回
|
||||
|
||||
Reference in New Issue
Block a user