Browse Source

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!2036
o2null 5 years ago
parent
commit
729ae15980

+ 1 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java

@@ -40,7 +40,6 @@ import com.x.base.core.project.config.Qiyeweixin;
 import com.x.base.core.project.config.Query;
 import com.x.base.core.project.config.Query;
 import com.x.base.core.project.config.Token;
 import com.x.base.core.project.config.Token;
 import com.x.base.core.project.config.Vfs;
 import com.x.base.core.project.config.Vfs;
-import com.x.base.core.project.config.Web;
 import com.x.base.core.project.config.WorkTime;
 import com.x.base.core.project.config.WorkTime;
 import com.x.base.core.project.config.ZhengwuDingding;
 import com.x.base.core.project.config.ZhengwuDingding;
 import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.gson.XGsonBuilder;
@@ -81,7 +80,7 @@ public class CreateConfigSample {
 		classes.add(WorkTime.class);
 		classes.add(WorkTime.class);
 		classes.add(ZhengwuDingding.class);
 		classes.add(ZhengwuDingding.class);
 		classes.add(Cache.class);
 		classes.add(Cache.class);
-		classes.add(Web.class);
+		//classes.add(Web.class);
 
 
 		Collections.sort(classes, new Comparator<Class<?>>() {
 		Collections.sort(classes, new Comparator<Class<?>>() {
 			public int compare(Class<?> c1, Class<?> c2) {
 			public int compare(Class<?> c1, Class<?> c2) {

+ 4 - 4
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Config.java

@@ -1166,13 +1166,13 @@ public class Config {
 		return instance().components;
 		return instance().components;
 	}
 	}
 
 
-	public Web web;
+	public JsonObject web;
 
 
-	public static synchronized Web web() throws Exception {
+	public static synchronized JsonObject web() throws Exception {
 		if (null == instance().web) {
 		if (null == instance().web) {
-			Web obj = BaseTools.readConfigObject(PATH_CONFIG_WEB, Web.class);
+			JsonObject obj = BaseTools.readConfigObject(PATH_CONFIG_WEB, JsonObject.class);
 			if (null == obj) {
 			if (null == obj) {
-				obj = Web.defaultInstance();
+				obj = new JsonObject();
 			}
 			}
 			instance().web = obj;
 			instance().web = obj;
 		}
 		}

+ 0 - 43
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Web.java

@@ -1,43 +0,0 @@
-package com.x.base.core.project.config;
-
-import java.util.TreeMap;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-
-public class Web extends ConfigObject {
-
-	private static final long serialVersionUID = -1549522764856326338L;
-
-	public static Web defaultInstance() {
-		return new Web();
-	}
-
-	public Web() {
-
-	}
-
-	@FieldDescribe("使用Post模拟Put,Get模拟Delete的模块.")
-	private Mock mock = new Mock();
-
-	public static class Mock extends TreeMap<String, MockItem> {
-
-	}
-
-	public Mock getMock() {
-		return mock;
-	}
-
-	public void setMock(Mock mock) {
-		this.mock = mock;
-	}
-
-	public static class MockItem {
-		private MockItemObject put;
-		private MockItemObject delete;
-	}
-
-	public static class MockItemObject {
-		private String to;
-		private String append;
-	}
-}

+ 4 - 2
o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java

@@ -4,7 +4,6 @@ import java.io.File;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashMap;
@@ -33,6 +32,7 @@ import org.eclipse.jetty.webapp.WebAppContext;
 import com.alibaba.druid.support.http.StatViewServlet;
 import com.alibaba.druid.support.http.StatViewServlet;
 import com.alibaba.druid.support.http.WebStatFilter;
 import com.alibaba.druid.support.http.WebStatFilter;
 import com.google.gson.Gson;
 import com.google.gson.Gson;
+import com.google.gson.JsonElement;
 import com.x.base.core.project.x_program_center;
 import com.x.base.core.project.x_program_center;
 import com.x.base.core.project.config.Config;
 import com.x.base.core.project.config.Config;
 import com.x.base.core.project.config.WebServer;
 import com.x.base.core.project.config.WebServer;
@@ -252,7 +252,9 @@ public class WebServerTools extends JettySeverTools {
 				publicKey = new String(Base64.encodeBase64(publicKeyB));
 				publicKey = new String(Base64.encodeBase64(publicKeyB));
 				map.put("publicKey", publicKey);
 				map.put("publicKey", publicKey);
 			}
 			}
-			map.put("mock", Config.web().getMock());
+			for (Entry<String, JsonElement> en : Config.web().entrySet()) {
+				map.put(en.getKey(), en.getValue());
+			}
 			FileUtils.writeStringToFile(file, gson.toJson(map), DefaultCharset.charset);
 			FileUtils.writeStringToFile(file, gson.toJson(map), DefaultCharset.charset);
 		}
 		}
 	}
 	}

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

@@ -72,6 +72,7 @@ public class Route extends SliceJpaObject {
 	@PostLoad
 	@PostLoad
 	public void postLoad() {
 	public void postLoad() {
 		this.asyncSupported = this.getProperties().getAsyncSupported();
 		this.asyncSupported = this.getProperties().getAsyncSupported();
+		this.soleDirect = this.getProperties().getSoleDirect();
 	}
 	}
 
 
 	public Route() {
 	public Route() {
@@ -93,14 +94,26 @@ public class Route extends SliceJpaObject {
 		return asyncSupported;
 		return asyncSupported;
 	}
 	}
 
 
+	public Boolean getSoleDirect() {
+		return soleDirect;
+	}
+
 	public void setAsyncSupported(Boolean asyncSupported) {
 	public void setAsyncSupported(Boolean asyncSupported) {
 		this.asyncSupported = asyncSupported;
 		this.asyncSupported = asyncSupported;
 		this.getProperties().setAsyncSupported(asyncSupported);
 		this.getProperties().setAsyncSupported(asyncSupported);
 	}
 	}
 
 
+	public void setSoleDirect(Boolean soleDirect) {
+		this.soleDirect = soleDirect;
+		this.getProperties().setSoleDirect(soleDirect);
+	}
+
 	@Transient
 	@Transient
 	private Boolean asyncSupported;
 	private Boolean asyncSupported;
 
 
+	@Transient
+	private Boolean soleDirect;
+
 	public static final String name_FIELDNAME = "name";
 	public static final String name_FIELDNAME = "name";
 	@FieldDescribe("名称.")
 	@FieldDescribe("名称.")
 	@Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME)
 	@Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME)

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

@@ -1,13 +1,20 @@
 package com.x.processplatform.core.entity.element;
 package com.x.processplatform.core.entity.element;
 
 
+import org.apache.commons.lang3.BooleanUtils;
+
 import com.x.base.core.entity.JsonProperties;
 import com.x.base.core.entity.JsonProperties;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.annotation.FieldDescribe;
 
 
 public class RouteProperties extends JsonProperties {
 public class RouteProperties extends JsonProperties {
 
 
+	private static final long serialVersionUID = -7792270726211126577L;
+
 	@FieldDescribe("是否启用异步返回.")
 	@FieldDescribe("是否启用异步返回.")
 	private Boolean asyncSupported = true;
 	private Boolean asyncSupported = true;
 
 
+	@FieldDescribe("选择优先路由时是否直接执行路由(一票否决),默认true.")
+	private Boolean soleDirect;
+
 	public Boolean getAsyncSupported() {
 	public Boolean getAsyncSupported() {
 		return asyncSupported;
 		return asyncSupported;
 	}
 	}
@@ -16,4 +23,12 @@ public class RouteProperties extends JsonProperties {
 		this.asyncSupported = asyncSupported;
 		this.asyncSupported = asyncSupported;
 	}
 	}
 
 
+	public Boolean getSoleDirect() {
+		return BooleanUtils.isNotFalse(soleDirect);
+	}
+
+	public void setSoleDirect(Boolean soleDirect) {
+		this.soleDirect = soleDirect;
+	}
+
 }
 }

+ 3 - 2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java

@@ -453,8 +453,9 @@ public class ManualProcessor extends AbstractManualProcessor {
 		boolean passThrough = false;
 		boolean passThrough = false;
 		// 取得本环节已经处理的已办
 		// 取得本环节已经处理的已办
 		List<TaskCompleted> taskCompleteds = this.listJoinInquireTaskCompleted(aeiObjects, identities);
 		List<TaskCompleted> taskCompleteds = this.listJoinInquireTaskCompleted(aeiObjects, identities);
-		// 存在优先路由,如果有人选择了优先路由那么直接流转.
-		Route soleRoute = aeiObjects.getRoutes().stream().filter(r -> BooleanUtils.isTrue(r.getSole())).findFirst()
+		// 存在优先路由,如果有人选择了优先路由那么直接流转.需要判断是否启用了soleDirect
+		Route soleRoute = aeiObjects.getRoutes().stream()
+				.filter(r -> BooleanUtils.isTrue(r.getSole()) && BooleanUtils.isTrue(r.getSoleDirect())).findFirst()
 				.orElse(null);
 				.orElse(null);
 		if (null != soleRoute) {
 		if (null != soleRoute) {
 			TaskCompleted soleTaskCompleted = taskCompleteds.stream()
 			TaskCompleted soleTaskCompleted = taskCompleteds.stream()

+ 8 - 0
o2web/source/x_component_process_ProcessDesigner/$Process/route.html

@@ -105,6 +105,14 @@
                     <input class="editTableRadio" name="sole" text{(!$.sole)?'checked':''} type="radio" value="false"/>否
                     <input class="editTableRadio" name="sole" text{(!$.sole)?'checked':''} type="radio" value="false"/>否
                 </td>
                 </td>
             </tr>
             </tr>
+            <tr>
+                <td class="editTableTitle">立即路由:</td>
+                <td class="editTableValue" id="text{$.id}sole" >
+                    <input class="editTableRadio" name="soleDirect" text{($.soleDirect!==false)?'checked':''} type="radio" value="true"/>是
+                    <input class="editTableRadio" name="soleDirect" text{($.soleDirect===false)?'checked':''} type="radio" value="false"/>否
+                    <br><div style="color: #999999">(当选择“是”,多人处理时只要选择此路由,则立即按此路由流转文档)</div>
+                </td>
+            </tr>
 
 
             <tr>
             <tr>
                 <td class="editTableValue" id="text{$.id}passExpired" colspan="2"><b>活动超时时自动流转:</b><input class="editTableRadio" name="passExpired" text{($.passExpired)?'checked':''} type="radio" value="true"/>是
                 <td class="editTableValue" id="text{$.id}passExpired" colspan="2"><b>活动超时时自动流转:</b><input class="editTableRadio" name="passExpired" text{($.passExpired)?'checked':''} type="radio" value="true"/>是