Przeglądaj źródła

html转word增加job字段用于查找红头文件

o2sword 5 lat temu
rodzic
commit
4cd90541ff

+ 20 - 8
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDocToWordWorkOrWorkCompleted.java

@@ -72,13 +72,13 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 	}
 	}
 
 
 	private byte[] workConvert(EffectivePerson effectivePerson, Wi wi, String application, String process,
 	private byte[] workConvert(EffectivePerson effectivePerson, Wi wi, String application, String process,
-			String activity) throws Exception {
+			String activity, String job) throws Exception {
 		byte[] bytes = null;
 		byte[] bytes = null;
 		Optional<WorkExtensionEvent> event = Config.processPlatform().getExtensionEvents().getWorkDocToWordEvents()
 		Optional<WorkExtensionEvent> event = Config.processPlatform().getExtensionEvents().getWorkDocToWordEvents()
 				.bind(application, process, activity);
 				.bind(application, process, activity);
 
 
 		if (event.isPresent()) {
 		if (event.isPresent()) {
-			bytes = this.workExtensionService(effectivePerson, wi.getContent(), event.get());
+			bytes = this.workExtensionService(effectivePerson, wi.getContent(), event.get(), job);
 		} else {
 		} else {
 			if (StringUtils.equals(ProcessPlatform.DOCTOWORDTYPE_CLOUD, Config.processPlatform().getDocToWordType())) {
 			if (StringUtils.equals(ProcessPlatform.DOCTOWORDTYPE_CLOUD, Config.processPlatform().getDocToWordType())) {
 				bytes = DocumentTools.docToWord(wi.getFileName(), wi.getContent());
 				bytes = DocumentTools.docToWord(wi.getFileName(), wi.getContent());
@@ -89,12 +89,13 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 		return bytes;
 		return bytes;
 	}
 	}
 
 
-	private byte[] workExtensionService(EffectivePerson effectivePerson, String content, WorkExtensionEvent event)
+	private byte[] workExtensionService(EffectivePerson effectivePerson, String content, WorkExtensionEvent event, String job)
 			throws Exception {
 			throws Exception {
 		byte[] bytes = null;
 		byte[] bytes = null;
 		Req req = new Req();
 		Req req = new Req();
 		req.setContent(content);
 		req.setContent(content);
 		req.setPerson(effectivePerson.getDistinguishedName());
 		req.setPerson(effectivePerson.getDistinguishedName());
+		req.setJob(job);
 		if (StringUtils.isNotEmpty(event.getCustom())) {
 		if (StringUtils.isNotEmpty(event.getCustom())) {
 			bytes = ThisApplication.context().applications().postQueryBinary(event.getCustom(), event.getUrl(), req);
 			bytes = ThisApplication.context().applications().postQueryBinary(event.getCustom(), event.getUrl(), req);
 		} else {
 		} else {
@@ -103,13 +104,13 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 		return bytes;
 		return bytes;
 	}
 	}
 
 
-	private byte[] workCompletedConvert(EffectivePerson effectivePerson, Wi wi, String application, String process)
+	private byte[] workCompletedConvert(EffectivePerson effectivePerson, Wi wi, String application, String process, String job)
 			throws Exception {
 			throws Exception {
 		byte[] bytes = null;
 		byte[] bytes = null;
 		Optional<WorkCompletedExtensionEvent> event = Config.processPlatform().getExtensionEvents()
 		Optional<WorkCompletedExtensionEvent> event = Config.processPlatform().getExtensionEvents()
 				.getWorkCompletedDocToWordEvents().bind(application, process);
 				.getWorkCompletedDocToWordEvents().bind(application, process);
 		if (event.isPresent()) {
 		if (event.isPresent()) {
-			bytes = this.workCompletedExtensionService(effectivePerson, wi.getContent(), event.get());
+			bytes = this.workCompletedExtensionService(effectivePerson, wi.getContent(), event.get(), job);
 		} else {
 		} else {
 			if (StringUtils.equals(ProcessPlatform.DOCTOWORDTYPE_CLOUD, Config.processPlatform().getDocToWordType())) {
 			if (StringUtils.equals(ProcessPlatform.DOCTOWORDTYPE_CLOUD, Config.processPlatform().getDocToWordType())) {
 				bytes = DocumentTools.docToWord(wi.getFileName(), wi.getContent());
 				bytes = DocumentTools.docToWord(wi.getFileName(), wi.getContent());
@@ -121,11 +122,12 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 	}
 	}
 
 
 	private byte[] workCompletedExtensionService(EffectivePerson effectivePerson, String content,
 	private byte[] workCompletedExtensionService(EffectivePerson effectivePerson, String content,
-			WorkCompletedExtensionEvent event) throws Exception {
+			WorkCompletedExtensionEvent event, String job) throws Exception {
 		byte[] bytes = null;
 		byte[] bytes = null;
 		Req req = new Req();
 		Req req = new Req();
 		req.setContent(content);
 		req.setContent(content);
 		req.setPerson(effectivePerson.getDistinguishedName());
 		req.setPerson(effectivePerson.getDistinguishedName());
+		req.setJob(job);
 		if (StringUtils.isNotEmpty(event.getCustom())) {
 		if (StringUtils.isNotEmpty(event.getCustom())) {
 			bytes = ThisApplication.context().applications().postQueryBinary(event.getCustom(), event.getUrl(), req);
 			bytes = ThisApplication.context().applications().postQueryBinary(event.getCustom(), event.getUrl(), req);
 		} else {
 		} else {
@@ -137,7 +139,7 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 	private Wo work(EffectivePerson effectivePerson, Wi wi, Work work) throws Exception {
 	private Wo work(EffectivePerson effectivePerson, Wi wi, Work work) throws Exception {
 		String person = effectivePerson.isCipher() ? work.getCreatorPerson() : effectivePerson.getDistinguishedName();
 		String person = effectivePerson.isCipher() ? work.getCreatorPerson() : effectivePerson.getDistinguishedName();
 		byte[] bytes = this.workConvert(effectivePerson, wi, work.getApplication(), work.getProcess(),
 		byte[] bytes = this.workConvert(effectivePerson, wi, work.getApplication(), work.getProcess(),
-				work.getActivity());
+				work.getActivity(), work.getJob());
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			List<Attachment> attachments = emc.listEqual(Attachment.class, Attachment.job_FIELDNAME, work.getJob());
 			List<Attachment> attachments = emc.listEqual(Attachment.class, Attachment.job_FIELDNAME, work.getJob());
 			Attachment attachment = null;
 			Attachment attachment = null;
@@ -190,7 +192,7 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 		String person = effectivePerson.isCipher() ? workCompleted.getCreatorPerson()
 		String person = effectivePerson.isCipher() ? workCompleted.getCreatorPerson()
 				: effectivePerson.getDistinguishedName();
 				: effectivePerson.getDistinguishedName();
 		byte[] bytes = this.workCompletedConvert(effectivePerson, wi, workCompleted.getApplication(),
 		byte[] bytes = this.workCompletedConvert(effectivePerson, wi, workCompleted.getApplication(),
-				workCompleted.getProcess());
+				workCompleted.getProcess(), workCompleted.getJob());
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			List<Attachment> attachments = emc.listEqual(Attachment.class, Attachment.job_FIELDNAME,
 			List<Attachment> attachments = emc.listEqual(Attachment.class, Attachment.job_FIELDNAME,
 					workCompleted.getJob());
 					workCompleted.getJob());
@@ -292,6 +294,8 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 
 
 		private String content;
 		private String content;
 
 
+		private String job;
+
 		public String getPerson() {
 		public String getPerson() {
 			return person;
 			return person;
 		}
 		}
@@ -307,6 +311,14 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
 		public void setContent(String content) {
 		public void setContent(String content) {
 			this.content = content;
 			this.content = content;
 		}
 		}
+
+		public String getJob() {
+			return job;
+		}
+
+		public void setJob(String job) {
+			this.job = job;
+		}
 	}
 	}
 
 
 }
 }