下载日志监控代码提交

This commit is contained in:
zhaol 2025-07-15 15:36:48 +08:00
parent fb972a5d0b
commit 6596ec611f
8 changed files with 139 additions and 9 deletions

View File

@ -1,6 +1,8 @@
package com.actionsoft.apps.coe.pal; package com.actionsoft.apps.coe.pal;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
@ -45,6 +47,8 @@ import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilString; import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.exception.ExceptionUtil; import com.actionsoft.exception.ExceptionUtil;
import com.actionsoft.i18n.I18nRes; import com.actionsoft.i18n.I18nRes;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.AppAPI;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -2601,6 +2605,31 @@ public class CoEPALController {
} else if ("control.policy".equals(methodId) ||"process.scheme".equals(methodId) || "engineering.standard".equals(methodId)) { } else if ("control.policy".equals(methodId) ||"process.scheme".equals(methodId) || "engineering.standard".equals(methodId)) {
return PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, me.getUID(), teamId, fileId); return PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, me.getUID(), teamId, fileId);
} }
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowDate=sdf.format(new Date());
// 调用App
String sourceAppId = "com.awspaas.user.apps.browsing_data";
// aslp服务地址
String aslp = "aslp://com.awspaas.user.apps.browsing_data/RecordDownloadAlsp";
// 参数定义列表
Map alspparams = new HashMap<String, Object>();
alspparams.put("sid", me.getSessionId());
alspparams.put("uid", me.getUID());
alspparams.put("username", me.getUserName());
alspparams.put("modelId", fileId);
alspparams.put("modelName", model.getName());
alspparams.put("downloadTime", nowDate);
alspparams.put("fileName", model.getName());
alspparams.put("downloadType", "doc");
alspparams.put("recordSource", "PAL画布-导出手册");
alspparams.put("downloadsource", "PAL画布");
AppAPI appAPI = SDK.getAppAPI();
//根据上传的文件进行更新相关的excel或者ppt
ResponseObject alsp_ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, alspparams);
return PALRepositoryQueryAPIManager.getInstance().createOutputReportPr(wsId, me.getUID(), teamId, fileId); return PALRepositoryQueryAPIManager.getInstance().createOutputReportPr(wsId, me.getUID(), teamId, fileId);
} }

View File

@ -496,7 +496,7 @@ public class UpfileWeb extends ActionWeb {
try { try {
long times = System.currentTimeMillis(); long times = System.currentTimeMillis();
final String zipName = "批量下载"+ toolbarname + ".zip"; final String zipName = "批量下载"+ toolbarname.replace(">", "-")+ ".zip";
String targetDir = AWSServerConf.getProperty("dc.path") + File.separator + "com.actionsoft.apps.coe.pal" + File.separator + "tmp/grouppackage/zip" + times + "/"; String targetDir = AWSServerConf.getProperty("dc.path") + File.separator + "com.actionsoft.apps.coe.pal" + File.separator + "tmp/grouppackage/zip" + times + "/";
File targetFileDir = new File(targetDir); File targetFileDir = new File(targetDir);
if (!targetFileDir.exists()) { if (!targetFileDir.exists()) {
@ -637,7 +637,7 @@ public class UpfileWeb extends ActionWeb {
} }
UtilFile.zipCompress(targetDir, new File(targetDir + zipName)); UtilFile.zipCompress(targetDir, new File(targetDir + zipName.replace(">", "-")));
File[] files = targetFileDir.listFiles(new FilenameFilter() File[] files = targetFileDir.listFiles(new FilenameFilter()
{ {

View File

@ -730,8 +730,8 @@
url : "./w?sid=" + encodeURIComponent($('#sid').val()) + "&cmd=com.awspaas.user.apps.browsing_data.service.insertReadingLog", url : "./w?sid=" + encodeURIComponent($('#sid').val()) + "&cmd=com.awspaas.user.apps.browsing_data.service.insertReadingLog",
data : "userId="+userId+"&userName="+userName+"&ruuid="+ruuid+"&fileName="+fileName+"&intervalStartTime="+intervalStartTime+"&currentTime="+currentTime+"&browserId="+browserId+"&isActive="+isActive, data : "userId="+userId+"&userName="+userName+"&ruuid="+ruuid+"&fileName="+fileName+"&intervalStartTime="+intervalStartTime+"&currentTime="+currentTime+"&browserId="+browserId+"&isActive="+isActive,
success : function(msg) { success : function(msg) {
if(msg.result==ok){ if (msg.result == "error") {
$.simpleAlert("删除失败", "error");
} }
} }
}); });
@ -746,7 +746,9 @@
url : "./w?sid=" + encodeURIComponent($('#sid').val()) + "&cmd=com.awspaas.user.apps.browsing_data.service.insertReadingLog", url : "./w?sid=" + encodeURIComponent($('#sid').val()) + "&cmd=com.awspaas.user.apps.browsing_data.service.insertReadingLog",
data : "userId="+userId+"&userName="+userName+"&ruuid="+ruuid+"&fileName="+fileName+"&intervalStartTime="+intervalStartTime+"&currentTime="+currentTime+"&browserId="+browserId+"&isActive="+isActive, data : "userId="+userId+"&userName="+userName+"&ruuid="+ruuid+"&fileName="+fileName+"&intervalStartTime="+intervalStartTime+"&currentTime="+currentTime+"&browserId="+browserId+"&isActive="+isActive,
success : function(msg) { success : function(msg) {
if (msg.result == "error") {
$.simpleAlert("删除失败", "error");
}
} }
}); });

