制度导入,识别段落用不同的形状显示。

This commit is contained in:
lihongyu 2022-08-23 14:45:29 +08:00
parent bc6d0f9d01
commit a21a504b5e

View File

@ -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);