update 华为Service

This commit is contained in:
Lemon
2024-03-25 08:46:40 +08:00
parent 7dc1e9be79
commit ee02249554
2 changed files with 58 additions and 12 deletions

View File

@@ -21,6 +21,7 @@ import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.domain.ThirdpartyParkingConfig;
import com.jsowell.pile.dto.PushStationInfoDTO;
import com.jsowell.pile.dto.ThirdPartyCommonStartChargeDTO;
import com.jsowell.pile.dto.huawei.HWQueryStartChargeDTO;
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
@@ -501,36 +502,41 @@ public class CommonService {
/**
* 统一请求启动充电,目前给华为平台用
* @param thirdPartyType
* @param stationIds
* @param pileConnectorCode
* @param dto
* @return
*/
public String commonQueryStartCharge(String thirdPartyType, List<String> stationIds, String pileConnectorCode, BigDecimal chargeAmount, String payMode) {
public String commonQueryStartCharge(ThirdPartyCommonStartChargeDTO dto) {
String thirdPartyType = dto.getThirdPartyType();
List<String> stationIds = dto.getStationIds();
String pileConnectorCode = dto.getPileConnectorCode();
BigDecimal chargeAmount = dto.getChargeAmount();
String payMode = dto.getPayMode();
// 判断平台类型
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
// 华为平台
String label = ThirdPlatformTypeEnum.getLabelByCode(thirdPartyType);
// query_station_status 查询站点枪口详情
Map<String, String> map = huaweiServiceV2.queryStationStatus(stationIds);
String status = map.get(pileConnectorCode);
// 判断枪口状态
if (!StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), status)) {
log.error(thirdPartyType + "判断枪口状态 error, 枪口状态为:{}", status);
log.error(label + "判断枪口状态 error, 枪口状态为:{}", status);
}
// query_equip_auth 请求设备认证
QueryEquipAuthVO vo = huaweiServiceV2.queryEquipAuth(pileConnectorCode);
Integer succStat = vo.getSuccStat();
if (succStat != Constants.zero) {
log.error(thirdPartyType + "请求设备认证 error, {}", vo.getFailReason());
log.error(label + "请求设备认证 error, {}", vo.getFailReason());
}
// query_start_charge 请求启动充电
HWQueryStartChargeDTO dto = new HWQueryStartChargeDTO();
dto.setConnectorID(pileConnectorCode);
dto.setMoneyLimit(chargeAmount);
dto.setPayMode(payMode);
QueryStartChargeVO startChargeVO = huaweiServiceV2.queryStartCharge(dto);
HWQueryStartChargeDTO chargeDTO = new HWQueryStartChargeDTO();
chargeDTO.setConnectorID(pileConnectorCode);
chargeDTO.setMoneyLimit(chargeAmount);
chargeDTO.setPayMode(payMode);
QueryStartChargeVO startChargeVO = huaweiServiceV2.queryStartCharge(chargeDTO);
if (startChargeVO.getSuccStat() != Constants.zero) {
log.error(thirdPartyType + "请求启动充电 error, {}", startChargeVO.getFailReason());
log.error(label + "请求启动充电 error, {}", startChargeVO.getFailReason());
}
String startChargeSeq = startChargeVO.getStartChargeSeq(); // 充电订单号