角色模型过滤\手册增加外部相关文件

This commit is contained in:
zhal 2023-08-29 10:14:22 +08:00
parent 18c1062b9f
commit 442a207c52
5 changed files with 140 additions and 9 deletions

View File

@ -23,6 +23,7 @@ import com.actionsoft.bpms.server.DispatcherRequest;
import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.fs.DCContext; import com.actionsoft.bpms.server.fs.DCContext;
import com.actionsoft.bpms.server.fs.dc.DCProfileManager; import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UtilDate; import com.actionsoft.bpms.util.UtilDate;
import com.actionsoft.bpms.util.UtilFile; import com.actionsoft.bpms.util.UtilFile;
import com.actionsoft.bpms.util.UtilString; import com.actionsoft.bpms.util.UtilString;
@ -682,9 +683,6 @@ public class OutputWordUtil {
//Section section2 = doc.addSection(); //Section section2 = doc.addSection();
//相关文件 R_relevant_flies //相关文件 R_relevant_flies
JSONArray relevant_flies = new JSONArray(); //组织职责Table JSONArray relevant_flies = new JSONArray(); //组织职责Table
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "related_files"); List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "related_files");
@ -699,7 +697,6 @@ public class OutputWordUtil {
JSONObject tmp = new JSONObject(); JSONObject tmp = new JSONObject();
tmp.put("name", name); tmp.put("name", name);
tmp.put("desc", count); tmp.put("desc", count);
relevant_flies.add(tmp); relevant_flies.add(tmp);
} }
} }
@ -775,6 +772,113 @@ public class OutputWordUtil {
} }
int extercount = 0;
//外部相关文件
JSONArray ExternalCorrelationFileArray = new JSONArray(); //外部相关文件Table
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) {
extercount++;
JSONObject tmp = new JSONObject();
tmp.put("name", str+"【外部】");
tmp.put("desc", extercount);
ExternalCorrelationFileArray.add(tmp);
}
}else if(outRelatFileJson.contains("")) {
String[] split = outRelatFileJson.split("");
for (String str : split) {
extercount++;
JSONObject tmp = new JSONObject();
tmp.put("name", str+"【外部】");
tmp.put("desc", extercount);
ExternalCorrelationFileArray.add(tmp);
}
}else {
extercount++;
JSONObject tmp = new JSONObject();
tmp.put("name", outRelatFileJson+"【外部】");
tmp.put("desc", extercount);
ExternalCorrelationFileArray.add(tmp);
}
CharacterFormat format = new CharacterFormat();
//创建字体格式
format.setFontName("宋体");
//添加段落设置一级序列
Paragraph paragraph1 = section.addParagraph();
ParagraphFormat paragraphFormat1 = paragraph1.getFormat();
paragraphFormat1.setHorizontalAlignment(Left);
TextRange tr = paragraph1.appendText("外部相关文件");
tr.getCharacterFormat().setBold(true);
tr.getCharacterFormat().setFontName("宋体");
tr.getCharacterFormat().setFontSize(12);
//tr.applyCharacterFormat(format); //应用字体格式
paragraph1.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
//定义表格数据
String[] header = {"序号", "文件名称"};
String[][] strArray2 = new String[ExternalCorrelationFileArray.size()][];
List<String[]> list = new LinkedList<>();
for (int i = 0; i < ExternalCorrelationFileArray.size(); i++) {
JSONObject jsonObject = ExternalCorrelationFileArray.getJSONObject(i);
String[] strArray = new String[2];
strArray[0] = jsonObject.getString("desc").toString();
strArray[1] = jsonObject.getString("name").toString();
list.add(strArray);
strArray2[i] = strArray;
}
String[][] data = strArray2;
//添加表格
Table table = section.addTable(true);
table.resetCells(data.length + 1, header.length);
TableRow row = table.getRows().get(0);
row.isHeader(true);
row.setHeight(20);
row.setHeightType(TableRowHeightType.Auto);
for (int i = 0; i < header.length; i++) {
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
//设置固定列宽
row.getCells().get(0).setWidth(150);
row.getCells().get(1).setWidth(500);
Paragraph p = row.getCells().get(i).addParagraph();
p.getFormat().setHorizontalAlignment(Center);
TextRange txtRange = p.appendText(header[i]);
txtRange.getCharacterFormat().setBold(true);
}
//将数据添加到其余行
for (int r = 0; r < data.length; r++) {
TableRow dataRow = table.getRows().get(r + 1);
dataRow.setHeight(25);
dataRow.setHeightType(TableRowHeightType.Auto);
dataRow.getRowFormat().setBackColor(Color.white);
for (int c = 0; c < data[r].length; c++) {
dataRow.getCells().get(c).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
//设置固定列宽
dataRow.getCells().get(0).setWidth(150);
dataRow.getCells().get(1).setWidth(500);
dataRow.getCells().get(c).addParagraph().appendText(data[r][c]);
}
}
}
//支持文件 //支持文件
JSONArray supportfiles = new JSONArray(); //组织职责Table JSONArray supportfiles = new JSONArray(); //组织职责Table
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files"); List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files");

