修改模型阅览下载时再调用报告生成器打包
This commit is contained in:
parent
e1f21815f3
commit
cf739d35a0
@ -0,0 +1,42 @@
|
|||||||
|
package com.awspaas.user.apps.integration.controller;
|
||||||
|
|
||||||
|
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.bpms.server.UserContext;
|
||||||
|
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||||
|
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||||
|
import com.actionsoft.bpms.util.UUIDGener;
|
||||||
|
import com.awspaas.user.apps.integration.event.OutputDCFileProcessor;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 文件阅览界面下载时创建手册
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
public class CreateFileContorller {
|
||||||
|
@Mapping("com.awspaas.user.apps.integrates.createFileController")
|
||||||
|
public String createFile(String sid,String taskId,String fileName) throws Exception {
|
||||||
|
String reportDownloadURL = "";
|
||||||
|
UserContext me = UserContext.fromSessionId(sid);
|
||||||
|
OutputTaskModel model = new OutputTask().getTaskReportById(taskId);
|
||||||
|
|
||||||
|
if (model != null) {
|
||||||
|
//三员管理,步骤横表下载重新生成手册
|
||||||
|
String taskName = model.getTaskName();
|
||||||
|
if ("步骤横表".equals(taskName)){
|
||||||
|
// 重新设置生成id,与用户id
|
||||||
|
String uuid = UUIDGener.getUUID();
|
||||||
|
model.setUserId(me.getUID());
|
||||||
|
|
||||||
|
// 重新生成手册文件
|
||||||
|
OutputAPIManager.getInstance().reGennerReport(me,model,uuid);
|
||||||
|
|
||||||
|
// 重新构建手册下载URL
|
||||||
|
taskId = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
reportDownloadURL = OutputDCFileProcessor.getReportDownloadURL(model.getWsId(), taskId, model.getProfileId(), me, fileName + model.getTaskName());
|
||||||
|
}
|
||||||
|
return reportDownloadURL;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -222,32 +222,30 @@ public class TaskController {
|
|||||||
jsonObject.put("link",SDK.getPortalAPI().getPortalUrl()+ "/r/w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + Row_maps_is_not_publish.get(0).getString("id") + "&sid=" + sid);
|
jsonObject.put("link",SDK.getPortalAPI().getPortalUrl()+ "/r/w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + Row_maps_is_not_publish.get(0).getString("id") + "&sid=" + sid);
|
||||||
jsonObject.put("size","");
|
jsonObject.put("size","");
|
||||||
jsonObject.put("id",num);
|
jsonObject.put("id",num);
|
||||||
|
jsonObject.put("taskId",id);
|
||||||
OutputTaskModel model = new OutputTask().getTaskReportById(id);
|
// OutputTaskModel model = new OutputTask().getTaskReportById(id);
|
||||||
JSONObject json = new JSONObject();
|
//JSONObject json = new JSONObject();
|
||||||
if (model != null) {
|
/*
|
||||||
//三员管理,步骤横表下载重新生成手册
|
* if (model != null) { //三员管理,步骤横表下载重新生成手册
|
||||||
|
*
|
||||||
String taskName = model.getTaskName();
|
* String taskName = model.getTaskName();
|
||||||
if ("步骤横表".equals(taskName)){
|
*
|
||||||
// 重新设置生成id,与用户id
|
* String str = "";
|
||||||
String uuid = UUIDGener.getUUID();
|
*
|
||||||
model.setUserId(me.getUID());
|
* if ("步骤横表".equals(taskName)){ // 重新设置生成id,与用户id String uuid =
|
||||||
|
* UUIDGener.getUUID(); model.setUserId(me.getUID());
|
||||||
// 重新生成手册文件
|
*
|
||||||
OutputAPIManager.getInstance().reGennerReport(me,model,uuid);
|
* // 重新生成手册文件 OutputAPIManager.getInstance().reGennerReport(me,model,uuid);
|
||||||
|
*
|
||||||
// 重新构建手册下载URL
|
* // 重新构建手册下载URL id = uuid; }
|
||||||
id = uuid;
|
*
|
||||||
}
|
* try { //jsonObject.put("url",
|
||||||
|
* OutputDCFileProcessor.getReportDownloadURL(model.getWsId(), id,
|
||||||
try {
|
* model.getProfileId(), me, bo.get("PUBLISHFILENAME")+model.getTaskName()));
|
||||||
jsonObject.put("url", OutputDCFileProcessor.getReportDownloadURL(model.getWsId(), id, model.getProfileId(), me, bo.get("PUBLISHFILENAME")+model.getTaskName()));
|
* jsonObject.put("taskId",id); } catch (Exception e) {
|
||||||
} catch (Exception e) {
|
*
|
||||||
|
* e.printStackTrace(); } }
|
||||||
e.printStackTrace();
|
*/
|
||||||
}
|
|
||||||
}
|
|
||||||
jsonArray.add(jsonObject);
|
jsonArray.add(jsonObject);
|
||||||
num++;
|
num++;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user