Просмотр исходного кода

Merge branch 'cherry-pick-09be80f8' into 'wrdp'

Merge branch 'feature/批量上传附件允许修改排序号' into 'project/chinamobile-重庆移动'

See merge request o2oa/o2oa!2987
胡起 5 лет назад
Родитель
Сommit
b528b0bb32

+ 11 - 5
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionManageBatchUpload.java

@@ -28,7 +28,7 @@ class ActionManageBatchUpload extends BaseAction {
 	private static Logger logger = LoggerFactory.getLogger(ActionManageBatchUpload.class);
 	private static Logger logger = LoggerFactory.getLogger(ActionManageBatchUpload.class);
 
 
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workIds, String site, String fileName, byte[] bytes,
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workIds, String site, String fileName, byte[] bytes,
-			FormDataContentDisposition disposition, String extraParam, String person) throws Exception {
+			FormDataContentDisposition disposition, String extraParam, String person, Integer order) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			ActionResult<Wo> result = new ActionResult<>();
 			ActionResult<Wo> result = new ActionResult<>();
 			Business business = new Business(emc);
 			Business business = new Business(emc);
@@ -62,11 +62,11 @@ class ActionManageBatchUpload extends BaseAction {
                     Attachment attachment = null;
                     Attachment attachment = null;
 					Work work = emc.find(workId.trim(), Work.class);
 					Work work = emc.find(workId.trim(), Work.class);
                     if(work!=null) {
                     if(work!=null) {
-						attachment = this.concreteAttachment(work, person, site);
+						attachment = this.concreteAttachment(work, person, site, order);
                     }else{
                     }else{
                         WorkCompleted workCompleted = emc.find(workId, WorkCompleted.class);
                         WorkCompleted workCompleted = emc.find(workId, WorkCompleted.class);
                         if (null != workCompleted) {
                         if (null != workCompleted) {
-                            attachment = this.concreteAttachment(workCompleted, person, site);
+                            attachment = this.concreteAttachment(workCompleted, person, site, order);
                         }
                         }
                     }
                     }
                     if(attachment!=null){
                     if(attachment!=null){
@@ -91,7 +91,7 @@ class ActionManageBatchUpload extends BaseAction {
 		}
 		}
 	}
 	}
 
 
-	private Attachment concreteAttachment(Work work, String person, String site) throws Exception {
+	private Attachment concreteAttachment(Work work, String person, String site, Integer order) throws Exception {
 		Attachment attachment = new Attachment();
 		Attachment attachment = new Attachment();
 		attachment.setCompleted(false);
 		attachment.setCompleted(false);
 		attachment.setPerson(person);
 		attachment.setPerson(person);
@@ -106,10 +106,13 @@ class ActionManageBatchUpload extends BaseAction {
 		attachment.setActivityName(work.getActivityName());
 		attachment.setActivityName(work.getActivityName());
 		attachment.setActivityToken(work.getActivityToken());
 		attachment.setActivityToken(work.getActivityToken());
 		attachment.setActivityType(work.getActivityType());
 		attachment.setActivityType(work.getActivityType());
+		if(order!=null){
+			attachment.setOrderNumber(order);
+		}
 		return attachment;
 		return attachment;
 	}
 	}
 
 
-    private Attachment concreteAttachment(WorkCompleted workCompleted, String person, String site) throws Exception {
+    private Attachment concreteAttachment(WorkCompleted workCompleted, String person, String site, Integer order) throws Exception {
         Attachment attachment = new Attachment();
         Attachment attachment = new Attachment();
         attachment.setCompleted(true);
         attachment.setCompleted(true);
         attachment.setPerson(person);
         attachment.setPerson(person);
@@ -124,6 +127,9 @@ class ActionManageBatchUpload extends BaseAction {
         attachment.setActivityName(workCompleted.getActivityName());
         attachment.setActivityName(workCompleted.getActivityName());
         attachment.setActivityToken(workCompleted.getActivity());
         attachment.setActivityToken(workCompleted.getActivity());
         attachment.setActivityType(ActivityType.end);
         attachment.setActivityType(ActivityType.end);
+		if(order!=null){
+			attachment.setOrderNumber(order);
+		}
         return attachment;
         return attachment;
     }
     }
 
 

+ 2 - 1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java

@@ -1090,6 +1090,7 @@ public class AttachmentAction extends StandardJaxrsAction {
 			@JaxrsParameterDescribe("位置") @FormDataParam("site") String site,
 			@JaxrsParameterDescribe("位置") @FormDataParam("site") String site,
 			@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
 			@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
 			@JaxrsParameterDescribe("上传到指定用户") @FormDataParam("person") String person,
 			@JaxrsParameterDescribe("上传到指定用户") @FormDataParam("person") String person,
+			@JaxrsParameterDescribe("附件排序号") @FormDataParam("orderNumber") Integer orderNumber,
 			@JaxrsParameterDescribe("天印扩展字段") @FormDataParam("extraParam") String extraParam,
 			@JaxrsParameterDescribe("天印扩展字段") @FormDataParam("extraParam") String extraParam,
 			@FormDataParam(FILE_FIELD) final byte[] bytes,
 			@FormDataParam(FILE_FIELD) final byte[] bytes,
 			@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
 			@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
@@ -1097,7 +1098,7 @@ public class AttachmentAction extends StandardJaxrsAction {
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
 		try {
 			result = new ActionManageBatchUpload().execute(effectivePerson, workIds, site, fileName, bytes, disposition,
 			result = new ActionManageBatchUpload().execute(effectivePerson, workIds, site, fileName, bytes, disposition,
-					extraParam, person);
+					extraParam, person, orderNumber);
 		} catch (Exception e) {
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);
 			result.error(e);