diff --git a/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml b/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml index eea4aea2..bfc139ca 100644 --- a/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml +++ b/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml @@ -8,9 +8,9 @@ - - - + + + @@ -39,5 +39,5 @@ - + diff --git a/com.actionsoft.apps.coe.pal/i18n/resource.xml b/com.actionsoft.apps.coe.pal/i18n/resource.xml index 4660941b..2596c6fc 100755 --- a/com.actionsoft.apps.coe.pal/i18n/resource.xml +++ b/com.actionsoft.apps.coe.pal/i18n/resource.xml @@ -100,7 +100,12 @@ - + + + + + + diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index f7a4c2f7..2845af26 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.custom.xml b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.custom.xml new file mode 100644 index 00000000..a9cd3849 --- /dev/null +++ b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.custom.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.custom.xml_bak b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.custom.xml_bak new file mode 100644 index 00000000..e69de29b diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.xml b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.xml new file mode 100644 index 00000000..42bccf62 --- /dev/null +++ b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.attribute.xml @@ -0,0 +1,40 @@ + + + + + + + + + + diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.import.xml b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.import.xml new file mode 100644 index 00000000..80d95940 --- /dev/null +++ b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.import.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.linker.xml b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.linker.xml new file mode 100644 index 00000000..696f0dd3 --- /dev/null +++ b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.linker.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.schema.tpl b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.schema.tpl new file mode 100644 index 00000000..c14af3fa --- /dev/null +++ b/com.actionsoft.apps.coe.pal/method/control.oaApprove/diagram.schema.tpl @@ -0,0 +1,103 @@ +/** + * Policy + */ + +Schema.addCategory({ + name: "control_oaApprove", + text: "OA审批流程图", + dataAttributes: [] +}); +/* Regulation*/ +Schema.addShape({name:"regulation", title:"制度",text:"制度", category:"control_oaApprove",lineStyle:{lineWidth: 1}, props:{w:150, h:66}, anchors:[ + {x:"w*0.5", y:"0"}, + {x:"w", y:"h*0.5"}, + {x:"w*0.5", y:"h-Math.min(h/8,w/12)"}, + {x:"0", y:"h*0.5"} +], textBlock:{x:"0", y:"0", w:"w", h:"h*0.9"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"}, path:[ + {actions:[ + {action:"move", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"line", x:"0", y:"0"}, + {action:"line", x:"w", y:"0"}, + {action:"line", x:"w", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.75", y1:"h-3*Math.min(h/8,w/12)", x:"w*0.5", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.25", y1:"h+Math.min(h/8,w/12)", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"close"} + ]}, + {actions:[ + {action:"move",x:"w", y:"h*0.4"}, + {action:"line",x:"w*0.76",y:"h-2*Math.min(h/8,w/12)"} + ]}, + {lineStyle:{lineStyle:"none"}, fillStyle:{type:"none"}, actions:[ + {action:"move", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"line", x:"0", y:"0"}, + {action:"line", x:"w", y:"0"}, + {action:"line", x:"w", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.75", y1:"h-3*Math.min(h/8,w/12)", x:"w*0.5", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.25", y1:"h+Math.min(h/8,w/12)", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"close"} + ]} +]}); + +Schema.addShape({name:"I/O_L4", title:"操作指导",text:"操作指导", category:"control_oaApprove",lineStyle:{lineWidth: 1}, props:{w:150, h:66}, anchors:[ + {x:"w*0.5", y:"0"}, + {x:"w", y:"h*0.5"}, + {x:"w*0.5", y:"h-Math.min(h/8,w/12)"}, + {x:"0", y:"h*0.5"} +], textBlock:{x:"0", y:"0", w:"w", h:"h*0.9"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"}, path:[ + {actions:[ + {action:"move", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"line", x:"0", y:"0"}, + {action:"line", x:"w", y:"0"}, + {action:"line", x:"w", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.75", y1:"h-3*Math.min(h/8,w/12)", x:"w*0.5", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.25", y1:"h+Math.min(h/8,w/12)", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"close"} + ]}, + {lineStyle:{lineStyle:"none"}, fillStyle:{type:"none"}, actions:[ + {action:"move", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"line", x:"0", y:"0"}, + {action:"line", x:"w", y:"0"}, + {action:"line", x:"w", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.75", y1:"h-3*Math.min(h/8,w/12)", x:"w*0.5", y:"h-Math.min(h/8,w/12)"}, + {action:"quadraticCurve", x1:"w*0.25", y1:"h+Math.min(h/8,w/12)", x:"0", y:"h-Math.min(h/8,w/12)"}, + {action:"move", x:"Math.min(w/6,20)", y:"0"}, + {action:"line", x:"Math.min(w/6,20)", y:"h"}, + {action:"move", x:"0", y:"Math.min(h/5,20)"}, + {action:"line", x:"w", y:"Math.min(h/5,20)"}, + {action:"close"} + ]} +]}); + + +/*Item*/ +Schema.addShape({name:"item1", title:"段落正文",text:"段落正文", category:"control_oaApprove", lineStyle:{lineWidth: 1}, +props:{w:220, h:50}, textBlock:{x:"w*0.1", y:"2", w:"(w-Math.min(h/2,w/6))*0.8", h:"h-2"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"}, anchors:[ + {x:"w*0.5", y:"0"}, + {x:"w-Math.min(h/2,w/6)", y:"h*0.5"}, + {x:"w*0.5", y:"h"}, + {x:"0", y:"h*0.5"} +],path:[ + {actions:[ + {action:"move", x:"0", y:"0"}, + {action:"line", x:"w", y:"0"}, + {action:"line", x:"w-Math.min(h/2,w/6)", y:"h*0.5"}, + {action:"line", x:"w", y:"h"}, + {action:"line", x:"0", y:"h"}, + {action:"line", x:"0", y:"0"}, + {action:"close"} + ]} +]}); + + +/***胶囊型:Terminator*/Schema.addShape({name:"item2", title:"条款", text:"条款", category:"control_oaApprove",lineStyle:{lineWidth: 1}, + props:{w:220, h:50},textBlock:{x:"Math.min(w,h)/3", y:"2", w:"w-(Math.min(w,h)/3)*2", h:"h-2"}, path:[ + {actions:[ + {action:"move", x:"Math.min(w,h)/3+5", y:"0"}, + {action:"line", x:"w-Math.min(w,h)/3-5", y:"0"}, + {action:"curve", x1:"w+Math.min(w,h)/3/3", y1:"0", x2:"w+Math.min(w,h)/3/3", y2:"h", x:"w-Math.min(w,h)/3-5", y:"h"}, + {action:"line", x:"Math.min(w,h)/3+5", y:"h"}, + {action:"curve", x1:"-Math.min(w,h)/3/3", y1:"h", x2:"-Math.min(w,h)/3/3", y2:"0", x:"Math.min(w,h)/3+5", y:"0"}, + {action:"close"} + ]} + +]}); diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/abc.tpl b/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/abc.tpl new file mode 100644 index 00000000..e69de29b diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/diagram.attribute.custom.xml b/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/diagram.attribute.custom.xml new file mode 100644 index 00000000..1e0ea495 --- /dev/null +++ b/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/diagram.attribute.custom.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/diagram.attribute.xml b/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/diagram.attribute.xml new file mode 100644 index 00000000..42bccf62 --- /dev/null +++ b/com.actionsoft.apps.coe.pal/method/control.oaApprove/fragment/diagram.attribute.xml @@ -0,0 +1,40 @@ + + + + + + + + + + diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/cache/PALMethodCache.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/cache/PALMethodCache.java index 26b76798..59cb0261 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/cache/PALMethodCache.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/cache/PALMethodCache.java @@ -75,7 +75,7 @@ public class PALMethodCache { } //如果是控制类过滤到制度图 if (method.equals("control")) { - if (k.equals("control.policy")) { + if (k.equals("control.policy") ||k.equals("control.oaApprove")) { continue; } } @@ -87,6 +87,7 @@ public class PALMethodCache { list.add(pmppMap.get("data.form")); list.add(pmppMap.get("control.policy")); list.add(pmppMap.get("engineering.standard")); + list.add(pmppMap.get("control.oaApprove")); } temp.put(method, list); } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/model/PALMethodModel.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/model/PALMethodModel.java index b8384db0..dd17ff3b 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/model/PALMethodModel.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/method/model/PALMethodModel.java @@ -162,6 +162,7 @@ public final class PALMethodModel { case "control.ma": name = "L1-L3流程绩效指标";break; case "process.scheme": name = "方案图";break; case "engineering.standard": name = "工程技术标准";break; + case "control.oaApprove": name = "OA审批流程";break; } return name; } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java index 0a1e87a4..bf78a50f 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java @@ -2930,45 +2930,42 @@ public class OutputWordUtil { } } } else if ("活动说明后".equals(text)) { - boolean foundProcessDesc = false; // 标记已找到“3. 流程说明”标题 - int lastTableParaIndex = -1; // 记录流程说明表格最后一行的索引 + + + boolean processDescriptionFound = false; + boolean tableFoundAfterDescription = false; for (Object obj : docs1.getSections()) { Section sec = (Section) obj; int i = 0; for (Object paragraph : sec.getParagraphs()) { - Paragraph para = (Paragraph) paragraph; + Paragraph para = (Paragraph)paragraph; String paraText = para.getText().trim(); - - // 修正1:匹配文件中实际的“3. 流程说明”标题(含#和数字) if (paraText.contains("3. 流程说明") || paraText.contains("流程说明")) { - foundProcessDesc = true; + processDescriptionFound = true; + tableFoundAfterDescription = false; continue; } - // 修正2:在“流程说明”后,持续追踪表格最后一行(含|符号) - if (foundProcessDesc) { - // 表格行含|(如“|01|线上审批55555|...”) - if (paraText.contains("|")) { - lastTableParaIndex = i; // 持续更新表格最后一行索引 - } else { - // 遇到非表格内容时,插入位置为表格最后一行的下一行 - if (lastTableParaIndex != -1) { - targetParaIndex = i; // 插入到当前非表格段落前(即表格下方) - targetPara = para; - targetSection = sec; - break; - } + if (processDescriptionFound) { + boolean tableFound = false; + Iterator iterator = sec.getTables().iterator(); + if (iterator.hasNext()) { + Table table = iterator.next(); + tableFoundAfterDescription = true; + targetPara = sec.addParagraph(); + targetParaIndex = i + 2; + targetSection = sec; } + if (tableFoundAfterDescription) + break; } i++; } - - - if (targetPara != null) { + if (targetPara != null) break; - } } } + // 未找到目标位置则退出 if (targetPara == null || targetSection == null) { return; @@ -3012,6 +3009,59 @@ public class OutputWordUtil { docs2.dispose(); } + + + public static List extractAllTables(String filePath) { + List tablesContent = new ArrayList<>(); + Document doc = new Document(); + doc.loadFromFile(filePath); + for (Object obj : doc.getSections()) { + Section sec = (Section) obj; + for (Object table : sec.getTables()) { + System.out.println("talble=" + table); + Table table1 = (Table) obj; + tablesContent.add(extractTableContent(table1)); + } + } + return tablesContent; + } + + + private static String extractTableContent(Table table) { + StringBuilder tableContent = new StringBuilder(); + int rowCount = table.getRows().getCount(); + int colCount = 0; + if (rowCount > 0) + colCount = table.getRows().get(0).getCells().getCount(); + tableContent.append("(").append(rowCount).append("").append(colCount).append("\n"); + for (int i = 0; i < rowCount; i++) { + TableRow row = table.getRows().get(i); + for (int j = 0; j < row.getCells().getCount(); j++) { + TableCell cell = row.getCells().get(j); + String cellText = extractCellContent(cell); + System.out.println("cellText====" + cellText); + tableContent.append(cellText); + if (j < row.getCells().getCount() - 1) + tableContent.append("\t"); + } + tableContent.append("\n"); + } + return tableContent.toString(); + } + + + private static String extractCellContent(TableCell cell) { + StringBuilder cellContent = new StringBuilder(); + for (int k = 0; k < cell.getParagraphs().getCount(); k++) { + Paragraph para = cell.getParagraphs().get(k); + cellContent.append(para.getText()); + if (k < cell.getParagraphs().getCount() - 1) + cellContent.append("\n"); + } + return cellContent.toString(); + } + + // 新增:清除文档中的分页符(针对文档2) private static void clearPageBreaks(Document doc) { for (Object obj : doc.getSections()) { diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index 6ace04d0..339ea998 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -8699,7 +8699,7 @@ public class CoeProcessLevelWeb extends ActionWeb { methodObj.put("havingCreatePerm", true); } else if (category.equals("control") && model.getSchema().contains("制度图")) { methodObj.put("havingCreatePerm", false); - } else if (category.equals("control") && model.getSchema().contains("末级流程绩效")) { + }else if (category.equals("control") && model.getSchema().contains("末级流程绩效")) { methodObj.put("havingCreatePerm", false); } else if (model.getId().equals("process.framework") && !_uc.getUID().equals("admin")) { methodObj.put("havingCreatePerm", false); @@ -13100,7 +13100,7 @@ public class CoeProcessLevelWeb extends ActionWeb { JSONArray methodIds = new JSONArray(); List process = PALMethodCache.getPALMethodModelListByMethod("process"); for (PALMethodModel methodModel : process) { - if ("control.policy".equals(methodModel.getId()) || "data.form".equals(methodModel.getId()) || "process.epc".equals(methodModel.getId()) || "process.bpmn2".equals(methodModel.getId()) || "process.flowchart".equals(methodModel.getId()) || "process.evc".equals(methodModel.getId()) ||"process.scheme".equals(methodModel.getId()) || "engineering.standard".equals(methodModel.getId())) { + if ("control.policy".equals(methodModel.getId()) || "data.form".equals(methodModel.getId()) || "process.epc".equals(methodModel.getId()) || "process.bpmn2".equals(methodModel.getId()) || "process.flowchart".equals(methodModel.getId()) || "process.evc".equals(methodModel.getId()) ||"process.scheme".equals(methodModel.getId()) || "engineering.standard".equals(methodModel.getId()) || "control.oaApprove".equals(methodModel.getId())) { JSONObject methodId = new JSONObject(); methodId.put("methodId", methodModel.getId()); methodId.put("name", methodModel.getMethodName()); @@ -13118,7 +13118,7 @@ public class CoeProcessLevelWeb extends ActionWeb { } List control = PALMethodCache.getPALMethodModelListByMethod("control"); for (PALMethodModel methodModel : control) { - if ("control.policy".equals(methodModel.getId()) || "control.ma".equals(methodModel.getId()) || "control.risk".equals(methodModel.getId()) || "control.kpi".equals(methodModel.getId())) { + if ("control.policy".equals(methodModel.getId()) || "control.ma".equals(methodModel.getId()) || "control.risk".equals(methodModel.getId()) || "control.kpi".equals(methodModel.getId()) || "control.oaApprove".equals(methodModel.getId()) ) { JSONObject methodId = new JSONObject(); methodId.put("methodId", methodModel.getId()); methodId.put("name", methodModel.getMethodName()); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/plugin/StartListener.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/plugin/StartListener.java index b746ab6b..420330db 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/plugin/StartListener.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/plugin/StartListener.java @@ -310,6 +310,8 @@ public class StartListener implements AppListener{ MethodAppManager.register("control.risk", appContext, "control.risk", "risk建模方法"); MethodAppManager.register("control.kpi", appContext, "control.kpi", "kpi建模方法"); + MethodAppManager.register("control.oaApprove", appContext, "control.oaApprove", "OA"); + // 是否开启业务层级、业务域、流程组建模方法 if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "OPEN_BUSINESS_METHOD", false)) { MethodAppManager.register("process.businessLevel", appContext, "process.businessLevel", "业务层级建模方法", true); diff --git a/com.actionsoft.apps.coe.pal/template/page/main.htm b/com.actionsoft.apps.coe.pal/template/page/main.htm index dabc46de..99f52525 100644 --- a/com.actionsoft.apps.coe.pal/template/page/main.htm +++ b/com.actionsoft.apps.coe.pal/template/page/main.htm @@ -13,4 +13,4 @@ var mainType = "<#mainType>"; var uid = "<#uid>"; var wHref = "./w"; - var jdHref = "./jd";
\ No newline at end of file + var jdHref = "./jd";
\ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.html b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.html index c9390e41..1d06c62b 100755 --- a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.html +++ b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.html @@ -1802,9 +1802,8 @@