浏览代码

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

zouxuan 5 年之前
父节点
当前提交
8ab8c26b22
共有 26 个文件被更改,包括 808 次插入79 次删除
  1. 3 1
      edu-common/src/main/java/com/keao/edu/common/enums/MessageTypeEnum.java
  2. 55 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamMusicTheoryController.java
  3. 55 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java
  4. 61 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java
  5. 28 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java
  6. 54 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/StudentExamResultStatisticsDto.java
  7. 12 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRegistration.java
  8. 3 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamReview.java
  9. 36 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamTeacherSalary.java
  10. 8 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Organization.java
  11. 66 35
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java
  12. 36 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Teacher.java
  13. 1 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/ExamStatusEnum.java
  14. 22 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamMusicTheoryQueryInfo.java
  15. 22 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamTeacherSalaryQueryInfo.java
  16. 60 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/StudentExamResultQueryInfo.java
  17. 26 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentExamResultService.java
  18. 12 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java
  19. 16 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  20. 78 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java
  21. 24 17
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamMusicTheoryMapper.xml
  22. 6 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  23. 26 6
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml
  24. 4 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExaminationBasicMapper.xml
  25. 82 8
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml
  26. 12 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/TeacherMapper.xml

+ 3 - 1
edu-common/src/main/java/com/keao/edu/common/enums/MessageTypeEnum.java

@@ -1,7 +1,9 @@
 package com.keao.edu.common.enums;
 
 public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
