diff --git a/pom.xml b/pom.xml
index 9b4ea61..5bd2c5b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,6 +102,12 @@
1.18.16
provided
+
+
diff --git a/src/main/java/cn/com/tenlion/controller/api/examination/ExaminationController.java b/src/main/java/cn/com/tenlion/controller/api/examination/ExaminationController.java
new file mode 100644
index 0000000..fb7ebf4
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/controller/api/examination/ExaminationController.java
@@ -0,0 +1,127 @@
+package cn.com.tenlion.controller.api.examination;
+
+import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
+import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
+import cn.com.tenlion.service.examination.IExaminationService;
+import ink.wgink.annotation.CheckRequestBodyAnnotation;
+import ink.wgink.common.base.DefaultBaseController;
+import ink.wgink.interfaces.consts.ISystemConstant;
+import ink.wgink.pojo.ListPage;
+import ink.wgink.pojo.result.ErrorResult;
+import ink.wgink.pojo.result.SuccessResult;
+import ink.wgink.pojo.result.SuccessResultData;
+import ink.wgink.pojo.result.SuccessResultList;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: ExaminationController
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口")
+@RestController
+@RequestMapping(ISystemConstant.API_PREFIX + "/examination")
+public class ExaminationController extends DefaultBaseController {
+
+ @Autowired
+ private IExaminationService examinationService;
+
+ @ApiOperation(value = "新增", notes = "新增接口")
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @PostMapping("save")
+ @CheckRequestBodyAnnotation
+ public SuccessResult save(@RequestBody ExaminationVO examinationVO) {
+ examinationService.save(examinationVO);
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "删除", notes = "删除接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @DeleteMapping("remove/{ids}")
+ public SuccessResult remove(@PathVariable("ids") String ids) {
+ examinationService.remove(Arrays.asList(ids.split("\\_")));
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "修改", notes = "修改接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @PutMapping("update/{examinationId}")
+ @CheckRequestBodyAnnotation
+ public SuccessResult update(@PathVariable("examinationId") String examinationId, @RequestBody ExaminationVO examinationVO) {
+ examinationService.update(examinationId, examinationVO);
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "详情", notes = "详情接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("get/{examinationId}")
+ public ExaminationDTO get(@PathVariable("examinationId") String examinationId) {
+ return examinationService.get(examinationId);
+ }
+
+ @ApiOperation(value = "列表", notes = "列表接口")
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("list")
+ public List list() {
+ Map params = requestParams();
+ return examinationService.list(params);
+ }
+
+ @ApiOperation(value = "分页列表", notes = "分页列表接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
+ @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
+ @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("list-page")
+ public SuccessResultList> listPage(ListPage page) {
+ Map params = requestParams();
+ page.setParams(params);
+ return examinationService.listPage(page);
+ }
+
+ @ApiOperation(value = "统计", notes = "统计接口")
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("count")
+ SuccessResultData count() {
+ Map params = requestParams();
+ return new SuccessResultData<>(examinationService.count(params));
+ }
+
+ @ApiOperation(value = "获取随机监考老师", notes = "获取随机监考老师接口")
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("sel-exam-user")
+ public ExaminationDTO selExamUser() {
+ Map params = requestParams();
+ return examinationService.selExamUser(params);
+ }
+
+ @ApiOperation(value = "获取剩余监考老师", notes = "获取剩余监考老师接口")
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("result-exam-user")
+ public List resultExamUser() {
+ Map params = requestParams();
+ return examinationService.resultExamUser(params);
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/cn/com/tenlion/controller/app/api/examination/ExaminationAppController.java b/src/main/java/cn/com/tenlion/controller/app/api/examination/ExaminationAppController.java
new file mode 100644
index 0000000..df61613
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/controller/app/api/examination/ExaminationAppController.java
@@ -0,0 +1,121 @@
+package cn.com.tenlion.controller.app.api.examination;
+
+import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
+import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
+import cn.com.tenlion.service.examination.IExaminationService;
+import ink.wgink.annotation.CheckRequestBodyAnnotation;
+import ink.wgink.common.base.DefaultBaseController;
+import ink.wgink.interfaces.consts.ISystemConstant;
+import ink.wgink.pojo.ListPage;
+import ink.wgink.pojo.result.ErrorResult;
+import ink.wgink.pojo.result.SuccessResult;
+import ink.wgink.pojo.result.SuccessResultData;
+import ink.wgink.pojo.result.SuccessResultList;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: ExaminationAppController
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "接口")
+@RestController
+@RequestMapping(ISystemConstant.APP_PREFIX + "/examination")
+public class ExaminationAppController extends DefaultBaseController {
+
+ @Autowired
+ private IExaminationService examinationService;
+
+ @ApiOperation(value = "新增", notes = "新增接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "token", value = "token", paramType = "header")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @PostMapping("save")
+ @CheckRequestBodyAnnotation
+ public SuccessResult save(@RequestHeader("token") String token, @RequestBody ExaminationVO examinationVO) {
+ examinationService.save(token, examinationVO);
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "删除(id列表)", notes = "删除(id列表)接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "token", value = "token", paramType = "header"),
+ @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @DeleteMapping("remove/{ids}")
+ public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) {
+ examinationService.remove(token, Arrays.asList(ids.split("\\_")));
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "修改", notes = "修改接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "token", value = "token", paramType = "header"),
+ @ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @PutMapping("updateexamination/{examinationId}")
+ @CheckRequestBodyAnnotation
+ public SuccessResult updateExamination(@RequestHeader("token") String token, @PathVariable("examinationId") String examinationId, @RequestBody ExaminationVO examinationVO) {
+ examinationService.update(token, examinationId, examinationVO);
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "详情(通过ID)", notes = "详情(通过ID)接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "token", value = "token", paramType = "header"),
+ @ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("get/{examinationId}")
+ public ExaminationDTO get(@RequestHeader("token") String token, @PathVariable("examinationId") String examinationId) {
+ return examinationService.get(examinationId);
+ }
+
+ @ApiOperation(value = "列表", notes = "列表接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "token", value = "token", paramType = "header")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("list")
+ public List list(@RequestHeader("token") String token) {
+ Map params = requestParams();
+ return examinationService.list(params);
+ }
+
+ @ApiOperation(value = "分页列表", notes = "分页列表接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "token", value = "token", paramType = "header"),
+ @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
+ @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
+ @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("listpageexamination")
+ public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) {
+ Map params = requestParams();
+ page.setParams(params);
+ return examinationService.listPage(page);
+ }
+
+ @ApiOperation(value = "统计", notes = "统计接口")
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("count")
+ SuccessResultData count() {
+ Map params = requestParams();
+ return new SuccessResultData<>(examinationService.count(params));
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/cn/com/tenlion/controller/resource/examination/ExaminationResourceController.java b/src/main/java/cn/com/tenlion/controller/resource/examination/ExaminationResourceController.java
new file mode 100644
index 0000000..035ded6
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/controller/resource/examination/ExaminationResourceController.java
@@ -0,0 +1,121 @@
+package cn.com.tenlion.controller.resource.examination;
+
+import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
+import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
+import cn.com.tenlion.service.examination.IExaminationService;
+import ink.wgink.annotation.CheckRequestBodyAnnotation;
+import ink.wgink.common.base.DefaultBaseController;
+import ink.wgink.interfaces.consts.ISystemConstant;
+import ink.wgink.pojo.ListPage;
+import ink.wgink.pojo.result.ErrorResult;
+import ink.wgink.pojo.result.SuccessResult;
+import ink.wgink.pojo.result.SuccessResultData;
+import ink.wgink.pojo.result.SuccessResultList;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: ExaminationResourceController
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "接口")
+@RestController
+@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/examination")
+public class ExaminationResourceController extends DefaultBaseController {
+
+ @Autowired
+ private IExaminationService examinationService;
+
+ @ApiOperation(value = "新增", notes = "新增接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @PostMapping("save")
+ @CheckRequestBodyAnnotation
+ public SuccessResult save(@RequestBody ExaminationVO examinationVO) {
+ examinationService.save(examinationVO);
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "删除(id列表)", notes = "删除(id列表)接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
+ @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @DeleteMapping("remove/{ids}")
+ public SuccessResult remove(@PathVariable("ids") String ids) {
+ examinationService.remove(Arrays.asList(ids.split("\\_")));
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "修改", notes = "修改接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
+ @ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @PutMapping("update/{examinationId}")
+ @CheckRequestBodyAnnotation
+ public SuccessResult update(@PathVariable("examinationId") String examinationId, @RequestBody ExaminationVO examinationVO) {
+ examinationService.update(examinationId, examinationVO);
+ return new SuccessResult();
+ }
+
+ @ApiOperation(value = "详情", notes = "详情接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
+ @ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("get/{examinationId}")
+ public ExaminationDTO get(@PathVariable("examinationId") String examinationId) {
+ return examinationService.get(examinationId);
+ }
+
+ @ApiOperation(value = "列表", notes = "列表接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("list")
+ public List list() {
+ Map params = requestParams();
+ return examinationService.list(params);
+ }
+
+ @ApiOperation(value = "分页列表", notes = "分页列表接口")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
+ @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
+ @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
+ @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
+ })
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("listpage")
+ public SuccessResultList> listPage(ListPage page) {
+ Map params = requestParams();
+ page.setParams(params);
+ return examinationService.listPage(page);
+ }
+
+ @ApiOperation(value = "统计", notes = "统计接口")
+ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
+ @GetMapping("count")
+ SuccessResultData count() {
+ Map params = requestParams();
+ return new SuccessResultData<>(examinationService.count(params));
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/cn/com/tenlion/controller/route/examination/ExaminationRouteController.java b/src/main/java/cn/com/tenlion/controller/route/examination/ExaminationRouteController.java
new file mode 100644
index 0000000..9d5c121
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/controller/route/examination/ExaminationRouteController.java
@@ -0,0 +1,36 @@
+package cn.com.tenlion.controller.route.examination;
+
+import ink.wgink.common.base.DefaultBaseController;
+import ink.wgink.interfaces.consts.ISystemConstant;
+import io.swagger.annotations.*;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @ClassName: ExaminationController
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "路由")
+@RestController
+@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/examination")
+public class ExaminationRouteController extends DefaultBaseController {
+
+ @GetMapping("save")
+ public ModelAndView save() {
+ return new ModelAndView("examination/save");
+ }
+
+ @GetMapping("update")
+ public ModelAndView update() {
+ return new ModelAndView("examination/update");
+ }
+
+ @GetMapping("list")
+ public ModelAndView list() {
+ return new ModelAndView("examination/list");
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/cn/com/tenlion/dao/examination/IExaminationDao.java b/src/main/java/cn/com/tenlion/dao/examination/IExaminationDao.java
new file mode 100644
index 0000000..bacde0f
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/dao/examination/IExaminationDao.java
@@ -0,0 +1,150 @@
+package cn.com.tenlion.dao.examination;
+
+import cn.com.tenlion.pojo.bos.examination.ExaminationBO;
+import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
+import cn.com.tenlion.pojo.dtos.examinationhis.ExaminationHisDTO;
+import cn.com.tenlion.pojo.pos.examination.ExaminationPO;
+import ink.wgink.exceptions.RemoveException;
+import ink.wgink.exceptions.SaveException;
+import ink.wgink.exceptions.SearchException;
+import ink.wgink.exceptions.UpdateException;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: IExaminationDao
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@Repository
+public interface IExaminationDao {
+
+ /**
+ * 新增
+ *
+ * @param params
+ * @throws SaveException
+ */
+ void save(Map params) throws SaveException;
+
+ /**
+ * 删除
+ *
+ * @param params
+ * @throws RemoveException
+ */
+ void remove(Map params) throws RemoveException;
+
+ /**
+ * 删除(物理)
+ *
+ * @param params
+ * @throws RemoveException
+ */
+ void delete(Map params) throws RemoveException;
+
+ /**
+ * 修改
+ *
+ * @param params
+ * @throws UpdateException
+ */
+ void update(Map params) throws UpdateException;
+
+ /**
+ * 详情
+ *
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ ExaminationDTO get(Map params) throws SearchException;
+
+ /**
+ * 详情
+ *
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ ExaminationBO getBO(Map params) throws SearchException;
+
+ /**
+ * 详情
+ *
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ ExaminationPO getPO(Map params) throws SearchException;
+
+ /**
+ * 列表
+ *
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ List list(Map params) throws SearchException;
+
+ /**
+ * 列表
+ *
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ List listBO(Map params) throws SearchException;
+
+ /**
+ * 列表
+ *
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ List listPO(Map params) throws SearchException;
+
+ /**
+ * 统计
+ *
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ Integer count(Map params) throws SearchException;
+
+ /**
+ * 判断当天是否存在监考老师信息
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ List hasUser(Map params) throws SearchException;
+
+ /**
+ * 保存监考信息
+ * @param params
+ * @throws SaveException
+ */
+ void saveExamHis(Map params) throws SaveException;
+
+ /**
+ * 当前考试是否存在在监考记录表
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ ExaminationHisDTO hasExam(Map params) throws SearchException;
+
+ /**
+ * 修改监考信息
+ * @param params
+ * @throws SearchException
+ */
+ void updateExamHis(Map params) throws SearchException;
+}
\ No newline at end of file
diff --git a/src/main/java/cn/com/tenlion/pojo/bos/examination/ExaminationBO.java b/src/main/java/cn/com/tenlion/pojo/bos/examination/ExaminationBO.java
new file mode 100644
index 0000000..edec749
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/pojo/bos/examination/ExaminationBO.java
@@ -0,0 +1,96 @@
+package cn.com.tenlion.pojo.bos.examination;
+
+/**
+ *
+ * @ClassName: ExaminationBO
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+public class ExaminationBO {
+
+ private String examinationId;
+ private String name;
+ private String phone;
+ private Integer isCheck;
+ private String gmtCreate;
+ private String creator;
+ private String gmtModified;
+ private String modifier;
+ private Integer isDelete;
+
+ public String getExaminationId() {
+ return examinationId == null ? "" : examinationId.trim();
+ }
+
+ public void setExaminationId(String examinationId) {
+ this.examinationId = examinationId;
+ }
+
+ public String getName() {
+ return name == null ? "" : name.trim();
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone == null ? "" : phone.trim();
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public Integer getIsCheck() {
+ return isCheck == null ? 0 : isCheck;
+ }
+
+ public void setIsCheck(Integer isCheck) {
+ this.isCheck = isCheck;
+ }
+
+ public String getGmtCreate() {
+ return gmtCreate == null ? "" : gmtCreate.trim();
+ }
+
+ public void setGmtCreate(String gmtCreate) {
+ this.gmtCreate = gmtCreate;
+ }
+
+ public String getCreator() {
+ return creator == null ? "" : creator.trim();
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getGmtModified() {
+ return gmtModified == null ? "" : gmtModified.trim();
+ }
+
+ public void setGmtModified(String gmtModified) {
+ this.gmtModified = gmtModified;
+ }
+
+ public String getModifier() {
+ return modifier == null ? "" : modifier.trim();
+ }
+
+ public void setModifier(String modifier) {
+ this.modifier = modifier;
+ }
+
+ public Integer getIsDelete() {
+ return isDelete == null ? 0 : isDelete;
+ }
+
+ public void setIsDelete(Integer isDelete) {
+ this.isDelete = isDelete;
+ }
+
+
+}
diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/examination/ExaminationDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/examination/ExaminationDTO.java
new file mode 100644
index 0000000..0c0e80f
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/pojo/dtos/examination/ExaminationDTO.java
@@ -0,0 +1,109 @@
+package cn.com.tenlion.pojo.dtos.examination;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ *
+ * @ClassName: ExaminationDTO
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@ApiModel
+public class ExaminationDTO {
+
+ @ApiModelProperty(name = "examinationId", value = "主键UUID")
+ private String examinationId;
+ @ApiModelProperty(name = "name", value = "考务人员姓名")
+ private String name;
+ @ApiModelProperty(name = "phone", value = "考务人员联系方式")
+ private String phone;
+ @ApiModelProperty(name = "isCheck", value = "0:未参加监考,1:参加监考")
+ private Integer isCheck;
+ @ApiModelProperty(name = "gmtCreate", value = "")
+ private String gmtCreate;
+ @ApiModelProperty(name = "creator", value = "")
+ private String creator;
+ @ApiModelProperty(name = "gmtModified", value = "")
+ private String gmtModified;
+ @ApiModelProperty(name = "modifier", value = "")
+ private String modifier;
+ @ApiModelProperty(name = "isDelete", value = "")
+ private Integer isDelete;
+
+ public String getExaminationId() {
+ return examinationId == null ? "" : examinationId.trim();
+ }
+
+ public void setExaminationId(String examinationId) {
+ this.examinationId = examinationId;
+ }
+
+ public String getName() {
+ return name == null ? "" : name.trim();
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone == null ? "" : phone.trim();
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public Integer getIsCheck() {
+ return isCheck == null ? 0 : isCheck;
+ }
+
+ public void setIsCheck(Integer isCheck) {
+ this.isCheck = isCheck;
+ }
+
+ public String getGmtCreate() {
+ return gmtCreate == null ? "" : gmtCreate.trim();
+ }
+
+ public void setGmtCreate(String gmtCreate) {
+ this.gmtCreate = gmtCreate;
+ }
+
+ public String getCreator() {
+ return creator == null ? "" : creator.trim();
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getGmtModified() {
+ return gmtModified == null ? "" : gmtModified.trim();
+ }
+
+ public void setGmtModified(String gmtModified) {
+ this.gmtModified = gmtModified;
+ }
+
+ public String getModifier() {
+ return modifier == null ? "" : modifier.trim();
+ }
+
+ public void setModifier(String modifier) {
+ this.modifier = modifier;
+ }
+
+ public Integer getIsDelete() {
+ return isDelete == null ? 0 : isDelete;
+ }
+
+ public void setIsDelete(Integer isDelete) {
+ this.isDelete = isDelete;
+ }
+
+
+}
diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/examinationhis/ExaminationHisDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/examinationhis/ExaminationHisDTO.java
new file mode 100644
index 0000000..b819632
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/pojo/dtos/examinationhis/ExaminationHisDTO.java
@@ -0,0 +1,77 @@
+package cn.com.tenlion.pojo.dtos.examinationhis;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ *
+ * @ClassName: ExaminationHisDTO
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@ApiModel
+public class ExaminationHisDTO {
+
+ @ApiModelProperty(name = "examinationHisId", value = "监考历史表主键ID")
+ private String examinationHisId;
+ @ApiModelProperty(name = "startTime", value = "考试开始时间")
+ private String startTime;
+ @ApiModelProperty(name = "endTime", value = "考试结束时间")
+ private String endTime;
+ @ApiModelProperty(name = "examinationId", value = "监考老师ID")
+ private String examinationId;
+ @ApiModelProperty(name = "examinationRoomId", value = "考场ID")
+ private String examinationRoomId;
+ @ApiModelProperty(name = "examId", value = "考试ID")
+ private String examId;
+
+ public String getExaminationHisId() {
+ return examinationHisId;
+ }
+
+ public void setExaminationHisId(String examinationHisId) {
+ this.examinationHisId = examinationHisId;
+ }
+
+ public String getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(String startTime) {
+ this.startTime = startTime;
+ }
+
+ public String getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(String endTime) {
+ this.endTime = endTime;
+ }
+
+ public String getExaminationId() {
+ return examinationId;
+ }
+
+ public void setExaminationId(String examinationId) {
+ this.examinationId = examinationId;
+ }
+
+ public String getExaminationRoomId() {
+ return examinationRoomId;
+ }
+
+ public void setExaminationRoomId(String examinationRoomId) {
+ this.examinationRoomId = examinationRoomId;
+ }
+
+ public String getExamId() {
+ return examId;
+ }
+
+ public void setExamId(String examId) {
+ this.examId = examId;
+ }
+}
diff --git a/src/main/java/cn/com/tenlion/pojo/pos/examination/ExaminationPO.java b/src/main/java/cn/com/tenlion/pojo/pos/examination/ExaminationPO.java
new file mode 100644
index 0000000..f4784c7
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/pojo/pos/examination/ExaminationPO.java
@@ -0,0 +1,96 @@
+package cn.com.tenlion.pojo.pos.examination;
+
+/**
+ *
+ * @ClassName: ExaminationPO
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+public class ExaminationPO {
+
+ private String examinationId;
+ private String name;
+ private String phone;
+ private Integer isCheck;
+ private String gmtCreate;
+ private String creator;
+ private String gmtModified;
+ private String modifier;
+ private Integer isDelete;
+
+ public String getExaminationId() {
+ return examinationId == null ? "" : examinationId.trim();
+ }
+
+ public void setExaminationId(String examinationId) {
+ this.examinationId = examinationId;
+ }
+
+ public String getName() {
+ return name == null ? "" : name.trim();
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone == null ? "" : phone.trim();
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public Integer getIsCheck() {
+ return isCheck == null ? 0 : isCheck;
+ }
+
+ public void setIsCheck(Integer isCheck) {
+ this.isCheck = isCheck;
+ }
+
+ public String getGmtCreate() {
+ return gmtCreate == null ? "" : gmtCreate.trim();
+ }
+
+ public void setGmtCreate(String gmtCreate) {
+ this.gmtCreate = gmtCreate;
+ }
+
+ public String getCreator() {
+ return creator == null ? "" : creator.trim();
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getGmtModified() {
+ return gmtModified == null ? "" : gmtModified.trim();
+ }
+
+ public void setGmtModified(String gmtModified) {
+ this.gmtModified = gmtModified;
+ }
+
+ public String getModifier() {
+ return modifier == null ? "" : modifier.trim();
+ }
+
+ public void setModifier(String modifier) {
+ this.modifier = modifier;
+ }
+
+ public Integer getIsDelete() {
+ return isDelete == null ? 0 : isDelete;
+ }
+
+ public void setIsDelete(Integer isDelete) {
+ this.isDelete = isDelete;
+ }
+
+
+}
diff --git a/src/main/java/cn/com/tenlion/pojo/vos/examination/ExaminationVO.java b/src/main/java/cn/com/tenlion/pojo/vos/examination/ExaminationVO.java
new file mode 100644
index 0000000..0c9243d
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/pojo/vos/examination/ExaminationVO.java
@@ -0,0 +1,52 @@
+package cn.com.tenlion.pojo.vos.examination;
+
+import ink.wgink.annotation.CheckEmptyAnnotation;
+import ink.wgink.annotation.CheckNumberAnnotation;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ *
+ * @ClassName: ExaminationVO
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@ApiModel
+public class ExaminationVO {
+
+ @ApiModelProperty(name = "name", value = "考务人员姓名")
+ private String name;
+ @ApiModelProperty(name = "phone", value = "考务人员联系方式")
+ private String phone;
+ @ApiModelProperty(name = "isCheck", value = "0:未参加监考,1:参加监考")
+ @CheckNumberAnnotation(name = "0:未参加监考,1:参加监考")
+ private Integer isCheck;
+
+ public String getName() {
+ return name == null ? "" : name.trim();
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone == null ? "" : phone.trim();
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public Integer getIsCheck() {
+ return isCheck == null ? 0 : isCheck;
+ }
+
+ public void setIsCheck(Integer isCheck) {
+ this.isCheck = isCheck;
+ }
+
+
+}
diff --git a/src/main/java/cn/com/tenlion/service/examination/IExaminationService.java b/src/main/java/cn/com/tenlion/service/examination/IExaminationService.java
new file mode 100644
index 0000000..d9fd9c8
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/service/examination/IExaminationService.java
@@ -0,0 +1,204 @@
+package cn.com.tenlion.service.examination;
+
+import cn.com.tenlion.pojo.bos.examination.ExaminationBO;
+import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
+import cn.com.tenlion.pojo.pos.examination.ExaminationPO;
+import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
+import ink.wgink.exceptions.SearchException;
+import ink.wgink.pojo.ListPage;
+import ink.wgink.pojo.result.SuccessResultList;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: IExaminationService
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+public interface IExaminationService {
+
+ /**
+ * 新增
+ *
+ * @param examinationVO
+ * @return
+ */
+ void save(ExaminationVO examinationVO);
+
+ /**
+ * 新增
+ *
+ * @param token
+ * @param examinationVO
+ * @return
+ */
+ void save(String token, ExaminationVO examinationVO);
+
+ /**
+ * 新增
+ *
+ * @param examinationVO
+ * @return examinationId
+ */
+ String saveReturnId(ExaminationVO examinationVO);
+
+ /**
+ * 新增
+ *
+ * @param token
+ * @param examinationVO
+ * @return examinationId
+ */
+ String saveReturnId(String token, ExaminationVO examinationVO);
+
+ /**
+ * 删除
+ *
+ * @param ids id列表
+ * @return
+ */
+ void remove(List ids);
+
+
+ /**
+ * 删除
+ *
+ * @param token
+ * @param ids id列表
+ * @return
+ */
+ void remove(String token, List ids);
+
+ /**
+ * 删除(物理删除)
+ *
+ * @param ids id列表
+ */
+ void delete(List ids);
+
+ /**
+ * 修改
+ *
+ * @param examinationId
+ * @param examinationVO
+ * @return
+ */
+ void update(String examinationId, ExaminationVO examinationVO);
+
+ /**
+ * 修改
+ *
+ * @param token
+ * @param examinationId
+ * @param examinationVO
+ * @return
+ */
+ void update(String token, String examinationId, ExaminationVO examinationVO);
+
+ /**
+ * 详情
+ *
+ * @param params 参数Map
+ * @return
+ */
+ ExaminationDTO get(Map params);
+
+ /**
+ * 详情
+ *
+ * @param examinationId
+ * @return
+ */
+ ExaminationDTO get(String examinationId);
+
+ /**
+ * 详情
+ *
+ * @param params 参数Map
+ * @return
+ */
+ ExaminationBO getBO(Map params);
+
+ /**
+ * 详情
+ *
+ * @param examinationId
+ * @return
+ */
+ ExaminationBO getBO(String examinationId);
+
+ /**
+ * 详情
+ *
+ * @param params 参数Map
+ * @return
+ */
+ ExaminationPO getPO(Map params);
+
+ /**
+ * 详情
+ *
+ * @param examinationId
+ * @return
+ */
+ ExaminationPO getPO(String examinationId);
+
+ /**
+ * 列表
+ *
+ * @param params
+ * @return
+ */
+ List list(Map params);
+
+ /**
+ * 列表
+ *
+ * @param params
+ * @return
+ */
+ List listBO(Map params);
+
+ /**
+ * 列表
+ *
+ * @param params
+ * @return
+ */
+ List listPO(Map params);
+
+ /**
+ * 分页列表
+ *
+ * @param page
+ * @return
+ */
+ SuccessResultList> listPage(ListPage page);
+
+ /**
+ * 统计
+ *
+ * @param params
+ * @return
+ */
+ Integer count(Map params);
+
+ /**
+ * 获取随机监考老师
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ ExaminationDTO selExamUser(Map params) throws SearchException;
+
+ /**
+ * 获取剩余监考老师列表
+ * @param params
+ * @return
+ * @throws SearchException
+ */
+ List resultExamUser(Map params) throws SearchException;
+}
\ No newline at end of file
diff --git a/src/main/java/cn/com/tenlion/service/examination/impl/ExaminationServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/impl/ExaminationServiceImpl.java
new file mode 100644
index 0000000..3623362
--- /dev/null
+++ b/src/main/java/cn/com/tenlion/service/examination/impl/ExaminationServiceImpl.java
@@ -0,0 +1,298 @@
+package cn.com.tenlion.service.examination.impl;
+
+import cn.com.tenlion.dao.examination.IExaminationDao;
+import cn.com.tenlion.pojo.bos.examination.ExaminationBO;
+import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
+import cn.com.tenlion.pojo.dtos.examinationhis.ExaminationHisDTO;
+import cn.com.tenlion.pojo.pos.examination.ExaminationPO;
+import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
+import cn.com.tenlion.service.examination.IExaminationService;
+import ink.wgink.common.base.DefaultBaseService;
+import ink.wgink.exceptions.SearchException;
+import ink.wgink.pojo.ListPage;
+import ink.wgink.pojo.result.SuccessResultList;
+import ink.wgink.util.map.HashMapUtil;
+import ink.wgink.util.UUIDUtil;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * @ClassName: ExaminationServiceImpl
+ * @Description:
+ * @Author: CodeFactory
+ * @Date: 2021-05-01 15:16:57
+ * @Version: 3.0
+ **/
+@Service
+public class ExaminationServiceImpl extends DefaultBaseService implements IExaminationService {
+
+ @Autowired
+ private IExaminationDao examinationDao;
+
+ @Override
+ public void save(ExaminationVO examinationVO) {
+ saveReturnId(examinationVO);
+ }
+
+ @Override
+ public void save(String token, ExaminationVO examinationVO) {
+ saveReturnId(token, examinationVO);
+ }
+
+ @Override
+ public String saveReturnId(ExaminationVO examinationVO) {
+ return saveReturnId(null, examinationVO);
+ }
+
+ @Override
+ public String saveReturnId(String token, ExaminationVO examinationVO) {
+ String examinationId = UUIDUtil.getUUID();
+ Map params = HashMapUtil.beanToMap(examinationVO);
+ params.put("examinationId", examinationId);
+ if (StringUtils.isBlank(token)) {
+ setSaveInfo(params);
+ } else {
+ setAppSaveInfo(token, params);
+ }
+ examinationDao.save(params);
+ return examinationId;
+ }
+
+ @Override
+ public void remove(List ids) {
+ remove(null, ids);
+ }
+
+ @Override
+ public void remove(String token, List ids) {
+ Map params = getHashMap(2);
+ params.put("examinationIds", ids);
+ if (StringUtils.isBlank(token)) {
+ setUpdateInfo(params);
+ } else {
+ setAppUpdateInfo(token, params);
+ }
+ examinationDao.remove(params);
+ }
+
+ @Override
+ public void delete(List ids) {
+ Map params = getHashMap(2);
+ params.put("examinationIds", ids);
+ examinationDao.delete(params);
+ }
+
+ @Override
+ public void update(String examinationId, ExaminationVO examinationVO) {
+ update(null, examinationId, examinationVO);
+ }
+
+ @Override
+ public void update(String token, String examinationId, ExaminationVO examinationVO) {
+ Map params = HashMapUtil.beanToMap(examinationVO);
+ params.put("examinationId", examinationId);
+ if (StringUtils.isBlank(token)) {
+ setUpdateInfo(params);
+ } else {
+ setAppUpdateInfo(token, params);
+ }
+ examinationDao.update(params);
+ }
+
+ @Override
+ public ExaminationDTO get(Map params) {
+ return examinationDao.get(params);
+ }
+
+ @Override
+ public ExaminationDTO get(String examinationId) {
+ Map params = super.getHashMap(2);
+ params.put("examinationId", examinationId);
+ return get(params);
+ }
+
+ @Override
+ public ExaminationBO getBO(Map params) {
+ return examinationDao.getBO(params);
+ }
+
+ @Override
+ public ExaminationBO getBO(String examinationId) {
+ Map params = super.getHashMap(2);
+ params.put("examinationId", examinationId);
+ return getBO(params);
+ }
+
+ @Override
+ public ExaminationPO getPO(Map params) {
+ return examinationDao.getPO(params);
+ }
+
+ @Override
+ public ExaminationPO getPO(String examinationId) {
+ Map params = super.getHashMap(2);
+ params.put("examinationId", examinationId);
+ return getPO(params);
+ }
+
+ @Override
+ public List list(Map params) {
+ return examinationDao.list(params);
+ }
+
+ @Override
+ public List listBO(Map params) {
+ return examinationDao.listBO(params);
+ }
+
+ @Override
+ public List listPO(Map params) {
+ return examinationDao.listPO(params);
+ }
+
+ @Override
+ public SuccessResultList> listPage(ListPage page) {
+ PageHelper.startPage(page.getPage(), page.getRows());
+ List examinationDTOs = list(page.getParams());
+ PageInfo pageInfo = new PageInfo<>(examinationDTOs);
+ return new SuccessResultList<>(examinationDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
+ }
+
+ @Override
+ public Integer count(Map params) {
+ Integer count = examinationDao.count(params);
+ return count == null ? 0 : count;
+ }
+
+ @Override
+ public ExaminationDTO selExamUser(Map params) throws SearchException {
+ if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("startTime"))) {
+ throw new SearchException("请传入考试开始时间");
+ }
+ if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("endTime"))) {
+ throw new SearchException("请传入考试结束时间");
+ }
+ if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("examinationRoomId"))) {
+ throw new SearchException("请传入考场ID");
+ }
+ if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("examId"))) {
+ throw new SearchException("请传入考试ID");
+ }
+ // 判断当前考试是否存在在监考记录表中,存在,获取监考老师信息,后续做修改操作,否则,做新增操作
+ ExaminationHisDTO examinationHisDTO = examinationDao.hasExam(params);
+ // 先获取所有考务人员
+ List examinationDTOList = list(params);
+ if(null != examinationDTOList && examinationDTOList.size() > 0) {
+ // 获取考试日期(精确到天)
+ String startDay = params.get("startTime").toString();
+ startDay = startDay.substring(0, 10);
+ params.put("startDay", startDay);
+ int randomNum = (int)(Math.random() * examinationDTOList.size());
+ ExaminationDTO examinationDTO = examinationDTOList.get(randomNum);
+ params.put("startDay", startDay);
+ params.put("examinationId", examinationDTO.getExaminationId());
+ if(null != examinationHisDTO) {
+ if(examinationHisDTO.getExaminationId().equals(examinationDTO.getExaminationId())) {
+ examinationDTO = removeAndReturnUser(randomNum, examinationDTO, examinationDTOList);
+ params.put("examinationId", examinationDTO.getExaminationId());
+ return updateLogic(randomNum, examinationDTO, examinationDTOList, params);
+ }
+ return updateLogic(randomNum, examinationDTO, examinationDTOList, params);
+ }
+ return insertLogic(randomNum, examinationDTO, examinationDTOList, params);
+ }
+ throw new SearchException("暂无考务人员数据");
+ }
+
+ @Override
+ public List resultExamUser(Map params) throws SearchException {
+ if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("startTime"))) {
+ throw new SearchException("请传入考试开始时间");
+ }
+ // 先获取所有考务人员
+ List examinationDTOList = list(params);
+ if(null == examinationDTOList) {
+ return new ArrayList<>();
+ }
+ // 获取考试日期(精确到天)
+ String startDay = params.get("startTime").toString();
+ startDay = startDay.substring(0, 10);
+ params.put("startDay", startDay);
+ List examinationHisDTOList = examinationDao.hasUser(params);
+ if(null == examinationHisDTOList) {
+ return examinationDTOList;
+ }
+ Iterator iterator = examinationDTOList.iterator();
+ while (iterator.hasNext()) {
+ ExaminationDTO examinationDTO = iterator.next();
+ for(ExaminationHisDTO examinationHisDTO: examinationHisDTOList) {
+ if(examinationDTO.getExaminationId().equals(examinationHisDTO.getExaminationId())) {
+ iterator.remove();
+ System.out.println(44);
+ }
+ }
+ }
+ return examinationDTOList;
+ }
+
+ /**
+ * 判断当天是否存在该考务人员的监考记录
+ * @param params
+ * @return
+ */
+ private Integer hasUser(Map params) {
+ List examinationHisDTOList = examinationDao.hasUser(params);
+ Integer count = 0;
+ if(null != examinationHisDTOList && examinationHisDTOList.size() > 0) {
+ count = examinationHisDTOList.size();
+ }
+ return count;
+ }
+
+ /**
+ * 移除不满足条件人员并重新选择
+ * @return
+ */
+ private ExaminationDTO removeAndReturnUser(Integer randomNum, ExaminationDTO examinationDTO, List examinationDTOList) {
+ examinationDTOList.remove(randomNum);
+ randomNum = (int)(Math.random() * examinationDTOList.size());
+ examinationDTO = examinationDTOList.get(randomNum);
+ return examinationDTO;
+ }
+
+ private ExaminationDTO updateLogic(Integer randomNum, ExaminationDTO examinationDTO, List examinationDTOList, Map params) {
+ Integer count = hasUser(params);
+ if(count > 0) {
+ examinationDTO = removeAndReturnUser(randomNum, examinationDTO, examinationDTOList);
+ params.put("examinationId", examinationDTO.getExaminationId());
+ return updateLogic(randomNum, examinationDTO, examinationDTOList, params);
+ }else {
+ params.put("examinationId", examinationDTO.getExaminationId());
+ setUpdateInfo(params);
+ examinationDao.updateExamHis(params);
+ return examinationDTO;
+ }
+ }
+
+ private ExaminationDTO insertLogic(Integer randomNum, ExaminationDTO examinationDTO, List examinationDTOList, Map params) {
+ Integer count = hasUser(params);
+ if(count > 0) {
+ examinationDTO = removeAndReturnUser(randomNum, examinationDTO, examinationDTOList);
+ params.put("examinationId", examinationDTO.getExaminationId());
+ return insertLogic(randomNum, examinationDTO, examinationDTOList, params);
+ }else {
+ String examinationHisId = UUIDUtil.getUUID();
+ params.put("examinationHisId", examinationHisId);
+ params.put("examinationId", examinationDTO.getExaminationId());
+ setSaveInfo(params);
+ examinationDao.saveExamHis(params);
+ return examinationDTO;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 32bc037..e92c4d6 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,6 +1,6 @@
server:
- port: 7009
- url: http://127.0.0.1:7009/signup
+ port: 8089
+ url: http://192.168.0.111:8089/signup
system-title: 考试报名系统
system-sub-title: 考试报名系统
servlet:
@@ -25,11 +25,11 @@ spring:
max-request-size: 1GB
datasource:
druid:
- url: jdbc:mysql://127.0.0.1:3306/db_examination_signup?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC
+ url: jdbc:mysql://49.232.216.45:3306/db_module_building_pictures?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC
db-type: mysql
driver-class-name: com.mysql.cj.jdbc.Driver
- username: root
- password: root
+ username: renpengcheng
+ password: tsrenpengcheng
initial-size: 2
min-idle: 2
max-active: 5
diff --git a/src/main/resources/mybatis/mapper/examination/examination-mapper.xml b/src/main/resources/mybatis/mapper/examination/examination-mapper.xml
new file mode 100644
index 0000000..adec605
--- /dev/null
+++ b/src/main/resources/mybatis/mapper/examination/examination-mapper.xml
@@ -0,0 +1,383 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO emergency_examination(
+ examination_id,
+ name,
+ phone,
+ is_check,
+ gmt_create,
+ creator,
+ gmt_modified,
+ modifier,
+ is_delete
+ ) VALUES(
+ #{examinationId},
+ #{name},
+ #{phone},
+ #{isCheck},
+ #{gmtCreate},
+ #{creator},
+ #{gmtModified},
+ #{modifier},
+ #{isDelete}
+ )
+
+
+
+
+ UPDATE
+ emergency_examination
+ SET
+ gmt_modified = #{gmtModified},
+ modifier = #{modifier},
+ is_delete = 1
+ WHERE
+ examination_id IN
+
+ #{examinationIds[${index}]}
+
+
+
+
+
+ DELETE FROM
+ emergency_examination
+ WHERE
+ examination_id IN
+
+ #{examinationIds[${index}]}
+
+
+
+
+
+ UPDATE
+ emergency_examination
+ SET
+
+ name = #{name},
+
+
+ phone = #{phone},
+
+
+ is_check = #{isCheck},
+
+ gmt_modified = #{gmtModified},
+ modifier = #{modifier},
+ examination_id = examination_id
+ WHERE
+ examination_id = #{examinationId}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO emergency_examination_his (
+ examination_his_id,
+ start_time,
+ end_time,
+ examination_id,
+ examination_room_id,
+ exam_id,
+ gmt_create,
+ creator,
+ gmt_modified,
+ modifier,
+ is_delete
+ )
+ VALUES
+ (
+ #{examinationHisId},
+ #{startTime},
+ #{endTime},
+ #{examinationId},
+ #{examinationRoomId},
+ #{examId},
+ #{gmtCreate},
+ #{creator},
+ #{gmtModified},
+ #{modifier},
+ #{isDelete}
+ )
+
+
+
+
+ UPDATE emergency_examination_his
+ SET examination_id = #{examinationId},
+ gmt_modified = #{gmtModified},
+ modifier = #{modifier}
+ WHERE
+ is_delete = 0
+ AND exam_id = #{examId}
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/static/route/examination/list.html b/src/main/resources/static/route/examination/list.html
new file mode 100644
index 0000000..dba9dd8
--- /dev/null
+++ b/src/main/resources/static/route/examination/list.html
@@ -0,0 +1,340 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/static/route/examination/save.html b/src/main/resources/static/route/examination/save.html
new file mode 100644
index 0000000..720a98a
--- /dev/null
+++ b/src/main/resources/static/route/examination/save.html
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/static/route/examination/update.html b/src/main/resources/static/route/examination/update.html
new file mode 100644
index 0000000..7d47f04
--- /dev/null
+++ b/src/main/resources/static/route/examination/update.html
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file