yangkai 6 years ago
parent 1796a7fd3e
commit 4886dd214e

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.management.sysconfig.core.impls;
import au.com.royalpay.payment.manage.management.sysconfig.core.SysPaymentConfig;
import au.com.royalpay.payment.manage.mappers.system.RateMapper;
import au.com.royalpay.payment.manage.mappers.system.SysPaymentConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.SysChannelConfigMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
@ -14,21 +14,21 @@ import java.util.List;
@Service
public class SysPaymentConfigImpl implements SysPaymentConfig {
@Resource
private SysPaymentConfigMapper sysPaymentConfigMapper;
private SysChannelConfigMapper sysChannelConfigMapper;
@Override
public List<JSONObject> getPaymentChannel() {
return sysPaymentConfigMapper.selectAll();
return sysChannelConfigMapper.selectAll();
}
@Override
public void updatePaymentChannel(JSONObject manager, String channel, int type) {
JSONObject paymentConfig = sysPaymentConfigMapper.find(channel, type);
JSONObject paymentConfig = sysChannelConfigMapper.find(channel, type);
if (paymentConfig == null) {
throw new BadRequestException("不存在该快捷通道");
}
Date lastUpdateTime = new Date();
sysPaymentConfigMapper.updatePaymentConfig(channel, type, lastUpdateTime, manager.getString("display_name"), false);
sysPaymentConfigMapper.updatePaymentConfig(channel, type, lastUpdateTime, manager.getString("display_name"), true);
sysChannelConfigMapper.updatePaymentConfig(channel, type, lastUpdateTime, manager.getString("display_name"), false);
sysChannelConfigMapper.updatePaymentConfig(channel, type, lastUpdateTime, manager.getString("display_name"), true);
}
}

@ -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;
@ -10,8 +9,8 @@ import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@AutoMapper(tablename = "sys_payment_config",pkName = "channel")
public interface SysPaymentConfigMapper {
@AutoMapper(tablename = "cb_channel_config",pkName = "channel_id")
public interface SysChannelConfigMapper {
@AutoSql(type = SqlType.SELECT)
List<JSONObject> selectAll();

@ -296,7 +296,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private RiskAttentionMerchantsMapper riskAttentionMerchantsMapper;
@Resource
private SysPaymentConfigMapper sysPaymentConfigMapper;
private SysChannelConfigMapper sysChannelConfigMapper;
@Resource
private SmsSender smsSender;
@ -4265,7 +4265,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new BadRequestException("partner code is not exists!");
}
JSONObject paymentConfig = sysPaymentConfigMapper.findOne(1);
JSONObject paymentConfig = sysChannelConfigMapper.findOne(1);
if (paymentConfig == null) {
throw new BadRequestException("服务商未开启快捷支付");
}
@ -4297,7 +4297,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new BadRequestException("partner code is not exists!");
}
JSONObject paymentConfig = sysPaymentConfigMapper.findOne(1);
JSONObject paymentConfig = sysChannelConfigMapper.findOne(1);
if (paymentConfig == null) {
throw new BadRequestException("服务商未开启快捷支付");
}

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.SysPaymentConfigMapper">
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.SysChannelConfigMapper">
<update id="updatePaymentConfig">
update sys_payment_config
update cb_channel_config
SET is_valid = #{is_valid},last_update_by = #{last_update_by},last_update_date = #{last_update_date}
<where>
type = #{type}
@ -15,6 +15,6 @@
</where>
</update>
<select id="findOne" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_payment_config where is_valid = 1 and type = #{type} limit 1;
select * from cb_channel_config where is_valid = 1 and type = #{type} limit 1;
</select>
</mapper>
Loading…
Cancel
Save