流程发布后权限单独存储、流程发布完成后事件绑定,流程发布中代办等不显示问题

This commit is contained in:
446052889@qq.com 2022-07-27 20:34:45 +08:00
parent cd6c95c1e8
commit 87a5655055
7 changed files with 101 additions and 5 deletions

View File

@ -3,8 +3,9 @@
<process id="obj_fb1c7a54b98b412187388c8bab407362" name="流程发布新流程" isClosed="false" processType="None" isExecutable="true">
<documentation/>
<extensionElements>
<aws:extendProcess accessSecurityType="0" archivesId="0" cancelProcessExclusiveActivities="obj_c9e93c345010000148211f97f9c07f00,obj_c9e5a2e6a2c00001891c127ce9309250,obj_c9e5a2e8c1300001809c1f8019b06830,obj_c9e5a2eb4e300001d5f056f6170a1cdc,obj_c9e5a2f12ae000018c481b60486010d9,obj_c9e5a2fac6200001e02b129413505750,obj_c9e5a2fe644000018643c060a52b197d,obj_c9e5a30288700001218cb32f1340fe50" cancelProcessExclusiveRule="1" defaultInstanceTitle="@form(BO_ACT_COE_PUBLISH,PROCESS_TITLE)-@form(BO_ACT_COE_PUBLISH,APPLYUSERNAME)-@form(BO_ACT_COE_PUBLISH,APPLYDATE)" extendProperty="" IOBD="" IOR="" IOS="" IOC="" description="" iconFontColor="" iconFontCode="" processLevelType="0" shortMessageNotifyTemplate="" mailNotifyTemplate="" timeDuration="0" timeDurationText="" trackDiagramType="0" taskOpenType="" wariningTimeDuration="0" wariningTimeDurationText="0Days,0Hours,0Minutes,0Seconds,0Milliseconds" isFormSummary="false" formSummary="" dataTrigger="[]" isAutoArchives="false" isCancelProcess="true" isCancelTask="false" isDataShare="false" isDraftRemove="true" isMobileStart="true" isQuickStart="false" isSecurityLayer="false" isTrackForm="true" isWorklistPopMini="true" isTransferPriority="false" isMatrixDistributed="false" isResetLostHistory="false" isTpl="false" tplSource="" tplUpdateLog="" tplLockedInfo="" processAccessPerm="" notifyConfig="{&quot;taskReminder&quot;:[]}" initSecurityLayer="-1" versionId="obj_fb1c7a54b98b412187388c8bab407362" processGroupId="obj_893ec85d8219468bb6df6a19fab4f7c9" processGroupName="流程发布新流程" categoryName="发布流程" engineType="0" processVer="1" versionStatus="0" processAdministrator="admin" createUser="admin" createTime="2022-07-12 16:23:23" updateUser="admin" updateTime="2022-07-26 15:10:04" historyMaxVersion="145" releaseUser="" releaseTime="" messageDigest="" isManaged="false" isIgnoreMapRoleSelect="true" isMapRoleSelectAtStart="false">
<aws:extendProcess accessSecurityType="0" archivesId="0" cancelProcessExclusiveActivities="obj_c9e93c345010000148211f97f9c07f00,obj_c9e5a2e6a2c00001891c127ce9309250,obj_c9e5a2e8c1300001809c1f8019b06830,obj_c9e5a2eb4e300001d5f056f6170a1cdc,obj_c9e5a2f12ae000018c481b60486010d9,obj_c9e5a2fac6200001e02b129413505750,obj_c9e5a2fe644000018643c060a52b197d,obj_c9e5a30288700001218cb32f1340fe50" cancelProcessExclusiveRule="1" defaultInstanceTitle="@form(BO_ACT_COE_PUBLISH,PROCESS_TITLE)-@form(BO_ACT_COE_PUBLISH,APPLYUSERNAME)-@form(BO_ACT_COE_PUBLISH,APPLYDATE)" extendProperty="" IOBD="" IOR="" IOS="" IOC="" description="" iconFontColor="" iconFontCode="" processLevelType="0" shortMessageNotifyTemplate="" mailNotifyTemplate="" timeDuration="0" timeDurationText="" trackDiagramType="0" taskOpenType="" wariningTimeDuration="0" wariningTimeDurationText="0Days,0Hours,0Minutes,0Seconds,0Milliseconds" isFormSummary="false" formSummary="" dataTrigger="[]" isAutoArchives="false" isCancelProcess="true" isCancelTask="false" isDataShare="false" isDraftRemove="true" isMobileStart="true" isQuickStart="false" isSecurityLayer="false" isTrackForm="true" isWorklistPopMini="true" isTransferPriority="false" isMatrixDistributed="false" isResetLostHistory="false" isTpl="false" tplSource="" tplUpdateLog="" tplLockedInfo="" processAccessPerm="" notifyConfig="{&quot;taskReminder&quot;:[]}" initSecurityLayer="-1" versionId="obj_fb1c7a54b98b412187388c8bab407362" processGroupId="obj_893ec85d8219468bb6df6a19fab4f7c9" processGroupName="流程发布新流程" categoryName="发布流程" engineType="0" processVer="1" versionStatus="0" processAdministrator="admin" createUser="admin" createTime="2022-07-12 16:23:23" updateUser="admin" updateTime="2022-07-27 20:07:54" historyMaxVersion="146" releaseUser="" releaseTime="" messageDigest="" isManaged="false" isIgnoreMapRoleSelect="true" isMapRoleSelectAtStart="false">
<aws:listener clazz="com.actionsoft.apps.coe.pal.publisher.event.PublishProcessAfterDeleteListener" event="PROCESS_AFTER_DELETE"/>
<aws:listener clazz="com.actionsoft.apps.coe.pal.publisher.event.PublishExecuteListenerInterfaceImpl" event="PROCESS_AFTER_COMPLETE"/>
</aws:extendProcess>
</extensionElements>
<sequenceFlow id="obj_c9e5a3a22fd00001b12b80c016f01a7f" sourceRef="obj_c9e5a3a1bf40000157b91c1017501351" targetRef="obj_c9e5a2fe644000018643c060a52b197d">

