IClearApiSystemInit.java
2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package com.erry.iclear.dateInterface.init;
import com.erry.iclear.dateInterface.common.Constant;
import com.erry.iclear.dateInterface.entity.AppInfo;
import com.erry.iclear.dateInterface.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import java.util.HashMap;
import java.util.List;
/**
* @author Administrator
*/
@Service("IClearApiSystemInit")
@Slf4j
public class IClearApiSystemInit implements InitializingBean, ApplicationContextAware{
private ApplicationContext applicationContext;
@Autowired
private AppInfoService appInfoService;
@Autowired
private DomesticDestinationMappingService domesticDestinationMappingService;
@Autowired
private DictionaryEntriesService dictionaryEntriesService;
@Autowired
private OrigplacecodeMappingService origplacecodeMappingService;
@Autowired
private ChmCarryPortService chmCarryPortService;
@Override
public void setApplicationContext(ApplicationContext applicationContext)throws BeansException {
this.applicationContext = applicationContext;
}
@Override
public void afterPropertiesSet() throws Exception {
try{
StopWatch sw = new StopWatch("initSystemCache");
sw.start("initCache");
log.info("init initAppInfo start>>>>>>>>>");
appInfoService.initAppInfo();
log.info("init initAppInfo end>>>>>>>>>");
log.info("init initDictionaryEntries start>>>>>>>>>");
dictionaryEntriesService.initDictionaryEntries();
log.info("init initDictionaryEntries end>>>>>>>>>");
log.info("init initDomesticDestinationMapping start>>>>>>>>>");
domesticDestinationMappingService.initDomesticDestinationMapping();
log.info("init initDomesticDestinationMapping end>>>>>>>>>");
log.info("init initOrigplacecodeMapping start>>>>>>>>>");
origplacecodeMappingService.initOrigplacecodeMapping();
log.info("init initOrigplacecodeMapping end>>>>>>>>>");
log.info("init initChmCarryPort start>>>>>>>>>");
chmCarryPortService.initChmCarryPort();
log.info("init initChmCarryPort start>>>>>>>>>");
sw.stop();
System.out.println(sw.prettyPrint());
}catch (Exception e){
log.error("init afterPropertiesSet error:" + e.getMessage());
}
}
}