增加接口:查询当前用户的价格屏蔽
This commit is contained in:
@@ -2,11 +2,8 @@ package com.jsh.erp.controller;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jsh.erp.constants.ExceptionConstants;
|
|
||||||
import com.jsh.erp.datasource.entities.Role;
|
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.role.RoleService;
|
||||||
import com.jsh.erp.service.user.UserService;
|
|
||||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||||
import com.jsh.erp.utils.ErpInfo;
|
import com.jsh.erp.utils.ErpInfo;
|
||||||
import io.swagger.annotations.Api;
|
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.exception.BusinessParamCheckingException;
|
||||||
import com.jsh.erp.service.log.LogService;
|
import com.jsh.erp.service.log.LogService;
|
||||||
import com.jsh.erp.service.redis.RedisService;
|
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.tenant.TenantService;
|
||||||
import com.jsh.erp.service.user.UserService;
|
import com.jsh.erp.service.user.UserService;
|
||||||
import com.jsh.erp.utils.*;
|
import com.jsh.erp.utils.*;
|
||||||
@@ -51,6 +52,9 @@ public class UserController {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RoleService roleService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
|
|
||||||
@@ -382,6 +386,24 @@ public class UserController {
|
|||||||
return arr;
|
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
|
* @param request
|
||||||
|
|||||||
@@ -240,4 +240,9 @@ public class RoleService {
|
|||||||
}
|
}
|
||||||
return price;
|
return price;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCurrentPriceLimit(HttpServletRequest request) throws Exception {
|
||||||
|
Long userId = userService.getUserId(request);
|
||||||
|
return userService.getRoleTypeByUserId(userId).getPriceLimit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user