|
@@ -0,0 +1,60 @@
|
|
|
|
+package cn.com.qmth.examcloud.tool.service.exam_record_audit;
|
|
|
|
+
|
|
|
|
+import cn.com.qmth.examcloud.tool.config.SysProperty;
|
|
|
|
+import cn.com.qmth.examcloud.tool.service.CommonService;
|
|
|
|
+import cn.com.qmth.examcloud.tool.utils.HttpHelper;
|
|
|
|
+import cn.com.qmth.examcloud.tool.vo.user.User;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.HashSet;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Set;
|
|
|
|
+
|
|
|
|
+@Component
|
|
|
|
+public class ExamRecordDataAuditTask {
|
|
|
|
+
|
|
|
|
+ private final static Logger log = LoggerFactory.getLogger(ExamRecordDataAuditTask.class);
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysProperty sysProperty;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private CommonService commonService;
|
|
|
|
+
|
|
|
|
+ public void start(User user) {
|
|
|
|
+ Set<Long> examRecordDataIds = new HashSet<>();
|
|
|
|
+ // examRecordDataIds.add(52801472L);
|
|
|
|
+ // examRecordDataIds.add(52796160L);
|
|
|
|
+ // examRecordDataIds.add(52794061L);
|
|
|
|
+ // examRecordDataIds.add(52791705L);
|
|
|
|
+ // examRecordDataIds.add(52801046L);
|
|
|
|
+ // examRecordDataIds.add(52793413L);
|
|
|
|
+ this.execute(user, examRecordDataIds);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 将某些考试记录重审为违纪
|
|
|
|
+ */
|
|
|
|
+ private void execute(User user, Set<Long> examRecordDataIds) {
|
|
|
|
+ String url = user.getServerUrl() + "/api/ecs_oe_admin/exam/audit/redoAudit";
|
|
|
|
+
|
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
|
+ headers.put("key", user.getKey());
|
|
|
|
+ headers.put("token", user.getToken());
|
|
|
|
+
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
+ params.put("examRecordDataIds", examRecordDataIds);
|
|
|
|
+ params.put("illegallyTypeId", 6L);// 违纪ID,通过页面查询获取
|
|
|
|
+ params.put("disciplineDetail", "sys");// 选填
|
|
|
|
+ params.put("isPass", false);// 审核是否通过
|
|
|
|
+ params.put("skip", true);
|
|
|
|
+
|
|
|
|
+ String result = HttpHelper.post(url, headers, params);
|
|
|
|
+ log.info(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|