From 1223368fb6dfb6a4f2a5d09293911de60aeef497 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 11 Jun 2019 17:43:40 +0800 Subject: [PATCH] =?UTF-8?q?fix=20v2=20gateway=20=E8=A1=A8=E4=B8=BB?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/mappers/system/MerchantSignInfoMapper.java | 5 ++--- .../manage/merchants/core/impls/ClientManagerImpl.java | 6 +++--- .../manage/merchants/entity/ClientGatewaySignModify.java | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java index a24933aa5..6f8b5b2e7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java @@ -1,6 +1,5 @@ package au.com.royalpay.payment.manage.mappers.system; -import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; @@ -8,11 +7,11 @@ import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; -@AutoMapper(tablename = "merchant_sign_info", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class) +@AutoMapper(tablename = "merchant_sign_info", pkName = "client_moniker", keyGenerator = Jdbc3KeyGenerator.class) public interface MerchantSignInfoMapper { @AutoSql(type = SqlType.SELECT) - JSONObject findClientSign(@Param("client_id") int clientId); + JSONObject findClientSign(@Param("client_moniker") String clientMoniker); @AutoSql(type = SqlType.UPDATE) void update(JSONObject signInfo); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 78d920fd7..21f26e579 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -425,7 +425,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("level2_client", 1); } //gateway V2 - JSONObject partnerGatewaySign = merchantSignInfoMapper.findClientSign(client.getIntValue("client_id")); + JSONObject partnerGatewaySign = merchantSignInfoMapper.findClientSign(client.getString("client_moniker")); if (partnerGatewaySign == null) { client.put("enable_gateway_version2", false); }else { @@ -3231,11 +3231,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } - JSONObject gatewaySignInfo = merchantSignInfoMapper.findClientSign(account.getIntValue("client_id")); + JSONObject gatewaySignInfo = merchantSignInfoMapper.findClientSign(client.getString("client_moniker")); if (gatewaySignInfo == null) { JSONObject key = getRsaKey(); gatewaySignInfo = new JSONObject(); - gatewaySignInfo.put("client_id", account.getIntValue("client_id")); + gatewaySignInfo.put("client_moniker", client.getIntValue("client_moniker")); gatewaySignInfo.put("platform_public_key", key.getString("public_key")); gatewaySignInfo.put("platform_private_key", key.getString("private_key")); gatewaySignInfo.put("is_valid", 0); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java index cd1d8a1d3..2c72380bf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java @@ -1,6 +1,5 @@ package au.com.royalpay.payment.manage.merchants.entity; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper; import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; @@ -34,9 +33,9 @@ public abstract class ClientGatewaySignModify { protected abstract JSONObject getModifyResult(); @Transactional - public int doModify(MerchantInfoProvider merchantInfoProvider,MerchantSignInfoMapper merchantSignInfoMapper, MongoTemplate mongoTemplate) { + public int doModify(MerchantInfoProvider merchantInfoProvider, MerchantSignInfoMapper merchantSignInfoMapper, MongoTemplate mongoTemplate) { JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker); - JSONObject clientGatewaySign = merchantSignInfoMapper.findClientSign(client.getIntValue("client_id")); + JSONObject clientGatewaySign = merchantSignInfoMapper.findClientSign(clientMoniker); JSONObject modifyResult = getModifyResult(); try { saveModifyHistory(clientGatewaySign, modifyResult, mongoTemplate); @@ -44,7 +43,7 @@ public abstract class ClientGatewaySignModify { } int clientId = client.getIntValue("client_id"); - modifyResult.put("client_id", clientId); + modifyResult.put("client_moniker", clientMoniker); modifyResult.put("last_update_by", account.getString("account_id")); modifyResult.put("last_update_date", new Date()); merchantSignInfoMapper.update(modifyResult);