Răsfoiți Sursa

修正流程中getTitle,getOpinion被截断的问题

zhourui 5 ani în urmă
părinte
comite
b7e23eaa72

+ 28 - 22
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/worklog/ActionListWithWorkOrWorkCompleted.java

@@ -38,10 +38,10 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 
 	private static Logger logger = LoggerFactory.getLogger(ActionListWithWorkOrWorkCompleted.class);
 
-	private final static String taskList_FIELDNAME = "taskList";
-	private final static String taskCompletedList_FIELDNAME = "taskCompletedList";
-	private final static String readList_FIELDNAME = "readList";
-	private final static String readCompletedList_FIELDNAME = "readCompletedList";
+	private final static String TASKLIST_FIELDNAME = "taskList";
+	private final static String TASKCOMPLETEDLIST_FIELDNAME = "taskCompletedList";
+	private final static String READLIST_FIELDNAME = "readList";
+	private final static String READCOMPLETEDLIST_FIELDNAME = "readCompletedList";
 
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
@@ -121,13 +121,13 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 				wos.add(wo);
 			}
 			ListTools.groupStick(wos, tasks, WorkLog.fromActivityToken_FIELDNAME, Task.activityToken_FIELDNAME,
-					taskList_FIELDNAME);
+					TASKLIST_FIELDNAME);
 			ListTools.groupStick(wos, taskCompleteds, WorkLog.fromActivityToken_FIELDNAME,
-					TaskCompleted.activityToken_FIELDNAME, taskCompletedList_FIELDNAME);
+					TaskCompleted.activityToken_FIELDNAME, TASKCOMPLETEDLIST_FIELDNAME);
 			ListTools.groupStick(wos, reads, WorkLog.fromActivityToken_FIELDNAME, Read.activityToken_FIELDNAME,
-					readList_FIELDNAME);
+					READLIST_FIELDNAME);
 			ListTools.groupStick(wos, readCompleteds, WorkLog.fromActivityToken_FIELDNAME,
-					ReadCompleted.activityToken_FIELDNAME, readCompletedList_FIELDNAME);
+					ReadCompleted.activityToken_FIELDNAME, READCOMPLETEDLIST_FIELDNAME);
 			result.setData(wos);
 			result.setData(wos);
 			return result;
