Commit 6c8427bd authored by 季圣华's avatar 季圣华
Browse files

增加接口:查询当前用户的价格屏蔽

parent b5a2fab9
......@@ -2,11 +2,8 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Role;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
......
......@@ -13,6 +13,7 @@ import com.jsh.erp.datasource.vo.TreeNodeEx;
import com.jsh.erp.exception.BusinessParamCheckingException;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.service.tenant.TenantService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.*;
......@@ -51,6 +52,9 @@ public class UserController {
@Resource
private UserService userService;
@Resource
private RoleService roleService;
@Resource
private TenantService tenantService;
......@@ -382,6 +386,24 @@ public class UserController {
return arr;
}
@GetMapping(value = "/getCurrentPriceLimit")
@ApiOperation(value = "查询当前用户的价格屏蔽")
public BaseResponseInfo getCurrentPriceLimit(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<>();
String priceLimit = roleService.getCurrentPriceLimit(request);
data.put("priceLimit", priceLimit);
res.code = 200;
res.data = data;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取session失败";
}
return res;
}
/**
* 获取当前用户的角色类型
* @param request
......
......@@ -240,4 +240,9 @@ public class RoleService {
}
return price;
}
public String getCurrentPriceLimit(HttpServletRequest request) throws Exception {
Long userId = userService.getUserId(request);
return userService.getRoleTypeByUserId(userId).getPriceLimit();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment