提交 533cf2fc 编写于 作者: O o2null

Merge branch '内容管理增加是否全员推送的配置' into 'develop'

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

See merge request o2oa/o2oa!352
......@@ -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;
......@@ -32,7 +33,8 @@ public class QueueSendDocumentNotify extends AbstractQueue<String> {
private static Logger logger = LoggerFactory.getLogger( QueueSendDocumentNotify.class );
private UserManagerService userManagerService = new UserManagerService();
public void execute( String documentId ) throws Exception {
@Override
public void execute(String documentId ) throws Exception {
logger.debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>start QueueSendDocumentNotify:" + documentId );
if( StringUtils.isEmpty(documentId) ) {
logger.debug("can not send publish notify , document is NULL!" );
......@@ -52,7 +54,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)) {
......
......@@ -54,8 +54,8 @@ public class DocumentPersistService {
}
if (ListTools.isNotEmpty(document.getPictureList())) {
document.setHasIndexPic(true);
if(document.getPictureList().size() > 3){
document.setIndexPics(StringUtils.join(document.getPictureList().subList(0, 2), ","));
if(document.getPictureList().size() > 4){
document.setIndexPics(StringUtils.join(document.getPictureList().subList(0, 3), ","));
}else{
document.setIndexPics(StringUtils.join(document.getPictureList(), ","));
}
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册