From b84402a40a0ae7e02fdd491d77c06f5021d686e3 Mon Sep 17 00:00:00 2001 From: "yunhao.wang" Date: Fri, 7 Dec 2018 21:23:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.properties | 18 +- .../src/main/resources/application-prod.properties | 22 +- .../src/main/resources/application-test.properties | 22 +- .../serviceimpl/busi/TestExcelPermission.java | 1 + .../serviceimpl/busi/TestExcelSysConfig.java | 414 ++++++++++----------- 5 files changed, 239 insertions(+), 238 deletions(-) diff --git a/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties b/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties index 2238e12..f79b292 100644 --- a/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties +++ b/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties @@ -106,22 +106,22 @@ spring.data.mongodb.port=27017 ##主数据源,读写 #impp.write.datasource.type=com.zaxxer.hikari.HikariDataSource impp.write.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.write.datasource.username=i3_dev_core -impp.write.datasource.password=i3_core_pass +impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.write.datasource.username=impp_i3_core_user +impp.write.datasource.password=impp_i3_core_pwd ##辅数据源,只读 #impp.read.datasource.type=com.zaxxer.hikari.HikariDataSource impp.read.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.read.datasource.username=i3_dev_core -impp.read.datasource.password=i3_core_pass +impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.read.datasource.username=impp_i3_core_user +impp.read.datasource.password=impp_i3_core_pwd ##############定时任务持久化############## impp.schedule.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.schedule.datasource.username=i3_dev_schedule -impp.schedule.datasource.password=i3_schedule_pass +impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/impp_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.schedule.datasource.username=impp_i3_schedule_user +impp.schedule.datasource.password=impp_i3_schedule_pwd impp.schedule.datasource.max-connections=20 #定时任务在服务启动后多少秒执行 impp.schedule.start.after-second=20 diff --git a/modules/i3plus-core-apiservice/src/main/resources/application-prod.properties b/modules/i3plus-core-apiservice/src/main/resources/application-prod.properties index 3fa9e90..73f944e 100644 --- a/modules/i3plus-core-apiservice/src/main/resources/application-prod.properties +++ b/modules/i3plus-core-apiservice/src/main/resources/application-prod.properties @@ -1,5 +1,5 @@ #项目端口 -server.port=8100 +server.port=1100 #本机ip impp.server.ip=192.168.1.56 #console控制台服务(zipkin追踪全路径) @@ -84,7 +84,7 @@ spring.zipkin.base-url=${impp.console.ip} spring.sleuth.sampler.probability=1.0 ################ 日志据源 ################ -spring.data.mongodb.database=mongoDBSource +spring.data.mongodb.database=prodMongoDBSource spring.data.mongodb.uri=192.168.1.55:27017 spring.data.mongodb.username=sa spring.data.mongodb.password=i3plus @@ -106,22 +106,22 @@ spring.data.mongodb.port=27017 ##主数据源,读写 #impp.write.datasource.type=com.zaxxer.hikari.HikariDataSource impp.write.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.write.datasource.username=i3_dev_core -impp.write.datasource.password=i3_core_pass +impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3309/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.write.datasource.username=impp_i3_core_user +impp.write.datasource.password=impp_i3_core_pwd ##辅数据源,只读 #impp.read.datasource.type=com.zaxxer.hikari.HikariDataSource impp.read.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.read.datasource.username=i3_dev_core -impp.read.datasource.password=i3_core_pass +impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3309/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.read.datasource.username=impp_i3_core_user +impp.read.datasource.password=impp_i3_core_pwd ##############定时任务持久化############## impp.schedule.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.schedule.datasource.username=i3_dev_schedule -impp.schedule.datasource.password=i3_schedule_pass +impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3309/impp_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.schedule.datasource.username=impp_i3_schedule_user +impp.schedule.datasource.password=impp_i3_schedule_pwd impp.schedule.datasource.max-connections=20 #定时任务在服务启动后多少秒执行 impp.schedule.start.after-second=20 diff --git a/modules/i3plus-core-apiservice/src/main/resources/application-test.properties b/modules/i3plus-core-apiservice/src/main/resources/application-test.properties index 9c7ae55..3dbaed7 100644 --- a/modules/i3plus-core-apiservice/src/main/resources/application-test.properties +++ b/modules/i3plus-core-apiservice/src/main/resources/application-test.properties @@ -1,5 +1,5 @@ #项目端口 -server.port=8100 +server.port=58100 #本机ip impp.server.ip=192.168.1.56 #console控制台服务(zipkin追踪全路径) @@ -84,7 +84,7 @@ spring.zipkin.base-url=${impp.console.ip} spring.sleuth.sampler.probability=1.0 ################ 日志据源 ################ -spring.data.mongodb.database=mongoDBSource +spring.data.mongodb.database=testMongoDBSource spring.data.mongodb.uri=192.168.1.55:27017 spring.data.mongodb.username=sa spring.data.mongodb.password=i3plus @@ -106,22 +106,22 @@ spring.data.mongodb.port=27017 ##主数据源,读写 #impp.write.datasource.type=com.zaxxer.hikari.HikariDataSource impp.write.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.write.datasource.username=i3_dev_core -impp.write.datasource.password=i3_core_pass +impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3308/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.write.datasource.username=impp_i3_core_user +impp.write.datasource.password=impp_i3_core_pwd ##辅数据源,只读 #impp.read.datasource.type=com.zaxxer.hikari.HikariDataSource impp.read.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.read.datasource.username=i3_dev_core -impp.read.datasource.password=i3_core_pass +impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3308/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.read.datasource.username=impp_i3_core_user +impp.read.datasource.password=impp_i3_core_pwd ##############定时任务持久化############## impp.schedule.datasource.driver-class-name=com.mysql.jdbc.Driver -impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8 -impp.schedule.datasource.username=i3_dev_schedule -impp.schedule.datasource.password=i3_schedule_pass +impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3308/impp_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8 +impp.schedule.datasource.username=impp_i3_schedule_user +impp.schedule.datasource.password=impp_i3_schedule_pwd impp.schedule.datasource.max-connections=20 #定时任务在服务启动后多少秒执行 impp.schedule.start.after-second=20 diff --git a/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelPermission.java b/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelPermission.java index dd6f15e..55718e7 100644 --- a/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelPermission.java +++ b/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelPermission.java @@ -141,6 +141,7 @@ public class TestExcelPermission extends TestBase { obj.setUserInfoId(Long.parseLong(row.getCell(5).getStringCellValue())); obj.setUserName(row.getCell(6).getStringCellValue()); obj.setIsValid(1); + obj.setUserStatus(1); obj.setUserType(1); obj.setUserLoginNum(0); diff --git a/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelSysConfig.java b/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelSysConfig.java index 69ad6a8..43ec295 100644 --- a/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelSysConfig.java +++ b/modules/i3plus-core-apiservice/src/test/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestExcelSysConfig.java @@ -1,207 +1,207 @@ -//package cn.estsh.i3plus.core.apiservice.serviceimpl.busi; -// -//import cn.estsh.i3plus.pojo.platform.bean.*; -//import cn.estsh.i3plus.pojo.platform.repository.SysConfigRepository; -//import cn.estsh.i3plus.pojo.platform.repository.SysDictionaryRepository; -//import cn.estsh.i3plus.pojo.platform.repository.SysLocaleLanguageRepository; -//import cn.estsh.i3plus.pojo.platform.repository.SysLocaleResourceRepository; -//import org.apache.poi.ss.usermodel.Row; -//import org.apache.poi.xssf.usermodel.XSSFSheet; -//import org.apache.poi.xssf.usermodel.XSSFWorkbook; -//import org.junit.Test; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.beans.factory.annotation.Autowired; -// -//import java.io.InputStream; -//import java.util.ArrayList; -//import java.util.List; -// -///** -// * @Description : -// * @Reference : -// * @Author : yunhao -// * @CreateDate : 2018-11-22 11:01 -// * @Modify: -// **/ -//public class TestExcelSysConfig extends TestBase { -// -// public static final Logger LOGGER = LoggerFactory.getLogger(TestExcelPermission.class); -// -// // 文件路径 -// public static final String PATH_NAME = "init/sys-config.xlsx"; -// // 权限Sheet 名称 -// public static final String SHEET_SYS_CONFIG = "sys-config"; -// public static final String SHEET_DICTIONARY = "dictionary"; -// public static final String SHEET_LANGUAGE = "language"; -// public static final String SHEET_RESOURCE = "resource"; -// -// @Autowired -// private SysConfigRepository sysConfigRDao; -// @Autowired -// private SysDictionaryRepository sysDictionaryRDao; -// @Autowired -// private SysLocaleLanguageRepository sysLocaleLanguageRDao; -// @Autowired -// private SysLocaleResourceRepository sysLocaleResourceRDao; -// -// @Test -// public void testInit() throws Exception { -// XSSFWorkbook workbook = getWorkbook(PATH_NAME); -// if(workbook != null){ -// XSSFSheet sheetSysConfig = workbook.getSheet(SHEET_SYS_CONFIG); -// XSSFSheet sheetDictionary = workbook.getSheet(SHEET_DICTIONARY); -// XSSFSheet sheetLanguage = workbook.getSheet(SHEET_LANGUAGE); -// XSSFSheet sheetResource = workbook.getSheet(SHEET_RESOURCE); -// -// List sysConfigList = getSysConfig(sheetSysConfig); -// List sysDictionaryList = getSysDictionary(sheetDictionary); -// List sysLocaleLanguageList = getSysLocaleLanguage(sheetLanguage); -// List sysLocaleResourceList= getSysLocaleResource(sheetResource); -// -// LOGGER.info("System Init SysConfig Size:{}",sysConfigList.size()); -// LOGGER.info("System Init SysDictionary Size:{}",sysDictionaryList.size()); -// LOGGER.info("System Init SysLocaleLanguage Size:{}",sysLocaleLanguageList.size()); -// LOGGER.info("System Init SysLocaleResource Size:{}",sysLocaleResourceList.size()); -// -// sysConfigRDao.saveAll(sysConfigList); -// sysDictionaryRDao.saveAll(sysDictionaryList); -// sysLocaleLanguageRDao.saveAll(sysLocaleLanguageList); -// sysLocaleResourceRDao.saveAll(sysLocaleResourceList); -// } -// } -// -// public List getSysConfig(XSSFSheet sheet){ -// List result = new ArrayList<>(); -// if(sheet != null){ -// if(sheet.getLastRowNum() >= 1){ -// SysConfig obj = null; -// for (int i = 1; i <= sheet.getLastRowNum(); i++) { -// try { -// Row row = sheet.getRow(i);//获取索引为i的行,以0开始 -// if(row.getCell(0).toString().trim().length() > 0){ -// obj = new SysConfig(); -// obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); -// obj.setName(row.getCell(1).getStringCellValue()); -// obj.setConfigType(Integer.valueOf(row.getCell(2).getStringCellValue())); -// obj.setConfigCode(row.getCell(3).getStringCellValue()); -// obj.setConfigValue(row.getCell(4).getStringCellValue()); -// obj.setConfigDescription(row.getCell(5).getStringCellValue()); -// obj.setIsValid(1); -// -// result.add(obj); -// } -// }catch (Exception e){ -// LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); -// } -// } -// } -// } -// return result; -// } -// -// public List getSysDictionary(XSSFSheet sheet){ -// List result = new ArrayList<>(); -// if(sheet != null){ -// if(sheet.getLastRowNum() >= 1){ -// SysDictionary obj = null; -// for (int i = 1; i <= sheet.getLastRowNum(); i++) { -// try { -// Row row = sheet.getRow(i);//获取索引为i的行,以0开始 -// if(row.getCell(0).toString().trim().length() > 0){ -// obj = new SysDictionary(); -// obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); -// obj.setName(row.getCell(1).getStringCellValue()); -// obj.setDictionaryCode(row.getCell(2).getStringCellValue()); -// obj.setParentId(Long.valueOf(row.getCell(3).getStringCellValue())); -// obj.setParentNameRdd(row.getCell(4).getStringCellValue()); -// obj.setParentCodeRdd(row.getCell(5).getStringCellValue()); -// obj.setDictionaryValue(row.getCell(6).getStringCellValue()); -// obj.setDictionarySort(Integer.valueOf(row.getCell(7).getStringCellValue())); -// obj.setDictionaryDescription(row.getCell(8).getStringCellValue()); -// obj.setIsValid(1); -// -// result.add(obj); -// } -// }catch (Exception e){ -// LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); -// } -// } -// } -// } -// return result; -// } -// -// public List getSysLocaleLanguage(XSSFSheet sheet){ -// List result = new ArrayList<>(); -// if(sheet != null){ -// if(sheet.getLastRowNum() >= 1){ -// SysLocaleLanguage obj = null; -// for (int i = 1; i <= sheet.getLastRowNum(); i++) { -// try { -// Row row = sheet.getRow(i);//获取索引为i的行,以0开始 -// if(row.getCell(0).toString().trim().length() > 0){ -// obj = new SysLocaleLanguage(); -// obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); -// obj.setLanguageName(row.getCell(1).getStringCellValue()); -// obj.setLanguageCode(row.getCell(2).getStringCellValue()); -// obj.setLanguageSort(Integer.valueOf(row.getCell(3).getStringCellValue())); -// obj.setIsDefault(Integer.valueOf(row.getCell(4).getStringCellValue())); -// obj.setLanguageStatus(Integer.valueOf(row.getCell(5).getStringCellValue())); -// obj.setIsValid(1); -// -// result.add(obj); -// } -// }catch (Exception e){ -// LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); -// } -// } -// } -// } -// return result; -// } -// -// public List getSysLocaleResource(XSSFSheet sheet){ -// List result = new ArrayList<>(); -// if(sheet != null){ -// if(sheet.getLastRowNum() >= 1){ -// SysLocaleResource obj = null; -// for (int i = 1; i <= sheet.getLastRowNum(); i++) { -// try { -// Row row = sheet.getRow(i);//获取索引为i的行,以0开始 -// if(row.getCell(0).toString().trim().length() > 0){ -// obj = new SysLocaleResource(); -// obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); -// obj.setResourceType(Integer.valueOf(row.getCell(1).getStringCellValue())); -// obj.setLanguageCode(row.getCell(2).getStringCellValue()); -// obj.setLanguageNameRdd(row.getCell(3).getStringCellValue()); -// obj.setResourceKey(row.getCell(4).getStringCellValue()); -// obj.setResourceValue(row.getCell(5).getStringCellValue()); -// obj.setIsSystem(Integer.valueOf(row.getCell(6).getStringCellValue())); -// obj.setIsValid(1); -// -// result.add(obj); -// } -// }catch (Exception e){ -// LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); -// } -// } -// } -// } -// return result; -// } -// -// -// public XSSFWorkbook getWorkbook(String pathName){ -// try { -// InputStream in = TestExcelPermission.class.getClassLoader().getResourceAsStream(pathName); -// XSSFWorkbook workbook = new XSSFWorkbook(in); -// return workbook; -// }catch (Exception e){ -// LOGGER.error(" System Init Sys Data Excel Error file path {} error message :{}",pathName,e.getMessage()); -// e.getMessage(); -// return null; -// } -// } -// -//} +package cn.estsh.i3plus.core.apiservice.serviceimpl.busi; + +import cn.estsh.i3plus.pojo.platform.bean.*; +import cn.estsh.i3plus.pojo.platform.repository.SysConfigRepository; +import cn.estsh.i3plus.pojo.platform.repository.SysDictionaryRepository; +import cn.estsh.i3plus.pojo.platform.repository.SysLocaleLanguageRepository; +import cn.estsh.i3plus.pojo.platform.repository.SysLocaleResourceRepository; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description : + * @Reference : + * @Author : yunhao + * @CreateDate : 2018-11-22 11:01 + * @Modify: + **/ +public class TestExcelSysConfig extends TestBase { + + public static final Logger LOGGER = LoggerFactory.getLogger(TestExcelPermission.class); + + // 文件路径 + public static final String PATH_NAME = "init/sys-config.xlsx"; + // 权限Sheet 名称 + public static final String SHEET_SYS_CONFIG = "sys-config"; + public static final String SHEET_DICTIONARY = "dictionary"; + public static final String SHEET_LANGUAGE = "language"; + public static final String SHEET_RESOURCE = "resource"; + + @Autowired + private SysConfigRepository sysConfigRDao; + @Autowired + private SysDictionaryRepository sysDictionaryRDao; + @Autowired + private SysLocaleLanguageRepository sysLocaleLanguageRDao; + @Autowired + private SysLocaleResourceRepository sysLocaleResourceRDao; + + @Test + public void testInit() throws Exception { + XSSFWorkbook workbook = getWorkbook(PATH_NAME); + if(workbook != null){ + XSSFSheet sheetSysConfig = workbook.getSheet(SHEET_SYS_CONFIG); + XSSFSheet sheetDictionary = workbook.getSheet(SHEET_DICTIONARY); + XSSFSheet sheetLanguage = workbook.getSheet(SHEET_LANGUAGE); + XSSFSheet sheetResource = workbook.getSheet(SHEET_RESOURCE); + + List sysConfigList = getSysConfig(sheetSysConfig); + List sysDictionaryList = getSysDictionary(sheetDictionary); + List sysLocaleLanguageList = getSysLocaleLanguage(sheetLanguage); + List sysLocaleResourceList= getSysLocaleResource(sheetResource); + + LOGGER.info("System Init SysConfig Size:{}",sysConfigList.size()); + LOGGER.info("System Init SysDictionary Size:{}",sysDictionaryList.size()); + LOGGER.info("System Init SysLocaleLanguage Size:{}",sysLocaleLanguageList.size()); + LOGGER.info("System Init SysLocaleResource Size:{}",sysLocaleResourceList.size()); + + sysConfigRDao.saveAll(sysConfigList); + sysDictionaryRDao.saveAll(sysDictionaryList); + sysLocaleLanguageRDao.saveAll(sysLocaleLanguageList); + sysLocaleResourceRDao.saveAll(sysLocaleResourceList); + } + } + + public List getSysConfig(XSSFSheet sheet){ + List result = new ArrayList<>(); + if(sheet != null){ + if(sheet.getLastRowNum() >= 1){ + SysConfig obj = null; + for (int i = 1; i <= sheet.getLastRowNum(); i++) { + try { + Row row = sheet.getRow(i);//获取索引为i的行,以0开始 + if(row.getCell(0).toString().trim().length() > 0){ + obj = new SysConfig(); + obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); + obj.setName(row.getCell(1).getStringCellValue()); + obj.setConfigType(Integer.valueOf(row.getCell(2).getStringCellValue())); + obj.setConfigCode(row.getCell(3).getStringCellValue()); + obj.setConfigValue(row.getCell(4).getStringCellValue()); + obj.setConfigDescription(row.getCell(5).getStringCellValue()); + obj.setIsValid(1); + + result.add(obj); + } + }catch (Exception e){ + LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); + } + } + } + } + return result; + } + + public List getSysDictionary(XSSFSheet sheet){ + List result = new ArrayList<>(); + if(sheet != null){ + if(sheet.getLastRowNum() >= 1){ + SysDictionary obj = null; + for (int i = 1; i <= sheet.getLastRowNum(); i++) { + try { + Row row = sheet.getRow(i);//获取索引为i的行,以0开始 + if(row.getCell(0).toString().trim().length() > 0){ + obj = new SysDictionary(); + obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); + obj.setName(row.getCell(1).getStringCellValue()); + obj.setDictionaryCode(row.getCell(2).getStringCellValue()); + obj.setParentId(Long.valueOf(row.getCell(3).getStringCellValue())); + obj.setParentNameRdd(row.getCell(4).getStringCellValue()); + obj.setParentCodeRdd(row.getCell(5).getStringCellValue()); + obj.setDictionaryValue(row.getCell(6).getStringCellValue()); + obj.setDictionarySort(Integer.valueOf(row.getCell(7).getStringCellValue())); + obj.setDictionaryDescription(row.getCell(8).getStringCellValue()); + obj.setIsValid(1); + + result.add(obj); + } + }catch (Exception e){ + LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); + } + } + } + } + return result; + } + + public List getSysLocaleLanguage(XSSFSheet sheet){ + List result = new ArrayList<>(); + if(sheet != null){ + if(sheet.getLastRowNum() >= 1){ + SysLocaleLanguage obj = null; + for (int i = 1; i <= sheet.getLastRowNum(); i++) { + try { + Row row = sheet.getRow(i);//获取索引为i的行,以0开始 + if(row.getCell(0).toString().trim().length() > 0){ + obj = new SysLocaleLanguage(); + obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); + obj.setLanguageName(row.getCell(1).getStringCellValue()); + obj.setLanguageCode(row.getCell(2).getStringCellValue()); + obj.setLanguageSort(Integer.valueOf(row.getCell(3).getStringCellValue())); + obj.setIsDefault(Integer.valueOf(row.getCell(4).getStringCellValue())); + obj.setLanguageStatus(Integer.valueOf(row.getCell(5).getStringCellValue())); + obj.setIsValid(1); + + result.add(obj); + } + }catch (Exception e){ + LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); + } + } + } + } + return result; + } + + public List getSysLocaleResource(XSSFSheet sheet){ + List result = new ArrayList<>(); + if(sheet != null){ + if(sheet.getLastRowNum() >= 1){ + SysLocaleResource obj = null; + for (int i = 1; i <= sheet.getLastRowNum(); i++) { + try { + Row row = sheet.getRow(i);//获取索引为i的行,以0开始 + if(row.getCell(0).toString().trim().length() > 0){ + obj = new SysLocaleResource(); + obj.setId(Long.parseLong(row.getCell(0).getStringCellValue())); + obj.setResourceType(Integer.valueOf(row.getCell(1).getStringCellValue())); + obj.setLanguageCode(row.getCell(2).getStringCellValue()); + obj.setLanguageNameRdd(row.getCell(3).getStringCellValue()); + obj.setResourceKey(row.getCell(4).getStringCellValue()); + obj.setResourceValue(row.getCell(5).getStringCellValue()); + obj.setIsSystem(Integer.valueOf(row.getCell(6).getStringCellValue())); + obj.setIsValid(1); + + result.add(obj); + } + }catch (Exception e){ + LOGGER.error("Excel Sheet Name :{} Index:{} DataType Error", sheet.getSheetName(), i); + } + } + } + } + return result; + } + + + public XSSFWorkbook getWorkbook(String pathName){ + try { + InputStream in = TestExcelPermission.class.getClassLoader().getResourceAsStream(pathName); + XSSFWorkbook workbook = new XSSFWorkbook(in); + return workbook; + }catch (Exception e){ + LOGGER.error(" System Init Sys Data Excel Error file path {} error message :{}",pathName,e.getMessage()); + e.getMessage(); + return null; + } + } + +} From 42a9154afe713a2488f1ddd9064300dc0f4a4006 Mon Sep 17 00:00:00 2001 From: "wei.peng" Date: Fri, 7 Dec 2018 22:34:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8F=91=E5=B8=83=20=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=88=E6=9C=AC=201.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/i3plus-core-api/pom.xml | 2 +- modules/i3plus-core-apiservice/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/i3plus-core-api/pom.xml b/modules/i3plus-core-api/pom.xml index cd0b29c..6e2cbcd 100644 --- a/modules/i3plus-core-api/pom.xml +++ b/modules/i3plus-core-api/pom.xml @@ -5,7 +5,7 @@ i3plus-core i3plus.core - 1.0-SNAPSHOT-DEV + 1.0-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/modules/i3plus-core-apiservice/pom.xml b/modules/i3plus-core-apiservice/pom.xml index b030067..b2956cc 100644 --- a/modules/i3plus-core-apiservice/pom.xml +++ b/modules/i3plus-core-apiservice/pom.xml @@ -5,7 +5,7 @@ i3plus-core i3plus.core - 1.0-SNAPSHOT-DEV + 1.0-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index e6c618a..4f991fd 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ i3plus.core i3plus-core pom - 1.0-SNAPSHOT-DEV + 1.0-SNAPSHOT modules/i3plus-core-api modules/i3plus-core-apiservice From c98297b3da3e772b28fbf13d41a0677353b6db16 Mon Sep 17 00:00:00 2001 From: "wei.peng" Date: Fri, 7 Dec 2018 23:18:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8F=91=E5=B8=83=20=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=88=E6=9C=AC=201.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4f991fd..676ec71 100644 --- a/pom.xml +++ b/pom.xml @@ -28,9 +28,9 @@ 1.8 Finchley.RELEASE INFO - E:/i3plus-platform-logs/${project.name} - E:/i3plus-platform-logs/${project.name}-error - E:/i3plus-platform-logs/${project.name}-controller + ../logs/${project.name} + ../logs/${project.name}-error + ../logs/${project.name}-controller 2.9.1 2.6 2.1