商户管理增加bd分组筛选

master
yuan 7 years ago
parent f40a9b5721
commit 9b9a477f78

@ -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.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; 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.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper; import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.mappers.system.*;
@ -164,6 +165,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private SpringTemplateEngine thymeleaf; private SpringTemplateEngine thymeleaf;
@Resource
private FinancialBDConfigMapper financialBDConfigMapper;
private static final String SOURCE_AGREE_FILE = "source_agree_file"; 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_BANK_FILE = "client_bank_file";
private static final String CLIENT_ID_FILE = "client_id_file"; private static final String CLIENT_ID_FILE = "client_id_file";
@ -309,12 +313,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override @Override
public JSONObject listClients(JSONObject manager, PartnerQuery query) { public JSONObject listClients(JSONObject manager, PartnerQuery query) {
JSONObject params = query.toJsonParam(); 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_id") != null){
if(params.getString("org_ids") == null){ if(params.getString("org_ids") == null){
orgIds(params,Integer.parseInt(params.getString("org_id"))); orgIds(params,Integer.parseInt(params.getString("org_id")));
@ -346,6 +344,29 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
params.remove("org_ids"); 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 tempSubMchId = sysConfigManager.getSysConfig().getString("temp_sub_mch_id");
String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source"); String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source");
tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource; tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource;

@ -69,6 +69,13 @@
</if> </if>
</if> </if>
<where> <where>
<if test="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config fb ON fb.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
<if test="client_moniker !=null">c.client_moniker=#{client_moniker}</if> <if test="client_moniker !=null">c.client_moniker=#{client_moniker}</if>
<if test="sub_merchant_id!=null">and c.sub_merchant_id=#{sub_merchant_id}</if> <if test="sub_merchant_id!=null">and c.sub_merchant_id=#{sub_merchant_id}</if>
<if test="business_structure!=null"> <if test="business_structure!=null">

Loading…
Cancel
Save