You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/java/com/glxp/api/controller/auth/DeptUserController.java

54 lines
2.0 KiB
Java

3 years ago
package com.glxp.api.controller.auth;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.auth.DeptUserEntity;
import com.glxp.api.req.auth.FilterDeptUserReqeust;
3 years ago
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.DeptUserResponse;
2 years ago
import com.glxp.api.service.auth.DeptService;
3 years ago
import com.glxp.api.service.auth.DeptUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
3 years ago
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class DeptUserController {
@Resource
DeptUserService deptUserService;
2 years ago
@Resource
DeptService deptService;
3 years ago
@AuthRuleAnnotation("")
@GetMapping("udi/auth/dept/user/filter")
public BaseResponse filterList(FilterDeptUserReqeust filterDeptUserReqeust) {
filterDeptUserReqeust.setDeptId(filterDeptUserReqeust.getDeptId());
List<DeptUserResponse> deptEntityList = deptUserService.selectJoinDeptUser(filterDeptUserReqeust);
3 years ago
PageInfo<DeptUserResponse> pageInfo = new PageInfo<>(deptEntityList);
PageSimpleResponse<DeptUserResponse> deptEntityPageSimpleResponse = new PageSimpleResponse<>();
deptEntityPageSimpleResponse.setTotal(pageInfo.getTotal());
deptEntityPageSimpleResponse.setList(deptEntityList);
return ResultVOUtils.success(deptEntityPageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("udi/auth/dept/user/delete")
public BaseResponse delete(@RequestBody DeptUserEntity deptUserEntity) {
boolean b = deptUserService.delete(deptUserEntity.getDeptId(), deptUserEntity.getUserId());
if (b)
return ResultVOUtils.success("移除成功!");
return ResultVOUtils.error(500, "移除失败!");
}
3 years ago
}