Joburgess 5 роки тому
батько
коміт
ba552ba697
20 змінених файлів з 207 додано та 44 видалено
  1. 11 1
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java
  2. 9 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrganizationRelationController.java
  3. 3 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRegistrationController.java
  4. 9 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamReviewController.java
  5. 12 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomController.java
  6. 6 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java
  7. 13 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamReview.java
  8. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRegistrationQueryInfo.java
  9. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomQueryInfo.java
  10. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomStudentRelationQueryInfo.java
  11. 0 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamOrganizationRelationService.java
  12. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRegistrationService.java
  13. 33 26
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java
  14. 25 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamReviewServiceImpl.java
  15. 6 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java
  16. 7 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  17. 4 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  18. 10 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml
  19. 11 3
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml
  20. 4 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

+ 11 - 1
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java

@@ -29,6 +29,8 @@ public class ExamRoom {
 	
 	/** 考试时间(json格式) */
 	private String examTimeJson;
+
+	private Integer organId;
 	
 	/**  */
 	private boolean delFlag;
@@ -105,7 +107,15 @@ public class ExamRoom {
 	public String getExamTimeJson(){
 		return this.examTimeJson;
 	}
-			
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
 	public void setDelFlag(boolean delFlag){
 		this.delFlag = delFlag;
 	}

+ 9 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrganizationRelationController.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.controller;
 
 import com.keao.edu.auth.api.client.SysUserFeignService;
+import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
@@ -12,6 +13,8 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Objects;
+
 /**
  * @Author Joburgess
  * @Date 2020.06.18
@@ -29,7 +32,12 @@ public class ExamOrganizationRelationController extends BaseController {
     @ApiOperation("分页查询")
     @GetMapping(value = "/list")
     public HttpResponseResult<PageInfo<ExamOrganizationRelation>> getList(ExamOrganizationRelationQueryInfo queryInfo) {
-        return succeed(examOrganizationRelationService.queryPage(queryInfo));
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(sysUser)){
+            return failed("请重新登录");
+        }
+        queryInfo.setOrganId(sysUser.getId());
+        return succeed(examOrganizationRelationService.queryExamOrgans(queryInfo));
     }
 
     @ApiOperation("更新考级项目与合作单位关联信息")

+ 3 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRegistrationController.java

@@ -32,7 +32,9 @@ public class ExamRegistrationController extends BaseController {
     @GetMapping(value = "list")
     @PreAuthorize("@pcs.hasPermissions('examRegistration/list')")
     public HttpResponseResult<PageInfo<ExamRegistration>> list(ExamRegistrationQueryInfo queryInfo) {
-        return succeed(examRegistrationService.queryPage(queryInfo));
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        queryInfo.setOrganId(sysUser.getId());
+        return succeed(examRegistrationService.queryExamRegistrationStudents(queryInfo));
     }
 
     @ApiOperation(value = "修改学员报名信息")

+ 9 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamReviewController.java

@@ -1,9 +1,12 @@
 package com.keao.edu.user.controller;
 
+import com.keao.edu.auth.api.client.SysUserFeignService;
+import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.dto.ExamReviewDto;
 import com.keao.edu.user.entity.ExamReview;
 import com.keao.edu.user.page.ExamReviewQueryInfo;
 import com.keao.edu.user.service.ExamReviewService;
@@ -20,11 +23,15 @@ public class ExamReviewController extends BaseController {
 
     @Autowired
     private ExamReviewService examReviewService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation("分页查询评审结果")
     @GetMapping(value = "/list")
-    public HttpResponseResult<PageInfo<ExamReview>> getList(ExamReviewQueryInfo queryInfo) {
-        return succeed(examReviewService.queryPage(queryInfo));
+    public HttpResponseResult<PageInfo<ExamReviewDto>> getList(ExamReviewQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        queryInfo.setOrganId(sysUser.getId());
+        return succeed(examReviewService.findExamResult(queryInfo));
     }
 
     @ApiOperation("修改评审结果")

+ 12 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomController.java

@@ -1,5 +1,7 @@
 package com.keao.edu.user.controller;
 
+import com.keao.edu.auth.api.client.SysUserFeignService;
+import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
@@ -20,16 +22,22 @@ public class ExamRoomController extends BaseController {
 
     @Autowired
     private ExamRoomService examRoomService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation("分页查询监考列表")
     @GetMapping(value = "/list")
     public HttpResponseResult<PageInfo<ExamRoomDto>> getList(ExamRoomQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        queryInfo.setOrganId(sysUser.getId());
         return succeed(examRoomService.queryExamRoomPage(queryInfo));
     }
 
     @ApiOperation("更新考场")
     @PostMapping(value = "/update")
     public HttpResponseResult update(@RequestBody ExamRoom examRoom){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        examRoom.setOrganId(sysUser.getId());
         examRoomService.update(examRoom);
         return succeed();
     }
@@ -37,12 +45,16 @@ public class ExamRoomController extends BaseController {
     @ApiModelProperty("创建教室")
     @PostMapping(value = "/createExamRoom")
     public HttpResponseResult<ExamRoom> createExamRoom(@RequestBody ExamRoom examRoom){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        examRoom.setOrganId(sysUser.getId());
         return succeed(examRoomService.createExamRoom(examRoom));
     }
 
     @ApiModelProperty("更新教室信息")
     @PostMapping(value = "/updateExamRoom")
     public HttpResponseResult<ExamRoom> updateExamRoom(@RequestBody ExamRoom examRoom){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        examRoom.setOrganId(sysUser.getId());
         return succeed(examRoomService.updateExamRoom(examRoom));
     }
 

+ 6 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java

@@ -1,5 +1,7 @@
 package com.keao.edu.user.controller;
 
+import com.keao.edu.auth.api.client.SysUserFeignService;
+import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
@@ -21,6 +23,8 @@ public class ExamRoomStudentRelationController extends BaseController {
 
     @Autowired
     private ExamRoomStudentRelationService examRoomStudentRelationService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation("开启/关闭教室")
     @GetMapping(value = "/switchClassRoom")
@@ -39,6 +43,8 @@ public class ExamRoomStudentRelationController extends BaseController {
     @ApiOperation("获取教室学员")
     @GetMapping(value = "/findExamRoomStudents")
     public HttpResponseResult<PageInfo<ExamRoomStudentRelationDto>> findExamRoomStudents(ExamRoomStudentRelationQueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        queryInfo.setOrganId(sysUser.getId());
         return succeed(examRoomStudentRelationService.findExamRoomStudents(queryInfo));
     }
 

+ 13 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamReview.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.entity;
 
 import com.keao.edu.user.enums.ExamEvaluationResultEnum;
+import com.keao.edu.user.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
@@ -37,6 +38,9 @@ public class ExamReview {
 	
 	private String tenantId;
 
+	@ApiModelProperty(value = "能否编辑")
+	private YesOrNoEnum enableEdit;
+
 	@ApiModelProperty(value = "考试基本信息")
 	private ExaminationBasic examinationBasic;
 
@@ -119,7 +123,15 @@ public class ExamReview {
 	public String getTenantId(){
 		return this.tenantId;
 	}
-			
+
+	public YesOrNoEnum getEnableEdit() {
+		return enableEdit;
+	}
+
+	public void setEnableEdit(YesOrNoEnum enableEdit) {
+		this.enableEdit = enableEdit;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRegistrationQueryInfo.java

@@ -10,6 +10,9 @@ import io.swagger.annotations.ApiModelProperty;
  */
 public class ExamRegistrationQueryInfo extends QueryInfo {
 
+    @ApiModelProperty(value = "合作单位编号")
+    private Integer organId;
+
     @ApiModelProperty(value = "考试项目编号")
     private Integer examId;
 
@@ -25,6 +28,14 @@ public class ExamRegistrationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "学员状态")
     private StudentRegistrationStatusEnum status;
 
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
     public Integer getExamId() {
         return examId;
     }

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomQueryInfo.java

@@ -8,6 +8,9 @@ import java.util.Date;
 
 public class ExamRoomQueryInfo extends QueryInfo {
 
+    @ApiModelProperty(value = "合作单位编号")
+    private Integer organId;
+
     @ApiModelProperty(value = "教室编号")
     private Long examRoomId;
 
@@ -29,6 +32,14 @@ public class ExamRoomQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "主考官")
     private Integer teacherId;
 
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
     public Long getExamRoomId() {
         return examRoomId;
     }

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomStudentRelationQueryInfo.java

@@ -9,6 +9,9 @@ import io.swagger.annotations.ApiModelProperty;
  */
 public class ExamRoomStudentRelationQueryInfo extends QueryInfo {
 
+    @ApiModelProperty(value = "合作单位编号")
+    private Integer organId;
+
     @ApiModelProperty(value = "考级编号")
     private Long examId;
 
@@ -18,6 +21,14 @@ public class ExamRoomStudentRelationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "是否已经加入教室")
     private Integer inRoom;
 
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 0 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamOrganizationRelationService.java

@@ -35,6 +35,4 @@ public interface ExamOrganizationRelationService extends BaseService<Long, ExamO
      */
     void sendUrl(Integer examId, String organIds);
 
-
-
 }

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRegistrationService.java

@@ -1,11 +1,22 @@
 package com.keao.edu.user.service;
 
 
+import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.user.entity.ExamRegistration;
+import com.keao.edu.user.page.ExamRegistrationQueryInfo;
 
 public interface ExamRegistrationService extends BaseService<Long, ExamRegistration> {
 
    ExamRegistration addRegistration(ExamRegistration examRegistration);
 
+   /**
+    * @describe 查询考级项目报名学员
+    * @author Joburgess
+    * @date 2020.06.28
+    * @param queryInfo:
+    * @return com.keao.edu.common.page.PageInfo<com.keao.edu.user.entity.ExamRegistration>
+    */
+   PageInfo<ExamRegistration> queryExamRegistrationStudents(ExamRegistrationQueryInfo queryInfo);
+
 }

+ 33 - 26
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java

@@ -12,7 +12,9 @@ import com.keao.edu.user.entity.ExamCertification;
 import com.keao.edu.user.entity.ExamRegistration;
 import com.keao.edu.user.entity.ExaminationBasic;
 import com.keao.edu.user.enums.ExamStatusEnum;
+import com.keao.edu.user.page.ExamRegistrationQueryInfo;
 import com.keao.edu.user.service.ExamRegistrationService;
+import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -34,38 +36,14 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
 	private ExaminationBasicDao examinationBasicDao;
 	@Autowired
 	private SysUserDao sysUserDao;
+	@Autowired
+	private OrganizationService organizationService;
 
 	@Override
 	public BaseDAO<Long, ExamRegistration> getDAO() {
 		return examRegistrationDao;
 	}
 
-	@Override
-	public PageInfo<ExamRegistration> queryPage(QueryInfo queryInfo) {
-		PageInfo<ExamRegistration> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-		Map<String, Object> params = new HashMap<String, Object>();
-		MapUtil.populateMap(params, queryInfo);
-
-		List<ExamRegistration> dataList = Collections.EMPTY_LIST;
-		int count = this.findCount(params);
-		if (count > 0) {
-			pageInfo.setTotal(count);
-			params.put("offset", pageInfo.getOffset());
-			dataList = this.getDAO().queryPage(params);
-			List<Integer> organIds = dataList.stream().map(ExamRegistration::getOrganId).collect(Collectors.toList());
-			Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
-			List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
-			Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
-			for (ExamRegistration examRegistration : dataList) {
-				examRegistration.getOrganization().setName(organIdNameMap.get(examRegistration.getOrganId()));
-				examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getStudentId()));
-			}
-		}
-		pageInfo.setRows(dataList);
-
-		return pageInfo;
-	}
-
     @Override
 	@Transactional(rollbackFor = Exception.class)
     public ExamRegistration addRegistration(ExamRegistration examRegistration) {
@@ -96,4 +74,33 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
 		examCertificationDao.insert(examCertification);
 		return examRegistration;
     }
