| | |
| | | /** |
| | | * 必填列 |
| | | */ |
| | | private ArrayList<Integer> ColumnNameisRed = new ArrayList<Integer>(); |
| | | private List<Integer> ColumnNameisRed = new ArrayList<Integer>(); |
| | | |
| | | /** |
| | | * 日志 |
| | |
| | | //界面没传名称,使用默认导出名称 |
| | | exportFileName = Func.isBlank(exportFileName) ? "枚举类型导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置列名 |
| | | List<String> columns = new ArrayList<>(Arrays.asList("枚举名称", "标签", "返回类型", "长度", "枚举项名称", "枚举值", "描述")); |
| | | List<String> columns = new ArrayList<>(Arrays.asList("枚举名称", "标签", "返回类型", "长度","创建时间", "枚举项名称", "枚举值", "描述")); |
| | | |
| | | //写excel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | |
| | | //处理枚举项写入 |
| | | for (int j = 0; j < enumVOItems.size(); j++) { |
| | | OsEnumItemVO osEnumItemVO = enumVOItems.get(j); |
| | | excelDataList.add(new WriteExcelData(startRow+j,7, true,osEnumItemVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,8, true, osEnumItemVO.getValue())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,9, true, osEnumItemVO.getDescription())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,5, true,osEnumItemVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,6, true, osEnumItemVO.getValue())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,7, true, osEnumItemVO.getDescription())); |
| | | } |
| | | |
| | | startRow += enumVOItems.size(); |
| | |
| | | if(Func.isNotEmpty(osEnumVOList)){ |
| | | repeatEnumId = osEnumVOList.stream().map(OsEnumVO::getId).collect(Collectors.toList()); |
| | | } |
| | | //当前excel中是否重复用的判重Map:(key:账号,value:行号) |
| | | //当前excel中是否重复用的判重Map:(key:判重属性,value:行号) |
| | | Map<String, String> excelReapeat = new HashMap<>(); |
| | | //判断必填属性是否为空,用户是否已存在,以及部门是否填错等校验逻辑 |
| | | List<String> finalRepeatEnumId = repeatEnumId; |
| | |
| | | }else if (Func.isNotEmpty(osEnumVOList) && finalRepeatEnumId.contains(osEnumPO.getId())){//2、判断枚举名是否与系统中重复 |
| | | throw new VciBaseException("第【"+osEnumPO.getRowIndex()+"】行,枚举名在系统中已经存在,请修改!"); |
| | | } |
| | | //先对必填属性判空处理 |
| | | //先对枚举名excel中需要判重处理 |
| | | excelReapeat.put(osEnumPO.getId(),osEnumPO.getRowIndex()); |
| | | }); |
| | | //保存逻辑 |