From 7d4fc49f3eb6140e5ad7fed7ea5ca7b4e74b144e Mon Sep 17 00:00:00 2001 From: lihongyu <504404568@qq.com> Date: Mon, 24 Oct 2022 20:32:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=A4=84=E7=90=86=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extend/CreateOutputReportJob2.java | 52 +++++++++++++++++-- .../extend/UpateFileStateController.java | 37 +++++++++++++ 2 files changed, 84 insertions(+), 5 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/CreateOutputReportJob2.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/CreateOutputReportJob2.java index 39a9e11b..00d09886 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/CreateOutputReportJob2.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/CreateOutputReportJob2.java @@ -5,10 +5,27 @@ import java.util.List; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; +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.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.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.manage.CoeDesignerAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel; +import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache; 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.bo.engine.BO; import com.actionsoft.bpms.commons.database.RowMap; import com.actionsoft.bpms.schedule.IJob; @@ -19,7 +36,7 @@ import com.actionsoft.sdk.local.SDK; import com.alibaba.fastjson.JSONObject; import com.sun.org.apache.xalan.internal.xsltc.compiler.sym; /** - * 批量修改文件发布状态 + * 空模型改为发布态文件发布状态 * @author Administrator * */ @@ -31,6 +48,8 @@ public class CreateOutputReportJob2 implements IJob { int createNum = 0; String sqls = "DELETE FROM BO_EU__PAL_NULL_L"; DBSql.update(sqls); + String sqls2 = "DELETE FROM BO_EU_PAL_FILE_NULL_L"; + DBSql.update(sqls2); // String sql = "select ID from App_Act_Coe_Pal_Repository where PUBLISHDATE < // to_date('2022/10/5 9:46:18 ','yyyy-mm-dd hh24:mi:ss')"; // String sql = "select ID from App_Act_Coe_Pal_Repository where PUBLISHDATE > @@ -72,6 +91,7 @@ public class CreateOutputReportJob2 implements IJob { BO bo = new BO(); BO bo2 = new BO(); bo.set("PLNAME", model.getName()); + bo2.set("PLNAME", model.getName()); PALRepositoryModel prmodel = PALRepositoryCache.getCache().get(model.getParentId()); if (prmodel != null) { bo.set("FRAMEWORK", prmodel.getName()); @@ -89,34 +109,34 @@ public class CreateOutputReportJob2 implements IJob { String methodId = model.getMethodId(); if (methodId.contains("data")) { bo.set("TYPE", "表单"); - bo2.set("TYPE", "表单"); createNum += SDK.getBOAPI().createDataBO("BO_EU__PAL_NULL_L", bo, UserContext.fromUID("admin")); String sqlt ="UPDATE BO_EU_PAL_FILE1 SET FILESTATE = 0 WHERE PLNAME = '"+model.getName()+"'"; int a = DBSql.update(sqlt); if(a!=0) { + bo2.set("TYPE", "表单"); System.err.println("刷新为设计的模型:" +model.getName()); updateNum += SDK.getBOAPI().createDataBO("BO_EU_PAL_FILE_NULL_L", bo2, UserContext.fromUID("admin")); } } else if (methodId.contains("control.policy")) { bo.set("TYPE", "制度"); - bo2.set("TYPE", "制度"); createNum += SDK.getBOAPI().createDataBO("BO_EU__PAL_NULL_L", bo, UserContext.fromUID("admin")); String sqlt ="UPDATE BO_EU_PAL_FILE1 SET FILESTATE = 0 WHERE PLNAME = '"+model.getName()+"'"; int a = DBSql.update(sqlt); if(a!=0) { + bo2.set("TYPE", "制度"); System.err.println("刷新为设计的模型:" +model.getName()); updateNum += SDK.getBOAPI().createDataBO("BO_EU_PAL_FILE_NULL_L", bo2, UserContext.fromUID("admin")); } } else if (methodId.contains("process")) { bo.set("TYPE", "流程"); - bo2.set("TYPE", "流程"); createNum += SDK.getBOAPI().createDataBO("BO_EU__PAL_NULL_L", bo, UserContext.fromUID("admin")); String sqlt ="UPDATE BO_EU_PAL_FILE1 SET FILESTATE = 0 WHERE PLNAME = '"+model.getName()+"'"; int a = DBSql.update(sqlt); if(a!=0) { - updateNum+=a; + bo2.set("TYPE", "流程"); System.err.println("刷新为设计的模型:" +model.getName()); + updateNum += SDK.getBOAPI().createDataBO("BO_EU_PAL_FILE_NULL_L", bo2, UserContext.fromUID("admin")); } } @@ -136,6 +156,28 @@ public class CreateOutputReportJob2 implements IJob { } } + + 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(); + SDK.getLogAPI().consoleInfo("更新状态后刷新缓存结束===========>"); + System.err.println("更新文件表数量:" + updateNum); System.err.println("本次共查询到的模型:" + createNum); diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/UpateFileStateController.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/UpateFileStateController.java index 58352e9a..37f69109 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/UpateFileStateController.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/extend/UpateFileStateController.java @@ -5,10 +5,27 @@ 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.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; @@ -58,6 +75,26 @@ 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(); + SDK.getLogAPI().consoleInfo("更新状态后刷新缓存结束===========>"); ro.put("result", "ok"); } else { ro.put("result", "error");