From 8f7b7d994e35c160206c90787332f0df849877c4 Mon Sep 17 00:00:00 2001 From: Guoqs Date: Thu, 18 Apr 2024 14:15:44 +0800 Subject: [PATCH 1/8] =?UTF-8?q?update=20=E5=AF=B9=E6=8E=A5lianlian?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thirdparty/ThirdPartyBaseController.java | 137 ++++++++++++++++++ .../ThirdPartyPlatformConfigMapper.java | 3 + .../service/ThirdPartySettingInfoService.java | 17 +-- .../ThirdPartyPlatformConfigServiceImpl.java | 19 ++- .../ThirdPartySettingInfoServiceImpl.java | 38 +---- .../pile/vo/ThirdPartySecretInfoVO.java | 44 ++++++ .../pile/ThirdPartyPlatformConfigMapper.xml | 4 + .../pile/ThirdPartySettingInfoMapper.xml | 17 +-- .../service/impl/LianLianServiceImpl.java | 2 +- .../platform/ThirdPartyPlatformService.java | 4 +- .../service/LianLianPlatformServiceImpl.java | 2 +- .../service/NeiMengGuPlatformServiceImpl.java | 89 ++++++------ .../util/ThirdPartyPlatformUtils.java | 2 + .../ZhongDianLianPlatformServiceImpl.java | 73 ++++++++++ 14 files changed, 333 insertions(+), 118 deletions(-) create mode 100644 jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdPartyBaseController.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/vo/ThirdPartySecretInfoVO.java create mode 100644 jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/zhongdianlian/service/ZhongDianLianPlatformServiceImpl.java diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdPartyBaseController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdPartyBaseController.java new file mode 100644 index 000000000..ba3270d61 --- /dev/null +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdPartyBaseController.java @@ -0,0 +1,137 @@ +package com.jsowell.web.controller.thirdparty; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.jsowell.common.annotation.Anonymous; +import com.jsowell.common.core.controller.BaseController; +import com.jsowell.common.exception.BusinessException; +import com.jsowell.pile.domain.ThirdPartyPlatformConfig; +import com.jsowell.pile.dto.QueryOperatorInfoDTO; +import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.service.ThirdPartyPlatformConfigService; +import com.jsowell.pile.thirdparty.CommonParamsDTO; +import com.jsowell.thirdparty.lianlian.common.CommonResult; +import com.jsowell.thirdparty.platform.ThirdPartyPlatformService; +import com.jsowell.thirdparty.platform.util.Cryptos; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * 内蒙古接口 + */ +@Anonymous +@RestController +public class ThirdPartyBaseController extends BaseController { + @Autowired + @Qualifier("zhongDianLianPlatformServiceImpl") + private ThirdPartyPlatformService platformLogic; + + @Autowired + private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService; + + /** + * 获取token接口 + * http://localhost:8080/query_token + */ + @PostMapping("/query_token") + public CommonResult queryToken(@RequestBody CommonParamsDTO dto) { + logger.info("平台请求令牌 params:{}", JSON.toJSONString(dto)); + try { + Map map = platformLogic.queryToken(dto); + logger.info("平台请求令牌 result:{}", JSON.toJSONString(map)); + return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("平台请求令牌接口 异常", e); + return CommonResult.failed("获取token发生异常"); + } + } + + // 解析DTO + private T parseDto(CommonParamsDTO dto, Class targetClass) { + // 解密 + String operatorId = dto.getOperatorID(); + // 通过operatorId 查出 operatorSecret + ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId); + if (platformConfig == null) { + throw new BusinessException("1", "无此对接平台"); + } + + String operatorSecret = platformConfig.getOperatorSecret(); + String dataSecret = platformConfig.getDataSecret(); + String dataSecretIv = platformConfig.getDataSecretIv(); + String signSecret = platformConfig.getSignSecret(); + + // 解密data 获取参数中的OperatorSecret + String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv); + return JSONObject.parseObject(decrypt, targetClass); + } + + /** + * 查询运营商信息 + * 接口名称:supervise_query_operator_info + * 使用方法:由数据提供方实现此接口,数据需求方调用 + * 接口频率:每天一次或多次 + * 超时时间:120秒 + */ + @PostMapping("/v1/supervise_query_operator_info") + public CommonResult queryOperatorInfo(@RequestBody CommonParamsDTO dto) { + logger.info("海南平台查询运营商信息 params:{}", JSON.toJSONString(dto)); + try { + QueryOperatorInfoDTO paramDTO = parseDto(dto, QueryOperatorInfoDTO.class); + Map map = platformLogic.queryOperatorInfo(paramDTO); + logger.info("海南平台查询运营商信息 result:{}", JSON.toJSONString(map)); + return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("海南平台查询运营商信息 异常", e); + return CommonResult.failed("查询运营商信息发生异常"); + } + } + + /** + * 查询充换电站信息 + * 接口名称: supervise_query_stations_info + * 使用方法:由数据提供方实现此接口,数据需求方调用 + * 接口频率:每天一次或多次 + * 超时时间:120秒 + */ + @PostMapping("/v1/supervise_query_stations_info") + public CommonResult queryStationsInfo(@RequestBody CommonParamsDTO dto) { + logger.info("海南平台查询运营商信息 params:{}", JSON.toJSONString(dto)); + try { + QueryStationInfoDTO paramDTO = parseDto(dto, QueryStationInfoDTO.class); + Map map = platformLogic.queryStationsInfo(paramDTO); + logger.info("海南平台查询运营商信息 result:{}", JSON.toJSONString(map)); + return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("海南平台查询运营商信息 异常", e); + return CommonResult.failed("查询运营商信息发生异常"); + } + } + + /** + * 查询充换电站状态信息 + * supervise_query_station_status + */ + @PostMapping("/v1/supervise_query_station_status") + public CommonResult queryStationStatus(@RequestBody CommonParamsDTO dto) { + logger.info("海南平台查询充换电站状态信息 params:{}", JSON.toJSONString(dto)); + try { + QueryStationInfoDTO paramDTO = parseDto(dto, QueryStationInfoDTO.class); + Map map = platformLogic.queryStationStatus(paramDTO); + logger.info("海南平台查询充换电站状态信息 result:{}", JSON.toJSONString(map)); + return CommonResult.success(0, "查询充换电站状态信息成功!", map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("海南平台查询充换电站状态信息异常", e); + return CommonResult.failed("查询充换电站状态信息发生异常"); + } + } + + /** + * + */ +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyPlatformConfigMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyPlatformConfigMapper.java index 410501dbf..f9f4c7479 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyPlatformConfigMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyPlatformConfigMapper.java @@ -1,6 +1,7 @@ package com.jsowell.pile.mapper; import com.jsowell.pile.domain.ThirdPartyPlatformConfig; +import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -68,4 +69,6 @@ public interface ThirdPartyPlatformConfigMapper { * @return */ ThirdPartyPlatformConfig getInfoByOperatorId(String operatorId); + + ThirdPartySecretInfoVO queryThirdPartySecretInfo(String operatorId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartySettingInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartySettingInfoService.java index 63a6476d4..1363382d5 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartySettingInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartySettingInfoService.java @@ -1,9 +1,9 @@ package com.jsowell.pile.service; -import java.util.List; - import com.jsowell.pile.domain.ThirdPartySettingInfo; +import java.util.List; + /** * 第三方平台配置Service接口 * @@ -67,18 +67,5 @@ public interface ThirdPartySettingInfoService { */ public int deleteThirdPartySettingInfoById(Long id); - /** - * 根据站点id 查询配置列表 - * - * @param stationId - * @return - */ - public ThirdPartySettingInfo getInfoByStationId(Long stationId); - /** - * 修改站点互联互通配置 - * @param info - * @return - */ - int updateStationSettingInfo(ThirdPartySettingInfo info); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyPlatformConfigServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyPlatformConfigServiceImpl.java index f0dc96cd7..7fbb93f1b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyPlatformConfigServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyPlatformConfigServiceImpl.java @@ -1,13 +1,14 @@ package com.jsowell.pile.service.impl; -import java.util.List; - import com.jsowell.common.util.DateUtils; +import com.jsowell.pile.domain.ThirdPartyPlatformConfig; +import com.jsowell.pile.mapper.ThirdPartyPlatformConfigMapper; +import com.jsowell.pile.service.ThirdPartyPlatformConfigService; +import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.jsowell.pile.mapper.ThirdPartyPlatformConfigMapper; -import com.jsowell.pile.domain.ThirdPartyPlatformConfig; -import com.jsowell.pile.service.ThirdPartyPlatformConfigService; + +import java.util.List; /** * 对接平台配置信息Service业务层处理 @@ -98,4 +99,12 @@ public class ThirdPartyPlatformConfigServiceImpl implements ThirdPartyPlatformCo public ThirdPartyPlatformConfig getInfoByOperatorId(String operatorId) { return thirdPartyPlatformConfigMapper.getInfoByOperatorId(operatorId); } + + /** + * 查询第三方平台配置的密钥信息 + * @return + */ + public ThirdPartySecretInfoVO queryThirdPartySecretInfo(String operatorId) { + return thirdPartyPlatformConfigMapper.queryThirdPartySecretInfo(operatorId); + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartySettingInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartySettingInfoServiceImpl.java index c1760973c..fc13ec364 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartySettingInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartySettingInfoServiceImpl.java @@ -1,13 +1,13 @@ package com.jsowell.pile.service.impl; -import java.util.List; - import com.jsowell.common.util.DateUtils; +import com.jsowell.pile.domain.ThirdPartySettingInfo; +import com.jsowell.pile.mapper.ThirdPartySettingInfoMapper; +import com.jsowell.pile.service.ThirdPartySettingInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.jsowell.pile.mapper.ThirdPartySettingInfoMapper; -import com.jsowell.pile.domain.ThirdPartySettingInfo; -import com.jsowell.pile.service.ThirdPartySettingInfoService; + +import java.util.List; /** * 第三方平台配置Service业务层处理 @@ -98,33 +98,5 @@ public class ThirdPartySettingInfoServiceImpl implements ThirdPartySettingInfoSe return thirdPartySettingInfoMapper.deleteThirdPartySettingInfoById(id); } - /** - * 根据站点id 查询配置列表 - * - * @param stationId - * @return - */ - @Override - public ThirdPartySettingInfo getInfoByStationId(Long stationId) { - return thirdPartySettingInfoMapper.getInfoByStationId(stationId); - } - /** - * 修改站点互联互通配置 - * @param info - * @return - */ - @Override - public int updateStationSettingInfo(ThirdPartySettingInfo info) { - Long stationId = info.getStationId(); - ThirdPartySettingInfo infoByStationId = getInfoByStationId(stationId); - if (infoByStationId == null) { - // 新增 - return insertThirdPartySettingInfo(info); - }else { - // 修改 - info.setId(infoByStationId.getId()); - return updateThirdPartySettingInfo(info); - } - } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/ThirdPartySecretInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/ThirdPartySecretInfoVO.java new file mode 100644 index 000000000..33e8e6ffe --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/ThirdPartySecretInfoVO.java @@ -0,0 +1,44 @@ +package com.jsowell.pile.vo; + +import lombok.Getter; +import lombok.Setter; + +/** + * 第三方平台配置的密钥信息 + */ +@Getter +@Setter +public class ThirdPartySecretInfoVO { + // 我方的组织机构代码 + private String ourOperatorId; + + // 我方生成的唯一识别密钥 + private String ourOperatorSecret; + + // 我方生成的消息密钥 + private String ourDataSecret; + + // 我方生成的初始化向量 + private String ourDataSecretIv; + + // 我方生成的签名密钥 + private String ourSigSecret; + + // 对接平台的组织机构代码 + private String theirOperatorId; + + // 对接平台生成的唯一识别密钥 + private String theirOperatorSecret; + + // 对接平台生成的消息密钥 + private String theirDataSecret; + + // 对接平台的初始化向量 + private String theirDataSecretIv; + + // 对接平台生成的签名密钥 + private String theirSigSecret; + + // 对接平台接口前缀 + private String theirUrlPrefix; +} diff --git a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyPlatformConfigMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyPlatformConfigMapper.xml index efc7f6251..73a854726 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyPlatformConfigMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyPlatformConfigMapper.xml @@ -110,4 +110,8 @@ where del_flag = '0' and operator_id = #{operatorId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartySettingInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartySettingInfoMapper.xml index 7dbd71729..a3ccf2623 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartySettingInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartySettingInfoMapper.xml @@ -8,7 +8,6 @@ - @@ -22,12 +21,12 @@ - select id, type, url_address, station_id, operator_id, operator_secret, sign_secret, data_secret, data_secret_IV, create_time, create_by, update_time, update_by, del_flag from thirdparty_setting_info + select id, type, url_address, operator_id, operator_secret, sign_secret, data_secret, data_secret_IV, create_time, create_by, update_time, update_by, del_flag from thirdparty_setting_info - id, type, url_address, station_id, operator_id, operator_secret, sign_secret, data_secret, data_secret_IV, create_time, create_by, update_time, update_by, del_flag + id, type, url_address, operator_id, operator_secret, sign_secret, data_secret, data_secret_IV, create_time, create_by, update_time, update_by, del_flag - select - from thirdparty_setting_info - where station_id = #{stationId,jdbcType=BIGINT} - - + + + and platform_name like concat('%', #{platformName}, '%') + and platform_type = #{platformType} + and url_prefix = #{urlPrefix} + and their_operator_id = #{theirOperatorId} + and their_operator_secret = #{theirOperatorSecret} + and their_data_secret = #{theirDataSecret} + and their_data_secret_Iv = #{theirDataSecretIv} + and their_sig_secret = #{theirSigSecret} + and our_operator_secret = #{ourOperatorSecret} + and our_data_secret = #{ourDataSecret} + and our_data_secret_iv = #{ourDataSecretIv} + and our_sig_secret = #{ourSigSecret} + + + + + + + insert into thirdparty_secret_info + + platform_name, + platform_type, + url_prefix, + their_operator_id, + their_operator_secret, + their_data_secret, + their_data_secret_Iv, + their_sig_secret, + our_operator_secret, + our_data_secret, + our_data_secret_iv, + our_sig_secret, + create_by, + create_time, + update_by, + update_time, + del_flag, + + + #{platformName}, + #{platformType}, + #{urlPrefix}, + #{theirOperatorId}, + #{theirOperatorSecret}, + #{theirDataSecret}, + #{theirDataSecretIv}, + #{theirSigSecret}, + #{ourOperatorSecret}, + #{ourDataSecret}, + #{ourDataSecretIv}, + #{ourSigSecret}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{delFlag}, + + + + + update thirdparty_secret_info + + platform_name = #{platformName}, + platform_type = #{platformType}, + url_prefix = #{urlPrefix}, + their_operator_id = #{theirOperatorId}, + their_operator_secret = #{theirOperatorSecret}, + their_data_secret = #{theirDataSecret}, + their_data_secret_Iv = #{theirDataSecretIv}, + their_sig_secret = #{theirSigSecret}, + our_operator_secret = #{ourOperatorSecret}, + our_data_secret = #{ourDataSecret}, + our_data_secret_iv = #{ourDataSecretIv}, + our_sig_secret = #{ourSigSecret}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from thirdparty_secret_info where id = #{id} + + + + delete from thirdparty_secret_info where id in + + #{id} + + + \ No newline at end of file diff --git a/jsowell-ui/src/api/thirdParty/secret.js b/jsowell-ui/src/api/thirdParty/secret.js new file mode 100644 index 000000000..f14541e4d --- /dev/null +++ b/jsowell-ui/src/api/thirdParty/secret.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询对接三方平台配置列表 +export function listSecret(query) { + return request({ + url: '/thirdparty/secret/list', + method: 'get', + params: query + }) +} + +// 查询对接三方平台配置详细 +export function getSecret(id) { + return request({ + url: '/thirdparty/secret/' + id, + method: 'get' + }) +} + +// 新增对接三方平台配置 +export function addSecret(data) { + return request({ + url: '/thirdparty/secret', + method: 'post', + data: data + }) +} + +// 修改对接三方平台配置 +export function updateSecret(data) { + return request({ + url: '/thirdparty/secret', + method: 'put', + data: data + }) +} + +// 删除对接三方平台配置 +export function delSecret(id) { + return request({ + url: '/thirdparty/secret/' + id, + method: 'delete' + }) +} diff --git a/jsowell-ui/src/views/thirdParty/secret/index.vue b/jsowell-ui/src/views/thirdParty/secret/index.vue new file mode 100644 index 000000000..72a9b03b9 --- /dev/null +++ b/jsowell-ui/src/views/thirdParty/secret/index.vue @@ -0,0 +1,384 @@ + + + From c8d68590756d8476a19ad2e8e39a1c3561015a76 Mon Sep 17 00:00:00 2001 From: Guoqs Date: Thu, 18 Apr 2024 17:52:19 +0800 Subject: [PATCH 3/8] =?UTF-8?q?update=20=E5=AF=B9=E6=8E=A5lianlian?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/ThirdpartySecretInfo.java | 196 ++++++++++-------- .../mapper/ThirdpartySecretInfoMapper.java | 32 +-- .../service/ThirdpartySecretInfoService.java | 3 + .../impl/ThirdpartySecretInfoServiceImpl.java | 11 + .../thirdparty/ThirdpartySecretInfoMapper.xml | 44 +++- .../src/views/thirdParty/secret/index.vue | 6 +- 6 files changed, 172 insertions(+), 120 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/thirdparty/domain/ThirdpartySecretInfo.java b/jsowell-pile/src/main/java/com/jsowell/thirdparty/domain/ThirdpartySecretInfo.java index 2a43bf10e..5c1678095 100644 --- a/jsowell-pile/src/main/java/com/jsowell/thirdparty/domain/ThirdpartySecretInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/thirdparty/domain/ThirdpartySecretInfo.java @@ -7,216 +7,228 @@ import org.apache.commons.lang3.builder.ToStringStyle; /** * 对接三方平台配置对象 thirdparty_secret_info - * + * * @author jsowell * @date 2024-04-18 */ -public class ThirdpartySecretInfo extends BaseEntity -{ +public class ThirdpartySecretInfo extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键 */ + /** + * 主键 + */ private Long id; - /** 对接平台名称 */ + /** + * 对接平台名称 + */ @Excel(name = "对接平台名称") private String platformName; - /** 对接平台类型 */ + /** + * 对接平台类型 + */ @Excel(name = "对接平台类型") private String platformType; - /** 接口地址前缀 */ + /** + * 接口地址前缀 + */ @Excel(name = "接口地址前缀") private String urlPrefix; - /** 对接平台标识(使用组织机构代码) */ + /** + * 对接平台标识(使用组织机构代码) + */ @Excel(name = "对接平台标识", readConverterExp = "使=用组织机构代码") private String theirOperatorId; - /** 对接平台生成的唯一识别密钥 */ + /** + * 对接平台生成的唯一识别密钥 + */ @Excel(name = "对接平台生成的唯一识别密钥") private String theirOperatorSecret; - /** 对接平台生成的消息密钥 */ + /** + * 对接平台生成的消息密钥 + */ @Excel(name = "对接平台生成的消息密钥") private String theirDataSecret; - /** 对接平台生成的初始化向量 */ + /** + * 对接平台生成的初始化向量 + */ @Excel(name = "对接平台生成的初始化向量") private String theirDataSecretIv; - /** 对接平台生成的签名密钥 */ + /** + * 对接平台生成的签名密钥 + */ @Excel(name = "对接平台生成的签名密钥") private String theirSigSecret; - /** 我方生成的唯一识别密钥 */ + /** + * 我方生成的唯一识别密钥 + */ @Excel(name = "我方生成的唯一识别密钥") private String ourOperatorSecret; - /** 我方生成的消息密钥 */ + /** + * 我方生成的消息密钥 + */ @Excel(name = "我方生成的消息密钥") private String ourDataSecret; - /** 我方生成的初始化向量 */ + /** + * 我方生成的初始化向量 + */ @Excel(name = "我方生成的初始化向量") private String ourDataSecretIv; - /** 我方生成的签名密钥 */ + /** + * 我方生成的签名密钥 + */ @Excel(name = "我方生成的签名密钥") private String ourSigSecret; - /** 删除标识(0-正常;1-删除) */ + /** + * 删除标识(0-正常;1-删除) + */ private String delFlag; - public void setId(Long id) - { + public void setId(Long id) { this.id = id; } - public Long getId() - { + public Long getId() { return id; } - public void setPlatformName(String platformName) - { + + public void setPlatformName(String platformName) { this.platformName = platformName; } - public String getPlatformName() - { + public String getPlatformName() { return platformName; } - public void setPlatformType(String platformType) - { + + public void setPlatformType(String platformType) { this.platformType = platformType; } - public String getPlatformType() - { + public String getPlatformType() { return platformType; } - public void setUrlPrefix(String urlPrefix) - { + + public void setUrlPrefix(String urlPrefix) { this.urlPrefix = urlPrefix; } - public String getUrlPrefix() - { + public String getUrlPrefix() { return urlPrefix; } - public void setTheirOperatorId(String theirOperatorId) - { + + public void setTheirOperatorId(String theirOperatorId) { this.theirOperatorId = theirOperatorId; } - public String getTheirOperatorId() - { + public String getTheirOperatorId() { return theirOperatorId; } - public void setTheirOperatorSecret(String theirOperatorSecret) - { + + public void setTheirOperatorSecret(String theirOperatorSecret) { this.theirOperatorSecret = theirOperatorSecret; } - public String getTheirOperatorSecret() - { + public String getTheirOperatorSecret() { return theirOperatorSecret; } - public void setTheirDataSecret(String theirDataSecret) - { + + public void setTheirDataSecret(String theirDataSecret) { this.theirDataSecret = theirDataSecret; } - public String getTheirDataSecret() - { + public String getTheirDataSecret() { return theirDataSecret; } - public void setTheirDataSecretIv(String theirDataSecretIv) - { + + public void setTheirDataSecretIv(String theirDataSecretIv) { this.theirDataSecretIv = theirDataSecretIv; } - public String getTheirDataSecretIv() - { + public String getTheirDataSecretIv() { return theirDataSecretIv; } - public void setTheirSigSecret(String theirSigSecret) - { + + public void setTheirSigSecret(String theirSigSecret) { this.theirSigSecret = theirSigSecret; } - public String getTheirSigSecret() - { + public String getTheirSigSecret() { return theirSigSecret; } - public void setOurOperatorSecret(String ourOperatorSecret) - { + + public void setOurOperatorSecret(String ourOperatorSecret) { this.ourOperatorSecret = ourOperatorSecret; } - public String getOurOperatorSecret() - { + public String getOurOperatorSecret() { return ourOperatorSecret; } - public void setOurDataSecret(String ourDataSecret) - { + + public void setOurDataSecret(String ourDataSecret) { this.ourDataSecret = ourDataSecret; } - public String getOurDataSecret() - { + public String getOurDataSecret() { return ourDataSecret; } - public void setOurDataSecretIv(String ourDataSecretIv) - { + + public void setOurDataSecretIv(String ourDataSecretIv) { this.ourDataSecretIv = ourDataSecretIv; } - public String getOurDataSecretIv() - { + public String getOurDataSecretIv() { return ourDataSecretIv; } - public void setOurSigSecret(String ourSigSecret) - { + + public void setOurSigSecret(String ourSigSecret) { this.ourSigSecret = ourSigSecret; } - public String getOurSigSecret() - { + public String getOurSigSecret() { return ourSigSecret; } - public void setDelFlag(String delFlag) - { + + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.JSON_STYLE) - .append("id", getId()) - .append("platformName", getPlatformName()) - .append("platformType", getPlatformType()) - .append("urlPrefix", getUrlPrefix()) - .append("theirOperatorId", getTheirOperatorId()) - .append("theirOperatorSecret", getTheirOperatorSecret()) - .append("theirDataSecret", getTheirDataSecret()) - .append("theirDataSecretIv", getTheirDataSecretIv()) - .append("theirSigSecret", getTheirSigSecret()) - .append("ourOperatorSecret", getOurOperatorSecret()) - .append("ourDataSecret", getOurDataSecret()) - .append("ourDataSecretIv", getOurDataSecretIv()) - .append("ourSigSecret", getOurSigSecret()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("delFlag", getDelFlag()) - .toString(); + .append("id", getId()) + .append("platformName", getPlatformName()) + .append("platformType", getPlatformType()) + .append("urlPrefix", getUrlPrefix()) + .append("theirOperatorId", getTheirOperatorId()) + .append("theirOperatorSecret", getTheirOperatorSecret()) + .append("theirDataSecret", getTheirDataSecret()) + .append("theirDataSecretIv", getTheirDataSecretIv()) + .append("theirSigSecret", getTheirSigSecret()) + .append("ourOperatorSecret", getOurOperatorSecret()) + .append("ourDataSecret", getOurDataSecret()) + .append("ourDataSecretIv", getOurDataSecretIv()) + .append("ourSigSecret", getOurSigSecret()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .toString(); } } diff --git a/jsowell-pile/src/main/java/com/jsowell/thirdparty/mapper/ThirdpartySecretInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/thirdparty/mapper/ThirdpartySecretInfoMapper.java index 2a2d6b9ed..c6f62361f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/thirdparty/mapper/ThirdpartySecretInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/thirdparty/mapper/ThirdpartySecretInfoMapper.java @@ -1,62 +1,64 @@ package com.jsowell.thirdparty.mapper; +import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import com.jsowell.thirdparty.domain.ThirdpartySecretInfo; import java.util.List; /** * 对接三方平台配置Mapper接口 - * + * * @author jsowell * @date 2024-04-18 */ -public interface ThirdpartySecretInfoMapper -{ +public interface ThirdpartySecretInfoMapper { /** * 查询对接三方平台配置 - * + * * @param id 对接三方平台配置主键 * @return 对接三方平台配置 */ - public ThirdpartySecretInfo selectThirdpartySecretInfoById(Long id); + ThirdpartySecretInfo selectThirdpartySecretInfoById(Long id); /** * 查询对接三方平台配置列表 - * + * * @param thirdpartySecretInfo 对接三方平台配置 * @return 对接三方平台配置集合 */ - public List selectThirdpartySecretInfoList(ThirdpartySecretInfo thirdpartySecretInfo); + List selectThirdpartySecretInfoList(ThirdpartySecretInfo thirdpartySecretInfo); /** * 新增对接三方平台配置 - * + * * @param thirdpartySecretInfo 对接三方平台配置 * @return 结果 */ - public int insertThirdpartySecretInfo(ThirdpartySecretInfo thirdpartySecretInfo); + int insertThirdpartySecretInfo(ThirdpartySecretInfo thirdpartySecretInfo); /** * 修改对接三方平台配置 - * + * * @param thirdpartySecretInfo 对接三方平台配置 * @return 结果 */ - public int updateThirdpartySecretInfo(ThirdpartySecretInfo thirdpartySecretInfo); + int updateThirdpartySecretInfo(ThirdpartySecretInfo thirdpartySecretInfo); /** * 删除对接三方平台配置 - * + * * @param id 对接三方平台配置主键 * @return 结果 */ - public int deleteThirdpartySecretInfoById(Long id); + int deleteThirdpartySecretInfoById(Long id); /** * 批量删除对接三方平台配置 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteThirdpartySecretInfoByIds(Long[] ids); + int deleteThirdpartySecretInfoByIds(Long[] ids); + + ThirdPartySecretInfoVO queryByOperatorId(String theirOperatorId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java index e5b149c06..8387c1dac 100644 --- a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java @@ -1,5 +1,6 @@ package com.jsowell.thirdparty.service; +import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import com.jsowell.thirdparty.domain.ThirdpartySecretInfo; import java.util.List; @@ -58,4 +59,6 @@ public interface ThirdpartySecretInfoService { * @return 结果 */ public int deleteThirdpartySecretInfoById(Long id); + + ThirdPartySecretInfoVO queryByOperatorId(String theirOperatorId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java index 429e58eeb..d618c3d3a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java @@ -1,6 +1,7 @@ package com.jsowell.thirdparty.service.impl; import com.jsowell.common.util.DateUtils; +import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import com.jsowell.thirdparty.domain.ThirdpartySecretInfo; import com.jsowell.thirdparty.mapper.ThirdpartySecretInfoMapper; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; @@ -87,4 +88,14 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ public int deleteThirdpartySecretInfoById(Long id) { return thirdpartySecretInfoMapper.deleteThirdpartySecretInfoById(id); } + + /** + * 查询第三方平台密钥配置信息 + * @param theirOperatorId 第三方平台的组织结构代码 + * @return + */ + @Override + public ThirdPartySecretInfoVO queryByOperatorId(String theirOperatorId) { + return thirdpartySecretInfoMapper.queryByOperatorId(theirOperatorId); + } } diff --git a/jsowell-pile/src/main/resources/mapper/thirdparty/ThirdpartySecretInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/thirdparty/ThirdpartySecretInfoMapper.xml index f48f853a3..632028045 100644 --- a/jsowell-pile/src/main/resources/mapper/thirdparty/ThirdpartySecretInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/thirdparty/ThirdpartySecretInfoMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -12,7 +12,7 @@ - + @@ -25,11 +25,18 @@ - - select id, platform_name, platform_type, url_prefix, their_operator_id, their_operator_secret, their_data_secret, their_data_secret_Iv, their_sig_secret, our_operator_secret, our_data_secret, our_data_secret_iv, our_sig_secret, create_by, create_time, update_by, update_time, del_flag from thirdparty_secret_info + + id, platform_name, platform_type, url_prefix, their_operator_id, their_operator_secret, their_data_secret, + their_data_secret_iv, their_sig_secret, our_operator_secret, our_data_secret, our_data_secret_iv, + our_sig_secret, create_by, create_time, update_by, update_time, del_flag - and platform_name like concat('%', #{platformName}, '%') @@ -38,7 +45,7 @@ and their_operator_id = #{theirOperatorId} and their_operator_secret = #{theirOperatorSecret} and their_data_secret = #{theirDataSecret} - and their_data_secret_Iv = #{theirDataSecretIv} + and their_data_secret_iv = #{theirDataSecretIv} and their_sig_secret = #{theirSigSecret} and our_operator_secret = #{ourOperatorSecret} and our_data_secret = #{ourDataSecret} @@ -52,7 +59,7 @@ where id = #{id} - + insert into thirdparty_secret_info platform_name, @@ -61,7 +68,7 @@ their_operator_id, their_operator_secret, their_data_secret, - their_data_secret_Iv, + their_data_secret_iv, their_sig_secret, our_operator_secret, our_data_secret, @@ -94,7 +101,7 @@ - + update thirdparty_secret_info platform_name = #{platformName}, @@ -103,7 +110,7 @@ their_operator_id = #{theirOperatorId}, their_operator_secret = #{theirOperatorSecret}, their_data_secret = #{theirDataSecret}, - their_data_secret_Iv = #{theirDataSecretIv}, + their_data_secret_iv = #{theirDataSecretIv}, their_sig_secret = #{theirSigSecret}, our_operator_secret = #{ourOperatorSecret}, our_data_secret = #{ourDataSecret}, @@ -128,4 +135,21 @@ #{id} + + \ No newline at end of file diff --git a/jsowell-ui/src/views/thirdParty/secret/index.vue b/jsowell-ui/src/views/thirdParty/secret/index.vue index 72a9b03b9..b30aa4f47 100644 --- a/jsowell-ui/src/views/thirdParty/secret/index.vue +++ b/jsowell-ui/src/views/thirdParty/secret/index.vue @@ -171,7 +171,7 @@ /> - + @@ -206,9 +206,9 @@ - +