parent
7cc9c53871
commit
ef968b55c1
Binary file not shown.
@ -1184,10 +1184,6 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
List<PALRepositoryPropertyModel> propertyModelList = propertyDao.queryByWsId(wsId);
|
||||
long s3 = System.currentTimeMillis();
|
||||
List<Long> tempLongList = new ArrayList<>();
|
||||
|
||||
// 扩展属性
|
||||
boolean extendAttr = tempArr.stream().anyMatch(item -> ((JSONObject) item).getString("columnType").equals("extendAttr"));
|
||||
|
||||
for (int i = 0; i < palList.size(); i++) {
|
||||
PALRepositoryModel model = palList.get(i);
|
||||
rowIndex++;
|
||||
@ -1228,10 +1224,37 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
count++;
|
||||
cellIndex = cellIndex + maxLevel + 1;// 第一列+level所占列数+空闲一列
|
||||
long s5 = System.currentTimeMillis();
|
||||
|
||||
// 扩展属性
|
||||
boolean extendAttr = false;
|
||||
for (int j = 0; j < tempArr.size(); j++) {
|
||||
JSONObject object = tempArr.getJSONObject(j);
|
||||
if ("extendAttr".equals(object.getString("columnType"))) {
|
||||
extendAttr = true;
|
||||
}
|
||||
}
|
||||
// 获取所有扩展属性的值
|
||||
JSONObject extendAttrValObj = new JSONObject();
|
||||
List<PALRepositoryPropertyModel> props = propertyModelList.stream().filter(prop -> {return prop.getPlId().equals(model.getId());}).collect(Collectors.toList());
|
||||
if (extendAttr) {// 如果表格中没有更多特性,则不查询,节省时间
|
||||
if(null!=model) {
|
||||
try {
|
||||
extendAttrValObj = ProcessListUtil.getProcessLevelPropertyVal(model.getId(), model, props);
|
||||
} catch (Exception e) {
|
||||
System.err.println("清单无法导出的模型ID:"+model.getId());
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Iterator iter = extendAttrValObj.entrySet().iterator();
|
||||
JSONObject object = new JSONObject();
|
||||
while (iter.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry) iter.next();
|
||||
JSONObject valueObj = JSONObject.parseObject(entry.getValue().toString());
|
||||
object.put(valueObj.getString("key"), valueObj.getString("value"));
|
||||
}
|
||||
extendAttrValObj = object;
|
||||
|
||||
int parentNameCellIndex = 0;
|
||||
for (int j = 0; j < tempArr.size(); j++) {
|
||||
HSSFCell attrCell = row.createCell(++cellIndex);
|
||||
@ -1250,17 +1273,6 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
}
|
||||
// 扩展列
|
||||
if ("extendAttr".equals(config.getString("columnType"))) {
|
||||
JSONObject extendAttrValObj = new JSONObject();
|
||||
List<PALRepositoryPropertyModel> props = propertyModelList.stream().filter(prop -> {return prop.getPlId().equals(model.getId());}).collect(Collectors.toList());
|
||||
extendAttrValObj = ProcessListUtil.getProcessLevelPropertyVal(model.getId(), model, props);
|
||||
Iterator iter = extendAttrValObj.entrySet().iterator();
|
||||
JSONObject object = new JSONObject();
|
||||
while (iter.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry) iter.next();
|
||||
JSONObject valueObj = JSONObject.parseObject(entry.getValue().toString());
|
||||
object.put(valueObj.getString("key"), valueObj.getString("value"));
|
||||
}
|
||||
extendAttrValObj = object;
|
||||
if (extendAttrValObj.containsKey(propId)) {
|
||||
attrCellValue = extendAttrValObj.getString(propId);
|
||||
}
|
||||
@ -1272,19 +1284,14 @@ public class PALRepositoryListWeb extends ActionWeb {
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
System.err.println("清单无法导出的模型ID:"+model.getId());
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
|
||||
// for (int j = 0; j <= cellIndex; j++) {
|
||||
// HSSFCell tempCell = row.getCell(j);
|
||||
// if (tempCell == null) {
|
||||
// tempCell = row.createCell(j);
|
||||
// }
|
||||
// tempCell.setCellStyle(styleData);
|
||||
// }
|
||||
for (int j = 0; j <= cellIndex; j++) {
|
||||
HSSFCell tempCell = row.getCell(j);
|
||||
if (tempCell == null) {
|
||||
tempCell = row.createCell(j);
|
||||
}
|
||||
tempCell.setCellStyle(styleData);
|
||||
}
|
||||
}
|
||||
ConsolePrinter.info("扩展属性处理时长详细: " + tempLongList.toString());
|
||||
ConsolePrinter.info("扩展属性处理平均时长: " + tempLongList.stream().mapToLong(Long::longValue).average().orElse(0.0));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user