From 0702e1393d668e36cd6a23bb87ed4e69c9ae37e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E4=B8=9C=E5=BC=BA?= <1559301693@qq.com> Date: Thu, 24 Jul 2025 13:56:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=AF=BC=E5=87=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8F=96=E6=B6=88=E6=8E=89=E6=A0=91=E5=BD=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processlist/web/PALRepositoryListWeb.java | 60 ++++++++++++------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java index 67466765..3b390123 100644 --- a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java +++ b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java @@ -1211,7 +1211,21 @@ public class PALRepositoryListWeb extends ActionWeb { // 获取符合条件数据的maxLevel int maxLevel = getMaxLevelByList(palList); // 获取Excel表头信息 - List excelTableHeadList = getExcelTableHeadData(wsId, palList, maxLevel, tempArr); + boolean treeVisible = true; + boolean idVisible = true; + try{ + JSONObject jsonObject = JSONObject.parseObject(customFilter); + if (jsonObject != null&& jsonObject.containsKey("treeVisible")&&"false".equals(jsonObject.getString("treeVisible"))){ + treeVisible = false; + } + if (jsonObject != null&& jsonObject.containsKey("idVisible")&&"false".equals(jsonObject.getString("idVisible"))){ + idVisible = false; + } + + }catch (Exception e){ + e.getMessage() ; + } + List excelTableHeadList = getExcelTableHeadData(wsId, palList, maxLevel, tempArr, treeVisible, idVisible); ConsolePrinter.info("流程清单表头信息 " + excelTableHeadList.toString().replaceAll("\n","")); short column = columnIndex; // 设置默认的两行 通栏 @@ -1298,24 +1312,25 @@ public class PALRepositoryListWeb extends ActionWeb { String cellValue = getDefaultFixedValueById("type", model.getId()); cell.setCellValue(I18nRes.findValue(ProcessListConstant.PROCESSLIST, cellValue.trim())); // 名称 - int level = model.getLevel(); - HSSFCell levelCell = row.createCell(level); - String levelCellValue = ""; - if (level <= 1) { - levelCellValue = model.getName(); - } else { - levelCellValue = getDefaultFixedValueById("no", model.getId()) + " " + model.getName(); + if (treeVisible) { + int level = model.getLevel(); + HSSFCell levelCell = row.createCell(level); + String levelCellValue = ""; + if (level <= 1) { + levelCellValue = model.getName(); + } else { + levelCellValue = getDefaultFixedValueById("no", model.getId()) + " " + model.getName(); + } + levelCell.setCellValue(levelCellValue); + // 记录合并列 + Map map = new HashMap<>(); + map.put(0, rowIndex); + map.put(1, levelCell.getColumnIndex()); + map.put(2, maxLevel + 1); + columMap.put(count, map); + count++; + cellIndex = cellIndex + maxLevel + 1;// 第一列+level所占列数+空闲一列 } - levelCell.setCellValue(levelCellValue); - // 记录合并列 - Map map = new HashMap<>(); - map.put(0, rowIndex); - map.put(1, levelCell.getColumnIndex()); - map.put(2, maxLevel + 1); - columMap.put(count, map); - count++; - cellIndex = cellIndex + maxLevel + 1;// 第一列+level所占列数+空闲一列 - // 模型名称 HSSFCell modelNameCell = row.createCell(++cellIndex); modelNameCell.setCellValue(model.getName()); @@ -1462,17 +1477,18 @@ public class PALRepositoryListWeb extends ActionWeb { * @param tableHeadConfigArr * @return */ - private List getExcelTableHeadData(String wsId, List palList, int maxLevel, JSONArray tableHeadConfigArr) { + private List getExcelTableHeadData(String wsId, List palList, int maxLevel, JSONArray tableHeadConfigArr,boolean treeVisible,boolean idVisible) { List result = new ArrayList<>(); for (int i = 0; i <= maxLevel; i++) { if (i == 0) { result.add(getExcelTitleName(I18nRes.findValue(CoEConstant.APP_ID, "流程分类"))); - } else { + } else if (treeVisible){ result.add("\n" + I18nRes.findValue(CoEConstant.APP_ID, com.actionsoft.apps.coe.pal.pal.repository.util.Number2ChineseNumUtil.convertChineseStr(String.valueOf(i))) + getExcelTitleName(I18nRes.findValue(CoEConstant.APP_ID, "级流程"))); } } - result.add("");// 空一列 - + if(treeVisible){ + result.add("");// 空一列 + } // 伊利定制化需求23-11-21 空白列与扩展列之间增加 模型名称与版本号两列 result.add("模型名称"); result.add("版本号");