123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- package com.dashitech.migration.task.other;
- import com.dashitech.migration.BaseTask;
- import com.dashitech.migration.core.FieldMapper;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- import org.springframework.stereotype.Component;
- import org.springframework.transaction.annotation.Transactional;
- import java.util.HashMap;
- import java.util.Map;
- /**
- * @author song
- * @date 2024年10月12日
- */
- @Component
- public class DictionaryTask extends BaseTask {
- public static Log log = LogFactory.getLog(DictionaryTask.class);
- private static Map<Long, Long> idCache = new HashMap<>();
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void start() {
- }
- @Override
- public FieldMapper loadCache() {
- FieldMapper mapper = null;
- if(idCache.isEmpty()) {
- mapper = loadCache2();
- }else {
- mapper = new FieldMapper();
- mapper.setIdCache(idCache);
- }
- return mapper;
- }
- private FieldMapper loadCache2() {
- log.info(" *** 加载DictionaryTask字典缓存 *** ");
- FieldMapper mapper = new FieldMapper();
- Map<Long, Long> idCache = new HashMap<>();
- mapper.setIdCache(idCache);
- //知识库
- idCache.put(71L, getDicId(jdbcTemplateHsms,"solution_status","2")); //待审核
- idCache.put(72L, getDicId(jdbcTemplateHsms,"solution_status","3")); //已发布
- idCache.put(73L, getDicId(jdbcTemplateHsms,"solution_status","4")); //待整改
- idCache.put(74L, getDicId(jdbcTemplateHsms,"solution_status","5")); //已停用
- //耗材消耗
- if ("xiangyang".equals(appName)) {
- idCache.put(1735L, getDicId(jdbcTemplateHsms,"consumables_consume_type","1"));//消耗
- idCache.put(1736L, getDicId(jdbcTemplateHsms,"consumables_consume_type","2"));//撤销
- }else {
- idCache.put(1732L, getDicId(jdbcTemplateHsms,"consumables_consume_type","1"));//消耗
- idCache.put(1733L, getDicId(jdbcTemplateHsms,"consumables_consume_type","2"));//撤销
- }
- //公司分类
- idCache.put(1709L,getDicId(jdbcTemplateHsms,"company_type","1"));
- idCache.put(1710L,getDicId(jdbcTemplateHsms,"company_type","3"));
- //性别
- idCache.put(1609L,getDicId(jdbcTemplateHsms,"user_gender","0"));
- idCache.put(1610L,getDicId(jdbcTemplateHsms,"user_gender","1"));
- //事件-关闭代码
- idCache.put(1572L,getDicId(jdbcTemplateHsms,"incident_closecode","1"));
- idCache.put(1573L,getDicId(jdbcTemplateHsms,"incident_closecode","2"));
- idCache.put(1575L,getDicId(jdbcTemplateHsms,"incident_closecode","3"));
- idCache.put(1574L,getDicId(jdbcTemplateHsms,"incident_closecode","4"));
- idCache.put(1576L,getDicId(jdbcTemplateHsms,"incident_closecode","4"));
- idCache.put(1577L,getDicId(jdbcTemplateHsms,"incident_closecode","4"));
- //事件-满意度
- idCache.put(1578L,getDicId(jdbcTemplateHsms,"incident_degree","5"));
- idCache.put(1579L,getDicId(jdbcTemplateHsms,"incident_degree","4"));
- idCache.put(1580L,getDicId(jdbcTemplateHsms,"incident_degree","3"));
- idCache.put(1581L,getDicId(jdbcTemplateHsms,"incident_degree","2"));
- idCache.put(1582L,getDicId(jdbcTemplateHsms,"incident_degree","1"));
- //事件-优先级
- idCache.put(1560L,5L);
- idCache.put(1561L,4L);
- idCache.put(1562L,3L);
- idCache.put(1563L,2L);
- idCache.put(1704L,1L);
- //事件-incident_source
- idCache.put(1547L,getDicId(jdbcTemplateHsms,"incident_source","phone"));
- idCache.put(1548L,getDicId(jdbcTemplateHsms,"incident_source","record"));
- idCache.put(1549L,getDicId(jdbcTemplateHsms,"incident_source","im"));
- idCache.put(1550L,getDicId(jdbcTemplateHsms,"incident_source","other"));
- idCache.put(1551L,getDicId(jdbcTemplateHsms,"incident_source","leader"));
- idCache.put(1552L,getDicId(jdbcTemplateHsms,"incident_source","other"));
- idCache.put(1700L,getDicId(jdbcTemplateHsms,"incident_source","other"));
- idCache.put(1747L,getDicId(jdbcTemplateHsms,"incident_source","other"));
- //事件-incident_status
- idCache.put(1479L,getDicId(jdbcTemplateHsms,"incident_status","reassign"));
- idCache.put(1543L,getDicId(jdbcTemplateHsms,"incident_status","pending"));
- idCache.put(1544L,getDicId(jdbcTemplateHsms,"incident_status","handler"));
- idCache.put(1545L,getDicId(jdbcTemplateHsms,"incident_status","close"));
- idCache.put(1546L,getDicId(jdbcTemplateHsms,"incident_status","close"));
- idCache.put(1674L,getDicId(jdbcTemplateHsms,"incident_status","storage"));
- idCache.put(1748L,getDicId(jdbcTemplateHsms,"incident_status","cancel"));
- idCache.put(1749L,getDicId(jdbcTemplateHsms,"incident_status","reject"));
- idCache.put(1750L,getDicId(jdbcTemplateHsms,"incident_status","accept"));
- //事件-incident_handleresult
- idCache.put(1568L,getDicId(jdbcTemplateHsms,"incident_handle_type","1"));
- idCache.put(1569L,getDicId(jdbcTemplateHsms,"incident_handle_type","1"));
- idCache.put(1570L,getDicId(jdbcTemplateHsms,"incident_handle_type","1"));
- idCache.put(1571L,getDicId(jdbcTemplateHsms,"incident_handle_type","1"));
- //事件-wxincident_degree
- idCache.put(1598L,getDicId(jdbcTemplateHsms,"incident_degree","5"));
- idCache.put(1599L,getDicId(jdbcTemplateHsms,"incident_degree","4"));
- idCache.put(1600L,getDicId(jdbcTemplateHsms,"incident_degree","3"));
- idCache.put(1601L,getDicId(jdbcTemplateHsms,"incident_degree","2"));
- idCache.put(1602L,getDicId(jdbcTemplateHsms,"incident_degree","1"));
- //事件日志-incident_log_type
- idCache.put(1736L,getDicId(jdbcTemplateHsms,"incident_log_type","accept"));
- idCache.put(1737L,getDicId(jdbcTemplateHsms,"incident_log_type","receive"));
- idCache.put(1738L,getDicId(jdbcTemplateHsms,"incident_log_type","doing"));
- idCache.put(1739L,getDicId(jdbcTemplateHsms,"incident_log_type","resolve"));
- idCache.put(1740L,getDicId(jdbcTemplateHsms,"incident_log_type","close"));
- idCache.put(1741L,getDicId(jdbcTemplateHsms,"incident_log_type","reassign"));
- idCache.put(1742L,getDicId(jdbcTemplateHsms,"incident_log_type","assign"));
- idCache.put(1743L,getDicId(jdbcTemplateHsms,"incident_log_type","redeploy"));
- idCache.put(1744L,getDicId(jdbcTemplateHsms,"incident_log_type","upgrade"));
- idCache.put(1745L,getDicId(jdbcTemplateHsms,"incident_log_type","schassign"));
- idCache.put(1751L,getDicId(jdbcTemplateHsms,"incident_log_type","overtime"));
- idCache.put(1752L,getDicId(jdbcTemplateHsms,"incident_log_type","callback"));
- idCache.put(1753L,getDicId(jdbcTemplateHsms,"incident_log_type","cancel"));
- idCache.put(1754L,getDicId(jdbcTemplateHsms,"incident_log_type","reject"));
- idCache.put(1755L,getDicId(jdbcTemplateHsms,"incident_log_type","request"));
- idCache.put(1766L,getDicId(jdbcTemplateHsms,"incident_log_type","edit"));
- //事件-incident_handleCategory
- idCache.put(1564L,getDicId(jdbcTemplateHsms,"incident_handle_type","1"));
- idCache.put(1565L,idCache.get(1564L));
- idCache.put(1566L,idCache.get(1564L));
- idCache.put(1567L,idCache.get(1564L));
- idCache.put(1725L,idCache.get(1564L));
- idCache.put(1726L,idCache.get(1564L));
- idCache.put(1727L,idCache.get(1564L));
- idCache.put(1728L,idCache.get(1564L));
- if ("xiangyang".equals(appName)) {
- idCache.put(1740L, idCache.get(1564L));
- }else {
- idCache.put(1746L, idCache.get(1564L));
- }
- //事件日志-repair_type
- if ("xiangyang".equals(appName)) {
- idCache.put(1723L,getDicId(jdbcTemplateHsms,"repair_type","1"));
- idCache.put(1724L,getDicId(jdbcTemplateHsms,"repair_type","2"));
- idCache.put(1729L,getDicId(jdbcTemplateHsms,"repair_type","ljmale8n"));
- idCache.put(1730L,getDicId(jdbcTemplateHsms,"repair_type","limalzle"));
- idCache.put(1731L,getDicId(jdbcTemplateHsms,"repair_type","ljmamxbm"));
- idCache.put(1739L,getDicId(jdbcTemplateHsms,"repair_type","lr623zun"));
- }else {
- idCache.put(1723L,getDicId(jdbcTemplateHsms,"repair_type","1"));
- idCache.put(1724L,getDicId(jdbcTemplateHsms,"repair_type","2"));
- }
- return mapper;
- }
- }
|