Merge remote-tracking branch 'origin/apps_dev' into apps_dev
This commit is contained in:
commit
a5be307594
Binary file not shown.
@ -2606,6 +2606,20 @@ public class CoEPALController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程手册预览
|
||||
*
|
||||
* @param me
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
// @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_PREVIEW")
|
||||
@Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_ppt_preview")
|
||||
public String COEPALOUTPUTREPORTOutputProcessPPTPreview(UserContext me, String taskId) {
|
||||
return PALRepositoryQueryAPIManager.getInstance().outputReportPPTPreview(me, taskId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程阅览 流程手册下载
|
||||
*
|
||||
@ -3698,4 +3712,50 @@ public class CoEPALController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断表单模型是否存在excel文件
|
||||
*
|
||||
* @param me
|
||||
* @param uuids
|
||||
* @param teamId
|
||||
* @param wsId
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.publisher_output_pr_estimateFile")
|
||||
public String createOutputPrReportsByEstimateFile(UserContext me, String fileId) {
|
||||
DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me);
|
||||
return web.createOutputPrReportsByEstimateFile(fileId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断制度模型是否存在ppt文件
|
||||
*
|
||||
* @param me
|
||||
* @param uuids
|
||||
* @param teamId
|
||||
* @param wsId
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.publisher_output_pr_estimatePPTFile")
|
||||
public String createOutputPrReportsByEstimatePPTFile(UserContext me, String fileId) {
|
||||
DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me);
|
||||
return web.createOutputPrReportsByEstimatePPTFile(me, fileId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断附件
|
||||
*
|
||||
* @param me
|
||||
* @param uuids
|
||||
* @param teamId
|
||||
* @param wsId
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.publisher_output_pr_downloadExcelFile")
|
||||
public String createOutputPrReportsByDownloadExcelFile(UserContext me, String taskIds) {
|
||||
DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me);
|
||||
return web.createOutputPrReportsByDownloadExcelFile(taskIds);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstan
|
||||
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.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.org.model.RoleModel;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
@ -25,6 +26,7 @@ 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.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sini.com.spire.doc.*;
|
||||
@ -232,28 +234,6 @@ public class OutputWordUtil {
|
||||
} 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); //流程文件内容
|
||||
@ -299,6 +279,78 @@ public class OutputWordUtil {
|
||||
DCContext dcContextpdf = null;
|
||||
File file = null;
|
||||
|
||||
boolean isPPT = false;
|
||||
//如果为PPT,则生成PPT手册
|
||||
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();
|
||||
|
||||
String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
if (suffix.equals("pptx")) {
|
||||
isPPT = true;
|
||||
String pptUrl = docName.substring(0, docName.lastIndexOf("/") + 1);
|
||||
// 调用App
|
||||
String sourceAppId = "com.actionsoft.apps.coe.pal";
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.awspaas.user.apps.new_performance_indicator_library/UpdatePptxAndExcelAslp";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
//文件id,必填
|
||||
params.put("pl_uuid", repositoryId);
|
||||
//文件内容id,必填
|
||||
params.put("shape_uuid", search.get(0).getShape_uuid());
|
||||
|
||||
//文件保存地址,必填
|
||||
params.put("fil_path", pptUrl + search.get(0).getFileName());
|
||||
|
||||
//文件路径(不包含文件名称),必填
|
||||
params.put("file_url", pptUrl);
|
||||
|
||||
//文件名称,必填
|
||||
params.put("file_data", search.get(0).getFileName());
|
||||
//sid,必填
|
||||
params.put("sid", userContext.getSessionId());
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//根据上传的文件进行更新相关的excel或者ppt
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isPPT == false) {
|
||||
// 输出文档路径及名称
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
if (search != null && search.size() > 0) {
|
||||
long b1 = System.currentTimeMillis();
|
||||
@ -353,9 +405,14 @@ public class OutputWordUtil {
|
||||
String substring = fileName.substring(0, fileName.lastIndexOf(".xml"));
|
||||
//保存为Word
|
||||
document.insertTextFromFile(docPath + substring + ".docx", FileFormat.Docx_2013);
|
||||
} else {
|
||||
} else if (suffix.equals("doc") || suffix.equals("docx")) {
|
||||
document.insertTextFromFile(path + fileName, FileFormat.Docx_2013);
|
||||
} else if (suffix.equals("pptx")) {
|
||||
isPPT = true;
|
||||
}
|
||||
|
||||
|
||||
if (isPPT == false) {
|
||||
// document.insertTextFromFile("/Users/sunlh/Downloads/手册格式问题测试文档(3)new.docx", FileFormat.Docx_2013);
|
||||
try {
|
||||
//保存结果文档
|
||||
@ -450,6 +507,8 @@ public class OutputWordUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
long b2 = System.currentTimeMillis();
|
||||
|
||||
@ -459,6 +518,8 @@ public class OutputWordUtil {
|
||||
|
||||
|
||||
/****************************插入支持文件、相关文件、附则等信息********************************************************/
|
||||
|
||||
|
||||
Document doc = new Document(outFile.getPath());
|
||||
//获取最后一节
|
||||
Section section = doc.getLastSection();
|
||||
@ -466,7 +527,6 @@ public class OutputWordUtil {
|
||||
//添加段落,设置一级序列
|
||||
Paragraph paragraph = section.addParagraph();
|
||||
|
||||
|
||||
//paragraph.appendBreak(BreakType.Page_Break);
|
||||
//Section section2 = doc.addSection();
|
||||
|
||||
@ -536,6 +596,9 @@ public class OutputWordUtil {
|
||||
row.setHeightType(TableRowHeightType.Exactly);
|
||||
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(HorizontalAlignment.Center);
|
||||
TextRange txtRange = p.appendText(header[i]);
|
||||
@ -546,10 +609,13 @@ public class OutputWordUtil {
|
||||
for (int r = 0; r < data.length; r++) {
|
||||
TableRow dataRow = table.getRows().get(r + 1);
|
||||
dataRow.setHeight(25);
|
||||
dataRow.setHeightType(TableRowHeightType.Exactly);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
@ -616,6 +682,9 @@ public class OutputWordUtil {
|
||||
row.setHeightType(TableRowHeightType.Exactly);
|
||||
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(HorizontalAlignment.Center);
|
||||
TextRange txtRange = p.appendText(header[i]);
|
||||
@ -626,43 +695,19 @@ public class OutputWordUtil {
|
||||
for (int r = 0; r < data.length; r++) {
|
||||
TableRow dataRow = table.getRows().get(r + 1);
|
||||
dataRow.setHeight(25);
|
||||
dataRow.setHeightType(TableRowHeightType.Exactly);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*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");
|
||||
|
||||
@ -774,6 +819,14 @@ public class OutputWordUtil {
|
||||
} else if (suffix.equals(".mp4")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "mp4");
|
||||
}
|
||||
} else if (suffix.equals(".ppt") || suffix.equals(".pptx")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/ppt.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
if (suffix.equals(".ppt")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "ppt");
|
||||
} else if (suffix.equals(".pptx")) {
|
||||
paragraph5.appendOleObject(stream1, pic1, "pptx");
|
||||
}
|
||||
} else if (suffix.equals(".txt")) {
|
||||
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/txt.png");
|
||||
paragraph5.appendText(dcContextModel.getFileName());
|
||||
@ -797,6 +850,10 @@ public class OutputWordUtil {
|
||||
// 关闭文档对象
|
||||
doc.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -825,6 +882,59 @@ public class OutputWordUtil {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//判断表单图是否为单一模型并且只上传excel一种附件,导出手册直接导出excel手册
|
||||
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId);
|
||||
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
//查询模型文件属性上传附件信息
|
||||
List<UpfileModel> search = upFileDao.searchByRepositoryId(repositoryModel.getId(), "s");
|
||||
|
||||
if (search.size() > 0) {
|
||||
if (search.size() == 1) {
|
||||
DCContext dcContextModel = null;
|
||||
//获取
|
||||
String getExcelFileName = search.get(0).getFileName();
|
||||
|
||||
//获取文件的后缀名
|
||||
int lastIndexOf = getExcelFileName.lastIndexOf(".");
|
||||
String suffix = getExcelFileName.substring(lastIndexOf);
|
||||
if (suffix.equals(".xls") || suffix.equals(".xlsx")) {
|
||||
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||
|
||||
UserContext userContext = DispatcherRequest.getUserContext();
|
||||
|
||||
|
||||
String excelUrl = docName.substring(0, docName.lastIndexOf("/") + 1);
|
||||
|
||||
// 调用App
|
||||
String sourceAppId = "com.actionsoft.apps.coe.pal";
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.awspaas.user.apps.new_performance_indicator_library/UpdatePptxAndExcelAslp";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
//文件id,必填
|
||||
params.put("pl_uuid", repositoryId);
|
||||
//文件内容id,必填
|
||||
params.put("shape_uuid", search.get(0).getShape_uuid());
|
||||
|
||||
//文件保存地址,必填
|
||||
params.put("fil_path", excelUrl + search.get(0).getFileName());
|
||||
|
||||
//文件路径(不包含文件名称),必填
|
||||
params.put("file_url", excelUrl);
|
||||
|
||||
//文件名称,必填
|
||||
params.put("file_data", search.get(0).getFileName());
|
||||
//sid,必填
|
||||
params.put("sid", userContext.getSessionId());
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//根据上传的文件进行更新相关的excel或者ppt
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
|
||||
|
||||
} else {
|
||||
// 输出文档路径及名称
|
||||
File outFile = new File(docName);
|
||||
Writer out = null;
|
||||
@ -845,9 +955,42 @@ public class OutputWordUtil {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ConcatenationformBySpire(outFile.getPath(), search);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// 输出文档路径及名称
|
||||
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();
|
||||
}
|
||||
ConcatenationformBySpire(outFile.getPath(), search);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void ConcatenationformBySpire(String filePath, List<UpfileModel> search) throws FileNotFoundException {
|
||||
/**************************************************插入文件对象**********************************************************************/
|
||||
Document doc = new Document(outFile.getPath());
|
||||
Document doc = new Document(filePath);
|
||||
//获取最后一节
|
||||
Section section = doc.getLastSection();
|
||||
|
||||
@ -871,13 +1014,6 @@ public class OutputWordUtil {
|
||||
//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) {
|
||||
@ -961,10 +1097,9 @@ public class OutputWordUtil {
|
||||
|
||||
}
|
||||
|
||||
doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
||||
doc.saveToFile(filePath, FileFormat.Docx_2013);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将文件的扩展属性设置默认值为空字符串(防止没有设置扩展属性而使得导出文件出错)
|
||||
*
|
||||
|
||||
@ -3525,6 +3525,68 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
public String outputReportPPTPreview(UserContext _uc, String taskId) {
|
||||
OutputTaskModel model = new OutputTask().getTaskReportById(taskId);
|
||||
ResponseObject result = ResponseObject.newOkResponse();
|
||||
if (model != null) {
|
||||
try {
|
||||
UtilFile file = OutputAPIManager.getInstance().getFilePath(model.getWsId(), taskId, model.getProfileId());
|
||||
if (file.exists()) {
|
||||
File[] fileList = file.listFiles();
|
||||
if (fileList.length > 0) {
|
||||
File docFile = null;
|
||||
for (File file2 : fileList) {
|
||||
if (file2.isFile() && "pptx".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1)))) {
|
||||
docFile = file2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (docFile == null) {
|
||||
return ResponseObject.newErrResponse("没有找到文件").toString();
|
||||
}
|
||||
if (SDK.getAppAPI().isActive("com.actionsoft.apps.addons.onlinedoc")) {
|
||||
OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId());
|
||||
String sourceAppId = appFile.getAppContext().getId();
|
||||
String filename = docFile.getName();
|
||||
DCContext sourceDc = new DCContext(_uc, DCProfileManager.getDCProfile(sourceAppId, "output"), sourceAppId, model.getWsId(), taskId, filename);
|
||||
Map<String, Object> aslpParams = new HashMap<String, Object>();
|
||||
|
||||
aslpParams.put("sid", _uc.getSessionId());
|
||||
aslpParams.put("fileNameOriginal", filename);
|
||||
aslpParams.put("sourceDc", sourceDc);
|
||||
aslpParams.put("isShowDefaultToolbar", true);
|
||||
aslpParams.put("isShowBackbtn", false);
|
||||
aslpParams.put("isEncrypt", true);
|
||||
aslpParams.put("isCopy", true);
|
||||
aslpParams.put("isPrint", true);
|
||||
aslpParams.put("isDownload", true);
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
ResponseObject responseObject = appAPI.callASLP(appAPI.getAppContext(sourceAppId), "aslp://com.actionsoft.apps.addons.onlinedoc/filePreview", aslpParams);
|
||||
if (responseObject != null) {
|
||||
if (responseObject.isOk()) {
|
||||
String url = responseObject.get("url").toString();
|
||||
result.put("url", url);
|
||||
result.put("filename", filename);
|
||||
} else {
|
||||
result = ResponseObject.newErrResponse("文档转换服务不可用,请联系管理员");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result = ResponseObject.newErrResponse("文档转换服务不可用,请联系管理员");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result = ResponseObject.newErrResponse("没有可预览文件");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseObject.newErrResponse().toString();
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程手册下载
|
||||
*
|
||||
|
||||
@ -10,6 +10,11 @@ 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.PALMethodJsonModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.util.PALMethodUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.OutputAPIManager;
|
||||
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.PALRepositoryQueryAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
||||
@ -31,6 +36,9 @@ import com.actionsoft.apps.coe.pal.pal.repository.designer.util.ShapeUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.CoeProcessLevelAutoBean;
|
||||
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.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.util.CoeProcessLevelUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.web.CoeProcessLevelWeb;
|
||||
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
|
||||
@ -38,6 +46,7 @@ import com.actionsoft.apps.coe.pal.util.BpmOrgUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.StringHandleUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.UtilMapSort;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.cache.Cache;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
@ -57,11 +66,13 @@ import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.org.web.CompanyWeb;
|
||||
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.*;
|
||||
import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.exception.AWSObjectNotFindException;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -4098,19 +4109,45 @@ public class DesignerRelationShapeWeb extends ActionWeb {
|
||||
for (FormFile formFile : formFiles) {
|
||||
DCContext fileDCContext = SDK.getBOAPI().getFileDCContext(formFile);
|
||||
fileDCContext.setSession(_uc);
|
||||
String downloadURL = fileDCContext.getDownloadURL();
|
||||
String downloadURL = "";
|
||||
Map<String, Object> aslpParams = new HashMap<String, Object>();
|
||||
|
||||
String sourceAppId = "com.actionsoft.apps.coe.pal";
|
||||
aslpParams.put("sid", _uc.getSessionId());
|
||||
aslpParams.put("fileNameOriginal", fileDCContext.getFileName());
|
||||
aslpParams.put("sourceDc", fileDCContext);
|
||||
aslpParams.put("isShowDefaultToolbar", true);
|
||||
aslpParams.put("isShowBackbtn", false);
|
||||
aslpParams.put("isEncrypt", true);
|
||||
aslpParams.put("isCopy", true);
|
||||
aslpParams.put("isPrint", true);
|
||||
aslpParams.put("isDownload", true);
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
ResponseObject responseObject = appAPI.callASLP(appAPI.getAppContext(sourceAppId), "aslp://com.actionsoft.apps.addons.onlinedoc/filePreview", aslpParams);
|
||||
|
||||
|
||||
if (responseObject != null) {
|
||||
if (responseObject.isOk()) {
|
||||
String url = responseObject.get("url").toString();
|
||||
downloadURL = SDK.getPortalAPI().getPortalUrl() + "/r" + url.substring(1, url.length());
|
||||
}
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
String fileName = fileDCContext.getFileName();
|
||||
//视频支持mp4类型
|
||||
if (fileName.contains("mp4")) {
|
||||
jo.put("video", downloadURL);
|
||||
jo.put("video", fileDCContext.getDownloadURL());
|
||||
jo.put("video_url", downloadURL);
|
||||
} else if (fileName.contains("png") || fileName.contains("gif") || fileName.contains("jpg")) {
|
||||
jo.put("picture", downloadURL);
|
||||
jo.put("picture", fileDCContext.getDownloadURL());
|
||||
jo.put("picture_url", downloadURL);
|
||||
}
|
||||
jo.put("picTitle", fileName.split("\\.")[0]);
|
||||
filePathArray.add(jo);
|
||||
}
|
||||
macroLibraries.put("filePaths", filePathArray);
|
||||
|
||||
}
|
||||
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "carousel.map.html", macroLibraries);
|
||||
}
|
||||
|
||||
@ -4209,4 +4246,129 @@ public class DesignerRelationShapeWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断是否为第一个节点为excel
|
||||
*
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @param uuids
|
||||
* @return
|
||||
*/
|
||||
public String createOutputPrReportsByEstimateFile(String fileId) {
|
||||
//判断表单图是否为单一模型并且只上传excel一种附件,导出手册直接导出excel手册
|
||||
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(fileId);
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
//查询模型文件属性上传附件信息
|
||||
List<UpfileModel> search = upFileDao.searchByRepositoryId(repositoryModel.getId(), "s");
|
||||
|
||||
if (search.size() > 0) {
|
||||
if (search.size() == 1) {
|
||||
DCContext dcContextModel = null;
|
||||
//获取
|
||||
String getExcelFileName = search.get(0).getFileName();
|
||||
//获取文件的后缀名
|
||||
int lastIndexOf = getExcelFileName.lastIndexOf(".");
|
||||
String suffix = getExcelFileName.substring(lastIndexOf);
|
||||
if (suffix.equals(".xls") || suffix.equals(".xlsx")) {
|
||||
ro.put("result", "existExcel");
|
||||
} else {
|
||||
ro.put("result", "noexistExcel");
|
||||
}
|
||||
} else {
|
||||
ro.put("result", "noexistExcel");
|
||||
}
|
||||
}
|
||||
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
|
||||
public String createOutputPrReportsByEstimatePPTFile(UserContext me, String fileId) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
List<Map<String, Object>> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(fileId); //流程文件内容
|
||||
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(fileId);
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 流程附件列表
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
List<UpfileModel> search = upFileDao.search(repositoryModel.getId(), controlShapeId, null);
|
||||
DCContext dcContextpdf = null;
|
||||
//如果为PPT,则生成PPT手册
|
||||
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(me, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), upfileModel.getFileName());
|
||||
String path = dcContextpdf.getPath();
|
||||
String fileName = dcContextpdf.getFileName();
|
||||
String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
if (suffix.equals("pptx")) {
|
||||
ro.put("result", "existPPT");
|
||||
} else {
|
||||
ro.put("result", "noexistPPT");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
|
||||
public String createOutputPrReportsByDownloadExcelFile(String taskIds) {
|
||||
OutputTaskModel model = new OutputTask().getTaskReportById(taskIds);
|
||||
ResponseObject result = ResponseObject.newOkResponse();
|
||||
if (model != null) {
|
||||
try {
|
||||
UtilFile file = OutputAPIManager.getInstance().getFilePath(model.getWsId(), taskIds, model.getProfileId());
|
||||
if (file.exists()) {
|
||||
File[] fileList = file.listFiles();
|
||||
if (fileList.length > 0) {
|
||||
System.out.println("fileList==========" + fileList);
|
||||
File docFile = null;
|
||||
for (File file2 : fileList) {
|
||||
System.out.println("file2==============" + file2);
|
||||
if (file2.isFile() && "xlsx".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1)))) {
|
||||
docFile = file2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (docFile == null) {
|
||||
return ResponseObject.newErrResponse("没有找到文件").toString();
|
||||
}
|
||||
OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId());
|
||||
String sourceAppId = appFile.getAppContext().getId();
|
||||
String filename = docFile.getName();
|
||||
DCContext sourceDc = new DCContext(_uc, DCProfileManager.getDCProfile(sourceAppId, "output"), sourceAppId, model.getWsId(), taskIds, filename);
|
||||
String downUrl = SDK.getConfAPI().getPortalUrl() + "/r/"
|
||||
+ sourceDc.getDownloadURL().replace("./", "");
|
||||
result.put("url", downUrl);
|
||||
}
|
||||
} else {
|
||||
result = ResponseObject.newErrResponse("没有可预览文件");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseObject.newErrResponse().toString();
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@ -142,6 +142,7 @@ Designer.op.shapeSelectable = function(a) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//根据isLaneAttrConfig来判断数组的数据
|
||||
function getTmpArray(isLaneAttrConfig) {
|
||||
var tmpArray1 = ['verticalPool', 'verticalLane', 'horizontalPool', 'horizontalLane'];
|
||||
@ -152,6 +153,7 @@ function getTmpArray(isLaneAttrConfig) {
|
||||
return tmpArray1;
|
||||
}
|
||||
}
|
||||
|
||||
// 重写
|
||||
Designer.linkClickable = function (a, c) {/*
|
||||
* var b = $("#link_spot"); if
|
||||
@ -170,6 +172,7 @@ Designer.linkClickable = function(a, c) {/*
|
||||
var myshapeLink = "";
|
||||
var linkIndex = 0;
|
||||
var selectShape = Utils.getSelected()[0];
|
||||
|
||||
/**
|
||||
* 功能:去除字符串中所有空格 传参:需要处理的字符串 返回值:去除空格后的字符串
|
||||
*/
|
||||
@ -199,8 +202,16 @@ UI.showInsertLink = function() {
|
||||
$("#link_dialog").dialog({
|
||||
title: "插入链接",
|
||||
buttons: [
|
||||
{text:'确定',cls:"blue",handler:function(){UI.setLink();}},
|
||||
{text:'关闭',handler:function(){$('#link_dialog').dialog('close');}}
|
||||
{
|
||||
text: '确定', cls: "blue", handler: function () {
|
||||
UI.setLink();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '关闭', handler: function () {
|
||||
$('#link_dialog').dialog('close');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
$(".awsui-simple-tab").find("a[tit=file]").trigger('click');
|
||||
@ -326,13 +337,20 @@ UI.showImportDlg = function() {
|
||||
width: 400,
|
||||
height: 200,
|
||||
buttons: [
|
||||
{text:'导入',cls:"blue",handler:function(){
|
||||
{
|
||||
text: '导入', cls: "blue", handler: function () {
|
||||
importVisio();
|
||||
}},
|
||||
{text:'取消',handler:function(){$("#visio_import_dlg").dialog("close");}}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '取消', handler: function () {
|
||||
$("#visio_import_dlg").dialog("close");
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
//初始化visio导入的fileupload组件
|
||||
function initVisioImportFileUpload() {
|
||||
$("#visio_import_upfile").upfile({
|
||||
@ -834,6 +852,7 @@ function setLinkTargetType(obj) {
|
||||
$(obj).parent().hide().siblings().show().text($(obj)
|
||||
.find("option:selected").text());
|
||||
}
|
||||
|
||||
// 判断给定的对象是不是数组
|
||||
|
||||
function isArray(o) {
|
||||
@ -956,11 +975,13 @@ function checkLink(str) {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// 隐藏链接重复提示
|
||||
|
||||
function removerWarning() {
|
||||
$("#warningContent").text("");
|
||||
}
|
||||
|
||||
// 删除所选 链接
|
||||
|
||||
function deleteTheLinkNode(str, index) {
|
||||
@ -1062,12 +1083,14 @@ function removeLinkHistoryByLink(obj) {
|
||||
window.top.$.confirm(options);
|
||||
|
||||
}
|
||||
|
||||
// 显示链接历史的删除
|
||||
|
||||
function showRemoveTrLinkHistory(obj) {
|
||||
$(obj).children("td").children("span::contains('删除')").show();
|
||||
$(obj).children("td").children("span").children("select").show();
|
||||
}
|
||||
|
||||
// 隐藏链接历史的删除按钮
|
||||
|
||||
function hideRemoveTrLinkHistory(obj) {
|
||||
@ -1298,6 +1321,7 @@ function showRelevanceShapesContent() {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function noPermissionMsg() {
|
||||
$.simpleAlert("暂无该模型权限", "warning", 1500);
|
||||
}
|
||||
@ -1379,6 +1403,7 @@ function attributeShowTabContent(currentShape) {
|
||||
// var dialogTableList = []
|
||||
var tableObj = {}
|
||||
var curTableId = ''
|
||||
|
||||
function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
|
||||
// 属性排序
|
||||
var defaultMoreAttr = $('#defaultMoreAttrSort').val();
|
||||
@ -1462,10 +1487,12 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
|
||||
+ '</td></tr>';
|
||||
} else if (!objReadonly && objType == "boolean") {
|
||||
booleanFlag = true;
|
||||
var booleanValue = { "objId" : obj.id,
|
||||
var booleanValue = {
|
||||
"objId": obj.id,
|
||||
"objValue": obj.value,
|
||||
"objOptions": obj.ref,
|
||||
"objType": objType};
|
||||
"objType": objType
|
||||
};
|
||||
booleanValues.push(booleanValue);
|
||||
constr = '<tr ' + mouseout + mouseover + ' objid="' + obj.id + '" class="tagContentTableTr">'
|
||||
+ ' <td>' + objName + '</td>'
|
||||
@ -1500,9 +1527,11 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
|
||||
|
||||
} else if (objType == "select" || objType == "select_m") {
|
||||
selectFlag = true;
|
||||
var selectValue = { "objId" : obj.id,
|
||||
var selectValue = {
|
||||
"objId": obj.id,
|
||||
"objValue": obj.value,
|
||||
"objType": objType};
|
||||
"objType": objType
|
||||
};
|
||||
selectValues.push(selectValue);
|
||||
|
||||
constr = '<tr ' + mouseout + mouseover + ' objid="' + obj.id + '" class="tagContentTableTr">'
|
||||
@ -1540,7 +1569,11 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
|
||||
} else if (!objReadonly && objType == "table") {
|
||||
let objRef = JSON.parse(obj.ref)
|
||||
let objTableInput = obj.value.table !== undefined && obj.value.table.length > 1 ? '请查看' : '请输入'
|
||||
tableObj[obj.id] = obj.value.table == undefined ? [ { id: Utils.newId() ,name: objRef.firstColumn, desc: objRef.secondColumn} ] : obj.value.table;
|
||||
tableObj[obj.id] = obj.value.table == undefined ? [{
|
||||
id: Utils.newId(),
|
||||
name: objRef.firstColumn,
|
||||
desc: objRef.secondColumn
|
||||
}] : obj.value.table;
|
||||
// dialogTableList = obj.value.table == undefined ? [ { id: Utils.newId() ,name: objRef.firstColumn, desc: objRef.secondColumn} ] : obj.value.table;
|
||||
constr = '<tr ' + mouseout + mouseover + ' class="tagContentTableTr">'
|
||||
+ ' <td>' + objName + requiredSpan + '</td>'
|
||||
@ -1652,6 +1685,7 @@ function getAttributeByAttrId(shape, objId, relationShapes) {
|
||||
|
||||
return shape;
|
||||
}
|
||||
|
||||
Array.prototype.notDistinct = function () {
|
||||
var newArr = [], obj = {};
|
||||
for (var i = 0, len = this.length; i < len; i++) {
|
||||
@ -1876,6 +1910,7 @@ function removeShepeAttributeAndReturnDifferent(exitObj, newObj1) {
|
||||
}
|
||||
return exitObj;
|
||||
}
|
||||
|
||||
// 删除没有选中的元素
|
||||
|
||||
function removeNotCheckedAttribute(shape, obj1) {
|
||||
@ -1909,6 +1944,7 @@ function removeNotCheckedAttribute(shape, obj1) {
|
||||
// Model.update(shape);
|
||||
$("#tagContentTable0 tr[objid='" + obj1.id + "']").remove();
|
||||
}
|
||||
|
||||
// 过滤掉重复的属性生成新的数组
|
||||
|
||||
function filterRepeatAttribute(arr1, arr2, shape) {
|
||||
@ -1944,6 +1980,7 @@ function showEditButton(obj) {
|
||||
}
|
||||
|
||||
var inputUpdate = false;
|
||||
|
||||
function saveInputContent(obj, value) {
|
||||
// 按钮
|
||||
// $(obj).siblings("span::contains('...')").hide();
|
||||
@ -2272,6 +2309,7 @@ function removeTrAttribute(obj) {
|
||||
};
|
||||
window.top.$.confirm(options);
|
||||
}
|
||||
|
||||
// 显示删除按钮
|
||||
|
||||
function showRemoveTrAttribute(obj) {
|
||||
@ -2286,6 +2324,7 @@ function showRemoveTrAttribute(obj) {
|
||||
$(obj).children("td").children("span").hide();
|
||||
}
|
||||
}
|
||||
|
||||
// 隐藏删除按钮
|
||||
|
||||
function hideRemoveTrAttribute(obj) {
|
||||
@ -2300,6 +2339,7 @@ function hideRemoveTrAttribute(obj) {
|
||||
$(obj).children("td").children("span").show();
|
||||
}
|
||||
}
|
||||
|
||||
// 经常用的是通过遍历,重构数组.
|
||||
Array.prototype.remove = function (dx) {
|
||||
if (isNaN(dx) || dx > this.length) {
|
||||
@ -2312,6 +2352,7 @@ Array.prototype.remove = function(dx) {
|
||||
}
|
||||
this.length -= 1;
|
||||
};
|
||||
|
||||
function removeElementFromArr(dx, obj) {
|
||||
if (isNaN(dx) || dx > obj.length) {
|
||||
return false;
|
||||
@ -2588,6 +2629,7 @@ function deleteLinkerSelected(linker) {
|
||||
Model.remove(d)
|
||||
}
|
||||
}
|
||||
|
||||
// 显示图形关系特性
|
||||
|
||||
function showShapeRelationTab(currentShape) {
|
||||
@ -2697,6 +2739,7 @@ function showShapeRelationTab(currentShape) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 给关系类型增加内容
|
||||
|
||||
function addtagContentTableContent(shape1, str, obj) {
|
||||
@ -2711,6 +2754,7 @@ function addtagContentTableContent(shape1, str, obj) {
|
||||
+ '</div> </td></tr>';
|
||||
$("#tagContentTable1").append(constr);
|
||||
}
|
||||
|
||||
// 判断是不是支持对象的关系类型
|
||||
|
||||
function isObjectRelationshipModel(linker, isAlert) {
|
||||
@ -2895,6 +2939,7 @@ function changeArributeByShape() {
|
||||
$("#attr_no_more_attribute_id").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function initUserAddressForShape(objIds, shapeId, shapeName) {
|
||||
$.each(objIds, function (key, value) {
|
||||
var objId = value;
|
||||
@ -3459,7 +3504,6 @@ function getRelevanceAwsOrgNameByShapeId(objIds, shapeId) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 形状关联弹窗
|
||||
function openRelationDig(obj, value) {
|
||||
var shapeRelationValue = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").val();
|
||||
@ -3908,6 +3952,7 @@ function saveRelevanceShapesTODB(shapesObj, shapeId, shapeName, fileName,
|
||||
|
||||
// 获取boolean类型属性的option
|
||||
var booleanComboboxs = [];
|
||||
|
||||
function getBooleanSelectOptions(booleanValues, shapeId) {
|
||||
for (var i = 0; i < booleanValues.length; i++) {
|
||||
var objId = booleanValues[i].objId;
|
||||
@ -3975,6 +4020,7 @@ function getBooleanSelectOptions(booleanValues, shapeId) {
|
||||
|
||||
//获取select类型属性的option
|
||||
var comboboxs = [];
|
||||
|
||||
function getSelectOptions(category, selectValues, shapeId) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@ -4118,6 +4164,7 @@ function getScreenResolution() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图形创建后事件
|
||||
*/
|
||||
@ -4173,7 +4220,37 @@ function outputReport() {
|
||||
fileId: ruuid
|
||||
},
|
||||
success: function (r) {
|
||||
debugger;
|
||||
if (r.result == "ok") {
|
||||
if (methodId == "data.form") {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal.publisher_output_pr_estimateFile",
|
||||
data: {
|
||||
fileId: ruuid
|
||||
},
|
||||
success: function (rep) {
|
||||
if (rep.data.result == "existExcel") {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal.publisher_output_pr_downloadExcelFile",
|
||||
data: {
|
||||
taskIds: r.data.taskId
|
||||
},
|
||||
success: function (msg) {
|
||||
if (msg.result == "ok") {
|
||||
window.open(msg.data.url);
|
||||
$.simpleAlert("close");
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.simpleAlert('正在打开', 'loading');
|
||||
setTimeout(function () {
|
||||
$.ajax({
|
||||
@ -4198,6 +4275,98 @@ function outputReport() {
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (methodId == 'control.policy') {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal.publisher_output_pr_estimatePPTFile",
|
||||
data: {
|
||||
fileId: ruuid
|
||||
},
|
||||
success: function (rep) {
|
||||
debugger;
|
||||
if (rep.data.result == "existPPT") {
|
||||
setTimeout(function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_ppt_preview",
|
||||
data: {
|
||||
taskId: r.data.taskId
|
||||
},
|
||||
success: function (msg) {
|
||||
if (msg.result == "ok") {
|
||||
$.simpleAlert("close");
|
||||
if (msg['data']) {
|
||||
var url = msg['data']['url'];
|
||||
window.open(url);
|
||||
}
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert(msg['msg'], 'info');
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
} else {
|
||||
$.simpleAlert('正在打开', 'loading');
|
||||
setTimeout(function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_preview",
|
||||
data: {
|
||||
taskId: r.data.taskId
|
||||
},
|
||||
success: function (msg) {
|
||||
if (msg.result == "ok") {
|
||||
$.simpleAlert("close");
|
||||
if (msg['data']) {
|
||||
var url = msg['data']['url'];
|
||||
window.open(url);
|
||||
}
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert(msg['msg'], 'info');
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.simpleAlert('正在打开', 'loading');
|
||||
setTimeout(function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_preview",
|
||||
data: {
|
||||
taskId: r.data.taskId
|
||||
},
|
||||
success: function (msg) {
|
||||
if (msg.result == "ok") {
|
||||
$.simpleAlert("close");
|
||||
if (msg['data']) {
|
||||
var url = msg['data']['url'];
|
||||
window.open(url);
|
||||
}
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert(msg['msg'], 'info');
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
} else {
|
||||
if (methodId == 'data.form') {
|
||||
$.simpleAlert('表单手册创建失败', 'error');
|
||||
@ -4222,10 +4391,16 @@ UI.showImportShapeDlg = function() {
|
||||
width: 570,
|
||||
height: 380,
|
||||
buttons: [
|
||||
{text:'确定',cls:"blue",handler:function(){
|
||||
{
|
||||
text: '确定', cls: "blue", handler: function () {
|
||||
importShapeFile();
|
||||
}},
|
||||
{text:'取消',handler:function(){$("#shape_import_dlg").dialog("close");}}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '取消', handler: function () {
|
||||
$("#shape_import_dlg").dialog("close");
|
||||
}
|
||||
}
|
||||
],
|
||||
onClose: delShapeFiles
|
||||
});
|
||||
@ -4414,10 +4589,16 @@ UI.showImportPolicyFileDlg = function() {
|
||||
width: 570,
|
||||
height: 380,
|
||||
buttons: [
|
||||
{text:'确定',cls:"blue",handler:function(){
|
||||
{
|
||||
text: '确定', cls: "blue", handler: function () {
|
||||
importPolicyFile();
|
||||
}},
|
||||
{text:'取消',handler:function(){$("#policyfile_import_dlg").dialog("close");}}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '取消', handler: function () {
|
||||
$("#policyfile_import_dlg").dialog("close");
|
||||
}
|
||||
}
|
||||
],
|
||||
onClose: delPolicyFiles
|
||||
});
|
||||
@ -4878,6 +5059,7 @@ function getInterfaceShapeLink(obj, elements) {
|
||||
}
|
||||
|
||||
var checkObj = undefined;
|
||||
|
||||
// 画布鼠标右键-添加至前置流程、后置流程功能
|
||||
function showLeadAndRearProcessDlg(type) {
|
||||
checkObj = undefined;
|
||||
|
||||
@ -79,6 +79,7 @@ public class InstitutionalTextWeb extends ActionWeb {
|
||||
public String systemManualTextExport() {
|
||||
List<String> listIds = OutputAppManager.getProfileName("");
|
||||
|
||||
|
||||
//查询制度流程文件
|
||||
List<RowMap> policyMap = DBSql.getMaps("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLMETHODID='control.policy' ");
|
||||
|
||||
@ -101,7 +102,6 @@ public class InstitutionalTextWeb extends ActionWeb {
|
||||
exportText(policyMap.get(i).getString("ID"), policyMap.get(i).getString("WSID"), policyMap.get(i).getString("PLNAME"), policyMap.get(i).getString("PLVER"), zipName, times, targetDir, targetFileDir);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
UtilFile.zipCompress(targetDir, new File(targetDir + zipName));
|
||||
|
||||
@ -133,6 +133,7 @@ public class InstitutionalTextWeb extends ActionWeb {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 制度正文单条导出
|
||||
*
|
||||
@ -183,6 +184,7 @@ public class InstitutionalTextWeb extends ActionWeb {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void exportText(String targetFileId, String wsId, String plname, String versionNumer, String zipName, long times, String targetDir, File targetFileDir) {
|
||||
ProcessInstance boProcessInstance = SDK.getProcessAPI()
|
||||
.createBOProcessInstance("obj_c0fd5262f1c64df9ab5e725aae3eff2e", "admin", "正文导出");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user