@@ -137,9 +137,14 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 	private List<WoTask> tasks(Business business, String job) {
 		List<WoTask> os = new ArrayList<>();
 		try {
-			os = business.entityManagerContainer().fetchEqual(Task.class, WoTask.copier, WoTask.job_FIELDNAME, job)
+			// os = business.entityManagerContainer().fetchEqual(Task.class, WoTask.copier,
+			// WoTask.job_FIELDNAME, job)
+			// .stream().sorted(Comparator.comparing(Task::getStartTime,
+			// Comparator.nullsLast(Date::compareTo)))
+			// .collect(Collectors.toList());
+			os = WoTask.copier.copy(business.entityManagerContainer().listEqual(Task.class, Task.job_FIELDNAME, job)
 					.stream().sorted(Comparator.comparing(Task::getStartTime, Comparator.nullsLast(Date::compareTo)))
-					.collect(Collectors.toList());
+					.collect(Collectors.toList()));
 		} catch (Exception e) {
 			logger.error(e);
 		}
@@ -203,7 +208,7 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 		private static final long serialVersionUID = -7666329770246726197L;
 
 		static WrapCopier<WorkLog, Wo> copier = WrapCopierFactory.wo(WorkLog.class, Wo.class,
-				ListTools.toList(WorkLog.id_FIELDNAME, WorkLog.fromActivity_FIELDNAME,
+				ListTools.toList(JpaObject.id_FIELDNAME, WorkLog.fromActivity_FIELDNAME,
 						WorkLog.fromActivityType_FIELDNAME, WorkLog.fromActivityName_FIELDNAME,
 						WorkLog.fromActivityAlias_FIELDNAME, WorkLog.fromActivityToken_FIELDNAME,
 						WorkLog.fromTime_FIELDNAME, WorkLog.arrivedActivity_FIELDNAME,
@@ -282,10 +287,10 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 		private static final long serialVersionUID = 293599148568443301L;
 
 		static WrapCopier<Task, WoTask> copier = WrapCopierFactory.wo(Task.class, WoTask.class,
-				ListTools.toList(Task.id_FIELDNAME, Task.person_FIELDNAME, Task.identity_FIELDNAME, Task.unit_FIELDNAME,
-						Task.routeName_FIELDNAME, Task.opinion_FIELDNAME, Task.opinionLob_FIELDNAME,
-						Task.startTime_FIELDNAME, Task.activityName_FIELDNAME, Task.activityToken_FIELDNAME,
-						Task.empowerFromIdentity_FIELDNAME),
+				ListTools.toList(JpaObject.id_FIELDNAME, Task.person_FIELDNAME, Task.identity_FIELDNAME,
+						Task.unit_FIELDNAME, Task.routeName_FIELDNAME, Task.opinion_FIELDNAME,
+						Task.opinionLob_FIELDNAME, Task.startTime_FIELDNAME, Task.activityName_FIELDNAME,
+						Task.activityToken_FIELDNAME, Task.empowerFromIdentity_FIELDNAME, Task.properties_FIELDNAME),
 				null);
 	}
 
@@ -295,7 +300,7 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 
 		static WrapCopier<TaskCompleted, WoTaskCompleted> copier = WrapCopierFactory.wo(TaskCompleted.class,
 				WoTaskCompleted.class,
-				ListTools.toList(TaskCompleted.id_FIELDNAME, TaskCompleted.person_FIELDNAME,
+				ListTools.toList(JpaObject.id_FIELDNAME, TaskCompleted.person_FIELDNAME,
 						TaskCompleted.identity_FIELDNAME, TaskCompleted.unit_FIELDNAME,
 						TaskCompleted.routeName_FIELDNAME, TaskCompleted.opinion_FIELDNAME,
 						TaskCompleted.opinionLob_FIELDNAME, TaskCompleted.startTime_FIELDNAME,
@@ -303,7 +308,7 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 						TaskCompleted.activityToken_FIELDNAME, TaskCompleted.mediaOpinion_FIELDNAME,
 						TaskCompleted.processingType_FIELDNAME, TaskCompleted.empowerToIdentity_FIELDNAME,
 						TaskCompleted.empowerFromIdentity_FIELDNAME, TaskCompleted.joinInquire_FIELDNAME,
-						TaskCompleted.properties_FIELDNAME),
+						TaskCompleted.properties_FIELDNAME, TaskCompleted.properties_FIELDNAME),
 				null);
 	}
 
@@ -312,9 +317,10 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 		private static final long serialVersionUID = -7243683008987722267L;
 
 		static WrapCopier<Read, WoRead> copier = WrapCopierFactory.wo(Read.class, WoRead.class,
-				ListTools.toList(Read.id_FIELDNAME, Read.person_FIELDNAME, Read.identity_FIELDNAME, Read.unit_FIELDNAME,
-						Read.opinion_FIELDNAME, Read.opinionLob_FIELDNAME, Read.startTime_FIELDNAME,
-						Read.activityName_FIELDNAME, Read.activityToken_FIELDNAME),
+				ListTools.toList(JpaObject.id_FIELDNAME, Read.person_FIELDNAME, Read.identity_FIELDNAME,
+						Read.unit_FIELDNAME, Read.opinion_FIELDNAME, Read.opinionLob_FIELDNAME,
+						Read.startTime_FIELDNAME, Read.activityName_FIELDNAME, Read.activityToken_FIELDNAME,
+						Read.properties_FIELDNAME),
 				null);
 	}
 
@@ -324,11 +330,11 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 
 		static WrapCopier<ReadCompleted, WoReadCompleted> copier = WrapCopierFactory.wo(ReadCompleted.class,
 				WoReadCompleted.class,
-				ListTools.toList(ReadCompleted.id_FIELDNAME, ReadCompleted.person_FIELDNAME,
+				ListTools.toList(JpaObject.id_FIELDNAME, ReadCompleted.person_FIELDNAME,
 						ReadCompleted.identity_FIELDNAME, ReadCompleted.unit_FIELDNAME, ReadCompleted.opinion_FIELDNAME,
 						ReadCompleted.opinionLob_FIELDNAME, ReadCompleted.startTime_FIELDNAME,
 						ReadCompleted.activityName_FIELDNAME, ReadCompleted.completedTime_FIELDNAME,
-						ReadCompleted.activityToken_FIELDNAME),
+						ReadCompleted.activityToken_FIELDNAME, ReadCompleted.properties_FIELDNAME),
 				null);
 	}
 

+ 5 - 1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Draft.java

