|
@@ -1,8 +1,11 @@
|
|
|
package cn.com.qmth.print.manage.controller;
|
|
|
|
|
|
import cn.com.qmth.print.manage.entity.ExamEntity;
|
|
|
+import cn.com.qmth.print.manage.entity.UserEntity;
|
|
|
+import cn.com.qmth.print.manage.enums.RoleMeta;
|
|
|
import cn.com.qmth.print.manage.service.ExamService;
|
|
|
import cn.com.qmth.print.manage.service.PmSession;
|
|
|
+import cn.com.qmth.print.manage.service.UserService;
|
|
|
import cn.com.qmth.print.manage.service.query.ExamQuery;
|
|
|
import cn.com.qmth.print.manage.utils.PathUtil;
|
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
@@ -13,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
import java.util.Objects;
|
|
|
|
|
@@ -24,8 +28,10 @@ import java.util.Objects;
|
|
|
@Aac(strict = BOOL.FALSE, auth = BOOL.TRUE)
|
|
|
public class ExamController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ExamService examService;
|
|
|
+ @Resource
|
|
|
+ private UserService userService;
|
|
|
|
|
|
/**
|
|
|
* 批次分页查询
|
|
@@ -34,7 +40,12 @@ public class ExamController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/page", method = RequestMethod.POST)
|
|
|
- public Object page(@Validated ExamQuery query) {
|
|
|
+ public Object page(@RequestAttribute PmSession accessEntity,@Validated ExamQuery query) {
|
|
|
+ Long userId = getAccessUserId(accessEntity);
|
|
|
+ UserEntity requestUser = userService.getById(userId);
|
|
|
+ if (RoleMeta.PRINT_LEADER.equals(requestUser.getRole())) {
|
|
|
+ query.setPrintLeaderId(userId);
|
|
|
+ }
|
|
|
return examService.pageQuery(query);
|
|
|
}
|
|
|
|