将推送第三方平台改为可推送多个平台

This commit is contained in:
Lemon
2024-01-18 17:03:08 +08:00
parent 63ae3c8ab7
commit 0b09585bbc
21 changed files with 534 additions and 63 deletions

View File

@@ -27,6 +27,7 @@ import com.jsowell.pile.service.PileStationInfoService;
import com.jsowell.pile.service.ThirdPartyParkingConfigService;
import com.jsowell.pile.service.ThirdPartyStationRelationService;
import com.jsowell.pile.service.ThirdPartySettingInfoService;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.service.PileService;
import com.jsowell.thirdparty.huawei.HuaWeiService;
@@ -242,11 +243,13 @@ public class PileStationInfoController extends BaseController {
* @return
*/
@PreAuthorize("@ss.hasPermi('pile:station:query')")
@GetMapping("/getSettingByStationId/{stationId}")
public AjaxResult getSettingByStationId(@PathVariable("stationId") Long id) {
ThirdPartyStationRelation info = new ThirdPartyStationRelation();
info.setStationId(id);
return AjaxResult.success(thirdPartyStationRelationService.selectRelationInfo(info));
@GetMapping("/getRelationByStationId/{stationId}")
public TableDataInfo getSettingByStationId(@PathVariable("stationId") Long id) {
List<ThirdPartyStationRelationVO> list = thirdPartyStationRelationService.getRelationInfoList(String.valueOf(id));
for (ThirdPartyStationRelationVO vo : list) {
vo.setThirdPartyType(ThirdPlatformTypeEnum.getLabelByCode(vo.getThirdPartyType()));
}
return getDataTable(list);
}
/**
@@ -256,8 +259,10 @@ public class PileStationInfoController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('pile:station:query')")
@PostMapping("/getSettingInfo")
public AjaxResult getSettingInfo(@RequestBody ThirdPartySettingInfo info) {
return AjaxResult.success(thirdPartySettingInfoService.selectSettingInfo(info));
public TableDataInfo getSettingInfo(@RequestBody ThirdPartySettingInfo info) {
List<ThirdPartySettingInfo> infos = thirdPartySettingInfoService.selectThirdPartySettingInfoList(info);
return getDataTable(infos);
// return AjaxResult.success(thirdPartySettingInfoService.selectSettingInfo(info));
}
/**
@@ -301,28 +306,32 @@ public class PileStationInfoController extends BaseController {
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
// 推送联联
result = lianLianService.pushStationInfo(dto);
// 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.pushStationInfo(dto);
result = zdlService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), dto.getThirdPartyType())) {
// 江苏省平台
result = nrService.pushStationInfo(dto);
// 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.pushStationInfo(dto);
result = ycbcService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), dto.getThirdPartyType())) {
// 新电途平台
result = xdtService.pushStationInfo(dto);
}
if(StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), dto.getThirdPartyType())) {
// 华为
result = huaWeiService.notificationOperationSystemInfo(dto);
xdtService.pushStationInfo(dto);
}
// if(StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), dto.getThirdPartyType())) {
// // 华为
// result = huaWeiService.notificationOperationSystemInfo(dto);
// }
response = new RestApiResponse<>(result);
}catch (BusinessException e) {
logger.error("推送第三方平台充电站信息 error",e);
@@ -331,10 +340,7 @@ public class PileStationInfoController extends BaseController {
logger.error("推送第三方平台充电站信息 error", e);
response = new RestApiResponse<>("推送失败,请联系管理员");
// 删除对应配置信息
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setStationId(dto.getStationId());
relation.setDelFlag(DelFlagEnum.DELETE.getValue());
thirdPartyStationRelationService.updateThirdPartyStationRelation(relation);
thirdPartyStationRelationService.updateRelationDelFlag(String.valueOf(dto.getStationId()), dto.getThirdPartyType());
}
logger.info("推送第三方平台充电站信息 result:{}", response);
return response;

View File

@@ -36,10 +36,10 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: jsowell_dev
# url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: jsowell_prd_copy
# url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: jsowell_dev
url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: jsowell_prd_copy
password: 123456
# 从库数据源
slave: