|
@@ -0,0 +1,55 @@
|
|
1
|
+package com.dashitech.migration.task.other;
|
|
2
|
+
|
|
3
|
+import com.dashitech.migration.BaseTask;
|
|
4
|
+import com.dashitech.migration.SqlTask;
|
|
5
|
+import com.dashitech.migration.core.FieldMapper;
|
|
6
|
+import com.dashitech.migration.util.JdbcUtil;
|
|
7
|
+import org.apache.commons.logging.Log;
|
|
8
|
+import org.apache.commons.logging.LogFactory;
|
|
9
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
10
|
+import org.springframework.stereotype.Component;
|
|
11
|
+import org.springframework.transaction.annotation.Transactional;
|
|
12
|
+
|
|
13
|
+import java.util.List;
|
|
14
|
+import java.util.Map;
|
|
15
|
+
|
|
16
|
+/**
|
|
17
|
+ * Created by CX on 2024/10/10.
|
|
18
|
+ */
|
|
19
|
+@Component
|
|
20
|
+public class OpLogTask extends BaseTask {
|
|
21
|
+
|
|
22
|
+ public static Log log = LogFactory.getLog(OpLogTask.class);
|
|
23
|
+
|
|
24
|
+ @Autowired
|
|
25
|
+ SqlTask dictionaryTask;
|
|
26
|
+
|
|
27
|
+ @Override
|
|
28
|
+ @Transactional(rollbackFor = Exception.class)
|
|
29
|
+ public void start() {
|
|
30
|
+ log.info(" *** TokenTask start开始 *** ");
|
|
31
|
+ StringBuffer sql = new StringBuffer("select * from itsm_base_operation_log where op_type = 'handlerLog' ");
|
|
32
|
+ List<Map<String, Object>> tokenList = jdbcTemplateMdv2.queryForList(sql.toString());
|
|
33
|
+
|
|
34
|
+ FieldMapper mapper = new FieldMapper();
|
|
35
|
+ mapper.addOperationRemove("id").addOperationRemove("repair_type").addOperationRemove("expected_day");
|
|
36
|
+ mapper.addOperationUpdate("hos_id", "branch_id");
|
|
37
|
+ mapper.trans2JdbcRow(tokenList);
|
|
38
|
+
|
|
39
|
+ JdbcUtil jdbcUtil = new JdbcUtil(jdbcTemplateHsms);
|
|
40
|
+ jdbcUtil.batchPageInsert("itsm_base_operation_log", mapper.getRows());
|
|
41
|
+
|
|
42
|
+ //clear释放内存
|
|
43
|
+ mapper.clear();
|
|
44
|
+ }
|
|
45
|
+
|
|
46
|
+ @Override
|
|
47
|
+ public FieldMapper loadCache() {
|
|
48
|
+ log.info(" *** AttachmentTask loadCache开始 *** ");
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+ return null;
|
|
52
|
+ }
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+}
|