Commit f72ffc24 by zhouhb

[+]权限修改

1 parent 61055a20
......@@ -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.MerchantUserService;
import com.glsx.plat.common.annotation.SysLog;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.*;
import com.rop.AbstractRopRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DurationFormatUtils;
......@@ -33,10 +32,6 @@ import java.lang.reflect.Method;
@Component
public class SysLogAspect {
final static GsonBuilder builder = new GsonBuilder();
final static Gson gson = builder.create();
@Autowired
private MerchantLogService merchantLogService;
......@@ -119,7 +114,6 @@ public class SysLogAspect {
Object[] args = joinPoint.getArgs();
AbstractRopRequest accessToken = (AbstractRopRequest) args[0];
String ip = accessToken.getRopRequestContext().getIp();
System.out.println(args);
// 插入日志
LogRequest logRequest = new LogRequest();
logRequest.setModule(sysLogMark.module());
......@@ -129,9 +123,10 @@ public class SysLogAspect {
logRequest.setOperator(user.getUsername());
logRequest.setIp(ip);
logRequest.setResult("成功");
logRequest.setProcessed(args[0].toString());
MerchantLogResponse merchantLogResponse = merchantLogService.saveMerchantLog(logRequest);
if(merchantLogResponse!=null){
MDC.put(Contants.MDC_LOG_DB_ID, merchantLogResponse.getId()+"");
if (merchantLogResponse != null) {
MDC.put(Contants.MDC_LOG_DB_ID, merchantLogResponse.getId() + "");
}
}
......
......@@ -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 入参
......
package cn.com.glsx.merchants.response;
import cn.com.glsx.merchants.model.response.ProductTreeResponse;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -20,4 +19,9 @@ public class AccountTypeTreeRopResponse {
@ApiModelProperty(name = "products", notes = "产品", dataType = "List", required = true, example = "1",value = "产品")
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 {
private Integer id;
private String label;
private List<CarbrandResponse> childrens;
private List<CarbrandResponse> children;
}
......@@ -34,7 +34,7 @@ public class MerchantCommonService {
carbrandResponse1.setLabel(in.getBrand());
return carbrandResponse1;
}).collect(Collectors.toList());
carbrandResponse.setChildrens(childrens);
carbrandResponse.setChildren(childrens);
return carbrandResponse;
}).collect(Collectors.toList());
return collect;
......
......@@ -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 入参
......
......@@ -5,9 +5,11 @@ import cn.com.glsx.merchants.request.user.MerchantUser;
import com.rop.AbstractRopRequest;
import com.rop.session.SimpleSession;
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.security.cas.User;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
......
......@@ -18,16 +18,16 @@ public class StaffControllerTest extends BaseControllerTest{
public void testGetExample() throws Exception {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
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("staffName","反抗军地方");
params.add("staffJob","反抗军地方");
params.add("password","反抗军地方");
params.add("visibleInferiorMer","反抗军地方");
params.add("staffPhone","13476565332E");
params.add("staffName","贤心");
params.add("staffJob","jkl");
params.add("password","3");
params.add("visibleInferiorMer","1");
params.add("staffPhone","18873336682");
params.add("merchantId","31");
params.add("staffEmail","31545445@");
params.add("roleIds[0]","1");
params.add("staffEmail","952643348@qq.com");
params.add("roleIds[0]","342");
params.add("merchantFileRequest.fileUrl","http://jhjhjhhj");
params.add("merchantFileRequest.fileName","dfdfddssd");
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!