diff --git a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java index 2cca87d3..51622456 100644 --- a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java +++ b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java @@ -294,7 +294,7 @@ public class Report1Gener { // 流程附件列表 UpFileDao upFileDao = new UpFileDao(); StringBuffer sqlWhere = new StringBuffer(); - sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'").append(" ORDER BY CREATETIME ASC"); + sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'").append(" ORDER BY FILENAME ASC"); List search = upFileDao.search(sqlWhere.toString()); File file = null; //三员管理下,用户密级与文件密级过滤显示 @@ -400,6 +400,7 @@ public class Report1Gener { fileIndex++; } } + fileTable.sort(Comparator.comparing(obj -> ((JSONObject) obj).getString("file_name"))); if(shapeFileTable.size() == 0) {// 没有附件时给空值,不然使用office打开会解析错误 JSONObject object = new JSONObject(); object.put("shape_file_name", ""); @@ -414,6 +415,12 @@ public class Report1Gener { JSONObject obj = dataAttributes.getJSONObject(i); String attrId = obj.getString("key"); String attrValue = obj.getString("value"); + if(attrValue.contains("<")||attrValue.contains(">")||attrValue.contains("&")||attrValue.contains("'")||attrValue.contains("\"")) { + //attrValue= attrValue.replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&").replaceAll("'", "'").replaceAll("\"", """); + attrValue= attrValue.replaceAll("<", "小于").replaceAll(">", "").replaceAll("&", "&").replaceAll("'", "'").replaceAll("\"", """); + } + + _tr.put("shape_" + attrId, attrValue.replace("\n", WRAPSTRING)); if (raciRelationType) {// 涉及部门、岗位/角色关联的是bpm组织部门、岗位、角色 if ("bpm_duty_r".equals(attrId)) { @@ -541,6 +548,8 @@ public class Report1Gener { //相关文件 R_relevant_flies JSONArray relevant_flies = new JSONArray(); try { + + //相关文件 int count = 0; String sql = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+repositoryModel.getId()+"' and PROPERTYID = 'R_relevant_flies'"; String relatFileJson = DBSql.getString(sql); @@ -559,6 +568,38 @@ public class Report1Gener { } } + + //外部相关文件 + String sqlOut = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+repositoryModel.getId()+"' and PROPERTYID = 'Out_relevant_files'"; + String outRelatFileJson = DBSql.getString(sqlOut); + if(UtilString.isNotEmpty(outRelatFileJson)) { + if(outRelatFileJson.contains(",")) { + String[] split = outRelatFileJson.split(","); + for (String str : split) { + count++; + JSONObject tmp = new JSONObject(); + tmp.put("name", str+"【外部】"); + tmp.put("desc", count); + relevant_flies.add(tmp); + } + }else if(outRelatFileJson.contains(",")) { + String[] split = outRelatFileJson.split(","); + for (String str : split) { + count++; + JSONObject tmp = new JSONObject(); + tmp.put("name", str+"【外部】"); + tmp.put("desc", count); + relevant_flies.add(tmp); + } + }else { + count++; + JSONObject tmp = new JSONObject(); + tmp.put("name", outRelatFileJson+"【外部】"); + tmp.put("desc", count); + relevant_flies.add(tmp); + } + } + } catch (Exception e) { // TODO: handle exception } @@ -622,8 +663,10 @@ public class Report1Gener { dataMap.put(OutputWordUtil.TABLE_REGULATE, regulateTable); dataMap.put(OutputWordUtil.TABLE_KPI, KPITable); ReportRepositoryCompare compare = new ReportRepositoryCompare(); - JSONArray historyVersionModify = compare.getModifyVersionHistory(repositoryId); - dataMap.put("history_table", historyVersionModify); + if(compare!=null) { + JSONArray historyVersionModify = compare.getModifyVersionHistory(repositoryId); + dataMap.put("history_table", historyVersionModify); + } return dataMap; } diff --git a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/ReportRepositoryCompare.java b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/ReportRepositoryCompare.java index 7e987c49..3e3aca93 100644 --- a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/ReportRepositoryCompare.java +++ b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/ReportRepositoryCompare.java @@ -583,9 +583,11 @@ public class ReportRepositoryCompare { // 获取属性内容 PALRepositoryPropertyModel currPropertyModel = PALRepositoryPropertyCache.getPropertyByPropertyId(currModel.getId(), model.getAttrId()); PALRepositoryPropertyModel prevPropertyModel = PALRepositoryPropertyCache.getPropertyByPropertyId(prevModel.getId(), model.getAttrId()); - String compareResult = compareTextContent(currPropertyModel.getPropertyValue(), prevPropertyModel.getPropertyValue()); - if (compareResult != null) { - result.add(assemblePropertyName(model.getAttrName()) + compareResult); + if(currPropertyModel!=null&&prevPropertyModel!=null) { + String compareResult = compareTextContent(currPropertyModel.getPropertyValue(), prevPropertyModel.getPropertyValue()); + if (compareResult != null) { + result.add(assemblePropertyName(model.getAttrName()) + compareResult); + } } } else if (model.getType().equalsIgnoreCase("relation")) {// 对比PAL关联属性 List currRelationModels = DesignerShapeRelationCache.getListByAttrId(currModel.getId(), "", model.getAttrId()); @@ -605,9 +607,11 @@ public class ReportRepositoryCompare { // 获取属性内容 PALRepositoryPropertyModel currPropertyModel = PALRepositoryPropertyCache.getPropertyByPropertyId(currModel.getId(), model.getAttrId()); PALRepositoryPropertyModel prevPropertyModel = PALRepositoryPropertyCache.getPropertyByPropertyId(prevModel.getId(), model.getAttrId()); - String compareResult = compareTextContent(currPropertyModel.getPropertyValue(), prevPropertyModel.getPropertyValue()); - if (compareResult != null) { - result.add(assemblePropertyName(model.getAttrName()) + compareResult); + if(currPropertyModel!=null&&prevPropertyModel!=null) { + String compareResult = compareTextContent(currPropertyModel.getPropertyValue(), prevPropertyModel.getPropertyValue()); + if (compareResult != null) { + result.add(assemblePropertyName(model.getAttrName()) + compareResult); + } } } } diff --git a/com.awspaas.user.apps.coe.pal.output.bd/src/com/awspaas/apps/coe/pal/output/bd/report1/Report1Gener.java b/com.awspaas.user.apps.coe.pal.output.bd/src/com/awspaas/apps/coe/pal/output/bd/report1/Report1Gener.java index d5bf8313..1605c12b 100644 --- a/com.awspaas.user.apps.coe.pal.output.bd/src/com/awspaas/apps/coe/pal/output/bd/report1/Report1Gener.java +++ b/com.awspaas.user.apps.coe.pal.output.bd/src/com/awspaas/apps/coe/pal/output/bd/report1/Report1Gener.java @@ -72,6 +72,8 @@ public class Report1Gener { * @see PlatformAPIImpl#getlanguages() */ public ResponseObject execute(OutputTaskModel model, String wizardJsonData, DCContext dcContext) { + + try { // synchronized (_lock) { // isRunning = true; @@ -224,7 +226,7 @@ public class Report1Gener { // 流程附件列表 UpFileDao upFileDao = new UpFileDao(); StringBuffer sqlWhere = new StringBuffer(); - sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'").append(" ORDER BY CREATETIME ASC"); + sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'").append(" ORDER BY FILENAME ASC"); List search = upFileDao.search(sqlWhere.toString()); File file = null; //三员管理下,用户密级与文件密级过滤显示 @@ -327,6 +329,7 @@ public class Report1Gener { fileIndex++; } } + fileTable.sort(Comparator.comparing(obj -> ((JSONObject) obj).getString("file_name"))); if(shapeFileTable.size() == 0) {// 没有附件时给空值,不然使用office打开会解析错误 JSONObject object = new JSONObject(); object.put("shape_file_name", ""); diff --git a/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java b/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java index 30ed6ea8..4922f770 100644 --- a/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java +++ b/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java @@ -453,7 +453,7 @@ public class Report1Gener { String shpId = ""; UpFileDao upFileDao = new UpFileDao(); StringBuffer sqlWhere = new StringBuffer(); - sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'").append(" ORDER BY CREATETIME ASC"); + sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'").append(" ORDER BY FILENAME ASC"); List search = upFileDao.search(sqlWhere.toString()); File file = null; //三员管理下,用户密级与文件密级过滤显示 @@ -563,6 +563,7 @@ public class Report1Gener { */ } } + fileTable.sort(Comparator.comparing(obj -> ((JSONObject) obj).getString("file_name"))); if(shapeFileTable.size() == 0) {// 没有附件时给空值,不然使用office打开会解析错误 JSONObject object = new JSONObject(); object.put("shape_file_name", ""); @@ -754,6 +755,37 @@ public class Report1Gener { } } + + //外部相关文件 + String sqlOut = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+repositoryModel.getId()+"' and PROPERTYID = 'Out_related_files'"; + String outRelatFileJson = DBSql.getString(sqlOut); + if(UtilString.isNotEmpty(outRelatFileJson)) { + if(outRelatFileJson.contains(",")) { + String[] split = outRelatFileJson.split(","); + for (String str : split) { + count++; + JSONObject tmp = new JSONObject(); + tmp.put("name", str+"【外部】"); + tmp.put("desc", count); + related_files.add(tmp); + } + }else if(outRelatFileJson.contains(",")) { + String[] split = outRelatFileJson.split(","); + for (String str : split) { + count++; + JSONObject tmp = new JSONObject(); + tmp.put("name", str+"【外部】"); + tmp.put("desc", count); + related_files.add(tmp); + } + }else { + count++; + JSONObject tmp = new JSONObject(); + tmp.put("name", outRelatFileJson+"【外部】"); + tmp.put("desc", count); + related_files.add(tmp); + } + } } catch (Exception e) { // TODO: handle exception }