Просмотр исходного кода

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan 5 лет назад
Родитель
Сommit
7fccdab9af
41 измененных файлов с 529 добавлено и 59 удалено
  1. 11 1
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java
  2. 12 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. 31 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamSubjectController.java
  8. 12 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamSubjectSongController.java
  9. 10 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamOrganizationRelationDao.java
  10. 11 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSongDao.java
  11. 15 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSubjectDao.java
  12. 13 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSubjectSongDao.java
  13. 10 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/OrganizationDao.java
  14. 16 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamSubjectDto.java
  15. 13 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamReview.java
  16. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamOrganizationRelationQueryInfo.java
  17. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRegistrationQueryInfo.java
  18. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomQueryInfo.java
  19. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomStudentRelationQueryInfo.java
  20. 11 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamOrganizationRelationService.java
  21. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRegistrationService.java
  22. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamSubjectService.java
  23. 10 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamSubjectSongService.java
  24. 14 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/OrganizationService.java
  25. 38 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java
  26. 34 26
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java
  27. 25 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamReviewServiceImpl.java
  28. 6 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java
  29. 7 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  30. 9 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamSubjectServiceImpl.java
  31. 22 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamSubjectSongServiceImpl.java
  32. 24 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java
  33. 33 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamOrganizationRelationMapper.xml
  34. 4 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  35. 10 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml
  36. 11 3
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml
  37. 4 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  38. 3 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSongMapper.xml
  39. 8 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectMapper.xml
  40. 3 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectSongMapper.xml
  41. 3 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/OrganizationMapper.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;
 	}

+ 12 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrganizationRelationController.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;
@@ -11,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
@@ -22,11 +26,18 @@ public class ExamOrganizationRelationController extends BaseController {
 
     @Autowired
     private ExamOrganizationRelationService examOrganizationRelationService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @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));
     }
 

+ 31 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamSubjectController.java

@@ -0,0 +1,31 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.user.dto.ExamSubjectDto;
+import com.keao.edu.user.entity.ExamSong;
+import com.keao.edu.user.entity.Subject;
+import com.keao.edu.user.service.ExamSubjectService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("examSubject")
+@Api(tags = "考级项目考级专业服务")
+public class ExamSubjectController extends BaseController {
+
+    @Autowired
+    private ExamSubjectService examSubjectService;
+
+    @ApiOperation("获取考试项目专业")
+    @ApiImplicitParam(name = "ExamId", value = "考试项目id", required = true, dataType = "Integer")
+    @GetMapping(value = "/getExamSubjects")
+    public HttpResponseResult<List<ExamSubjectDto>> getExamSubjects(Integer ExamId) {
+        return succeed(examSubjectService.getExamSubjects(ExamId));
+    }
+}

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

@@ -5,10 +5,13 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
 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.user.entity.ExamSong;
 import com.keao.edu.user.entity.ExamSubjectSong;
 import com.keao.edu.user.page.ExamSubjectSongQueryInfo;
 import com.keao.edu.user.service.ExamSubjectSongService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -47,4 +50,13 @@ public class ExamSubjectSongController extends BaseController {
         return succeed();
     }
 
+
+    @ApiOperation("获取考级专业相应级别的曲目")
+    @ApiImplicitParams({@ApiImplicitParam(name = "examSubjectId", value = "考试项目专业id", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "level", value = "级别", required = true, dataType = "Integer") })
+    @GetMapping(value = "/getExamSubjectSong")
+    public HttpResponseResult<List<ExamSong>> getExamSubjectSong(Long examSubjectId,Integer level) {
+        return succeed(examSubjectSongService.getExamSubjectSong(examSubjectId,level));
+    }
+
 }

+ 10 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamOrganizationRelationDao.java

@@ -53,5 +53,15 @@ public interface ExamOrganizationRelationDao extends BaseDAO<Long, ExamOrganizat
      */
     Set<Integer> getOrganIdsWithExam(@Param("examId") Integer examId);
 
