mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 推送第三方平台可多选
This commit is contained in:
@@ -1,12 +1,25 @@
|
||||
package com.jsowell.thirdparty.common;
|
||||
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.ThirdPartyStationRelation;
|
||||
import com.jsowell.pile.dto.PushStationInfoDTO;
|
||||
import com.jsowell.pile.service.ThirdPartyStationRelationService;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
||||
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||
import com.jsowell.thirdparty.xindiantu.service.XDTService;
|
||||
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
|
||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
@@ -19,6 +32,24 @@ public class CommonService {
|
||||
@Autowired
|
||||
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
@Autowired
|
||||
private ZDLService zdlService;
|
||||
|
||||
@Autowired
|
||||
private NRService nrService;
|
||||
|
||||
@Autowired
|
||||
private YCBCService ycbcService;
|
||||
|
||||
@Autowired
|
||||
private XDTService xdtService;
|
||||
|
||||
@Autowired
|
||||
private HuaWeiService huaWeiService;
|
||||
|
||||
/**
|
||||
* 将站点--第三方平台类型对应关系存入关系表
|
||||
* @param dto
|
||||
@@ -34,4 +65,51 @@ public class CommonService {
|
||||
// 新增数据库
|
||||
thirdPartyStationRelationService.insertThirdPartyStationRelation(relation);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统一方法推送站点信息
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public String commonPushStation(PushStationInfoDTO dto) throws ParseException {
|
||||
List<String> types = dto.getThirdPartyTypes();
|
||||
|
||||
String result = "";
|
||||
StringBuilder finalResult = new StringBuilder();
|
||||
for (String type : types) {
|
||||
dto.setThirdPartyType(type);
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
|
||||
// 推送联联
|
||||
// result = lianLianService.pushStationInfo(dto);
|
||||
result = lianLianService.pushStationInfoV2(dto);
|
||||
}
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
|
||||
// 中电联
|
||||
// result = zdlService.pushStationInfo(dto);
|
||||
result = zdlService.pushStationInfoV2(dto);
|
||||
}
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), dto.getThirdPartyType())) {
|
||||
// 江苏省平台
|
||||
// result = nrService.pushStationInfo(dto);
|
||||
result = nrService.pushStationInfoV2(dto);
|
||||
}
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), dto.getThirdPartyType())) {
|
||||
// 甬城泊车平台
|
||||
// result = ycbcService.pushStationInfo(dto);
|
||||
result = ycbcService.pushStationInfoV2(dto);
|
||||
}
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), dto.getThirdPartyType())) {
|
||||
// 新电途平台
|
||||
result = xdtService.pushStationInfoV2(dto);
|
||||
}
|
||||
// if(StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), dto.getThirdPartyType())) {
|
||||
// // 华为
|
||||
// result = huaWeiService.notificationOperationSystemInfo(dto);
|
||||
// }
|
||||
finalResult.append(result).append("\n");
|
||||
}
|
||||
return finalResult.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user