-    SMS_VERIFY_CODE_LOGIN("SMS_VERIFY_CODE_LOGIN", "验证码登录");
+
+    SMS_VERIFY_CODE_LOGIN("SMS_VERIFY_CODE_LOGIN", "验证码登录"),
+    EXAM_REGISTRATION_URL_PUSH("EXAM_REGISTRATION_URL_PUSH", "报名连接推送");
 
     MessageTypeEnum(String code, String msg) {
         this.code = code;

+ 55 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamMusicTheoryController.java

@@ -0,0 +1,55 @@
+package com.keao.edu.user.controller;
+
+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.ExamMusicTheory;
+import com.keao.edu.user.page.ExamMusicTheoryQueryInfo;
+import com.keao.edu.user.service.ExamMusicTheoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+@RestController
+@RequestMapping("examMusicTheory")
+@Api(tags = "考级乐理")
+public class ExamMusicTheoryController extends BaseController {
+
+    @Autowired
+    private ExamMusicTheoryService examMusicTheoryService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamMusicTheory>> getList(ExamMusicTheoryQueryInfo queryInfo) {
+        return succeed(examMusicTheoryService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("新增")
+    @PostMapping(value = "/add")
+    public HttpResponseResult add(ExamMusicTheory examMusicTheory) {
+        examMusicTheoryService.insert(examMusicTheory);
+        return succeed();
+    }
+
+    @ApiOperation("更新")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(ExamMusicTheory examMusicTheory) {
+        examMusicTheory.setUpdateTime(new Date());
+        examMusicTheoryService.update(examMusicTheory);
+        return succeed();
+    }
+
+    @ApiOperation("删除")
+    @PostMapping(value = "/del/{id}")
+    public HttpResponseResult add(@PathVariable("id") Integer id) {
+        return succeed(examMusicTheoryService.delete(id));
+    }
+
+}

+ 55 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java

@@ -0,0 +1,55 @@
+package com.keao.edu.user.controller;
+
+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.ExamTeacherSalary;
+import com.keao.edu.user.page.ExamTeacherSalaryQueryInfo;
+import com.keao.edu.user.service.ExamTeacherSalaryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+@RestController
+@RequestMapping("examTeacherSalary")
+@Api(tags = "考级项目评审教室分润")
+public class ExamTeacherSalaryController extends BaseController {
+
+    @Autowired
+    private ExamTeacherSalaryService examTeacherSalaryService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamTeacherSalary>> getList(ExamTeacherSalaryQueryInfo queryInfo) {
+        return succeed(examTeacherSalaryService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("新增")
+    @PostMapping(value = "/add")
+    public HttpResponseResult add(ExamTeacherSalary examTeacherSalary) {
+        examTeacherSalaryService.insert(examTeacherSalary);
+        return succeed();
+    }
+
+    @ApiOperation("更新")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(ExamTeacherSalary examTeacherSalary) {
+        examTeacherSalary.setUpdateTime(new Date());
+        examTeacherSalaryService.update(examTeacherSalary);
+        return succeed();
+    }
+
+    @ApiOperation("删除")
+    @PostMapping(value = "/del/{id}")
+    public HttpResponseResult add(@PathVariable("id") Long id) {
+        return succeed(examTeacherSalaryService.delete(id));
+    }
+
+}

+ 61 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java

@@ -0,0 +1,61 @@
+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.user.dto.StudentExamResultStatisticsDto;
+import com.keao.edu.user.entity.ExamReview;
+import com.keao.edu.user.entity.StudentExamResult;
+import com.keao.edu.user.page.StudentExamResultQueryInfo;
+import com.keao.edu.user.service.StudentExamResultService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Objects;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.30
+ */
+@RestController
+@RequestMapping("studentExamResult")
+@Api(tags = "考试结果服务")
+public class StudentExamResultController extends BaseController {
+
+    @Autowired
+    private StudentExamResultService studentExamResultService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation("查询考试结果")
+    @GetMapping(value = "/queryStudentExamResult")
+    public HttpResponseResult<PageInfo<StudentExamResult>> queryStudentExamResult(StudentExamResultQueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(queryInfo.getOrganId())){
+            queryInfo.setOrganId(sysUser.getId());
+        }
+        return succeed(studentExamResultService.queryStudentExamResult(queryInfo));
+    }
+
+    @ApiOperation("修改考试结果")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(StudentExamResult examResult){
+        studentExamResultService.updateStudentExamResult(examResult);
+        return succeed();
+    }
+
+    @ApiOperation("考试结果统计信息")
+    @PostMapping(value = "/getStudentExamResultStatisticsInfo")
+    public HttpResponseResult<StudentExamResultStatisticsDto> getStudentExamResultStatisticsInfo(Integer examId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        return succeed(studentExamResultService.getStudentExamResultStatisticsInfo(sysUser.getId(), examId));
+    }
+
+}

+ 28 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java

@@ -1,9 +1,36 @@
 package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
 import com.keao.edu.user.entity.StudentExamResult;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
 
 public interface StudentExamResultDao extends BaseDAO<Long, StudentExamResult> {
 
-	
+    int batchInsert(@Param("results") List<StudentExamResult> results);
+
+    /**
+     * @describe 查询考试结果
+     * @author Joburgess
+     * @date 2020.06.30
+     * @param params:
+     * @return java.util.List<com.keao.edu.user.entity.StudentExamResult>
+     */
+    List<StudentExamResult> queryStudentExamResult(Map<String, Object> params);
+    int countStudentExamResult(Map<String, Object> params);
+
+    /**
+     * @describe 考试结果统计信息
+     * @author Joburgess
+     * @date 2020.06.30
+     * @param organIds:
+     * @param examId:
+     * @return com.keao.edu.user.dto.StudentExamResultStatisticsDto
+     */
+    StudentExamResultStatisticsDto getStudentExamResultStatisticsInfo(@Param("organIds") List<Integer> organIds,
+                                                                      @Param("examId") Integer examId);
+
 }

+ 54 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/StudentExamResultStatisticsDto.java

@@ -0,0 +1,54 @@
+package com.keao.edu.user.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.30
+ */
+public class StudentExamResultStatisticsDto {
+
+    @ApiModelProperty(value = "总招生人数")
+    private int totalRegistrationStudentNum;
+
+    @ApiModelProperty(value = "参考人数")
+    private int examStudentNum;
+
+    @ApiModelProperty(value = "缺考人数")
+    private int notExamStudentNum;
+
+    @ApiModelProperty(value = "不及格人数")
+    private int examFailStudentNum;
+
+    public int getTotalRegistrationStudentNum() {
+        return totalRegistrationStudentNum;
+    }
+
+    public void setTotalRegistrationStudentNum(int totalRegistrationStudentNum) {
+        this.totalRegistrationStudentNum = totalRegistrationStudentNum;
+    }
+
+    public int getExamStudentNum() {
+        return examStudentNum;
+    }
+
+    public void setExamStudentNum(int examStudentNum) {
+        this.examStudentNum = examStudentNum;
+    }
+
+    public int getNotExamStudentNum() {
+        return notExamStudentNum;
+    }
+
+    public void setNotExamStudentNum(int notExamStudentNum) {
+        this.notExamStudentNum = notExamStudentNum;
+    }
+
+    public int getExamFailStudentNum() {
+        return examFailStudentNum;
+    }
+
+    public void setExamFailStudentNum(int examFailStudentNum) {
+        this.examFailStudentNum = examFailStudentNum;
+    }
+}

+ 12 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRegistration.java

@@ -58,6 +58,9 @@ public class ExamRegistration extends Student {
 	@ApiModelProperty(value = "报名状态")
 	private StudentRegistrationStatusEnum status;
 
+	@ApiModelProperty(value = "备注")
+	private String memo;
+
 	private java.util.Date createTime;
 
 	private java.util.Date updateTime;
@@ -215,7 +218,15 @@ public class ExamRegistration extends Student {
 	public String getTenantId(){
 		return this.tenantId;
 	}
-			
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -30,7 +30,7 @@ public class ExamReview {
 	
 	/** 结果 */
 	@ApiModelProperty(value = "结果")
-	private ExamEvaluationResultEnum evaluationResult;
+	private Integer evaluationResult;
 	
 	private java.util.Date createTime;
 	
@@ -92,11 +92,11 @@ public class ExamReview {
 		return this.evaluationContent;
 	}
 
-	public ExamEvaluationResultEnum getEvaluationResult() {
+	public Integer getEvaluationResult() {
 		return evaluationResult;
 	}
 
-	public void setEvaluationResult(ExamEvaluationResultEnum evaluationResult) {
+	public void setEvaluationResult(Integer evaluationResult) {
 		this.evaluationResult = evaluationResult;
 	}
 

+ 36 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamTeacherSalary.java

@@ -5,6 +5,8 @@ import com.keao.edu.user.enums.SettlementTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+
 /**
  * 对应数据库表(exam_teacher_salary):
  */
@@ -27,6 +29,15 @@ public class ExamTeacherSalary {
 	@ApiModelProperty(value = "分润金额")
 	private java.math.BigDecimal shareProfitAmount;
 
+	@ApiModelProperty(value = "总监考次数")
+	private Integer totalInvigilationNum;
+
+	@ApiModelProperty(value = "监考学员数")
+	private Integer totalInvigilationStudentNum;
+
+	@ApiModelProperty(value = "结算费用")
+	private BigDecimal totalSettlementCost;
+
 	private java.util.Date createTime;
 
 	private java.util.Date updateTime;
@@ -80,7 +91,31 @@ public class ExamTeacherSalary {
 	public java.math.BigDecimal getShareProfitAmount(){
 		return this.shareProfitAmount;
 	}
-			
+
+	public Integer getTotalInvigilationNum() {
+		return totalInvigilationNum;
+	}
+
+	public void setTotalInvigilationNum(Integer totalInvigilationNum) {
+		this.totalInvigilationNum = totalInvigilationNum;
+	}
+
+	public Integer getTotalInvigilationStudentNum() {
+		return totalInvigilationStudentNum;
+	}
+
+	public void setTotalInvigilationStudentNum(Integer totalInvigilationStudentNum) {
+		this.totalInvigilationStudentNum = totalInvigilationStudentNum;
+	}
+
+	public BigDecimal getTotalSettlementCost() {
+		return totalSettlementCost;
+	}
+
+	public void setTotalSettlementCost(BigDecimal totalSettlementCost) {
+		this.totalSettlementCost = totalSettlementCost;
+	}
+
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 	}

+ 8 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Organization.java

@@ -54,6 +54,14 @@ public class Organization {
 
 	private SysUser sysUser;
 
+	public Organization() {
+	}
+
+	public Organization(Integer id, String name) {
+		this.id = id;
+		this.name = name;
+	}
+
 	public YesOrNoEnum getIsAllowArrangeExam() {
 		return isAllowArrangeExam;
 	}

+ 66 - 35
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java

@@ -1,5 +1,7 @@
 package com.keao.edu.user.entity;
 
+import com.keao.edu.user.enums.ExamEvaluationResultEnum;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -7,34 +9,39 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
  */
 public class StudentExamResult {
 
-	/**  */
 	private Long id;
 	
-	/**  */
+	@ApiModelProperty(value = "考级项目编号")
 	private Integer examinationBasicId;
 	
-	/**  */
+	@ApiModelProperty(value = "学员编号")
 	private Integer studentId;
+
+	@ApiModelProperty(value = "学员注册信息")
+	private ExamRegistration examRegistration;
+
+	@ApiModelProperty(value = "考试结果")
+	private ExamEvaluationResultEnum result;
+
+	@ApiModelProperty(value = "教师评审均分")
+	private Float avgScore;
+
+	@ApiModelProperty(value = "考试结果确认")
+	private Boolean confirmStatus;
 	
-	/** 考试结果 */
-	private String result;
-	
-	/** 确认状态(1-已确认 0-未确认) */
-	private boolean confirmStatus;
-	
-	/**  */
+	@ApiModelProperty(value = "备注")
 	private String memo;
 	
-	/** 操作人编号 */
+	@ApiModelProperty(value = "操作者")
 	private Integer operatorId;
-	
-	/**  */
+
+	@ApiModelProperty(value = "是否参与考试")
+	private Boolean isFinishedExam;
+
 	private java.util.Date createTime;
-	
-	/**  */
+
 	private java.util.Date updateTime;
-	
-	/**  */
+
 	private String tenantId;
 	
 	public void setId(Long id){
@@ -44,7 +51,23 @@ public class StudentExamResult {
 	public Long getId(){
 		return this.id;
 	}
-			
+
+	public ExamRegistration getExamRegistration() {
+		return examRegistration;
+	}
+
+	public void setExamRegistration(ExamRegistration examRegistration) {
+		this.examRegistration = examRegistration;
+	}
+
+	public Boolean getConfirmStatus() {
+		return confirmStatus;
+	}
+
+	public void setConfirmStatus(Boolean confirmStatus) {
+		this.confirmStatus = confirmStatus;
+	}
+
 	public void setExaminationBasicId(Integer examinationBasicId){
 		this.examinationBasicId = examinationBasicId;
 	}
@@ -60,23 +83,15 @@ public class StudentExamResult {
 	public Integer getStudentId(){
 		return this.studentId;
 	}
-			
-	public void setResult(String result){
-		this.result = result;
-	}
-	
-	public String getResult(){
-		return this.result;
-	}
-			
-	public void setConfirmStatus(boolean confirmStatus){
-		this.confirmStatus = confirmStatus;
+
+	public ExamEvaluationResultEnum getResult() {
+		return result;
 	}
-	
-	public boolean isConfirmStatus(){
-		return this.confirmStatus;
+
+	public void setResult(ExamEvaluationResultEnum result) {
+		this.result = result;
 	}
-			
+
 	public void setMemo(String memo){
 		this.memo = memo;
 	}
@@ -108,7 +123,15 @@ public class StudentExamResult {
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 	}
-			
+
+	public Float getAvgScore() {
+		return avgScore;
+	}
+
+	public void setAvgScore(Float avgScore) {
+		this.avgScore = avgScore;
+	}
+
 	public void setTenantId(String tenantId){
 		this.tenantId = tenantId;
 	}
@@ -116,7 +139,15 @@ public class StudentExamResult {
 	public String getTenantId(){
 		return this.tenantId;
 	}
-			
+
+	public Boolean getIsFinishedExam() {
+		return this.isFinishedExam;
+	}
+
+	public void setIsFinishedExam(Boolean isFinishedExam) {
+		this.isFinishedExam = isFinishedExam;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 36 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Teacher.java

@@ -6,6 +6,8 @@ import com.keao.edu.user.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+
 /**
  * 对应数据库表(teacher):
  */
@@ -28,6 +30,15 @@ public class Teacher {
 
 	@ApiModelProperty(value = "是否删除",required = false)
 	private YesOrNoEnum delFlag;
+
+	@ApiModelProperty(value = "总监考次数")
+	private Integer totalInvigilationNum;
+
+	@ApiModelProperty(value = "监考学员数")
+	private Integer totalInvigilationStudentNum;
+
+	@ApiModelProperty(value = "结算费用")
+	private BigDecimal totalSettlementCost;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -103,7 +114,31 @@ public class Teacher {
 	public java.math.BigDecimal getSalary(){
 		return this.salary;
 	}
-			
+
+	public Integer getTotalInvigilationNum() {
+		return totalInvigilationNum;
+	}
+
+	public void setTotalInvigilationNum(Integer totalInvigilationNum) {
+		this.totalInvigilationNum = totalInvigilationNum;
+	}
+
+	public Integer getTotalInvigilationStudentNum() {
+		return totalInvigilationStudentNum;
+	}
+
+	public void setTotalInvigilationStudentNum(Integer totalInvigilationStudentNum) {
+		this.totalInvigilationStudentNum = totalInvigilationStudentNum;
+	}
+
+	public BigDecimal getTotalSettlementCost() {
+		return totalSettlementCost;
+	}
+
+	public void setTotalSettlementCost(BigDecimal totalSettlementCost) {
+		this.totalSettlementCost = totalSettlementCost;
+	}
+
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 	}

+ 1 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/ExamStatusEnum.java

@@ -13,6 +13,7 @@ public enum ExamStatusEnum implements BaseEnum<String, ExamStatusEnum> {
     APPLIED("APPLIED", "报名结束"),
     EXAM_ING("EXAM_ING", "考试中"),
     EXAM_END("EXAM_END", "考试结束"),
+    RESULT_CONFIRM("RESULT_CONFIRM", "确认考试结果"),
     CLOSE("CLOSE", "关闭");
 
     private String code;

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamMusicTheoryQueryInfo.java

@@ -0,0 +1,22 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+public class ExamMusicTheoryQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "考试项目编号")
+    private Integer examId;
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+}

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamTeacherSalaryQueryInfo.java

@@ -0,0 +1,22 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+public class ExamTeacherSalaryQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "考级编号")
+    private Integer examId;
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+}

+ 60 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/StudentExamResultQueryInfo.java

@@ -0,0 +1,60 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.30
+ */
+public class StudentExamResultQueryInfo extends QueryInfo {
+
+    private Integer organId;
+
+    private Integer examId;
+
+    private String cardNo;
+
+    private Integer subjectId;
+
+    private Integer level;
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+
+    public String getCardNo() {
+        return cardNo;
+    }
+
+    public void setCardNo(String cardNo) {
+        this.cardNo = cardNo;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+}

+ 26 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentExamResultService.java

@@ -1,8 +1,34 @@
 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.dto.StudentExamResultStatisticsDto;
 import com.keao.edu.user.entity.StudentExamResult;
+import com.keao.edu.user.page.StudentExamResultQueryInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface StudentExamResultService extends BaseService<Long, StudentExamResult> {
 
+    /**
+     * @describe 查询考试结果
+     * @author Joburgess
+     * @date 2020.06.30
+     * @param queryInfo:
+     * @return com.keao.edu.common.page.PageInfo<com.keao.edu.user.entity.StudentExamResult>
+     */
+    PageInfo<StudentExamResult> queryStudentExamResult(StudentExamResultQueryInfo queryInfo);
+
+    /**
+     * @describe 更新考试结果
+     * @author Joburgess
+     * @date 2020.06.30
+     * @param studentExamResult:
+     * @return void
+     */
+    void updateStudentExamResult(StudentExamResult studentExamResult);
+
+    StudentExamResultStatisticsDto getStudentExamResultStatisticsInfo(Integer organId, Integer examId);
+
 }

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

@@ -1,11 +1,15 @@
 package com.keao.edu.user.service.impl;
 
+import com.keao.edu.auth.api.client.SysMessageFeignService;
+import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.enums.MessageTypeEnum;
 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.thirdparty.message.MessageSenderPluginContext;
 import com.keao.edu.user.dao.ExamOrganizationRelationDao;
 import com.keao.edu.user.dao.ExaminationBasicDao;
 import com.keao.edu.user.entity.ExamOrganizationRelation;
@@ -41,6 +45,8 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 	private OrganizationService organizationService;
 	@Autowired
 	private ShortUrlService shortUrlService;
+	@Autowired
+	private SysMessageFeignService sysMessageFeignService;
 
 	@Override
 	public BaseDAO<Long, ExamOrganizationRelation> getDAO() {
@@ -133,6 +139,12 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 		for (ExamOrganizationRelation examOrgan : examOrgans) {
 			examOrgan.setUrl(shortUrlService.createShortUrl(""));
 			examOrgan.setSendUrlFlag(YesOrNoEnum.YES);
+
+//			SysUser student = teacherDao.getUser(practiceGroup.getStudentId());
+//			Map<Integer, String> userPhoneMap = new HashMap<>();
+//			userPhoneMap.put(practiceGroup.getStudentId(), student.getPhone());
+//			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.EXAM_REGISTRATION_URL_PUSH,
+//					userPhoneMap, null, 0, null, "STUDENT", groupStartTime, groupEndTime, teacherName, drillTimesOnWeek, firstCourseStartTime);
 		}
 
 		examOrganizationRelationDao.batchUpdate(examOrgans);

+ 16 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -9,8 +9,10 @@ import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.api.entity.ExamRoom;
 import com.keao.edu.user.dao.ExamRoomDao;
 import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
+import com.keao.edu.user.dao.StudentExamResultDao;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
+import com.keao.edu.user.entity.StudentExamResult;
 import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 import com.keao.edu.user.service.ExamRoomStudentRelationService;
@@ -33,6 +35,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	private ExamRoomDao examRoomDao;
 	@Autowired
 	private OrganizationService organizationService;
+	@Autowired
+	private StudentExamResultDao studentExamResultDao;
 
 	@Override
 	public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
@@ -60,6 +64,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		Set<Integer> existStudentIds = studentsWithExamRoom.stream().map(ExamRoomStudentRelation::getStudentId).collect(Collectors.toSet());
 		String[] studentIds = studentIdsStr.split(",");
 		List<ExamRoomStudentRelation> examRoomStudentRelations=new ArrayList<>();
+		List<StudentExamResult> studentExamResults=new ArrayList<>();
 		for (String studentId : studentIds) {
 			if(existStudentIds.contains(Integer.valueOf(studentId))){
 				continue;
@@ -70,10 +75,21 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			e.setStudentId(Integer.valueOf(studentId));
 			e.setTenantId(TenantContextHolder.getTenantId().toString());
 			examRoomStudentRelations.add(e);
+
+			StudentExamResult ser = new StudentExamResult();
+			ser.setExaminationBasicId(examRoom.getExaminationBasicId());
+			ser.setStudentId(Integer.valueOf(studentId));
+			ser.setIsFinishedExam(false);
+			ser.setConfirmStatus(false);
+			ser.setTenantId(TenantContextHolder.getTenantId().toString());
+			studentExamResults.add(ser);
 		}
 		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
 			examRoomStudentRelationDao.batchInsert(examRoomStudentRelations);
 		}
+		if(!CollectionUtils.isEmpty(studentExamResults)){
+			studentExamResultDao.batchInsert(studentExamResults);
+		}
 	}
 
 	@Override

+ 78 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java

@@ -1,22 +1,98 @@
 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.ExaminationBasicDao;
 import com.keao.edu.user.dao.StudentExamResultDao;
+import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
+import com.keao.edu.user.entity.ExaminationBasic;
+import com.keao.edu.user.entity.Organization;
 import com.keao.edu.user.entity.StudentExamResult;
+import com.keao.edu.user.entity.Subject;
+import com.keao.edu.user.enums.ExamStatusEnum;
+import com.keao.edu.user.page.StudentExamResultQueryInfo;
+import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.user.service.StudentExamResultService;
+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 java.util.*;
+import java.util.stream.Collectors;
+
 @Service
 public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentExamResult> implements StudentExamResultService {
-	
+
+	@Autowired
+	private ExaminationBasicDao examinationBasicDao;
 	@Autowired
 	private StudentExamResultDao studentExamResultDao;
+	@Autowired
+	private OrganizationService organizationService;
 
 	@Override
 	public BaseDAO<Long, StudentExamResult> getDAO() {
 		return studentExamResultDao;
 	}
-	
+
+	@Override
+	public PageInfo<StudentExamResult> queryStudentExamResult(StudentExamResultQueryInfo queryInfo) {
+		PageInfo<StudentExamResult> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<Integer> childOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
+		params.put("organIds", childOrganIds);
+
+		List<StudentExamResult> 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> studentIds = dataList.stream().map(StudentExamResult::getStudentId).collect(Collectors.toList());
+			List<Integer> subjectIds = dataList.stream().map(e -> e.getExamRegistration().getSubjectId()).collect(Collectors.toList());
+			List<Integer> organIds = dataList.stream().map(e -> e.getExamRegistration().getOrganId()).collect(Collectors.toList());
+			Map<Integer, String> studentIdNameMap = this.getMap("sys_user", "id_", "real_name_", studentIds, Integer.class, String.class);
+			Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+			Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
+			for (StudentExamResult s : dataList) {
+				s.getExamRegistration().setSysUser(new SysUser(s.getStudentId(), studentIdNameMap.get(s.getStudentId())));
+				s.getExamRegistration().setSubject(new Subject(s.getExamRegistration().getSubjectId(), subjectIdNameMap.get(s.getExamRegistration().getSubjectId())));
+				s.getExamRegistration().setOrganization(new Organization(s.getExamRegistration().getOrganId(), organIdNameMap.get(s.getExamRegistration().getSubjectId())));
+			}
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	public void updateStudentExamResult(StudentExamResult studentExamResult) {
+		if(Objects.isNull(studentExamResult.getId())){
+			throw new BizException("请指定考试结果");
+		}
+		StudentExamResult oldStudentExamResult = studentExamResultDao.get(studentExamResult.getId());
+		if(Objects.isNull(oldStudentExamResult)){
+			throw new BizException("考试结果不存在");
+		}
+		ExaminationBasic examinationBasic = examinationBasicDao.get(studentExamResult.getExaminationBasicId().longValue());
+		if(Objects.isNull(examinationBasic)){
+			throw new BizException("考级项目不存在");
+		}
+		if(ExamStatusEnum.RESULT_CONFIRM.equals(examinationBasic.getStatus())||ExamStatusEnum.CLOSE.equals(examinationBasic.getStatus())){
+			throw new BizException("考试结果不可编辑");
+		}
+		studentExamResultDao.update(studentExamResult);
+	}
+
+	@Override
+	public StudentExamResultStatisticsDto getStudentExamResultStatisticsInfo(Integer organId, Integer examId) {
+		List<Integer> childOrganIds = organizationService.getChildOrganIds(organId, true);
+		StudentExamResultStatisticsDto studentExamResultStatisticsInfo = studentExamResultDao.getStudentExamResultStatisticsInfo(childOrganIds, examId);
+		return studentExamResultStatisticsInfo;
+	}
 }

+ 24 - 17
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamMusicTheoryMapper.xml

@@ -39,22 +39,21 @@
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.user.entity.ExamMusicTheory">
-		UPDATE exam_music_theory <set>
-		<if test="examinationBasicId != null">
-		examination_basic_id_ = #{examinationBasicId},
-		</if>
-		<if test="fee != null">
-		fee_ = #{fee},
-		</if>
-		<if test="tenantId != null">
-		tenant_id_ = #{tenantId},
-		</if>
-		<if test="updateTime != null">
-		update_time_ = #{updateTime},
-		</if>
-		<if test="level != null">
-		level_ = #{level},
-		</if>
+		UPDATE exam_music_theory
+		<set>
+			<if test="examinationBasicId != null">
+				examination_basic_id_ = #{examinationBasicId},
+			</if>
+			<if test="fee != null">
+				fee_ = #{fee},
+			</if>
+			<if test="tenantId != null">
+				tenant_id_ = #{tenantId},
+			</if>
+			<if test="level != null">
+				level_ = #{level},
+			</if>
+				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
 	
@@ -62,10 +61,18 @@
 	<delete id="delete" >
 		DELETE FROM exam_music_theory WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="queryCondition">
+		<where>
+			examination_basic_id_ = #{examId}
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamMusicTheory" parameterType="map">
-		SELECT * FROM exam_music_theory ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM exam_music_theory
+		ORDER BY id_
+		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->

+ 6 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -20,6 +20,7 @@
 		<result column="adviser_phone_" property="adviserPhone" />
 		<result column="card_no_" property="cardNo" />
 		<result column="status_" property="status" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+		<result column="memo_" property="memo" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -39,8 +40,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamRegistration" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO exam_registration (id_,examination_basic_id_,student_id_,organ_id_,subject_id_,level_,song_json_,last_exam_level_,last_exam_certificate_url_,adviser_name_,adviser_phone_,card_no_,status_,create_time_,update_time_,tenant_id_)
-		VALUES(#{id},#{examinationBasicId},#{studentId},#{organId},#{subjectId},#{level},#{songJson},#{lastExamLevel},#{lastExamCertificateUrl},#{adviserName},#{adviserPhone},#{cardNo},#{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(), NOW(),#{tenantId})
+		INSERT INTO exam_registration (id_,examination_basic_id_,student_id_,organ_id_,subject_id_,level_,song_json_,last_exam_level_,last_exam_certificate_url_,adviser_name_,adviser_phone_,card_no_,status_,memo_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{examinationBasicId},#{studentId},#{organId},#{subjectId},#{level},#{songJson},#{lastExamLevel},#{lastExamCertificateUrl},#{adviserName},#{adviserPhone},#{cardNo},#{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{memo},NOW(), NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -89,6 +90,9 @@
 			<if test="status!=null">
 				status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
+			<if test="memo!=null">
+				memo_ = #{memo}
+			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>

+ 26 - 6
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml

@@ -13,6 +13,9 @@
 		<result column="teacher_id_" property="teacherId" />
 		<result column="settlement_type_" property="settlementType" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
 		<result column="share_profit_amount_" property="shareProfitAmount" />
+		<result column="total_invigilation_num_" property="totalInvigilationNum"/>
+		<result column="total_invigilation_student_num_" property="totalInvigilationStudentNum"/>
+		<result column="total_settlement_fee_" property="totalSettlementCost"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -30,8 +33,10 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamTeacherSalary" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO exam_teacher_salary (id_,examination_basic_id_,exam_mode_,teacher_id_,settlement_type_,share_profit_amount_,create_time_,update_time_,tenant_id_)
-		VALUES(#{id},#{examinationBasicId},#{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{teacherId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},NOW(),NOW(),#{tenantId})
+		INSERT INTO exam_teacher_salary (id_,examination_basic_id_,exam_mode_,teacher_id_,settlement_type_,share_profit_amount_,
+		total_invigilation_num_,total_invigilation_student_num_,total_settlement_fee_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{examinationBasicId},#{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{teacherId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},
+		#{totalInvigilationNum},#{totalInvigilationStudentNum},#{totalSettlementCost},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -41,9 +46,6 @@
 			<if test="examinationBasicId != null">
 				examination_basic_id_ = #{examinationBasicId},
 			</if>
-			<if test="id != null">
-				id_ = #{id},
-			</if>
 			<if test="teacherId != null">
 				teacher_id_ = #{teacherId},
 			</if>
@@ -59,6 +61,15 @@
 			<if test="settlementType != null">
 				settlement_type_ = #{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
+			<if test="totalInvigilationNum != null">
+				total_invigilation_num_ = #{totalInvigilationNum},
+			</if>
+			<if test="totalInvigilationStudentNum != null">
+				total_invigilation_student_num_ = #{totalInvigilationStudentNum},
+			</if>
+			<if test="totalSettlementCost != null">
+				total_settlement_fee_ = #{totalSettlementCost},
+			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
@@ -67,14 +78,23 @@
 	<delete id="delete" >
 		DELETE FROM exam_teacher_salary WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="queryPageCondition">
+		<where>
+			examination_basic_id_ = #{examinationBasicId}
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamTeacherSalary" parameterType="map">
-		SELECT * FROM exam_teacher_salary ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM exam_teacher_salary
+		<include refid="queryPageCondition"/>
+		ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM exam_teacher_salary
+		<include refid="queryPageCondition"/>
 	</select>
 </mapper>

+ 4 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExaminationBasicMapper.xml

@@ -151,7 +151,10 @@
 		<where>
 			tenant_id_=#{tenantId}
 			<if test="examStatus!=null">
-				status_=#{examStatus}
+				AND status_=#{examStatus}
+			</if>
+			<if test="search!=null">
+				AND (id_=#{search} OR name_ LIKE CONCAT(#{search}, '%'))
 			</if>
 		</where>
 	</sql>

+ 82 - 8
edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml

@@ -10,13 +10,16 @@
 		<result column="id_" property="id" />
 		<result column="examination_basic_id_" property="examinationBasicId" />
 		<result column="student_id_" property="studentId" />
-		<result column="result_" property="result" />
+		<result column="result_" property="result" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
+		<result column="avg_score_" property="avgScore"/>
 		<result column="confirm_status_" property="confirmStatus" />
+		<result column="is_finished_exam_" property="isFinishedExam" />
 		<result column="memo_" property="memo" />
 		<result column="operator_id_" property="operatorId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
+		<association property="examRegistration" columnPrefix="regist_" resultMap="com.keao.edu.user.dao.ExamRegistrationDao.ExamRegistration"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -31,10 +34,19 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.StudentExamResult" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO student_exam_result (id_,examination_basic_id_,student_id_,result_,confirm_status_,memo_,operator_id_,create_time_,update_time_,tenant_id_)
-		VALUES(#{id},#{examinationBasicId},#{studentId},#{result},#{confirmStatus},#{memo},#{operatorId},NOW(),NOW(),#{tenantId})
+		INSERT INTO student_exam_result (id_,examination_basic_id_,student_id_,result_,avg_score_,confirm_status_,memo_,operator_id_,is_finished_exam_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{examinationBasicId},#{studentId},#{result,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{avgScore},#{confirmStatus},#{memo},#{operatorId},#{isFinishedExam},NOW(),NOW(),#{tenantId})
 	</insert>
-	
+
+	<insert id="batchInsert" parameterType="com.keao.edu.user.entity.StudentExamResult" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO student_exam_result (examination_basic_id_,student_id_,result_,#{avg_score_},confirm_status_,memo_,operator_id_,is_finished_exam_,create_time_,update_time_,tenant_id_)
+		VALUES
+		<foreach collection="results" item="result" separator=",">
+			(#{result.examinationBasicId},#{result.studentId},#{result.result,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			#{result.avgScore},#{result.confirmStatus},#{result.memo},#{result.operatorId},#{result.isFinishedExam},NOW(),NOW(),#{result.tenantId})
+		</foreach>
+	</insert>
+
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.user.entity.StudentExamResult">
 		UPDATE student_exam_result
@@ -45,9 +57,6 @@
 			<if test="operatorId != null">
 				operator_id_ = #{operatorId},
 			</if>
-			<if test="id != null">
-				id_ = #{id},
-			</if>
 			<if test="tenantId != null">
 				tenant_id_ = #{tenantId},
 			</if>
@@ -58,11 +67,17 @@
 				student_id_ = #{studentId},
 			</if>
 			<if test="result != null">
-				result_ = #{result},
+				result_ = #{result,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="avgScore != null">
+				avg_score_ = #{avgScore},
 			</if>
 			<if test="memo != null">
 				memo_ = #{memo},
 			</if>
+			<if test="isFinishedExam != null">
+				is_finished_exam_ = #{isFinishedExam},
+			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
@@ -81,4 +96,63 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM student_exam_result
 	</select>
+
+	<sql id="queryStudentExamResultCondition">
+		<where>
+			er.organ_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
+			<if test="examId!=null">
+				er.examination_basic_id_ = #{examId}
+			</if>
+		</where>
+	</sql>
+
+	<select id="queryStudentExamResult" resultMap="StudentExamResult" parameterType="map">
+		SELECT
+			er.card_no_,
+			er.student_id_,
+			er.organ_id_,
+			er.subject_id_,
+			er.level_,
+			CASE WHEN ser.id_>0 THEN 1 ELSE 0 END,
+			ser.confirm_status_
+		FROM
+			exam_registration er
+			LEFT JOIN student_exam_result ser ON er.examination_basic_id_ = ser.examination_basic_id_
+			AND er.student_id_ = ser.student_id_
+		<include refid="queryStudentExamResultCondition"/>
+		ORDER BY id_ <include refid="global.limit"/>
+	</select>
+
+	<select id="countStudentExamResult" resultType="int">
+		SELECT
+			COUNT(er.id_)
+		FROM
+			exam_registration er
+			LEFT JOIN student_exam_result ser ON er.examination_basic_id_ = ser.examination_basic_id_
+			AND er.student_id_ = ser.student_id_
+		<include refid="queryStudentExamResultCondition"/>
+	</select>
+
+	<select id="getStudentExamResultStatisticsInfo" resultType="com.keao.edu.user.dto.StudentExamResultStatisticsDto">
+		SELECT
+			COUNT( er.id_ ) totalRegistrationStudentNum,
+			SUM( CASE WHEN ser.id_ > 0 THEN 0 ELSE 1 END ) notExamStudentNum,
+			SUM( CASE WHEN ser.result_ = 'FAIL' THEN 1 ELSE 0 END ) examFailStudentNum,
+			SUM( CASE WHEN ser.id_ > 0 THEN 1 ELSE 0 END ) examStudentNum
+		FROM
+			exam_registration er
+			LEFT JOIN student_exam_result ser ON er.examination_basic_id_ = ser.examination_basic_id_
+			AND er.student_id_ = ser.student_id_
+		WHERE
+			er.examination_basic_id_ = #{examId}
+			AND er.organ_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
+		GROUP BY
+			er.examination_basic_id_
+	</select>
 </mapper>

+ 12 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -13,6 +13,9 @@
 		<result column="salary_settlement_type_" property="salarySettlementType" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
 		<result column="salary_" property="salary" />
 		<result column="del_flag_" property="delFlag" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+		<result column="total_invigilation_num_" property="totalInvigilationNum"/>
+		<result column="total_invigilation_student_num_" property="totalInvigilationStudentNum"/>
+		<result column="total_settlement_fee_" property="totalSettlementCost"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -46,6 +49,15 @@
 			<if test="tenantId != null">
 				tenant_id_ = #{tenantId},
 			</if>
+			<if test="totalInvigilationNum != null">
+				total_invigilation_num_ = #{totalInvigilationNum},
+			</if>
+			<if test="totalInvigilationStudentNum != null">
+				total_invigilation_student_num_ = #{totalInvigilationStudentNum},
+			</if>
+			<if test="totalSettlementCost != null">
+				total_settlement_fee_ = #{totalSettlementCost},
+			</if>
 			update_time_ = NOW()
 		</set>
 		WHERE user_id_ = #{userId}