流程清单 导出接口 加计算执行时长日志(后续删除)
This commit is contained in:
parent
44a8724d10
commit
29b750e0f7
Binary file not shown.
@ -31,6 +31,7 @@ import com.actionsoft.apps.coe.pal.processlist.model.ProcessListConfigModel;
|
||||
import com.actionsoft.apps.coe.pal.processlist.util.ProcessListUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.SubUtil;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.util.ConsolePrinter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -1077,6 +1078,7 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
* @param conditions
|
||||
*/
|
||||
private void exportSheetData2(HSSFWorkbook wb, HSSFSheet sheet, int rowIndex, short columnIndex, String wsId, String teamId, JSONObject conditions) {
|
||||
long s1 = System.currentTimeMillis();
|
||||
HSSFFont font = wb.createFont();
|
||||
HSSFCellStyle styleHead = wb.createCellStyle();
|
||||
styleHead.setFillForegroundColor(HSSFColor.BLUE_GREY.index);
|
||||
@ -1108,6 +1110,9 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
String tableFilter = conditions.getString("tableFilter");
|
||||
String customFilter = conditions.getString("customFilter");
|
||||
List<PALRepositoryModel> palList = getFilteredPalRepositoryList(wsId, teamId, category, searchInput, levelValue, tableFilter, customFilter);
|
||||
long e1 = System.currentTimeMillis();
|
||||
ConsolePrinter.info("计算符合筛选条件的模型数据时间: " + (e1 - s1));
|
||||
long s2 = System.currentTimeMillis();
|
||||
// 获取配置信息
|
||||
JSONArray tableHeadConfigArr = getProcessListTableHeaderData(wsId, category);
|
||||
// 获取展现到Excel的扩展字段
|
||||
@ -1150,6 +1155,8 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
sheet.createFreezePane(1, 3); // 前三列冻结
|
||||
long e2 = System.currentTimeMillis();
|
||||
ConsolePrinter.info("处理表头数据时间: " + (e2 - s2));
|
||||
// 合并列的信息
|
||||
Map columMap = new HashMap();
|
||||
int count = 0;
|
||||
@ -1164,6 +1171,8 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
styleData.setTopBorderColor(HSSFColor.BLACK.index);
|
||||
PALRepositoryPropertyDao propertyDao = new PALRepositoryPropertyDao();
|
||||
List<PALRepositoryPropertyModel> propertyModelList = propertyDao.queryByWsId(wsId);
|
||||
long s3 = System.currentTimeMillis();
|
||||
List<Long> tempLongList = new ArrayList<>();
|
||||
for (int i = 0; i < palList.size(); i++) {
|
||||
PALRepositoryModel model = palList.get(i);
|
||||
rowIndex++;
|
||||
@ -1203,6 +1212,7 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
columMap.put(count, map);
|
||||
count++;
|
||||
cellIndex = cellIndex + maxLevel + 1;// 第一列+level所占列数+空闲一列
|
||||
long s5 = System.currentTimeMillis();
|
||||
// 扩展属性
|
||||
boolean extendAttr = false;
|
||||
for (int j = 0; j < tempArr.size(); j++) {
|
||||
@ -1258,7 +1268,8 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
}
|
||||
attrCell.setCellValue(attrCellValue);
|
||||
}
|
||||
|
||||
long e5 = System.currentTimeMillis();
|
||||
tempLongList.add(e5 - s5);
|
||||
HSSFCell attrCell = row.createCell(parentNameCellIndex);
|
||||
String parentName = model.getParentId().length() < 36 ? I18nRes.findValue(CoEConstant.APP_ID,model.getParentId()) : PALRepositoryCache.getCache().get(model.getParentId()).getName();
|
||||
attrCell.setCellValue(parentName);
|
||||
@ -1271,6 +1282,10 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
tempCell.setCellStyle(styleData);
|
||||
}
|
||||
}
|
||||
ConsolePrinter.info("扩展属性处理平均时长: " + tempLongList.stream().mapToLong(Long::longValue).average().orElse(0.0));
|
||||
long e3 = System.currentTimeMillis();
|
||||
ConsolePrinter.info("处理模型数据--非合并时间: " + (e3 - s3));
|
||||
long s4 = System.currentTimeMillis();
|
||||
// 将已经存在的数据进行合并单元格
|
||||
if (columMap.size() > 0) {
|
||||
for (int i = 0; i < columMap.size(); i++) {
|
||||
@ -1279,12 +1294,16 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
int rowindex = (Integer) data.get(0);
|
||||
int fromColumnIndex = (Integer) data.get(1);
|
||||
int toColumnIndex = (Integer) data.get(2);
|
||||
CellRangeAddress region = new CellRangeAddress((short) rowindex, (short) rowindex, (short) fromColumnIndex, (short) toColumnIndex);// 合并从第rowFrom行columnFrom列
|
||||
sheet.addMergedRegion(region);// 到rowTo行columnTo的区域
|
||||
if (rowindex >= 0){
|
||||
CellRangeAddress region = new CellRangeAddress((short) rowindex, (short) rowindex, (short) fromColumnIndex, (short) toColumnIndex);// 合并从第rowFrom行columnFrom列
|
||||
sheet.addMergedRegion(region);// 到rowTo行columnTo的区域
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
long e4 = System.currentTimeMillis();
|
||||
ConsolePrinter.info("处理模型数据--合并时间 " + (e4 - s4));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user