Sfoglia il codice sorgente

1、人工活动增加充值处理人脚本
2、增加获取流程节点信息接口

o2sword 5 anni fa
parent
commit
8dfac68abe

+ 51 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGetActivity.java

@@ -0,0 +1,51 @@
+package com.x.processplatform.assemble.surface.jaxrs.process;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.exception.ExceptionEntityNotExist;
+import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.processplatform.core.entity.element.Activity;
+import com.x.processplatform.core.entity.element.ActivityType;
+
+class ActionGetActivity extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String activityType) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Activity activity = emc.find(id, ActivityType.getClassOfActivityType(ActivityType.valueOf(activityType)));
+			if (null == activity) {
+				throw new ExceptionEntityNotExist(id, Activity.class);
+			}
+			Wo wo = new Wo();
+			wo.setActivityType(activityType);
+			wo.setActivity(activity);
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wo extends GsonPropertyObject {
+
+		private String activityType;
+
+		private Activity activity;
+
+		public String getActivityType() {
+			return activityType;
+		}
+
+		public void setActivityType(String activityType) {
+			this.activityType = activityType;
+		}
+
+		public Activity getActivity() {
+			return activity;
+		}
+
+		public void setActivity(Activity activity) {
+			this.activity = activity;
+		}
+	}
+}

+ 19 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ProcessAction.java

@@ -181,4 +181,23 @@ public class ProcessAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 
+	@JaxrsMethodDescribe(value = "获取流程节点信息.", action = ActionGetActivity.class)
+	@GET
+	@Path("activity/{activity}/activityType/{activityType}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void getActivity(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+					@JaxrsParameterDescribe("流程节点标志") @PathParam("activity") String activity,
+					@JaxrsParameterDescribe("流程节点类型") @PathParam("activityType") String activityType) {
+		ActionResult<ActionGetActivity.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGetActivity().execute(effectivePerson, activity, activityType);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
 }

+ 1 - 0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Activity.java

@@ -184,5 +184,6 @@ public abstract class Activity extends SliceJpaObject {
 	public static final String allowRerouteTo_FIELDNAME = "allowRerouteTo";
 	public static final String displayLogScript_FIELDNAME = "displayLogScript";
 	public static final String displayLogScriptText_FIELDNAME = "displayLogScriptText";
+	public static final String resetRangeScriptText_FIELDNAME = "resetRangeScriptText";
 
 }

+ 14 - 0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Manual.java

@@ -589,6 +589,13 @@ public class Manual extends Activity {
 	@CheckPersist(allowEmpty = true)
 	private String displayLogScriptText;
 
+	@FieldDescribe("重置处理人脚本文本.")
+	@Lob
+	@Basic(fetch = FetchType.EAGER)
+	@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + resetRangeScriptText_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String resetRangeScriptText;
+
 	public static final String edition_FIELDNAME = "edition";
 	@FieldDescribe("版本编码.")
 	@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + edition_FIELDNAME)
@@ -1206,4 +1213,11 @@ public class Manual extends Activity {
 		this.manualUncompletedTaskToRead = manualUncompletedTaskToRead;
 	}
 
+	public String getResetRangeScriptText() {
+		return resetRangeScriptText;
+	}
+
+	public void setResetRangeScriptText(String resetRangeScriptText) {
+		this.resetRangeScriptText = resetRangeScriptText;
+	}
 }