|
@@ -61,15 +61,18 @@ public class PrintingProjectController extends ControllerSupport {
|
|
|
@PostMapping("/org/list")
|
|
|
@ApiOperation(value = "获取印刷学校列表")
|
|
|
public List<OrgInfo> getOrgList() {
|
|
|
- //根据登录用户的不同角色取不同的学校数据
|
|
|
+ //根据登录用户的不同角色获取不同的学校数据
|
|
|
UserInfo user = new UserInfo(getAccessUser());
|
|
|
+
|
|
|
+ if (user.isSchoolLeader()) {
|
|
|
+ //学校印刷管理员直接返回当前用户的学校机构信息
|
|
|
+ return Lists.newArrayList(user.getOrgInfo());
|
|
|
+ }
|
|
|
+
|
|
|
if (user.isPM()) {
|
|
|
return printingProjectService.getOrgList(user.getUserId(), null);
|
|
|
} else if (user.isSupplier()) {
|
|
|
return printingProjectService.getOrgList(null, user.getUserId());
|
|
|
- } else if (user.isSchoolLeader()) {
|
|
|
- //直接返回当前用户的学校机构信息
|
|
|
- return Lists.newArrayList(user.getOrgInfo());
|
|
|
} else {
|
|
|
return printingProjectService.getOrgList(null, null);
|
|
|
}
|
|
@@ -77,8 +80,20 @@ public class PrintingProjectController extends ControllerSupport {
|
|
|
|
|
|
@PostMapping("/exam/list")
|
|
|
@ApiOperation(value = "获取印刷考试列表")
|
|
|
- public List<ExamInfo> getExamList(@RequestParam Long orgId) {
|
|
|
- return printingProjectService.getExamList(orgId);
|
|
|
+ public List<ExamInfo> getExamList(@RequestParam Long orgId, @RequestParam(required = false, defaultValue = "true") Boolean needAll) {
|
|
|
+ if (needAll) {
|
|
|
+ return printingProjectService.getExamList(orgId, null, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据登录用户的不同角色获取不同的考试数据
|
|
|
+ UserInfo user = new UserInfo(getAccessUser());
|
|
|
+ if (user.isPM()) {
|
|
|
+ return printingProjectService.getExamList(orgId, user.getUserId(), null);
|
|
|
+ } else if (user.isSupplier()) {
|
|
|
+ return printingProjectService.getExamList(orgId, null, user.getUserId());
|
|
|
+ } else {
|
|
|
+ return printingProjectService.getExamList(orgId, null, null);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|