提交 230d8f43 编写于 作者: Z zhourui

过滤zip格式的doc

上级 35012f83
......@@ -21,6 +21,7 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.dataitem.DataItemConverter;
import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.gson.GsonPropertyObject;
......@@ -121,6 +122,12 @@ class ActionListCalculateWithWork extends BaseAction {
Attachment.job_FIELDNAME, work.getJob());
StorageMapping mapping = null;
for (Attachment o : attachments) {
if (Config.query().getCrawlWorkCompleted().getExcludeAttachment().contains(o.getName())
|| Config.query().getCrawlWorkCompleted().getExcludeSite().contains(o.getSite())
|| StringUtils.equalsIgnoreCase(o.getName(), Config.processPlatform().getDocToWordDefaultFileName())
|| StringUtils.equalsIgnoreCase(o.getSite(), Config.processPlatform().getDocToWordDefaultSite())) {
continue;
}
if (o.getLength() < MAX_ATTACHMENT_BYTE_LENGTH) {
mapping = ThisApplication.context().storageMappings().get(Attachment.class, o.getStorage());
if (null != mapping) {
......
......@@ -52,6 +52,7 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.entity.dataitem.DataItemConverter;
import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.gson.XGsonBuilder;
......@@ -441,7 +442,15 @@ public class Generate {
attachments);
}
for (Attachment att : attachmentObjects) {
/* 文件小于10M */
if (Config.query().getCrawlWorkCompleted().getExcludeAttachment().contains(att.getName())
|| Config.query().getCrawlWorkCompleted().getExcludeSite().contains(att.getSite())
|| StringUtils.equalsIgnoreCase(att.getName(),
Config.processPlatform().getDocToWordDefaultFileName())
|| StringUtils.equalsIgnoreCase(att.getSite(),
Config.processPlatform().getDocToWordDefaultSite())) {
continue;
}
// 文件小于10M
if (att.getLength() < BaseAction.MAX_ATTACHMENT_BYTE_LENGTH) {
StorageMapping mapping = ThisApplication.context().storageMappings().get(Attachment.class,
att.getStorage());
......
......@@ -21,6 +21,7 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.dataitem.DataItemConverter;
import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.gson.GsonPropertyObject;
......@@ -121,6 +122,12 @@ class ActionListCalculateWithWork extends BaseAction {
Attachment.job_FIELDNAME, work.getJob());
StorageMapping mapping = null;
for (Attachment o : attachments) {
if (Config.query().getCrawlWorkCompleted().getExcludeAttachment().contains(o.getName())
|| Config.query().getCrawlWorkCompleted().getExcludeSite().contains(o.getSite())
|| StringUtils.equalsIgnoreCase(o.getName(), Config.processPlatform().getDocToWordDefaultFileName())
|| StringUtils.equalsIgnoreCase(o.getSite(), Config.processPlatform().getDocToWordDefaultSite())) {
continue;
}
if (o.getLength() < MAX_ATTACHMENT_BYTE_LENGTH) {
mapping = ThisApplication.context().storageMappings().get(Attachment.class, o.getStorage());
if (null != mapping) {
......
......@@ -52,6 +52,7 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.entity.dataitem.DataItemConverter;
import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.gson.XGsonBuilder;
......@@ -441,7 +442,15 @@ public class Generate {
attachments);
}
for (Attachment att : attachmentObjects) {
/* 文件小于10M */
if (Config.query().getCrawlWorkCompleted().getExcludeAttachment().contains(att.getName())
|| Config.query().getCrawlWorkCompleted().getExcludeSite().contains(att.getSite())
|| StringUtils.equalsIgnoreCase(att.getName(),
Config.processPlatform().getDocToWordDefaultFileName())
|| StringUtils.equalsIgnoreCase(att.getSite(),
Config.processPlatform().getDocToWordDefaultSite())) {
continue;
}
// 文件小于10M
if (att.getLength() < BaseAction.MAX_ATTACHMENT_BYTE_LENGTH) {
StorageMapping mapping = ThisApplication.context().storageMappings().get(Attachment.class,
att.getStorage());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册