From 69596d2416c81ad2e31989f428eb61dcd1e33cfe Mon Sep 17 00:00:00 2001 From: Lemon Date: Tue, 11 Feb 2025 10:14:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=B2=B3=E5=8D=97?= =?UTF-8?q?=E7=9C=81=E5=B9=B3=E5=8F=B0Service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thirdparty/ThirdPlatformTypeEnum.java | 2 + .../impl/HeNanPlatformServiceImpl.java | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java diff --git a/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java index 64fced732..a9749fcda 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java +++ b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java @@ -31,6 +31,8 @@ public enum ThirdPlatformTypeEnum { GUANG_XI_PLATFORM("20", "广西平台", "450000000"), XIN_YUN_PLATFORM("21", "新运平台", "MADKXL8FX"), + + HE_NAN_PLATFORM("22", "河南省平台", ""), ; private String typeCode; diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java new file mode 100644 index 000000000..e7423cf6f --- /dev/null +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java @@ -0,0 +1,48 @@ +package com.jsowell.thirdparty.platform.service.impl; + +import com.jsowell.common.constant.Constants; +import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; +import com.jsowell.common.enums.ykc.ReturnCodeEnum; +import com.jsowell.common.exception.BusinessException; +import com.jsowell.pile.vo.ThirdPartySecretInfoVO; +import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory; +import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; +import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 河南省平台Service + * + * @author Lemon + * @Date 2025/2/11 9:57:47 + */ +@Service +public class HeNanPlatformServiceImpl implements ThirdPartyPlatformService { + // 平台类型 + private final String thirdPlatformType = ThirdPlatformTypeEnum.HE_NAN_PLATFORM.getTypeCode(); + + @Autowired + private ThirdpartySecretInfoService thirdpartySecretInfoService; + + @Override + public void afterPropertiesSet() throws Exception { + ThirdPartyPlatformFactory.register(thirdPlatformType, this); + } + + + /** + * 查询河南省平台密钥信息 + * @return + */ + private ThirdPartySecretInfoVO getHeNanSecretInfo() { + // 通过第三方平台类型查询相关配置信息 + ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); + if (thirdPartySecretInfoVO == null) { + throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL); + } + thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU); + return thirdPartySecretInfoVO; + } + +} From b85780f576302190d713e5cbfb6b805ad72a964a Mon Sep 17 00:00:00 2001 From: Lemon Date: Wed, 12 Feb 2025 08:57:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update=20=20=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=95=B4=E5=90=88=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/PileStationInfoController.java | 73 ++++++++++--------- .../ThirdPartyStationRelationMapper.java | 2 + .../ThirdPartyStationRelationService.java | 2 + .../ThirdPartyStationRelationServiceImpl.java | 4 + .../vo/base/ThirdPartyStationRelationVO.java | 22 ++++++ .../pile/ThirdPartyStationRelationMapper.xml | 23 +++++- jsowell-ui/src/api/pile/station.js | 14 ++-- jsowell-ui/src/views/pile/station/detail.vue | 27 ++++--- 8 files changed, 109 insertions(+), 58 deletions(-) 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() { From 087e38e963ecadbaf4c4e9715703554f4035fa4f Mon Sep 17 00:00:00 2001 From: "BOOL\\25024" Date: Wed, 12 Feb 2025 09:27:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BA=92=E8=81=94=E4=BA=92=E9=80=9A?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=A4=8D=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsowell-ui/src/views/pile/station/detail.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsowell-ui/src/views/pile/station/detail.vue b/jsowell-ui/src/views/pile/station/detail.vue index e1b36ecaf..f821e50d7 100644 --- a/jsowell-ui/src/views/pile/station/detail.vue +++ b/jsowell-ui/src/views/pile/station/detail.vue @@ -375,8 +375,8 @@ export default { console.log("res", res); console.log("res.rows", res.rows); res.rows.forEach((item, index) => { - this.checkList.push(item.thirdPartyType); - this.firstList.push(item.thirdPartyType); + this.checkList.push(item.thirdPartyName); + this.firstList.push(item.thirdPartyName); }); console.log("this.checkList", this.checkList, this.firstList); // if (res.data === undefined) {