制度手册根据xml生成手册调整

This commit is contained in:
lihongyu 2022-11-18 05:36:07 +08:00
parent 0177a06443
commit 13bc4a006d

View File

@ -228,19 +228,17 @@ public class Report1Gener {
if (upfileModel.getFileName().contains(".xml")) {
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(".xml"));
* docs.saveToFile("/"+path+substring+".xml",FileFormat.Word_ML); dcContextpdf =
* new DCContext(userContext, dcProfile, CoEConstant.APP_ID,
* upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), substring+".xml");
*/
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_ML); dcContextpdf =
new DCContext(userContext, dcProfile, CoEConstant.APP_ID,
upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), substring+".xml");
break;
}
}
@ -457,20 +455,7 @@ public class Report1Gener {
String shpId = "";
UpFileDao upFileDao = new UpFileDao();
StringBuffer sqlWhere = new StringBuffer();
//制度手册过滤掉第一个节点形状上的附件
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(repositoryId, 0);
String define = defineModel.getDefinition();
JSONObject definition = JSONObject.parseObject(define);
JSONObject elements = definition.getJSONObject("elements");
for (String key : elements.keySet()) {
JSONObject shape1 = elements.getJSONObject(key);
if ("regulation,I/O_L4,manual".contains(shape1.getString("name"))) {
shpId = key;
break;
}
}
sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'").append(" and SHAPEID !='").append(shpId).append("'");
sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryModel.getId()).append("'");
List<UpfileModel> search = upFileDao.search(sqlWhere.toString());
File file = null;
//三员管理下用户密级与文件密级过滤显示
@ -492,9 +477,9 @@ public class Report1Gener {
if (search != null && search.size() > 0) {
// 复制附件
for (UpfileModel upfileModel : search) {
/*
* if (!"f".equals(upfileModel.getType())) {// 文件 continue; }
*/
if (!"f".equals(upfileModel.getType())) {
continue;
}
// 复制doccenter下的文件
DCContext dcContext = null;
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);