View File

@ -1 +1 @@
{"CheckOutTime":"2022-07-27 12:57:55","CheckOutIP":"0:0:0:0:0:0:0:1","CheckOutUser":"admin","CheckOutState":"CHECKOUT"}
{"CheckOutTime":"2022-07-27 20:19:13","CheckOutIP":"0:0:0:0:0:0:0:1","CheckOutUser":"admin","CheckOutState":"CHECKOUT"}

View File

@ -1 +1 @@
{"versionId":"obj_fb1c7a54b98b412187388c8bab407362","chartId":"obj_fb1c7a54b98b412187388c8bab407362","userIds":["admin"],"messages":[],"userNames":"管理员","remark":"","updateTime":"2022-07-26 15:10:04","definitionId":"obj_fb1c7a54b98b412187388c8bab407362"}
{"versionId":"obj_fb1c7a54b98b412187388c8bab407362","chartId":"obj_fb1c7a54b98b412187388c8bab407362","userIds":["admin"],"messages":[],"userNames":"管理员","remark":"","updateTime":"2022-07-27 20:07:55","definitionId":"obj_fb1c7a54b98b412187388c8bab407362"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -9,7 +9,7 @@ package com.actionsoft.apps.coe.pal.publisher.constant;
public interface PublisherConstant {
public static final String PUBLISH = "com.actionsoft.apps.coe.pal.publisher"; //流程发布AppId
public static final String PROCESSGROUPID = "obj_f2903c7c6a2d405a981a87e115d4261e"; //发布流程流程组Id
public static final String PROCESSGROUPID = "obj_893ec85d8219468bb6df6a19fab4f7c9"; //发布流程流程组Id
//public static final String PROCESSID = "obj_d2b56ab6bd96477b9b14fc355f3c5ee9";
public static final String PROCESSID = "obj_fb1c7a54b98b412187388c8bab407362";

View File

@ -1,13 +1,15 @@
package com.actionsoft.apps.coe.pal.publisher.event;
import java.sql.Timestamp;
import java.util.List;
import java.util.*;
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.cache.PALRepositoryCache;
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.publisher.client.util.ProcesNumberUtil;
import com.actionsoft.apps.coe.pal.publisher.client.util.ProcessStatusAPIManager;
import com.actionsoft.apps.coe.pal.publisher.constant.PublisherConstant;
@ -135,6 +137,99 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
repositoryDao.updatePublishStatusAndDate("S", boS.get("STOPFILEID").toString(), null, model.getPublishDate());
}
}
// 流程发布范围权限单独存储
savePublishScope(bo, bolistN, bolistC, bolistS);
}
/**
* 流程发布范围权限单独存储
* @param bo 流程发布bo主表
* @param bolistN 新增发布流程信息
* @param bolistC 变更发布流程信息需要将已存在的相应流程权限信息进行删除再进行权限存储
* @param bolistS 停用发布流程信息删除相应流程权限信息
*/
private void savePublishScope(BO publish, List<BO> bolistN, List<BO> bolistC, List<BO> bolistS) {
String bindId = publish.getBindId();
String wsId = publish.getString("WSID");
String applyUser = publish.getString("APPLYUSERID");
String sendScope = publish.getString("SEND_SCOP");
String sendScopeOrg = publish.getString("SEND_SCOPE_ORG");
String sendScopePost = publish.getString("SEND_SCOPE_POST");
String sendScopeLevel = publish.getString("SEND_SCOPE_LEVEL");
Set<String> removeVerIds = new HashSet<>();
Map<String, String> addVerMap = new HashMap<>();
//将发布范围权限信息保存至范围权限表
if (bolistN != null) {
for (BO boN : bolistN) {
String palId = boN.get("PUBLISHFILEID").toString();
PALRepositoryModel model = PALRepositoryCache.getCache().get(palId);
if (model == null) {
SDK.getLogAPI().consoleErr("[发布范围权限信息保存至范围权限表]更新失败,模型[" + palId + "]");
continue;
}
addVerMap.put(model.getVersionId(), model.getName());
removeVerIds.add(model.getVersionId());
}
}
if (bolistC != null) {
for (BO boC : bolistC) {
String palId = boC.get("CHANGEDFILEIDNEW").toString();
PALRepositoryModel model = PALRepositoryCache.getCache().get(palId);
if (model == null) {
SDK.getLogAPI().consoleErr("[发布范围权限信息保存至范围权限表]更新失败,模型[" + palId + "]");
continue;
}
addVerMap.put(model.getVersionId(), model.getName());
removeVerIds.add(model.getVersionId());
}
}
if (bolistS != null) {
for (BO boS : bolistS) {
String palId = boS.get("STOPFILEID").toString();
PALRepositoryModel model = PALRepositoryCache.getCache().get(palId);
if (model == null) {
SDK.getLogAPI().consoleErr("[发布范围权限信息保存至范围权限表]更新失败,模型[" + palId + "]");
continue;
}
removeVerIds.add(model.getVersionId());
}
}
String newBoName = "BO_ACT_PUBLISH_PERM_SCOPE";
// 先删除相应原有权限数据再进行数据更新
Set<String> removeIds = new HashSet<>();
for (String removeVerId : removeVerIds) {
List<BO> delList = SDK.getBOAPI().query(newBoName).addQuery("PALVERSIONID=", removeVerId).list();
if (delList != null && delList.size() > 0) {
for (BO del : delList) {
removeIds.add(del.getId());
}
}
}
for (String removeId : removeIds) {
SDK.getBOAPI().remove(newBoName, removeId);
}
// 重新添加权限
List<BO> list = new ArrayList<>();
for (Map.Entry<String, String> entry : addVerMap.entrySet()) {
String verId = entry.getKey();
String name = entry.getValue();
BO bo = new BO();
bo.set("PERMID", UUIDGener.getUUID());
bo.set("WSID", wsId);
bo.set("PALVERSIONID", verId);
bo.set("PALNAME", name);
bo.set("PERMTYPE", sendScope);
bo.set("ORGPERM", "1".equals(sendScope) ? "" : sendScopeOrg);
bo.set("POSTPERM", "1".equals(sendScope) ? "" : sendScopePost);
bo.set("LEVELPERM", "1".equals(sendScope) ? "" : sendScopeLevel);
list.add(bo);
}
if (list.size() > 0) {
SDK.getBOAPI().create(newBoName, list, bindId, applyUser);
SDK.getLogAPI().consoleErr("[发布范围权限信息保存至范围权限表]更新成功");
}
}
}