|
@@ -0,0 +1,65 @@
|
|
|
+package cn.com.qmth.examcloud.core.examwork.api.provider;
|
|
|
+
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.common.support.exception.StatusException;
|
|
|
+import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.ExamReq;
|
|
|
+import cn.com.qmth.examcloud.service.examwork.entity.Exam;
|
|
|
+import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
|
|
|
+import cn.com.qmth.examcloud.service.examwork.service.ExamService;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author chenken
|
|
|
+ * @date 2018年5月3日 下午2:08:59
|
|
|
+ * @company QMTH
|
|
|
+ * @description ExamProvider.java
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("${url.prefix}/exam")
|
|
|
+public class ExamProvider {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExamService examService;
|
|
|
+ //@RequestBody ExamReq examReq
|
|
|
+ @ApiOperation(value = "新增考试批次", notes = "新增")
|
|
|
+ @GetMapping
|
|
|
+ public void addExam(){
|
|
|
+ if(true){
|
|
|
+ throw new StatusException("EXAMWORK-EXAMEXSTED", "考试名称已存在,请重新填写");
|
|
|
+ }
|
|
|
+ /*Exam exam = new Exam();
|
|
|
+ exam.setName(examReq.getName());
|
|
|
+ exam.setRemark(examReq.getRemark());
|
|
|
+ exam.setDuration(examReq.getDuration());
|
|
|
+ exam.setExamType(ExamType.valueOf(examReq.getExamType()));
|
|
|
+ exam.setBeginTime(examReq.getBeginTime());
|
|
|
+ exam.setEndTime(examReq.getEndTime());
|
|
|
+ //exam.setOrgId(accessUser.getOrgId());
|
|
|
+ exam.setOrgId(109L);
|
|
|
+ //exam.setRootOrgId(accessUser.getRootOrgId());
|
|
|
+ exam.setCreateTime(new Date());
|
|
|
+ exam.setCanStuDel(true);
|
|
|
+ if (!examService.checkExamName(exam)) {
|
|
|
+ throw new StatusException("EXAMWORK-EXAMEXSTED", "考试名称已存在,请重新填写");
|
|
|
+ }
|
|
|
+ examService.insertExam(exam, null);*/
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|