master
wangning 8 years ago
parent e7817f5449
commit 13f8547d47

@ -240,7 +240,7 @@ public class RetailAppServiceImp implements RetailAppService {
if (device.getIntValue("client_id") != account.getIntValue("client_id") || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { if (device.getIntValue("client_id") != account.getIntValue("client_id") || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
throw new ForbiddenException("You have no permission"); throw new ForbiddenException("You have no permission");
} }
clientManager.updateAppClient(device.getIntValue("client_id"), appClientBean); clientManager.updateAppClient(account,device.getIntValue("client_id"), appClientBean);
} }

@ -177,7 +177,7 @@ public interface ClientManager {
void writeActivityPoster(JSONObject manager, String clientMoniker, String activityName, OutputStream ous) throws IOException; void writeActivityPoster(JSONObject manager, String clientMoniker, String activityName, OutputStream ous) throws IOException;
@Transactional @Transactional
void updateTimeZone(String clientMoniker, String timezone); void updateTimeZone(JSONObject account,String clientMoniker, String timezone);
JSONObject listClientDevices(JSONObject manager, String clientMoniker, String remark, int page, int limit, String client_type, String[] client_ids); JSONObject listClientDevices(JSONObject manager, String clientMoniker, String remark, int page, int limit, String client_type, String[] client_ids);
@ -189,7 +189,7 @@ public interface ClientManager {
JSONObject getBankInfo(JSONObject manager, String clientMoniker, String bsb_no); JSONObject getBankInfo(JSONObject manager, String clientMoniker, String bsb_no);
void setMaxOrderAmount(String clientMoniker, BigDecimal limit); void setMaxOrderAmount(JSONObject account,String clientMoniker, BigDecimal limit);
void setClientQRCodePaySurCharge(String clientMoniker, boolean paySurcharge); void setClientQRCodePaySurCharge(String clientMoniker, boolean paySurcharge);
@ -241,13 +241,13 @@ public interface ClientManager {
JSONArray getAllClientIds(int clientId); JSONArray getAllClientIds(int clientId);
void updateAppClient(int client_id, AppClientBean appClientBean); void updateAppClient(JSONObject account,int client_id, AppClientBean appClientBean);
void setSkipClearing(String clientMoniker, Boolean skip_clearing); void setSkipClearing(JSONObject account,String clientMoniker, Boolean skip_clearing);
void enableGatewayUpgrade(String clientMoniker, boolean gatewayUpgrade); void enableGatewayUpgrade(String clientMoniker, boolean gatewayUpgrade);
void setCustomerSurchargeRate(String clientMoniker, BigDecimal customer_surcharge_rate); void setCustomerSurchargeRate(JSONObject account,String clientMoniker, BigDecimal customer_surcharge_rate);
void setOrderExpiryConfig(String clientMoniker, String orderExpiryConfig); void setOrderExpiryConfig(String clientMoniker, String orderExpiryConfig);

@ -43,11 +43,17 @@ import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.impls.ApproveEmailAuditModify; import au.com.royalpay.payment.manage.merchants.entity.impls.ApproveEmailModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.GreenChannelAuditModify; import au.com.royalpay.payment.manage.merchants.entity.impls.BDUserModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.MerchantIdAuditModify; import au.com.royalpay.payment.manage.merchants.entity.impls.ClearDaysModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.CustomerSurchargeRateModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.GreenChannelModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.MaxOrderAmountModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.MerchantIdModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.RefundAuditModify; import au.com.royalpay.payment.manage.merchants.entity.impls.RefundAuditModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionAuditModify; import au.com.royalpay.payment.manage.merchants.entity.impls.SettleHourModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.TimeZoneModify;
import au.com.royalpay.payment.manage.notice.core.MailService; import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.signin.beans.TodoNotice; import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider; import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
@ -589,13 +595,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
String subMerchantId = subMerchantInfo.getString("sub_merchant_id"); String subMerchantId = subMerchantInfo.getString("sub_merchant_id");
WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(subMerchantId); WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(subMerchantId);
clientModifySupport.processClientModify( clientModifySupport.processClientModify(
new MerchantIdAuditModify(manager, clientMoniker, subMerchantId, availableMerchant == null ? null : availableMerchant.getMerchantId())); new MerchantIdModify(manager, clientMoniker, subMerchantId, availableMerchant == null ? null : availableMerchant.getMerchantId()));
List<JSONObject> children = clientMapper.listChildClients(clientId); List<JSONObject> children = clientMapper.listChildClients(clientId);
for (JSONObject child : children) { for (JSONObject child : children) {
if (Objects.equals(child.getString("sub_merchant_id"), originSubMerchantId)) { if (Objects.equals(child.getString("sub_merchant_id"), originSubMerchantId)) {
update.put("client_id", child.getIntValue("client_id")); update.put("client_id", child.getIntValue("client_id"));
clientModifySupport.processClientModify( clientModifySupport.processClientModify(
new MerchantIdAuditModify(manager, clientMoniker, subMerchantId, availableMerchant == null ? null : availableMerchant.getMerchantId())); new MerchantIdModify(manager, clientMoniker, subMerchantId, availableMerchant == null ? null : availableMerchant.getMerchantId()));
} }
} }
} }
@ -653,7 +659,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client.getString("sub_merchant_id") == null || client.getString("sub_merchant_id").equals("")) { if (client.getString("sub_merchant_id") == null || client.getString("sub_merchant_id").equals("")) {
throw new BadRequestException("该商户未设置微信 Sub Merchant ID!"); throw new BadRequestException("该商户未设置微信 Sub Merchant ID!");
} }
clientModifySupport.processClientModify(new GreenChannelAuditModify(manager, clientMoniker, manager.getString("manager_id"))); clientModifySupport.processClientModify(new GreenChannelModify(manager, clientMoniker, manager.getString("manager_id")));
saveClientAuditProcess(client.getIntValue("client_id"), 10, 1, "绿色通道申请通过", manager); saveClientAuditProcess(client.getIntValue("client_id"), 10, 1, "绿色通道申请通过", manager);
sendCommissionWechatMessage(client); sendCommissionWechatMessage(client);
initAdminUserAndSendEmail(manager, clientMoniker, client); initAdminUserAndSendEmail(manager, clientMoniker, client);
@ -837,7 +843,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
private void updateClientApproveEmailStatus(int status, JSONObject account, String client_moniker) { private void updateClientApproveEmailStatus(int status, JSONObject account, String client_moniker) {
clientModifySupport.processClientModify(new ApproveEmailAuditModify(account, client_moniker, status)); clientModifySupport.processClientModify(new ApproveEmailModify(account, client_moniker, status));
} }
@Override @Override
@ -878,7 +884,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
clientModifySupport.processClientConfigModify(new SwitchPermissionAuditModify(manager,clientMoniker,permissionKey,allow)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, permissionKey, allow));
} }
@Override @Override
@ -889,7 +895,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) { if (client == null) {
throw new NotFoundException("Client Not Exists"); throw new NotFoundException("Client Not Exists");
} }
clientModifySupport.processClientConfigModify(new SwitchPermissionAuditModify(manager,clientMoniker,"enable_" + channel.toLowerCase(),allow)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel "
+ channel + " to " + allow); + channel + " to " + allow);
return; return;
@ -1062,7 +1068,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Assert.notNull(partner); Assert.notNull(partner);
partner.put("enable_pay_notice", enable); partner.put("enable_pay_notice", enable);
clientMapper.update(partner); clientMapper.update(partner);
clientModifySupport.processClientConfigModify(new SwitchPermissionAuditModify(account,clientMoniker,"enable_pay_notice", enable)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "enable_pay_notice", enable));
clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id"));
} }
@ -1201,12 +1207,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
logger.info(manager.getString("username") + " changed settle hour to " + hour); clientModifySupport.processClientModify(new SettleHourModify(manager, clientMoniker, hour));
JSONObject update = new JSONObject();
update.put("client_id", client.getIntValue("client_id"));
update.put("settle_hour", hour);
clientMapper.update(update);
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
@Override @Override
@ -1308,7 +1309,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat"); JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat");
int cleanDays = changeRate.getIntValue("clean_days"); int cleanDays = changeRate.getIntValue("clean_days");
if (cleanDays != client.getIntValue("clean_days")) { if (cleanDays != client.getIntValue("clean_days")) {
clientMapper.updateCleanDays(clientId, cleanDays); clientModifySupport.processClientConfigModify(new ClearDaysModify(manager, clientMoniker, cleanDays));
} }
// clientMapper.updateCleanDays(clientId, config.getCleanDays()); // clientMapper.updateCleanDays(clientId, config.getCleanDays());
} }
@ -1494,17 +1495,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
bd_id = bd_id + user.getString("manager_id") + ","; bd_id = bd_id + user.getString("manager_id") + ",";
bd_name = bd_name + user.getString("display_name") + ","; bd_name = bd_name + user.getString("display_name") + ",";
} }
JSONObject clientUpdate = new JSONObject(); BDUserModify bdUserModify = new BDUserModify(managerMapper.findById(manager_id), client.getString("client_moniker"),
clientUpdate.put("client_id", client.getIntValue("client_id")); bd_id.substring(0, bd_id.length() - 1), bd_name.substring(0, bd_name.length() - 1));
clientUpdate.put("bd_user", bd_id.substring(0, bd_id.length() - 1));
clientUpdate.put("bd_user_name", bd_name.substring(0, bd_name.length() - 1));
if (users.size() > 0) { if (users.size() > 0) {
String bd_manager_id = users.get(0).getString("manager_id"); String bd_manager_id = users.get(0).getString("manager_id");
JSONObject manager = managerMapper.findById(bd_manager_id); JSONObject manager = managerMapper.findById(bd_manager_id);
clientUpdate.put("org_id", manager.getIntValue("org_id")); bdUserModify.setOrg_id(manager.getIntValue("org_id"));
} }
clientModifySupport.processClientModify(bdUserModify);
clientMapper.update(clientUpdate);
} }
@ -1668,17 +1666,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void updateTimeZone(String clientMoniker, String timezone) { public void updateTimeZone(JSONObject account,String clientMoniker, String timezone) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
JSONObject partner = new JSONObject(); clientModifySupport.processClientModify(new TimeZoneModify(account,clientMoniker,timezone));
int clientId = client.getIntValue("client_id");
partner.put("client_id", clientId);
partner.put("timezone", timezone);
clientMapper.update(partner);
clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
@ -1771,37 +1764,32 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void setMaxOrderAmount(String clientMoniker, BigDecimal limit) { public void setMaxOrderAmount(JSONObject account,String clientMoniker, BigDecimal limit) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
JSONObject update = new JSONObject(); clientModifySupport.processClientConfigModify(new MaxOrderAmountModify(account,clientMoniker,limit));
update.put("client_id", client.getIntValue("client_id"));
update.put("max_order_amount", limit == null ? null : limit.toPlainString());
clientMapper.update(update);
} }
@Override @Override
public void setCustomerSurchargeRate(String clientMoniker, BigDecimal customer_surcharge_rate) { public void setCustomerSurchargeRate(JSONObject account,String clientMoniker, BigDecimal customer_surcharge_rate) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
JSONObject update = new JSONObject();
update.put("client_id", client.getIntValue("client_id"));
if (customer_surcharge_rate == null) { if (customer_surcharge_rate == null) {
update.put("customer_surcharge_rate", null); clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account,clientMoniker,null));
} else { } else {
BigDecimal rate_value = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value"); BigDecimal rate_value = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value");
if (customer_surcharge_rate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0 if (customer_surcharge_rate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0
|| customer_surcharge_rate.compareTo(rate_value) < 0) { || customer_surcharge_rate.compareTo(rate_value) < 0) {
throw new ForbiddenException("Invalid Range"); throw new ForbiddenException("Invalid Range");
} }
update.put("customer_surcharge_rate", customer_surcharge_rate); clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account,clientMoniker,customer_surcharge_rate));
} }
clientConfigService.update(update);
} }
@Override @Override
@ -2810,7 +2798,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void updateAppClient(int client_id, AppClientBean appClientBean) { public void updateAppClient(JSONObject account,int client_id, AppClientBean appClientBean) {
JSONObject client = getClientInfo(client_id); JSONObject client = getClientInfo(client_id);
Assert.notNull(client); Assert.notNull(client);
JSONObject updateObj = appClientBean.updateObject(); JSONObject updateObj = appClientBean.updateObject();
@ -2823,13 +2811,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new ForbiddenException("customerSurchargeRate is 0"); throw new ForbiddenException("customerSurchargeRate is 0");
} }
BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN); BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
setCustomerSurchargeRate(client.getString("client_moniker"), customerSurchargeRate); setCustomerSurchargeRate(account,client.getString("client_moniker"), customerSurchargeRate);
} }
clientInfoCacheSupport.clearClientCache(client_id);
} }
@Override @Override
public void setSkipClearing(String clientMoniker, Boolean skip_clearing) { public void setSkipClearing(JSONObject account,String clientMoniker, Boolean skip_clearing) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
@ -2838,6 +2825,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
int clientId = client.getIntValue("client_id"); int clientId = client.getIntValue("client_id");
update.put("client_id", clientId); update.put("client_id", clientId);
update.put("skip_clearing", skip_clearing); update.put("skip_clearing", skip_clearing);
clientModifySupport.processClientConfigModify(new SwitchPermissionModify());
clientMapper.update(update); clientMapper.update(update);
clientInfoCacheSupport.clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }

