fix: client modify process

master
yixian 4 years ago
parent 1453f0505a
commit a1bbc19efd

@ -99,6 +99,9 @@ public interface ClientManager {
@Transactional
void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow);
@Transactional
void modifyUPayProfile(JSONObject manager, String clientMoniker, String profileKey, boolean allow);
@Transactional
void switchChannelPermission(JSONObject manager, String clientMoniker, String channel, boolean allow);
@ -176,7 +179,7 @@ public interface ClientManager {
List<JSONObject> listSubClients(JSONObject manager, String clientMoniker);
JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,String searchText, int page);
JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker, String searchText, int page);
List<JSONObject> listSubClients(int clientId);
@ -210,6 +213,7 @@ public interface ClientManager {
/**
* Id
*
* @param clientMoniker
* @param client_type
* @param client_ids
@ -253,9 +257,9 @@ public interface ClientManager {
void revertClient(String clientMoniker, JSONObject manager);
void updateClientIdInfo(String clientMoniker,JSONObject params, JSONObject manager);
void updateClientIdInfo(String clientMoniker, JSONObject params, JSONObject manager);
void updateMWRiskInfoByClient(String clientMoniker,JSONObject params, JSONObject manager);
void updateMWRiskInfoByClient(String clientMoniker, JSONObject params, JSONObject manager);
JSONObject getAuthFiles(JSONObject manager, String clientMoniker);
@ -287,7 +291,7 @@ public interface ClientManager {
List<JSONObject> uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo);
List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo,String fileType);
List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo, String fileType);
List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo);
@ -307,6 +311,7 @@ public interface ClientManager {
/**
*
*
* @param clientMoniker
* @param manager
*/
@ -392,7 +397,7 @@ public interface ClientManager {
void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception;
void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,String promotionalEffectiveDate,int promotionalPeriod) throws Exception;
void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String promotionalEffectiveDate, int promotionalPeriod) throws Exception;
void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception;
@ -587,7 +592,7 @@ public interface ClientManager {
boolean getMergeSettleStatus(JSONObject client);
void changeExtParams(String clientMoniker,JSONObject manager, JSONObject params);
void changeExtParams(String clientMoniker, JSONObject manager, JSONObject params);
RPayMerchantEntity applyMWMerchantId(String clientMoniker, JSONObject manager);

@ -1,19 +1,21 @@
package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation;
/**
* Create by yixian at 2018-04-12 16:24
*/
public interface ClientModifySupport {
void processModify(ClientModifyOperation modify);
void processClientModify(ClientModify clientModify);
void processClientConfigModify(ClientConfigModify clientConfigModify);
void processClientConfigModify(ClientModify clientConfigModify);
void processClientConfigModify(ClientConfigModify clientConfigModify, boolean onlyModifyConfig);
void processClientConfigModify(ClientModify clientConfigModify, boolean onlyModifyConfig);
void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify);
}

