IClearApiSystemInit.java 2.31 KB
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 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{
			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>>>>>>>>>");


		}catch (Exception e){
			log.error("init afterPropertiesSet error:" + e.getMessage());
		}
	}

















}