@ -7,10 +7,10 @@ import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class ApproveEmailAuditModify extends ClientModify { public class ApproveEmailModify extends ClientModify {
private int approve_email_send; private int approve_email_send;
public ApproveEmailAuditModify(JSONObject account, String clientMoniker, int approve_email_send) { public ApproveEmailModify(JSONObject account, String clientMoniker, int approve_email_send) {
super(account, clientMoniker); super(account, clientMoniker);
this.approve_email_send = approve_email_send; this.approve_email_send = approve_email_send;

@ -0,0 +1,44 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
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 BDUserModify extends ClientModify {
private String bd_user;
private String bd_user_name;
private int org_id;
public BDUserModify(JSONObject account, String clientMoniker, String bd_user, String bd_user_name) {
super(account, clientMoniker);
this.bd_user = bd_user;
this.bd_user_name = bd_user_name;
}
public int getOrg_id() {
return org_id;
}
public void setOrg_id(int org_id) {
this.org_id = org_id;
}
@Override
protected String business() {
return "修改商户BD为"+bd_user_name+""+bd_user+"";
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("bd_user", bd_user);
modify.put("bd_user_name", bd_user_name);
if(org_id!=0){
modify.put("org_id",org_id);
}
return modify;
}
}

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

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

@ -9,10 +9,10 @@ import java.util.Date;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class GreenChannelAuditModify extends ClientModify { public class GreenChannelModify extends ClientModify {
private String manager_id; private String manager_id;
public GreenChannelAuditModify(JSONObject account, String clientMoniker, String manager_id) { public GreenChannelModify(JSONObject account, String clientMoniker, String manager_id) {
super(account, clientMoniker); super(account, clientMoniker);
this.manager_id = manager_id; this.manager_id = manager_id;

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

@ -7,11 +7,11 @@ import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class MerchantIdAuditModify extends ClientModify { public class MerchantIdModify extends ClientModify {
private String sub_merchant_id; private String sub_merchant_id;
private String merchant_id; private String merchant_id;
public MerchantIdAuditModify(JSONObject account, String clientMoniker, String sub_merchant_id, String merchant_id) { public MerchantIdModify(JSONObject account, String clientMoniker, String sub_merchant_id, String merchant_id) {
super(account, clientMoniker); super(account, clientMoniker);
this.sub_merchant_id = sub_merchant_id; this.sub_merchant_id = sub_merchant_id;
this.merchant_id = merchant_id; this.merchant_id = merchant_id;

@ -0,0 +1,30 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
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 ClientModify {
private int settle_hour;
public SettleHourModify(JSONObject account, String clientMoniker, int settle_hour) {
super(account, clientMoniker);
this.settle_hour = settle_hour;
}
@Override
protected String business() {
return "修改商户清算截止时间为:"+settle_hour;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("settle_hour", settle_hour);
return modify;
}
}

@ -7,11 +7,11 @@ import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class SwitchPermissionAuditModify extends ClientConfigModify { public class SwitchPermissionModify extends ClientConfigModify {
private String key; private String key;
private boolean value; private boolean value;
public SwitchPermissionAuditModify(JSONObject account, String clientMoniker, String key, boolean value) { public SwitchPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) {
super(account, clientMoniker); super(account, clientMoniker);
this.key = key; this.key = key;
this.value = value; this.value = value;

@ -0,0 +1,29 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
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 TimeZoneModify extends ClientModify {
private String timezone;
public TimeZoneModify(JSONObject account, String clientMoniker, String timezone) {
super(account, clientMoniker);
this.timezone = timezone;
}
@Override
protected String business() {
return "修改商户时区为:"+timezone;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("timezone", timezone);
return modify;
}
}

@ -10,13 +10,10 @@ import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply; import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequireManager; import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
@ -133,13 +130,13 @@ public class PartnerManageController {
} }
@ManagerMapping(value = "/{clientMoniker}/max_order_amount", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/max_order_amount", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void setMaxOrderAmount(@PathVariable String clientMoniker, @RequestBody JSONObject limit) { public void setMaxOrderAmount(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject limit) {
clientManager.setMaxOrderAmount(clientMoniker, limit.getBigDecimal("limit")); clientManager.setMaxOrderAmount(manager,clientMoniker, limit.getBigDecimal("limit"));
} }
@ManagerMapping(value = "/{clientMoniker}/customer_surcharge_rate", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/customer_surcharge_rate", method = RequestMethod.PUT, role = {ManagerRole.ADMIN})
public void setCustomerSurchargeRate(@PathVariable String clientMoniker, @RequestBody JSONObject config) { public void setCustomerSurchargeRate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setCustomerSurchargeRate(clientMoniker, config.getBigDecimal("customer_surcharge_rate")); clientManager.setCustomerSurchargeRate(manager,clientMoniker, config.getBigDecimal("customer_surcharge_rate"));
} }
@ManagerMapping(value = "/{clientMoniker}/order_expiry_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/order_expiry_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN})
@ -326,8 +323,8 @@ public class PartnerManageController {
} }
@ManagerMapping(value = "/{clientMoniker}/skip_clearing", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) @ManagerMapping(value = "/{clientMoniker}/skip_clearing", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF})
public void skipClearing(@PathVariable String clientMoniker, @RequestBody JSONObject skip_clearing) { public void skipClearing(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject skip_clearing) {
clientManager.setSkipClearing(clientMoniker, skip_clearing.getBooleanValue("skip_clearing")); clientManager.setSkipClearing(manager,clientMoniker, skip_clearing.getBooleanValue("skip_clearing"));
} }
@ManagerMapping(value = "/{clientMoniker}/settle_hour", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.FINANCIAL_STAFF}) @ManagerMapping(value = "/{clientMoniker}/settle_hour", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.FINANCIAL_STAFF})

@ -277,7 +277,7 @@ public class PartnerViewController {
if (!timezone.matches("^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$")) { if (!timezone.matches("^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$")) {
throw new ParamInvalidException("timezone", "error.payment.valid.invalid_timezone"); throw new ParamInvalidException("timezone", "error.payment.valid.invalid_timezone");
} }
clientManager.updateTimeZone(account.getString("client_moniker"), timezone); clientManager.updateTimeZone(account,account.getString("client_moniker"), timezone);
} }
@PartnerMapping(value = "/sub_partners", method = RequestMethod.GET) @PartnerMapping(value = "/sub_partners", method = RequestMethod.GET)
@ -352,7 +352,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/customer_surcharge_rate", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) @PartnerMapping(value = "/customer_surcharge_rate", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody @ResponseBody
public void setCustomerSurchargeRate(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { public void setCustomerSurchargeRate(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.setCustomerSurchargeRate(account.getString("client_moniker"), pass.getBigDecimal("customer_surcharge_rate")); clientManager.setCustomerSurchargeRate(account,account.getString("client_moniker"), pass.getBigDecimal("customer_surcharge_rate"));
} }
@PartnerMapping(value = "/trade_logs/full_release_preauth", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @PartnerMapping(value = "/trade_logs/full_release_preauth", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})

Loading…
Cancel
Save