新增 宁夏平台controller

This commit is contained in:
Lemon
2024-05-30 09:38:29 +08:00
parent 40a929eebd
commit f08de6dd54
5 changed files with 148 additions and 5 deletions

View File

@@ -171,6 +171,15 @@ public interface ThirdPartyPlatformService extends InitializingBean {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 过程信息查询 query_bms_info
* @param pileConnectorCode
* @return
*/
default Map<String, String> queryBmsInfo(String pileConnectorCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询业务策略信息结果
* 请求计费策略 request_equip_business_policy

View File

@@ -552,6 +552,65 @@ public class ShenZhenPlatformServiceImpl implements ThirdPartyPlatformService {
return result;
}
@Override
public Map<String, String> queryBmsInfo(String pileConnectorCode) {
JSONObject jsonObject = new JSONObject();
// 根据枪口编号查询枪口信息
PileConnectorInfoVO connectorInfoVO = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
if (!StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), String.valueOf(connectorInfoVO.getStatus()))) {
// 不为充电中, BmsInfo 为空
jsonObject.put("BmsInfo", null);
}else {
// 充电中状态时,获取充电电池信息
// 获取正在充电的订单信息
List<OrderListVO> orderListVOS = orderBasicInfoService.selectChargingOrder(connectorInfoVO.getPileSn());
if (CollectionUtils.isEmpty(orderListVOS)) {
return null;
}
OrderListVO orderVO = orderListVOS.get(0);
// 获取充电电池信息
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderVO.getTransactionCode());
if (CollectionUtils.isEmpty(chargingRealTimeData)) {
return null;
}
RealTimeMonitorData data = chargingRealTimeData.get(0);
BMSInfo bmsInfo = BMSInfo.builder()
.vinCode(orderVO.getVinCode())
.bmsCode("")
.bmsVer("")
.connectorID(orderVO.getPileConnectorCode())
.maxChargeCurrent(new BigDecimal(""))
.maxChargeCellVoltage(new BigDecimal(""))
.maxTemp(0)
.ratedCapacity(0)
.tatalVoltage(new BigDecimal(data.getOutputVoltage()))
.totalCurrent(new BigDecimal(data.getOutputCurrent()))
.soc(Integer.parseInt(data.getSOC()))
.voltageH(new BigDecimal(""))
.voltageHNumIndex(0)
.temptureH(0)
.temptureHNumIndex(0)
.temptureL(0)
.temptureLNumIndex(0)
.currentCapacity(new BigDecimal(""))
.freshTime(DateUtils.getDateTime())
.startChargingTime(orderVO.getChargeStartTime())
.chargingSessionMin(Integer.parseInt(data.getSumChargingTime()) * 60)
.build();
jsonObject.put("BmsInfo", bmsInfo);
}
jsonObject.put("ConnectorID", pileConnectorCode);
jsonObject.put("Status", connectorInfoVO.getStatus());
ThirdPartySecretInfoVO shenZhenSecretInfo = getShenZhenSecretInfo();
Map<String, String> map = ThirdPartyPlatformUtils.generateResultMap(jsonObject, shenZhenSecretInfo);
return map;
}
/**
* 获取深圳平台相关密钥信息
* @return