提交 059b2f07 编写于 作者: O o2sword

内容管理管理员权限修改2

上级 f10b34d8
......@@ -18,7 +18,7 @@ import com.x.base.core.project.annotation.ModuleType;
"com.x.query.core.entity.View", "com.x.cms.core.entity.ReadRemind", "com.x.cms.core.entity.DocumentCommend",
"com.x.cms.core.entity.DocumentCommentInfo", "com.x.cms.core.entity.CmsBatchOperation", "com.x.cms.core.entity.Review",
"com.x.cms.core.entity.DocumentCommentContent", "com.x.cms.core.entity.DocumentCommentCommend", "com.x.portal.core.entity.Script"
, "com.x.processplatform.core.entity.element.Script"}, storageTypes = {
, "com.x.processplatform.core.entity.element.Script", "com.x.processplatform.core.entity.element.Form"}, storageTypes = {
StorageType.cms, StorageType.processPlatform }, storeJars = { "x_processplatform_core_entity",
"x_organization_core_entity", "x_organization_core_express", "x_cms_core_entity","x_cms_core_express",
"x_query_core_entity", "x_query_core_express", "x_portal_core_entity" })
......
package com.x.cms.assemble.control.factory.process;
import com.x.cms.assemble.control.Business;
import com.x.cms.assemble.control.factory.ElementFactory;
import com.x.processplatform.core.entity.element.Form;
public class FormFactory extends ElementFactory {
public FormFactory(Business abstractBusiness) throws Exception {
super(abstractBusiness);
}
public Form pick(String flag) throws Exception {
return this.pick(flag, Form.class);
}
}
......@@ -18,4 +18,13 @@ public class ProcessFactory extends AbstractFactory {
return script;
}
private FormFactory form;
public FormFactory form() throws Exception {
if (null == this.form) {
this.form = new FormFactory(this.business());
}
return form;
}
}
......@@ -41,7 +41,7 @@ import com.x.processplatform.core.entity.content.Attachment;
/**
* 从流程发布一个文档(流程)
*
*
* @author sword
*/
public class ActionPersistPublishByWorkFlow extends BaseAction {
......@@ -228,6 +228,7 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
if (wi.getPublishTime() == null) {
wi.setPublishTime(new Date());
}
wi.setPpFormId(wi.getWf_formId());
document = documentPersistService.save(wi, wi.getDocData(), categoryInfo.getProjection());
} catch (Exception e) {
check = false;
......@@ -382,7 +383,7 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
if (check && !wi.getSkipPermission()) {
// 将读者以及作者信息持久化到数据库中
try {
document = documentPersistService.refreshDocumentPermission(document.getId(), wi.getReaderList(),
documentPersistService.refreshDocumentPermission(document.getId(), wi.getReaderList(),
wi.getAuthorList());
} catch (Exception e) {
check = false;
......
......@@ -164,6 +164,7 @@ public class ActionPersistPublishContent extends BaseAction {
wi.setCategoryName(categoryInfo.getCategoryName());
wi.setCategoryId(categoryInfo.getId());
wi.setCategoryAlias(categoryInfo.getCategoryAlias());
if( StringUtils.isEmpty( wi.getDocumentType() ) ) {
wi.setDocumentType( categoryInfo.getDocumentType() );
}
......@@ -229,6 +230,7 @@ public class ActionPersistPublishContent extends BaseAction {
if( wi.getPublishTime() == null ) { wi.setPublishTime(new Date()); }
document = Wi.copier.copy(wi);
document.setId( wi.getId() );
document.setPpFormId(wi.getWf_formId());
document = documentPersistService.save( document, wi.getDocData(), categoryInfo.getProjection());
} catch (Exception e) {
check = false;
......
......@@ -33,6 +33,7 @@ class V2LookupDoc extends BaseAction {
private Form form = null;
private Form readForm = null;
private com.x.processplatform.core.entity.element.Form ppForm;
private Wo wo = new Wo();
ActionResult<Wo> execute(EffectivePerson effectivePerson, String docId) throws Exception {
......@@ -44,6 +45,7 @@ class V2LookupDoc extends BaseAction {
this.getDocForm(docId);
String formId = "";
String readFormId = "";
String ppFormId = "";
if (null != this.form) {
formId = form.getId();
this.wo.setFormId(formId);
......@@ -52,8 +54,12 @@ class V2LookupDoc extends BaseAction {
readFormId = readForm.getId();
this.wo.setReadFormId(readFormId);
}
if (StringUtils.isNotEmpty(formId) || StringUtils.isNotEmpty(readFormId)) {
CacheKey cacheKey = new CacheKey(this.getClass(), formId, readFormId);
if (null != this.ppForm){
ppFormId = this.ppForm.getId();
this.wo.setPpFormId(ppFormId);
}
if(StringUtils.isNotEmpty(formId) || StringUtils.isNotEmpty(readFormId) || StringUtils.isNotEmpty(ppFormId)){
CacheKey cacheKey = new CacheKey(this.getClass(), formId, readFormId, ppFormId);
Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
if (optional.isPresent()) {
this.wo = (Wo) optional.get();
......@@ -77,6 +83,9 @@ class V2LookupDoc extends BaseAction {
list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
}
if(this.ppForm != null){
list.add(this.ppForm.getId() + this.ppForm.getUpdateTime().getTime());
}
list = list.stream().sorted().collect(Collectors.toList());
CRC32 crc = new CRC32();
crc.update(StringUtils.join(list, "#").getBytes());
......@@ -120,6 +129,9 @@ class V2LookupDoc extends BaseAction {
this.readForm = business.getFormFactory().pick(readFormId);
}
}
if(StringUtils.isNotBlank(document.getPpFormId())){
this.ppForm = business.process().form().pick(document.getPpFormId());
}
}
}
}
......@@ -168,6 +180,8 @@ class V2LookupDoc extends BaseAction {
private String readFormId;
private String ppFormId;
private String cacheTag;
public String getFormId() {
......@@ -194,6 +208,13 @@ class V2LookupDoc extends BaseAction {
this.cacheTag = cacheTag;
}
public String getPpFormId() {
return ppFormId;
}
public void setPpFormId(String ppFormId) {
this.ppFormId = ppFormId;
}
}
}
......@@ -33,6 +33,7 @@ class V2LookupDocMobile extends BaseAction {
private Form form = null;
private Form readForm = null;
private com.x.processplatform.core.entity.element.Form ppForm;
private Wo wo = new Wo();
ActionResult<Wo> execute(EffectivePerson effectivePerson, String docId) throws Exception {
......@@ -43,6 +44,7 @@ class V2LookupDocMobile extends BaseAction {
String formId = "";
String readFormId = "";
String ppFormId = "";
if (null != this.form) {
formId = form.getId();
this.wo.setFormId(formId);
......@@ -51,8 +53,12 @@ class V2LookupDocMobile extends BaseAction {
readFormId = readForm.getId();
this.wo.setReadFormId(readFormId);
}
if(StringUtils.isNotEmpty(formId) || StringUtils.isNotEmpty(readFormId)){
CacheKey cacheKey = new CacheKey(this.getClass(), formId, readFormId);
if (null != this.ppForm){
ppFormId = this.ppForm.getId();
this.wo.setPpFormId(ppFormId);
}
if(StringUtils.isNotEmpty(formId) || StringUtils.isNotEmpty(readFormId) || StringUtils.isNotEmpty(ppFormId)){
CacheKey cacheKey = new CacheKey(this.getClass(), formId, readFormId, ppFormId);
Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
if (optional.isPresent()) {
this.wo = (Wo) optional.get();
......@@ -74,6 +80,9 @@ class V2LookupDocMobile extends BaseAction {
list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
}
if(this.ppForm != null){
list.add(this.ppForm.getId() + this.ppForm.getUpdateTime().getTime());
}
list = list.stream().sorted().collect(Collectors.toList());
CRC32 crc = new CRC32();
crc.update(StringUtils.join(list, "#").getBytes());
......@@ -117,6 +126,9 @@ class V2LookupDocMobile extends BaseAction {
this.readForm = business.getFormFactory().pick(readFormId);
}
}
if(StringUtils.isNotBlank(document.getPpFormId())){
this.ppForm = business.process().form().pick(document.getPpFormId());
}
}
}
}
......@@ -165,6 +177,8 @@ class V2LookupDocMobile extends BaseAction {
private String readFormId;
private String ppFormId;
private String cacheTag;
public String getFormId() {
......@@ -191,6 +205,13 @@ class V2LookupDocMobile extends BaseAction {
this.cacheTag = cacheTag;
}
public String getPpFormId() {
return ppFormId;
}
public void setPpFormId(String ppFormId) {
this.ppFormId = ppFormId;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册