Commit 23f29706 by zhouhb

[+]新增权限功能

1 parent 6cbeeb2b
......@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.response.AccountTypeTreeRopResponse;
import cn.com.glsx.merchants.response.MerchantRopResponse;
......@@ -162,6 +163,24 @@ public class MerchantController {
}
/**
* 获取账户类型下产品菜单功能树
*
* @param accountTypeSearchRequest 入参
* @return
*/
@ServiceMethod(method = "cn.com.glsx.merchants.merchant.accountTypeSearchRequest", needInSession = NeedInSessionType.NO)
@ApiOperation("获取账户类型下产品菜单功能树")
public RopResponse<List<AccountTypeTreeRopResponse>> accountTypeSearchRequest(AccountTypeSearchRequest accountTypeSearchRequest) {
try {
List<AccountTypeTreeRopResponse> merchantResponse = merchantService.findMenuFunTreeByAccountType(accountTypeSearchRequest);
return RopResponse.success(merchantResponse);
} catch (RpcServiceException e) {
log.info("=======MerchantController__invoke__accountTypeSearchRequest__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询商户的菜单权限树
*
* @param merchantDetailRequest 入参
......
......@@ -6,10 +6,12 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.merchants.convert.ConvertRequest;
import cn.com.glsx.merchants.convert.ConvertResponse;
import cn.com.glsx.merchants.model.request.*;
import cn.com.glsx.merchants.model.response.AccountTreeResponse;
import cn.com.glsx.merchants.model.response.AccountTypeTreeResponse;
import cn.com.glsx.merchants.model.response.MerchantResponse;
import cn.com.glsx.merchants.model.response.MerchantTreeResponse;
import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.request.file.FileSaveRequest;
import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.response.*;
......@@ -21,6 +23,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -218,4 +221,18 @@ public class MerchantService {
}
throw new RpcServiceException(allMerchantRemote.getException().getErrId(), allMerchantRemote.getMessage());
}
public List<AccountTypeTreeRopResponse> findMenuFunTreeByAccountType(AccountTypeSearchRequest accountTypeSearchRequest) {
String[] split = accountTypeSearchRequest.getIds().split(",");
List<Integer> strings = new ArrayList<>();
for (String s : split) {
strings.add(Integer.parseInt(s));
}
RpcResponse<List<AccountTypeTreeResponse>> response =
merchantRemote.findMenuFunTreeByAccountType(strings, accountTypeSearchRequest.getAccountLevel(), accountTypeSearchRequest.getMerchantId());
if (response.isSuccess()) {
return ConvertResponse.convertList(response.getResult(), AccountTypeTreeRopResponse.class);
}
throw new RpcServiceException(response.getException().getErrId(),response.getMessage());
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!