diff --git a/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml b/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml
index ce7aeebc..5a065379 100644
--- a/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml
+++ b/com.actionsoft.apps.coe.method.process.epc/method/process.epc/diagram.attribute.custom.xml
@@ -30,8 +30,8 @@
-
+
-
+
diff --git a/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar b/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar
index 45bd0967..10097938 100644
Binary files a/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar and b/com.actionsoft.apps.coe.pal.output.pr/lib/com.actionsoft.apps.coe.pal.output.pr.jar differ
diff --git a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java
index 50af0e0b..59000a11 100644
--- a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java
+++ b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java
@@ -185,7 +185,7 @@ public class Report1Gener {
// 记录关联属性的流程节点,防止多次查询重复文件信息耗费时间
Set relationFileIds = new HashSet<>();
Map> relationFileMap = new HashMap<>();
-
+
PrReportComment prReportComment = new PrReportComment();
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId);
if (repositoryModel == null) {
diff --git a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java
index 99de029e..42aadd4a 100644
--- a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java
+++ b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/util/PrReportComment.java
@@ -66,6 +66,8 @@ public class PrReportComment {
createUser = OutputWordUtil.specialCharTransfer(UserCache.getModel(createUser).getUserName());
}
dataMap.put(OutputWordUtil.PL_CREATE_USER, createUser); // 编制人
+ System.out.println("============版本"+repositoryModel.getVersion());
+
dataMap.put(OutputWordUtil.PL_VERSION, repositoryModel.getVersion()); // 版本
String date = "";
diff --git a/com.actionsoft.apps.coe.pal.output.pr/~$横表-流程手册2.doc b/com.actionsoft.apps.coe.pal.output.pr/~$横表-流程手册2.doc
new file mode 100644
index 00000000..6e18ba5f
Binary files /dev/null and b/com.actionsoft.apps.coe.pal.output.pr/~$横表-流程手册2.doc differ
diff --git a/com.actionsoft.apps.coe.pal.output.pr/~WRL0001.tmp b/com.actionsoft.apps.coe.pal.output.pr/~WRL0001.tmp
new file mode 100644
index 00000000..5c7dd00a
Binary files /dev/null and b/com.actionsoft.apps.coe.pal.output.pr/~WRL0001.tmp differ
diff --git a/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.doc b/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.doc
index 5c7dd00a..7e086a16 100644
Binary files a/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.doc and b/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.doc differ
diff --git a/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.xml b/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.xml
index 41484c68..84db3b23 100644
--- a/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.xml
+++ b/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册2.xml
@@ -5901,7 +5901,7 @@ y7fdOgAAAABJRU5ErkJggk==
- ${pl_Purpose}
+ ${pl_goal}
@@ -6664,7 +6664,7 @@ y7fdOgAAAABJRU5ErkJggk==
- ${table2.shape_activity_name}
+ ${table2.shape_activity_number}
diff --git a/com.actionsoft.apps.coe.pal/manifest.xml b/com.actionsoft.apps.coe.pal/manifest.xml
index d3da2645..71261d43 100755
--- a/com.actionsoft.apps.coe.pal/manifest.xml
+++ b/com.actionsoft.apps.coe.pal/manifest.xml
@@ -2,7 +2,7 @@
CoE PAL流程资产库
- 6.5
+ 6.5
5
北京炎黄盈动科技发展有限责任公司
diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutputAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutputAPIManager.java
index 009079d4..a71033a3 100755
--- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutputAPIManager.java
+++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutputAPIManager.java
@@ -1,5 +1,6 @@
package com.actionsoft.apps.coe.pal.pal.output;
-import java.io.FileInputStream;
+
+import java.io.FileInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -35,227 +36,226 @@ import com.alibaba.fastjson.JSONObject;
/**
* 报告生成器内部API封装
- *
+ *
* @author jack
- *
*/
public class OutputAPIManager {
- private static OutputAPIManager instance = new OutputAPIManager();
+ private static OutputAPIManager instance = new OutputAPIManager();
- private OutputAPIManager() {
- }
+ private OutputAPIManager() {
+ }
- public static OutputAPIManager getInstance() {
- return instance;
- }
+ public static OutputAPIManager getInstance() {
+ return instance;
+ }
- // -------------------任务保存/提取----------------------
+ // -------------------任务保存/提取----------------------
- /**
- * 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
- *
- * @param wsId 资产库id
- * @param id 任务Id
- * @param profileId 报告生成器扩展App的配置Id
- * @param jsonData 拼装的json数据串
- */
- public void saveWizardJsonData(String wsId, String id, String profileId, String jsonData) throws AWSException {
- // --------app appProfile----------
- OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
- if (appProfile == null)
- throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
- // --------dc context-----------
- DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
- if (dcProfile == null)
- throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
- DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
- InputStream in = null;
- try {
- in = new ByteArrayInputStream(jsonData.getBytes("UTF-8"));
- boolean isSave = SDK.getDCAPI().write(in, dcContext);
- if (!isSave) {
- throw new AWSException("Save Parameter Error!");
- }
- } catch (Exception e) {
- throw new AWSException(e);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception e) {
- }
- }
- }
+ /**
+ * 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
+ *
+ * @param wsId 资产库id
+ * @param id 任务Id
+ * @param profileId 报告生成器扩展App的配置Id
+ * @param jsonData 拼装的json数据串
+ */
+ public void saveWizardJsonData(String wsId, String id, String profileId, String jsonData) throws AWSException {
+ // --------app appProfile----------
+ OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
+ if (appProfile == null)
+ throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
+ // --------dc context-----------
+ DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
+ if (dcProfile == null)
+ throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
+ DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
+ InputStream in = null;
+ try {
+ in = new ByteArrayInputStream(jsonData.getBytes("UTF-8"));
+ boolean isSave = SDK.getDCAPI().write(in, dcContext);
+ if (!isSave) {
+ throw new AWSException("Save Parameter Error!");
+ }
+ } catch (Exception e) {
+ throw new AWSException(e);
+ } finally {
+ try {
+ if (in != null)
+ in.close();
+ } catch (Exception e) {
+ }
+ }
+ }
- /**
- * 删除文件
- *
- * @param wsId 资产库id
- * @param id 任务Id
- * @param profileId 报告生成器扩展App的配置Id
- * @throws AWSException
- */
- public void delFile(String wsId, String id, String profileId) throws AWSException {
- UtilFile file = getFilePath(wsId, id, profileId);
- if (file.isDirectory()) {
- File[] files = file.listFiles();
- for (File f : files) {
- if (f.exists()) {
- boolean flag = f.getAbsoluteFile().delete();
- }
- }
- file.delete();
- }
- }
+ /**
+ * 删除文件
+ *
+ * @param wsId 资产库id
+ * @param id 任务Id
+ * @param profileId 报告生成器扩展App的配置Id
+ * @throws AWSException
+ */
+ public void delFile(String wsId, String id, String profileId) throws AWSException {
+ UtilFile file = getFilePath(wsId, id, profileId);
+ if (file.isDirectory()) {
+ File[] files = file.listFiles();
+ for (File f : files) {
+ if (f.exists()) {
+ boolean flag = f.getAbsoluteFile().delete();
+ }
+ }
+ file.delete();
+ }
+ }
- /**
- * 删除资产库时同时删除文件
- *
- * @param wsid 资产库id
- * @throws AWSException
- */
- public void delTaskByWsid(String wsid) throws AWSException {
- List list = new OutputTask().getTasksByWsid(wsid);
- if (new OutputTask().delTaskByWsid(wsid)) {
- String profileId = null;
- for (OutputTaskModel model : list) {
- profileId = model.getProfileId();
- delFile(wsid, model.getId(), model.getProfileId());
- }
- if (profileId != null) {
- delFile(wsid, "", profileId);
- }
- }
- }
+ /**
+ * 删除资产库时同时删除文件
+ *
+ * @throws AWSException
+ * @param wsid 资产库id
+ */
+ public void delTaskByWsid(String wsid) throws AWSException {
+ List list = new OutputTask().getTasksByWsid(wsid);
+ if (new OutputTask().delTaskByWsid(wsid)) {
+ String profileId = null;
+ for (OutputTaskModel model : list) {
+ profileId = model.getProfileId();
+ delFile(wsid, model.getId(), model.getProfileId());
+ }
+ if (profileId != null) {
+ delFile(wsid, "", profileId);
+ }
+ }
+ }
- /**
- * 得到文件
- *
- * @param wsId 资产库id
- * @param id 任务Id
- * @param profileId 报告生成器扩展App的配置Id
- * @throws AWSException
- */
- public UtilFile getFilePath(String wsId, String id, String profileId) throws AWSException {
- OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
- if (appProfile == null)
- throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
- DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
- if (dcProfile == null)
- throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
- DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id);
- UtilFile file = new UtilFile(dcContext.getPath());
- return file;
- }
+ /**
+ * 得到文件
+ *
+ * @param wsId 资产库id
+ * @param id 任务Id
+ * @param profileId 报告生成器扩展App的配置Id
+ * @throws AWSException
+ */
+ public UtilFile getFilePath(String wsId, String id, String profileId) throws AWSException {
+ OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
+ if (appProfile == null)
+ throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
+ DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
+ if (dcProfile == null)
+ throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
+ DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id);
+ UtilFile file = new UtilFile(dcContext.getPath());
+ return file;
+ }
- /**
- * 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
- *
- * @param wsId 资产库id
- * @param id 任务Id
- * @param profileId 报告生成器扩展App的配置Id
- */
- public String getWizardJsonData(String wsId, String id, String profileId) throws AWSException {
- // --------app appProfile----------
- OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
- if (appProfile == null)
- throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
- // --------dc context-----------
- DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
- if (dcProfile == null)
- throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
- DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
- File configFile = new File(dcContext.getFilePath());
- // 如果该配置还不存在,没有保存过
- if (!configFile.exists()) {
- return "";
- }
- InputStream in = null;
- try {
- //in = SDK.getDCAPI().read(dcContext);
- in = new FileInputStream(configFile);
- int b = -1;
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- while((b=in.read())!=-1){
- baos.write(b);
- }
- return baos.toString("UTF-8");
- } catch (Exception e) {
- throw new AWSException(e);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception e) {
- }
- }
- }
+ /**
+ * 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
+ *
+ * @param wsId 资产库id
+ * @param id 任务Id
+ * @param profileId 报告生成器扩展App的配置Id
+ */
+ public String getWizardJsonData(String wsId, String id, String profileId) throws AWSException {
+ // --------app appProfile----------
+ OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
+ if (appProfile == null)
+ throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
+ // --------dc context-----------
+ DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
+ if (dcProfile == null)
+ throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
+ DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
+ File configFile = new File(dcContext.getFilePath());
+ // 如果该配置还不存在,没有保存过
+ if (!configFile.exists()) {
+ return "";
+ }
+ InputStream in = null;
+ try {
+ //in = SDK.getDCAPI().read(dcContext);
+ in = new FileInputStream(configFile);
+ int b = -1;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ while ((b = in.read()) != -1) {
+ baos.write(b);
+ }
+ return baos.toString("UTF-8");
+ } catch (Exception e) {
+ throw new AWSException(e);
+ } finally {
+ try {
+ if (in != null)
+ in.close();
+ } catch (Exception e) {
+ }
+ }
+ }
- // -------------------任务执行/操作----------------------
+ // -------------------任务执行/操作----------------------
- /**
- * 克隆一个任务
- *
- * @param userId 操作人账户
- * @param id 源任务id,必须是已执行完毕的
- * @throws AWSException
- */
- public void cloneTask(String userId, String id) throws Exception {
- OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
- if (outputTaskModel == null)
- throw new AWSException("Not Find outputTask! id=" + id);
- if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_SUCESS && outputTaskModel.getTaskState() != OutputConst.TASK_STATE_ERROR)
- throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Clone!");
- OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
- if (appProfile == null)
- throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
- // --------dc context-----------
- DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
- if (dcProfile == null)
- throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
- DCContext sourceDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id, OutputConst.FILE_WIZARD_CONFIG);
- //判断源文件是否存在
- UtilFile sourceFile = new UtilFile(sourceDcContext.getFilePath());
- if (!sourceFile.exists()) {
- throw new Exception("sourceFile not found");
- }
- outputTaskModel.setId(UUIDGener.getUUID());
- outputTaskModel.setUserId(userId);
- new OutputTask().insert(outputTaskModel);
- // copy config.txt
- DCContext targetDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), outputTaskModel.getId(), OutputConst.FILE_WIZARD_CONFIG);
- SDK.getDCAPI().copyDCFile(sourceDcContext, targetDcContext);
- }
+ /**
+ * 克隆一个任务
+ *
+ * @param userId 操作人账户
+ * @param id 源任务id,必须是已执行完毕的
+ * @throws AWSException
+ */
+ public void cloneTask(String userId, String id) throws Exception {
+ OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
+ if (outputTaskModel == null)
+ throw new AWSException("Not Find outputTask! id=" + id);
+ if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_SUCESS && outputTaskModel.getTaskState() != OutputConst.TASK_STATE_ERROR)
+ throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Clone!");
+ OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
+ if (appProfile == null)
+ throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
+ // --------dc context-----------
+ DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
+ if (dcProfile == null)
+ throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
+ DCContext sourceDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id, OutputConst.FILE_WIZARD_CONFIG);
+ //判断源文件是否存在
+ UtilFile sourceFile = new UtilFile(sourceDcContext.getFilePath());
+ if (!sourceFile.exists()) {
+ throw new Exception("sourceFile not found");
+ }
+ outputTaskModel.setId(UUIDGener.getUUID());
+ outputTaskModel.setUserId(userId);
+ new OutputTask().insert(outputTaskModel);
+ // copy config.txt
+ DCContext targetDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), outputTaskModel.getId(), OutputConst.FILE_WIZARD_CONFIG);
+ SDK.getDCAPI().copyDCFile(sourceDcContext, targetDcContext);
+ }
- /**
- * 创建线程,执行报告生成任务
- *
- * @param id
- */
- public void startTask(String id, UserContext uc) throws AWSException {
- OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
- if (outputTaskModel == null)
- throw new AWSException("Not Find outputTask! id=" + id);
+ /**
+ * 创建线程,执行报告生成任务
+ *
+ * @param id
+ */
+ public void startTask(String id, UserContext uc) throws AWSException {
+ OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
+ if (outputTaskModel == null)
+ throw new AWSException("Not Find outputTask! id=" + id);
- if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
- throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
+ if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
+ throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
- // --------app appProfile----------
- OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
- if (appProfile == null)
- throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
- String gennerClass = appProfile.getGenerClass();
- if (UtilString.isEmpty(gennerClass))
- throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
+ // --------app appProfile----------
+ OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
+ if (appProfile == null)
+ throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
+ String gennerClass = appProfile.getGenerClass();
+ if (UtilString.isEmpty(gennerClass))
+ throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
- // --------dc context-----------
- DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
- if (dcProfile == null)
- throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
- DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
+ // --------dc context-----------
+ DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
+ if (dcProfile == null)
+ throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
+ DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
- // ---------config---------------
- String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
+ // ---------config---------------
+ String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
/*JSONObject object = JSONObject.parseObject(wizardJsonData);
String fileIds = object.getString("targetFileId");
@@ -274,251 +274,252 @@ public class OutputAPIManager {
signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName() + "-" + arr[i]);
signalThread.start();
}*/
-
- // start thread
- GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
-
- Thread signalThread = new Thread(gener);
- signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
- signalThread.start();
- // 操作行为日志记录
- if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
- CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_CREATE, CoEOpLogConst.INFO_OUTPUT_CREATE);
- }
- }
-
- /**
- * 创建线程,执行报告生成任务
- *
- * @param id
- */
- public ResponseObject startTaskAndReturnResult(String id, UserContext uc) throws AWSException {
- OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
- if (outputTaskModel == null)
- throw new AWSException("Not Find outputTask! id=" + id);
- if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
- throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
+ // start thread
+ GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
- // --------app appProfile----------
- OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
- if (appProfile == null)
- throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
- String gennerClass = appProfile.getGenerClass();
- if (UtilString.isEmpty(gennerClass))
- throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
+ Thread signalThread = new Thread(gener);
+ signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
+ signalThread.start();
+ // 操作行为日志记录
+ if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
+ CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_CREATE, CoEOpLogConst.INFO_OUTPUT_CREATE);
+ }
+ }
- // --------dc context-----------
- DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
- if (dcProfile == null)
- throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
- DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
+ /**
+ * 创建线程,执行报告生成任务
+ *
+ * @param id
+ */
+ public ResponseObject startTaskAndReturnResult(String id, UserContext uc) throws AWSException {
+ OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
+ if (outputTaskModel == null)
+ throw new AWSException("Not Find outputTask! id=" + id);
- // ---------config---------------
- String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
-
- CallableGennerReport gener = new CallableGennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
- FutureTask task = new FutureTask<>(gener);
- Thread signalThread = new Thread(task);
- signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
- signalThread.start();
- try {
- return task.get();
- } catch (InterruptedException | ExecutionException e) {
- e.printStackTrace();
- return ResponseObject.newErrResponse();
- }
- }
+ if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
+ throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
- /**
- * 三员管理模式下,重新生成步骤横表手册
- * @param outputTaskModel
- */
- public void reGennerReport(UserContext uc,OutputTaskModel outputTaskModel,String id){
+ // --------app appProfile----------
+ OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
+ if (appProfile == null)
+ throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
+ String gennerClass = appProfile.getGenerClass();
+ if (UtilString.isEmpty(gennerClass))
+ throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
- if (outputTaskModel == null)
- throw new AWSException("Not Find outputTask! ");
+ // --------dc context-----------
+ DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
+ if (dcProfile == null)
+ throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
+ DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
- // --------app appProfile----------
- OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
- if (appProfile == null)
- throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
- String gennerClass = appProfile.getGenerClass();
- if (UtilString.isEmpty(gennerClass))
- throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
+ // ---------config---------------
+ String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
- // --------dc context-----------
- DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
- if (dcProfile == null)
- throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
- DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
+ CallableGennerReport gener = new CallableGennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
+ FutureTask task = new FutureTask<>(gener);
+ Thread signalThread = new Thread(task);
+ signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
+ signalThread.start();
+ try {
+ return task.get();
+ } catch (InterruptedException | ExecutionException e) {
+ e.printStackTrace();
+ return ResponseObject.newErrResponse();
+ }
+ }
- // ---------config---------------
- //获取原有config.txt的json
- String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), outputTaskModel.getId(), appProfile.getId());
+ /**
+ * 三员管理模式下,重新生成步骤横表手册
+ *
+ * @param outputTaskModel
+ */
+ public void reGennerReport(UserContext uc, OutputTaskModel outputTaskModel, String id) {
- // 根据原有config保存新的配置
- this.saveWizardJsonData(outputTaskModel.getWsId(), id, outputTaskModel.getProfileId(), wizardJsonData);
+ if (outputTaskModel == null)
+ throw new AWSException("Not Find outputTask! ");
- //同步执行
- GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
- gener.run();
- }
+ // --------app appProfile----------
+ OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
+ if (appProfile == null)
+ throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
+ String gennerClass = appProfile.getGenerClass();
+ if (UtilString.isEmpty(gennerClass))
+ throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
- class CallableGennerReport implements Callable {
+ // --------dc context-----------
+ DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
+ if (dcProfile == null)
+ throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
+ DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
- private OutputTaskModel task;
- private OutputAppProfile appProfile;
- private DCContext dcContext;
- private String wizardJsonData;
+ // ---------config---------------
+ //获取原有config.txt的json
+ String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), outputTaskModel.getId(), appProfile.getId());
- public CallableGennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
- this.appProfile = appProfile;
- this.task = task;
- this.dcContext = dcContext;
- this.wizardJsonData = wizardJsonData;
- }
-
- @Override
- public ResponseObject call() throws Exception {
- Constructor> cons = null;
- try {
- cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
- } catch (Exception e) {
- e.printStackTrace();
- SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
- return ResponseObject.newErrResponse();
- }
- // 获得该接口实现类实例
- try {
- Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
- Object obj = cons.newInstance();
- Method execute = generClass.getMethod("execute", new Class[] { OutputTaskModel.class, String.class, DCContext.class });
- // 标记执行
- new OutputTask().updateRunning(task.getId());
- // 正式执行
- ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[] { task, wizardJsonData, dcContext });
- // 处理日志
- List logs = (List) ro.get("logs");
- if (logs != null && !logs.isEmpty()) {
- StringBuilder sb = new StringBuilder();
- for (String msg : logs) {
- sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
- }
- // 保存日志文件
- InputStream in = null;
- try {
- in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
- dcContext.setFileName(OutputConst.FILE_TASK_LOG);
- SDK.getDCAPI().write(in, dcContext);
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception e) {
- }
- }
- }
- // 标记结束
- if (ro.isOk()) {
- new OutputTask().updateSucess(task.getId());
- return ResponseObject.newOkResponse();
- } else {
- new OutputTask().updateError(task.getId());
- return ResponseObject.newErrResponse();
- }
- } catch (Exception e) {
- e.printStackTrace();
- SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
- return ResponseObject.newErrResponse();
- }
- }
-
- }
-
- /**
- * 得到限定范围的流程id
- *
- * @param wsId 资产库id
- * @param id 任务Id
- * @param profileId 报告生成器扩展App的配置Id
- * @return
- * @throws AWSException
- */
- /* public String getargetFileIds(String wsId, String id, String profileId)
- * throws AWSException { UtilFile file = new UtilFile(getFilePath(wsId, id,
- * profileId) + "/" + OutputConst.FILE_WIZARD_CONFIG); if (file.exists()) {
- * String config = file.readStr(); return
- * JSONObject.fromObject(config).getString("targetFileId"); } return ""; } */
+ // 根据原有config保存新的配置
+ this.saveWizardJsonData(outputTaskModel.getWsId(), id, outputTaskModel.getProfileId(), wizardJsonData);
+
+ //同步执行
+ GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
+ gener.run();
+ }
+
+ class CallableGennerReport implements Callable {
+
+ private OutputTaskModel task;
+ private OutputAppProfile appProfile;
+ private DCContext dcContext;
+ private String wizardJsonData;
+
+ public CallableGennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
+ this.appProfile = appProfile;
+ this.task = task;
+ this.dcContext = dcContext;
+ this.wizardJsonData = wizardJsonData;
+ }
+
+ @Override
+ public ResponseObject call() throws Exception {
+ Constructor> cons = null;
+ try {
+ cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
+ } catch (Exception e) {
+ e.printStackTrace();
+ SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
+ return ResponseObject.newErrResponse();
+ }
+ // 获得该接口实现类实例
+ try {
+ Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
+ Object obj = cons.newInstance();
+ Method execute = generClass.getMethod("execute", new Class[]{OutputTaskModel.class, String.class, DCContext.class});
+ // 标记执行
+ new OutputTask().updateRunning(task.getId());
+ // 正式执行
+ ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[]{task, wizardJsonData, dcContext});
+ // 处理日志
+ List logs = (List) ro.get("logs");
+ if (logs != null && !logs.isEmpty()) {
+ StringBuilder sb = new StringBuilder();
+ for (String msg : logs) {
+ sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
+ }
+ // 保存日志文件
+ InputStream in = null;
+ try {
+ in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
+ dcContext.setFileName(OutputConst.FILE_TASK_LOG);
+ SDK.getDCAPI().write(in, dcContext);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ if (in != null)
+ in.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+ // 标记结束
+ if (ro.isOk()) {
+ new OutputTask().updateSucess(task.getId());
+ return ResponseObject.newOkResponse();
+ } else {
+ new OutputTask().updateError(task.getId());
+ return ResponseObject.newErrResponse();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
+ return ResponseObject.newErrResponse();
+ }
+ }
+
+ }
+
+ /**
+ * 得到限定范围的流程id
+ *
+ * @param wsId 资产库id
+ * @param id 任务Id
+ * @param profileId 报告生成器扩展App的配置Id
+ * @return
+ * @throws AWSException
+ */
+ /* public String getargetFileIds(String wsId, String id, String profileId)
+ * throws AWSException { UtilFile file = new UtilFile(getFilePath(wsId, id,
+ * profileId) + "/" + OutputConst.FILE_WIZARD_CONFIG); if (file.exists()) {
+ * String config = file.readStr(); return
+ * JSONObject.fromObject(config).getString("targetFileId"); } return ""; } */
}
class GennerReport implements Runnable {
- private OutputTaskModel task;
- private OutputAppProfile appProfile;
- private DCContext dcContext;
- private String wizardJsonData;
+ private OutputTaskModel task;
+ private OutputAppProfile appProfile;
+ private DCContext dcContext;
+ private String wizardJsonData;
- public GennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
- this.appProfile = appProfile;
- this.task = task;
- this.dcContext = dcContext;
- this.wizardJsonData = wizardJsonData;
- }
+ public GennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
+ this.appProfile = appProfile;
+ this.task = task;
+ this.dcContext = dcContext;
+ this.wizardJsonData = wizardJsonData;
+ }
- public void run() {
- Constructor> cons = null;
- try {
- cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
- } catch (Exception e) {
- e.printStackTrace();
- SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
- }
- if (cons != null) {
- // 获得该接口实现类实例
- try {
- Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
- Object obj = cons.newInstance();
- Method execute = generClass.getMethod("execute", new Class[] { OutputTaskModel.class, String.class, DCContext.class });
- // 标记执行
- new OutputTask().updateRunning(task.getId());
- // 正式执行
- ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[] { task, wizardJsonData, dcContext });
- // 处理日志
- List logs = (List) ro.get("logs");
- if (logs != null && !logs.isEmpty()) {
- StringBuilder sb = new StringBuilder();
- for (String msg : logs) {
- sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
- }
- // 保存日志文件
- InputStream in = null;
- try {
- in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
- dcContext.setFileName(OutputConst.FILE_TASK_LOG);
- SDK.getDCAPI().write(in, dcContext);
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception e) {
- }
- }
- }
- // 标记结束
- if (ro.isOk()) {
- new OutputTask().updateSucess(task.getId());
- } else {
- new OutputTask().updateError(task.getId());
- }
- } catch (Exception e) {
- e.printStackTrace();
- SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
- }
- }
- }
+ public void run() {
+ Constructor> cons = null;
+ try {
+ cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
+ } catch (Exception e) {
+ e.printStackTrace();
+ SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
+ }
+ if (cons != null) {
+ // 获得该接口实现类实例
+ try {
+ Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
+ Object obj = cons.newInstance();
+ Method execute = generClass.getMethod("execute", new Class[]{OutputTaskModel.class, String.class, DCContext.class});
+ // 标记执行
+ new OutputTask().updateRunning(task.getId());
+ // 正式执行
+ ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[]{task, wizardJsonData, dcContext});
+ // 处理日志
+ List logs = (List) ro.get("logs");
+ if (logs != null && !logs.isEmpty()) {
+ StringBuilder sb = new StringBuilder();
+ for (String msg : logs) {
+ sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
+ }
+ // 保存日志文件
+ InputStream in = null;
+ try {
+ in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
+ dcContext.setFileName(OutputConst.FILE_TASK_LOG);
+ SDK.getDCAPI().write(in, dcContext);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ if (in != null)
+ in.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+ // 标记结束
+ if (ro.isOk()) {
+ new OutputTask().updateSucess(task.getId());
+ } else {
+ new OutputTask().updateError(task.getId());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
+ }
+ }
+ }
}
diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputExcelUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputExcelUtil.java
index 92b1bfca..1198ca2c 100755
--- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputExcelUtil.java
+++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputExcelUtil.java
@@ -231,6 +231,7 @@ public class OutputExcelUtil {
String label2 = m2.group();
if (checkLabel(label2)) {
labels.add(label2);
+ System.out.println("=============================label2内容为:"+label2.toString());
}
}
return labels;
diff --git a/com.actionsoft.apps.coe.pal/template/page/main.htm b/com.actionsoft.apps.coe.pal/template/page/main.htm
index bfa7e9f5..5701653f 100644
--- a/com.actionsoft.apps.coe.pal/template/page/main.htm
+++ b/com.actionsoft.apps.coe.pal/template/page/main.htm
@@ -13,4 +13,4 @@
var mainType = "<#mainType>";
var uid = "<#uid>";
var wHref = "./w";
- var jdHref = "./jd";