|
|
|
@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.management.clearing.core.impl;
|
|
|
|
|
import au.com.royalpay.payment.manage.management.clearing.beans.PriorityModifyLog;
|
|
|
|
|
import au.com.royalpay.payment.manage.management.clearing.core.PriorityListManager;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.SysSettlePlanMapper;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
|
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.id.IdUtil;
|
|
|
|
@ -47,8 +48,8 @@ public class PriorityListManagerImpl implements PriorityListManager {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setMerchantPriority(String clientMoniker, JSONObject manager) {
|
|
|
|
|
JSONObject client = mchInfoProvider.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
public JSONObject setMerchantPriority(String clientMoniker, JSONObject manager) {
|
|
|
|
|
JSONObject client = MonikerStringUtils.getSimplifiedClientsInfo(mchInfoProvider, clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("Client " + clientMoniker + " not found");
|
|
|
|
|
}
|
|
|
|
@ -57,7 +58,7 @@ public class PriorityListManagerImpl implements PriorityListManager {
|
|
|
|
|
List<String> monikerList = MonikerStringUtils.splitStringArray(clientMonikers).collect(Collectors.toList());
|
|
|
|
|
if (monikerList.stream().anyMatch(moniker -> moniker.equalsIgnoreCase(clientMoniker))) {
|
|
|
|
|
logger.debug("{} exists,ignore", clientMoniker);
|
|
|
|
|
return;
|
|
|
|
|
throw new BadRequestException("Client exists");
|
|
|
|
|
}
|
|
|
|
|
monikerList.add(clientMoniker.toUpperCase());
|
|
|
|
|
String joinedMonikers = String.join(",", monikerList);
|
|
|
|
@ -74,6 +75,7 @@ public class PriorityListManagerImpl implements PriorityListManager {
|
|
|
|
|
mongoTemplate.insert(log);
|
|
|
|
|
} catch (Exception ignore) {
|
|
|
|
|
}
|
|
|
|
|
return client;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|