DictionaryTask.java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. package com.dashitech.migration.task.other;
  2. import com.dashitech.migration.BaseTask;
  3. import com.dashitech.migration.core.FieldMapper;
  4. import org.apache.commons.logging.Log;
  5. import org.apache.commons.logging.LogFactory;
  6. import org.springframework.stereotype.Component;
  7. import org.springframework.transaction.annotation.Transactional;
  8. import java.util.HashMap;
  9. import java.util.Map;
  10. /**
  11. * @author song
  12. * @date 2024年10月12日
  13. */
  14. @Component
  15. public class DictionaryTask extends BaseTask {
  16. public static Log log = LogFactory.getLog(DictionaryTask.class);
  17. @Override
  18. @Transactional(rollbackFor = Exception.class)
  19. public void start() {
  20. }
  21. @Override
  22. public FieldMapper loadCache() {
  23. FieldMapper mapper = null;
  24. if ("xiangyang".equals(appName)) {
  25. mapper = loadXiangYangCache();
  26. } else {
  27. mapper = loadNanJingCache();
  28. }
  29. return mapper;
  30. }
  31. private FieldMapper loadXiangYangCache() {
  32. log.info(" *** 加载襄阳字典缓存 *** ");
  33. FieldMapper mapper = new FieldMapper();
  34. Map<Long, Long> dicIdCache = new HashMap<>();
  35. mapper.setIdCache(dicIdCache);
  36. //知识库
  37. dicIdCache.put(71L, 20404L); //待审核
  38. dicIdCache.put(72L, 20405L); //已发布
  39. dicIdCache.put(73L, 20406L); //待整改
  40. dicIdCache.put(74L, 20407L); //已停用
  41. //耗材消耗
  42. dicIdCache.put(1735L, 20557L);//消耗
  43. dicIdCache.put(1736L, 20558L);//撤销
  44. return mapper;
  45. }
  46. private FieldMapper loadNanJingCache() {
  47. log.info(" *** 加载南京字典缓存 *** ");
  48. FieldMapper mapper = new FieldMapper();
  49. Map<Long, Long> idCache = new HashMap<>();
  50. mapper.setIdCache(idCache);
  51. //知识库
  52. idCache.put(71L, 20328L); //待审核
  53. idCache.put(72L, 20329L); //已发布
  54. idCache.put(73L, 20330L); //待整改
  55. idCache.put(74L, 20331L); //已停用
  56. //耗材消耗
  57. idCache.put(1732L, 20475L);//消耗
  58. idCache.put(1733L, 20476L);//撤销
  59. //公司分类
  60. idCache.put(1709L,20309L);
  61. idCache.put(1710L,20311L);
  62. //性别
  63. idCache.put(279L,1609L);
  64. idCache.put(280L,1610L);
  65. //事件-关闭代码
  66. idCache.put(1572L,20419L);
  67. idCache.put(1573L,20420L);
  68. idCache.put(1575L,20421L);
  69. idCache.put(1574L,20422L);
  70. idCache.put(1576L,20422L);
  71. idCache.put(1577L,20422L);
  72. //事件-满意度
  73. idCache.put(1578L,20414L);
  74. idCache.put(1579L,20415L);
  75. idCache.put(1580L,20416L);
  76. idCache.put(1581L,20417L);
  77. idCache.put(1582L,20418L);
  78. //事件-优先级
  79. idCache.put(1560L,5L);
  80. idCache.put(1561L,4L);
  81. idCache.put(1562L,3L);
  82. idCache.put(1563L,2L);
  83. idCache.put(1704L,1L);
  84. //事件-incident_source
  85. idCache.put(1547L,20402L);
  86. idCache.put(1548L,20403L);
  87. idCache.put(1549L,1549L);
  88. idCache.put(1550L,20406L);
  89. idCache.put(1551L,20405L);
  90. idCache.put(1552L,20406L);
  91. idCache.put(1700L,20406L);
  92. idCache.put(1747L,20406L);
  93. //事件-incident_status
  94. idCache.put(1479L,20423L);
  95. idCache.put(1543L,20424L);
  96. idCache.put(1544L,20425L);
  97. idCache.put(1545L,20426L);
  98. idCache.put(1546L,20426L);
  99. idCache.put(1674L,20427L);
  100. idCache.put(1748L,20428L);
  101. idCache.put(1749L,20429L);
  102. idCache.put(1750L,20430L);
  103. //事件-incident_handleresult
  104. idCache.put(1568L,20401L);
  105. idCache.put(1569L,20401L);
  106. idCache.put(1570L,20401L);
  107. idCache.put(1571L,20401L);
  108. //事件-wxincident_degree
  109. idCache.put(1598L,20414L);
  110. idCache.put(1599L,20415L);
  111. idCache.put(1600L,20416L);
  112. idCache.put(1601L,20417L);
  113. idCache.put(1602L,20418L);
  114. //事件日志-incident_log_type
  115. idCache.put(1736L,20435L);
  116. idCache.put(1737L,20436L);
  117. idCache.put(1738L,20437L);
  118. idCache.put(1739L,20438L);
  119. idCache.put(1740L,20439L);
  120. idCache.put(1741L,20440L);
  121. idCache.put(1742L,20441L);
  122. idCache.put(1743L,20442L);
  123. idCache.put(1744L,20443L);
  124. idCache.put(1745L,20444L);
  125. idCache.put(1751L,20445L);
  126. idCache.put(1752L,20446L);
  127. idCache.put(1753L,20447L);
  128. idCache.put(1754L,20448L);
  129. idCache.put(1755L,20449L);
  130. idCache.put(1766L,20450L);
  131. return mapper;
  132. }
  133. }