diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java index b119476ffa442dad255537c58b39af930a63458b..532e6c7375945aae0ab5245536a517b86402223d 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java @@ -82,28 +82,24 @@ public abstract class JpaObject extends GsonPropertyObject implements Serializab public static final String scratchInteger_FIELDNAME = "scratchInteger"; - public static final String properties_FIELDNAME = "properties"; - public static final String JsonPropertiesValueHandler = "com.x.base.core.entity.annotation.JsonPropertiesValueHandler"; - public static final List FieldsUnmodify = ListUtils - .unmodifiableList(Arrays.asList(id_FIELDNAME, distributeFactor_FIELDNAME, createTime_FIELDNAME, - updateTime_FIELDNAME, sequence_FIELDNAME, scratchString_FIELDNAME, scratchBoolean_FIELDNAME, - scratchDate_FIELDNAME, scratchInteger_FIELDNAME, properties_FIELDNAME)); + public static final List FieldsUnmodify = ListUtils.unmodifiableList(Arrays.asList(id_FIELDNAME, + distributeFactor_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, sequence_FIELDNAME, + scratchString_FIELDNAME, scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME)); - public static final List FieldsUnmodifyExcludeId = ListUtils - .unmodifiableList(Arrays.asList(distributeFactor_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, - sequence_FIELDNAME, scratchString_FIELDNAME, scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, - scratchInteger_FIELDNAME, properties_FIELDNAME)); + public static final List FieldsUnmodifyExcludeId = ListUtils.unmodifiableList(Arrays.asList( + distributeFactor_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, sequence_FIELDNAME, + scratchString_FIELDNAME, scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME)); public static final List FieldsInvisible = ListUtils.unmodifiableList( Arrays.asList(distributeFactor_FIELDNAME, sequence_FIELDNAME, password_FIELDNAME, scratchString_FIELDNAME, - scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME, properties_FIELDNAME)); + scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME)); public static final List FieldsDefault = ListUtils .unmodifiableList(Arrays.asList(id_FIELDNAME, key_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, sequence_FIELDNAME, distributeFactor_FIELDNAME, password_FIELDNAME, scratchString_FIELDNAME, - scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME, properties_FIELDNAME)); + scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME)); @FieldDescribe("创建时间,自动生成,索引创建在约束中.") @Column(name = ColumnNamePrefix + createTime_FIELDNAME) diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java index 8a8b5ba645a3fcfb26df310125ec1e50479b2b1b..1f2b475a2a946922f862f1c43e541d16d3d2f905 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java @@ -114,10 +114,10 @@ class ActionProcessing extends BaseAction { new Thread(() -> { RespProcessingSignal resp = null; try { - resp = ThisApplication - .context().applications().getQuery(effectivePerson.getDebugger(), - x_processplatform_service_processing.class, Applications.joinQueryUri("work", - task.getWork(), "series", series, "processing", "signal"), + resp = ThisApplication.context().applications() + .getQuery(effectivePerson.getDebugger(), x_processplatform_service_processing.class, + Applications.joinQueryUri("work", task.getWork(), "series", series, "activitytoken", + this.task.getActivityToken(), "processing", "signal"), task.getJob()) .getData(RespProcessingSignal.class); } catch (Exception e) { diff --git a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Record.java b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Record.java index b495aa168eff1a9d02545516cbb098dfdd5425fc..ba30184584cf919cab22c951207f8d4a6dc06558 100644 --- a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Record.java +++ b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Record.java @@ -107,12 +107,12 @@ public class Record extends SliceJpaObject { public void onPersist() throws Exception { switch (Objects.toString(this.type)) { - case TYPE_URGE: - case TYPE_EXPIRE: - this.display = false; - break; - default: - this.display = true; + case TYPE_URGE: + case TYPE_EXPIRE: + this.display = false; + break; + default: + this.display = true; } } /* 更新运行方法 */ @@ -162,6 +162,10 @@ public class Record extends SliceJpaObject { return this.properties; } + public void setProperties(RecordProperties properties) { + this.properties = properties; + } + public static final String application_FIELDNAME = "application"; @FieldDescribe("应用.") @Column(length = JpaObject.length_id, name = ColumnNamePrefix + application_FIELDNAME) @@ -467,8 +471,6 @@ public class Record extends SliceJpaObject { this.type = type; } - - public String getApplication() { return application; } diff --git a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/wrap/WrapRoute.java b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/wrap/WrapRoute.java index af1c8454ffa8f146d8f80bf9da5360222d9c54b2..c40dc1135151d23a842c3d867287f615e3bc49d9 100644 --- a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/wrap/WrapRoute.java +++ b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/wrap/WrapRoute.java @@ -3,6 +3,7 @@ package com.x.processplatform.core.entity.element.wrap; import com.x.base.core.entity.JpaObject; import com.x.base.core.project.bean.WrapCopier; import com.x.base.core.project.bean.WrapCopierFactory; +import com.x.base.core.project.tools.ListTools; import com.x.processplatform.core.entity.element.Route; public class WrapRoute extends Route { @@ -10,8 +11,8 @@ public class WrapRoute extends Route { private static final long serialVersionUID = 6333586002792120317L; public static WrapCopier outCopier = WrapCopierFactory.wo(Route.class, WrapRoute.class, null, - JpaObject.FieldsInvisible); + ListTools.toList(JpaObject.FieldsInvisible, Route.properties_FIELDNAME)); public static WrapCopier inCopier = WrapCopierFactory.wi(WrapRoute.class, Route.class, null, - JpaObject.FieldsUnmodifyExcludeId); + ListTools.toList(JpaObject.FieldsUnmodifyExcludeId, Route.properties_FIELDNAME)); } diff --git a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionProcessingSignal.java b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionProcessingSignal.java index c2d4a72ed5d33e74ee0de0337e13902ac102f1b8..d9e810ad7bbd1cb0b647e5507502038a43d17471 100644 --- a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionProcessingSignal.java +++ b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionProcessingSignal.java @@ -16,27 +16,21 @@ class ActionProcessingSignal extends BaseAction { ActionResult execute(EffectivePerson effectivePerson, String id, String series, String activityToken) throws Exception { - Wo wo = new Wo(); - - Thread.sleep(Config.processPlatform().getProcessingSignalThreshold()); - - Optional optional = ThisApplication.getProcessingToProcessingSignalStack().find(id, series); + Wo wo = null; int loop = 0; - while ((!optional.isPresent()) && (loop++ < 20)) { - Thread.sleep(200); - optional = ThisApplication.getProcessingToProcessingSignalStack().find(id, series); + Thread.sleep(Config.processPlatform().getProcessingSignalThreshold()); + + while ((null == wo) && (loop++ < 50)) { + wo = dataReady(activityToken, ThisApplication.getProcessingToProcessingSignalStack().find(id, series)); + if (null == wo) { + Thread.sleep(200); + } } - if (optional.isPresent()) { - optional.get().forEach(o -> { - if (((null != o.getManualExecute()) || (null != o.getSplitExecute())) - && (!StringUtils.equals(activityToken, o.getActivityToken()))) { - wo.getSignalStack().add(o); - } - }); - } else { + if (null == wo) { + wo = new Wo(); wo.setSignalStack(new SignalStack()); } @@ -45,6 +39,24 @@ class ActionProcessingSignal extends BaseAction { return result; } + private Wo dataReady(String activityToken, Optional optional) { + if (!optional.isPresent()) { + return null; + } + Wo wo = new Wo(); + optional.get().forEach(o -> { + if (((null != o.getManualExecute()) || (null != o.getSplitExecute())) + && (!StringUtils.equals(activityToken, o.getActivityToken()))) { + wo.getSignalStack().add(o); + } + }); + if (wo.getSignalStack().isEmpty()) { + return null; + } else { + return wo; + } + } + public static class Wo extends ActionProcessingSignalWo { private static final long serialVersionUID = -3206075665001702872L; } diff --git a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/WorkAction.java b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/WorkAction.java index 619124d7f24c9e4b24789aba5617327ac5e16e6d..8c0096002e7545ac89df7116f8a4776514fb7586 100644 --- a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/WorkAction.java +++ b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/WorkAction.java @@ -110,7 +110,7 @@ public class WorkAction extends StandardJaxrsAction { @Path("{id}/series/{series}/activitytoken/{activityToken}/processing/signal") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) - public void processing(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + public void processingSignal(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, @JaxrsParameterDescribe("串号") @PathParam("series") String series, @JaxrsParameterDescribe("活动Token") @PathParam("activityToken") String activityToken) {