+    /**
+     * @describe 统计指定考级项目与指定分布下的报名人数与累计收款
+     * @author Joburgess
+     * @date 2020.06.28
+     * @param examId:
+     * @param organIds:
+     * @return java.util.List<com.keao.edu.user.entity.ExamOrganizationRelation>
+     */
+    List<ExamOrganizationRelation> countExamOrganStudentAndPayment(@Param("examId") Integer examId,
+                                                                       @Param("organIds") List<Integer> organIds);
 	
 }

+ 11 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSongDao.java

@@ -2,8 +2,18 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamSong;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ExamSongDao extends BaseDAO<Integer, ExamSong> {
 
-	
+    /**
+     * 获取考试曲目
+     *
+     * @param ids
+     * @return
+     */
+    List<ExamSong> getExamSongs(@Param("ids") String ids);
+
 }

+ 15 - 4
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSubjectDao.java

@@ -1,22 +1,33 @@
 package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.dto.ExamSubjectDto;
 import com.keao.edu.user.entity.ExamSubject;
+import com.keao.edu.user.entity.Subject;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 public interface ExamSubjectDao extends BaseDAO<Long, ExamSubject> {
 
-    int batchInsert(@Param("examSubjects")List<ExamSubject> examSubjects);
+    int batchInsert(@Param("examSubjects") List<ExamSubject> examSubjects);
 
     /**
+     * @param examId: 考级项目编号
+     * @return java.util.List<com.keao.edu.user.entity.ExamSubject>
      * @describe 获取考级项目关联的声部
      * @author Joburgess
      * @date 2020.06.19
-     * @param examId: 考级项目编号
-     * @return java.util.List<com.keao.edu.user.entity.ExamSubject>
      */
     List<ExamSubject> getWithTenant(@Param("examId") Integer examId);
-	
+
+    /**
+     * 根据考级项目编号获取相关专业
+     *
+     * @param examId 考级项目编号
+     * @return
+     */
+    List<ExamSubjectDto> getSubjectWithExamId(@Param("examId") Integer examId);
+
+
 }

+ 13 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSubjectSongDao.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.ExamSong;
 import com.keao.edu.user.entity.ExamSubjectSong;
 import org.apache.ibatis.annotations.Param;
 
@@ -11,12 +12,21 @@ public interface ExamSubjectSongDao extends BaseDAO<Long, ExamSubjectSong> {
     int batchInsert(@Param("examSubjectSongs") List<ExamSubjectSong> examSubjectSongs);
 
     /**
+     * @param examId:
+     * @return java.util.List<com.keao.edu.user.entity.ExamSubjectSong>
      * @describe 获取考级项目下的专业设置
      * @author Joburgess
      * @date 2020.06.22
-     * @param examId:
-     * @return java.util.List<com.keao.edu.user.entity.ExamSubjectSong>
      */
     List<ExamSubjectSong> findByExam(@Param("examId") Integer examId);
-	
+
+
+    /**
+     * 获取考试对应科目对应级别的曲目
+     * @param examSubjectId
+     * @param level
+     * @return
+     */
+    ExamSubjectSong getExamSubjectSong(@Param("examSubjectId") Long examSubjectId, @Param("level") Integer level);
+
 }

+ 10 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/OrganizationDao.java

@@ -25,6 +25,15 @@ public interface OrganizationDao extends BaseDAO<Integer, Organization> {
      * @param parentOrganIdTag:
      * @return java.util.List<java.lang.Integer>
      */
-    List<Integer> getSelfAndChildOrganIds(@Param("parentOrganIdTag") String parentOrganIdTag);
+    List<Integer> getChildOrganIds(@Param("parentOrganIdTag") String parentOrganIdTag);
+
+    /**
+     * @describe 获取下一级所有合作单位编号
+     * @author Joburgess
+     * @date 2020.06.28
+     * @param organId: 当前合作单位
+     * @return java.util.List<java.lang.Integer>
+     */
+    List<Integer> getNextLevelOrganIds(@Param("organId") Integer organId);
 
 }

