|
@@ -0,0 +1,34 @@
|
|
|
+package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.ExamWarnRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamWarnEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.enums.WarnType;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamWarnService;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class ExamWarnServiceImpl implements ExamWarnService {
|
|
|
+
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(ExamWarnServiceImpl.class);
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExamWarnRepo examWarnRepo;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void saveExamWarn(Long examRecordDataId, WarnType warnType) {
|
|
|
+ ExamWarnEntity examWarn = new ExamWarnEntity();
|
|
|
+ examWarn.setExamRecordDataId(examRecordDataId);
|
|
|
+ examWarn.setWarnType(warnType);
|
|
|
+ examWarn.setWarnDetail(warnType.getDescription());
|
|
|
+ examWarn.setCreationTime(new Date());
|
|
|
+ examWarn.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ examWarnRepo.save(examWarn);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|