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

已完成工作添加活动结束节点信息

zhourui 5 лет назад
Родитель
Сommit
c0975bc7ec

+ 0 - 21
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompleted.java

@@ -58,15 +58,9 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
 	private WoWorkForm work(Business business, Work work) throws Exception {
 		WoWorkForm wo = new WoWorkForm();
 		String id = work.getForm();
-		System.out.println("!!!!!!!!!!!!!!!!!!");
-		System.out.println(id);
-		System.out.println("!!!!!!!!!!!!!!!!!!");
 		if (StringUtils.isEmpty(id)) {
 			Activity activity = business.getActivity(work);
 			id = PropertyTools.getOrElse(activity, Activity.form_FIELDNAME, String.class, "");
-			System.out.println("!!!!!!!!!!!!!!!!!!22");
-			System.out.println(id);
-			System.out.println("!!!!!!!!!!!!!!!!!!22");
 		}
 		if (StringUtils.isNotEmpty(id)) {
 			Form form = business.form().pick(id);
@@ -99,21 +93,6 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
 		} else if (StringUtils.isNotEmpty(workCompleted.getFormMobileData())) {
 			wo.setData(workCompleted.getFormMobileData());
 		}
-		// WoWorkCompletedForm wo = new WoWorkCompletedForm();
-		// if (StringUtils.isNotEmpty(workCompleted.getFormData())) {
-		// wo.setData(workCompleted.getFormData());
-		// } else if (StringUtils.isNotEmpty(workCompleted.getFormMobileData())) {
-		// wo.setData(workCompleted.getFormMobileData());
-		// } else if (StringUtils.isNotEmpty(workCompleted.getForm())) {
-		// Form form = business.form().pick(workCompleted.getForm());
-		// if (null != form) {
-		// if (StringUtils.isNotEmpty(form.getData())) {
-		// wo.setData(form.getData());
-		// } else if (StringUtils.isNotEmpty(form.getMobileData())) {
-		// wo.setData(workCompleted.getFormMobileData());
-		// }
-		// }
-		// }
 		return wo;
 	}
 

+ 7 - 7
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Work.java