+ 16 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamSubjectDto.java

@@ -0,0 +1,16 @@
+package com.keao.edu.user.dto;
+
+import com.keao.edu.user.entity.Subject;
+
+public class ExamSubjectDto extends Subject {
+
+    private Long examSubjectId;
+
+    public Long getExamSubjectId() {
+        return examSubjectId;
+    }
+
+    public void setExamSubjectId(Long examSubjectId) {
+        this.examSubjectId = examSubjectId;
+    }
+}

+ 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/ExamOrganizationRelationQueryInfo.java

@@ -12,12 +12,23 @@ import javax.management.Query;
  */
 public class ExamOrganizationRelationQueryInfo extends QueryInfo {
 
+    @ApiModelProperty(value = "合作单位编号")
+    private Integer organId;
+
     @ApiModelProperty(value = "考试项目编号")
     private Integer examId;
 
     @ApiModelProperty(value = "分润结算方式")
     private SettlementTypeEnum settlementType;
 
+    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/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;
     }

+ 11 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamOrganizationRelationService.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.ExamOrganizationRelation;
+import com.keao.edu.user.page.ExamOrganizationRelationQueryInfo;
 
 public interface ExamOrganizationRelationService extends BaseService<Long, ExamOrganizationRelation> {
 
     /**
+     * @describe 查询考级项目关联合作单位记录
+     * @author Joburgess
+     * @date 2020.06.28
+     * @param queryInfo:
+     * @return com.keao.edu.common.page.PageInfo<com.keao.edu.user.entity.ExamOrganizationRelation>
+     */
+    PageInfo<ExamOrganizationRelation> queryExamOrgans(ExamOrganizationRelationQueryInfo queryInfo);
+
+    /**
      * @describe 更新考级项目与合作单位关联信息
      * @author Joburgess
      * @date 2020.06.18
@@ -24,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);
+
 }

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

@@ -2,8 +2,19 @@ package com.keao.edu.user.service;
 
 
 import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.dto.ExamSubjectDto;
 import com.keao.edu.user.entity.ExamSubject;
+import com.keao.edu.user.entity.Subject;
+
+import java.util.List;
 
 public interface ExamSubjectService extends BaseService<Long, ExamSubject> {
 
+
+    /**
+     * 根据考试项目id获取考试专业列表
+     * @param ExamId
+     * @return
+     */
+    List<ExamSubjectDto> getExamSubjects(Integer ExamId);
 }

+ 10 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamSubjectSongService.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.service;
 
 import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExamSong;
 import com.keao.edu.user.entity.ExamSubjectSong;
 
 import java.util.List;
@@ -16,4 +17,13 @@ public interface ExamSubjectSongService extends BaseService<Long, ExamSubjectSon
      */
     void addExamSubjects(List<ExamSubjectSong> examSubjectSongs);
 
+
+    /**
+     * 获取考试对应科目对应级别的曲目
+     * @param examSubjectId
+     * @param level
+     * @return
+     */
+    List<ExamSong> getExamSubjectSong(Long examSubjectId,Integer level);
+
 }

+ 14 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/OrganizationService.java

@@ -21,11 +21,22 @@ public interface OrganizationService extends BaseService<Integer, Organization>
     void updateOrganization(Organization organization);
 
     /**
-     * @describe 获取当前分部及其所有子分部编号
+     * @describe 获取当前分部及其所有子合作单位编号
      * @author Joburgess
      * @date 2020.06.28
-     * @param organId:
+     * @param organId: 本单位编号
+     * @param includeSelf: 是否包含本单位
      * @return java.util.List<java.lang.Integer>
      */
-    List<Integer> getSelfAndChildOrganIds(Integer organId);
+    List<Integer> getChildOrganIds(Integer organId, boolean includeSelf);
+
+    /**
+     * @describe 获取下一级所有合作单位编号
+     * @author Joburgess
+     * @date 2020.06.28
+     * @param organId: 当前合作单位编号
+     * @param includeSelf: 是否包含当前合作单位
+     * @return java.util.List<java.lang.Integer>
+     */
+    List<Integer> getNextLevelOrganIds(Integer organId, boolean includeSelf);
 }

