You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.4 KiB

package com.ccic.safeliab.web;
import com.ccic.safeliab.entity.ExamSchedule;
import com.ccic.safeliab.service.ExamScheduleService;
import com.ccic.safeliab.support.Condition;
import com.ccic.safeliab.util.R;
import com.ccic.safeliab.vo.ExamScheduleVO;
import com.ccic.safeliab.vo.InsDemoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@RestController
@RequestMapping("/ex/exam-schedule")
public class ExamScheduleController {
@Autowired
private ExamScheduleService service;
@GetMapping("/select")
public R select(@RequestParam(required = false) String examName,
@RequestParam(required = false) String paperName,
@RequestParam(required = false) String regulatedIndustry,
@RequestParam(required = false) String validDate
) {
Map<String, Object> param = new HashMap<>();
param.put("examName", examName);
param.put("paperName", paperName);
param.put("regulatedIndustry", regulatedIndustry);
param.put("date", validDate);
List<ExamSchedule> examList = service.selectExamSchedule(param);
Map<Object, Object> result = new HashMap<>();
result.put("data", examList);
result.put("total", examList.size());
return R.ok().data(result);
}
@PostMapping("/cancel")
public R cancel(@RequestBody List<String> ids) {
int result = service.doCancel(ids);
return R.ok().data(result);
}
@PostMapping("/publish")
public R publish(@RequestBody List<String> ids) {
int result = service.doPublish(ids);
return R.ok().data(result);
}
@PostMapping("/delete")
public R delete(@RequestBody List<Long> ids) {
int result = service.doDelete(ids);
return R.ok().data(result);
}
@PostMapping("/save")
public R save(@RequestBody ExamScheduleVO examSchedule) {
examSchedule.setPublishStatus(0);
return R.ok().data(service.saveOrUpdate(examSchedule));
}
@PostMapping("/saveQrCode")
public R saveQrCode(@RequestBody ExamScheduleVO examSchedule) {
ExamScheduleVO examScheduleVO = new ExamScheduleVO();
examScheduleVO.setCaptcha(examSchedule.getCaptcha());
examScheduleVO.setPath(examSchedule.getPath());
examSchedule.setId(examSchedule.getId());
return R.ok().data(service.saveOrUpdate(examScheduleVO));
}
@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("/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<String, Object> param = new HashMap<>();
param.put("examParticipation", service.getExamParticipation(id));
param.put("examAnswer", service.getExamAnswerDetails(id));
return R.ok().data(param);
}
}