|
@@ -0,0 +1,57 @@
|
|
|
+package cn.com.qmth.export;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
+
|
|
|
+import org.apache.log4j.LogManager;
|
|
|
+import org.apache.log4j.Logger;
|
|
|
+
|
|
|
+/**moodle按课程导
|
|
|
+ * @author Administrator
|
|
|
+ *
|
|
|
+ */
|
|
|
+public class GkExportPaperByCourseCode3 {
|
|
|
+ private static Logger logger = LogManager.getLogger(GkExportPaperByCourseCode3.class);
|
|
|
+ //试卷后缀
|
|
|
+ private static String paperSuff = "(240407)";
|
|
|
+ //数据库名
|
|
|
+ private static String dbName="guangkai2";
|
|
|
+ private static AtomicInteger count=new AtomicInteger(0);
|
|
|
+
|
|
|
+ private static AtomicInteger valid=new AtomicInteger(0);
|
|
|
+
|
|
|
+ private static AtomicInteger rectify=new AtomicInteger(0);
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ logger.debug("导出开始");
|
|
|
+ Date start=new Date();
|
|
|
+ try {
|
|
|
+ MyProducer pro=new MyProducer();
|
|
|
+ Map<String, Object> param=new HashMap<>();
|
|
|
+ param.put("paperSuff", paperSuff);
|
|
|
+ param.put("dbName", dbName);
|
|
|
+ pro.startDispose(MyConsumer.class, 8, param);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error(e.getCause(), e);
|
|
|
+ }
|
|
|
+ logger.debug("导出结束,纠正:"+rectify);
|
|
|
+ logger.debug("导出结束,舍弃:"+valid);
|
|
|
+ Date end=new Date();
|
|
|
+ logger.debug("导出结束,耗时:"+((end.getTime()-start.getTime())/1000));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void addDisposeCount() {
|
|
|
+ count.addAndGet(1);
|
|
|
+ logger.debug("处理了"+count);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void addRectify() {
|
|
|
+ rectify.addAndGet(1);
|
|
|
+ }
|
|
|
+ public static void addValid() {
|
|
|
+ valid.addAndGet(1);
|
|
|
+ }
|
|
|
+}
|