表单手册文件标题修改
制度解析word正文
This commit is contained in:
parent
4c0cf05bd9
commit
f63f607023
@ -1561,7 +1561,7 @@
|
|||||||
<w:color w:val="000000"/>
|
<w:color w:val="000000"/>
|
||||||
<w:sz w:val="52"/>
|
<w:sz w:val="52"/>
|
||||||
</w:rPr>
|
</w:rPr>
|
||||||
<w:t>表单文件</w:t>
|
<w:t></w:t>
|
||||||
</w:r>
|
</w:r>
|
||||||
</w:p>
|
</w:p>
|
||||||
<w:p wsp:rsidR="00AC2941" wsp:rsidRDefault="00AC2941">
|
<w:p wsp:rsidR="00AC2941" wsp:rsidRDefault="00AC2941">
|
||||||
|
|||||||
@ -43,6 +43,8 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.awspaas.apps.coe.pal.output.zd.util.PrReportComment;
|
import com.awspaas.apps.coe.pal.output.zd.util.PrReportComment;
|
||||||
import com.awspaas.apps.coe.pal.output.zd.util.ReportRepositoryCompare;
|
import com.awspaas.apps.coe.pal.output.zd.util.ReportRepositoryCompare;
|
||||||
import com.awspaas.apps.coe.pal.output.zd.util.XMLUtil;
|
import com.awspaas.apps.coe.pal.output.zd.util.XMLUtil;
|
||||||
|
import com.spire.doc.FileFormat;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
@ -200,22 +202,52 @@ public class Report1Gener {
|
|||||||
UpFileDao upFileDao = new UpFileDao();
|
UpFileDao upFileDao = new UpFileDao();
|
||||||
List<UpfileModel> search = upFileDao.search(repositoryModel.getId(), controlShapeId, null);
|
List<UpfileModel> search = upFileDao.search(repositoryModel.getId(), controlShapeId, null);
|
||||||
|
|
||||||
DCContext dc = null;
|
DCContext dcContextpdf = null;
|
||||||
File file = null;
|
File file = null;
|
||||||
if (search != null && search.size() > 0) {
|
if (search != null && search.size() > 0) {
|
||||||
// 复制附件
|
// 复制附件
|
||||||
for (UpfileModel upfileModel : search) {
|
for (UpfileModel upfileModel : search) {
|
||||||
if (upfileModel.getFileName().contains(".xml")) {
|
|
||||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||||
|
if (upfileModel.getFileName().contains(".xml")) {
|
||||||
if (dcProfile != null) {
|
if (dcProfile != null) {
|
||||||
dc = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), upfileModel.getFileName());
|
dcContextpdf = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), upfileModel.getFileName());
|
||||||
|
/*
|
||||||
|
* String path = dcContextpdf.getPath(); String fileName =
|
||||||
|
* dcContextpdf.getFileName(); //创建实例,加载doc测试文档 com.spire.doc.Document docs =
|
||||||
|
* new com.spire.doc.Document(); docs.loadFromFile("/"+path+fileName);
|
||||||
|
* //保存为xml格式
|
||||||
|
* //nas/awsinst/doccenter/com.actionsoft.apps.coe.pal/COE_Upfile/03e55104-3ac6-
|
||||||
|
* 4298-8a9f-6d1c03cad06b/obj_2ebe57d0f9b84bdeb7cf697945d3c5ab/
|
||||||
|
* 液态奶事业部食品安全委员会运行管理规定.doc String substring = fileName.substring(0,
|
||||||
|
* fileName.lastIndexOf(".xml"));
|
||||||
|
* docs.saveToFile("/"+path+substring+".xml",FileFormat.Word_Xml); dcContextpdf
|
||||||
|
* = new DCContext(userContext, dcProfile, CoEConstant.APP_ID,
|
||||||
|
* upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), substring+".xml");
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (upfileModel.getFileName().contains(".doc")||upfileModel.getFileName().contains(".docx")) {
|
||||||
|
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();
|
||||||
|
//创建实例,加载doc测试文档
|
||||||
|
com.spire.doc.Document docs = new com.spire.doc.Document();
|
||||||
|
docs.loadFromFile("/"+path+fileName);
|
||||||
|
//保存为xml格式
|
||||||
|
//nas/awsinst/doccenter/com.actionsoft.apps.coe.pal/COE_Upfile/03e55104-3ac6-4298-8a9f-6d1c03cad06b/obj_2ebe57d0f9b84bdeb7cf697945d3c5ab/液态奶事业部食品安全委员会运行管理规定.doc
|
||||||
|
String substring = fileName.substring(0, fileName.lastIndexOf(".doc"));
|
||||||
|
docs.saveToFile("/"+path+substring+".xml",FileFormat.Word_ML);
|
||||||
|
dcContextpdf = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), substring+".xml");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dc != null) {
|
|
||||||
file = new File(dc.getFilePath());
|
}
|
||||||
|
}
|
||||||
|
if (dcContextpdf != null) {
|
||||||
|
file = new File(dcContextpdf.getFilePath());
|
||||||
}
|
}
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
// 解析xml文件
|
// 解析xml文件
|
||||||
@ -490,12 +522,12 @@ public class Report1Gener {
|
|||||||
if (search != null && search.size() > 0) {
|
if (search != null && search.size() > 0) {
|
||||||
// 复制附件
|
// 复制附件
|
||||||
for (UpfileModel upfileModel : search) {
|
for (UpfileModel upfileModel : search) {
|
||||||
if ("f".equals(upfileModel.getType())) {
|
/*
|
||||||
continue;
|
* if ("f".equals(upfileModel.getType())) { continue; } if
|
||||||
}
|
* (!shape.get("id").equals(upfileModel.getShape_uuid())) { continue; }
|
||||||
if (!shape.get("id").equals(upfileModel.getShape_uuid())) {
|
*/
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 复制doccenter下的文件
|
// 复制doccenter下的文件
|
||||||
// DCContext dcContext = null;
|
// DCContext dcContext = null;
|
||||||
// DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
// DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||||
@ -668,6 +700,7 @@ public class Report1Gener {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
for (DesignerShapeRelationModel relation : relationList2) {
|
for (DesignerShapeRelationModel relation : relationList2) {
|
||||||
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
||||||
|
System.err.println("生成手册时相关文件id=======>"+relationFileId);
|
||||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
||||||
if (model != null) {
|
if (model != null) {
|
||||||
count++;
|
count++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user