@ -1625,11 +1625,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, permissionKey, allow));
JSONObject upayProfileInfo = sysClientUpayProfileMapper.findInfo(client.getInteger("client_id"));
if (upayProfileInfo != null) {
upayProfileInfo.put(permissionKey, allow);
sysClientUpayProfileMapper.update(upayProfileInfo);
}
@Override
@Transactional
public void modifyUPayProfile(JSONObject manager, String clientMoniker, String profileKey, boolean allow) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport.processModify(new CustomSwitchModify(manager, clientMoniker, profileKey, allow, cli -> {
JSONObject profileUpdate = new JSONObject();
profileUpdate.put(profileKey, allow);
profileUpdate.put("client_id", cli.getIntValue("client_id"));
sysClientUpayProfileMapper.update(profileUpdate);
}));
}
@Override
@ -3142,7 +3152,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("clean_days", p.getString("clean_days"));
} else if ("Alipay".equals(rate_name)) {
client.put("alipay_rate", p.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}else if ("AlipayOnline".equals(rate_name)) {
} else if ("AlipayOnline".equals(rate_name)) {
client.put("alipay_online_rate", p.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
});

@ -5,11 +5,10 @@ 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.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;
@ -34,26 +33,36 @@ public class ClientModifySupportImpl implements ClientModifySupport {
private MongoTemplate mongoTemplate;
@Override
public void processClientModify(ClientModify modify) {
int clientId = modify.doModify(merchantInfoProvider, clientMapper,mongoTemplate);
public void processModify(ClientModifyOperation modify) {
int clientId = modify.processModify(merchantInfoProvider, mongoTemplate);
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
public void processClientConfigModify(ClientConfigModify clientConfigModify) {
int clientId =clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,clientMapper,mongoTemplate);
clientInfoCacheSupport.clearClientCache(clientId);
public void processClientModify(ClientModify modify) {
processModify(modify.setModifyConsumer(modifyObj -> clientMapper.update(modifyObj)));
}
@Override
public void processClientConfigModify(ClientConfigModify clientConfigModify,boolean onlyModifyConfig) {
int clientId =clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,clientMapper,mongoTemplate,onlyModifyConfig);
clientInfoCacheSupport.clearClientConfigCache(clientId);
public void processClientConfigModify(ClientModify clientConfigModify) {
processModify(clientConfigModify.setModifyConsumer(modifyObj -> {
clientMapper.update(modifyObj);
clientConfigMapper.update(modifyObj);
}));
}
@Override
public void processClientConfigModify(ClientModify clientConfigModify, boolean onlyModifyConfig) {
processModify(clientConfigModify.setModifyConsumer(modifyObj -> {
if (!onlyModifyConfig) {
clientMapper.update(modifyObj);
}
clientConfigMapper.update(modifyObj);
}));
}
@Override
public void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify) {
int clientId =clientGatewaySignModify.doModify(merchantInfoProvider, merchantSignInfoMapper,mongoTemplate);
clientInfoCacheSupport.clearClientCache(clientId);
processModify(clientGatewaySignModify.setMerchantSignInfoMapper(merchantSignInfoMapper));
}
}

@ -1,78 +1,39 @@
package au.com.royalpay.payment.manage.merchants.entity;
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;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.function.Consumer;
/**
* Create by yixian at 2018-04-12 16:19
*/
public abstract class ClientGatewaySignModify {
public abstract class ClientGatewaySignModify extends ClientModifyOperation {
private JSONObject account;
private String clientMoniker;
private MerchantSignInfoMapper merchantSignInfoMapper;
public ClientGatewaySignModify(JSONObject account, String clientMoniker) {
this.account = account;
this.clientMoniker = clientMoniker;
super(account, clientMoniker);
}
protected abstract String business();
protected abstract JSONObject getModifyResult();
@Transactional
public int doModify(MerchantInfoProvider merchantInfoProvider, MerchantSignInfoMapper merchantSignInfoMapper, MongoTemplate mongoTemplate) {
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker);
JSONObject clientGatewaySign = merchantSignInfoMapper.findClientSign(clientMoniker);
JSONObject modifyResult = getModifyResult();
try {
saveModifyHistory(clientGatewaySign, modifyResult, mongoTemplate);
}catch (Exception e){
}
int clientId = client.getIntValue("client_id");
modifyResult.put("client_moniker", clientMoniker);
modifyResult.put("last_update_by", account.getString("account_id"));
modifyResult.put("last_update_date", new Date());
merchantSignInfoMapper.update(modifyResult);
return clientId;
@Override
protected Consumer<JSONObject> getModifyProcess() {
return client -> {
JSONObject modifyResult = getModifyResult();
modifyResult.put("client_moniker", getClientMoniker());
modifyResult.put("last_update_by", getAccount().getString("account_id"));
modifyResult.put("last_update_date", new Date());
merchantSignInfoMapper.update(modifyResult);
};
}
private void saveModifyHistory(JSONObject clientGatewaySign, JSONObject modifyResult, MongoTemplate mongoTemplate) {
if (account == null) {
return;
}
ClientConfigLog clientConfigLog = new ClientConfigLog();
clientConfigLog.setId(IdUtil.getId());
clientConfigLog.setBusiness(business());
clientConfigLog.setClientId(clientGatewaySign.getIntValue("client_id"));
boolean isPartner = true;
if (StringUtils.isNotEmpty(account.getString("account_id"))) {
isPartner = true;
}
if (StringUtils.isNotEmpty(account.getString("manager_id"))) {
isPartner = false;
}
clientConfigLog.setUserType(isPartner ? "Merchant" : "Manager");
clientConfigLog.setCreateTime(new Date());
clientConfigLog.setNewData(modifyResult.toJSONString());
clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id"));
Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, clientGatewaySign::get));
clientConfigLog.setOriginData(JSON.toJSONString(beforeModify));
clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name"));
mongoTemplate.save(clientConfigLog);
public ClientGatewaySignModify setMerchantSignInfoMapper(MerchantSignInfoMapper merchantSignInfoMapper) {
this.merchantSignInfoMapper = merchantSignInfoMapper;
return this;
}
}

@ -1,77 +1,32 @@
package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.function.Consumer;
/**
* Create by yixian at 2018-04-12 16:19
*/
public abstract class ClientModify {
public abstract class ClientModify extends ClientModifyOperation {
private JSONObject account;
private String clientMoniker;
private Consumer<JSONObject> modifyConsumer;
public ClientModify(JSONObject account, String clientMoniker) {
this.account = account;
this.clientMoniker = clientMoniker;
super(account, clientMoniker);
}
protected abstract String business();
protected abstract JSONObject getModifyResult();
@Transactional
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientMapper clientMapper, MongoTemplate mongoTemplate) {
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker);
JSONObject modifyResult = getModifyResult();
try {
saveModifyHistory(client, modifyResult, mongoTemplate);
}catch (Exception e){
}
int clientId = client.getIntValue("client_id");
modifyResult.put("client_id", clientId);
clientMapper.update(modifyResult);
return clientId;
@Override
protected Consumer<JSONObject> getModifyProcess() {
return client -> {
JSONObject modifyResult = getModifyResult();
int clientId = client.getIntValue("client_id");
modifyResult.put("client_id", clientId);
modifyConsumer.accept(modifyResult);
};
}
private void saveModifyHistory(JSONObject client, JSONObject modifyResult, MongoTemplate mongoTemplate) {
if (account == null) {
return;
}
ClientConfigLog clientConfigLog = new ClientConfigLog();
clientConfigLog.setId(IdUtil.getId());
clientConfigLog.setBusiness(business());
clientConfigLog.setClientId(client.getIntValue("client_id"));
boolean isPartner = true;
if (StringUtils.isNotEmpty(account.getString("account_id"))) {
isPartner = true;
}
if (StringUtils.isNotEmpty(account.getString("manager_id"))) {
isPartner = false;
}
clientConfigLog.setUserType(isPartner ? "Merchant" : "Manager");
clientConfigLog.setCreateTime(new Date());
clientConfigLog.setNewData(modifyResult.toJSONString());
clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id"));
Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, client::get));
clientConfigLog.setOriginData(JSON.toJSONString(beforeModify));
clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name"));
mongoTemplate.save(clientConfigLog);
public ClientModify setModifyConsumer(Consumer<JSONObject> modifyConsumer) {
this.modifyConsumer = modifyConsumer;
return this;
}
}

@ -1,32 +1,26 @@
package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
* Create by yixian at 2018-04-12 16:19
* Create by davep at 2020-05-12 14:32
*/
public abstract class ClientConfigModify {
private JSONObject account;
private String clientMoniker;
public abstract class ClientModifyOperation {
private final JSONObject account;
private final String clientMoniker;
public ClientConfigModify(JSONObject account, String clientMoniker) {
protected ClientModifyOperation(JSONObject account, String clientMoniker) {
this.account = account;
this.clientMoniker = clientMoniker;
}
@ -35,36 +29,21 @@ public abstract class ClientConfigModify {
protected abstract JSONObject getModifyResult();
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientConfigMapper clientConfigMapper, ClientMapper clientMapper, MongoTemplate mongoTemplate) {
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker);
JSONObject modifyResult = getModifyResult();
try {
saveModifyHistory(client, modifyResult, mongoTemplate);
}catch (Exception e){
protected abstract Consumer<JSONObject> getModifyProcess();
}
int clientId = client.getIntValue("client_id");
modifyResult.put("client_id", clientId);
clientConfigMapper.update(modifyResult);
clientMapper.update(modifyResult);
return clientId;
}
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientConfigMapper clientConfigMapper, ClientMapper clientMapper, MongoTemplate mongoTemplate,boolean onlyModifyConfig) {
JSONObject clientConfig = merchantInfoProvider.getClientConfigInfoByMoniker(clientMoniker);
public int processModify(MerchantInfoProvider merchantInfoProvider, MongoTemplate mongoTemplate) {
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(getClientMoniker());
JSONObject modifyResult = getModifyResult();
try {
saveModifyHistory(clientConfig, modifyResult, mongoTemplate);
}catch (Exception e){
saveModifyHistory(client, modifyResult, mongoTemplate);
} catch (Exception e) {
}
int clientId = clientConfig.getIntValue("client_id");
modifyResult.put("client_id", clientId);
clientConfigMapper.update(modifyResult);
return clientId;
getModifyProcess().accept(client);
return client.getIntValue("client_id");
}
private void saveModifyHistory(JSONObject client, JSONObject modifyResult,MongoTemplate mongoTemplate) {
protected void saveModifyHistory(JSONObject client, JSONObject modifyResult, MongoTemplate mongoTemplate) {
if (account == null) {
return;
}
@ -86,7 +65,15 @@ public abstract class ClientConfigModify {
clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id"));
Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, client::get));
clientConfigLog.setOriginData(JSON.toJSONString(beforeModify));
clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name"));
clientConfigLog.setUserName(account.getString("display_name"));
mongoTemplate.insert(clientConfigLog);
}
public JSONObject getAccount() {
return account;
}
public String getClientMoniker() {
return clientMoniker;
}
}

@ -1,17 +1,17 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class CBBankPaypadVersionModify extends ClientConfigModify {
private String cbbank_paypad_version;
public class CBBankPaypadVersionModify extends ClientModify {
private String cbbankPaypadVersion;
public CBBankPaypadVersionModify(JSONObject account, String clientMoniker, String paypad_version) {
super(account, clientMoniker);
this.cbbank_paypad_version = paypad_version;
this.cbbankPaypadVersion = paypad_version;
}
@Override
@ -23,7 +23,7 @@ public class CBBankPaypadVersionModify extends ClientConfigModify {
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("cbbank_paypad_version", cbbank_paypad_version);
modify.put("cbbank_paypad_version", cbbankPaypadVersion);
return modify;
}
}

@ -1,30 +1,29 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class ClearDaysModify extends ClientConfigModify {
private int settle_hour;
public class ClearDaysModify extends ClientModify {
private int settleHour;
public ClearDaysModify(JSONObject account, String clientMoniker, int settle_hour) {
public ClearDaysModify(JSONObject account, String clientMoniker, int settleHour) {
super(account, clientMoniker);
this.settle_hour = settle_hour;
this.settleHour = settleHour;
}
@Override
protected String business() {
return "修改商户清算截止时间为:"+settle_hour;
return "修改商户清算截止时间为:" + settleHour;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("settle_hour", settle_hour);
modify.put("settle_hour", settleHour);
return modify;
}
}

@ -1,19 +1,18 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class CredentialCodeModify extends ClientConfigModify {
private String credential_code;
public class CredentialCodeModify extends ClientModify {
private String credentialCode;
public CredentialCodeModify(JSONObject account, String clientMoniker, String credential_code) {
public CredentialCodeModify(JSONObject account, String clientMoniker, String credentialCode) {
super(account, clientMoniker);
this.credential_code = credential_code;
this.credentialCode = credentialCode;
}
@Override
@ -24,7 +23,7 @@ public class CredentialCodeModify extends ClientConfigModify {
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("credential_code", credential_code);
modify.put("credential_code", credentialCode);
return modify;
}
}

@ -0,0 +1,43 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation;
import com.alibaba.fastjson.JSONObject;
import java.util.function.Consumer;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class CustomSwitchModify extends ClientModifyOperation {
private final String key;
private final boolean value;
private final Consumer<JSONObject> modifyProcess;
public CustomSwitchModify(JSONObject account, String clientMoniker, String key, boolean value, Consumer<JSONObject> modifyProcess) {
super(account, clientMoniker);
this.key = key;
this.value = value;
this.modifyProcess = modifyProcess;
}
@Override
protected String business() {
return (value ? "开启 " : "关闭 ") + key;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put(key, value);
return modify;
}
@Override
protected Consumer<JSONObject> getModifyProcess() {
return modifyProcess;
}
}

@ -1,7 +1,6 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal;
@ -9,24 +8,24 @@ import java.math.BigDecimal;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class CustomerSurchargeRateModify extends ClientConfigModify {
private BigDecimal customer_surcharge_rate;
public class CustomerSurchargeRateModify extends ClientModify {
private BigDecimal customerSurchargeRate;
public CustomerSurchargeRateModify(JSONObject account, String clientMoniker, BigDecimal customer_surcharge_rate) {
public CustomerSurchargeRateModify(JSONObject account, String clientMoniker, BigDecimal customerSurchargeRate) {
super(account, clientMoniker);
this.customer_surcharge_rate = customer_surcharge_rate;
this.customerSurchargeRate = customerSurchargeRate;
}
@Override
protected String business() {
return "修改商户客户手续费率为:"+customer_surcharge_rate;
return "修改商户客户手续费率为:" + customerSurchargeRate;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("customer_surcharge_rate", customer_surcharge_rate);
modify.put("customer_surcharge_rate", customerSurchargeRate);
return modify;
}
}

@ -1,7 +1,6 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal;
@ -9,24 +8,24 @@ import java.math.BigDecimal;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class EmailSendStandByModify extends ClientConfigModify {
private BigDecimal max_order_amount;
public class EmailSendStandByModify extends ClientModify {
private BigDecimal maxOrderAmount;
public EmailSendStandByModify(JSONObject account, String clientMoniker, BigDecimal max_order_amount) {
public EmailSendStandByModify(JSONObject account, String clientMoniker, BigDecimal maxOrderAmount) {
super(account, clientMoniker);
this.max_order_amount = max_order_amount;
this.maxOrderAmount = maxOrderAmount;
}
@Override
protected String business() {
return "修改商户最大订单额为:"+max_order_amount;
return "修改商户最大订单额为:" + maxOrderAmount;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("max_order_amount", max_order_amount);
modify.put("max_order_amount", maxOrderAmount);
return modify;
}
}

@ -1,7 +1,6 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal;
@ -9,24 +8,24 @@ import java.math.BigDecimal;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class MaxOrderAmountModify extends ClientConfigModify {
private BigDecimal max_order_amount;
public class MaxOrderAmountModify extends ClientModify {
private BigDecimal maxOrderAmount;
public MaxOrderAmountModify(JSONObject account, String clientMoniker, BigDecimal max_order_amount) {
public MaxOrderAmountModify(JSONObject account, String clientMoniker, BigDecimal maxOrderAmount) {
super(account, clientMoniker);
this.max_order_amount = max_order_amount;
this.maxOrderAmount = maxOrderAmount;
}
@Override
protected String business() {
return "修改商户最大订单额为:"+max_order_amount;
return "修改商户最大订单额为:" + maxOrderAmount;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("max_order_amount", max_order_amount);
modify.put("max_order_amount", maxOrderAmount);
return modify;
}
}

@ -1,19 +1,18 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class OrderExpiryModify extends ClientConfigModify {
private String order_expiry_config;
public class OrderExpiryModify extends ClientModify {
private String orderExpiryConfig;
public OrderExpiryModify(JSONObject account, String clientMoniker, String order_expiry_config) {
public OrderExpiryModify(JSONObject account, String clientMoniker, String orderExpiryConfig) {
super(account, clientMoniker);
this.order_expiry_config = order_expiry_config;
this.orderExpiryConfig = orderExpiryConfig;
}
@Override
@ -24,7 +23,7 @@ public class OrderExpiryModify extends ClientConfigModify {
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("order_expiry_config", order_expiry_config);
modify.put("order_expiry_config", orderExpiryConfig);
return modify;
}
}

@ -1,18 +1,17 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class PaypadVersionModify extends ClientConfigModify {
private String paypad_version;
public class PaypadVersionModify extends ClientModify {
private String paypadVersion;
public PaypadVersionModify(JSONObject account, String clientMoniker, String paypad_version) {
public PaypadVersionModify(JSONObject account, String clientMoniker, String paypadVersion) {
super(account, clientMoniker);
this.paypad_version = paypad_version;
this.paypadVersion = paypadVersion;
}
@Override
@ -24,7 +23,7 @@ public class PaypadVersionModify extends ClientConfigModify {
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("paypad_version", paypad_version);
modify.put("paypad_version", paypadVersion);
return modify;
}
}

@ -1,23 +1,22 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class RefundAuditModify extends ClientConfigModify {
public class RefundAuditModify extends ClientModify {
private boolean enable;
public RefundAuditModify(JSONObject account, String clientMoniker, boolean enable) {
super( account, clientMoniker);
super(account, clientMoniker);
this.enable = enable;
}
@Override
protected String business() {
return (enable?"打开":"关闭")+"refund_audit";
return (enable ? "打开" : "关闭") + "refund_audit";
}
@Override

@ -1,13 +1,12 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class RefundPWDModify extends ClientConfigModify {
public class RefundPWDModify extends ClientModify {
private String refund_pwd;
private String refund_pwd_salt;

@ -1,30 +1,29 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class SettleHourModify extends ClientConfigModify {
private Integer settle_hour;
public class SettleHourModify extends ClientModify {
private Integer settleHour;
public SettleHourModify(JSONObject account, String clientMoniker, Integer settle_hour) {
public SettleHourModify(JSONObject account, String clientMoniker, Integer settleHour) {
super(account, clientMoniker);
this.settle_hour = settle_hour;
this.settleHour = settleHour;
}
@Override
protected String business() {
return "修改商户清算截止时间为:"+settle_hour;
return "修改商户清算截止时间为:" + settleHour;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("settle_hour", settle_hour);
modify.put("settle_hour", settleHour);
return modify;
}
}

@ -1,6 +1,5 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;

@ -1,6 +1,5 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;

@ -1,15 +1,14 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class SwitchPermissionModify extends ClientConfigModify {
private String key;
private boolean value;
public class SwitchPermissionModify extends ClientModify {
private final String key;
private final boolean value;
public SwitchPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) {
super(account, clientMoniker);
@ -19,8 +18,7 @@ public class SwitchPermissionModify extends ClientConfigModify {
@Override
protected String business() {
return (value?"开启 ":"关闭 ")+key;
return (value ? "开启 " : "关闭 ") + key;
}
@Override

@ -990,7 +990,7 @@ public class PartnerManageController {
*/
@ManagerMapping(value = "/{clientMoniker}/payment_card_permission", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void switchInternationalCard(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){
clientManager.switchPermission(manager, clientMoniker, "enable_international_card", pass.getBooleanValue("allow"));
clientManager.modifyUPayProfile(manager, clientMoniker, "enable_international_card", pass.getBooleanValue("allow"));
}
}

Loading…
Cancel
Save