This commit is contained in:
zhal 2022-07-30 20:29:23 +08:00
parent fbc8f3b0a7
commit 18f7ee99df
3 changed files with 21 additions and 9 deletions

View File

@ -6,6 +6,7 @@ package com.actionsoft.apps.coe.pal.pal.repository.upfile.web;
import java.io.File; import java.io.File;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.*; import java.util.*;
import java.util.zip.ZipOutputStream;
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager; import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI; 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.cache.PALMethodCache;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel; 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.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.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory; import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
@ -404,23 +408,32 @@ public class UpfileWeb extends ActionWeb {
/** /**
* 附件下载功能 * 压缩附件下载功能
* *
* @param uuid * @param uuid
* @return * @return
* @author zhaolei * @author zhaolei
*/ */
public String readFileDownLoad(String uuid) { public String readZipFileDownLoad(String uuid) throws Exception {
UserContext me = super.getContext(); UserContext me = super.getContext();
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
UpFileDao upfileDao = new UpFileDao(); UpFileDao upfileDao = new UpFileDao();
UpfileModel upfileModel = upfileDao.get(uuid); UpfileModel upfileModel = upfileDao.get(uuid);
DCContext dcContext = getDCContext(upfileModel); 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("./", ""); String downUrl=SDK.getConfAPI().getPortalUrl() + "/r/" + dcContext.getDownloadURL().replace("./", "");
ro.put("url",downUrl); ro.put("url",downUrl);
return ro.toString(); return ro.toString();
} }

View File

@ -2273,7 +2273,7 @@ public class CoeProcessLevelUtil {
relationFileId = JSONObject.parseObject(property.getPropertyValue()).get("relationFileId").toString(); relationFileId = JSONObject.parseObject(property.getPropertyValue()).get("relationFileId").toString();
if(relationFileId.contains(",")){ if(relationFileId.contains(",")){
String[] spiltRelationFileId=relationFileId.split(","); String[] spiltRelationFileId=relationFileId.split(",");
relationFileId=spiltRelationFileId[0]; relationFileId=spiltRelationFileId[1];
} }
PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid); PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid);

View File

@ -1452,13 +1452,11 @@ function isObjectRelationshipModel(linker, isAlert) {
// 文件属性的处理 // 文件属性的处理
function initProcessDesc() { function initProcessDesc() {
debugger;
var length = Object.keys(processDesc).length; var length = Object.keys(processDesc).length;
var t = ''; var t = '';
var b=''; var b='';
for(var i = 1; i <= length; i++) { for(var i = 1; i <= length; i++) {
var obj = processDesc[i]; var obj = processDesc[i];
debugger;
//判断如果为相关文件/支持文件显示在右侧区域 //判断如果为相关文件/支持文件显示在右侧区域
if(obj.name=="相关文件" || obj.name=="支持文件"){ if(obj.name=="相关文件" || obj.name=="支持文件"){
b += '<table class="awsui-table">'; b += '<table class="awsui-table">';
@ -1653,11 +1651,12 @@ function downloadProcessFile(taskId) {
* 相关文件/制度文件下载 * 相关文件/制度文件下载
* @param uuid * @param uuid
*/ */
function downloadFile(uuid) { function downloadZipFile(uuid) {
debugger;
$.ajax({ $.ajax({
type : "POST", type : "POST",
url : "./jd?sid=" + sid url : "./jd?sid=" + sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_downloadfile", + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_downloadZipfile",
data : { data : {
uuid : uuid uuid : uuid
}, },
@ -1687,7 +1686,7 @@ function initUpfileData(obj) {
var obj = processFile[i]; var obj = processFile[i];
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>'; 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 +='<button id="ProcessManual" type="button" class="awsui-btn awsui-btn-blue awsui-btn-sm">';
t += '<i class="awsui-iconfont" onclick="downloadFile(\''+obj.id+'\')">&#xe653;</i>'; t += '<i class="awsui-iconfont" onclick="downloadZipFile(\''+obj.id+'\')">&#xe653;</i>';
t +='</button>'; t +='</button>';
} }