Эх сурвалжийг харах

[bug-267]流程启动时,暂存,修改再提交时,表单数据获取的是缓存数据(暂存不更新缓存数据)

liyuan 2 жил өмнө
parent
commit
8a5d9aa697

+ 7 - 0
ibps-bpmn-root/modules/bpmn-biz/src/main/java/com/lc/ibps/bpmn/service/impl/BpmProcInstServiceImpl.java

@@ -1,6 +1,7 @@
 package com.lc.ibps.bpmn.service.impl;
 
 import cn.hutool.core.exceptions.ExceptionUtil;
+import com.lc.ibps.api.base.constants.CacheKeyConstants;
 import com.lc.ibps.api.base.context.CurrentContext;
 import com.lc.ibps.api.base.page.Page;
 import com.lc.ibps.api.base.query.QueryFilter;
@@ -17,6 +18,7 @@ import com.lc.ibps.base.framework.executor.ExecutorServiceFactory;
 import com.lc.ibps.base.framework.executor.ICalculateThreadSize;
 import com.lc.ibps.base.framework.executor.MultiTaskExecutor;
 import com.lc.ibps.base.framework.id.UniqueIdUtil;
+import com.lc.ibps.base.framework.utils.J2CacheUtil;
 import com.lc.ibps.base.saas.context.TenantContext;
 import com.lc.ibps.base.web.context.ContextUtil;
 import com.lc.ibps.bpmn.api.cmd.ActionCmd;
@@ -57,6 +59,7 @@ import com.lc.ibps.cloud.mq.core.constants.ContentType;
 import com.lc.ibps.cloud.mq.core.constants.MessageType;
 import com.lc.ibps.org.api.IPartyEmployeeService;
 import com.lc.ibps.org.party.persistence.entity.PartyEmployeePo;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.event.Level;
@@ -210,6 +213,10 @@ public class BpmProcInstServiceImpl implements BpmProcInstService {
 			throw e;
 		} finally {
 			StopWatchUtil.stopAndPrintLocal(stepId, step);
+			//FIX BUG:流程启动时,暂存,修改再提交时,表单数据获取的是缓存数据(暂存不更新缓存数据)
+			if(J2CacheUtil.isCaching() && instance != null && StringUtils.isNotBlank(instance.getBizKey())) {
+				J2CacheUtil.getChannel().evict(CacheKeyConstants.Region.REGION_IBPS_BO, instance.getBizKey());
+			}
 		}
 		return instance;
 	}