流程发布页面调整

This commit is contained in:
lihongyu 2022-10-27 17:33:58 +08:00
parent 2dbf2f8cc8
commit 796db2b193
5 changed files with 127 additions and 102 deletions

View File

@ -24,23 +24,21 @@ public class ApplyTasAfterkComplete extends ExecuteListener implements ExecuteLi
return "申请任务完成后事件,将表单数据改为审批中";
}
@Override
public void execute(ProcessExecutionContext ctx) throws Exception {
System.err.println("---------生成编号------------");
String processInstId = ctx.getProcessInstance().getId();
//by bzp 文件编号生成
/*
* String sql =
* "SELECT * FROM BO_ACT_COE_PUBLISH_N WHERE BINDID = '"+processInstId+"'";
* List<RowMap> maps = DBSql.getMaps(sql); for (RowMap rowMap : maps) { String
* number = rowMap.getString("PUBLISH_NUMBER"); }
*/
new ProcesNumberUtil().getNumber(processInstId);
SDK.getLogAPI().consoleInfo("[任务事件]任务结束,涉及流程状态变为审批中-->" + ctx.getTaskInstance().getTitle());
ProcessStatusAPIManager.getInstance().batchUpdateApprovalStatus(ctx.getTaskInstance().getProcessInstId(), true);
@Override
public void execute(ProcessExecutionContext ctx) throws Exception {
System.err.println("---------生成编号------------");
String processInstId = ctx.getProcessInstance().getId();
// by bzp 文件编号生成
String sql = "SELECT * FROM BO_ACT_COE_PUBLISH_N WHERE BINDID = '" + processInstId + "'";
List<RowMap> maps = DBSql.getMaps(sql);
for (RowMap rowMap : maps) {
String number = rowMap.getString("PUBLISH_NUMBER");
}
new ProcesNumberUtil().getNumber(processInstId);
SDK.getLogAPI().consoleInfo("[任务事件]任务结束,涉及流程状态变为审批中-->" + ctx.getTaskInstance().getTitle());
ProcessStatusAPIManager.getInstance().batchUpdateApprovalStatus(ctx.getTaskInstance().getProcessInstId(), true);
}
}
}

View File

