Browse Source

修改部门权限

lwx_dev
erdanergou 3 years ago
parent
commit
59d8a92f74
  1. 19
      src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java
  2. 12
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java
  3. 2
      src/main/resources/templates/pages/user/table-user.html
  4. 2
      src/main/resources/templates/pages/warehouse/depository_add.html
  5. 2
      src/main/resources/templates/pages/warehouse/warehouse_view.html

19
src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java

@ -90,6 +90,25 @@ public class CompanyController {
return new RestResponse(administrationPList, total, 200);
}
/**
* 获取当前公司下的部门
* @param company
* @param request
* @return
*/
@GetMapping("/findPostByCompany")
public RestResponse findPostByCompany(@RequestParam("company") String company, HttpServletRequest request) {
String token = request.getHeader("user-token");
if (token == null) {
token = (String) request.getSession().getAttribute("userToken");
}
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
List<AdministrationP> administrationPList = LinkInterfaceUtil.findCompanyBySuperior(company, userToken);
int size = administrationPList.size();
return new RestResponse(administrationPList, size, 200);
}
/**
* 根据条件查询公司
*

12
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java

@ -1000,17 +1000,7 @@ public class DepositoryController {
return new RestResponse(list, size, 200);
}
@GetMapping("/findPostByCompany")
public RestResponse findPostByCompany(@RequestParam("company") String company, HttpServletRequest request) {
String token = request.getHeader("user-token");
if (token == null) {
token = (String) request.getSession().getAttribute("userToken");
}
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
List<AdministrationP> administrationPList = LinkInterfaceUtil.findCompanyBySuperior(company, userToken);
int size = administrationPList.size();
return new RestResponse(administrationPList, size, 200);
}
// 构造树选择框
@GetMapping("/treeMenus")

2
src/main/resources/templates/pages/user/table-user.html

@ -200,7 +200,7 @@
form.on('select(company)', function (data) {
$.ajax({
url: "/repository/findPostByCompany?company=0" + data.value,
url: "/company/findPostByCompany?company=0" + data.value,
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",

2
src/main/resources/templates/pages/warehouse/depository_add.html

@ -113,7 +113,7 @@
form.on('select(company)',function (data){
$.ajax({
url:"/repository/findPostByCompany?company=0"+data.value,
url:"/company/findPostByCompany?company=0"+data.value,
type:'get',
dataType:'json',
contentType: "application/json;charset=utf-8",

2
src/main/resources/templates/pages/warehouse/warehouse_view.html

@ -143,7 +143,7 @@
form.on('select(company)', function (data) {
$.ajax({
url: "/repository/findPostByCompany?company=0" + data.value,
url: "/company/findPostByCompany?company=0" + data.value,
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",

Loading…
Cancel
Save