Ver Fonte

getReexamineLogList

deason há 11 meses atrás
pai
commit
e2e959b182

+ 33 - 1
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/ReexamineLogController.java

@@ -1,18 +1,30 @@
 
 package cn.com.qmth.examcloud.core.oe.admin.api.controller;
 
+import cn.com.qmth.examcloud.api.commons.enums.DataRuleType;
+import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
+import cn.com.qmth.examcloud.core.oe.admin.base.utils.excel.ExportUtils;
 import cn.com.qmth.examcloud.core.oe.admin.service.ReexamineLogService;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog.ReexamineLogInfo;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog.ReexamineLogQuery;
+import cn.com.qmth.examcloud.web.security.DataRule;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+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 javax.servlet.http.HttpServletResponse;
+
 @RestController
 @Api(tags = "重考设置记录相关接口")
-@RequestMapping("${$rmp.ctr.oe}/exam/warn")
+@RequestMapping("${$rmp.ctr.oe}/reexamine/log")
 public class ReexamineLogController extends ControllerSupport {
 
     private static final Logger log = LoggerFactory.getLogger(ReexamineLogController.class);
@@ -20,5 +32,25 @@ public class ReexamineLogController extends ControllerSupport {
     @Autowired
     private ReexamineLogService reexamineLogService;
 
+    @DataRule(type = {DataRuleType.COURSE, DataRuleType.ORG})
+    @PostMapping("/list")
+    @ApiOperation(value = "查询“重考设置记录”列表(分页)")
+    public Page<ReexamineLogInfo> list(ReexamineLogQuery query) {
+        UserDataRule courseRule = super.getUserDataRule(DataRuleType.COURSE);
+        UserDataRule orgRule = super.getUserDataRule(DataRuleType.ORG);
+        return reexamineLogService.getReexamineLogList(query, courseRule, orgRule);
+    }
+
+    @DataRule(type = {DataRuleType.COURSE, DataRuleType.ORG})
+    @GetMapping("/list/export")
+    @ApiOperation(value = "导出“重考设置记录”列表(Excel)")
+    public void export(ReexamineLogQuery query, HttpServletResponse response) throws Exception {
+        UserDataRule courseRule = super.getUserDataRule(DataRuleType.COURSE);
+        UserDataRule orgRule = super.getUserDataRule(DataRuleType.ORG);
+        query.setByExport(true);
+
+        Page<ReexamineLogInfo> page = reexamineLogService.getReexamineLogList(query, courseRule, orgRule);
+        ExportUtils.exportEXCEL("重考设置记录", ReexamineLogInfo.class, page.getContent(), response);
+    }
 
 }

+ 6 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/ReexamineLogService.java

@@ -1,9 +1,15 @@
 package cn.com.qmth.examcloud.core.oe.admin.service;
 
+import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ReexamineLogEntity;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog.ReexamineLogInfo;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog.ReexamineLogQuery;
+import org.springframework.data.domain.Page;
 
 public interface ReexamineLogService {
 
     void addReexamineLog(ReexamineLogEntity reexamineLog);
 
+    Page<ReexamineLogInfo> getReexamineLogList(ReexamineLogQuery query, UserDataRule courseRule, UserDataRule orgRule);
+
 }

+ 150 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/reexaminelog/ReexamineLogInfo.java

@@ -0,0 +1,150 @@
+package cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+import cn.com.qmth.examcloud.support.excel.ExcelProperty;
+
+import java.util.Date;
+
+public class ReexamineLogInfo implements JsonSerializable {
+
+    private static final long serialVersionUID = -7260035187571848686L;
+
+    private Long examId;
+
+    private Long examStudentId;
+
+    @ExcelProperty(name = "姓名", width = 20, index = 1)
+    private String studentName;
+
+    @ExcelProperty(name = "学号", width = 20, index = 2)
+    private String studentCode;
+
+    @ExcelProperty(name = "证件号", width = 20, index = 3)
+    private String identityNumber;
+
+    private Long orgId;
+
+    @ExcelProperty(name = "学习中心", width = 20, index = 4)
+    private String orgName;
+
+    private Long courseId;
+
+    @ExcelProperty(name = "课程代码", width = 20, index = 5)
+    private String courseCode;
+
+    @ExcelProperty(name = "课程名称", width = 20, index = 6)
+    private String courseName;
+
+    private Long operateUserId;
+
+    @ExcelProperty(name = "操作人", width = 20, index = 7)
+    private String operateUserName;
+
+    @ExcelProperty(name = "操作时间", width = 20, index = 8)
+    private Date creationTime;
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamStudentId() {
+        return examStudentId;
+    }
+
+    public void setExamStudentId(Long examStudentId) {
+        this.examStudentId = examStudentId;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getStudentCode() {
+        return studentCode;
+    }
+
+    public void setStudentCode(String studentCode) {
+        this.studentCode = studentCode;
+    }
+
+    public String getIdentityNumber() {
+        return identityNumber;
+    }
+
+    public void setIdentityNumber(String identityNumber) {
+        this.identityNumber = identityNumber;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public String getOrgName() {
+        return orgName;
+    }
+
+    public void setOrgName(String orgName) {
+        this.orgName = orgName;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public Long getOperateUserId() {
+        return operateUserId;
+    }
+
+    public void setOperateUserId(Long operateUserId) {
+        this.operateUserId = operateUserId;
+    }
+
+    public String getOperateUserName() {
+        return operateUserName;
+    }
+
+    public void setOperateUserName(String operateUserName) {
+        this.operateUserName = operateUserName;
+    }
+
+    public Date getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(Date creationTime) {
+        this.creationTime = creationTime;
+    }
+
+}

+ 87 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/reexaminelog/ReexamineLogQuery.java

@@ -0,0 +1,87 @@
+package cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog;
+
+import cn.com.qmth.examcloud.api.PagerQuery;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel
+public class ReexamineLogQuery extends PagerQuery {
+
+    @ApiModelProperty("考试ID")
+    private Long examId;
+
+    @ApiModelProperty("学习中心ID")
+    private Long orgId;
+
+    @ApiModelProperty("课程ID")
+    private Long courseId;
+
+    @ApiModelProperty("学号")
+    private String studentCode;
+
+    @ApiModelProperty("学生姓名")
+    private String studentName;
+
+    @ApiModelProperty("证件号")
+    private String identityNumber;
+
+    @ApiModelProperty(value = "用于导出", hidden = true)
+    private Boolean byExport;
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public String getStudentCode() {
+        return studentCode;
+    }
+
+    public void setStudentCode(String studentCode) {
+        this.studentCode = studentCode;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getIdentityNumber() {
+        return identityNumber;
+    }
+
+    public void setIdentityNumber(String identityNumber) {
+        this.identityNumber = identityNumber;
+    }
+
+    public Boolean getByExport() {
+        return byExport;
+    }
+
+    public void setByExport(Boolean byExport) {
+        this.byExport = byExport;
+    }
+
+}

+ 20 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ReexamineLogServiceImpl.java

@@ -1,11 +1,18 @@
 package cn.com.qmth.examcloud.core.oe.admin.service.impl;
 
+import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
+import cn.com.qmth.examcloud.core.oe.admin.base.jpa.SpecUtils;
+import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ReexamineLogRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ReexamineLogEntity;
 import cn.com.qmth.examcloud.core.oe.admin.service.ReexamineLogService;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog.ReexamineLogInfo;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.reexaminelog.ReexamineLogQuery;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.stereotype.Service;
 
 @Service
@@ -23,7 +30,19 @@ public class ReexamineLogServiceImpl implements ReexamineLogService {
         }
 
         reexamineLogRepo.save(reexamineLog);
-        log.warn("reexamineLog:{}", reexamineLog);
+        log.warn("重考设置!examId:{} examStudentId:{} {} {}", reexamineLog.getExamId(), reexamineLog.getExamStudentId(),
+                reexamineLog.getReexamineType(), reexamineLog.getReexamineDetail());
+    }
+
+    @Override
+    public Page<ReexamineLogInfo> getReexamineLogList(ReexamineLogQuery query, UserDataRule courseRule, UserDataRule orgRule) {
+        Check.isNull(query, "请求参数不能为空!");
+        Check.isNull(query.getExamId(), "请先选择考试!");
+
+        Pageable pageable = SpecUtils.buildPageable(query.getPageNo(), query.getPageSize());
+        //todo
+
+        return Page.empty(pageable);
     }
 
 }