Commit f72ffc24 by zhouhb

[+]权限修改

1 parent 61055a20
...@@ -7,8 +7,7 @@ import cn.com.glsx.merchants.request.user.MerchantUser; ...@@ -7,8 +7,7 @@ import cn.com.glsx.merchants.request.user.MerchantUser;
import cn.com.glsx.merchants.service.MerchantLogService; import cn.com.glsx.merchants.service.MerchantLogService;
import cn.com.glsx.merchants.service.MerchantUserService; import cn.com.glsx.merchants.service.MerchantUserService;
import com.glsx.plat.common.annotation.SysLog; import com.glsx.plat.common.annotation.SysLog;
import com.google.gson.Gson; import com.google.gson.*;
import com.google.gson.GsonBuilder;
import com.rop.AbstractRopRequest; import com.rop.AbstractRopRequest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DurationFormatUtils; import org.apache.commons.lang.time.DurationFormatUtils;
...@@ -33,10 +32,6 @@ import java.lang.reflect.Method; ...@@ -33,10 +32,6 @@ import java.lang.reflect.Method;
@Component @Component
public class SysLogAspect { public class SysLogAspect {
final static GsonBuilder builder = new GsonBuilder();
final static Gson gson = builder.create();
@Autowired @Autowired
private MerchantLogService merchantLogService; private MerchantLogService merchantLogService;
...@@ -119,7 +114,6 @@ public class SysLogAspect { ...@@ -119,7 +114,6 @@ public class SysLogAspect {
Object[] args = joinPoint.getArgs(); Object[] args = joinPoint.getArgs();
AbstractRopRequest accessToken = (AbstractRopRequest) args[0]; AbstractRopRequest accessToken = (AbstractRopRequest) args[0];
String ip = accessToken.getRopRequestContext().getIp(); String ip = accessToken.getRopRequestContext().getIp();
System.out.println(args);
// 插入日志 // 插入日志
LogRequest logRequest = new LogRequest(); LogRequest logRequest = new LogRequest();
logRequest.setModule(sysLogMark.module()); logRequest.setModule(sysLogMark.module());
...@@ -129,9 +123,10 @@ public class SysLogAspect { ...@@ -129,9 +123,10 @@ public class SysLogAspect {
logRequest.setOperator(user.getUsername()); logRequest.setOperator(user.getUsername());
logRequest.setIp(ip); logRequest.setIp(ip);
logRequest.setResult("成功"); logRequest.setResult("成功");
logRequest.setProcessed(args[0].toString());
MerchantLogResponse merchantLogResponse = merchantLogService.saveMerchantLog(logRequest); MerchantLogResponse merchantLogResponse = merchantLogService.saveMerchantLog(logRequest);
if(merchantLogResponse!=null){ if (merchantLogResponse != null) {
MDC.put(Contants.MDC_LOG_DB_ID, merchantLogResponse.getId()+""); MDC.put(Contants.MDC_LOG_DB_ID, merchantLogResponse.getId() + "");
} }
} }
......
...@@ -165,6 +165,24 @@ public class MerchantController { ...@@ -165,6 +165,24 @@ public class MerchantController {
} }
/** /**
* 查询商户的菜单权限树
*
* @param merchantDetailRequest 入参
* @return
*/
@ServiceMethod(method = "cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId", needInSession = NeedInSessionType.NO)
@ApiOperation("查询商户的菜单权限树")
public RopResponse<List<AccountTypeTreeRopResponse>> findMenuFunTreeByMerId(MerchantDetailRequest merchantDetailRequest) {
try {
List<AccountTypeTreeRopResponse> merchantResponse = merchantService.findMenuFunTreeByMerId(merchantDetailRequest);
return RopResponse.success(merchantResponse);
} catch (RpcServiceException e) {
log.info("=======MerchantController__invoke__findMenuFunTreeByMerId__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 更新商户的有效期 * 更新商户的有效期
* *
* @param merchantUpdateValRequest 入参 * @param merchantUpdateValRequest 入参
......
package cn.com.glsx.merchants.response; package cn.com.glsx.merchants.response;
import cn.com.glsx.merchants.model.response.ProductTreeResponse;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -20,4 +19,9 @@ public class AccountTypeTreeRopResponse { ...@@ -20,4 +19,9 @@ public class AccountTypeTreeRopResponse {
@ApiModelProperty(name = "products", notes = "产品", dataType = "List", required = true, example = "1",value = "产品") @ApiModelProperty(name = "products", notes = "产品", dataType = "List", required = true, example = "1",value = "产品")
private List<ProductTreeRopResponse> products; private List<ProductTreeRopResponse> products;
@ApiModelProperty(name = "accountTypeName", notes = "账户类型", dataType = "Integer", required = true, example = "1",value = "账户类型id")
private String accountTypeName;
private List<MerchantProTreeRopResponse> merchantProTreeResponses;
} }
...@@ -16,5 +16,5 @@ public class CarbrandResponse { ...@@ -16,5 +16,5 @@ public class CarbrandResponse {
private Integer id; private Integer id;
private String label; private String label;
private List<CarbrandResponse> childrens; private List<CarbrandResponse> children;
} }
...@@ -34,7 +34,7 @@ public class MerchantCommonService { ...@@ -34,7 +34,7 @@ public class MerchantCommonService {
carbrandResponse1.setLabel(in.getBrand()); carbrandResponse1.setLabel(in.getBrand());
return carbrandResponse1; return carbrandResponse1;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
carbrandResponse.setChildrens(childrens); carbrandResponse.setChildren(childrens);
return carbrandResponse; return carbrandResponse;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return collect; return collect;
......
...@@ -147,6 +147,20 @@ public class MerchantService { ...@@ -147,6 +147,20 @@ public class MerchantService {
} }
/** /**
* 查询商户的菜单权限树
*
* @param merchantDetailRequest 入参
* @return
*/
public List<AccountTypeTreeRopResponse> findMenuFunTreeByMerId(MerchantDetailRequest merchantDetailRequest) {
RpcResponse<List<AccountTypeTreeResponse>> merchantDetailRemote = merchantRemote.findMenuFunTreeByMerId(merchantDetailRequest.getId());
if (merchantDetailRemote.isSuccess()) {
return ConvertResponse.convertList(merchantDetailRemote.getResult(), AccountTypeTreeRopResponse.class);
}
throw new RpcServiceException(merchantDetailRemote.getException().getErrId(), merchantDetailRemote.getMessage());
}
/**
* 更新商户的有效期 * 更新商户的有效期
* *
* @param merchantUpdateValRequest 入参 * @param merchantUpdateValRequest 入参
......
...@@ -5,9 +5,11 @@ import cn.com.glsx.merchants.request.user.MerchantUser; ...@@ -5,9 +5,11 @@ import cn.com.glsx.merchants.request.user.MerchantUser;
import com.rop.AbstractRopRequest; import com.rop.AbstractRopRequest;
import com.rop.session.SimpleSession; import com.rop.session.SimpleSession;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.rop.session.RopSessionManager;
import org.oreframework.boot.autoconfigure.rop.util.RopThreadLocal; import org.oreframework.boot.autoconfigure.rop.util.RopThreadLocal;
import org.oreframework.boot.security.cas.User; import org.oreframework.boot.security.cas.User;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
...@@ -18,16 +18,16 @@ public class StaffControllerTest extends BaseControllerTest{ ...@@ -18,16 +18,16 @@ public class StaffControllerTest extends BaseControllerTest{
public void testGetExample() throws Exception { public void testGetExample() throws Exception {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4); MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
params.add("v", "1.0.0"); params.add("v", "1.0.0");
params.add("method", "cn.com.glsx.merchants.merchant.saveStaff"); params.add("method", "cn.com.glsx.merchants.staff.saveStaff");
params.add("name", "alvin"); params.add("name", "alvin");
params.add("staffName","反抗军地方"); params.add("staffName","贤心");
params.add("staffJob","反抗军地方"); params.add("staffJob","jkl");
params.add("password","反抗军地方"); params.add("password","3");
params.add("visibleInferiorMer","反抗军地方"); params.add("visibleInferiorMer","1");
params.add("staffPhone","13476565332E"); params.add("staffPhone","18873336682");
params.add("merchantId","31"); params.add("merchantId","31");
params.add("staffEmail","31545445@"); params.add("staffEmail","952643348@qq.com");
params.add("roleIds[0]","1"); params.add("roleIds[0]","342");
params.add("merchantFileRequest.fileUrl","http://jhjhjhhj"); params.add("merchantFileRequest.fileUrl","http://jhjhjhhj");
params.add("merchantFileRequest.fileName","dfdfddssd"); params.add("merchantFileRequest.fileName","dfdfddssd");
System.out.println(getByHeader(params)); System.out.println(getByHeader(params));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!