Commit 79373890 by liuyang

2024/03/14 文件下载和文件删除调整

parent aaf8be59
...@@ -787,15 +787,24 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -787,15 +787,24 @@ public class ServiceHPSC002 extends ServiceBase {
// 项目环境 // 项目环境
String projectEnv = ProjectInfo.getProjectEnv(); String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) { if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo eiInfo = new EiInfo(); EiInfo queryInfo = new EiInfo();
eiInfo.set("data",realPath+"-"+0); queryInfo.set(HPSC002A.FIELD_DOC_ID,hpds002.getDocId());
eiInfo.set(EiConstant.serviceId,"S_EU_0105"); //获取文档信息
//调用接口 queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo outInfo = XServiceManager.call(eiInfo); EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){ Map docInfoMap = docInfo.getMap("docMap");
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败"); if (docInfoMap.size() > 0) {
outInfo.setMsg("失败"); EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
} }
}else { }else {
FileUtils.deleteFile(realPath); FileUtils.deleteFile(realPath);
......
...@@ -150,15 +150,24 @@ public class ServiceHPSC002A extends ServiceEPBase { ...@@ -150,15 +150,24 @@ public class ServiceHPSC002A extends ServiceEPBase {
// 项目环境 // 项目环境
String projectEnv = ProjectInfo.getProjectEnv(); String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) { if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo eiInfo = new EiInfo(); EiInfo queryInfo = new EiInfo();
eiInfo.set("data",realPath+"-"+0); queryInfo.set(HPSC002A.FIELD_DOC_ID,list.get(0).getDocId());
eiInfo.set(EiConstant.serviceId,"S_EU_0105"); //获取文档信息
//调用接口 queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo outInfo = XServiceManager.call(eiInfo); EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){ if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败"); LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败"); outInfo.setMsg("失败");
}
} }
}else { }else {
FileUtils.deleteFile(realPath); FileUtils.deleteFile(realPath);
......
...@@ -331,15 +331,24 @@ public class ServiceHPSC006 extends ServiceBase { ...@@ -331,15 +331,24 @@ public class ServiceHPSC006 extends ServiceBase {
// 项目环境 // 项目环境
String projectEnv = ProjectInfo.getProjectEnv(); String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) { if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo eiInfo = new EiInfo(); EiInfo queryInfo = new EiInfo();
eiInfo.set("data",realPath+"-"+0); queryInfo.set(HPSC002A.FIELD_DOC_ID,hpds002.getDocId());
eiInfo.set(EiConstant.serviceId,"S_EU_0105"); //获取文档信息
//调用接口 queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo outInfo = XServiceManager.call(eiInfo); EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){ if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败"); LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败"); outInfo.setMsg("失败");
}
} }
}else { }else {
FileUtils.deleteFile(realPath); FileUtils.deleteFile(realPath);
......
...@@ -43,10 +43,10 @@ $(function () { ...@@ -43,10 +43,10 @@ $(function () {
field: "docName", field: "docName",
title: "文件名称", title: "文件名称",
template: function (item) { template: function (item) {
let docId = item.docId;
let docName = item.docName let docName = item.docName
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + item.docId + 'href="' + downloadHref(docId) + '" target="_blank">'+docName+'</a>';
+ '" >'+docName+'</a>';
return template; return template;
} }
}], }],
...@@ -119,11 +119,14 @@ $(function () { ...@@ -119,11 +119,14 @@ $(function () {
NotificationUtil("请至少选中一条数据", "info"); NotificationUtil("请至少选中一条数据", "info");
} else { } else {
for (let i = 0, length = checkedRows.length; i < length; i++) { for (let i = 0, length = checkedRows.length; i < length; i++) {
docId += checkedRows[i]["docId"];
docId += "," downloadHref(checkedRows[i]["docId"])
//docId += checkedRows[i]["docId"];
//docId += ","
} }
docId = docId.substr(0, docId.lastIndexOf(','));
window.location.href = IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM14.jsp?docIds=' + docId //docId = docId.substr(0, docId.lastIndexOf(','));
//window.location.href = IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM14.jsp?docIds=' + docId
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment