diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java index 1dc501ae9..9ffb11607 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java @@ -253,10 +253,11 @@ public class PileStationInfoController extends BaseController { @PreAuthorize("@ss.hasPermi('pile:station:query')") @GetMapping("/getRelationByStationId/{stationId}") public TableDataInfo getSettingByStationId(@PathVariable("stationId") Long id) { - List list = thirdPartyStationRelationService.getRelationInfoList(String.valueOf(id)); - for (ThirdPartyStationRelationVO vo : list) { - vo.setThirdPartyType(ThirdPlatformTypeEnum.getTypeLabelByTypeCode(vo.getThirdPartyType())); - } + // List list = thirdPartyStationRelationService.getRelationInfoList(String.valueOf(id)); + // for (ThirdPartyStationRelationVO vo : list) { + // vo.setThirdPartyType(ThirdPlatformTypeEnum.getTypeLabelByTypeCode(vo.getThirdPartyType())); + // } + List list = thirdPartyStationRelationService.getRelationInfoListV2(String.valueOf(id)); return getDataTable(list); } @@ -303,38 +304,38 @@ public class PileStationInfoController extends BaseController { * @param dto * @return */ - @PostMapping("/pushStationInfo") - public RestApiResponse pushStationInfo(@RequestBody PushStationInfoDTO dto) { - logger.info("推送第三方平台充电站信息 params:{}", JSON.toJSONString(dto)); - RestApiResponse response = null; - Long stationId = dto.getStationId(); - List types = dto.getThirdPartyTypes(); - // 先查到该站点推送过的类型 - List infoList = thirdPartyStationRelationService.getRelationInfoList(String.valueOf(stationId)); - List typeList = infoList.stream() - .map(ThirdPartyStationRelationVO::getThirdPartyType) - .collect(Collectors.toList()); - // 对types去重,可获取到需要新推送的第三方平台类型 - types.removeAll(typeList); - dto.setThirdPartyTypes(types); - try { - if (StringUtils.isBlank(String.valueOf(stationId))) { - throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR); - } - String result = commonService.commonPushStation(dto); - response = new RestApiResponse<>(result); - } catch (BusinessException e) { - logger.error("推送第三方平台充电站信息 error", e); - response = new RestApiResponse<>(e.getCode(), e.getMessage()); - } catch (Exception e) { - logger.error("推送第三方平台充电站信息 error", e); - response = new RestApiResponse<>("推送失败,请联系管理员"); - // 有报错,所有的都必须删除 - thirdPartyStationRelationService.updateRelationDelFlag(String.valueOf(stationId), types); - } - logger.info("推送第三方平台充电站信息 result:{}", response); - return response; - } + // @PostMapping("/pushStationInfo") + // public RestApiResponse pushStationInfo(@RequestBody PushStationInfoDTO dto) { + // logger.info("推送第三方平台充电站信息 params:{}", JSON.toJSONString(dto)); + // RestApiResponse response = null; + // Long stationId = dto.getStationId(); + // List types = dto.getThirdPartyTypes(); + // // 先查到该站点推送过的类型 + // List infoList = thirdPartyStationRelationService.getRelationInfoList(String.valueOf(stationId)); + // List typeList = infoList.stream() + // .map(ThirdPartyStationRelationVO::getThirdPartyType) + // .collect(Collectors.toList()); + // // 对types去重,可获取到需要新推送的第三方平台类型 + // types.removeAll(typeList); + // dto.setThirdPartyTypes(types); + // try { + // if (StringUtils.isBlank(String.valueOf(stationId))) { + // throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR); + // } + // String result = commonService.commonPushStation(dto); + // response = new RestApiResponse<>(result); + // } catch (BusinessException e) { + // logger.error("推送第三方平台充电站信息 error", e); + // response = new RestApiResponse<>(e.getCode(), e.getMessage()); + // } catch (Exception e) { + // logger.error("推送第三方平台充电站信息 error", e); + // response = new RestApiResponse<>("推送失败,请联系管理员"); + // // 有报错,所有的都必须删除 + // thirdPartyStationRelationService.updateRelationDelFlag(String.valueOf(stationId), types); + // } + // logger.info("推送第三方平台充电站信息 result:{}", response); + // return response; + // } /** * 绑定停车平台(停车充电下发优惠券) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java index e1c17b82b..db71d0da7 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java @@ -113,4 +113,6 @@ public interface ThirdPartyStationRelationMapper { int insertOrUpdateSelective(ThirdPartyStationRelation thirdPartyStationRelation); int batchInsert(List list); + + List getRelationInfoListV2(@Param("stationId") String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java index f77bb015e..d914c0b4e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java @@ -112,4 +112,6 @@ public interface ThirdPartyStationRelationService { * @return */ List selectStationList(String thirdPlatformType); + + List getRelationInfoListV2(String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java index d42791c2e..64d0fd0ce 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java @@ -128,6 +128,10 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe return thirdPartyStationRelationMapper.getRelationInfoList(stationId); } + public List getRelationInfoListV2(String stationId) { + return thirdPartyStationRelationMapper.getRelationInfoListV2(stationId); + } + /** * 新增站点、第三方推送平台配置对应 * diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java index 3a1e85487..e260109ef 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java @@ -14,6 +14,8 @@ public class ThirdPartyStationRelationVO { private String thirdPartyType; + private String thirdPartyName; + private String startMode; private String urlAddress; @@ -22,4 +24,24 @@ public class ThirdPartyStationRelationVO { private String signSecret; private String dataSecret; private String dataSecretIv; + + + /** + * 对方平台密钥信息 + */ + private String theirOperatorId; + private String theirOperatorSecret; + private String theirSignSecret; + private String theirDataSecret; + private String theirDataSecretIv; + + + /** + * 我方平台密钥信息 + */ + private String ourOperatorId; + private String ourOperatorSecret; + private String ourSignSecret; + private String ourDataSecret; + private String ourDataSecretIv; } diff --git a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml index 3743e8a93..2f13c7ad3 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml @@ -332,5 +332,26 @@ - + \ No newline at end of file diff --git a/jsowell-ui/src/api/pile/station.js b/jsowell-ui/src/api/pile/station.js index cbff33a08..10086e2b0 100644 --- a/jsowell-ui/src/api/pile/station.js +++ b/jsowell-ui/src/api/pile/station.js @@ -140,13 +140,13 @@ export function updateSettingByStationId(data) { // } // 推送充电站信息到联联平台 -export function pushStationInfo(data) { - return request({ - url: "/pile/station/pushStationInfo", - method: "post", - data: data, - }) -} +// export function pushStationInfo(data) { +// return request({ +// url: "/pile/station/pushStationInfo", +// method: "post", +// data: data, +// }) +// } // 绑定停车平台 export function bindParkingPlatform(data) { diff --git a/jsowell-ui/src/views/pile/station/detail.vue b/jsowell-ui/src/views/pile/station/detail.vue index e1b36ecaf..afdd2ae06 100644 --- a/jsowell-ui/src/views/pile/station/detail.vue +++ b/jsowell-ui/src/views/pile/station/detail.vue @@ -256,7 +256,6 @@ import { getStationInfo, updateStationQRCodePrefix, updateSettingByStationId, - pushStationInfo, getParkingInfoList, bindParkingPlatform, getRelationByStationId, @@ -455,19 +454,19 @@ export default { }); }, // 推送站点 - pushStation() { - let exchange = ""; - const param = { - stationId: this.stationId, - thirdPartyTypes: this.exchange, - }; - console.log("param", param); - pushStationInfo(param).then((response) => { - console.log("response", response); - this.$modal.msg(response.obj); - this.disableFlag = true; - }); - }, + // pushStation() { + // let exchange = ""; + // const param = { + // stationId: this.stationId, + // thirdPartyTypes: this.exchange, + // }; + // console.log("param", param); + // pushStationInfo(param).then((response) => { + // console.log("response", response); + // this.$modal.msg(response.obj); + // this.disableFlag = true; + // }); + // }, // 保存站点与第三方平台关系 saveStationThirdParty() {