From d83318f5195e99a43f24b6cd6dd9196f653ce494 Mon Sep 17 00:00:00 2001 From: lihongyu <504404568@qq.com> Date: Mon, 9 Jan 2023 00:35:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8F=91=E5=B8=83=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E4=BF=9D=E5=AD=98=E6=97=B6=E4=BF=9D=E5=AD=98=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=88=B0=E4=B8=BB=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/ApplyTasAfterkComplete.java | 65 +-------------- .../pal/publisher/event/SubFormAfterSave.java | 79 +++++++++++++++++++ .../pubEvent/ProcessEndAfterEvent.java | 4 +- 3 files changed, 82 insertions(+), 66 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/ApplyTasAfterkComplete.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/ApplyTasAfterkComplete.java index 359ff77e..3fee10c5 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/ApplyTasAfterkComplete.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/ApplyTasAfterkComplete.java @@ -51,75 +51,12 @@ public class ApplyTasAfterkComplete extends ExecuteListener implements ExecuteLi ProcessStatusAPIManager.getInstance().batchUpdateApprovalStatus(ctx.getTaskInstance().getProcessInstId(), true); //任务提交后重新生成手册 List bolistN = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(processInstId).list(); - ArrayList arr = new ArrayList(); - if(bolistN.size()>0) { - for (BO bo : bolistN) { - try { - typeList(arr, bo.getString("PUBLISHFILEID")); - } catch (Exception e) { - // TODO: handle exception - } - } - } List bolistC = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(processInstId).list(); - if(bolistC.size()>0) { - for (BO bo : bolistC) { - try { - typeList(arr, bo.getString("CHANGEDFILEIDNEW")); - } catch (Exception e) { - // TODO: handle exception - } - } - - } - - List bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list(); - if(bolistS.size()>0) { - for (BO bo : bolistS) { - try { - typeList(arr, bo.getString("STOPFILEID")); - } catch (Exception e) { - // TODO: handle exception - } - } - } - //保存发布文件的类型到主表 - if((arr.contains("表单模板")||arr.contains("操作指导"))&&!arr.contains("制度模型")&&!arr.contains("EPC模型")&&!arr.contains("泳道图")) { - SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "操作指导/表单模板"); - }else { - SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "制度模型/EPC模型/泳道图"); - } - + //List bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list(); Timestamp nowTime = new Timestamp(System.currentTimeMillis()); BO bo = SDK.getBOAPI().query(PublisherConstant.BOTABLENAME).detailByBindId(processInstId); updateEffectiveDateProperty(processInstId, bo, nowTime, bolistN, bolistC); } - - public ArrayList typeList(ArrayList arr,String plId){ - String sql = "SELECT PLMETHODID,EXT3 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '"+plId+"'"; - RowMap map = DBSql.getMap(sql); - if(map!=null) { - String methodId = map.getString("PLMETHODID"); - if("control.policy".equals(methodId)) { - String fileType = map.getString("EXT3"); - if("I/O_L4".equals(fileType)) { - arr.add("操作指导"); - }else { - arr.add("制度模型"); - } - }else if("data.form".equals(methodId)) { - arr.add("表单模板"); - }else if("process.epc".equals(methodId)) { - arr.add("EPC模型"); - }else if("process.flowchart".equals(methodId)) { - arr.add("泳道图"); - } - - - } - return arr; - } - private void updateEffectiveDateProperty(String processInstId, BO bo, Timestamp publishDate, List bolistN, List bolistC) { // 对epc、表单、制度图进行生效日期更新和手册重新生成 // epc:process.epc effective_date diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java index 6dfc4215..048cee4e 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java @@ -5,11 +5,14 @@ import java.util.List; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; +import com.actionsoft.apps.coe.pal.publisher.constant.PublisherConstant; import com.actionsoft.bpms.bo.engine.BO; import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst; import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance; +import com.actionsoft.bpms.commons.database.RowMap; +import com.actionsoft.bpms.util.DBSql; import com.actionsoft.bpms.util.UUIDGener; import com.actionsoft.sdk.local.SDK; import com.actionsoft.sdk.local.api.BOQueryAPI; @@ -29,6 +32,7 @@ public class SubFormAfterSave extends ExecuteListener { } public void execute(ProcessExecutionContext param) throws Exception { + String processInstId = param.getProcessInstance().getId(); //记录ID String boId = param.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID); //表单ID @@ -110,15 +114,90 @@ public class SubFormAfterSave extends ExecuteListener { } } } + + SDK.getBOAPI().create(boName, boList, bindId, uid); // 该记录是否新建的状态,由于机制调整,BO对象中的ID是不为空的,不能通过ID判断记录是否处于新建状态还是修改状态 boolean isCreate = param.getParameterOfBoolean(ListenerConst.FORM_EVENT_PARAM_ISCREATE); if (isCreate) { SDK.getBOAPI().remove(boName, boId); } + + //保存文件类型到主表 + saveFileType(processInstId); } } + //保存文件类型到主表 + saveFileType(processInstId); } + public String saveFileType(String processInstId) { + List bolistN = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(processInstId).list(); + ArrayList arr = new ArrayList(); + if(bolistN.size()>0) { + for (BO bo : bolistN) { + try { + typeList(arr, bo.getString("PUBLISHFILEID")); + } catch (Exception e) { + // TODO: handle exception + } + } + } + List bolistC = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(processInstId).list(); + if(bolistC.size()>0) { + for (BO bo : bolistC) { + try { + typeList(arr, bo.getString("CHANGEDFILEIDNEW")); + } catch (Exception e) { + // TODO: handle exception + } + } + + } + + List bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list(); + if(bolistS.size()>0) { + for (BO bo : bolistS) { + try { + typeList(arr, bo.getString("STOPFILEID")); + } catch (Exception e) { + // TODO: handle exception + } + } + } + //保存发布文件的类型到主表 + if((arr.contains("表单模板")||arr.contains("操作指导"))&&!arr.contains("制度模型")&&!arr.contains("EPC模型")&&!arr.contains("泳道图")) { + DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '操作指导/表单模板' WHERE BINDID = '"+processInstId+"'"); + //SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "操作指导/表单模板"); + }else { + DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '制度模型/EPC模型/泳道图' WHERE BINDID = '"+processInstId+"'"); + //SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "制度模型/EPC模型/泳道图"); + } + return processInstId; + } + public ArrayList typeList(ArrayList arr,String plId){ + String sql = "SELECT PLMETHODID,EXT3 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '"+plId+"'"; + RowMap map = DBSql.getMap(sql); + if(map!=null) { + String methodId = map.getString("PLMETHODID"); + if("control.policy".equals(methodId)) { + String fileType = map.getString("EXT3"); + if("I/O_L4".equals(fileType)) { + arr.add("操作指导"); + }else { + arr.add("制度模型"); + } + }else if("data.form".equals(methodId)) { + arr.add("表单模板"); + }else if("process.epc".equals(methodId)) { + arr.add("EPC模型"); + }else if("process.flowchart".equals(methodId)) { + arr.add("泳道图"); + } + + + } + return arr; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent.java index 0b193d53..98bd2c20 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent.java @@ -1430,7 +1430,7 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList String sql_n = "select * from APP_ACT_COE_PAL_REPOSITORY where id = '" + publishfileid + "'"; RowMap map = DBSql.getMap(sql_n); PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(publishfileid); - jsonObject_ehsq.put("version", palRepositoryModel.getVersion()+""); + jsonObject_ehsq.put("version", "V"+palRepositoryModel.getVersion()+""); jsonObject_ehsq.put("releasedate", simpleDateFormat.format(new Date())); jsonObject_ehsq.put("effectivedate", simpleDateFormat.format(new Date())); jsonObject_ehsq.put("authorcode", processExecutionContext.getTaskInstance().getTarget()); // jsonObject_ehsq.put("authorcode","00116465"); @@ -1538,7 +1538,7 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList String sql_n = "select * from APP_ACT_COE_PAL_REPOSITORY where id = '" + publishfileid + "'"; RowMap map = DBSql.getMap(sql_n); PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(publishfileid); - jsonObject_ehsq.put("version", palRepositoryModel.getVersion()+""); + jsonObject_ehsq.put("version", "V"+palRepositoryModel.getVersion()+""); jsonObject_ehsq.put("releasedate", simpleDateFormat.format(new Date())); jsonObject_ehsq.put("effectivedate", simpleDateFormat.format(new Date())); jsonObject_ehsq.put("authorcode", processExecutionContext.getTaskInstance().getTarget());