提交 2066f7f1 编写于 作者: O o2null

Merge branch 'fix/cms权限刷新修改' into 'wrdp'

【内容管理】缓存及权限刷新修改

See merge request o2oa/o2oa!1975
......@@ -13,6 +13,7 @@ import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -47,7 +48,7 @@ class ActionCreate extends BaseAction {
emc.persist(o, CheckPersistType.all);
}
emc.commit();
ApplicationCache.notify(AppDict.class);
CacheManager.notify(AppDict.class);
Wo wo = new Wo();
wo.setId(appInfoDict.getId());
result.setData(wo);
......
......@@ -6,6 +6,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -37,7 +38,7 @@ class ActionDelete extends BaseAction {
emc.beginTransaction(AppDict.class);
emc.remove(dict, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(AppDict.class);
CacheManager.notify(AppDict.class);
Wo wo = new Wo();
wo.setId(dict.getId());
result.setData(wo);
......
......@@ -13,6 +13,7 @@ import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -63,7 +64,7 @@ class ActionEdit extends BaseAction {
emc.persist(o, CheckPersistType.all);
}
emc.commit();
ApplicationCache.notify(AppDict.class);
CacheManager.notify(AppDict.class);
Wo wo = new Wo();
wo.setId(dict.getId());
result.setData(wo);
......
......@@ -2,6 +2,7 @@ package com.x.cms.assemble.control.jaxrs.categoryinfo;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -71,10 +72,10 @@ public class ActionDelete extends BaseAction {
CmsBatchOperationProcessService.OPT_TYPE_DELETE, id, id, "删除分类:ID=" + id );
new LogService().log(null, effectivePerson.getDistinguishedName(), categoryInfo.getAppName() + "-" + categoryInfo.getCategoryName(), id, "", "", "", "CATEGORY", "删除");
ApplicationCache.notify( AppInfo.class );
ApplicationCache.notify( CategoryInfo.class );
ApplicationCache.notify( ViewCategory.class );
CacheManager.notify( AppInfo.class );
CacheManager.notify( CategoryInfo.class );
CacheManager.notify( ViewCategory.class );
} catch (Exception e) {
Exception exception = new ExceptionCategoryInfoProcess(e, "分类信息在删除时发生异常。ID:" + id);
result.error(exception);
......
......@@ -7,6 +7,7 @@ import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -190,11 +191,11 @@ public class ActionSave extends BaseAction {
}else {
new LogService().log(null, effectivePerson.getDistinguishedName(), categoryInfo.getAppName() + "-" + categoryInfo.getCategoryName(), categoryInfo.getId(), "", "", "", "CATEGORY", "新增");
}
ApplicationCache.notify(AppInfo.class);
ApplicationCache.notify(CategoryInfo.class);
ApplicationCache.notify(ViewCategory.class);
ApplicationCache.notify(Document.class);
CacheManager.notify(AppInfo.class);
CacheManager.notify(CategoryInfo.class);
CacheManager.notify(ViewCategory.class);
CacheManager.notify(Document.class);
} catch (Exception e) {
check = false;
Exception exception = new ExceptionCategoryInfoProcess(e, "分类信息在保存时发生异常.");
......
......@@ -7,6 +7,7 @@ import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -64,8 +65,8 @@ public class ActionSave extends BaseAction {
documentCommentInfo = documentCommentInfoPersistService.save( documentCommentInfo, wi.getContent(), effectivePerson );
// 更新缓存
ApplicationCache.notify( Document.class );
ApplicationCache.notify( DocumentCommentInfo.class );
CacheManager.notify( Document.class );
CacheManager.notify( DocumentCommentInfo.class );
Wo wo = new Wo();
wo.setId( documentCommentInfo.getId() );
......
......@@ -4,6 +4,7 @@ import com.google.gson.JsonElement;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.gson.GsonPropertyObject;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -123,7 +124,7 @@ public class ActionPersistChangeCategory extends BaseAction {
}
wo.setFailtureList( failture );
wo.setSuccessList( success );
ApplicationCache.notify(Document.class);
CacheManager.notify(Document.class);
}
}
result.setCount(Long.parseLong( wo.getTotal().toString() ) );
......
......@@ -9,6 +9,7 @@ import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -214,7 +215,7 @@ public class ActionPersistPublishAndNotify extends BaseAction {
}
}
ApplicationCache.notify( Document.class );
CacheManager.notify( Document.class );
return result;
}
......
......@@ -7,6 +7,7 @@ import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.exception.ExceptionWhen;
import com.x.processplatform.core.entity.content.Attachment;
......@@ -16,12 +17,10 @@ import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -416,8 +415,8 @@ public class ActionPersistPublishContent extends BaseAction {
}
}
ApplicationCache.notify(FileInfo.class);
ApplicationCache.notify(Document.class);
CacheManager.notify(FileInfo.class);
CacheManager.notify(Document.class);
return result;
}
......
......@@ -5,6 +5,7 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -76,12 +77,12 @@ public class ActionDelete extends BaseAction {
keys.add( "file.all" ); //清除文档的附件列表缓存
keys.add( "file." + id ); //清除指定ID的附件信息缓存
keys.add( ApplicationCache.concreteCacheKey( "document", document.getId(), isAnonymous, isManager ) ); //清除文档的附件列表缓存
ApplicationCache.notify( FileInfo.class, keys );
CacheManager.notify( FileInfo.class, keys );
keys.clear();
keys.add( ApplicationCache.concreteCacheKey( document.getId(), "view", isAnonymous, isManager ) ); //清除文档阅读缓存
keys.add( ApplicationCache.concreteCacheKey( document.getId(), "get", isManager ) ); //清除文档信息获取缓存
ApplicationCache.notify( Document.class, keys );
CacheManager.notify( Document.class, keys );
// 成功删除一个附件信息
logService.log(emc, effectivePerson.getDistinguishedName(), fileInfo.getName(), fileInfo.getAppId(),
......
......@@ -5,6 +5,7 @@ import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tika.Tika;
......@@ -205,9 +206,9 @@ public class ActionFileUpdate extends BaseAction {
// keys.add( ApplicationCache.concreteCacheKey( document.getId(), "view", isAnonymous, isManager ) ); //清除文档阅读缓存
// keys.add( ApplicationCache.concreteCacheKey( document.getId(), "get", isManager ) ); //清除文档信息获取缓存
// ApplicationCache.notify( Document.class, keys );
ApplicationCache.notify( FileInfo.class );
ApplicationCache.notify( Document.class );
CacheManager.notify( FileInfo.class );
CacheManager.notify( Document.class );
Wo wo = new Wo();
wo.setId( attachment.getId() );
......
......@@ -5,6 +5,7 @@ import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tika.Tika;
......@@ -128,9 +129,9 @@ public class ActionFileUploadCallback extends BaseAction {
// keys.add( ApplicationCache.concreteCacheKey( document.getId(), "view", isAnonymous, isManager ) ); //清除文档阅读缓存
// keys.add( ApplicationCache.concreteCacheKey( document.getId(), "get", isManager ) ); //清除文档信息获取缓存
// ApplicationCache.notify( Document.class, keys );
ApplicationCache.notify( FileInfo.class );
ApplicationCache.notify( Document.class );
CacheManager.notify( FileInfo.class );
CacheManager.notify( Document.class );
WoObject woObject = new WoObject();
woObject.setId(attachment.getId());
......
......@@ -4,6 +4,7 @@ import com.google.gson.JsonElement;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -70,7 +71,7 @@ public class ActionAppInfoManagerSave extends BaseAction {
if( check ){
String description = "栏目:"+appId+"权限变更";
new LogService().log( null, effectivePerson.getDistinguishedName(), description, appId, "", "", appId, "APPINFO_MANAGER", "管理权限变更" );
ApplicationCache.notify( AppInfo.class );
CacheManager.notify( AppInfo.class );
Wo wo = new Wo();
wo.setId( appId );
result.setData( wo );
......
......@@ -4,6 +4,7 @@ import com.google.gson.JsonElement;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -70,8 +71,8 @@ public class ActionAppInfoPublisherSave extends BaseAction {
if( check ){
String description = "栏目:"+appId+"权限变更";
new LogService().log( null, effectivePerson.getDistinguishedName(), description, appId, "", "", appId, "APPINFO_PUBLISHER", "发布权限变更" );
ApplicationCache.notify( AppInfo.class );
CacheManager.notify( AppInfo.class );
Wo wo = new Wo();
wo.setId( appId );
result.setData( wo );
......
......@@ -4,6 +4,7 @@ import com.google.gson.JsonElement;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -70,8 +71,8 @@ public class ActionAppInfoViewerSave extends BaseAction {
if( check ){
String description = "栏目:"+appId+"权限变更";
new LogService().log( null, effectivePerson.getDistinguishedName(), description, appId, "", "", appId, "APPINFO_VIEWER", "可见权限变更" );
ApplicationCache.notify( AppInfo.class );
CacheManager.notify( AppInfo.class );
Wo wo = new Wo();
wo.setId( appId );
......
......@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import com.google.gson.JsonElement;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -70,9 +71,9 @@ public class ActionCategoryInfoManagerSave extends BaseAction {
if( check ){
String description = "分类:"+categoryId+"权限变更";
new LogService().log( null, effectivePerson.getDistinguishedName(), description, categoryId, "", "", categoryId, "CATEGORYINFO_MANAGER", "管理权限变更" );
ApplicationCache.notify( AppInfo.class );
ApplicationCache.notify( CategoryInfo.class );
CacheManager.notify( AppInfo.class );
CacheManager.notify( CategoryInfo.class );
Wo wo = new Wo();
wo.setId( categoryId );
......
......@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import com.google.gson.JsonElement;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -70,9 +71,9 @@ public class ActionCategoryInfoPublisherSave extends BaseAction {
if( check ){
String description = "分类:"+categoryId+"权限变更";
new LogService().log( null, effectivePerson.getDistinguishedName(), description, categoryId, "", "", categoryId, "CATEGORYINFO_PUBLISHER", "发布权限变更" );
ApplicationCache.notify( AppInfo.class );
ApplicationCache.notify( CategoryInfo.class );
CacheManager.notify( AppInfo.class );
CacheManager.notify( CategoryInfo.class );
Wo wo = new Wo();
wo.setId( categoryId );
......
......@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import com.google.gson.JsonElement;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -70,9 +71,9 @@ public class ActionCategoryInfoViewerSave extends BaseAction {
if( check ){
String description = "分类:"+categoryId+"权限变更";
new LogService().log( null, effectivePerson.getDistinguishedName(), description, categoryId, "", "", categoryId, "CATEGORYINFO_VIEWER", "可见范围变更" );
ApplicationCache.notify( AppInfo.class );
ApplicationCache.notify( CategoryInfo.class );
CacheManager.notify( AppInfo.class );
CacheManager.notify( CategoryInfo.class );
Wo wo = new Wo();
wo.setId( categoryId );
......
......@@ -2,6 +2,7 @@ package com.x.cms.assemble.control.jaxrs.permission;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.logger.Logger;
......@@ -34,7 +35,7 @@ public class ActionRefreshAllDocumentPermission extends BaseAction {
logger.error(e, effectivePerson, request, null);
}
}
ApplicationCache.notify(Document.class);
CacheManager.notify(Document.class);
return result;
}
......
......@@ -5,6 +5,7 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.annotation.AuditLog;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -84,7 +85,7 @@ public class ActionRefreshDocumentPermission extends BaseAction {
}
ApplicationCache.notify( Document.class );
CacheManager.notify( Document.class );
return result;
}
......
......@@ -14,6 +14,7 @@ import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -59,7 +60,7 @@ class ActionCreate extends BaseAction {
emc.beginTransaction(QueryView.class);
emc.persist(queryView, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(QueryView.class);
CacheManager.notify(QueryView.class);
Wo wo = new Wo();
wo.setId(queryView.getId());
......
......@@ -4,6 +4,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.exception.ExceptionWhen;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -22,7 +23,7 @@ class ActionDelete extends BaseAction {
//business.applicationEditAvailable(effectivePerson, application, ExceptionWhen.not_allow);
emc.remove(queryView, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(QueryView.class);
CacheManager.notify(QueryView.class);
Wo wo = new Wo();
wo.setId( queryView.getId() );
......
......@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -49,7 +50,7 @@ class ActionUpdate extends BaseAction {
this.transQuery(queryView);
emc.check(queryView, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(QueryView.class);
CacheManager.notify(QueryView.class);
Wo wo = new Wo();
wo.setId( queryView.getId() );
......
......@@ -2,6 +2,7 @@ package com.x.cms.assemble.control.jaxrs.templateform;
import java.util.Arrays;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -44,7 +45,7 @@ class ActionCreate extends BaseAction {
emc.persist(o, CheckPersistType.all);
}
emc.commit();
ApplicationCache.notify(TemplateForm.class);
CacheManager.notify(TemplateForm.class);
Wo wo = new Wo();
wo.setId(o.getId());
result.setData(wo);
......
......@@ -4,6 +4,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -28,7 +29,7 @@ class ActionDelete extends BaseAction {
emc.beginTransaction(TemplateForm.class);
emc.remove(template, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(TemplateForm.class);
CacheManager.notify(TemplateForm.class);
Wo wo = new Wo();
wo.setId(template.getId());
result.setData(wo);
......
......@@ -6,6 +6,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -39,9 +40,9 @@ public class ActionDelete extends BaseAction {
Wo wo = new Wo();
wo.setId( viewCategory.getId() );
result.setData(wo);
ApplicationCache.notify( View.class );
ApplicationCache.notify( ViewCategory.class );
CacheManager.notify( View.class );
CacheManager.notify( ViewCategory.class );
} catch (Throwable th) {
th.printStackTrace();
result.error(th);
......
......@@ -5,6 +5,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -74,8 +75,8 @@ public class ActionSave extends BaseAction {
Wo wo = new Wo();
wo.setId( viewCategory.getId() );
result.setData(wo);
ApplicationCache.notify( View.class );
ApplicationCache.notify( ViewCategory.class );
CacheManager.notify( View.class );
CacheManager.notify( ViewCategory.class );
} catch (Throwable th) {
th.printStackTrace();
result.error(th);
......
......@@ -8,6 +8,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -59,7 +60,7 @@ public class ActionDelete extends BaseAction {
wrap = new Wo();
wrap.setId(viewFieldConfig.getId());
ApplicationCache.notify(ViewFieldConfig.class);
CacheManager.notify(ViewFieldConfig.class);
result.setData(wrap);
} catch (Throwable th) {
th.printStackTrace();
......
......@@ -5,6 +5,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -130,8 +131,8 @@ public class ActionSave extends BaseAction {
wrap = new Wo();
wrap.setId( viewFieldConfig.getId() );
result.setData(wrap);
ApplicationCache.notify( ViewFieldConfig.class );
ApplicationCache.notify( View.class );
CacheManager.notify( ViewFieldConfig.class );
CacheManager.notify( View.class );
} catch (Throwable th) {
th.printStackTrace();
result.error(th);
......
......@@ -59,7 +59,7 @@ public class QueueDataRowImport extends AbstractQueue<ImportDataRow> {
document.setTitle( "无标题" );
}
}
boolean flag = false;
try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
emc.beginTransaction( Document.class );
document.setDocStatus( excelReadRuntime.template.getDocStatus() ); //已发布
......@@ -102,11 +102,7 @@ public class QueueDataRowImport extends AbstractQueue<ImportDataRow> {
data.setDocument( document );
documentDataHelper.update( data );
emc.commit();
new CmsBatchOperationPersistService().addOperation(
CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT,
CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "导入新文档:ID=" + document.getId() );
flag = true;
dataImportStatus.addDocumentId( document.getId() );
dataImportStatus.increaseSuccessTotal(1);
System.out.println( "第" + curRow + "行数据导入成功,已经成功提交到数据库!导入成功共"+ excelReadRuntime.wo.getSuccess_count() +"条");
......@@ -116,6 +112,12 @@ public class QueueDataRowImport extends AbstractQueue<ImportDataRow> {
dataImportStatus.increaseErrorTotal(1);
e.printStackTrace();
}
if(flag) {
new CmsBatchOperationPersistService().addOperation(
CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT,
CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "导入新文档:ID=" + document.getId());
}
}else {
System.out.println("数据导入不成功,propertyNames为空,无法识别数据列对应的属性!");
}
......
......@@ -41,16 +41,14 @@ public class CmsBatchOperationPersistService {
}
if( StringUtils.isEmpty( cmsBatchOperation.getDescription() )) {
throw new Exception("description can not empty for save CmsBatchOperation!");
}
}
try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
emc.beginTransaction( CmsBatchOperation.class );
emc.persist( cmsBatchOperation, CheckPersistType.all );
emc.commit();
//将批量操作信息压入队列
ThisApplication.queueBatchOperation.send( cmsBatchOperation );
} catch ( Exception e ) {
throw e;
}
}
//将批量操作信息压入队列
ThisApplication.queueBatchOperation.send( cmsBatchOperation );
return cmsBatchOperation;
}
......
......@@ -2,6 +2,7 @@ package com.x.cms.assemble.control.service;
import java.util.List;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.container.EntityManagerContainer;
......@@ -213,8 +214,8 @@ public class CmsBatchOperationProcessService {
} catch (Exception e) {
throw e;
}
ApplicationCache.notify( Review.class );
ApplicationCache.notify( Document.class );
CacheManager.notify( Review.class );
CacheManager.notify( Document.class );
}
/**
......@@ -271,8 +272,8 @@ public class CmsBatchOperationProcessService {
} catch (Exception e) {
throw e;
}
ApplicationCache.notify( Review.class );
ApplicationCache.notify( Document.class );
CacheManager.notify( Review.class );
CacheManager.notify( Document.class );
}
......@@ -343,9 +344,9 @@ public class CmsBatchOperationProcessService {
} catch (Exception e) {
throw e;
}
ApplicationCache.notify( Document.class );
ApplicationCache.notify( CategoryInfo.class );
CacheManager.notify( Document.class );
CacheManager.notify( CategoryInfo.class );
}
/**
......@@ -414,8 +415,8 @@ public class CmsBatchOperationProcessService {
emc.commit();
}
}
ApplicationCache.notify( Document.class );
ApplicationCache.notify( CategoryInfo.class );
CacheManager.notify( Document.class );
CacheManager.notify( CategoryInfo.class );
}
/**
......@@ -479,8 +480,8 @@ public class CmsBatchOperationProcessService {
} catch (Exception e) {
throw e;
}
ApplicationCache.notify( CategoryInfo.class );
ApplicationCache.notify( Document.class );
CacheManager.notify( CategoryInfo.class );
CacheManager.notify( Document.class );
}
/**
......@@ -530,8 +531,8 @@ public class CmsBatchOperationProcessService {
} catch (Exception e) {
throw e;
}
ApplicationCache.notify( Document.class );
ApplicationCache.notify( CategoryInfo.class );
CacheManager.notify( Document.class );
CacheManager.notify( CategoryInfo.class );
}
/**
......
......@@ -6,6 +6,7 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.tools.ListTools;
import com.x.cms.assemble.control.DocumentDataHelper;
import com.x.cms.assemble.control.jaxrs.document.ActionPersistBatchModifyData.WiDataChange;
......@@ -349,7 +350,7 @@ public class DocumentPersistService {
}
}
}
ApplicationCache.notify(Document.class);
CacheManager.notify(Document.class);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册