| | |
| | | package com.yssh.run; |
| | | |
| | | |
| | | import com.yssh.utils.CacheUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.yssh.service.ICommonService; |
| | | import com.yssh.service.IDictRecordService; |
| | | |
| | | |
| | | @Component |
| | | public class InitDataRunner implements ApplicationRunner{ |
| | | public class InitDataRunner implements ApplicationRunner { |
| | | |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | @Autowired |
| | | private ICommonService commonService; |
| | | |
| | | @Autowired |
| | | private IDictRecordService dictRecordService; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | boolean tableExists = commonService.checkTableExists("dict_record"); |
| | | if (!tableExists) { |
| | | dictRecordService.createDictRecoTable(); |
| | | } |
| | | //读取dat数据 |
| | | commonService.readDatData(); |
| | | } |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | @Autowired |
| | | private ICommonService commonService; |
| | | |
| | | @Autowired |
| | | private IDictRecordService dictRecordService; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | CacheUtils.init(); |
| | | |
| | | boolean tableExists = commonService.checkTableExists("dict_record"); |
| | | if (!tableExists) { |
| | | dictRecordService.createDictRecoTable(); |
| | | } |
| | | //读取dat数据 |
| | | commonService.readDatData(); |
| | | } |
| | | } |