View File

@ -285,6 +285,7 @@ function loadFiles() { //加载附件,params参考引用
$('#selfAccessoryTable').show(); $('#selfAccessoryTable').show();
var editable = parent.editable == "0" ? 0 : 1; //editable等于0页面只读 var editable = parent.editable == "0" ? 0 : 1; //editable等于0页面只读
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
debugger;
var obj = list[i]; var obj = list[i];
var downloadIcon = ""; var downloadIcon = "";
var deleteIcon = ""; var deleteIcon = "";
@ -292,7 +293,7 @@ function loadFiles() { //加载附件,params参考引用
deleteIcon = ' <img src="../apps/com.actionsoft.apps.coe.pal/img/icon/pal_delete.png" onclick="delFile(\'' + obj.uuid + '\', \'' + obj.fileName + '\', loadFiles)" awsui-qtip="删除">'; deleteIcon = ' <img src="../apps/com.actionsoft.apps.coe.pal/img/icon/pal_delete.png" onclick="delFile(\'' + obj.uuid + '\', \'' + obj.fileName + '\', loadFiles)" awsui-qtip="删除">';
} }
if (obj.download == 1 || obj.createUser == $("#userId").val()) { if (obj.download == 1 || obj.createUser == $("#userId").val()) {
downloadIcon = ' <img src="../apps/com.actionsoft.apps.coe.pal/img/icon/pal_download.png" onclick="downloadFile(\'' + obj.url + '\')" awsui-qtip="下载">'; downloadIcon = ' <img src="../apps/com.actionsoft.apps.coe.pal/img/icon/pal_download.png" onclick="downloadFile(\'' + obj.url + '\',\''+obj.type+'\')" awsui-qtip="下载">';
} }
accessoryHtml += '<tr>' accessoryHtml += '<tr>'
+ ' <td><div awsui-qtip="hBordercolor:\'#108ee9\',text:\''+obj.fileName+'\',position:\'bottom\'" class="text_overflow" widthpercent="60" style="max-width: 302px;display: inline-block;">' + obj.fileName ; + ' <td><div awsui-qtip="hBordercolor:\'#108ee9\',text:\''+obj.fileName+'\',position:\'bottom\'" class="text_overflow" widthpercent="60" style="max-width: 302px;display: inline-block;">' + obj.fileName ;
@ -451,9 +452,45 @@ function delFileAll(callback) { //删除全部文件
} }
//下载附件 //下载附件
function downloadFile(url) { function downloadFile(url,type) {
window.location.href = url; window.location.href = url;
var downloadsource;
if(type=='s'){
downloadsource="数据属性";
}else{
downloadsource="文件属性";
} }
var queryString = url.split('?')[1];
var params = new URLSearchParams(queryString);
var fileName = params.get('fileName');
var fileExtension = fileName.substring(fileName.lastIndexOf('.')+1);
var subFileName=fileName.substring(0,fileName.lastIndexOf("."));
var params = {
"modelId": pl_uuid,
"modelName": parent.fileName,
"downloadType": fileExtension,
"fileName":subFileName,
"recordSource": "PAL画布-下载附件",
"fileName":fileName.substring(0,fileName.lastIndexOf(".")),
"downloadsource": downloadsource
}
jQuery.ajax({
type: "POST",
url: "./jd?sid=" + encodeURIComponent(sid) + "&cmd=com.awspaas.user.apps.browsing_data.service.downloadRecord",
data: params,
success: function(msg) {
$.simpleAlert("close");
},
err: function(msg) {
$.simpleAlert("close");
}
});
}
//附件在线预览 //附件在线预览
function readFile(uuid) { function readFile(uuid) {

View File

@ -317,7 +317,6 @@ $(function () {
}); });
//导出手册 //导出手册
$("#export_file").off("click").on("click", function () { $("#export_file").off("click").on("click", function () {
debugger;
menuSelected($(this)); menuSelected($(this));
}); });