@ -32,9 +32,15 @@ public class ApplyTaskAfterCreated extends ExecuteListener implements ExecuteLis
SDK.getLogAPI().consoleInfo("[任务创建]任务创建,涉及流程状态取消审批中状态,退回原有状态" + ctx.getTaskInstance().getTitle());
ProcessStatusAPIManager.getInstance().batchUpdateApprovalStatus(ctx.getTaskInstance().getProcessInstId(), false);
}
if("00000000-0000-0000-0000-000000000000".equals(ctx.getTaskInstance().getParentTaskInstId())) {
saveData(ctx);
BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA);
Object variable = SDK.getProcessAPI().getVariable(ctx.getProcessInstance(), "createType");
System.err.println("=====boData1=====>"+boData);
System.err.println("====variable1======>"+variable);
if(boData==null&&variable==null) {
System.err.println("===任务创建后创建====>");
saveData(ctx);
}
}
}
public void saveData(ProcessExecutionContext ctx) {
@ -45,7 +51,7 @@ public class ApplyTaskAfterCreated extends ExecuteListener implements ExecuteLis
String boId = ctx.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID);
//BO表记录注意该记录的数据如果被修改将会体现到表单上修改后不会直接持久化到数据库中
BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA);
BO byProcess = SDK.getBOAPI().getByProcess(PublisherConstant.BOTABLENAME, ctx.getProcessInstance().getId());
BO bo = new BO();
if(null==boData) {
bo.set("TEAMID", "");

View File

@ -26,47 +26,63 @@ public class PublishLoadBefore extends ExecuteListener {
return "表单加载前获取内部校对人和流程经理";
}
public void execute(ProcessExecutionContext ctx) throws Exception {
UserContext userContext = ctx.getUserContext();
Date date=new Date();//此时date为当前的时间
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置当前时间的格式为年--
String titled ="流程发布-"+ userContext.getUserName()+"-"+dateFormat.format(date);
String boId = ctx.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID);
//BO表记录注意该记录的数据如果被修改将会体现到表单上修改后不会直接持久化到数据库中
BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA);
if(null==boData) {
}else {
//如果有值就不再去计算了
if(boData.getString("DEPARTMENT_PROOFREADER") != null && !boData.getString("DEPARTMENT_PROOFREADER").isEmpty()){
return;
}
}
//根据部门名称 和单位 计算出 内部校对人 和流程经理
UserContext me = ctx.getUserContext();
String departmentId = me.getUserModel().getDepartmentId();
String allpath = SDK.getORGAPI().getDepartmentById(departmentId).getPathNameOfCache();
String[] patharr = allpath.split("/");
StringBuffer sb = new StringBuffer();
for (String str : patharr) {
sb.append("'").append(str).append("'").append(",");
public void execute(ProcessExecutionContext ctx) throws Exception {
UserContext userContext = ctx.getUserContext();
Date date = new Date();// 此时date为当前的时间
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 设置当前时间的格式为年--
String titled = "流程发布-" + userContext.getUserName() + "-" + dateFormat.format(date);
String boId = ctx.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID);
// BO表记录注意该记录的数据如果被修改将会体现到表单上修改后不会直接持久化到数据库中
BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA);
Object variable = SDK.getProcessAPI().getVariable(ctx.getProcessInstance(), "createType");
System.err.println("====boData2====>"+boData);
System.err.println("====variable2====>"+variable);
if (null == boData) {
} else {
// 如果有值就不再去计算了
if (boData.getString("DEPARTMENT_PROOFREADER") != null
&& !boData.getString("DEPARTMENT_PROOFREADER").isEmpty()) {
return;
}
//如果是1是从oa创建就不用再获取
if (variable==null) {
System.err.println("===表单加载前创建====>");
// 根据部门名称 和单位 计算出 内部校对人 和流程经理
UserContext me = ctx.getUserContext();
String departmentId = me.getUserModel().getDepartmentId();
String allpath = SDK.getORGAPI().getDepartmentById(departmentId).getPathNameOfCache();
String[] patharr = allpath.split("/");
StringBuffer sb = new StringBuffer();
for (String str : patharr) {
sb.append("'").append(str).append("'").append(",");
}
String substring = sb.substring(0, sb.length() - 1);
// 可以为boData中的字段进行赋值
Connection open = DBSql.open();
RowMap data = DBSql.getMap(open,
"select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGDEPART in (" + substring
+ ")");
if (null == data) {
throw new AWSException("请联系管理员,配置流程经理和流程校对人!");
}
open.close();
// RowMap data = DBSql.getMap(String.format("select DEAPRTMNUM,PROCESSMNUMBER
// from BO_ACT_PROCESSMANAGER where ORGNAME like'%s' and ORGDEPART like'%s'",
// allpath, allpath));
if (data != null && null != boData) {
boData.set("DEPARTMENT_PROOFREADER", data.getString("DEAPRTMNUM"));
boData.set("PROCESS_MANAGER", data.getString("PROCESSMNUMBER"));
boData.set("RELEASE_INSTRUCTIONS",
"<p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-align:center\"><strong><span style=\";font-family:宋体;font-size:24px\">关于发布《XXXXXXXXXXXX》的通知</span></strong><br></p><p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-align:center\"><strong><span style=\";font-family:宋体;font-size:14px\">&nbsp;</span></strong></p><p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-align:justify;text-justify:inter-ideograph\"><span style=\";font-family:仿宋_GB2312;font-size:21px\">各事业部、分(子)公司、总部各部(室):</span></p><p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-indent:43px;text-align:justify;text-justify:inter-ideograph\"><span style=\";font-family:仿宋_GB2312;font-size:21px\">为</span><span style=\";font-family:宋体;font-size:21px\">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span><span style=\";font-family:仿宋_GB2312;font-size:21px\">,现下发《</span><span style=\";font-family:宋体;font-size:21px\">xxxxxxxxxxxxxxx</span><span style=\";font-family:仿宋_GB2312;font-size:21px\">》,请各单位遵照执行。</span></p><p style=\"margin-top:5px;margin-right:0;margin-bottom:5px;margin-left:0;text-indent:43px;text-align:justify;text-justify:inter-ideograph\"><span style=\";font-family:仿宋_GB2312;font-size:21px\">特此通知。</span></p><p style=\"margin: 5px 0px; text-indent: 43px; text-align: right;\"><span style=\"text-indent: 299px; font-family: 仿宋_GB2312; font-size: 21px;\">xxxxxxxxx单位名称</span></p><p style=\"margin: 5px 0px; text-indent: 43px; text-align: right;\"><span style=\"font-family: 仿宋_GB2312; font-size: 21px;\">2022年7月27日</span></p>");// 流程实例状态
// 如果需要展示在表单上需要调用如下代码注意此操作不会更新数据库中的数据
ctx.setParameter(ListenerConst.FORM_EVENT_PARAM_BODATA, boData);
}
}
}
String substring = sb.substring(0, sb.length()-1);
// 可以为boData中的字段进行赋值
Connection open = DBSql.open();
RowMap data = DBSql.getMap(open,"select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGDEPART in ("+substring+")");
if(null==data) {
throw new AWSException("请联系管理员,配置流程经理和流程校对人!");
}
open.close();
// RowMap data = DBSql.getMap(String.format("select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGNAME like'%s' and ORGDEPART like'%s'", allpath, allpath));
if(data != null&&null!=boData){
boData.set("DEPARTMENT_PROOFREADER", data.getString("DEAPRTMNUM"));
boData.set("PROCESS_MANAGER", data.getString("PROCESSMNUMBER"));
boData.set("RELEASE_INSTRUCTIONS", "<p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-align:center\"><strong><span style=\";font-family:宋体;font-size:24px\">关于发布《XXXXXXXXXXXX》的通知</span></strong><br></p><p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-align:center\"><strong><span style=\";font-family:宋体;font-size:14px\">&nbsp;</span></strong></p><p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-align:justify;text-justify:inter-ideograph\"><span style=\";font-family:仿宋_GB2312;font-size:21px\">各事业部、分(子)公司、总部各部(室):</span></p><p style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;text-indent:43px;text-align:justify;text-justify:inter-ideograph\"><span style=\";font-family:仿宋_GB2312;font-size:21px\">为</span><span style=\";font-family:宋体;font-size:21px\">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span><span style=\";font-family:仿宋_GB2312;font-size:21px\">,现下发《</span><span style=\";font-family:宋体;font-size:21px\">xxxxxxxxxxxxxxx</span><span style=\";font-family:仿宋_GB2312;font-size:21px\">》,请各单位遵照执行。</span></p><p style=\"margin-top:5px;margin-right:0;margin-bottom:5px;margin-left:0;text-indent:43px;text-align:justify;text-justify:inter-ideograph\"><span style=\";font-family:仿宋_GB2312;font-size:21px\">特此通知。</span></p><p style=\"margin: 5px 0px; text-indent: 43px; text-align: right;\"><span style=\"text-indent: 299px; font-family: 仿宋_GB2312; font-size: 21px;\">xxxxxxxxx单位名称</span></p><p style=\"margin: 5px 0px; text-indent: 43px; text-align: right;\"><span style=\"font-family: 仿宋_GB2312; font-size: 21px;\">2022年7月27日</span></p>");//流程实例状态
//如果需要展示在表单上需要调用如下代码注意此操作不会更新数据库中的数据
ctx.setParameter(ListenerConst.FORM_EVENT_PARAM_BODATA, boData);
}
}
}
}

