流程发布,文件编号生成规则代码提交

This commit is contained in:
lihongyu 2022-07-29 02:31:15 +08:00
parent 1ba1ae4846
commit 5ec2bd9f77
4 changed files with 21 additions and 20 deletions

View File

@ -82,23 +82,32 @@ public class ProcesNumberUtil {
String number = getProcessNum(levelnum, orgCode); String number = getProcessNum(levelnum, orgCode);
String publishfileid=nowData.getString("PUBLISHFILEID"); 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 name = "00R00";
String fileName = "file_number"; String fileName = "file_number";
String plver= "1.0";
if(rowMap!=null){ if(rowMap!=null){
String plcategory=rowMap.getString("PLCATEGORY"); String plcategory=rowMap.getString("PLMETHODID");
System.out.println("plcategory"+plcategory); String plvers=rowMap.getString("PLVER");
if(plcategory.equals("process")){ if(plcategory.contains("process")){
name = number + "/P"+number; name = number + "/P"+number;
}else if(plcategory.equals("control")){ }else if(plcategory.contains("control")){
name = "00/R00"; name = "00/R00";
}else if(plcategory.equals("data")){ }else if(plcategory.contains("form")){
fileName = "form_number"; fileName = "form_number";
name = "00/T00"; 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(); String s = nowData.getId();
int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase())); int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase()));
System.out.println("表单文件编号回填:"+update+"--->"+processNum); System.out.println("表单文件编号回填:"+update+"--->"+processNum);

View File

@ -16,6 +16,7 @@ public class ApplyTasAfterkComplete extends ExecuteListener implements ExecuteLi
@Override @Override
public void execute(ProcessExecutionContext ctx) throws Exception { public void execute(ProcessExecutionContext ctx) throws Exception {
System.err.println("---------生成编号------------");
String processInstId = ctx.getProcessInstance().getId(); String processInstId = ctx.getProcessInstance().getId();
//by bzp 文件编号生成 //by bzp 文件编号生成
new ProcesNumberUtil().getNumber(processInstId); new ProcesNumberUtil().getNumber(processInstId);

View File

@ -1,20 +1,9 @@
package com.actionsoft.apps.coe.pal.publisher.event; 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.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.core.delegate.ProcessExecutionContext;
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener;
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListenerInterface; 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 { public class PublishExecuteListenerInterfaceCreateNo extends ExecuteListener implements ExecuteListenerInterface {

View File

@ -21,9 +21,11 @@ public class PublishLoadBefore extends ExecuteListener {
//BO表记录注意该记录的数据如果被修改将会体现到表单上修改后不会直接持久化到数据库中 //BO表记录注意该记录的数据如果被修改将会体现到表单上修改后不会直接持久化到数据库中
BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA); BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA);
//如果有值就不再去计算了 //如果有值就不再去计算了
if(null!=boData) {
if(boData.getString("DEPARTMENT_PROOFREADER") != null && !boData.getString("DEPARTMENT_PROOFREADER").isEmpty()){ if(boData.getString("DEPARTMENT_PROOFREADER") != null && !boData.getString("DEPARTMENT_PROOFREADER").isEmpty()){
return; return;
} }
}
//根据部门名称 和单位 计算出 内部校对人 和流程经理 //根据部门名称 和单位 计算出 内部校对人 和流程经理
UserContext me = ctx.getUserContext(); UserContext me = ctx.getUserContext();
String departmentId = me.getUserModel().getDepartmentId(); String departmentId = me.getUserModel().getDepartmentId();