+
+	@Override
+	public PageInfo<ExamRegistration> queryExamRegistrationStudents(ExamRegistrationQueryInfo queryInfo) {
+		PageInfo<ExamRegistration> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<Integer> nextLevelOrganIds = organizationService.getNextLevelOrganIds(queryInfo.getOrganId(), true);
+		params.put("organIds", nextLevelOrganIds);
+
+		List<ExamRegistration> dataList = Collections.EMPTY_LIST;
+		int count = this.findCount(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = this.getDAO().queryPage(params);
+			List<Integer> organIds = dataList.stream().map(ExamRegistration::getOrganId).collect(Collectors.toList());
+			Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
+			List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
+			Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+			for (ExamRegistration examRegistration : dataList) {
+				examRegistration.getOrganization().setName(organIdNameMap.get(examRegistration.getOrganId()));
+				examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getStudentId()));
+			}
+		}
+
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

+ 25 - 4
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamReviewServiceImpl.java

@@ -3,6 +3,7 @@ package com.keao.edu.user.service.impl;
 
 import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.dao.ExamReviewDao;
@@ -10,17 +11,16 @@ import com.keao.edu.user.dto.ExamReviewDto;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.entity.ExamReview;
 import com.keao.edu.user.entity.Subject;
+import com.keao.edu.user.enums.YesOrNoEnum;
 import com.keao.edu.user.page.ExamReviewQueryInfo;
 import com.keao.edu.user.service.ExamReviewService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -28,6 +28,8 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
 	
 	@Autowired
 	private ExamReviewDao examReviewDao;
