提交 5f581c8b 编写于 作者: O o2sword

内容管理增加是否全员推送的配置

上级 0067e099
......@@ -17,6 +17,7 @@ import com.x.cms.assemble.control.service.UserManagerService;
import com.x.cms.core.entity.AppInfo;
import com.x.cms.core.entity.CategoryInfo;
import com.x.cms.core.entity.Document;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
......@@ -52,7 +53,7 @@ public class QueueSendDocumentNotify extends AbstractQueue<String> {
persons = reviewService.listPermissionPersons(appInfo, category, document);
if (ListTools.isNotEmpty(persons)) {
//有可能是*, 一般是所有的人员标识列表
if (persons.contains("*")) {
if (persons.contains("*") && !BooleanUtils.isFalse(category.getBlankToAllNotify())) {
String topUnitName = document.getCreatorTopUnitName();
logger.debug(">>>>>document.getCreatorTopUnitName()=" + topUnitName);
if (StringUtils.equalsAnyIgnoreCase("cipher", topUnitName) || StringUtils.equalsAnyIgnoreCase("xadmin", topUnitName)) {
......
......@@ -49,10 +49,12 @@ public class CategoryInfo extends SliceJpaObject {
private static final long serialVersionUID = 3856138316794473794L;
private static final String TABLE = PersistenceProperties.CategoryInfo.table;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
......@@ -62,6 +64,7 @@ public class CategoryInfo extends SliceJpaObject {
@Column(length = length_id, name = ColumnNamePrefix + id_FIELDNAME)
private String id = createId();
@Override
public void onPersist() throws Exception {
}
/*
......@@ -279,16 +282,20 @@ public class CategoryInfo extends SliceJpaObject {
@FieldDescribe("是否允许匿名访问.")
@Column(name = ColumnNamePrefix + anonymousAble_FIELDNAME)
@CheckPersist(allowEmpty = true)
@Index(name = TABLE + IndexNameMiddle + anonymousAble_FIELDNAME)
private Boolean anonymousAble = true;
public static final String sendNotify_FIELDNAME = "sendNotify";
@FieldDescribe("发布文档后是否通知阅读者:true | false")
@Column(name = ColumnNamePrefix + sendNotify_FIELDNAME)
@CheckPersist(allowEmpty = true)
@Index(name = TABLE + IndexNameMiddle + sendNotify_FIELDNAME)
private Boolean sendNotify = true;
public static final String blankToAllNotify_FIELDNAME = "blankToAllNotify";
@FieldDescribe("文档发布范围为空时是否全员通知:true(默认)|false")
@Column(name = ColumnNamePrefix + blankToAllNotify_FIELDNAME)
@CheckPersist(allowEmpty = true)
private Boolean blankToAllNotify = true;
public static final String projection_FIELDNAME = "projection";
@FieldDescribe("字段映射配置.")
@Lob
......@@ -701,6 +708,14 @@ public class CategoryInfo extends SliceJpaObject {
this.documentType = documentType;
}
public Boolean getBlankToAllNotify() {
return blankToAllNotify;
}
public void setBlankToAllNotify(Boolean blankToAllNotify) {
this.blankToAllNotify = blankToAllNotify;
}
public List<String> getViewablePersonList() {
return viewablePersonList == null ? new ArrayList<>() : viewablePersonList;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册