@@ -227,28 +227,28 @@ public class Work extends SliceJpaObject implements ProjectionInterface {
 	private String applicationAlias;
 
 	public static final String process_FIELDNAME = "process";
-	@FieldDescribe("流程ID")
+	@FieldDescribe("流程ID.")
 	@Column(length = JpaObject.length_id, name = ColumnNamePrefix + process_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + process_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
 	private String process;
 
 	public static final String processName_FIELDNAME = "processName";
-	@FieldDescribe("流程名称")
+	@FieldDescribe("流程名称.")
 	@Column(length = length_255B, name = ColumnNamePrefix + processName_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + processName_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
 	private String processName;
 
 	public static final String processAlias_FIELDNAME = "processAlias";
-	@FieldDescribe("流程别名")
+	@FieldDescribe("流程别名.")
 	@Column(length = length_255B, name = ColumnNamePrefix + processAlias_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + processAlias_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
 	private String processAlias;
 
 	public static final String activity_FIELDNAME = "activity";
-	@FieldDescribe("当前活动ID")
+	@FieldDescribe("当前活动ID.")
 	@Column(length = JpaObject.length_id, name = ColumnNamePrefix + activity_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + activity_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
@@ -263,21 +263,21 @@ public class Work extends SliceJpaObject implements ProjectionInterface {
 	private ActivityType activityType;
 
 	public static final String activityName_FIELDNAME = "activityName";
-	@FieldDescribe("活动名称")
+	@FieldDescribe("活动名称.")
 	@Column(length = length_255B, name = ColumnNamePrefix + activityName_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + activityName_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
 	private String activityName;
 
 	public static final String activityAlias_FIELDNAME = "activityAlias";
-	@FieldDescribe("活动别名")
+	@FieldDescribe("活动别名.")
 	@Column(length = length_255B, name = ColumnNamePrefix + activityAlias_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + activityAlias_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
 	private String activityAlias;
 
 	public static final String activityDescription_FIELDNAME = "activityDescription";
-	@FieldDescribe("活动名称")
+	@FieldDescribe("活动说明.")
 	@Column(length = length_255B, name = ColumnNamePrefix + activityDescription_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + activityDescription_FIELDNAME)
 	@CheckPersist(allowEmpty = true)

+ 61 - 7
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompleted.java

@@ -339,13 +339,33 @@ public class WorkCompleted extends SliceJpaObject implements ProjectionInterface
 	@CheckPersist(allowEmpty = true)
 	private Boolean allowRollback;
 
-	// public static final String data_FIELDNAME = "data";
-	// @FieldDescribe("业务数据.")
-	// @Lob
-	// @Basic(fetch = FetchType.EAGER)
-	// @Column(length = JpaObject.length_10M, name = ColumnNamePrefix + data_FIELDNAME)
-	// @CheckPersist(allowEmpty = true)
-	// private String data;
+	public static final String activity_FIELDNAME = "activity";
+	@FieldDescribe("结束节点的活动id.")
+	@Column(length = JpaObject.length_id, name = ColumnNamePrefix + activity_FIELDNAME)
+	@Index(name = TABLE + IndexNameMiddle + activity_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String activity;
+
+	public static final String activityName_FIELDNAME = "activityName";
+	@FieldDescribe("结束节点的活动名称.")
+	@Column(length = length_255B, name = ColumnNamePrefix + activityName_FIELDNAME)
+	@Index(name = TABLE + IndexNameMiddle + activityName_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String activityName;
+
+	public static final String activityAlias_FIELDNAME = "activityAlias";
+	@FieldDescribe("结束节点的活动别名.")
+	@Column(length = length_255B, name = ColumnNamePrefix + activityAlias_FIELDNAME)
+	@Index(name = TABLE + IndexNameMiddle + activityAlias_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String activityAlias;
+
+	public static final String activityDescription_FIELDNAME = "activityDescription";
+	@FieldDescribe("结束节点的活动说明.")
+	@Column(length = length_255B, name = ColumnNamePrefix + activityDescription_FIELDNAME)
+	@Index(name = TABLE + IndexNameMiddle + activityDescription_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String activityDescription;
 
 	public static final String properties_FIELDNAME = "properties";
 	@FieldDescribe("属性对象存储字段.")
@@ -1052,4 +1072,38 @@ public class WorkCompleted extends SliceJpaObject implements ProjectionInterface
 		this.properties = properties;
 	}
 
+	public String getActivity() {
+		return activity;
+	}
+
+	public void setActivity(String activity) {
+		this.activity = activity;
+	}
+
+	public String getActivityName() {
+		return activityName;
+	}
+
+	public void setActivityName(String activityName) {
+		this.activityName = activityName;
+	}
+
+	public String getActivityAlias() {
+		return activityAlias;
+	}
+
+	public void setActivityAlias(String activityAlias) {
+		this.activityAlias = activityAlias;
+	}
+
+	public String getActivityDescription() {
+		return activityDescription;
+	}
+
+	public void setActivityDescription(String activityDescription) {
+		this.activityDescription = activityDescription;
+	}
+
+	
+
 }

+ 10 - 3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/end/EndProcessor.java

@@ -36,6 +36,7 @@ public class EndProcessor extends AbstractEndProcessor {
 
 	@Override
 	protected void arrivingCommitted(AeiObjects aeiObjects, End end) throws Exception {
+		//nothing
 	}
 
 	@Override
@@ -62,7 +63,7 @@ public class EndProcessor extends AbstractEndProcessor {
 						aeiObjects.getDeleteWorkLogs().add(obj);
 					});
 		} else {
-			WorkCompleted workCompleted = this.createWorkCompleted(aeiObjects.getWork());
+			WorkCompleted workCompleted = this.createWorkCompleted(aeiObjects.getWork(), end);
 			workCompleted.setAllowRollback(end.getAllowRollback());
 			aeiObjects.getCreateWorkCompleteds().add(workCompleted);
 			aeiObjects.getTasks().stream().forEach(o -> aeiObjects.getDeleteTasks().add(o));
@@ -150,10 +151,11 @@ public class EndProcessor extends AbstractEndProcessor {
 
 	@Override
 	protected void inquiringCommitted(AeiObjects aeiObjects, End end) throws Exception {
+		// nothing
 	}
 
 	/* 根据work和data创建最终保存的workCompleted */
-	private WorkCompleted createWorkCompleted(Work work) throws Exception {
+	private WorkCompleted createWorkCompleted(Work work, End end) throws Exception {
 		Date completedTime = new Date();
 		Long duration = Config.workTime().betweenMinutes(work.getStartTime(), completedTime);
 		String formString = "";
@@ -166,6 +168,11 @@ public class EndProcessor extends AbstractEndProcessor {
 				formMobileString = form.getMobileData();
 			}
 		}
-		return new WorkCompleted(work, completedTime, duration, formString, formMobileString);
+		WorkCompleted workCompleted = new WorkCompleted(work, completedTime, duration, formString, formMobileString);
+		workCompleted.setActivity(end.getId());
+		workCompleted.setActivityAlias(end.getAlias());
+		workCompleted.setActivityDescription(end.getDescription());
+		workCompleted.setActivityName(end.getName());
+		return workCompleted;
 	}
 }