+	@Autowired
+	private OrganizationServiceImpl organizationService;
 
 	@Override
 	public BaseDAO<Long, ExamReview> getDAO() {
@@ -40,6 +42,9 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
 
+		List<Integer> nextLevelOrganIds = organizationService.getNextLevelOrganIds(queryInfo.getOrganId(), true);
+		params.put("organIds", nextLevelOrganIds);
+
 		List<ExamReviewDto> dataList = null;
 		int count = examReviewDao.countExamResult(params);
 		if (count > 0) {
@@ -58,4 +63,20 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
 		pageInfo.setRows(dataList);
 		return pageInfo;
 	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public int update(ExamReview examReview) {
+		if(Objects.isNull(examReview.getId())){
+			throw new BizException("考试结果不存在");
+		}
+		ExamReview existExamReview = examReviewDao.get(examReview.getId());
+		if(Objects.isNull(existExamReview)){
+			throw new BizException("考试结果不存在");
+		}
+		if(YesOrNoEnum.YES.equals(existExamReview.getEnableEdit())){
+			throw new BizException("编辑已锁定");
+		}
+		return super.update(examReview);
+	}
 }

+ 6 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -13,6 +13,7 @@ import com.keao.edu.user.dto.ExamRoomDto;
 import com.keao.edu.user.enums.ExamModeEnum;
 import com.keao.edu.user.page.ExamRoomQueryInfo;
 import com.keao.edu.user.service.ExamRoomService;
+import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +29,8 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 	private ExamRoomDao examRoomDao;
 	@Autowired
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
+	@Autowired
+	private OrganizationService organizationService;
 
 	@Override
 	public BaseDAO<Long, ExamRoom> getDAO() {
@@ -40,6 +43,9 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		Map<String, Object> params = new HashMap<>();
 		MapUtil.populateMap(params, queryInfo);
 
+		List<Integer> nextLevelOrganIds = organizationService.getNextLevelOrganIds(queryInfo.getOrganId(), true);
+		params.put("organIds", nextLevelOrganIds);
+
 		List<ExamRoomDto> dataList = null;
 		int count = examRoomDao.countExamRoomPage(params);
 		if (count > 0) {

+ 7 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -14,6 +14,7 @@ import com.keao.edu.user.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 import com.keao.edu.user.service.ExamRoomStudentRelationService;
+import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +31,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
 	@Autowired
 	private ExamRoomDao examRoomDao;
+	@Autowired
+	private OrganizationService organizationService;
 
 	@Override
 	public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
@@ -79,8 +82,11 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
 
+		List<Integer> nextLevelOrganIds = organizationService.getNextLevelOrganIds(queryInfo.getOrganId(), true);
+		params.put("organIds", nextLevelOrganIds);
+
 		List<ExamRoomStudentRelationDto> dataList = new ArrayList<>();
-		int count = this.findCount(params);
+		int count = examRoomStudentRelationDao.countExamRoomStudents(params);
 		if (count > 0) {
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());

+ 4 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -100,6 +100,10 @@
 
 	<sql id="queryCondition">
 		<where>
+			er.organ_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
 			<if test="examId!=null">
 				AND er.examination_basic_id_ = #{examId}
 			</if>

+ 10 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml

@@ -16,6 +16,7 @@
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
+		<result column="enable_edit_" property="enableEdit" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
 		<association property="examinationBasic" javaType="com.keao.edu.user.entity.ExaminationBasic"/>
 	</resultMap>
 
@@ -36,9 +37,9 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamReview" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO exam_review (id_,examination_basic_id_,teacher_id_,student_id_,evaluation_content_,
-		evaluation_result_,create_time_,update_time_,tenant_id_)
+		evaluation_result_,create_time_,update_time_,tenant_id_,enable_edit_)
 		VALUES(#{id},#{examinationBasicId},#{teacherId},#{studentId},#{evaluationContent},
-		#{evaluationResult,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
+		#{evaluationResult,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId},#{enableEdit,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -63,6 +64,9 @@
 			<if test="evaluationContent != null">
 				evaluation_content_ = #{evaluationContent},
 			</if>
+			<if test="enableEdit != null">
+				enable_edit_ = #{enableEdit,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
@@ -86,6 +90,10 @@
 
 	<sql id="findExamResultCondition">
 		<where>
+			ere.organ_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
 			<if test="examinationBaseId!=null">
 				AND ere.examination_basic_id_ = #{examinationBaseId}
 			</if>

+ 11 - 3
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -16,6 +16,7 @@
 		<result column="assistant_teacher_user_id_list_" property="assistantTeacherUserIdList" />
 		<result column="exam_time_json_" property="examTimeJson" />
 		<result column="del_flag_" property="delFlag" />
+		<result column="organ_id_" property="organId"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -34,9 +35,9 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.api.entity.ExamRoom" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO exam_room (id_,examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,main_teacher_user_id_,
-		assistant_teacher_user_id_list_,exam_time_json_,del_flag_,create_time_,update_time_,tenant_id_)
+		assistant_teacher_user_id_list_,exam_time_json_,del_flag_,organ_id_,create_time_,update_time_,tenant_id_)
 		VALUES(#{id},#{examinationBasicId},#{examMode},#{examLocationId},#{subjectIdList},#{mainTeacherUserId},#{assistantTeacherUserIdList},
-		#{examTimeJson},#{delFlag},NOW(),NOW(),#{tenantId})
+		#{examTimeJson},#{delFlag},#{organId},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -70,6 +71,9 @@
 			<if test="assistantTeacherUserIdList != null">
 				assistant_teacher_user_id_list_ = #{assistantTeacherUserIdList},
 			</if>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
@@ -98,8 +102,12 @@
 
 	<sql id="queryExamRoomPageSql">
 		<where>
+			er.organ_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
 			<if test="examRoomId!=null">
-				er.id_=#{examRoomId}
+				AND er.id_=#{examRoomId}
 			</if>
 			<if test="examId!=null">
 				AND er.examination_basic_id_ = #{examId}

+ 4 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -111,6 +111,10 @@
 
 	<sql id="queryCondition">
 		<where>
+			ersr.organ_id_ IN
+			<foreach collection="organIds" item="organI" separator="," open="(" close=")">
+				#{organI}
+			</foreach>
 			<if test="examId!=null">
 				AND er.examination_basic_id_ = 1
 			</if>