@@ -70,7 +70,11 @@ public class Draft extends SliceJpaObject {
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	public Draft() {

+ 10 - 2
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Read.java

@@ -92,7 +92,11 @@ public class Read extends SliceJpaObject implements ProjectionInterface {
 	}
 
 	public String getOpinion() {
-		return this.opinion;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getOpinion())) {
+			return this.properties.getOpinion();
+		} else {
+			return this.opinion;
+		}
 	}
 
 	public void setTitle(String title) {
@@ -101,7 +105,11 @@ public class Read extends SliceJpaObject implements ProjectionInterface {
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	public Read() {

+ 10 - 2
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/ReadCompleted.java

@@ -99,7 +99,11 @@ public class ReadCompleted extends SliceJpaObject implements ProjectionInterface
 	}
 
 	public String getOpinion() {
-		return this.opinion;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getOpinion())) {
+			return this.properties.getOpinion();
+		} else {
+			return this.opinion;
+		}
 	}
 
 	public void setTitle(String title) {
@@ -108,7 +112,11 @@ public class ReadCompleted extends SliceJpaObject implements ProjectionInterface
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	/* 更新运行方法 */

+ 5 - 1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Review.java

@@ -82,7 +82,11 @@ public class Review extends SliceJpaObject implements ProjectionInterface {
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	/* 更新运行方法 */

+ 10 - 2
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Task.java

@@ -99,7 +99,11 @@ public class Task extends SliceJpaObject implements ProjectionInterface {
 	}
 
 	public String getOpinion() {
-		return this.opinion;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getOpinion())) {
+			return this.properties.getOpinion();
+		} else {
+			return this.opinion;
+		}
 	}
 
 	public void setTitle(String title) {
@@ -108,7 +112,11 @@ public class Task extends SliceJpaObject implements ProjectionInterface {
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	/* 更新运行方法 */

+ 10 - 2
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/TaskCompleted.java

@@ -159,7 +159,11 @@ public class TaskCompleted extends SliceJpaObject implements ProjectionInterface
 	}
 
 	public String getOpinion() {
-		return this.opinion;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getOpinion())) {
+			return this.properties.getOpinion();
+		} else {
+			return this.opinion;
+		}
 	}
 
 	public void setTitle(String title) {
@@ -168,7 +172,11 @@ public class TaskCompleted extends SliceJpaObject implements ProjectionInterface
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	/* 更新运行方法 */

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

@@ -127,25 +127,17 @@ public class Work extends SliceJpaObject implements ProjectionInterface {
 		return this.properties;
 	}
 
-	// public void setTitle(String title) {
-	// this.title = title;
-	// }
-
-	// public String getTitle() {
-	// if (StringUtils.isNotEmpty(this.titleLob)) {
-	// return this.titleLob;
-	// } else {
-	// return this.title;
-	// }
-	// }
-
 	public void setTitle(String title) {
 		this.title = title;
 		this.getProperties().setTitle(title);
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	public String getWorkCreateType() {

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

@@ -144,7 +144,11 @@ public class WorkCompleted extends SliceJpaObject implements ProjectionInterface
 	}
 
 	public String getTitle() {
-		return this.title;
+		if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) {
+			return this.properties.getTitle();
+		} else {
+			return this.title;
+		}
 	}
 
 	public Boolean getMerged() {

+ 0 - 49
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AeiObjects.java

@@ -5,7 +5,6 @@ import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
 import java.util.Map.Entry;
-import java.util.TreeSet;
 import java.util.stream.Collectors;
 
 import javax.script.Bindings;
@@ -234,7 +233,6 @@ public class AeiObjects extends GsonPropertyObject {
 			}
 		}
 		return this.projections;
-
 	}
 
 	public List<Mapping> getMappings() throws Exception {
@@ -1005,29 +1003,6 @@ public class AeiObjects extends GsonPropertyObject {
 						logger.error(e);
 					}
 				});
-		// this.getCreateReads().stream()
-		// .collect(Collectors.collectingAndThen(
-		// Collectors.toCollection(
-		// () -> new TreeSet<>(Comparator.comparing(o -> o.getPerson() + o.getJob()))),
-		// ArrayList::new))
-		// .stream().forEach(o -> {
-		// Read obj;
-		// try {
-		// obj = this.getReads().stream().filter(p -> StringUtils.equals(o.getJob(),
-		// p.getJob())
-		// && StringUtils.equals(o.getPerson(),
-		// p.getPerson())).findFirst().orElse(null);
-		// if (null == obj) {
-		// this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-		// /* 创建待阅的参阅 */
-		// this.createReview(new Review(this.getWork(), o.getPerson()));
-		// } else {
-		// o.copyTo(obj, JpaObject.FieldsUnmodify);
-		// }
-		// } catch (Exception e) {
-		// logger.error(e);
-		// }
-		// });
 	}
 
 	private void commitReadUpdatePart() {
@@ -1150,30 +1125,6 @@ public class AeiObjects extends GsonPropertyObject {
 						logger.error(e);
 					}
 				});
-
-		// this.getCreateReviews().stream()
-		// .collect(Collectors.collectingAndThen(
-		// Collectors.toCollection(
-		// () -> new TreeSet<>(Comparator.comparing(o -> o.getPerson() + o.getJob()))),
-		// ArrayList::new))
-		// .stream().forEach(o -> {
-		// Review obj;
-		// try {
-		// /* 参阅唯一 */
-		// obj = this.getReviews().stream().filter(p -> StringUtils.equals(o.getJob(),
-		// p.getJob())
-		// && StringUtils.equals(o.getPerson(),
-		// p.getPerson())).findFirst().orElse(null);
-		// if (null == obj) {
-		// this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-		// } else {
-		// // 如果逻辑上相同的已阅已经存在,覆盖内容.
-		// o.copyTo(obj, JpaObject.FieldsUnmodify);
-		// }
-		// } catch (Exception e) {
-		// logger.error(e);
-		// }
-		// });
 	}
 
 	private void commitReviewUpdatePart() {