制度手册使用spire生成手册
This commit is contained in:
parent
24fd1ab36d
commit
db1ef96d41
Binary file not shown.
@ -1,21 +1,13 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.output;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.FutureTask;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.constant.OutputConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
@ -25,14 +17,16 @@ import com.actionsoft.bpms.util.ClassReflect;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.bpms.util.UtilFile;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.constant.OutputConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
||||
import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.FutureTask;
|
||||
|
||||
/**
|
||||
* 报告生成器内部API封装
|
||||
@ -66,11 +60,9 @@ public class OutputAPIManager {
|
||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
|
||||
// --------dc context-----------
|
||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||
System.out.println("这是一个什么东西>>>>>>"+dcProfile);
|
||||
if (dcProfile == null)
|
||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
|
||||
System.out.println("dc里边的是什么东西>>>>>>>>>>>>"+dcContext);
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = new ByteArrayInputStream(jsonData.getBytes("UTF-8"));
|
||||
|
||||
@ -1,26 +1,46 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.output.util;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.org.model.RoleModel;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.server.DispatcherRequest;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.fs.DCContext;
|
||||
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||
import com.actionsoft.bpms.util.UtilFile;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sini.com.spire.doc.*;
|
||||
import com.sini.com.spire.doc.collections.SectionCollection;
|
||||
import com.sini.com.spire.doc.documents.*;
|
||||
import com.sini.com.spire.doc.fields.DocPicture;
|
||||
import com.sini.com.spire.doc.fields.TextRange;
|
||||
import com.sini.com.spire.doc.formatting.CharacterFormat;
|
||||
import com.sini.com.spire.doc.formatting.ParagraphFormat;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.Template;
|
||||
import freemarker.template.TemplateException;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class OutputWordUtil {
|
||||
@ -186,6 +206,719 @@ public class OutputWordUtil {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成word文件
|
||||
*
|
||||
* @param dataMap
|
||||
* @param tempPath
|
||||
* @param tempName
|
||||
* @param docName
|
||||
*/
|
||||
public static void createZdDoc2(JSONObject dataMap, String tempPath, String tempName, String docName, JSONObject wizardJsonData, String repositoryId, String docPath) throws FileNotFoundException {
|
||||
Configuration configuration = new Configuration();
|
||||
configuration.setDefaultEncoding("UTF-8");
|
||||
|
||||
// 设置模本装置方法和路径
|
||||
try {
|
||||
UtilFile temps = new UtilFile(tempPath);
|
||||
configuration.setDirectoryForTemplateLoading(temps);
|
||||
} catch (IOException e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
Template t = null;
|
||||
try {
|
||||
t = configuration.getTemplate(tempName, "UTF-8");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 输出文档路径及名称
|
||||
File outFile = new File(docName);
|
||||
Writer out = null;
|
||||
try {
|
||||
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8"));
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (t != null && out != null) {
|
||||
t.process(dataMap, out);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
} catch (TemplateException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
//***********************************************************使用spire 生成模板后复制文件****************************************************/
|
||||
List<Map<String, Object>> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(repositoryId); //流程文件内容
|
||||
if (wizardJsonData.getBoolean("orderNuberFirst")) { // 根据页面选择进行排序
|
||||
OutputWordUtil.orderByNumber(repositoryFileElements);
|
||||
}
|
||||
|
||||
String controlShapeId = "";
|
||||
if (repositoryFileElements != null) {
|
||||
int index = 1;// 流程步骤序号
|
||||
int dangerIndex = 1;// 风险序号
|
||||
int regulateIndex = 1;// 控制序号
|
||||
for (Map<String, Object> shape : repositoryFileElements) {
|
||||
String type = shape.get("type").toString();
|
||||
if ("regulation".equals(type)) {
|
||||
controlShapeId = shape.get("id").toString();
|
||||
} else if ("I/O_L4".equals(type)) {
|
||||
controlShapeId = shape.get("id").toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UserContext userContext = DispatcherRequest.getUserContext();
|
||||
|
||||
Map<String, String> result = new HashMap<>();
|
||||
result.put("listDef", "");
|
||||
result.put("content", "");
|
||||
if (UtilString.isEmpty(controlShapeId)) {
|
||||
|
||||
}
|
||||
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId);
|
||||
if (repositoryModel == null) {
|
||||
|
||||
}
|
||||
String content = "";
|
||||
StringBuilder listStr = new StringBuilder();
|
||||
// 读取附件
|
||||
// 流程附件列表
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
List<UpfileModel> search = upFileDao.search(repositoryModel.getId(), controlShapeId, null);
|
||||
|
||||
DCContext dcContextpdf = null;
|
||||
File file = null;
|
||||
|
||||
|
||||
if (search != null && search.size() > 0) {
|
||||
long b1 = System.currentTimeMillis();
|
||||
// 复制附件
|
||||
for (UpfileModel upfileModel : search) {
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||
|
||||
if (dcProfile != null) {
|
||||
dcContextpdf = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), upfileModel.getFileName());
|
||||
String path = dcContextpdf.getPath();
|
||||
String fileName = dcContextpdf.getFileName();
|
||||
|
||||
//创建 Document 类的对象并从磁盘加载 Word 文档
|
||||
Document document = new Document(outFile.getPath());
|
||||
|
||||
/*//获取最后一节
|
||||
Section section = document.getLastSection();
|
||||
Paragraph paragraph = section.addParagraph();
|
||||
|
||||
paragraph.appendBreak(BreakType.Page_Break);*/
|
||||
|
||||
|
||||
String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
|
||||
if (suffix.equals("xml")) {
|
||||
// 输出文档路径及名称
|
||||
File sourceFile = new UtilFile(path + fileName);
|
||||
File targetFile = new UtilFile(docPath + fileName);
|
||||
try {
|
||||
UtilFile.copyFile(sourceFile, targetFile);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//创建实例,加载xml测试文档
|
||||
com.sini.com.spire.doc.Document doc = new com.sini.com.spire.doc.Document();
|
||||
doc.loadFromFile(docPath + fileName);
|
||||
|
||||
//保存为xml格式
|
||||
String substring = fileName.substring(0, fileName.lastIndexOf(".xml"));
|
||||
//保存为Word
|
||||
doc.saveToFile(docPath + substring + ".docx", FileFormat.Docx);//支持.doc
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (suffix.equals("xml")) {
|
||||
//保存为xml格式
|
||||
String substring = fileName.substring(0, fileName.lastIndexOf(".xml"));
|
||||
//保存为Word
|
||||
document.insertTextFromFile(docPath + substring + ".docx", FileFormat.Docx_2013);
|
||||
} else {
|
||||
document.insertTextFromFile(path + fileName, FileFormat.Docx_2013);
|
||||
}
|
||||
// document.insertTextFromFile("/Users/sunlh/Downloads/手册格式问题测试文档(3)new.docx", FileFormat.Docx_2013);
|
||||
//保存结果文档
|
||||
document.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
||||
|
||||
|
||||
//加载文档1
|
||||
com.sini.com.spire.doc.Document doc1 = new com.sini.com.spire.doc.Document();
|
||||
doc1.loadFromFile(tempPath + "制度-手册5.doc");
|
||||
|
||||
|
||||
//获取section
|
||||
Section section1 = doc1.getSections().get(0);
|
||||
|
||||
//获取文档1的页眉页脚
|
||||
HeaderFooter headerword = section1.getHeadersFooters().getHeader();
|
||||
HeaderFooter footerword = section1.getHeadersFooters().getFooter();
|
||||
|
||||
//加载文档2
|
||||
com.sini.com.spire.doc.Document doc2 = new com.sini.com.spire.doc.Document();
|
||||
|
||||
|
||||
doc2.loadFromFile(outFile.getPath());
|
||||
|
||||
|
||||
SectionCollection sections = doc2.getSections();
|
||||
|
||||
|
||||
// 获取源文档的页眉页脚
|
||||
Section sourceSection = doc1.getSections().get(0);
|
||||
HeaderFooter sourceHeader = sourceSection.getHeadersFooters().getHeader();
|
||||
HeaderFooter sourceFooter = sourceSection.getHeadersFooters().getFooter();
|
||||
|
||||
// 将页眉复制到目标文档的第三节以及后续节
|
||||
for (int i = 2; i < doc2.getSections().getCount(); i++) {
|
||||
Section targetSection = doc2.getSections().get(i);
|
||||
HeaderFooter targetHeader = targetSection.getHeadersFooters().getHeader();
|
||||
targetHeader.getChildObjects().clear();
|
||||
for (int j = 0; j < sourceHeader.getChildObjects().getCount(); j++) {
|
||||
DocumentObject obj = sourceHeader.getChildObjects().get(j).deepClone();
|
||||
targetHeader.getChildObjects().add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
// 将页脚复制到目标文档的第三节以及后续节
|
||||
for (int i = 2; i < doc2.getSections().getCount(); i++) {
|
||||
Section targetSection = doc2.getSections().get(i);
|
||||
HeaderFooter targetFooter = targetSection.getHeadersFooters().getFooter();
|
||||
targetFooter.getChildObjects().clear();
|
||||
for (int j = 0; j < sourceFooter.getChildObjects().getCount(); j++) {
|
||||
DocumentObject obj = sourceFooter.getChildObjects().get(j).deepClone();
|
||||
targetFooter.getChildObjects().add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
doc2.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
||||
|
||||
}
|
||||
}
|
||||
long b2 = System.currentTimeMillis();
|
||||
|
||||
System.err.println("复制附件用时:"
|
||||
+ (b2 - b1) / 1000 + "秒");
|
||||
}
|
||||
|
||||
|
||||
/****************************插入支持文件、相关文件、附则等信息********************************************************/
|
||||
Document doc = new Document(outFile.getPath());
|
||||
//获取最后一节
|
||||
Section section = doc.getLastSection();
|
||||
|
||||
//添加段落,设置一级序列
|
||||
Paragraph paragraph = section.addParagraph();
|
||||
|
||||
|
||||
//paragraph.appendBreak(BreakType.Page_Break);
|
||||
//Section section2 = doc.addSection();
|
||||
|
||||
//相关文件 R_relevant_flies
|
||||
JSONArray relevant_flies = new JSONArray(); //组织职责Table
|
||||
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "related_files");
|
||||
int count = 0;
|
||||
if (relationList2.size() > 0) {
|
||||
for (DesignerShapeRelationModel relation : relationList2) {
|
||||
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
||||
if (model != null) {
|
||||
count++;
|
||||
String name = model.getName();
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("name", name);
|
||||
tmp.put("desc", count);
|
||||
|
||||
relevant_flies.add(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
CharacterFormat format = new CharacterFormat();
|
||||
//创建字体格式
|
||||
format.setFontName("宋体");
|
||||
//添加段落,设置一级序列
|
||||
Paragraph paragraph1 = section.addParagraph();
|
||||
|
||||
|
||||
//paragraph1.appendBreak(BreakType.Page_Break);
|
||||
|
||||
|
||||
ParagraphFormat paragraphFormat1 = paragraph1.getFormat();
|
||||
paragraphFormat1.setHorizontalAlignment(HorizontalAlignment.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[relevant_flies.size()][];
|
||||
List<String[]> list = new LinkedList<>();
|
||||
for (int i = 0; i < relevant_flies.size(); i++) {
|
||||
JSONObject jsonObject = relevant_flies.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.Exactly);
|
||||
for (int i = 0; i < header.length; i++) {
|
||||
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
||||
Paragraph p = row.getCells().get(i).addParagraph();
|
||||
p.getFormat().setHorizontalAlignment(HorizontalAlignment.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.Exactly);
|
||||
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(c).addParagraph().appendText(data[r][c]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//支持文件
|
||||
JSONArray supportfiles = new JSONArray(); //组织职责Table
|
||||
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files");
|
||||
int index = 0;
|
||||
if (relationList.size() > 0) {
|
||||
for (DesignerShapeRelationModel relation : relationList) {
|
||||
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
||||
if (model != null) {
|
||||
index++;
|
||||
String name = model.getName();
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("name", name);
|
||||
tmp.put("desc", index);
|
||||
supportfiles.add(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CharacterFormat format2 = new CharacterFormat();
|
||||
//创建字体格式
|
||||
format2.setFontName("宋体");
|
||||
//添加段落,设置一级序列
|
||||
Paragraph paragraph2 = section.addParagraph();
|
||||
ParagraphFormat paragraphFormat2 = paragraph2.getFormat();
|
||||
paragraphFormat2.setHorizontalAlignment(HorizontalAlignment.Left);
|
||||
TextRange tr2 = paragraph2.appendText("支持文件");
|
||||
tr2.getCharacterFormat().setBold(true);
|
||||
tr2.getCharacterFormat().setFontName("宋体");
|
||||
tr2.getCharacterFormat().setFontSize(12);
|
||||
paragraph2.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
|
||||
|
||||
|
||||
//定义表格数据
|
||||
String[] header = {"序号", "文件名称"};
|
||||
String[][] strArray2 = new String[supportfiles.size()][];
|
||||
List<String[]> list = new LinkedList<>();
|
||||
for (int i = 0; i < supportfiles.size(); i++) {
|
||||
JSONObject jsonObject = supportfiles.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.Exactly);
|
||||
for (int i = 0; i < header.length; i++) {
|
||||
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
||||
Paragraph p = row.getCells().get(i).addParagraph();
|
||||
p.getFormat().setHorizontalAlignment(HorizontalAlignment.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.Exactly);
|
||||
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(c).addParagraph().appendText(data[r][c]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*CharacterFormat format3=new CharacterFormat();
|
||||
//创建字体格式
|
||||
format3.setFontName("宋体");
|
||||
//添加段落,设置一级序列
|
||||
Paragraph paragraph3 = section.addParagraph();
|
||||
TextRange tr3 = paragraph3.appendText("7.附则");
|
||||
tr3.getCharacterFormat().setBold(true);
|
||||
tr3.getCharacterFormat().setFontName("宋体");
|
||||
paragraph3.applyStyle(BuiltinStyle.Heading_7); //应用标题1样式
|
||||
|
||||
//添加段落
|
||||
Paragraph paragraph5 = section.addParagraph();
|
||||
|
||||
// 附则处理
|
||||
List<String> T_supplementary_articles_table = new ArrayList<>();
|
||||
String [] tmp = dataMap.getString("pl_T_supplementary_articles").split("\n");
|
||||
for (int i = 0; i < tmp.length; i++) {
|
||||
if (UtilString.isNotEmpty(tmp[i])) {
|
||||
T_supplementary_articles_table.add(tmp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TextRange tr5 = paragraph5.appendText(T_supplementary_articles_table.toString());
|
||||
tr5.getCharacterFormat().setFontName("宋体");*/
|
||||
|
||||
|
||||
//查询模型文件属性上传附件信息
|
||||
List<UpfileModel> search2 = upFileDao.searchByRepositoryId(repositoryModel.getId(), "f");
|
||||
|
||||
DCContext dcContextModel = null;
|
||||
|
||||
|
||||
// 排序
|
||||
Collections.sort(search2, new Comparator<UpfileModel>() {
|
||||
@Override
|
||||
public int compare(UpfileModel o1, UpfileModel o2) {
|
||||
String p1 = o1.getFileName();
|
||||
String p2 = o2.getFileName();
|
||||
if (p1.substring(0, 2).equals("附件") && p2.substring(0, 2).equals("附件") && p1.contains(":") && p2.contains(":")) {
|
||||
return Integer.parseInt(p1.substring(2, p1.indexOf(":"))) - Integer.parseInt(p2.substring(2, p2.indexOf(":")));
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//读取模型附件插入手册中文档对象
|
||||
if (search2 != null && search2.size() > 0) {
|
||||
|
||||
|
||||
//附件如果为空,不插入附件标题
|
||||
CharacterFormat format4 = new CharacterFormat();
|
||||
//创建字体格式
|
||||
format4.setFontName("宋体");
|
||||
//添加段落
|
||||
Paragraph paragraph4 = section.addParagraph();
|
||||
|
||||
ParagraphFormat paragraphFormat4 = paragraph4.getFormat();
|
||||
paragraphFormat4.setHorizontalAlignment(HorizontalAlignment.Left);
|
||||
|
||||
TextRange tr4 = paragraph4.appendText("附件");
|
||||
|
||||
|
||||
tr4.getCharacterFormat().setBold(true);
|
||||
tr4.getCharacterFormat().setFontName("宋体");
|
||||
tr4.getCharacterFormat().setFontSize(12);
|
||||
paragraph4.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
|
||||
|
||||
|
||||
long b1 = System.currentTimeMillis();
|
||||
|
||||
for (UpfileModel upfileModel : search2) {
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||
if (dcProfile != null) {
|
||||
|
||||
// 处理DocCenter
|
||||
dcContextModel = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, "file", upfileModel.getPl_uuid(), upfileModel.getFileName());
|
||||
//添加段落
|
||||
Paragraph paragraph5 = section.addParagraph();
|
||||
|
||||
//加载一个图片,它将作为外部文件的符号显示在Word文档中
|
||||
//获取最后一个.的位置
|
||||
int lastIndexOf = dcContextModel.getFileName().lastIndexOf(".");
|
||||
//获取文件的后缀名 .jpg
|
||||
String suffix = dcContextModel.getFileName().substring(lastIndexOf);
|
||||
|
||||
DocPicture pdfIcon = new DocPicture(doc);
|
||||
|
||||
InputStream stream1 = new FileInputStream(dcContextModel.getFilePath());
|
||||
DocPicture pic1 = new DocPicture(doc);
|
||||
|
||||
if (suffix.equals(".doc") || suffix.equals(".docx")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/word.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".doc")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "doc");
|
||||
} else if (suffix.equals(".docx")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "docx");
|
||||
}
|
||||
} else if (suffix.equals(".pdf")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/pdf.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
paragraph5.appendOleObject(stream1, pic1, "pdf");
|
||||
} else if (suffix.equals(".xls") || suffix.equals(".xlsx")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/xls.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".xls")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "xls");
|
||||
} else if (suffix.equals(".xlsx")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "xlsx");
|
||||
}
|
||||
} else if (suffix.equals(".png") || suffix.equals(".jgp")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/png.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".png")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "png");
|
||||
} else if (suffix.equals(".jpg")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "jpg");
|
||||
}
|
||||
} else if (suffix.equals(".zip") || suffix.equals(".rar")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/zip.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".zip")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "zip");
|
||||
} else if (suffix.equals(".rar")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "rar");
|
||||
}
|
||||
} else if (suffix.equals(".mp3") || suffix.equals(".mp4")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/mp3.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".mp3")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "mp3");
|
||||
} else if (suffix.equals(".mp4")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "mp4");
|
||||
}
|
||||
} else if (suffix.equals(".txt")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/txt.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
paragraph5.appendOleObject(stream1, pic1, "txt");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
long b2 = System.currentTimeMillis();
|
||||
System.err.println("插入附件用时:"
|
||||
+ (b2 - b1) / 1000 + "秒");
|
||||
}
|
||||
doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成word文件
|
||||
*
|
||||
* @param dataMap
|
||||
* @param tempPath
|
||||
* @param tempName
|
||||
* @param docName
|
||||
*/
|
||||
public static void createBdDoc2(JSONObject dataMap, String tempPath, String tempName, String docName, String repositoryId) throws FileNotFoundException {
|
||||
Configuration configuration = new Configuration();
|
||||
configuration.setDefaultEncoding("UTF-8");
|
||||
|
||||
// 设置模本装置方法和路径
|
||||
try {
|
||||
UtilFile temps = new UtilFile(tempPath);
|
||||
configuration.setDirectoryForTemplateLoading(temps);
|
||||
} catch (IOException e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
Template t = null;
|
||||
try {
|
||||
t = configuration.getTemplate(tempName, "UTF-8");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 输出文档路径及名称
|
||||
File outFile = new File(docName);
|
||||
Writer out = null;
|
||||
try {
|
||||
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8"));
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
if (t != null && out != null) {
|
||||
t.process(dataMap, out);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
} catch (TemplateException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/**************************************************插入文件对象**********************************************************************/
|
||||
Document doc = new Document(outFile.getPath());
|
||||
//获取最后一节
|
||||
Section section = doc.getLastSection();
|
||||
|
||||
|
||||
CharacterFormat format4 = new CharacterFormat();
|
||||
//创建字体格式
|
||||
format4.setFontName("宋体");
|
||||
//添加段落
|
||||
Paragraph paragraph = section.addParagraph();
|
||||
|
||||
|
||||
ParagraphFormat paragraphFormat4 = paragraph.getFormat();
|
||||
paragraphFormat4.setHorizontalAlignment(HorizontalAlignment.Left);
|
||||
|
||||
TextRange tr4 = paragraph.appendText("表单/模板");
|
||||
|
||||
tr4.getCharacterFormat().setBold(true);
|
||||
tr4.getCharacterFormat().setFontName("宋体");
|
||||
paragraph.applyStyle(BuiltinStyle.Heading_1); //应用标题1样式
|
||||
|
||||
//doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
||||
|
||||
|
||||
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId);
|
||||
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
//查询模型文件属性上传附件信息
|
||||
List<UpfileModel> search = upFileDao.searchByRepositoryId(repositoryModel.getId(), "s");
|
||||
|
||||
|
||||
DCContext dcContextModel = null;
|
||||
UserContext userContext = DispatcherRequest.getUserContext();
|
||||
if (search != null && search.size() > 0) {
|
||||
// 复制附件
|
||||
for (UpfileModel upfileModel : search) {
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||
|
||||
if (dcProfile != null) {
|
||||
dcContextModel = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), upfileModel.getFileName());
|
||||
String path = dcContextModel.getPath();
|
||||
String fileName = dcContextModel.getFileName();
|
||||
|
||||
|
||||
//添加段落
|
||||
Paragraph paragraph5 = section.addParagraph();
|
||||
|
||||
//加载一个图片,它将作为外部文件的符号显示在Word文档中
|
||||
//获取最后一个.的位置
|
||||
int lastIndexOf = dcContextModel.getFileName().lastIndexOf(".");
|
||||
//获取文件的后缀名 .jpg
|
||||
String suffix = dcContextModel.getFileName().substring(lastIndexOf);
|
||||
|
||||
DocPicture pdfIcon = new DocPicture(doc);
|
||||
|
||||
InputStream stream1 = new FileInputStream(dcContextModel.getFilePath());
|
||||
DocPicture pic1 = new DocPicture(doc);
|
||||
|
||||
if (suffix.equals(".doc") || suffix.equals(".docx")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/word.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".doc")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "doc");
|
||||
} else if (suffix.equals(".docx")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "docx");
|
||||
}
|
||||
} else if (suffix.equals(".pdf")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/pdf.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
paragraph5.appendOleObject(stream1, pic1, "pdf");
|
||||
} else if (suffix.equals(".xls") || suffix.equals(".xlsx")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/xls.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".xls")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "xls");
|
||||
} else if (suffix.equals(".xlsx")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "xlsx");
|
||||
}
|
||||
} else if (suffix.equals(".png") || suffix.equals(".jgp")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/png.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".png")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "png");
|
||||
} else if (suffix.equals(".jpg")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "jpg");
|
||||
}
|
||||
} else if (suffix.equals(".zip") || suffix.equals(".rar")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/zip.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".zip")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "zip");
|
||||
} else if (suffix.equals(".rar")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "rar");
|
||||
}
|
||||
} else if (suffix.equals(".mp3") || suffix.equals(".mp4")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/mp3.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".mp3")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "mp3");
|
||||
} else if (suffix.equals(".mp4")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "mp4");
|
||||
}
|
||||
} else if (suffix.equals(".txt")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/txt.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
paragraph5.appendOleObject(stream1, pic1, "txt");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将文件的扩展属性设置默认值为空字符串(防止没有设置扩展属性而使得导出文件出错)
|
||||
*
|
||||
|
||||
@ -1,65 +1,26 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.repository;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.PALMethodManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.constant.OutputConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.web.CoeProcessLevelWeb;
|
||||
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.bpmn.engine.cache.ProcessDefCache;
|
||||
import com.actionsoft.bpms.bpmn.modeler.constant.BPMNConstant;
|
||||
import com.actionsoft.bpms.bpmn.modeler.constant.BPMNFileConstant;
|
||||
import com.actionsoft.bpms.bpmn.modeler.io.BPMNIO;
|
||||
import com.actionsoft.bpms.bpmn.modeler.util.BPMNFileUtil;
|
||||
import com.actionsoft.bpms.commons.cache.Cache;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.commons.htmlframework.AlertWindow;
|
||||
import com.actionsoft.bpms.commons.login.constant.LoginConst;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.commons.security.high.HighSecurity;
|
||||
import com.actionsoft.bpms.org.cache.DepartmentCache;
|
||||
import com.actionsoft.bpms.org.cache.UserMapCache;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.org.model.RoleModel;
|
||||
import com.actionsoft.bpms.org.model.UserMapModel;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.server.DispatcherRequest;
|
||||
import com.actionsoft.bpms.server.SSOUtil;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.fs.DCContext;
|
||||
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||
import com.actionsoft.bpms.server.fs.dc.DCUtil;
|
||||
import com.actionsoft.bpms.util.*;
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishFrequencyDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishListHistory;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.model.PublishFrequencyModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.PALMethodManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.OutPutReportWeb;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.OutputAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.constant.OutputConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.CoeProcessLevelCorrelateCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryAttributeCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeAttributeCache;
|
||||
@ -78,31 +39,63 @@ import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.ShapeUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.web.CoeDesignerWeb;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.CoeProcessLevelCorrelateModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryAttributeModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryShapeAttributeModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelImpl;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.web.UpfileWeb;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.web.CoeProcessLevelWeb;
|
||||
import com.actionsoft.apps.coe.pal.pal.ws.dao.CoeWorkSpace;
|
||||
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.StringHandleUtil;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.bpmn.engine.cache.ProcessDefCache;
|
||||
import com.actionsoft.bpms.bpmn.modeler.constant.BPMNConstant;
|
||||
import com.actionsoft.bpms.bpmn.modeler.constant.BPMNFileConstant;
|
||||
import com.actionsoft.bpms.bpmn.modeler.io.BPMNIO;
|
||||
import com.actionsoft.bpms.bpmn.modeler.util.BPMNFileUtil;
|
||||
import com.actionsoft.bpms.commons.cache.Cache;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.commons.htmlframework.AlertWindow;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.commons.security.high.HighSecurity;
|
||||
import com.actionsoft.bpms.org.cache.DepartmentCache;
|
||||
import com.actionsoft.bpms.org.cache.UserMapCache;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.org.model.RoleModel;
|
||||
import com.actionsoft.bpms.org.model.UserMapModel;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.server.DispatcherRequest;
|
||||
import com.actionsoft.bpms.server.SSOUtil;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.fs.DCContext;
|
||||
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||
import com.actionsoft.bpms.server.fs.dc.DCUtil;
|
||||
import com.actionsoft.bpms.util.Base64;
|
||||
import com.actionsoft.bpms.util.*;
|
||||
import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.actionsoft.sdk.local.api.BOAPI;
|
||||
import com.actionsoft.sdk.local.api.BOQueryAPI;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.collections4.IteratorUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 资产库文件查询接口API封装
|
||||
*
|
||||
@ -457,7 +450,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
*
|
||||
* @param wsid 流程库ID
|
||||
* @param teamId 小组id
|
||||
* @param category 建模方法 如process
|
||||
* @param category 建模方法 如process
|
||||
*/
|
||||
public List<PALRepositoryModel> getAccessPalModel(String wsid, String teamId, String userId, String category) {
|
||||
return CoeProcessLevelUtil.getPermRepositoryList(wsid, teamId, userId, category, null, true, false);
|
||||
@ -528,7 +521,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
*
|
||||
* @param wsId 流程库ID
|
||||
* @param teamId 小组id
|
||||
* @param category 建模方法 如process
|
||||
* @param category 建模方法 如process
|
||||
* @return list
|
||||
*/
|
||||
public List<PALRepositoryModel> getAccessPALFile(String wsId, String teamId, String userId, String category) {
|
||||
@ -544,7 +537,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
* 得到指定权限的树节点并重新生成树节点
|
||||
*
|
||||
* @param wsid 流程库ID
|
||||
* @param category 建模方法 如process
|
||||
* @param category 建模方法 如process
|
||||
* @return list
|
||||
*/
|
||||
public List<PALRepositoryModel> getAccessPALFile(String wsid, String category) {
|
||||
@ -566,7 +559,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
* 得到指定权限的树节点并重新生成树节点
|
||||
*
|
||||
* @param wsid 流程库ID
|
||||
* @param category 建模方法 如process
|
||||
* @param category 建模方法 如process
|
||||
* @return list
|
||||
*/
|
||||
public List<PALRepositoryModel> getAccessPALFile1(String wsid, String category, boolean isUse, boolean isPublish) {
|
||||
@ -810,7 +803,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 得到指定权限范围内的树节点
|
||||
*
|
||||
* @param jsonArray
|
||||
* @param jsonArray
|
||||
* @param methodType 建模方法大类
|
||||
* @param wsid 流程库Id
|
||||
* @param versionType 版本类型
|
||||
@ -928,7 +921,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
list.add(newModel);
|
||||
|
||||
|
||||
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -961,6 +953,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取某个小组的成员有权限的流程
|
||||
*
|
||||
* @param wsId
|
||||
* @param userId
|
||||
* @param teamId
|
||||
@ -1006,6 +999,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取资产库下的流程
|
||||
*
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
* @return
|
||||
@ -1055,7 +1049,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<PALRepositoryModel> getUsedPalRepositoryModelsByPidRole(String wsId, String pid, String ruuid) {
|
||||
List<PALRepositoryModel> list = getPalRepositoryModelsByPidRole(wsId, pid, ruuid);
|
||||
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
|
||||
@ -1110,7 +1103,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************** 获取使用中的流程 *****************************************************/
|
||||
|
||||
/**
|
||||
@ -1432,6 +1424,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据pid获取使用中的流程树
|
||||
*
|
||||
* @param context
|
||||
* @param wsId
|
||||
* @param pid
|
||||
@ -1482,6 +1475,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据pid获取使用中的流程树(角色模型)
|
||||
*
|
||||
* @param context
|
||||
* @param wsId
|
||||
* @param pid
|
||||
@ -1516,8 +1510,8 @@ public class PALRepositoryQueryAPIManager {
|
||||
JSONArray result = list2JsonRole(context, list, true, false, ruuid);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param context
|
||||
* @param wsId
|
||||
* @param pid
|
||||
@ -1553,7 +1547,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************** 获取流程树 **********************************************************/
|
||||
|
||||
/**
|
||||
@ -1571,7 +1564,9 @@ public class PALRepositoryQueryAPIManager {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 父节点下的所有子节点 */
|
||||
/**
|
||||
* 父节点下的所有子节点
|
||||
*/
|
||||
private static void recurPermChild(List<PALRepositoryModel> repidList, List<PALRepositoryModel> newList, String newParentId) {
|
||||
if (repidList != null) {
|
||||
for (int i = 0; i < repidList.size(); i++) {
|
||||
@ -2505,6 +2500,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
if (model.getName().equals("岗位模型")) {
|
||||
object.put("nocheck", true);
|
||||
}
|
||||
object.put("nocheck", false);
|
||||
object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim());
|
||||
object.put("name", I18nRes.findValue(CoEConstant.APP_ID, context.getLanguage(), model.getName()).trim());
|
||||
object.put("wsId", model.getWsId());
|
||||
@ -2593,7 +2589,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************************************************************************/
|
||||
|
||||
/**
|
||||
@ -2669,6 +2664,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取部门下的流程根节点(仅适用于责任部门选择org)
|
||||
*
|
||||
* @param uid 用户ID
|
||||
* @param wsId 资产库Id,为空则查询默认资产库
|
||||
* @param methodId
|
||||
@ -2719,6 +2715,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取部门下的所有流程(仅适用于责任部门选择org)
|
||||
*
|
||||
* @param uid 用户ID
|
||||
* @param wsId 资产库Id,为空则查询默认资产库
|
||||
* @param methodId
|
||||
@ -2734,6 +2731,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据uid,获取可以查看的流程的责任部门Id
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@ -2780,7 +2778,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uid
|
||||
* @param searchList
|
||||
* @return
|
||||
@ -2820,6 +2817,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 流程,发布版本下,未发布流程可见
|
||||
*
|
||||
* @param context
|
||||
* @param wsId
|
||||
* @param pid
|
||||
@ -2853,6 +2851,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 部门流程,获取根节点
|
||||
*
|
||||
* @param uid
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
@ -2897,6 +2896,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取有发布版本的部门流程根节点,没有发布版本,取该节点的使用版本
|
||||
*
|
||||
* @param uid
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
@ -2930,6 +2930,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取有发布版本的部门流程,没有发布版本,取该节点的使用版本
|
||||
*
|
||||
* @param uid
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
@ -2966,6 +2967,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取有发布版本部门根节点下流程,没有发布版本的流程不显示
|
||||
*
|
||||
* @param uid
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
@ -2992,6 +2994,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 流程树--根据流程名称搜索流程
|
||||
*
|
||||
* @param context
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
@ -3116,6 +3119,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据部门Id获取流程
|
||||
*
|
||||
* @param deptIds
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
@ -3162,6 +3166,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取指定层级的流程
|
||||
*
|
||||
* @param _uc
|
||||
* @param wsId
|
||||
* @param methodId
|
||||
@ -3196,6 +3201,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据uc,获取可以查看的流程的责任部门Id
|
||||
*
|
||||
* @param uc
|
||||
* @return
|
||||
*/
|
||||
@ -3243,6 +3249,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取流程图片
|
||||
*
|
||||
* @param _uc 用户上下文对象
|
||||
* @param uuid 流程Id
|
||||
* @return 图片url
|
||||
@ -3290,6 +3297,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 导出单个流程手册
|
||||
* 仅限于应用流程手册com.actionsoft.apps.coe.pal.output.pr下的手册导出
|
||||
*
|
||||
* @param wsId 资产库Id
|
||||
* @param userId 用户Id
|
||||
* @param teamId 小组Id
|
||||
@ -3353,6 +3361,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 导出单个表单手册
|
||||
* 仅限于应用流程手册com.awspaas.user.apps.coe.pal.output.bd下的手册导出
|
||||
*
|
||||
* @param wsId 资产库Id
|
||||
* @param userId 用户Id
|
||||
* @param teamId 小组Id
|
||||
@ -3401,6 +3410,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 导出单个制度手册
|
||||
* 仅限于应用流程手册com.awspaas.user.apps.coe.pal.output.bd下的手册导出
|
||||
*
|
||||
* @param wsId 资产库Id
|
||||
* @param userId 用户Id
|
||||
* @param teamId 小组Id
|
||||
@ -3448,6 +3458,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 预览流程手册
|
||||
*
|
||||
* @param _uc
|
||||
* @param taskId
|
||||
* @return
|
||||
@ -3516,6 +3527,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 流程手册下载
|
||||
*
|
||||
* @param _uc
|
||||
* @param taskId
|
||||
* @return
|
||||
@ -3611,6 +3623,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 预览流程手册且流程访问量+1
|
||||
*
|
||||
* @param _uc
|
||||
* @param taskId
|
||||
* @param uuid
|
||||
@ -3630,6 +3643,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取高频流程列表
|
||||
*
|
||||
* @param wsId 资产库id
|
||||
* @param category 大分类 process流程,org组织,data数据,itsystem IT系统,control 风险与控制,null则不过滤
|
||||
* @param methodId 具体分类
|
||||
@ -3726,6 +3740,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 创建模型图片和缩略图
|
||||
*
|
||||
* @param uuid 流程Id
|
||||
* @param bigImage 是否生成大图(正常图片大小)
|
||||
* @param smallImage 是否生成缩略图
|
||||
@ -3826,6 +3841,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 创建模型图片和缩略图,图片中流程图上方中间位置增加流程标题
|
||||
* 缩略图不进行标题处理
|
||||
*
|
||||
* @param uuid 流程Id
|
||||
* @param bigImage 是否生成大图(正常图片大小)
|
||||
* @param smallImage 是否生成缩略图
|
||||
@ -3876,6 +3892,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 创建文本类型节点作为标题并返回流程定义
|
||||
*
|
||||
* @param model
|
||||
* @param title
|
||||
* @return
|
||||
@ -3924,6 +3941,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取文件的位置
|
||||
*
|
||||
* @param model
|
||||
* @return {x:最小横坐标,y:最小y坐标,w:最大宽度,h:最大高度}
|
||||
*/
|
||||
@ -4031,6 +4049,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 校验图片,若该模型id在定时任务的缓存中,则生成图片,若不在缓存中则跳过
|
||||
*
|
||||
* @param uuid 流程Id
|
||||
* @param bigImage 是否生成大图(正常图片大小)
|
||||
* @param smallImage 是否生成缩略图
|
||||
@ -4044,6 +4063,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 校验图片,若该模型id在定时任务的缓存中,则生成图片,若不在缓存中则跳过
|
||||
*
|
||||
* @param uuid 流程Id
|
||||
* @param bigImage 是否生成大图(正常图片大小)
|
||||
* @param smallImage 是否生成缩略图
|
||||
@ -4075,7 +4095,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 流程发布门户详情页面
|
||||
*
|
||||
@ -4086,8 +4105,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 流程发布门户详情页面
|
||||
*
|
||||
@ -4141,9 +4158,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 流程发布门户详情页面
|
||||
*
|
||||
@ -4199,8 +4213,6 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean hasAccessPortalDesignerPerm(UserContext uc, PALRepositoryModel model) {
|
||||
String newBoName = "BO_ACT_PUBLISH_PERM_SCOPE";
|
||||
BO bo = SDK.getBOAPI().query(newBoName).addQuery("PALVERSIONID=", model.getVersionId()).detail();
|
||||
@ -4296,6 +4308,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//岗位权限
|
||||
private boolean getPostPerm(String postPerm, UserContext uc) {
|
||||
if (UtilString.isNotEmpty(postPerm)) {
|
||||
@ -4312,6 +4325,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
//职级权限
|
||||
private boolean getLevelPerm(String levelPerm, UserContext uc) {
|
||||
if (UtilString.isNotEmpty(levelPerm)) {
|
||||
@ -4355,6 +4369,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 无session打开流程只读页面
|
||||
*
|
||||
* @param uid
|
||||
* @param uuid
|
||||
* @param processDefId
|
||||
@ -4388,6 +4403,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 变更表
|
||||
*
|
||||
* @param uuid id
|
||||
* @param setStr set部分sql
|
||||
* @return
|
||||
@ -4407,6 +4423,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
* 获取流程缩略图片
|
||||
* 图片不重新生成,适用于快速查看,卡片展示对实时性要求不强的场景
|
||||
* 通过定时任务进行图片更新
|
||||
*
|
||||
* @param uuid pal流程id,若该流程为关联/(在bpm运行)流程,则返回bpm流程图片
|
||||
* @return
|
||||
*/
|
||||
@ -4436,6 +4453,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 获取流程图片
|
||||
* 图片重新生成,适用于实时查看图片,打印报告等耗费时间性能的操作
|
||||
*
|
||||
* @param uuid pal流程id,若该流程为关联/(在bpm运行)流程,则返回bpm流程图片
|
||||
* @return
|
||||
*/
|
||||
@ -4466,6 +4484,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 获取流程图片路径,,若该流程为关联/(在bpm运行)流程,则返回bpm流程图片路径
|
||||
* 图片重新创建,适用于实时查看图片,打印报告等耗费时间性能的操作
|
||||
*
|
||||
* @param uuid pal流程id
|
||||
* @return
|
||||
*/
|
||||
@ -4490,6 +4509,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取流程文件,若该流程为关联/(在bpm运行)流程,则返回bpm平台流程文件
|
||||
*
|
||||
* @param uc UserContext对象
|
||||
* @param uuid pal流程id
|
||||
* @return
|
||||
@ -4582,6 +4602,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取当前流程的所有版本,不同的是若流程与BPMS有关联,则获取与BPMS有关联的流程并更新版本号为BPMS流程版本号
|
||||
*
|
||||
* @param uuid
|
||||
* @return list
|
||||
*/
|
||||
@ -4591,6 +4612,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取版本,若PAL与BPMS关联,则获取关联的所有版本,若未关联,获取PAL数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public PALRepositoryModel queryPalRepositoryModelByPalId(String uuid) {
|
||||
@ -4599,6 +4621,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 校验PAL是否关联了bpm流程但是在bpm端流程被删除,若存在此情况则进行关联关系删除
|
||||
*
|
||||
* @param uuid
|
||||
* @return
|
||||
*/
|
||||
@ -4609,6 +4632,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 获取PAL推送到BPMS但是尚未分配的流程-JSON方式
|
||||
* 返回通用的JSON,可供其他jar调用而不用引用相关类
|
||||
*
|
||||
* @return JSONArray
|
||||
*/
|
||||
public JSONArray getCoePalNoDistributionJSON() {
|
||||
@ -4618,6 +4642,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/**
|
||||
* 获取PAL推送到BPMS但是尚未分配的流程-JSON方式
|
||||
* 返回通用的JSON,可供其他jar调用而不用引用相关类
|
||||
*
|
||||
* @param versionId pal流程版本id
|
||||
* @return JSONArray
|
||||
*/
|
||||
@ -4627,6 +4652,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 保存coe与bpms流程之间的关联关系,供其他jar调用
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@ -4636,6 +4662,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 校验PAL流程是否与BPMS有关联/推送关系
|
||||
*
|
||||
* @param uuid PAL流程id
|
||||
* @param checkBpmsExist 若有关联关系,是否进一步校验BPMS端流程是否存在,true:PAL关联了BPMS并且BPMS端被关联流程存在则返回BPMS流程id,false:PAL关联了BPMS流程(不管BPMS端流程是否存在)返回BPMS流程id
|
||||
* @return 若是关联/推送流程,返回BPMS流程的ID,若不是或者BPMS端流程被删除,返回空字符串
|
||||
@ -4646,6 +4673,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 校验PAL流程是否与BPMS端流程有关联关系
|
||||
*
|
||||
* @param uuid PAL id
|
||||
* @param checkBpmsExist 若有关联关系,是否进一步校验BPMS端流程是否存在,true:PAL关联了BPMS并且BPMS端被关联流程存在则返回true,false:PAL关联了BPMS流程(不管BPMS端流程是否存在)返回true
|
||||
* @return
|
||||
@ -4656,6 +4684,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据BPMS流程id查询与PAL关联的流程id
|
||||
*
|
||||
* @param plAwsId
|
||||
* @return BPMS与PAL有关联关系则返回PAL流程id,无关联关系返回null
|
||||
*/
|
||||
@ -4669,6 +4698,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 组名称是否可修改、删除判断依据
|
||||
*
|
||||
* @param processVerIds BPM流程verId集合
|
||||
* @return true:可以修改/删除 false:锁定结构,不可以修改/删除
|
||||
*/
|
||||
@ -4694,6 +4724,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 流程是否可显示/隐藏
|
||||
*
|
||||
* @param processVerId
|
||||
* @return null:该流程/流程版本与PAL 关联关系,依照平台机制处 不为null,[xxx,xxx]:xxx为所有可以显示的流程,且其所有显示流程锁定结构,若size为0, 代表该流程版本下所有流程 显示(及特殊情况出现)
|
||||
*/
|
||||
@ -4719,6 +4750,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 流程是否锁定结构
|
||||
*
|
||||
* @param processDefId BPM流程id
|
||||
* @return true:可以修改/删除 false:锁定结构, 可以修改/删除
|
||||
*/
|
||||
@ -4739,6 +4771,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 流程是否显示
|
||||
*
|
||||
* @param processDefId
|
||||
* @return
|
||||
*/
|
||||
@ -4804,6 +4837,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取更多特性树
|
||||
*
|
||||
* @param wsId 资产库id
|
||||
* @param methodId 模型分类
|
||||
* @param type file:文件属性,shape:形状属性
|
||||
@ -4818,6 +4852,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据pid获取符合条件的子流程数据
|
||||
*
|
||||
* @param uc
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
@ -4860,6 +4895,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据父节点获取权限范围内的子流程
|
||||
*
|
||||
* @param wsId
|
||||
* @param pid
|
||||
* @param permVersionIds 权限versionIds
|
||||
@ -4899,6 +4935,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 新的流程树list转换json方法
|
||||
*
|
||||
* @param uc
|
||||
* @param list
|
||||
* @param childrenCountMap list中的model是否具有子节点map记录
|
||||
@ -5005,6 +5042,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 三员管理下,附件是否存在未标定密级
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@ -5047,6 +5085,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取模型形状的附件
|
||||
*
|
||||
* @param palId
|
||||
* @param uc 可为null
|
||||
* @return
|
||||
@ -5057,6 +5096,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取模型形状的关联附件
|
||||
*
|
||||
* @param palId
|
||||
* @param uc 可为null
|
||||
* @return
|
||||
@ -5067,6 +5107,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取文件的附件
|
||||
*
|
||||
* @param palId
|
||||
* @param uc 可为null
|
||||
* @return
|
||||
@ -5077,6 +5118,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取文件的关联附件
|
||||
*
|
||||
* @param palId
|
||||
* @param uc 可为null
|
||||
* @return
|
||||
@ -5088,6 +5130,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
static class UpfileQuery {
|
||||
/**
|
||||
* 加载流程文件/形状附件
|
||||
*
|
||||
* @param palId
|
||||
* @param type file 文件附件 shape 形状附件
|
||||
* @param shapeId
|
||||
@ -5191,7 +5234,9 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
public void sortByCreateTime(List<UpfileModel> list) {
|
||||
list.sort((m1, m2) -> {return m2.getCreateTime().compareTo(m1.getCreateTime());});
|
||||
list.sort((m1, m2) -> {
|
||||
return m2.getCreateTime().compareTo(m1.getCreateTime());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5219,6 +5264,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
/*************************************流程附件 start****************************************/
|
||||
/**
|
||||
* 检测平台是否开启三员管理,同时设置返回参数
|
||||
*
|
||||
* @param ro
|
||||
*/
|
||||
public void checkHighSecurity(String uuid, ResponseObject ro) {
|
||||
@ -5249,9 +5295,9 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 附件密级根据用户与文件密级过滤
|
||||
*
|
||||
* @param uc
|
||||
* @param list
|
||||
*/
|
||||
@ -5267,6 +5313,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 附件密级根据用户筛选其下所有密级文件,包含未标密
|
||||
*
|
||||
* @param uc
|
||||
* @param list
|
||||
*/
|
||||
@ -5282,6 +5329,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 是否开启三员管理
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isSecurityMode() {
|
||||
@ -5290,6 +5338,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取流程树中第一个流程文件未标密 或者 附件未标密文件在树中路径
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getUnmarkPath(UserContext me, String wsId, String teamId) {
|
||||
@ -5334,6 +5383,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取第一个流程文件未标密model
|
||||
*
|
||||
* @param me
|
||||
* @param versionIds
|
||||
* @param wsId
|
||||
@ -5359,6 +5409,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取流程树中inuse文件
|
||||
*
|
||||
* @param versionIds 小组权限下的流程文件uuid
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
@ -5390,6 +5441,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 三员管理下,流程文件是否存在未标定密级
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@ -5401,6 +5453,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 获取流程树下未标密文件的数量
|
||||
*
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @return
|
||||
@ -5428,6 +5481,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 报告生成器应用,前置校验密级访问权限
|
||||
*
|
||||
* @param me
|
||||
* @param model
|
||||
* @return
|
||||
@ -5454,6 +5508,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
|
||||
/**
|
||||
* 根据报告生成器的任务ID查询对应的文件存储路径
|
||||
*
|
||||
* @param uc
|
||||
* @param taskId 表APP_ACT_COE_PAL_OUTPUT_TASK的ID
|
||||
* @return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user