add app费率信息、文件

master
luoyang 6 years ago
parent 691097fd17
commit e4427468a9

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.appclient.core;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
@ -9,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface ManageAppService {
@ -36,6 +38,22 @@ public interface ManageAppService {
void saveBankAccount(JSONObject device, String clientMoniker, BankAccountInfo bankAccount);
void newConfigRate(JSONObject device, String clientMoniker, JSONObject config);
void commitToGreenChannel(JSONObject device, String clientMoniker);
void commitToDoAgreeFile(JSONObject device, String clientMoniker);
void commitToCompliance(JSONObject device, String clientMoniker);
JSONObject getAuthFiles(JSONObject device, String clientMoniker);
void uploadAuthFiles(JSONObject device, String clientMoniker, ClientAuthFilesInfo filesInfo);
Map<String, List<JSONObject>> getRates(JSONObject device, String clientMoniker);
JSONObject getConfigRates(JSONObject device);
JSONObject getNewVersion(JSONObject device);
JSONObject getCommons(JSONObject device);

@ -12,6 +12,7 @@ import au.com.royalpay.payment.manage.mappers.system.ManageDeviceTokenMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
@ -32,9 +33,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class ManageAppServiceImp implements ManageAppService {
@ -170,6 +170,68 @@ public class ManageAppServiceImp implements ManageAppService {
clientManager.saveBankAccount(manager, clientMoniker, bankAccount);
}
@Override
public Map<String, List<JSONObject>> getRates(JSONObject device, String clientMoniker) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
List<JSONObject> rates = clientManager.clientRates(clientMoniker, true);
return rates.stream().collect(Collectors.groupingBy(e -> e.getString("rate_name"),HashMap::new,Collectors.toList()));
}
@Override
public JSONObject getConfigRates(JSONObject device) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
return clientManager.getSysRateConfig();
}
@Override
public void newConfigRate(JSONObject device, String clientMoniker, JSONObject config) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
clientManager.newConfigRate(manager, clientMoniker, config);
}
@Override
public void commitToGreenChannel(JSONObject device, String clientMoniker) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
clientManager.commitToGreenChannel(clientMoniker, manager);
}
@Override
public void commitToDoAgreeFile(JSONObject device, String clientMoniker) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
clientManager.commitToDoAgreeFile(clientMoniker, manager);
}
@Override
public void commitToCompliance(JSONObject device, String clientMoniker) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
clientManager.commitToCompliance(clientMoniker, manager);
}
@Override
public JSONObject getAuthFiles(JSONObject device, String clientMoniker) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
return clientManager.getAuthFiles(manager, clientMoniker);
}
@Override
public void uploadAuthFiles(JSONObject device, String clientMoniker, ClientAuthFilesInfo filesInfo) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
clientManager.uploadAuthFiles(manager, clientMoniker,filesInfo);
}
@Override
public void updateDevTokenStatus(String devId, int status) {

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.appclient.web;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.appclient.core.ManageAppService;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
@ -26,6 +27,7 @@ import javax.validation.Valid;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;
@AppClientController
@ -100,6 +102,48 @@ public class ManageAppController {
manageAppService.saveBankAccount(device, clientMoniker, bankAccount);
}
@RequestMapping(value = "/merchant/{clientMoniker}/rates", method = RequestMethod.GET)
public Map<String,List<JSONObject>> getRates(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.getRates(device, clientMoniker);
}
@RequestMapping(value = "/merchant/rate_config", method = RequestMethod.GET)
public JSONObject getConfigRates(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.getConfigRates(device);
}
@RequestMapping(value = "/merchant/{clientMoniker}/rates", method = RequestMethod.POST)
public void newRate(@PathVariable String clientMoniker, @RequestBody JSONObject config, Errors errors,
@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
HttpUtils.handleValidErrors(errors);
manageAppService.newConfigRate(device, clientMoniker, config);
}
@RequestMapping(value = "/merchant/{clientMoniker}/compliance/green_channel", method = RequestMethod.PUT)
public void commitToGreenChannel(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
manageAppService.commitToGreenChannel(device, clientMoniker);
}
@RequestMapping(value = "/merchant/{clientMoniker}/make_agree_file", method = RequestMethod.PUT)
public void commitToDoAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
manageAppService.commitToDoAgreeFile(device, clientMoniker);
}
@RequestMapping(value = "/merchant/{clientMoniker}/to_compliance", method = RequestMethod.PUT)
public void commitToCompliance(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
manageAppService.commitToCompliance(device, clientMoniker);
}
@RequestMapping(value = "/merchant/{clientMoniker}/file", method = RequestMethod.GET)
public JSONObject getAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.getAuthFiles(device, clientMoniker);
}
@RequestMapping(value = "/merchant/{clientMoniker}/file", method = RequestMethod.PUT)
public void uploadAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientAuthFilesInfo filesInfo, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
manageAppService.uploadAuthFiles(device, clientMoniker, filesInfo);
}
@RequestMapping(value = "/version", method = RequestMethod.GET)
public JSONObject getAppVersion(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.getNewVersion(device);

Loading…
Cancel
Save