From a21a504b5eadd5ec7c41446fdc33d56049802f9b Mon Sep 17 00:00:00 2001 From: lihongyu <504404568@qq.com> Date: Tue, 23 Aug 2022 14:45:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E5=BA=A6=E5=AF=BC=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E6=AE=B5=E8=90=BD=E7=94=A8=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E7=9A=84=E5=BD=A2=E7=8A=B6=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/readword/WordUtilXWPF.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java index eead919f..2bb3e62d 100644 --- a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java +++ b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java @@ -263,7 +263,7 @@ public class WordUtilXWPF { y += 1; } - shap = getSharp(x, y, countall, len, tmpshap, para.getParagraphText()); + shap = getSharp(x, y, countall, len, tmpshap, para.getParagraphText(),"item2"); shap.put("id", shapeId1); shap.put("text", getShowText(para.getParagraphText())); shap.put("level", nowlevel); @@ -345,7 +345,7 @@ public class WordUtilXWPF { x = 1; JSONObject tmpshap = onlinedata.getJSONObject(lastindex); //根据上一个位置计算当前位置 - shap = getSharp(x, y, countall, len, tmpshap, strb.toString()); + shap = getSharp(x, y, countall, len, tmpshap, strb.toString(),"item1"); shap.put("id", shapeId1); shap.put("text", getShowText(strb.toString()).replaceAll("\n", "")); //shap.put("p", pnode); @@ -467,7 +467,7 @@ public class WordUtilXWPF { countall += 1; lastindex = 0; int len = para.getParagraphText().length() / 8 - 2; - shap = getSharp(x, y, countall, len, null, ""); + shap = getSharp(x, y, countall, len, null, "","item1"); shap.put("id", shapeId1); shap.put("text", para.getParagraphText()); } @@ -493,7 +493,7 @@ public class WordUtilXWPF { } lastindex = 1; int len = para.getParagraphText().length() / 8 - 2; - shap = getSharp(x, y, countall, len, null, ""); + shap = getSharp(x, y, countall, len, null, "","item2"); shap.put("id", shapeId1); shap.put("text", para.getParagraphText()); leoj = shap; @@ -517,7 +517,7 @@ public class WordUtilXWPF { } lastindex = 2; int len = para.getParagraphText().length() / 8 - 2; - shap = getSharp(x, y, countall, len, null, ""); + shap = getSharp(x, y, countall, len, null, "","item2"); shap.put("id", shapeId1); shap.put("text", para.getParagraphText()); letj = shap; @@ -545,7 +545,7 @@ public class WordUtilXWPF { tmpshap = leoj; } int len = para.getParagraphText().length() / 8 - 2; - shap = getSharp(x, y, countall, len, null, ""); + shap = getSharp(x, y, countall, len, null, "","item2"); shap.put("id", shapeId1); shap.put("text", para.getParagraphText()); craetline(elements, tmpshap, shap, countall); @@ -608,9 +608,10 @@ public class WordUtilXWPF { elements.put(linkerId, linkerObj); } - public JSONObject getSharp(int x, int y, int zindex, int len, JSONObject lastshap, String str) { + public JSONObject getSharp(int x, int y, int zindex, int len, JSONObject lastshap, String str,String type) { // String shapeId1 = UUIDGener.getObjectId(); - JSONObject shape1 = ShapeUtil.getProcessShapeDefinitionByName("control.policy", "item"); + + JSONObject shape1 = ShapeUtil.getProcessShapeDefinitionByName("control.policy", type); // shape1.put("id", shapeId1); JSONArray attribute = shape1.getJSONArray("dataAttributes").getJSONObject(0).getJSONArray("attributesJsonArray"); JSONObject tmp = new JSONObject(); @@ -638,7 +639,11 @@ public class WordUtilXWPF { props1.put("x", xtmp); props1.put("y", 100 * y); //props1.put("w", 150 + (len * 35)); - props1.put("w", 325); + if("item1".equals(type)) { + props1.put("w", 385); + }else { + props1.put("w", 325); + } props1.put("h", 50); //System.out.println("坐标为:x" + xtmp + " y:" + y); props1.put("zindex", zindex);