From 5ec2bd9f77dc45dfb9402345fc8424b27acda548 Mon Sep 17 00:00:00 2001 From: lihongyu <504404568@qq.com> Date: Fri, 29 Jul 2022 02:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8F=91=E5=B8=83=EF=BC=8C?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=BC=96=E5=8F=B7=E7=94=9F=E6=88=90=E8=A7=84?= =?UTF-8?q?=E5=88=99=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/util/ProcesNumberUtil.java | 23 +++++++++++++------ .../event/ApplyTasAfterkComplete.java | 1 + ...blishExecuteListenerInterfaceCreateNo.java | 11 --------- .../publisher/event/PublishLoadBefore.java | 6 +++-- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java index ec1a56ee..9ca6254a 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java @@ -82,23 +82,32 @@ public class ProcesNumberUtil { String number = getProcessNum(levelnum, orgCode); String publishfileid=nowData.getString("PUBLISHFILEID"); - RowMap rowMap=DBSql.getMap("SELECT PLCATEGORY FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"+publishfileid+"' "); + RowMap rowMap=DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"+publishfileid+"' AND" + + " ISUSE = 1 "); String name = "00R00"; String fileName = "file_number"; + String plver= "1.0"; if(rowMap!=null){ - String plcategory=rowMap.getString("PLCATEGORY"); - System.out.println("plcategory"+plcategory); - if(plcategory.equals("process")){ + String plcategory=rowMap.getString("PLMETHODID"); + String plvers=rowMap.getString("PLVER"); + if(plcategory.contains("process")){ name = number + "/P"+number; - }else if(plcategory.equals("control")){ + }else if(plcategory.contains("control")){ name = "00/R00"; - }else if(plcategory.equals("data")){ + }else if(plcategory.contains("form")){ fileName = "form_number"; name = "00/T00"; } + if(!"".equals(plvers)) { + if(plvers.length()>1) { + plver = plvers.substring(0,1)+"."+plvers.substring(plvers.length()-1,plvers.length()); + }else { + plver = plvers.substring(0,1)+".0"; + } + } } - String processNum = levelnum + "." + name +"V1.0"+orgCode + regionCode + productCode; + String processNum = levelnum + "." + name +"V"+plver+orgCode + regionCode + productCode; String s = nowData.getId(); int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase())); System.out.println("表单文件编号回填:"+update+"--->"+processNum); 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 47543c55..7305fa48 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 @@ -16,6 +16,7 @@ public class ApplyTasAfterkComplete extends ExecuteListener implements ExecuteLi @Override public void execute(ProcessExecutionContext ctx) throws Exception { + System.err.println("---------生成编号------------"); String processInstId = ctx.getProcessInstance().getId(); //by bzp 文件编号生成 new ProcesNumberUtil().getNumber(processInstId); diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceCreateNo.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceCreateNo.java index 94fe0f09..99ef2158 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceCreateNo.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceCreateNo.java @@ -1,20 +1,9 @@ package com.actionsoft.apps.coe.pal.publisher.event; -import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishHistory; -import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishListHistory; -import com.actionsoft.apps.coe.pal.pal.manage.publish.model.PublishHistoryModel; -import com.actionsoft.apps.coe.pal.pal.manage.publish.model.PublishListHistoryModel; -import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository; import com.actionsoft.apps.coe.pal.publisher.client.util.ProcesNumberUtil; -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.ExecuteListenerInterface; -import com.actionsoft.bpms.util.UUIDGener; -import com.actionsoft.sdk.local.SDK; - -import java.sql.Timestamp; -import java.util.List; public class PublishExecuteListenerInterfaceCreateNo extends ExecuteListener implements ExecuteListenerInterface { diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishLoadBefore.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishLoadBefore.java index aeb5fabe..31418d2c 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishLoadBefore.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishLoadBefore.java @@ -21,8 +21,10 @@ public class PublishLoadBefore extends ExecuteListener { //BO表记录,注意:该记录的数据如果被修改,将会体现到表单上,修改后不会直接持久化到数据库中 BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA); //如果有值就不再去计算了 - if(boData.getString("DEPARTMENT_PROOFREADER") != null && !boData.getString("DEPARTMENT_PROOFREADER").isEmpty()){ - return; + if(null!=boData) { + if(boData.getString("DEPARTMENT_PROOFREADER") != null && !boData.getString("DEPARTMENT_PROOFREADER").isEmpty()){ + return; + } } //根据部门名称 和单位 计算出 内部校对人 和流程经理 UserContext me = ctx.getUserContext();