+ 38 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java

@@ -2,6 +2,8 @@ package com.keao.edu.user.service.impl;
 
 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.page.QueryInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.dao.ExamOrganizationRelationDao;
@@ -10,8 +12,12 @@ import com.keao.edu.user.entity.ExamOrganizationRelation;
 import com.keao.edu.user.entity.ExaminationBasic;
 import com.keao.edu.user.enums.ExamStatusEnum;
 import com.keao.edu.user.enums.YesOrNoEnum;
+import com.keao.edu.user.page.ExamOrganizationRelationQueryInfo;
 import com.keao.edu.user.service.ExamOrganizationRelationService;
+import com.keao.edu.user.service.OrganizationService;
+import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
+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.Isolation;
@@ -29,6 +35,8 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 	private ExamOrganizationRelationDao examOrganizationRelationDao;
 	@Autowired
 	private ExaminationBasicDao examinationBasicDao;
+	@Autowired
+	private OrganizationService organizationService;
 
 	@Override
 	public BaseDAO<Long, ExamOrganizationRelation> getDAO() {
@@ -36,6 +44,36 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 	}
 
 	@Override
+	public PageInfo<ExamOrganizationRelation> queryExamOrgans(ExamOrganizationRelationQueryInfo queryInfo) {
+		PageInfo<ExamOrganizationRelation> 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<ExamOrganizationRelation> dataList = new ArrayList<>();
+		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(ExamOrganizationRelation::getOrganId).collect(Collectors.toList());
+			List<ExamOrganizationRelation> countInfos = examOrganizationRelationDao.countExamOrganStudentAndPayment(queryInfo.getExamId(), organIds);
+			Map<Integer, ExamOrganizationRelation> organCountInfoMap = countInfos.stream().collect(Collectors.toMap(ExamOrganizationRelation::getOrganId, e -> e));
+			for (ExamOrganizationRelation examOrganizationRelation : dataList) {
+				ExamOrganizationRelation countInfo = organCountInfoMap.get(examOrganizationRelation.getOrganId());
+				if(Objects.nonNull(countInfo)){
+					examOrganizationRelation.setTotalRegistrationStudentNum(countInfo.getTotalRegistrationStudentNum());
+					examOrganizationRelation.setTotalPaymentAmount(countInfo.getTotalPaymentAmount());
+				}
+			}
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
 	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public void updateExamOrganizationRelation(ExamOrganizationRelation examOrganizationRelation) {
 		if(Objects.isNull(examOrganizationRelation.getExaminationBasicId())){

+ 34 - 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) {
@@ -93,7 +71,37 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
 		examCertification.setLevel(examRegistration.getLevel());
 		examCertification.setExamStartTime(examinationBasic.getExpectExamStartTime());
 		examCertification.setExamEndTime(examinationBasic.getExpectExamEndTime());
+		examCertification.setTenantId(examRegistration.getTenantId());
 		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());

+ 9 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamSubjectServiceImpl.java

@@ -3,11 +3,15 @@ package com.keao.edu.user.service.impl;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.dao.ExamSubjectDao;
+import com.keao.edu.user.dto.ExamSubjectDto;
 import com.keao.edu.user.entity.ExamSubject;
+import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.service.ExamSubjectService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class ExamSubjectServiceImpl extends BaseServiceImpl<Long, ExamSubject> implements ExamSubjectService {
 	
@@ -18,5 +22,9 @@ public class ExamSubjectServiceImpl extends BaseServiceImpl<Long, ExamSubject> i
 	public BaseDAO<Long, ExamSubject> getDAO() {
 		return examSubjectDao;
 	}
-	
+
+    @Override
+    public List<ExamSubjectDto> getExamSubjects(Integer ExamId) {
+		return examSubjectDao.getSubjectWithExamId(ExamId);
+    }
 }

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamSubjectSongServiceImpl.java

@@ -6,9 +6,11 @@ import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.tenant.TenantContextHolder;
+import com.keao.edu.user.dao.ExamSongDao;
 import com.keao.edu.user.dao.ExamSubjectDao;
 import com.keao.edu.user.dao.ExamSubjectSongDao;
 import com.keao.edu.user.dao.ExaminationBasicDao;
+import com.keao.edu.user.entity.ExamSong;
 import com.keao.edu.user.entity.ExamSubject;
 import com.keao.edu.user.entity.ExamSubjectSong;
 import com.keao.edu.user.entity.ExaminationBasic;
@@ -32,6 +34,8 @@ public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjec
 	private ExamSubjectSongDao examSubjectSongDao;
 	@Autowired
 	private ExamSubjectDao examSubjectDao;
+	@Autowired
+	private ExamSongDao examSongDao;
 
 	@Override
 	public BaseDAO<Long, ExamSubjectSong> getDAO() {
@@ -97,4 +101,22 @@ public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjec
 			examSubjectDao.batchInsert(newExamSubjects);
 		}
 	}
+
+    @Override
+    public List<ExamSong> getExamSubjectSong(Long examSubjectId, Integer level) {
+		List<ExamSong> examSongs = new ArrayList<>();
+		ExamSubjectSong examSubjectSong = examSubjectSongDao.getExamSubjectSong(examSubjectId, level);
+		if(examSubjectSong == null){
+			return examSongs;
+		}
+		List<ExamSong> practiceSong = examSongDao.getExamSongs(examSubjectSong.getPracticeSongIdList());
+		if(practiceSong != null){
+			examSongs.addAll(practiceSong);
+		}
+		List<ExamSong> performSong = examSongDao.getExamSongs(examSubjectSong.getPerformSongIdList());
+		if(performSong != null){
+			examSongs.addAll(performSong);
+		}
+		return examSongs;
+	}
 }

