修复5127问题
This commit is contained in:
parent
30ae2de3be
commit
eb6d295f46
Binary file not shown.
@ -1173,7 +1173,8 @@ public class CoEPALController {
|
|||||||
UpfileWeb web = new UpfileWeb(me);
|
UpfileWeb web = new UpfileWeb(me);
|
||||||
String splitId = params.get("splitId");
|
String splitId = params.get("splitId");
|
||||||
String toolbarname=params.get("toolbarname");
|
String toolbarname=params.get("toolbarname");
|
||||||
return web.readZipFileDownLoad(splitId,toolbarname);
|
String taskId=params.get("taskIdParams");
|
||||||
|
return web.readZipFileDownLoad(splitId,toolbarname,taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -415,7 +415,7 @@ public class UpfileWeb extends ActionWeb {
|
|||||||
* @return
|
* @return
|
||||||
* @author zhaolei
|
* @author zhaolei
|
||||||
*/
|
*/
|
||||||
public String readZipFileDownLoad(String splitId,String toolbarname) throws Exception {
|
public String readZipFileDownLoad(String splitId,String toolbarname,String taskId) 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();
|
||||||
@ -459,6 +459,72 @@ public class UpfileWeb extends ActionWeb {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (UtilString.isNotEmpty(taskId)) {
|
||||||
|
|
||||||
|
OutputTaskModel model = new OutputTask().getTaskReportById(taskId);
|
||||||
|
if (model != null) {
|
||||||
|
try {
|
||||||
|
UtilFile file = OutputAPIManager.getInstance().getFilePath(model.getWsId(), taskId, model.getProfileId());
|
||||||
|
if (file.exists()) {
|
||||||
|
File[] fileList = file.listFiles();
|
||||||
|
if (fileList.length > 0) {
|
||||||
|
File docFile = null;
|
||||||
|
for (File file2 : fileList) {
|
||||||
|
if (file2.isFile() && "doc".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1)))) {
|
||||||
|
docFile = file2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (docFile == null) {
|
||||||
|
return ResponseObject.newErrResponse("没有找到文件").toString();
|
||||||
|
}
|
||||||
|
String sourceAppId = "com.awspaas.user.apps.coe.pal.output.bd";
|
||||||
|
String filename = docFile.getName();
|
||||||
|
DCContext sourceDc = new DCContext(_uc, DCProfileManager.getDCProfile(sourceAppId, "output"), sourceAppId, model.getWsId(), taskId, filename);
|
||||||
|
|
||||||
|
File targetFile = new File(targetDir + filename);
|
||||||
|
if (!targetFile.exists()) {
|
||||||
|
targetFile.createNewFile();
|
||||||
|
}
|
||||||
|
OutputStream out = new FileOutputStream(targetFile);
|
||||||
|
InputStream in = DCUtil.decryptFile(sourceDc);
|
||||||
|
if (in == null) {
|
||||||
|
String msg = "+ dcContext.getFileName() + ";
|
||||||
|
if (sourceDc.getDCMessage() != null) {
|
||||||
|
msg = sourceDc.getDCMessage().getMessage();
|
||||||
|
}
|
||||||
|
return ResponseObject.newErrResponse(msg).toString();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
IOUtils.copy(in, out);
|
||||||
|
in.close();
|
||||||
|
out.close();
|
||||||
|
} finally {
|
||||||
|
IOUtils.closeQuietly(in);
|
||||||
|
IOUtils.closeQuietly(out);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return ResponseObject.newErrResponse().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UtilFile.zipCompress(targetDir, new File(targetDir + zipName));
|
UtilFile.zipCompress(targetDir, new File(targetDir + zipName));
|
||||||
|
|
||||||
File[] files = targetFileDir.listFiles(new FilenameFilter()
|
File[] files = targetFileDir.listFiles(new FilenameFilter()
|
||||||
|
|||||||
@ -1579,11 +1579,34 @@ function changeArributeByShape() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ProcessManual(obj) {
|
function ProcessManual(obj) {
|
||||||
|
|
||||||
|
var manualName;
|
||||||
|
if(methodId=="data.form"){
|
||||||
|
manualName="表单手册 :";
|
||||||
|
}else if (methodId=="process.epc"){
|
||||||
|
manualName="EPC手册 :";
|
||||||
|
}else if (methodId=="process.bpmn2"){
|
||||||
|
manualName="BPMN手册 :";
|
||||||
|
}else if (methodId=="process.flowchart"){
|
||||||
|
manualName="泳道手册 :";
|
||||||
|
}else if (methodId=="process.evc"){
|
||||||
|
manualName="架构手册 :";
|
||||||
|
}else if (methodId=="org.normal"){
|
||||||
|
manualName="组织手册 :";
|
||||||
|
}else if (methodId=="itsystem.normal"){
|
||||||
|
manualName="IT系统手册 :";
|
||||||
|
}else if (methodId=="control.policy"){
|
||||||
|
manualName="制度手册 :";
|
||||||
|
}else if (methodId=="control.risk"){
|
||||||
|
manualName="风险控制手册 :";
|
||||||
|
}else if(methodId=="control.kpi"){
|
||||||
|
manualName="流程绩效手册 :";
|
||||||
|
}
|
||||||
$('#processFileDock').empty();
|
$('#processFileDock').empty();
|
||||||
var t = '';
|
var t = '';
|
||||||
t += '<table class="awsui-table">';
|
t += '<table class="awsui-table">';
|
||||||
t += '<tr><td>';
|
t += '<tr><td>';
|
||||||
t += '<div class="filetableHeader"><i class="awsui-iconfont" style="color: #999999;margin-top: 2px;"></i> 流程手册:</div>';
|
t += '<div class="filetableHeader"><i class="awsui-iconfont" style="color: #999999;margin-top: 2px;"></i>'+manualName+'</div>';
|
||||||
t += '<div class="tablefileContent"><a href="javascript:void(0);" onclick="openOutputFile(\''+ taskId +'\')">'+ fileName +'</a>';
|
t += '<div class="tablefileContent"><a href="javascript:void(0);" onclick="openOutputFile(\''+ taskId +'\')">'+ fileName +'</a>';
|
||||||
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="downloadProcessFile(\''+taskId+'\')"></i>';
|
t += '<i class="awsui-iconfont" onclick="downloadProcessFile(\''+taskId+'\')"></i>';
|
||||||
@ -1658,7 +1681,8 @@ function downloadZipFile(splitId,toolbarname) {
|
|||||||
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_downloadZipfile",
|
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_downloadZipfile",
|
||||||
data : {
|
data : {
|
||||||
splitId : splitId,
|
splitId : splitId,
|
||||||
toolbarname:toolbarname
|
toolbarname:toolbarname,
|
||||||
|
taskIdParams:taskId
|
||||||
},
|
},
|
||||||
success : function(msg) {
|
success : function(msg) {
|
||||||
if (msg.result == "ok") {
|
if (msg.result == "ok") {
|
||||||
@ -1722,11 +1746,10 @@ function initUpfileData(obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
t += '</table>';
|
t += '</table>';
|
||||||
|
|
||||||
var toolbarname=$("#toolbarname").text();
|
var toolbarname=$("#toolbarname").text();
|
||||||
if(splitId.length>0){
|
if(splitId.length>0){
|
||||||
splitId=splitId.substring(0,splitId.length-1);
|
splitId=splitId.substring(0,splitId.length-1);
|
||||||
t +='<button id="ProcessManual" type="button" onclick="downloadZipFile(\''+splitId+'\',\''+toolbarname+'\')" class="awsui-btn awsui-btn-blue">';
|
t +='<button id="ProcessManual" type="button" onclick="downloadZipFile(\''+splitId+'\',\''+toolbarname+'\',\''+taskId+'\')" class="awsui-btn awsui-btn-blue">';
|
||||||
t +='打包下载';
|
t +='打包下载';
|
||||||
t +='</button>';
|
t +='</button>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user