View File

@ -4403,7 +4403,6 @@ function outputReport() {
palId: ruuid palId: ruuid
}, },
success: function (r) { success: function (r) {
debugger;
if (r.result == "ok") { if (r.result == "ok") {
if(r.data.state == true){ if(r.data.state == true){
msg+="<br>您好,您的文件已超过"+r.data.maxFileLength+"M导出时间可能大于3min请您耐心等待" msg+="<br>您好,您的文件已超过"+r.data.maxFileLength+"M导出时间可能大于3min请您耐心等待"

View File

@ -1761,11 +1761,49 @@ function downloadProcessFile(taskId) {
success : function(msg) { success : function(msg) {
if (msg.result == "ok") { if (msg.result == "ok") {
window.location.href = msg.data.url; window.location.href = msg.data.url;
var queryString = msg.data.url.split('?')[1];
var params = new URLSearchParams(queryString);
var fileName = params.get('fileName');
var fileExtension = fileName.substring(fileName.lastIndexOf('.')+1);
var subFileName=fileName.substring(0,fileName.lastIndexOf("."));
var params = {
"modelId": ruuid ,
"modelName": fileName,
"downloadType": fileExtension,
"fileName":subFileName,
"recordSource": "文件阅览-导出手册",
"fileName":fileName.substring(0,fileName.lastIndexOf(".")),
"downloadsource": "导出手册"
}
jQuery.ajax({
type: "POST",
url: "./jd?sid=" + encodeURIComponent(sid) + "&cmd=com.awspaas.user.apps.browsing_data.service.downloadRecord",
data: params,
success: function(msg) {
$.simpleAlert("close");
},
err: function(msg) {
$.simpleAlert("close");
}
});
}else{ }else{
$.simpleAlert("请确认是否已生成流程手册", 'info'); $.simpleAlert("请确认是否已生成流程手册", 'info');
} }
} }
}); });
} }
@ -1803,9 +1841,35 @@ function downloadZipFile(splitId,toolbarname) {
success : function(msg) { success : function(msg) {
if (msg.result == "ok") { if (msg.result == "ok") {
window.location.href = msg.data.url; window.location.href = msg.data.url;
//插入下载记录数据
var params = {
"modelId": ruuid,
"modelName":fileName,
"splitId": splitId,
}
jQuery.ajax({
type: "POST",
url: "./jd?sid=" + encodeURIComponent(sid) + "&cmd=com.awspaas.user.apps.browsing_data.service.downloadRecordByFileRead",
data: params,
success: function(msg) {
$.simpleAlert("close");
},
err: function(msg) {
$.simpleAlert("close");
}
});
} }
} }
}); });
} }