View File

@ -1487,7 +1487,7 @@ public class PALRepositoryQueryAPIManager {
public JSONArray getUsedPalRepositoryTreeDataByPidRole(UserContext context, String wsId, String pid, String ruuid, String teamId) { public JSONArray getUsedPalRepositoryTreeDataByPidRole(UserContext context, String wsId, String pid, String ruuid, String teamId) {
List<PALRepositoryModel> list = getUsedPalRepositoryModelsByPidRole(wsId, pid, ruuid); // 根据父节点Id获取使用中的子节点 List<PALRepositoryModel> list = getUsedPalRepositoryModelsByPidRole(wsId, pid, ruuid); // 根据父节点Id获取使用中的子节点
Set<String> versionIds = new HashSet<>(); Set<String> versionIds = new HashSet<>();
if (UtilString.isNotEmpty(teamId)) { /*if (UtilString.isNotEmpty(teamId)) {
UserInfo userInfo = CooperationCache.getUserInfo(teamId, context.getUID()); UserInfo userInfo = CooperationCache.getUserInfo(teamId, context.getUID());
if (userInfo != null) { if (userInfo != null) {
if (userInfo.getIsAllDataPermission()) { if (userInfo.getIsAllDataPermission()) {
@ -1506,13 +1506,13 @@ public class PALRepositoryQueryAPIManager {
} }
} }
list = modelList; list = modelList;
} }*/
//Collections.sort(list, new Comparator1()); // 按级别排序 //Collections.sort(list, new Comparator1()); // 按级别排序
JSONArray result = list2JsonRole(context, list, true, false, ruuid); JSONArray result = list2JsonRole(context, list, true, false, ruuid);
return result; return result;
} }
/** /**PAL名称重名校验uuid
* @param context * @param context
* @param wsId * @param wsId
* @param pid * @param pid

View File

@ -873,7 +873,35 @@ public class DesignerRelationShapeWeb extends ActionWeb {
} }
} }
macroLibraries.put("treeData", jsonArr_new.toString()); macroLibraries.put("treeData", jsonArr_new.toString());
} else if (attrId.equals("R_relevant_flies") || attrId.equals("related_files")) {//相关文件 }else if(attrId.equals("role")){
if (objects != null) {
for (int i = 0; i < objects.size(); i++) {
String id = objects.getJSONObject(i).getString("id");
String url = objects.getJSONObject(i).getString("url");
if (UtilString.isNotEmpty(url)) {
String titles = objects.getJSONObject(i).getString("title");
if (titles.equals("角色模型")) {
objects.getJSONObject(i).put("nocheck", true);
jsonArr_new.add(objects.getJSONObject(i));
} else {
List<Map<String, Object>> nodeElements = CoeDesignerUtil.getShapeMessageJson4(id);
if (nodeElements.size() > 0) {
String title = nodeElements.get(0).get("title").toString();
if (title.equals("角色")) {
jsonArr_new.add(objects.getJSONObject(i));
}
}
}
} else {
jsonArr_new.add(objects.getJSONObject(i));
}
}
}
macroLibraries.put("treeData", jsonArr_new.toString());
}else if (attrId.equals("R_relevant_flies") || attrId.equals("related_files")) {//相关文件
for (int i = 0; i < objects.size(); i++) { for (int i = 0; i < objects.size(); i++) {
JSONObject jsonObject = objects.getJSONObject(i); JSONObject jsonObject = objects.getJSONObject(i);
String isParent = jsonObject.getString("isParent"); String isParent = jsonObject.getString("isParent");

View File

@ -67,7 +67,6 @@ var UI = {
uuid:ruuid uuid:ruuid
}, },
success: function (r, textStatus, jqXHR) { success: function (r, textStatus, jqXHR) {
debugger;
if (r.data.result == 'ok') { if (r.data.result == 'ok') {
changeTitle(newTitle); changeTitle(newTitle);
} else { } else {