فهرست منبع

增加离线考试批次

宋悦 7 سال پیش
والد
کامیت
21906021be

+ 6 - 2
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamApi.java

@@ -12,6 +12,8 @@ import java.util.stream.Stream;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Sort;
@@ -35,6 +37,8 @@ import cn.com.qmth.examcloud.service.examwork.service.ExamStudentService;
 @RequestMapping("${app.api.root}")
 public class ExamApi {
 
+    private static final Logger log = LoggerFactory.getLogger(ExamApi.class);
+
     @Autowired
     ExamRepo examRepo;
 
@@ -103,7 +107,7 @@ public class ExamApi {
                 errorMap.put("errorMsg","考试名称已存在,请重新填写");
                 return new ResponseEntity(errorMap,HttpStatus.INTERNAL_SERVER_ERROR);
             }
-            return new ResponseEntity(examService.saveExam(exam),HttpStatus.OK);
+            return new ResponseEntity(examService.insertExam(exam,accessUser),HttpStatus.OK);
         }else{
             errorMap.put("errorMsg","accessUser为空");
             return new ResponseEntity(errorMap,HttpStatus.INTERNAL_SERVER_ERROR);
@@ -130,7 +134,7 @@ public class ExamApi {
             examService.deleteExam(examIds);
             return new ResponseEntity(HttpStatus.OK);
         }catch (Exception e){
-            e.printStackTrace();
+            log.error("删除失败:",e);
             return new ResponseEntity(new ErrorMsg(e.getMessage()),HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }

+ 71 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamOrgTimeApi.java

@@ -0,0 +1,71 @@
+package cn.com.qmth.examcloud.service.examwork.api;
+
+import cn.com.qmth.examcloud.common.util.ErrorMsg;
+import cn.com.qmth.examcloud.service.examwork.dao.ExamOrgTimeRepo;
+import cn.com.qmth.examcloud.service.examwork.entity.ExamOrgTime;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 考试服务API
+ * Created by songyue on 17/1/13.
+ */
+@RestController
+@RequestMapping("${app.api.root}")
+public class ExamOrgTimeApi {
+
+    @Autowired
+    ExamOrgTimeRepo examOrgTimeRepo;
+
+    @ApiOperation(value="查询学习中心考试时间",notes = "分页")
+    @GetMapping("/examOrgTime/{examId}/{curPage}/{pageSize}")
+    public ResponseEntity findByExamId(@PathVariable Long examId,
+                                       @PathVariable Integer curPage,
+                                       @PathVariable Integer pageSize){
+        PageRequest pageRequest = new PageRequest(curPage,pageSize);
+        Page<ExamOrgTime> orgTimePage = examOrgTimeRepo.findByExamId(examId,pageRequest);
+    	return new ResponseEntity(orgTimePage, HttpStatus.OK);
+    }
+
+    @ApiOperation(value="查询学习中心考试时间",notes = "不分页")
+    @GetMapping("/examOrgTime/{examId}")
+    public ResponseEntity findByExamId(@PathVariable Long examId){
+        List<ExamOrgTime> orgTimePage = examOrgTimeRepo.findByExamId(examId);
+        return new ResponseEntity(orgTimePage, HttpStatus.OK);
+    }
+
+    @ApiOperation(value="按ID查询学习中心考试时间",notes = "ID查询")
+    @GetMapping("/examOrgTime/{id}")
+    public ResponseEntity findById(@PathVariable Long id){
+        return new ResponseEntity(examOrgTimeRepo.findOne(id),HttpStatus.OK);
+    }
+
+    @ApiOperation(value="新增学习中心考试时间",notes = "新增")
+    @PostMapping("/examOrgTime")
+    public ResponseEntity add(@RequestBody ExamOrgTime examOrgTime){
+        try{
+            return new ResponseEntity(examOrgTimeRepo.save(examOrgTime),HttpStatus.OK);
+        }catch (Exception e){
+            return new ResponseEntity(new ErrorMsg(e.getMessage()),
+                    HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+    @ApiOperation(value="更新学习中心考试时间",notes = "更新")
+    @PutMapping("/examOrgTime")
+    public ResponseEntity update(@RequestBody ExamOrgTime examOrgTime){
+        try{
+            return new ResponseEntity(examOrgTimeRepo.save(examOrgTime),HttpStatus.OK);
+        }catch (Exception e){
+            return new ResponseEntity(new ErrorMsg(e.getMessage()),
+                    HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+    }
+}

+ 23 - 14
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamStudentApi.java

@@ -28,6 +28,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
+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.PageRequest;
@@ -68,6 +70,8 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile;
 @RequestMapping("${app.api.root}/exam_student")
 public class ExamStudentApi {
 
+    private static final Logger log = LoggerFactory.getLogger(ExamStudentApi.class);
+
     @Autowired
     ExamStudentRepo examStudentRepo;
 
@@ -111,7 +115,7 @@ public class ExamStudentApi {
                 examStudent.setOrgId(accessUser.getOrgId());
             }
         } else {
-            return new ResponseEntity(HttpStatus.NOT_FOUND);
+            return new ResponseEntity(new ErrorMsg("无访问权限"),HttpStatus.INTERNAL_SERVER_ERROR);
         }
         return new ResponseEntity(examStudentService.getAllExamStudent(examStudent,
                 new PageRequest(curPage, pageSize,new Sort(Direction.DESC,"id"))), HttpStatus.OK);
@@ -122,15 +126,19 @@ public class ExamStudentApi {
      */
     @ApiOperation(value = "查询重考考生", notes = "查询重考考生")
     @PostMapping("/reexamineStudents/{curPage}/{pageSize}")
-    public ResponseEntity getReexamineStudents(@RequestBody CommonExamStudent examStudentSpecification,@PathVariable Integer curPage,@PathVariable Integer pageSize){
+    public ResponseEntity getReexamineStudents(@RequestBody CommonExamStudent examStudentSpecification,
+                                               @PathVariable Integer curPage,
+                                               @PathVariable Integer pageSize){
     	try{
     		Page<ExamStudent> pageExamStudents = examStudentService.getReexamineStudent(examStudentSpecification, curPage, pageSize);
-    		if(pageExamStudents==null||pageExamStudents.getContent()==null||pageExamStudents.getContent().size()==0){
-    			return new ResponseEntity(new ErrorMsg("无数据",null), HttpStatus.OK);
+    		if(pageExamStudents == null
+                    || pageExamStudents.getContent() == null
+                    || pageExamStudents.getContent().size() == 0){
+    			return new ResponseEntity(new ErrorMsg("无数据"), HttpStatus.OK);
     		}
     		return new ResponseEntity(pageExamStudents,HttpStatus.OK);
     	}catch(Exception e){
-    		e.printStackTrace();
+    	    log.error("调用失败:",e);
     		return new ResponseEntity(new ErrorMsg("调用失败"),HttpStatus.INTERNAL_SERVER_ERROR);
     	}
     }
@@ -174,7 +182,7 @@ public class ExamStudentApi {
             ExamStudent saveExamStu = examStudentService.saveExamStudent(examStudent);
             return new ResponseEntity(saveExamStu, HttpStatus.OK);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("新增失败:",e);
             return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }
@@ -191,14 +199,15 @@ public class ExamStudentApi {
             ExamStudent saveExamStu = examStudentService.saveExamStudent(examStudent);
             return new ResponseEntity(saveExamStu, HttpStatus.OK);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("更新失败:",e);
             return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }
 
     @ApiOperation(value = "更新考试学生缺考状态", notes = "更新缺考")
     @PutMapping("/{id}")
-    public ResponseEntity<ExamStudent> getExamStudentById(@PathVariable Long id, @RequestParam boolean finished) {
+    public ResponseEntity<ExamStudent> getExamStudentById(@PathVariable Long id,
+                                                          @RequestParam boolean finished) {
         ExamStudent examStudent = examStudentRepo.findOne(id);
         examStudent.setFinished(finished);
         //进入考试时,判断考试次数是否小于考试信息(ecs_exam)中的考试次数,如果是,考试次数加一
@@ -212,13 +221,14 @@ public class ExamStudentApi {
     @ApiOperation(value = "按ID删除考试学生", notes = "删除")
     @DeleteMapping("/{id}")
     public ResponseEntity deleteExamStudent(@PathVariable String id) {
-        List<Long> examStuIds = Stream.of(id.split(",")).map(s -> Long.parseLong(s.trim()))
+        List<Long> examStuIds = Stream.of(id.split(","))
+                .map(s -> Long.parseLong(s.trim()))
                 .collect(Collectors.toList());
         try {
             examStudentService.deleteExamStudent(examStuIds);
             return new ResponseEntity(HttpStatus.OK);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("删除失败:",e);
             return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }
@@ -230,7 +240,7 @@ public class ExamStudentApi {
             examStudentService.deleteExamStudents(examId);
             return new ResponseEntity(HttpStatus.OK);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("删除失败:",e);
             return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }
@@ -243,7 +253,7 @@ public class ExamStudentApi {
             List<ExcelError> excelErrors = examStudentService.importExamStudent(examId, new FileInputStream(tempFile));
             return new ResponseEntity(excelErrors, HttpStatus.OK);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("导入失败:",e);
             return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }
@@ -296,7 +306,7 @@ public class ExamStudentApi {
             examStudentService.copyExamStudent(sourceExamId, targetExamId);
             return new ResponseEntity(HttpStatus.OK);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("复制失败:",e);
             return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }
@@ -310,7 +320,6 @@ public class ExamStudentApi {
         Map<String, Integer> result = new HashMap<>();
         result.put("finished", finished);
         result.put("unFinished", unFinished);
-
         return result;
     }
 

+ 52 - 1
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamService.java

@@ -1,10 +1,17 @@
 package cn.com.qmth.examcloud.service.examwork.service;
 
 import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
-import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.startsWith;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
+import cn.com.qmth.examcloud.common.dto.core.Org;
+import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
+import cn.com.qmth.examcloud.service.examwork.dao.ExamOrgTimeRepo;
+import cn.com.qmth.examcloud.service.examwork.entity.ExamOrgTime;
+import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
+import cn.com.qmth.examcloud.service.examwork.service.rpc.OrgService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Example;
 import org.springframework.data.domain.ExampleMatcher;
@@ -16,6 +23,7 @@ import org.springframework.stereotype.Service;
 
 import cn.com.qmth.examcloud.service.examwork.dao.ExamRepo;
 import cn.com.qmth.examcloud.service.examwork.entity.Exam;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 考试批次服务类
@@ -29,6 +37,12 @@ public class ExamService {
     @Autowired
     ExamStudentService examStudentService;
 
+    @Autowired
+    ExamOrgTimeRepo examOrgTimeRepo;
+
+    @Autowired
+    OrgService orgService;
+
     /**
      * 获取所有考试批次(分页)
      * @param examCriteria
@@ -73,15 +87,52 @@ public class ExamService {
         return examRepo.save(exam);
     }
 
+    @Transactional
+    public Exam insertExam(Exam exam, AccessUser accessUser){
+        ExamType examType = exam.getExamType();
+        if(examType == ExamType.OFFLINE){
+            Exam newExam = examRepo.save(exam);
+            insertExamOrgTime(newExam,accessUser);
+            return newExam;
+        }
+        return examRepo.save(exam);
+    }
+
+    /**
+     * 新增学习中心考试时间
+     * @param exam
+     * @param accessUser
+     */
+    private void insertExamOrgTime(Exam exam,AccessUser accessUser){
+        Long examId = exam.getId();
+        Long rootOrgId = accessUser.getRootOrgId();
+        String token = accessUser.getToken();
+        Date beginTime = exam.getBeginTime();
+        Date endTime = exam.getEndTime();
+        List<Org> orgList = orgService.findByParentId(token,rootOrgId);
+        List<ExamOrgTime> examOrgTimes = new ArrayList<>();
+        for(Org org:orgList){
+            Long orgId = org.getId();
+            String orgName = org.getName();
+            ExamOrgTime examOrgTime = new ExamOrgTime(examId,orgId,orgName,beginTime,endTime);
+            examOrgTimes.add(examOrgTime);
+        }
+        examOrgTimeRepo.save(examOrgTimes);
+    }
+
     /**
      * 删除考试批次
      * @param ids
      * @return
      */
+    @Transactional
     public void deleteExam(List<Long> ids)throws Exception{
         List<Exam> exams = examRepo.findByIdIn(ids);
         for(Exam exam:exams){
+            //删除考生
             if(exam.getCanStuDel()){
+                //删除学习中心考试时间
+                examOrgTimeRepo.deleteByExamId(exam.getId());
                 examStudentService.deleteExamStudents(exam.getId());
                 examRepo.delete(exam);
             }else{

+ 50 - 19
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamStudentService.java

@@ -11,6 +11,10 @@ import javax.persistence.criteria.Predicate;
 
 import cn.com.qmth.examcloud.common.util.BeanCopierUtil;
 
+import cn.com.qmth.examcloud.common.util.DateFormat;
+import cn.com.qmth.examcloud.service.examwork.dao.ExamOrgTimeRepo;
+import cn.com.qmth.examcloud.service.examwork.entity.ExamOrgTime;
+import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -81,14 +85,9 @@ public class ExamStudentService {
 	@Autowired
 	SpecialtyService specialtyService;
 
+	@Autowired
+	ExamOrgTimeRepo examOrgTimeRepo;
 
-//    @Value("${app.em.photo.path}")
-//    private String PHOTO_PATH ;
-//    @Value("${app.em.facepp.key}")
-//    private String FACEPP_KEY;
-//    @Value("${app.em.facepp.secret}")
-//    private String FACEPP_SECRET;
-    
     /**
      * 获取所有考试学生(分页)
      * @param examCriteria
@@ -97,14 +96,6 @@ public class ExamStudentService {
      * @return
      */
     public Page<ExamStudent> getAllExamStudent(ExamStudentDTO examCriteria, Pageable pageable){
-//		ExamStudent examStudentSearch = BeanCopierUtil.copyProperties(examCriteria,ExamStudent.class);
-//        ExampleMatcher exampleMatcher = ExampleMatcher.matching()
-//                .withMatcher("name",contains())
-//				.withMatcher("studentCode",contains())
-//				.withMatcher("specialtyName",contains()).withIgnoreNullValues();
-//        Example<ExamStudent> examExamStudentple = Example.of(examStudentSearch, exampleMatcher);
-//		Page<ExamStudent> examStudents = examStudentRepo.findAll(examExamStudentple,pageable);
-//        return examStudents;
     	Specification<ExamStudent> specification = getPageSpecification(examCriteria);
 		Page<ExamStudent> examStudents = examStudentRepo.findAll(specification,pageable);
         return examStudents;
@@ -116,11 +107,50 @@ public class ExamStudentService {
      * @return 
      * @return
      */
-    public  List<ExamStudent> getAllExamStudent(ExamStudentDTO examCriteria){
+    public List<ExamStudent> getAllExamStudent(ExamStudentDTO examCriteria){
     	Specification<ExamStudent> specification = getSpecification(examCriteria);
-        return examStudentRepo.findAll(specification,new Sort(Direction.DESC,"id"));
+		List<ExamStudent> examStudents = examStudentRepo.findAll(specification,new Sort(Direction.DESC,"id"));
+		processExamStudent(examStudents);
+        return examStudents;
     }
 
+	/**
+	 * 处理考生集合(设置学习中心考试时间)
+	 * @param examStudents
+     */
+    private void processExamStudent(List<ExamStudent> examStudents){
+		for(ExamStudent examStudent:examStudents){
+			//设置学习中心考试时间
+			setExamOrgTime(examStudent);
+		}
+	}
+
+	/**
+	 * 设置学习中心考试时间
+	 * @param examStudent
+     */
+	private void setExamOrgTime(ExamStudent examStudent){
+		Exam exam = examStudent.getExam();
+		if(exam != null){
+			if(exam.getExamType() == ExamType.OFFLINE){
+				Long examId = exam.getId();
+				Long orgId = examStudent.getOrgId();
+				ExamOrgTime examOrgTime = examOrgTimeRepo.findFirstByExamIdAndOrgId(examId,orgId);
+				if(examOrgTime != null){
+					String examBeginTime = DateFormat.dateFormat(examOrgTime.getBeginTime());
+					String examEndTime = DateFormat.dateFormat(examOrgTime.getEndTime());
+					examStudent.setExamBeginTime(examBeginTime);
+					examStudent.setExamEndTime(examEndTime);
+				}
+			}else{
+				String examBeginTime = DateFormat.dateFormat(exam.getBeginTime());
+				String examEndTime = DateFormat.dateFormat(exam.getEndTime());
+				examStudent.setExamBeginTime(examBeginTime);
+				examStudent.setExamEndTime(examEndTime);
+			}
+		}
+	}
+
     /**
      * 按考试批次获取学生
      * @param examId
@@ -335,7 +365,8 @@ public class ExamStudentService {
 	/**
 	 * 获取重考考生
 	 * @param examCriteria
-	 * @param pageable
+	 * @param curPage
+	 * @param pageSize
 	 * @return
 	 */
     public Page<ExamStudent> getReexamineStudent(CommonExamStudent examCriteria,Integer curPage,Integer pageSize){
@@ -741,7 +772,7 @@ public class ExamStudentService {
 	
 	/**
 	 * 设置考生重考信息
-	 * @param examStudentId
+	 * @param commonExamStudent
 	 */
 	public void setExamStudentIsReexamine(CommonExamStudent commonExamStudent){
 		if(commonExamStudent.getId() == null){

+ 8 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/OrgService.java

@@ -7,6 +7,8 @@ import cn.com.qmth.examcloud.common.dto.core.Org;
 import cn.com.qmth.examcloud.common.util.GsonUtil;
 import cn.com.qmth.examcloud.service.examwork.service.rpc.client.OrgClient;
 
+import java.util.List;
+
 /**
  * 
  * @author ting.yin
@@ -24,4 +26,10 @@ public class OrgService {
 		return domain;
 	}
 
+	public List<Org> findByParentId(String token,Long orgId) {
+		String json = orgClient.findByParentId(token,orgId);
+		List<Org> orgList = GsonUtil.jsonToArrayList(json, Org.class);
+		return orgList;
+	}
+
 }

+ 5 - 3
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/OrgClient.java

@@ -1,9 +1,7 @@
 package cn.com.qmth.examcloud.service.examwork.service.rpc.client;
 
 import org.springframework.cloud.netflix.feign.FeignClient;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @Description: TODO
@@ -16,4 +14,8 @@ public interface OrgClient {
 	@RequestMapping(method = RequestMethod.GET, value = "${app.api.core}/org")
 	String findByParentIdAndCode(@RequestParam("parentId") Long parentId,@RequestParam("code") String code);
 
+	@RequestMapping(method = RequestMethod.GET, value = "${app.api.core}/org/sub/{parentId}")
+	String findByParentId(@RequestHeader("user_token") String token,
+						  @PathVariable("parentId") Long parentId);
+
 }

+ 27 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamOrgTimeRepo.java

@@ -0,0 +1,27 @@
+package cn.com.qmth.examcloud.service.examwork.dao;
+
+import cn.com.qmth.examcloud.service.examwork.entity.ExamOrgTime;
+import cn.com.qmth.examcloud.service.examwork.entity.ExamStudent;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+public interface ExamOrgTimeRepo extends JpaRepository<ExamOrgTime, Long>, JpaSpecificationExecutor<ExamOrgTime> {
+
+	List<ExamOrgTime> findByExamId(Long examId);
+
+	Page<ExamOrgTime> findByExamId(Long examId, Pageable pageable);
+
+	ExamOrgTime findFirstByExamIdAndOrgId(Long examId,Long orgId);
+
+	@Transactional
+	@Modifying
+	@Query("delete from ExamOrgTime where examId = ?1")
+	void deleteByExamId(Long examId);
+}

+ 102 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamOrgTime.java

@@ -0,0 +1,102 @@
+package cn.com.qmth.examcloud.service.examwork.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 学习中心设置考试时间,只针对离线考试
+ * Created by songyue on 18/2/1.
+ */
+@Entity
+@Table(name = "ecs_exam_org_time")
+public class ExamOrgTime implements Serializable{
+
+    private static final long serialVersionUID = -6957590800607876766L;
+
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @NotNull
+    private Long examId;
+
+    @NotNull
+    private Long orgId;
+
+    @NotNull
+    private String orgName;
+
+    /**
+     * 该学习中心考试开始时间
+     */
+    private Date beginTime;
+
+    /**
+     * 该学习中心考试结束时间
+     */
+    private Date endTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    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 Date getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(Date beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getOrgName() {
+        return orgName;
+    }
+
+    public void setOrgName(String orgName) {
+        this.orgName = orgName;
+    }
+
+    public ExamOrgTime(Long examId, Long orgId, String orgName,Date beginTime, Date endTime) {
+        this.examId = examId;
+        this.orgId = orgId;
+        this.orgName = orgName;
+        this.beginTime = beginTime;
+        this.endTime = endTime;
+    }
+
+    public ExamOrgTime() {
+    }
+}

+ 38 - 1
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamStudent.java

@@ -3,6 +3,8 @@ package cn.com.qmth.examcloud.service.examwork.entity;
 import java.io.Serializable;
 
 import javax.persistence.*;
+import javax.persistence.Id;
+import javax.persistence.Transient;
 import javax.validation.constraints.NotNull;
 
 /**
@@ -133,6 +135,18 @@ public class ExamStudent implements Serializable {
 	 * 重考已完成  true:是 false:否
 	 */
 	private Boolean reexamineCompleted;
+
+	/**
+	 * 考试开始时间(针对学生,网考使用)
+	 */
+	@Transient
+	private String examBeginTime;
+
+	/**
+	 * 考试结束时间(针对学生,网考使用)
+	 */
+	@Transient
+	private String examEndTime;
 	
 	public static long getSerialVersionUID() {
 		return serialVersionUID;
@@ -395,5 +409,28 @@ public class ExamStudent implements Serializable {
 	public void setReexamineCompleted(Boolean reexamineCompleted) {
 		this.reexamineCompleted = reexamineCompleted;
 	}
-	
+
+	public Boolean getReexamine() {
+		return isReexamine;
+	}
+
+	public void setReexamine(Boolean reexamine) {
+		isReexamine = reexamine;
+	}
+
+	public String getExamBeginTime() {
+		return examBeginTime;
+	}
+
+	public void setExamBeginTime(String examBeginTime) {
+		this.examBeginTime = examBeginTime;
+	}
+
+	public String getExamEndTime() {
+		return examEndTime;
+	}
+
+	public void setExamEndTime(String examEndTime) {
+		this.examEndTime = examEndTime;
+	}
 }

+ 6 - 1
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/ExamType.java

@@ -20,5 +20,10 @@ public enum ExamType {
     /**
      * 练习
      */
-    PRACTICE
+    PRACTICE,
+
+    /**
+     * 离线
+     */
+    OFFLINE
 }