fix : develop_client_permission

master
luoyang14z7 6 years ago
parent 93ae3a7275
commit 8f7d5f42c5

@ -20,6 +20,7 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -111,6 +112,19 @@ public class PermissionPartnerManagerImpl implements PermissionPartnerManager {
return report;
}
public void permissionClientModuleSave(int clientId,String clientMoniker) {
List<JSONObject> moduleId = permissionPartnerModuleMapper.list();
for (JSONObject moduleClientAdd : moduleId) {
moduleClientAdd.put("client_id", clientId);
moduleClientAdd.put("client_moniker", clientMoniker);
moduleClientAdd.put("module_id", moduleClientAdd.getString("id"));
moduleClientAdd.put("is_valid", 1);
permissionClientModuleMapper.save(moduleClientAdd);
}
}
@Override
public List<JSONObject> listModules() {
return permissionPartnerModuleMapper.list();

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
@ -65,6 +66,8 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
private ApplicationEventPublisher publisher;
@Resource
private ClientConfigService clientConfigService;
@Resource
private PermissionPartnerManagerImpl permissionPartnerManagerImpl;
@Override
@Transactional
@ -220,6 +223,8 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
clientConfig.put("client_id",partner.getIntValue("client_id"));
clientConfig.put("client_moniker",info.getClientMoniker());
clientConfigService.save(clientConfig);
permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"),info.getClientMoniker());
JSONObject client_bd = new JSONObject();
client_bd.put("client_id", partner.getIntValue("client_id"));

@ -13,6 +13,7 @@ import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.*;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
@ -268,6 +269,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private PermissionPartnerModuleMapper permissionPartnerModuleMapper;
@Resource
private PermissionClientModuleMapper permissionClientModuleMapper;
@Resource
private PermissionPartnerManagerImpl permissionPartnerManagerImpl;
@ -567,19 +570,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientConfig.put("client_id", partner.getIntValue("client_id"));
clientConfig.put("client_moniker", partner.getString("client_moniker"));
clientConfigService.save(clientConfig);
List<JSONObject> moduleId = permissionPartnerModuleMapper.list();
for (JSONObject moduleClientAdd : moduleId) {
moduleClientAdd.put("client_id", partner.getIntValue("client_id"));
moduleClientAdd.put("client_moniker", partner.getString("client_moniker"));
moduleClientAdd.put("module_id", moduleClientAdd.getString("id"));
moduleClientAdd.put("is_valid", 1);
permissionClientModuleMapper.save(moduleClientAdd);
}
permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"),partner.getString("client_moniker"));
} catch (Exception e) {
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
}

Loading…
Cancel
Save