View File

@ -1,32 +1,12 @@
package com.actionsoft.apps.coe.pal.publisher.extend;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishHistoryCache;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishUserGroupCache;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishUserGroupPermCache;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishUserGroupRoleCache;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.cache.CoeProcessLevelCorrelateCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryAttributeCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryRemoveCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeAttributeCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeConfigCache;
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositoryPropertyDao;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.CoeDesignerImageCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.CoeDesignerShapeCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.PALDesignerFileCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.PALDesignerFileDragModelCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.teamwork.cache.TeamMemberPermCache;
import com.actionsoft.apps.coe.pal.teamwork.cache.TeamPermCache;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.bind.annotation.Controller;
import com.actionsoft.bpms.server.bind.annotation.Mapping;
@ -67,6 +47,12 @@ public class UpateFileStateController {
//SDK.getPALPublishAPI().publishPALRepository(publishInfo, publishList)
}
} else {
PALRepository repositoryDao = new PALRepository();
//修改流程文件的发布属性和发布时间
repositoryDao.updatePublishStatusAndDate("N",plId, null, null);
String updataSql = "UPDATE APP_ACT_COE_PAL_REPOSITORY SET ISPUBLISH = '" + state + "' WHERE ID = '" + plId
+ "'";
count += DBSql.update(updataSql);
@ -76,24 +62,25 @@ public class UpateFileStateController {
}
if (count > 0) {
SDK.getLogAPI().consoleInfo("更新状态后刷新缓存开始===========>");
TeamPermCache.getCache().reload();
TeamMemberPermCache.getCache().reload();
PublishHistoryCache.getCache().reload();
PublishUserGroupCache.getCache().reload();
PublishUserGroupPermCache.getCache().reload();
PublishUserGroupRoleCache.getCache().reload();
PALDesignerFileCache.getCache().reload();
PALDesignerFileDragModelCache.getCache().reload();
PALRepositoryCache.getCache().reload();
PALRepositoryRemoveCache.getCache().reload();
CoeDesignerShapeCache.getCache().reload();
DesignerShapeRelationCache.getCache().reload();
PALRepositoryPropertyCache.getCache().reload();
PALRepositoryAttributeCache.getCache().reload();
PALRepositoryShapeConfigCache.getCache().reload();
PALRepositoryShapeAttributeCache.getCache().reload();
CoeProcessLevelCorrelateCache.getCache().reload();
CoeDesignerImageCache.getCache().reload();
/*
* TeamPermCache.getCache().reload(); TeamMemberPermCache.getCache().reload();
* PublishHistoryCache.getCache().reload();
* PublishUserGroupCache.getCache().reload();
* PublishUserGroupPermCache.getCache().reload();
* PublishUserGroupRoleCache.getCache().reload();
* PALDesignerFileCache.getCache().reload();
* PALDesignerFileDragModelCache.getCache().reload();
* PALRepositoryRemoveCache.getCache().reload();
* CoeDesignerShapeCache.getCache().reload();
* DesignerShapeRelationCache.getCache().reload();
* PALRepositoryPropertyCache.getCache().reload();
* PALRepositoryAttributeCache.getCache().reload();
* PALRepositoryShapeConfigCache.getCache().reload();
* PALRepositoryShapeAttributeCache.getCache().reload();
* CoeProcessLevelCorrelateCache.getCache().reload();
* CoeDesignerImageCache.getCache().reload();
*/
SDK.getLogAPI().consoleInfo("更新状态后刷新缓存结束===========>");
ro.put("result", "ok");
} else {

View File

@ -446,6 +446,11 @@ var changedId = '';
function initPublishData(data, type, pageNumber, start){
showlist(data, type, pageNumber, start);
var ff = $("#readonly").val();
if($("#readonly").val()=="true"){
$("#publish_new_button").hide();
}
}
// 初始化数据
@ -2010,6 +2015,7 @@ function dealPublishCheck(isCheck, type) {
// 单独保存子表操作
function saveFormData(type) {
$.simpleAlert('正在保存', 'loading');
var saveData = [];
if (type == 'new') {
@ -2050,7 +2056,7 @@ function saveFormData(type) {
});
$.simpleAlert('close');
debugger
if (flag) {
if (false) {
var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
if (tempData.length > 0) {
for (var i = 0; i < tempData.length; i++) {
@ -2072,7 +2078,8 @@ function saveFormData(type) {
// 点击办理时的校验+保存字表
function formSave(isTransact){
debugger;
if(isTransact==true){
uiRequiredClass("PROCESS_TITLE", isShow);
uiRequiredClass("SEND_SCOPE", isShow);
@ -2205,7 +2212,7 @@ function formSave(isTransact){
}
});
$.simpleAlert('close');
if (flag) {
if (false) {
var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
if (tempData.length > 0) {
for (var i = 0; i < tempData.length; i++) {
@ -2222,6 +2229,7 @@ function formSave(isTransact){
$.confirm(options);
return false;
} else {
debugger;
newTemp = newTempData;
if (newTemp.length == 0) {
newPageSetting = {
@ -2251,6 +2259,16 @@ function formSave(isTransact){
}
$.simpleAlert('保存成功', 'ok');
}
if(isTransact!=true){
var processinstid = $("#processInstId").val();
var taskid = $("#taskInstId").val();
var ss = ui('CREATETYPE');
if("oa"==ss){
//window.open("https://bpm.yili.com:8088/portal/r/w?sid=6f4ae646-8ff8-426d-8a0a-891c5b5e4686&cmd=CLIENT_BPM_FORM_MAIN_PAGE_OPEN&processInstId="+processinstid+"&taskInstId="+taskid+"&openState=1","_blank");
}
}
}
//办理完成后关闭页面