فهرست منبع

过滤zip格式的doc

zhourui 5 سال پیش
والد
کامیت
e005e888d2

+ 7 - 0
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/ActionListCalculateWithWork.java

@@ -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) {

+ 10 - 1
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/Generate.java

@@ -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());

+ 7 - 0
o2server/x_query_service_processing/src/main/webapp/describe/sources/com/x/query/service/processing/jaxrs/neural/ActionListCalculateWithWork.java

@@ -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) {

+ 10 - 1
o2server/x_query_service_processing/src/main/webapp/describe/sources/com/x/query/service/processing/jaxrs/neural/Generate.java

@@ -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());