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