+ 24 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java

@@ -132,15 +132,37 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	}
 
 	@Override
-	public List<Integer> getSelfAndChildOrganIds(Integer organId) {
+	public List<Integer> getChildOrganIds(Integer organId, boolean includeSelf) {
 		Organization organization = organDao.get(organId);
 		if(Objects.isNull(organization)){
 			throw new BizException("当前声部不存在");
 		}
-		List<Integer> selfAndChildOrganIds = organDao.getSelfAndChildOrganIds(organization.getLevel()<=0?organization.getId().toString():organization.getParentOrganIdTag());
+		StringBuffer parentOrganIdTag= new StringBuffer(organization.getParentOrganIdTag());
+		parentOrganIdTag.append(",");
+		parentOrganIdTag.append(organization.getId());
+		List<Integer> selfAndChildOrganIds = organDao.getChildOrganIds(parentOrganIdTag.toString());
 		if(null == selfAndChildOrganIds){
 			selfAndChildOrganIds= Collections.EMPTY_LIST;
 		}
+		if(!includeSelf){
+			selfAndChildOrganIds.remove(organization.getId());
+		}
 		return selfAndChildOrganIds;
 	}
+
+	@Override
+	public List<Integer> getNextLevelOrganIds(Integer organId, boolean includeSelf) {
+		Organization organization = organDao.get(organId);
+		if(Objects.isNull(organization)){
+			throw new BizException("当前声部不存在");
+		}
+		List<Integer> selfAndChildOrganIds = organDao.getNextLevelOrganIds(organization.getId());
+		if(null == selfAndChildOrganIds){
+			selfAndChildOrganIds= Collections.EMPTY_LIST;
+		}
+		if(includeSelf){
+			selfAndChildOrganIds.add(organization.getId());
+		}
+		return null;
+	}
 }

+ 33 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamOrganizationRelationMapper.xml

@@ -108,6 +108,10 @@
 	<sql id="queryCondition">
 		<where>
 			ear.tenant_id_=#{tenantId}
+			AND ear.orga_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
 			<if test="settlementType!=null">
 				AND ear.settlement_type_=#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
 			</if>
