|
|
|
@ -11,6 +11,7 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
|
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
|
|
|
|
|
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.*;
|
|
|
|
@ -164,6 +165,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
@Resource
|
|
|
|
|
private SpringTemplateEngine thymeleaf;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private FinancialBDConfigMapper financialBDConfigMapper;
|
|
|
|
|
|
|
|
|
|
private static final String SOURCE_AGREE_FILE = "source_agree_file";
|
|
|
|
|
private static final String CLIENT_BANK_FILE = "client_bank_file";
|
|
|
|
|
private static final String CLIENT_ID_FILE = "client_id_file";
|
|
|
|
@ -309,12 +313,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject listClients(JSONObject manager, PartnerQuery query) {
|
|
|
|
|
JSONObject params = query.toJsonParam();
|
|
|
|
|
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
|
|
|
|
|
if (query.getOnlyMe()) {
|
|
|
|
|
params.put("bd_user", manager.getString("manager_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(params.getString("org_id") != null){
|
|
|
|
|
if(params.getString("org_ids") == null){
|
|
|
|
|
orgIds(params,Integer.parseInt(params.getString("org_id")));
|
|
|
|
@ -346,6 +344,29 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
params.remove("org_ids");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
|
|
|
|
|
JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id"));
|
|
|
|
|
if (bdConfig != null) {
|
|
|
|
|
params.put("bd_group", bdConfig.getString("bd_group"));
|
|
|
|
|
List<JSONObject> listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group"));
|
|
|
|
|
List<Integer> bdUserId = listGroupBds.stream().map(groupBd->groupBd.getIntValue("manager_id")).collect(Collectors.toList());
|
|
|
|
|
if(params.containsKey("bd_user")){
|
|
|
|
|
if(!bdUserId.contains(params.getIntValue("bd_user"))){
|
|
|
|
|
params.remove("bd_user");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(params.containsKey("org_ids")){
|
|
|
|
|
params.remove("org_ids");
|
|
|
|
|
}
|
|
|
|
|
if(params.containsKey("org_id")){
|
|
|
|
|
params.remove("org_id");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (query.getOnlyMe()) {
|
|
|
|
|
params.put("bd_user", manager.getString("manager_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String tempSubMchId = sysConfigManager.getSysConfig().getString("temp_sub_mch_id");
|
|
|
|
|
String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source");
|
|
|
|
|
tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource;
|
|
|
|
|