下载
This commit is contained in:
parent
fbc8f3b0a7
commit
18f7ee99df
@ -6,6 +6,7 @@ package com.actionsoft.apps.coe.pal.pal.repository.upfile.web;
|
||||
import java.io.File;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.*;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
||||
@ -13,6 +14,9 @@ import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
||||
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.OutputAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
|
||||
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.dao.CoeProcessLevelDaoFacotory;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
|
||||
@ -404,23 +408,32 @@ public class UpfileWeb extends ActionWeb {
|
||||
|
||||
|
||||
/**
|
||||
* 附件下载功能
|
||||
* 压缩附件下载功能
|
||||
*
|
||||
* @param uuid
|
||||
* @return
|
||||
* @author zhaolei
|
||||
*/
|
||||
public String readFileDownLoad(String uuid) {
|
||||
public String readZipFileDownLoad(String uuid) throws Exception {
|
||||
UserContext me = super.getContext();
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
UpFileDao upfileDao = new UpFileDao();
|
||||
UpfileModel upfileModel = upfileDao.get(uuid);
|
||||
DCContext dcContext = getDCContext(upfileModel);
|
||||
|
||||
UtilFile file = new UtilFile(dcContext.getPath());
|
||||
|
||||
DCUtil.getInstance();
|
||||
dcContext = DCUtil.createTempFileContext("com.actionsoft.apps.coe.pal", "output", uuid, "zip");
|
||||
dcContext.setFileName("xxx.zip");
|
||||
File ff = new File(dcContext.getFilePath());
|
||||
UtilFile.zipCompressExcludeName(file.getPath(), ff, "log,**/config.txt");
|
||||
dcContext.setSession(_uc);
|
||||
|
||||
String downUrl=SDK.getConfAPI().getPortalUrl() + "/r/" + dcContext.getDownloadURL().replace("./", "");
|
||||
ro.put("url",downUrl);
|
||||
|
||||
return ro.toString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2273,7 +2273,7 @@ public class CoeProcessLevelUtil {
|
||||
relationFileId = JSONObject.parseObject(property.getPropertyValue()).get("relationFileId").toString();
|
||||
if(relationFileId.contains(",")){
|
||||
String[] spiltRelationFileId=relationFileId.split(",");
|
||||
relationFileId=spiltRelationFileId[0];
|
||||
relationFileId=spiltRelationFileId[1];
|
||||
}
|
||||
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid);
|
||||
|
||||
@ -1452,13 +1452,11 @@ function isObjectRelationshipModel(linker, isAlert) {
|
||||
|
||||
// 文件属性的处理
|
||||
function initProcessDesc() {
|
||||
debugger;
|
||||
var length = Object.keys(processDesc).length;
|
||||
var t = '';
|
||||
var b='';
|
||||
for(var i = 1; i <= length; i++) {
|
||||
var obj = processDesc[i];
|
||||
debugger;
|
||||
//判断如果为相关文件/支持文件显示在右侧区域
|
||||
if(obj.name=="相关文件" || obj.name=="支持文件"){
|
||||
b += '<table class="awsui-table">';
|
||||
@ -1653,11 +1651,12 @@ function downloadProcessFile(taskId) {
|
||||
* 相关文件/制度文件下载
|
||||
* @param uuid
|
||||
*/
|
||||
function downloadFile(uuid) {
|
||||
function downloadZipFile(uuid) {
|
||||
debugger;
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid=" + sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_downloadfile",
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_downloadZipfile",
|
||||
data : {
|
||||
uuid : uuid
|
||||
},
|
||||
@ -1687,7 +1686,7 @@ function initUpfileData(obj) {
|
||||
var obj = processFile[i];
|
||||
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>';
|
||||
t +='<button id="ProcessManual" type="button" class="awsui-btn awsui-btn-blue awsui-btn-sm">';
|
||||
t += '<i class="awsui-iconfont" onclick="downloadFile(\''+obj.id+'\')"></i>';
|
||||
t += '<i class="awsui-iconfont" onclick="downloadZipFile(\''+obj.id+'\')"></i>';
|
||||
t +='</button>';
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user