初始化功能目录

yun-zuoyi
wei.peng 6 years ago
parent 0e6990d3b7
commit d9f32002ca

@ -93,8 +93,7 @@ public class AuthController extends CoreBaseController {
if (menus != null) { if (menus != null) {
for (SysMenu menu : menus) { for (SysMenu menu : menus) {
if (menu != null) { if (menu != null) {
if (menu.getMenuType().equals(CommonEnumUtil.METHOD_LEVEL.PLUGIN.getValue()) if (menu.getMenuType().equals(CommonEnumUtil.METHOD_LEVEL.PLUGIN.getValue()) && menu.getParentId().longValue() != -1) {
&& menu.getParentId().longValue() != -1) {
list.add(menu); list.add(menu);
} }
} }

@ -576,7 +576,7 @@ public class PersonnelController extends CoreBaseController {
} }
} }
@PutMapping(value = "/user/session-organize/{id}}") @PutMapping(value = "/user/session-organize/{id}")
@ApiOperation(value = "修改用户会话组织信息", notes = "修改用户会话组织信息") @ApiOperation(value = "修改用户会话组织信息", notes = "修改用户会话组织信息")
public ResultBean updateUserOrganizeList(@PathVariable("id") String idStr){ public ResultBean updateUserOrganizeList(@PathVariable("id") String idStr){
try { try {

@ -282,7 +282,6 @@ public class SysRoleService implements ISysRoleService {
} }
} }
/** /**
* *
* @param roleName * @param roleName

@ -153,12 +153,7 @@ public class ExcelUtil {
} }
// excel 文本框最大长度 // excel 文本框最大长度
if(String.valueOf(cellValue).length() > 30000){ hssfRow.createCell(j, CellType.STRING).setCellValue(StringTool.valueExcelOf(cellValue));
hssfRow.createCell(j, CellType.STRING).setCellValue(String.valueOf(cellValue).substring(0, 30000));
}else{
hssfRow.createCell(j, CellType.STRING).setCellValue(String.valueOf(cellValue));
}
} }
} }
@ -208,6 +203,7 @@ public class ExcelUtil {
// 校验sheet是否超过最大行数 // 校验sheet是否超过最大行数
Sheet sheet = wb.getSheet(importClass.getSimpleName()); Sheet sheet = wb.getSheet(importClass.getSimpleName());
int maxRow = Integer.parseInt(sysConfigService.getSysConfigByCode(PlatformConstWords.EXCEL_IMPORT_MAX_ROW).getConfigValue()); int maxRow = Integer.parseInt(sysConfigService.getSysConfigByCode(PlatformConstWords.EXCEL_IMPORT_MAX_ROW).getConfigValue());
System.out.println(maxRow);
if (sheet != null && sheet.getLastRowNum() > maxRow) { if (sheet != null && sheet.getLastRowNum() > maxRow) {
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
@ -246,30 +242,33 @@ public class ExcelUtil {
row = sheet.getRow(i); row = sheet.getRow(i);
obj = importClass.newInstance(); obj = importClass.newInstance();
for (int j = 0; j < fields.length; j++) { for (int j = 0; j < fields.length; j++) {
// 判断是否存在引用关系 Field field = fields[j];
if (fields[j].isAnnotationPresent(AnnoOutputColumn.class)) { if(field != null){
inputColumn = fields[j].getAnnotation(AnnoOutputColumn.class); // 判断是否存在引用关系
row.getCell(j).setCellType(CellType.STRING); if (field.isAnnotationPresent(AnnoOutputColumn.class)) {
cellValue = row.getCell(j).getStringCellValue(); inputColumn = fields[j].getAnnotation(AnnoOutputColumn.class);
row.getCell(j).setCellType(CellType.STRING);
// 判断是否为枚举字段 cellValue = row.getCell(j).getStringCellValue();
if (inputColumn.refClass().isEnum()) {
method = inputColumn.refClass().getDeclaredMethod( // 判断是否为枚举字段
inputColumn.value() + "Of" + StringTool.toUpperCaseFirstOne(inputColumn.refForeignKey()), if (inputColumn.refClass().isEnum()) {
inputColumn.refClass().getDeclaredMethod("get"+ method = inputColumn.refClass().getDeclaredMethod(
StringTool.toUpperCaseFirstOne(inputColumn.value())).getReturnType()); inputColumn.value() + "Of" + StringTool.toUpperCaseFirstOne(inputColumn.refForeignKey()),
cellValue = method.invoke(null, cellValue); inputColumn.refClass().getDeclaredMethod("get"+
}else if(inputColumn.refClass().equals(SysDictionary.class) && cellValue != null){ StringTool.toUpperCaseFirstOne(inputColumn.value())).getReturnType());
cellValue = sysDictionaryService.getSysDictionaryByParentCodeAndName(inputColumn.refForeignKey(), String.valueOf(cellValue)).getName(); cellValue = method.invoke(null, cellValue);
} else if(!inputColumn.refClass().equals(Object.class) && !inputColumn.refClass().equals(SysDictionary.class)){ }else if(inputColumn.refClass().equals(SysDictionary.class) && cellValue != null){
cellValue = selectByProperty(inputColumn.refClass(), inputColumn.refForeignKey(), inputColumn.value(), cellValue); cellValue = sysDictionaryService.getSysDictionaryByParentCodeAndName(inputColumn.refForeignKey(), String.valueOf(cellValue)).getName();
} else if(!inputColumn.refClass().equals(Object.class) && !inputColumn.refClass().equals(SysDictionary.class)){
cellValue = selectByProperty(inputColumn.refClass(), inputColumn.refForeignKey(), inputColumn.value(), cellValue);
}
}else{
cellValue = getExcelCell(row.getCell(j), field.getType());
} }
}else{
cellValue = getExcelCell(row.getCell(j), fields[j].getType());
}
fields[j].setAccessible(true); field.setAccessible(true);
fields[j].set(obj, cellValue); field.set(obj, cellValue);
}
} }
dataList.add(obj); dataList.add(obj);
} }

@ -0,0 +1,23 @@
package test.cn.estsh.i3plus.core.apiservice.util;
import cn.estsh.i3plus.core.apiservice.util.ExcelUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import com.alibaba.fastjson.JSON;
import java.io.FileInputStream;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-05-21 12:57
* @Modify:
**/
public class ExcelReadData {
public static void main(String[] args) throws Exception{
List<SysMenu> list = ExcelUtil.importData("permission.xls", new FileInputStream("E:\\permission.xls"), SysMenu.class);
System.out.println(JSON.toJSONString(list));
}
}

@ -101,6 +101,11 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>i3plus.platform</groupId>
<artifactId>i3plus-platform-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId> <groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-platform</artifactId> <artifactId>i3plus-pojo-platform</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
@ -122,7 +127,7 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!-- wei'fu微服调用 --> <!-- 微服调用 -->
<dependency> <dependency>
<groupId>i3plus.icloud</groupId> <groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-core</artifactId> <artifactId>i3plus-icloud-core</artifactId>
@ -226,6 +231,7 @@
<artifactId>jaxen</artifactId> <artifactId>jaxen</artifactId>
<version>1.1.6</version> <version>1.1.6</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>

Loading…
Cancel
Save