fix v2 gateway 表主键

master
luoyang 6 years ago
parent 03a12fd812
commit 1223368fb6

@ -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);

@ -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);

@ -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);

Loading…
Cancel
Save