@@ -140,16 +144,45 @@
 		</if>
 		<include refid="queryCondition"/>
 	</select>
+
 	<select id="getWithExam" resultMap="ExamOrganizationRelation">
 		SELECT * FROM exam_organization_relation WHERE examination_basic_id_=#{examId}
 	</select>
+
 	<select id="getOrganIdsWithExam" resultType="int">
 		SELECT organ_id_ FROM exam_organization_relation WHERE examination_basic_id_=#{examId} FOR UPDATE
 	</select>
+
     <select id="getWithExams" resultMap="ExamOrganizationRelation">
 		SELECT * FROM exam_organization_relation WHERE examination_basic_id_ IN
 		<foreach collection="examIds" item="examId" separator="," open="(" close=")">
 			#{examId}
 		</foreach>
     </select>
+	<select id="countExamOrganStudentAndPayment" resultMap="ExamOrganizationRelation">
+		SELECT
+			o.id_ organ_id_,
+			SUM(eor.total_registration_student_num_) total_registration_student_num_,
+			SUM(eor.total_payment_amount_) total_payment_amount_
+		FROM
+			organization o
+			LEFT JOIN (
+			SELECT
+				eor1.id_,
+				eor1.organ_id_,
+				eor1.total_payment_amount_,
+				eor1.total_registration_student_num_,
+				o1.parent_organ_id_tag_
+			FROM
+				exam_organization_relation eor1
+				LEFT JOIN organization o1 ON o1.id_ = eor1.organ_id_
+			WHERE eor1.examination_basic_id_=#{examId}
+			) eor ON eor.parent_organ_id_tag_ LIKE CONCAT( o.parent_organ_id_tag_, '%' )
+		WHERE
+			o.id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
+		GROUP BY o.id_
+	</select>
 </mapper>

+ 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>

+ 3 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSongMapper.xml

@@ -103,4 +103,7 @@
 		SELECT COUNT(*) FROM exam_song
 		<include refid="queryCondition"/>
 	</select>
+    <select id="getExamSongs" resultMap="ExamSong">
+		SELECT * FROM exam_song WHERE FIND_IN_SET(id_,#{ids})
+	</select>
 </mapper>

+ 8 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectMapper.xml

@@ -76,4 +76,12 @@
 	<select id="getWithTenant" resultMap="ExamSubject">
 		SELECT * FROM exam_subject WHERE examination_basic_id_=#{examId}
 	</select>
+
+	<resultMap id="ExamSubjectDto" type="com.keao.edu.user.dto.ExamSubjectDto" extends="com.keao.edu.user.dao.SubjectDao.Subject" >
+		<result column="exam_subject_id_" property="examSubjectId" />
+	</resultMap>
+	<select id="getSubjectWithExamId" resultMap="ExamSubjectDto">
+		SELECT es.id_ exam_subject_id_ ,s.* FROM exam_subject es
+		LEFT JOIN subject s on es.subject_id_ = s.id_ WHERE examination_basic_id_ = #{examId}
+	</select>
 </mapper>

+ 3 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectSongMapper.xml

@@ -130,4 +130,7 @@
 	<select id="findByExam" resultMap="ExamSubjectSong">
 		SELECT * FROM exam_subject_song WHERE examination_basic_id_=#{examId}
 	</select>
+    <select id="getExamSubjectSong" resultType="com.keao.edu.user.entity.ExamSubjectSong">
+		SELECT * FROM exam_subject_song WHERE exam_subject_id_ = #{examSubjectId} AND level_ = #{level}
+	</select>
 </mapper>

+ 3 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -120,4 +120,7 @@
 	<select id="getSelfAndChildOrganIds" resultType="int">
 		SELECT id_ FROM organization WHERE parent_organ_id_tag_ LIKE CONCAT(#{parentOrganIdTag}, '%');
 	</select>
+	<select id="getNextLevelOrganIds" resultType="int">
+		SELECT id_ FROM organization WHERE parent_organ_id_ =#{organId};
+	</select>
 </mapper>