diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java index c33127d..10bfc83 100644 --- a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java +++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java @@ -22,13 +22,17 @@ public class ExamSchedule extends BaseEntity{ /** * 主键ID */ - @TableId(value = "exam_id", type = IdType.ID_WORKER) + @TableId(value = "id", type = IdType.ID_WORKER) @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + @TableField(exist = false) private Long examId; private String examName; private Integer paperId; @TableField(exist = false) private String paperName; + private String industryId; + @TableField(exist = false) private String regulatedIndustry; private String examRegion; @DateTimeFormat( diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java index 6ee97fd..a4349d2 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java @@ -14,4 +14,6 @@ public interface ExamScheduleMapper extends BaseMapper { List selectExamSchedule(Map param); List> getIndustry(); List> getPaper(); + List> getExamParticipation(String examId); + List> getExamAnswerDetails(String examId); } \ No newline at end of file diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java index 28f9019..04c86d3 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java @@ -17,4 +17,6 @@ public interface ExamScheduleService extends BaseService { public int doPublish(List ids); public int doDelete(List ids); public int doCancel(List ids); + public List> getExamParticipation(String examId); + public List> getExamAnswerDetails(String examId); } diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java index 519b60c..997c93b 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java @@ -54,5 +54,11 @@ public class ExamScheduleServiceImpl extends BaseServiceImpl> getExamParticipation(String examId){ + return baseMapper.getExamParticipation(examId); + } + public List> getExamAnswerDetails(String examId){ + return baseMapper.getExamAnswerDetails(examId); + } } diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java index 201e139..54cce90 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java @@ -9,10 +9,7 @@ import com.ccic.safeliab.vo.InsDemoVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @RestController @RequestMapping("/ex/exam-schedule") @@ -23,9 +20,8 @@ public class ExamScheduleController { public R select( @RequestParam(required = false) String examName, @RequestParam(required = false) String paperName, @RequestParam(required = false) String regulatedIndustry, - @RequestParam(required = false) String validDate, - @RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "10") int pageSize) { + @RequestParam(required = false) String validDate + ) { // 模拟数据库查询 List examList = new ArrayList<>(); ExamScheduleVO insDemoVO = new ExamScheduleVO(); @@ -42,26 +38,20 @@ public class ExamScheduleController { result.put("total", examList.size()); return R.ok().data(result); } - @GetMapping("/cancel") - public R cancel(@RequestParam(required = false) String[] ids) { - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); - } - @GetMapping("/publish") - public R publish(@RequestParam(required = false) String[] ids) { - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + @PostMapping("/cancel") + public R cancel(@RequestBody List ids) { + int result = service.doCancel(ids); + return R.ok().data(result); } - @GetMapping("/delete") - public R delete(@RequestParam(required = false) String[] ids) { - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + @PostMapping("/publish") + public R publish(@RequestBody List ids) { + int result = service.doPublish(ids); + return R.ok().data(result); } - @PostMapping("/update") - public R update(@RequestBody ExamScheduleVO examSchedule) { - examSchedule.setPublishStatus(0); - boolean result = service.saveOrUpdate(examSchedule); - return R.ok().data("success."); + @PostMapping("/delete") + public R delete(@RequestBody List ids) { + int result = service.doDelete(ids); + return R.ok().data(result); } @PostMapping("/insert") @@ -70,22 +60,39 @@ public class ExamScheduleController { boolean result = service.saveOrUpdate(examSchedule); return R.ok().data("success."); } + @GetMapping("/getIndustry") public R getIndustry(){ return R.ok().data(service.getIndustry()); } + @GetMapping("/getExamDataById") public R getExamDataById(@RequestParam(required = false) String id){ return R.ok().data(service.getExamDataById(id)); } + @GetMapping("/getPaper") public R getPaper(){ return R.ok().data(service.getPaper()); } - @GetMapping("/show") - public R show() { + @GetMapping("/paperStatusCheck") + public R paperStatusCheck() { + return R.ok().data("success."); + } + + @GetMapping("/paperDeleteCheck") + public R paperDeleteCheck() { return R.ok().data("success."); } + + @GetMapping("/getDetailById") + public R getAnswerStatus(@RequestParam(required = false) String id) { + Map param = new HashMap<>(); + param.put("examParticipation",service.getExamParticipation(id)); + param.put("examAnswer",service.getExamAnswerDetails(id)); + return R.ok().data(param); + } + } diff --git a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml index 2e4c501..af9c94d 100644 --- a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml +++ b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml @@ -3,7 +3,7 @@ + + \ No newline at end of file