|
@@ -0,0 +1,41 @@
|
|
|
+package thyyxxk.wxservice_server.controller;
|
|
|
+
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+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 thyyxxk.wxservice_server.config.exception.ExceptionEnum;
|
|
|
+import thyyxxk.wxservice_server.dao.IsolationsDao;
|
|
|
+import thyyxxk.wxservice_server.entity.ResultVo;
|
|
|
+import thyyxxk.wxservice_server.entity.isolations.StudentInspection;
|
|
|
+import thyyxxk.wxservice_server.utils.ResultVoUtil;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description: 独立页面控制器
|
|
|
+ * @author: DingJie
|
|
|
+ * @create: 2021-06-01 16:27:00
|
|
|
+ **/
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@RequestMapping("/isolations")
|
|
|
+public class IsolationsController {
|
|
|
+ private final IsolationsDao dao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public IsolationsController(IsolationsDao dao) {
|
|
|
+ this.dao = dao;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/saveStudentInspection")
|
|
|
+ public ResultVo<String> saveStudentInspection(@RequestBody StudentInspection inspection) {
|
|
|
+ Integer count = dao.selectSameOrderCount(inspection.getIdcard(), inspection.getOrderCode());
|
|
|
+ if (null != count && count > 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您当天已保存过此项目,请勿重复提交。");
|
|
|
+ }
|
|
|
+ dao.insertStudentInspection(inspection);
|
|
|
+ log.info("保存学生体检预约信息:{}", inspection);
|
|
|
+ return ResultVoUtil.success("保存预约信息成功。");
|
|
|
+ }
|
|
|
+}
|