From 41e225666145b45a80a14c1deb1f9fea9182d975 Mon Sep 17 00:00:00 2001 From: zhourui Date: Tue, 27 Oct 2020 12:53:34 +0800 Subject: [PATCH] mock --- o2server/configSample/node_127.0.0.1.json | 6 +- o2server/configSample/web.json | 4 + .../project/build/CreateConfigSample.java | 2 + .../x/base/core/project/config/Config.java | 26 ++ .../com/x/base/core/project/config/Web.java | 31 ++ .../x/base/core/project/http/FilterTools.java | 2 +- .../console/server/web/WebServerTools.java | 25 +- .../assemble/surface/Business.java | 26 +- .../ApplicationDictAction.java | 426 +++++++++++++++++- .../ActionListWithWorkOrWorkCompleted.java | 59 ++- .../jaxrs/attachment/AttachmentAction.java | 154 ++++++- .../surface/jaxrs/draft/DraftAction.java | 37 +- .../surface/jaxrs/keylock/KeyLockAction.java | 19 + .../surface/jaxrs/process/ActionGet.java | 17 - .../surface/jaxrs/read/ReadAction.java | 103 ++++- .../readcompleted/ReadCompletedAction.java | 41 +- .../surface/jaxrs/record/RecordAction.java | 37 ++ .../surface/jaxrs/review/ReviewAction.java | 23 +- .../surface/jaxrs/route/RouteAction.java | 19 + .../serialnumber/SerialNumberAction.java | 37 ++ .../surface/jaxrs/service/ServiceAction.java | 25 +- .../jaxrs/snap/ActionTypeAbandoned.java | 14 +- .../surface/jaxrs/snap/SnapAction.java | 18 + .../surface/jaxrs/task/TaskAction.java | 140 +++++- .../taskcompleted/TaskCompletedAction.java | 42 +- .../surface/jaxrs/work/ActionCloseCheck.java | 33 -- .../surface/jaxrs/work/WorkAction.java | 252 ++++++++++- .../workcompleted/WorkCompletedAction.java | 64 ++- .../processing/jaxrs/test/ActionTest5.java | 23 + .../processing/jaxrs/test/ActionTest52.java | 23 + .../processing/jaxrs/test/TestAction.java | 37 ++ 31 files changed, 1580 insertions(+), 185 deletions(-) create mode 100644 o2server/configSample/web.json create mode 100644 o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Web.java create mode 100644 o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest5.java create mode 100644 o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest52.java diff --git a/o2server/configSample/node_127.0.0.1.json b/o2server/configSample/node_127.0.0.1.json index 187e52826e..383c28c848 100644 --- a/o2server/configSample/node_127.0.0.1.json +++ b/o2server/configSample/node_127.0.0.1.json @@ -135,12 +135,12 @@ }, "logLevel": "warn", "dumpData": { - "enable": true, + "enable": false, "cron": "", "size": 7.0, "path": "", - "###enable": "是否启用,默认每天凌晨2点进行备份.###", - "###cron": "定时任务cron表达式###", + "###enable": "是否启用,默认禁用.###", + "###cron": "定时任务cron表达式,默认每天凌晨2点进行备份.###", "###size": "最大保留份数,超过将自动删除最久的数据.###", "###path": "备份路径###" }, diff --git a/o2server/configSample/web.json b/o2server/configSample/web.json new file mode 100644 index 0000000000..acd72bd5a2 --- /dev/null +++ b/o2server/configSample/web.json @@ -0,0 +1,4 @@ +{ + "mocks": [], + "###mocks": "使用Post模拟Put,Get模拟Delete的模块.###" +} \ No newline at end of file diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java index 4e5beb35a5..6e299825c4 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java @@ -40,6 +40,7 @@ import com.x.base.core.project.config.Qiyeweixin; import com.x.base.core.project.config.Query; import com.x.base.core.project.config.Token; 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.ZhengwuDingding; import com.x.base.core.project.gson.XGsonBuilder; @@ -80,6 +81,7 @@ public class CreateConfigSample { classes.add(WorkTime.class); classes.add(ZhengwuDingding.class); classes.add(Cache.class); + classes.add(Web.class); Collections.sort(classes, new Comparator>() { public int compare(Class c1, Class c2) { diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Config.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Config.java index 94e8d9f095..8209717088 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Config.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Config.java @@ -3,6 +3,9 @@ package com.x.base.core.project.config; import java.io.File; import java.io.FileFilter; import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -79,6 +82,7 @@ public class Config { public static final String PATH_CONFIG_CACHE = "config/cache.json"; public static final String PATH_CONFIG_COMPONENTS = "config/components.json"; public static final String PATH_CONFIG_EMAIL = "config/email.json"; + public static final String PATH_CONFIG_WEB = "config/web.json"; public static final String DIR_COMMONS = "commons"; public static final String DIR_COMMONS_TESS4J_TESSDATA = "commons/tess4j/tessdata"; @@ -116,6 +120,7 @@ public class Config { public static final String DIR_SERVERS_CENTERSERVER_WEBAPPS = "servers/centerServer/webapps"; public static final String DIR_SERVERS_CENTERSERVER_WORK = "servers/centerServer/work"; public static final String DIR_SERVERS_WEBSERVER = "servers/webServer"; + public static final String DIR_SERVERS_WEBSERVER_X_DESKTOP_RES_CONFIG = "servers/webServer/x_desktop/res/config"; public static final String DIR_STORE = "store"; public static final String DIR_STORE_JARS = "store/jars"; @@ -457,6 +462,14 @@ public class Config { return dir; } + public static Path path_servers_webServer_x_desktop_res_config(Boolean force) throws Exception { + Path path = Paths.get(base(), DIR_SERVERS_WEBSERVER_X_DESKTOP_RES_CONFIG); + if (!Files.exists(path)) { + Files.createDirectories(path); + } + return path; + } + public static synchronized void flush() { INSTANCE = null; } @@ -1136,6 +1149,19 @@ public class Config { return instance().components; } + public Web web; + + public static synchronized Web web() throws Exception { + if (null == instance().web) { + Web obj = BaseTools.readConfigObject(PATH_CONFIG_WEB, Web.class); + if (null == obj) { + obj = Web.defaultInstance(); + } + instance().web = obj; + } + return instance().web; + } + public static Object resource(String name) throws Exception { return initialContext().lookup(name); } diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Web.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Web.java new file mode 100644 index 0000000000..81e5e0200e --- /dev/null +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Web.java @@ -0,0 +1,31 @@ +package com.x.base.core.project.config; + +import java.util.ArrayList; +import java.util.List; + +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 List mocks = new ArrayList<>(); + + public List getMocks() { + return mocks; + } + + public void setMocks(List mocks) { + this.mocks = mocks; + } + +} diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/http/FilterTools.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/http/FilterTools.java index 68356ec5d2..08cabcfa39 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/http/FilterTools.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/http/FilterTools.java @@ -12,7 +12,7 @@ public class FilterTools { public static final String Access_Control_Allow_Methods = "Access-Control-Allow-Methods"; public static final String Access_Control_Allow_Methods_Value = "GET, POST, OPTIONS, PUT, DELETE, HEAD, TRACE"; public static final String Access_Control_Allow_Headers = "Access-Control-Allow-Headers"; - public static final String Access_Control_Allow_Headers_Value = "x-requested-with, x-request, x-token, c-token, Content-Type, Content-Length, x-cipher, x-client, x-debugger, Authorization"; + public static final String Access_Control_Allow_Headers_Value = "x-requested-with, x-request, x-token, c-token, Content-Type, Content-Length, x-cipher, x-client, x-debugger, Authorization, P-User-Id, P-Request-Id, P-Page-Id"; public static final String Access_Control_Allow_Credentials = "Access-Control-Allow-Credentials"; public static final String Access_Control_Expose_Headers = "Access-Control-Expose-Headers"; public static final String Access_Control_Max_Age = "Access-Control-Max-Age"; diff --git a/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java b/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java index ef66cf1ad0..3a19a9727d 100644 --- a/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java +++ b/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java @@ -1,8 +1,10 @@ package com.x.server.console.server.web; import java.io.File; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; @@ -52,21 +54,15 @@ public class WebServerTools extends JettySeverTools { public static Server start(WebServer webServer) throws Exception { - /** - * 更新x_desktop的center指向 - */ + // 创建Web.json + updateWeb(); + // 更新x_desktop的center指向 updateCenterConfigJson(); - /** - * 更新 favicon.ico - */ + // 更新 favicon.ico updateFavicon(); - /** - * 创建index.html - */ + // 创建index.html createIndexPage(); - /** - * copyDefaultHtml - */ + // copyDefaultHtml copyDefaultHtml(); QueuedThreadPool threadPool = new QueuedThreadPool(); @@ -161,6 +157,11 @@ public class WebServerTools extends JettySeverTools { } } + private static void updateWeb() throws Exception { + Path path = Config.path_servers_webServer_x_desktop_res_config(true); + Files.write(path.resolve("web.json"), XGsonBuilder.toJson(Config.web()).getBytes(StandardCharsets.UTF_8)); + } + private static void updateFavicon() throws Exception { File file = new File(Config.dir_config(), "favicon.ico"); diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java index 1850b5a7a5..9ff698b55a 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java @@ -1097,16 +1097,16 @@ public class Business { if (effectivePerson.isPerson(creatorPerson)) { return true; } - if (emc.countEqualAndEqual(TaskCompleted.class, TaskCompleted.person_FIELDNAME, - effectivePerson.getDistinguishedName(), TaskCompleted.job_FIELDNAME, job) == 0) { - if (emc.countEqualAndEqual(ReadCompleted.class, ReadCompleted.person_FIELDNAME, - effectivePerson.getDistinguishedName(), ReadCompleted.job_FIELDNAME, job) == 0) { - if (emc.countEqualAndEqual(Task.class, Task.person_FIELDNAME, effectivePerson.getDistinguishedName(), - Task.job_FIELDNAME, job) == 0) { - if (emc.countEqualAndEqual(Read.class, Read.person_FIELDNAME, - effectivePerson.getDistinguishedName(), Read.job_FIELDNAME, job) == 0) { - if (emc.countEqualAndEqual(Review.class, Review.person_FIELDNAME, - effectivePerson.getDistinguishedName(), Review.job_FIELDNAME, job) == 0) { + if (emc.countEqualAndEqual(Review.class, Review.person_FIELDNAME, effectivePerson.getDistinguishedName(), + Review.job_FIELDNAME, job) == 0) { + if (emc.countEqualAndEqual(Task.class, Task.person_FIELDNAME, effectivePerson.getDistinguishedName(), + Task.job_FIELDNAME, job) == 0) { + if (emc.countEqualAndEqual(Read.class, Read.person_FIELDNAME, effectivePerson.getDistinguishedName(), + Read.job_FIELDNAME, job) == 0) { + if (emc.countEqualAndEqual(TaskCompleted.class, TaskCompleted.person_FIELDNAME, + effectivePerson.getDistinguishedName(), TaskCompleted.job_FIELDNAME, job) == 0) { + if (emc.countEqualAndEqual(ReadCompleted.class, ReadCompleted.person_FIELDNAME, + effectivePerson.getDistinguishedName(), ReadCompleted.job_FIELDNAME, job) == 0) { Application application = application().pick(applicationId); Process process = process().pick(processId); if (!canManageApplicationOrProcess(effectivePerson, application, process)) { @@ -1230,7 +1230,8 @@ public class Business { try (ZipOutputStream zos = new ZipOutputStream(os)) { for (Map.Entry entry : filePathMap.entrySet()) { zos.putNextEntry(new ZipEntry(StringUtils.replaceEach(entry.getKey(), - new String[] { "/",":","*","?","<<",">>","|","<",">","\\" }, new String[] { "","","","","","","","","","" }))); + new String[] { "/", ":", "*", "?", "<<", ">>", "|", "<", ">", "\\" }, + new String[] { "", "", "", "", "", "", "", "", "", "" }))); StorageMapping mapping = ThisApplication.context().storageMappings().get(Attachment.class, entry.getValue().getStorage()); try (ByteArrayOutputStream os1 = new ByteArrayOutputStream()) { @@ -1244,7 +1245,8 @@ public class Business { if (otherAttMap != null) { for (Map.Entry entry : otherAttMap.entrySet()) { zos.putNextEntry(new ZipEntry(StringUtils.replaceEach(entry.getKey(), - new String[] { "/",":","*","?","<<",">>","|","<",">","\\" }, new String[] { "","","","","","","","","","" }))); + new String[] { "/", ":", "*", "?", "<<", ">>", "|", "<", ">", "\\" }, + new String[] { "", "", "", "", "", "", "", "", "", "" }))); zos.write(entry.getValue()); } } diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ApplicationDictAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ApplicationDictAction.java index ca49ab6e8e..95e768a99e 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ApplicationDictAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ApplicationDictAction.java @@ -54,26 +54,6 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } -// @JaxrsMethodDescribe(value = "更新数据字典以及数据.", action = ActionUpdate.class) -// @PUT -// @Path("{applicationDictFlag}/application/{applicationFlag}") -// @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) -// @Consumes(MediaType.APPLICATION_JSON) -// public void update(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, -// @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, -// @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, -// JsonElement jsonElement) { -// ActionResult result = new ActionResult<>(); -// EffectivePerson effectivePerson = this.effectivePerson(request); -// try { -// result = new ActionUpdate().execute(effectivePerson, applicationDictFlag, applicationFlag, jsonElement); -// } catch (Exception e) { -// logger.error(e, effectivePerson, request, null); -// result.error(e); -// } -// asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); -// } - @JaxrsMethodDescribe(value = "获取Application的数据字典列表.", action = ActionListWithApplication.class) @GET @Path("list/application/{applicationFlag}") @@ -323,7 +303,28 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据..", action = ActionUpdateDataPath1.class) + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath0.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath0MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath0().execute(applicationDictFlag, applicationFlag, path0, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + + @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据.", action = ActionUpdateDataPath1.class) @PUT @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/data") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @@ -345,6 +346,29 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath1.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath1MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath1().execute(applicationDictFlag, applicationFlag, path0, path1, + jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据.", action = ActionUpdateDataPath2.class) @PUT @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/data") @@ -368,6 +392,30 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath2.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath2MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath2().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据.", action = ActionUpdateDataPath3.class) @PUT @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/data") @@ -392,6 +440,31 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath3.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath3MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath3().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据.", action = ActionUpdateDataPath4.class) @PUT @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/data") @@ -417,6 +490,32 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath4.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath4MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath4().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据.", action = ActionUpdateDataPath5.class) @PUT @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/data") @@ -443,6 +542,33 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath5.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath5MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, + @JaxrsParameterDescribe("5级路径") @PathParam("path5") String path5, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath5().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4, path5, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据.", action = ActionUpdateDataPath6.class) @PUT @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/data") @@ -470,6 +596,34 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath6.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath6MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, + @JaxrsParameterDescribe("5级路径") @PathParam("path5") String path5, + @JaxrsParameterDescribe("6级路径") @PathParam("path6") String path6, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath6().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4, path5, path6, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典和路径更新Application下的数据字典局部数据.", action = ActionUpdateDataPath7.class) @PUT @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/{path7}/data") @@ -498,6 +652,35 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock POST to PUT.", action = ActionUpdateDataPath7.class) + @POST + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/{path7}/data/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateDataPath7MockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, + @JaxrsParameterDescribe("5级路径") @PathParam("path5") String path5, + @JaxrsParameterDescribe("6级路径") @PathParam("path6") String path6, + @JaxrsParameterDescribe("7级路径") @PathParam("path7") String path7, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateDataPath7().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4, path5, path6, path7, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径添加Application下的新的局部数据.", action = ActionCreateDataPath0.class) @POST @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/data") @@ -713,6 +896,27 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath0.class) + @GET + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath0MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath0().execute(applicationDictFlag, applicationFlag, path0); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径删除Application下的数据字典局部数据.", action = ActionDeleteDataPath1.class) @DELETE @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/data") @@ -734,6 +938,28 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath1.class) + @GET + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath1MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath1().execute(applicationDictFlag, applicationFlag, path0, path1); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径删除Application下的数据字典局部数据.", action = ActionDeleteDataPath2.class) @DELETE @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/data") @@ -756,6 +982,29 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath2.class) + @GET + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath2MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath2().execute(applicationDictFlag, applicationFlag, path0, path1, path2); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径删除Application下的数据字典局部数据.", action = ActionDeleteDataPath3.class) @DELETE @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/data") @@ -780,6 +1029,31 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath3.class) + @DELETE + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath3MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath3().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径删除Application下的数据字典局部数据.", action = ActionDeleteDataPath4.class) @DELETE @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/data") @@ -805,6 +1079,32 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath4.class) + @GET + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath4MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath4().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径删除Application下的数据字典局部数据.", action = ActionDeleteDataPath5.class) @DELETE @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/data") @@ -831,6 +1131,33 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath5.class) + @GET + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath5MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, + @JaxrsParameterDescribe("5级路径") @PathParam("path5") String path5) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath5().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4, path5); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径删除Application下的数据字典局部数据.", action = ActionDeleteDataPath6.class) @DELETE @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/data") @@ -858,6 +1185,34 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath6.class) + @GET + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath6MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, + @JaxrsParameterDescribe("5级路径") @PathParam("path5") String path5, + @JaxrsParameterDescribe("6级路径") @PathParam("path6") String path6) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath6().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4, path5, path6); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据字典ID和路径删除Application下的数据字典局部数据.", action = ActionDeleteDataPath7.class) @DELETE @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/{path7}/data") @@ -886,4 +1241,33 @@ public class ApplicationDictAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get 2 Delete.", action = ActionDeleteDataPath7.class) + @GET + @Path("{applicationDictFlag}/application/{applicationFlag}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}/{path6}/{path7}/data/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteDataPath7MockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag, + @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, + @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, + @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, + @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, + @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, + @JaxrsParameterDescribe("5级路径") @PathParam("path5") String path5, + @JaxrsParameterDescribe("6级路径") @PathParam("path6") String path6, + @JaxrsParameterDescribe("7级路径") @PathParam("path7") String path7) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteDataPath7().execute(applicationDictFlag, applicationFlag, path0, path1, path2, + path3, path4, path5, path6, path7); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionListWithWorkOrWorkCompleted.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionListWithWorkOrWorkCompleted.java index 12ac82803b..819d5058a0 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionListWithWorkOrWorkCompleted.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionListWithWorkOrWorkCompleted.java @@ -4,8 +4,11 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.Date; import java.util.List; +import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; +import org.apache.commons.lang3.BooleanUtils; + import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.container.factory.EntityManagerContainerFactory; import com.x.base.core.entity.JpaObject; @@ -19,6 +22,8 @@ import com.x.base.core.project.http.EffectivePerson; import com.x.base.core.project.logger.Logger; import com.x.base.core.project.logger.LoggerFactory; import com.x.processplatform.assemble.surface.Business; +import com.x.processplatform.assemble.surface.jaxrs.work.ActionGetWithWorkOrWorkCompleted.WoRead; +import com.x.processplatform.assemble.surface.jaxrs.work.ActionGetWithWorkOrWorkCompleted.WoTask; import com.x.processplatform.core.entity.content.Attachment; class ActionListWithWorkOrWorkCompleted extends BaseAction { @@ -31,37 +36,45 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction { Business business = new Business(emc); - if (!business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted, - new ExceptionEntityNotExist(workOrWorkCompleted))) { - throw new ExceptionAccessDenied(effectivePerson); - } + CompletableFuture _control = CompletableFuture.supplyAsync(() -> { + return business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted, + new ExceptionEntityNotExist(workOrWorkCompleted)); + }); - List identities = business.organization().identity().listWithPerson(effectivePerson); + CompletableFuture> _wos = CompletableFuture.supplyAsync(() -> { + List identities = business.organization().identity().listWithPerson(effectivePerson); - List units = business.organization().unit().listWithPerson(effectivePerson); + List units = business.organization().unit().listWithPerson(effectivePerson); - final String job = business.job().findWithWorkOrWorkCompleted(workOrWorkCompleted); + final String job = business.job().findWithWorkOrWorkCompleted(workOrWorkCompleted); - List wos = new ArrayList<>(); + List wos = new ArrayList<>(); - for (Attachment attachment : this.list(business, job)) { - Wo wo = Wo.copier.copy(attachment); - boolean canControl = this.control(attachment, effectivePerson, identities, units, business); - boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business); - boolean canRead = this.read(attachment, effectivePerson, identities, units, business); - if (canRead) { - wo.getControl().setAllowRead(true); - wo.getControl().setAllowEdit(canEdit); - wo.getControl().setAllowControl(canControl); - wos.add(wo); + for (Attachment attachment : this.list(business, job)) { + Wo wo = Wo.copier.copy(attachment); + boolean canControl = this.control(attachment, effectivePerson, identities, units, business); + boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business); + boolean canRead = this.read(attachment, effectivePerson, identities, units, business); + if (canRead) { + wo.getControl().setAllowRead(true); + wo.getControl().setAllowEdit(canEdit); + wo.getControl().setAllowControl(canControl); + wos.add(wo); + } } - } - wos = wos.stream().sorted(Comparator.comparing(Wo::getOrderNumber, Comparator.nullsLast(Integer::compareTo)) - .thenComparing(Comparator.comparing(Wo::getCreateTime, Comparator.nullsLast(Date::compareTo)))) - .collect(Collectors.toList()); + wos = wos.stream() + .sorted(Comparator.comparing(Wo::getOrderNumber, Comparator.nullsLast(Integer::compareTo)) + .thenComparing( + Comparator.comparing(Wo::getCreateTime, Comparator.nullsLast(Date::compareTo)))) + .collect(Collectors.toList()); + return wos; + }); - result.setData(wos); + if (BooleanUtils.isFalse(_control.get())) { + throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted); + } + result.setData(_wos.get()); return result; } } diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java index 886ab6cc40..6b3de245c6 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java @@ -192,6 +192,25 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionDeleteWithWork.class) + @GET + @Path("{id}/work/{workId}/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteWithWorkMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, + @JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteWithWork().execute(effectivePerson, id, workId); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "删除指定workCompleted下的附件. ", action = ActionDeleteWithWorkCompleted.class) @DELETE @Path("{id}/workcompleted/{workCompletedId}") @@ -211,6 +230,25 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionDeleteWithWorkCompleted.class) + @GET + @Path("{id}/workcompleted/{workCompletedId}/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteWithWorkCompletedMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, + @JaxrsParameterDescribe("已完成工作标识") @PathParam("workCompletedId") String workCompletedId) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDeleteWithWorkCompleted().execute(effectivePerson, id, workCompletedId); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "根据Work下载附件", action = ActionDownloadWithWork.class) @GET @Path("download/{id}/work/{workId}") @@ -501,6 +539,42 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionUpdate.class) + @POST + @Path("update/{id}/work/{workId}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.MULTIPART_FORM_DATA) + public void updateMockPost2Put(FormDataMultiPart form, @Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, + @JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId, + @JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName, + @JaxrsParameterDescribe("天印扩展字段") @FormDataParam("extraParam") String extraParam, + @FormDataParam(FILE_FIELD) byte[] bytes, + @JaxrsParameterDescribe("附件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + if (StringUtils.isEmpty(extraParam)) { + extraParam = this.request2Json(request); + } + if (bytes == null) { + Map> map = form.getFields(); + for (String key : map.keySet()) { + FormDataBodyPart part = map.get(key).get(0); + if ("application".equals(part.getMediaType().getType())) { + bytes = part.getValueAs(byte[].class); + break; + } + } + } + result = new ActionUpdate().execute(effectivePerson, id, workId, fileName, bytes, disposition, extraParam); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "更新Attachment信息", action = ActionUpdateContent.class) @PUT @Path("update/content/{id}/work/{workId}") @@ -520,6 +594,25 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionUpdateContent.class) + @POST + @Path("update/content/{id}/work/{workId}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateContentMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, + @JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdateContent().execute(effectivePerson, id, workId, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "更新附件,使用callback方式,为了与前台兼容使用POST方法.", action = ActionUpdateCallback.class) @POST @Path("update/{id}/work/{workId}/callback/{callback}") @@ -657,6 +750,25 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionEdit.class) + @POST + @Path("edit/{id}/work/{workId}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void editMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, + @JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionEdit().execute(effectivePerson, id, workId, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "设置附件排序号.", action = ActionEdit.class) @GET @Path("{id}/work/{workId}/change/ordernumber/{orderNumber}") @@ -696,6 +808,25 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionEditText.class) + @POST + @Path("edit/{id}/work/{workId}/text/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void exitTextMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, + @JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionEditText().execute(effectivePerson, id, workId, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "获取附件文本.", action = ActionGetText.class) @GET @Path("{id}/work/{workId}/text") @@ -871,7 +1002,7 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - @JaxrsMethodDescribe(value = "上传工单的表单、审批记录等html信息到缓存", action = ActionUploadWorkInfo.class) + @JaxrsMethodDescribe(value = "上传工单的表单、审批记录等html信息到缓存.", action = ActionUploadWorkInfo.class) @PUT @Path("upload/work/{workId}/save/as/{flag}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @@ -891,6 +1022,27 @@ public class AttachmentAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionUploadWorkInfo.class) + @POST + @Path("upload/work/{workId}/save/as/{flag}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void uploadWorkInfoMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, + @JaxrsParameterDescribe("Work或WorkCompleted的工作标识") @PathParam("workId") String workId, + @JaxrsParameterDescribe("另存为格式:(0)表示不转换|pdf表示转为pdf|word表示转为word") @PathParam("flag") String flag, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUploadWorkInfo().execute(effectivePerson, workId, flag, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "下载工单的表单、审批记录等html信息", action = ActionDownloadWorkInfo.class) @GET @Path("download/work/{workId}/att/{flag}") diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/draft/DraftAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/draft/DraftAction.java index 0dae4a493e..c5a32ae39f 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/draft/DraftAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/draft/DraftAction.java @@ -88,10 +88,28 @@ public class DraftAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - @PUT + @JaxrsMethodDescribe(value = "Mock Get To Delete", action = ActionDelete.class) + @GET + @Path("{id}/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("草稿标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) @JaxrsMethodDescribe(value = "保存草稿.", action = ActionSave.class) + @PUT public void save(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, JsonElement jsonElement) { ActionResult result = new ActionResult<>(); @@ -105,6 +123,23 @@ public class DraftAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + @JaxrsMethodDescribe(value = "Mock Post 2 Put.", action = ActionSave.class) + @POST + public void saveMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionSave().execute(effectivePerson, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "列示当前用户创建的草稿,分页.", action = ActionListMyPaging.class) @POST @Path("list/my/paging/{page}/size/{size}") diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/keylock/KeyLockAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/keylock/KeyLockAction.java index e63bcea1a0..0f60f52fed 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/keylock/KeyLockAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/keylock/KeyLockAction.java @@ -2,6 +2,7 @@ package com.x.processplatform.assemble.surface.jaxrs.keylock; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; +import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -44,4 +45,22 @@ public class KeyLockAction extends BaseAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionLock.class) + @POST + @Path("lock/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void lockMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionLock().execute(effectivePerson, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGet.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGet.java index 29bf1ef6f7..919a9197e6 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGet.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGet.java @@ -1,7 +1,5 @@ package com.x.processplatform.assemble.surface.jaxrs.process; -import java.util.List; - import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.container.factory.EntityManagerContainerFactory; import com.x.base.core.entity.JpaObject; @@ -11,22 +9,7 @@ import com.x.base.core.project.exception.ExceptionEntityNotExist; import com.x.base.core.project.http.ActionResult; import com.x.base.core.project.http.EffectivePerson; import com.x.processplatform.assemble.surface.Business; -import com.x.processplatform.core.entity.element.Agent; -import com.x.processplatform.core.entity.element.Begin; -import com.x.processplatform.core.entity.element.Cancel; -import com.x.processplatform.core.entity.element.Choice; -import com.x.processplatform.core.entity.element.Delay; -import com.x.processplatform.core.entity.element.Embed; -import com.x.processplatform.core.entity.element.End; -import com.x.processplatform.core.entity.element.Invoke; -import com.x.processplatform.core.entity.element.Manual; -import com.x.processplatform.core.entity.element.Merge; -import com.x.processplatform.core.entity.element.Message; -import com.x.processplatform.core.entity.element.Parallel; import com.x.processplatform.core.entity.element.Process; -import com.x.processplatform.core.entity.element.Route; -import com.x.processplatform.core.entity.element.Service; -import com.x.processplatform.core.entity.element.Split; class ActionGet extends BaseAction { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java index 481232f815..803e98fdc3 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java @@ -317,6 +317,24 @@ public class ReadAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionEdit.class) + @POST + @Path("{id}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void editMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("待阅标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionEdit().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "获取制定人员的待阅数量,没有权限限制.", action = ActionCountWithPerson.class) @GET @Path("count/{credential}") @@ -462,6 +480,24 @@ public class ReadAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "管理删除待阅.", action = ActionManageDelete.class) + @GET + @Path("{id}/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("待阅标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "管理待阅转已阅.", action = ActionManageProcessing.class) @PUT @Path("{id}/processing/manage") @@ -480,7 +516,26 @@ public class ReadAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - @JaxrsMethodDescribe(value = "重置待阅,将之前的待办转为已办,opinion:办理意见,,identityList:新的待阅人.", action = ActionManageReset.class) + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageProcessing.class) + @POST + @Path("{id}/processing/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageProcessingMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("待阅标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageProcessing().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + + @JaxrsMethodDescribe(value = "重置待阅,将之前的待办转为已办,opinion:办理意见,identityList:新的待阅人.", action = ActionManageReset.class) @PUT @Path("{id}/reset/manage") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @@ -498,6 +553,25 @@ public class ReadAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageReset.class) + @POST + @Path("{id}/reset/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageReadMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("待阅标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageReset().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "管理修改意见.", action = ActionManageOpinion.class) @PUT @Path("{id}/opinion/manage") @@ -516,6 +590,25 @@ public class ReadAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageOpinion.class) + @POST + @Path("{id}/opinion/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageOpinionMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("待阅标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageOpinion().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "列示当前用户的待阅,分页.", action = ActionListMyPaging.class) @GET @Path("list/my/paging/{page}/size/{size}") @@ -728,8 +821,8 @@ public class ReadAction extends StandardJaxrsAction { @Path("list/person/{person}/manage") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) - public void manageListWithPerson(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @JaxrsParameterDescribe("用户") @PathParam("person") String person) { + public void manageListWithPerson(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("用户") @PathParam("person") String person) { ActionResult> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { @@ -746,8 +839,8 @@ public class ReadAction extends StandardJaxrsAction { @Path("list/date/{date}/manage") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) - public void manageListWithDate(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date) { + public void manageListWithDate(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date) { ActionResult> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ReadCompletedAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ReadCompletedAction.java index 2cb9f4078f..18078608a1 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ReadCompletedAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ReadCompletedAction.java @@ -389,6 +389,24 @@ public class ReadCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete", action = ActionManageDelete.class) + @GET + @Path("{id}/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("已阅标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "管理修改意见.", action = ActionManageOpinion.class) @PUT @Path("{id}/opinion/manage") @@ -407,6 +425,25 @@ public class ReadCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageOpinion.class) + @POST + @Path("{id}/opinion/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("已阅标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageOpinion().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "列示当前用户的已阅,分页.", action = ActionListMyPaging.class) @GET @Path("list/my/paging/{page}/size/{size}") @@ -619,8 +656,8 @@ public class ReadCompletedAction extends StandardJaxrsAction { @Path("list/date/{date}/manage") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) - public void manageListWithDate(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date) { + public void manageListWithDate(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date) { ActionResult> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/RecordAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/RecordAction.java index 3d59d98832..0a3be2ce5e 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/RecordAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/RecordAction.java @@ -131,6 +131,24 @@ public class RecordAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionManageDelete.class) + @GET + @Path("{id}/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "管理根据job创建记录.", action = ActionManageCreateWithJob.class) @POST @Path("job/{job}/manage") @@ -166,4 +184,23 @@ public class RecordAction extends StandardJaxrsAction { } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageEdit.class) + @POST + @Path("{id}/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageEditMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageEdit().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/review/ReviewAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/review/ReviewAction.java index e22b5d0123..1f623fdc8d 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/review/ReviewAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/review/ReviewAction.java @@ -179,6 +179,25 @@ public class ReviewAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionManageDelete.class) + @GET + @Path("{id}/application/{applicationFlag}/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("参阅标识") @PathParam("id") String id, + @JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDelete().execute(effectivePerson, id, applicationFlag); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "列示当前用户创建的工作的参阅,分页.", action = V2ListCreatePaging.class) @POST @Path("v2/list/create/paging/{page}/size/{size}") @@ -335,8 +354,8 @@ public class ReviewAction extends StandardJaxrsAction { @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void V2ManageListPaging(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, - @JaxrsParameterDescribe("分页") @PathParam("page") Integer page, - @JaxrsParameterDescribe("每页数量") @PathParam("size") Integer size, JsonElement jsonElement) { + @JaxrsParameterDescribe("分页") @PathParam("page") Integer page, + @JaxrsParameterDescribe("每页数量") @PathParam("size") Integer size, JsonElement jsonElement) { ActionResult> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/route/RouteAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/route/RouteAction.java index 7d4d738573..ed9e38e3b9 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/route/RouteAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/route/RouteAction.java @@ -5,6 +5,7 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.GET; +import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; @@ -68,6 +69,24 @@ public class RouteAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionList.class) + @POST + @Path("list/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void listMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + JsonElement jsonElement) { + ActionResult> result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionList().execute(effectivePerson, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "获取选择人员配置.", action = ActionGetSelectConfig.class) @GET @Path("{id}/selectconfig") diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/SerialNumberAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/SerialNumberAction.java index 25103d0a30..fab9fe8ccd 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/SerialNumberAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/SerialNumberAction.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; +import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; @@ -87,6 +88,24 @@ public class SerialNumberAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionUpdate.class) + @POST + @Path("{id}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void updateMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionUpdate().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "删除SerialNumber内容.", action = ActionRemove.class) @DELETE @Path("{id}") @@ -105,4 +124,22 @@ public class SerialNumberAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionRemove.class) + @GET + @Path("{id}/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionRemove().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/service/ServiceAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/service/ServiceAction.java index 28abd94e55..4876edfa98 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/service/ServiceAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/service/ServiceAction.java @@ -2,6 +2,7 @@ package com.x.processplatform.assemble.surface.jaxrs.service; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; +import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; @@ -29,19 +30,37 @@ public class ServiceAction extends StandardJaxrsAction { private static Logger logger = LoggerFactory.getLogger(ServiceAction.class); - @JaxrsMethodDescribe(value = "访问服务", action = ActionTouch.class) + @JaxrsMethodDescribe(value = "访问服务.", action = ActionTouch.class) @PUT @Path("work/{id}/touch") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) - public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + public void touch(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) { ActionResult result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionTouch().execute(effectivePerson, id, jsonElement); } catch (Exception e) { - logger.error(e, effectivePerson, request, null); + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionTouch.class) + @POST + @Path("work/{id}/touch/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void touchMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionTouch().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/ActionTypeAbandoned.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/ActionTypeAbandoned.java index e70296710a..f36bb6d30c 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/ActionTypeAbandoned.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/ActionTypeAbandoned.java @@ -15,8 +15,8 @@ import com.x.base.core.project.logger.Logger; import com.x.base.core.project.logger.LoggerFactory; import com.x.processplatform.assemble.surface.Business; import com.x.processplatform.assemble.surface.ThisApplication; +import com.x.processplatform.assemble.surface.WorkControl; import com.x.processplatform.core.entity.content.Work; -import com.x.processplatform.core.entity.element.Activity; class ActionTypeAbandoned extends BaseAction { @@ -30,14 +30,11 @@ class ActionTypeAbandoned extends BaseAction { if (null == work) { throw new ExceptionEntityNotExist(workId, Work.class); } - job = work.getJob(); - Activity activity = business.getActivity(work.getActivity(), work.getActivityType()); - if (BooleanUtils.isNotTrue( - business.canManageApplicationOrProcess(effectivePerson, work.getApplication(), work.getProcess())) - && ((!business.editable(effectivePerson, work)) - || (BooleanUtils.isNotTrue(activity.getAllowSuspend())))) { + WoControl control = business.getControl(effectivePerson, work, WoControl.class); + if (BooleanUtils.isNotTrue(control.getAllowDelete())) { throw new ExceptionAccessDenied(effectivePerson, work); } + job = work.getJob(); } Wo wo = ThisApplication.context().applications() @@ -56,4 +53,7 @@ class ActionTypeAbandoned extends BaseAction { } + public static class WoControl extends WorkControl { + } + } diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java index a570a41d55..b3196a40cd 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java @@ -105,6 +105,24 @@ public class SnapAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "删除快照", action = ActionDelete.class) + @GET + @Path("{id}/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "恢复快照", action = ActionRestore.class) @GET @Path("{id}/restore") diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java index 01188dfd3d..a557cfc3e6 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java @@ -357,7 +357,25 @@ public class TaskAction extends StandardJaxrsAction { @Path("{id}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) - public void update(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + public void edit(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionEdit().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionEdit.class) + @POST + @Path("{id}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void editMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement jsonElement) { ActionResult result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); @@ -388,6 +406,24 @@ public class TaskAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "重置待办,将之前的待办转为已办,opinion:办理意见,routeName:选择路由,identityList:新的办理人.", action = ActionReset.class) + @POST + @Path("{id}/reset/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void resetMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionReset().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "预计下一活动处理状态及处理人.", action = ActionWill.class) @GET @Path("{id}/will") @@ -478,6 +514,24 @@ public class TaskAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionManageDelete.class) + @GET + @Path("{id}/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "待办转已办.", action = ActionManageProcessing.class) @PUT @Path("{id}/processing/manage") @@ -496,6 +550,25 @@ public class TaskAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageProcessing.class) + @POST + @Path("{id}/processing/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageProcessingMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("待办标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageProcessing().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "管理修改意见.", action = ActionManageOpinion.class) @PUT @Path("{id}/opinion/manage") @@ -514,6 +587,25 @@ public class TaskAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageOpinion.class) + @POST + @Path("{id}/opinion/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageOpinionMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("待办标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageOpinion().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "重置待办,将之前的待办转为已办,opinion:办理意见,routeName:选择路由,identityList:新的办理人.", action = ActionManageReset.class) @PUT @Path("{id}/reset/manage") @@ -532,6 +624,25 @@ public class TaskAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "重置待办,将之前的待办转为已办,opinion:办理意见,routeName:选择路由,identityList:新的办理人.", action = ActionManageReset.class) + @POST + @Path("{id}/reset/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageResetMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageReset().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "列示当前用户的待办,分页.", action = ActionListMyPaging.class) @GET @Path("list/my/paging/{page}/size/{size}") @@ -833,6 +944,24 @@ public class TaskAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = V2Reset.class) + @POST + @Path("v2/{id}/reset/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void V2ResetMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new V2Reset().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "待办提醒,message类型:task_press.", action = ActionManagePress.class) @GET @Path("{id}/press/manage") @@ -856,8 +985,8 @@ public class TaskAction extends StandardJaxrsAction { @Path("list/person/{person}/manage") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) - public void manageListWithPerson(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @JaxrsParameterDescribe("用户") @PathParam("person") String person) { + public void manageListWithPerson(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("用户") @PathParam("person") String person) { ActionResult> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { @@ -875,8 +1004,9 @@ public class TaskAction extends StandardJaxrsAction { @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void manageListWithDateHour(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date, - @JaxrsParameterDescribe("小时(0-23)") @PathParam("hour") Integer hour) { + @Context HttpServletRequest request, + @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date, + @JaxrsParameterDescribe("小时(0-23)") @PathParam("hour") Integer hour) { ActionResult> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/TaskCompletedAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/TaskCompletedAction.java index 1cb2b8f6fc..541349d784 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/TaskCompletedAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/TaskCompletedAction.java @@ -407,6 +407,24 @@ public class TaskCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionManageDelete.class) + @GET + @Path("{id}/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "管理修改意见.", action = ActionManageOpinion.class) @PUT @Path("{id}/opinion/manage") @@ -425,6 +443,25 @@ public class TaskCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionManageOpinion.class) + @POST + @Path("{id}/opinion/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageOpinionMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("已办标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageOpinion().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "提醒.", action = ActionPress.class) @GET @Path("press/work/{work}") @@ -674,8 +711,9 @@ public class TaskCompletedAction extends StandardJaxrsAction { @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void manageListWithDateHour(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date, - @JaxrsParameterDescribe("小时(0-23)") @PathParam("hour") Integer hour) { + @Context HttpServletRequest request, + @JaxrsParameterDescribe("日期(如:2020-09-11)") @PathParam("date") String date, + @JaxrsParameterDescribe("小时(0-23)") @PathParam("hour") Integer hour) { ActionResult> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java index 568443b8b2..38b79a4932 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java @@ -62,35 +62,10 @@ class ActionCloseCheck extends BaseAction { return wo; } -// private WoGrabRelease grabRelease(Business business, EffectivePerson effectivePerson, Work work) throws Exception { -// WoGrabRelease wo = new WoGrabRelease(); -// if ((null != work) && (Objects.equals(work.getActivityType(), ActivityType.manual))) { -// Manual manual = business.manual().pick(work.getActivity()); -// if ((null != manual) && Objects.equals(ManualMode.grab, manual.getManualMode())) { -// if (ListTools.isEmpty(work.getManualTaskIdentityList()) -// || (work.getManualTaskIdentityList().size() == 1)) { -// business.entityManagerContainer().beginTransaction(Work.class); -// work.getManualTaskIdentityList().clear(); -// business.entityManagerContainer().commit(); -// ThisApplication.context().applications().putQuery(effectivePerson.getDebugger(), -// x_processplatform_service_processing.class, -// Applications.joinQueryUri("work", work.getId(), "processing"), null); -// List tasks = business.entityManagerContainer().fetchEqual(Task.class, -// ListTools.toList(Task.identity_FIELDNAME), Task.work_FIELDNAME, work.getId()); -// wo.setRelease(true); -// wo.setTaskList(tasks); -// } -// } -// } -// return wo; -// } - public static class Wo extends GsonPropertyObject { @FieldDescribe("检查删除草稿结果") private WoDraft draft; -// @FieldDescribe("检查抢办释放结果") -// private WoGrabRelease grabRelease; public WoDraft getDraft() { return draft; @@ -100,14 +75,6 @@ class ActionCloseCheck extends BaseAction { this.draft = draft; } -// public WoGrabRelease getGrabRelease() { -// return grabRelease; -// } -// -// public void setGrabRelease(WoGrabRelease grabRelease) { -// this.grabRelease = grabRelease; -// } - } public static class WoDraft extends WrapBoolean { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java index bcdd03961b..f632517d0b 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java @@ -1,6 +1,5 @@ package com.x.processplatform.assemble.surface.jaxrs.work; -import java.util.Date; import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -201,9 +200,27 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionProcessing.class) @POST + @Path("{id}/processing/mockpost2put") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) + public void processingMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionProcessing().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + @POST @Path("process/{processFlag}") @JaxrsMethodDescribe(value = "创建工作(创建启动版本的流程).", action = ActionCreate.class) public void create(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @@ -219,10 +236,10 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - @POST @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) @Path("process/{processFlag}/force") + @POST @JaxrsMethodDescribe(value = "创建工作(强制创建存在的流程).", action = ActionCreateForce.class) public void createForce(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("流程标识") @PathParam("processFlag") String processFlag, JsonElement jsonElement) { @@ -297,6 +314,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionDelete.class) + @GET + @Path("{id}/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void deleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "完成工作关闭时候的检查,1.检查是否要删除处于草稿状态的工作,没有保存过任何数据将被认为是草稿.2.检查是否需要释放抢办.", action = ActionCloseCheck.class) @GET @Path("{id}/close/check") @@ -319,7 +354,7 @@ public class WorkAction extends StandardJaxrsAction { @POST @Path("{id}/close/check") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) - // @Consumes(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) public void closeCheckPost(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id) { ActionResult result = new ActionResult<>(); @@ -600,6 +635,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionRetract.class) + @POST + @Path("{id}/retract/mockPost2Put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void retractMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionRetract().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "将工作调度。", action = ActionReroute.class) @PUT @Path("{id}/reroute/activity/{activityId}/activitytype/{activityType}") @@ -621,6 +674,27 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "将工作调度。", action = ActionReroute.class) + @POST + @Path("{id}/reroute/activity/{activityId}/activitytype/{activityType}/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void rerouteMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, + @JaxrsParameterDescribe("活动标识") @PathParam("activityId") String activityId, + @JaxrsParameterDescribe("活动类型") @PathParam("activityType") ActivityType activityType, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionReroute().execute(effectivePerson, id, activityId, activityType, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "增加一个会签分支", action = ActionAddSplit.class) @PUT @Path("{id}/add/split") @@ -639,6 +713,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionAddSplit.class) + @POST + @Path("{id}/add/split/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void addSplitMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult> result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionAddSplit().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "回滚工作到指定的workLog", action = ActionRollback.class) @PUT @Path("{id}/rollback") @@ -657,6 +749,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionRollback.class) + @POST + @Path("{id}/rollback/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void rollbackMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionRollback().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "列示当前用户创建的工作,可以根据条件过滤,分页.", action = ActionListMyPaging.class) @POST @Path("list/my/paging/{page}/size/{size}") @@ -825,6 +935,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionManageDeleteSingleWork.class) + @GET + @Path("{id}/single/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteSingleWorkMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id) { + ActionResult> result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDeleteSingleWork().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "删除所有相关联的工作.", action = ActionManageDeleteRelativeWork.class) @DELETE @Path("{id}/relative/manage") @@ -843,6 +971,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionManageDeleteRelativeWork.class) + @GET + @Path("{id}/relative/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteRelativeWorkMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id) { + ActionResult> result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDeleteRelativeWork().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "获取用于过滤的可选属性值", action = ActionManageFilterAttribute.class) @GET @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @@ -942,6 +1088,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = V2Reroute.class) + @POST + @Path("v2/{id}/reroute/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void V2RerouteMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new V2Reroute().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "V2_工作召回。", action = V2Retract.class) @PUT @Path("v2/{id}/retract") @@ -960,6 +1124,24 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = V2Retract.class) + @POST + @Path("v2/{id}/retract/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void V2RetractMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new V2Retract().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "V2_回滚工作.", action = V2Rollback.class) @PUT @Path("v2/{id}/rollback") @@ -978,6 +1160,25 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = V2Rollback.class) + @POST + @Path("v2/{id}/rollback/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void V2RollbackMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new V2Rollback().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "V2_增加一个会签分支", action = ActionAddSplit.class) @PUT @Path("v2/{id}/add/split") @@ -996,6 +1197,25 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionAddSplit.class) + @POST + @Path("v2/{id}/add/split/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void V2AddSplitMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, + JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new V2AddSplit().execute(effectivePerson, id, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "管理员替代person操作工作召回。", action = V2ManageRetract.class) @PUT @Path("v2/{id}/person/{person}/retract/manage") @@ -1015,6 +1235,25 @@ public class WorkAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = V2ManageRetract.class) + @POST + @Path("v2/{id}/person/{person}/retract/manage/mockpost2put") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void V2ManageRetractMockPost2Put(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("id") String id, + @JaxrsParameterDescribe("召回工作已办人员(根据流转记录确认)") @PathParam("person") String person, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new V2ManageRetract().execute(effectivePerson, id, person); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "V2_根据Work或workCompleted取得内容.", action = V2GetWorkOrWorkCompleted.class) @GET @Path("v2/workorworkcompleted/{workOrWorkCompleted}") @@ -1023,22 +1262,15 @@ public class WorkAction extends StandardJaxrsAction { public void V2GetWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted) { - // Date s = new Date(); ActionResult result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); - // System.out.println("!!!!!!!!!!!!!!!!V2GetWorkOrWorkCompleted1:" + ((new - // Date()).getTime() - s.getTime())); try { result = new V2GetWorkOrWorkCompleted().execute(effectivePerson, workOrWorkCompleted); - // System.out.println("!!!!!!!!!!!!!!!!V2GetWorkOrWorkCompleted2:" + ((new - // Date()).getTime() - s.getTime())); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); - // System.out.println("!!!!!!!!!!!!!!!!V2GetWorkOrWorkCompleted3:" + ((new - // Date()).getTime() - s.getTime())); } } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/WorkCompletedAction.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/WorkCompletedAction.java index 4a20934f88..1e7eeeadb7 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/WorkCompletedAction.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/WorkCompletedAction.java @@ -305,28 +305,6 @@ public class WorkCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - // @JaxrsMethodDescribe(value = "更新WorkCompleted中的extension字段.", action = - // ActionUpdateExtension.class) - // @PUT - // @Path("update/extension") - // @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) - // @Consumes(MediaType.APPLICATION_JSON) - // public void updateExtension(@Suspended final AsyncResponse asyncResponse, - // @Context HttpServletRequest request, - // @JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement - // jsonElement) { - // ActionResult result = new ActionResult<>(); - // EffectivePerson effectivePerson = this.effectivePerson(request); - // try { - // result = new ActionUpdateExtension().execute(effectivePerson, id, - // jsonElement); - // } catch (Exception e) { - // logger.error(e, effectivePerson, request, jsonElement); - // result.error(e); - // } - // asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); - // } - @JaxrsMethodDescribe(value = "获取工作内容.", action = ActionManageGet.class) @GET @Path("{id}/manage") @@ -441,6 +419,24 @@ public class WorkCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Get To Delete.", action = ActionManageDelete.class) + @GET + @Path("{id}/delete/manage/mockget2delete") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void manageDeleteMockGet2Delete(@Suspended final AsyncResponse asyncResponse, + @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id) { + ActionResult> result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionManageDelete().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "获取用于过滤的可选属性值", action = ActionManageFilterAttribute.class) @GET @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @@ -501,10 +497,10 @@ public class WorkCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - @POST @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) @Path("process/{processFlag}") + @POST @JaxrsMethodDescribe(value = "创建已完成工作.", action = ActionCreate.class) public void create(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("流程标识") @PathParam("processFlag") String processFlag, JsonElement jsonElement) { @@ -519,11 +515,11 @@ public class WorkCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } - @PUT + @JaxrsMethodDescribe(value = "完成工作重新回滚.", action = ActionRollback.class) @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) @Path("{flag}/rollback") - @JaxrsMethodDescribe(value = "完成工作重新回滚.", action = ActionRollback.class) + @PUT public void rollback(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("流程标识") @PathParam("flag") String flag, JsonElement jsonElement) { ActionResult result = new ActionResult<>(); @@ -537,6 +533,24 @@ public class WorkCompletedAction extends StandardJaxrsAction { asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + @JaxrsMethodDescribe(value = "Mock Post To Put.", action = ActionRollback.class) + @Path("{flag}/rollback/mockpost2put") + @POST + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void rollbackMockPost2Put(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("流程标识") @PathParam("flag") String flag, JsonElement jsonElement) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionRollback().execute(effectivePerson, flag, jsonElement); + } catch (Exception e) { + logger.error(e, effectivePerson, request, jsonElement); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + @JaxrsMethodDescribe(value = "按条件对WorkCompleted分页显示.", action = ActionManageListFilterPaging.class) @POST @Path("list/filter/{page}/size/{size}/manage") diff --git a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest5.java b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest5.java new file mode 100644 index 0000000000..5d8d0e0ef1 --- /dev/null +++ b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest5.java @@ -0,0 +1,23 @@ +package com.x.processplatform.service.processing.jaxrs.test; + +import com.x.base.core.project.http.ActionResult; +import com.x.base.core.project.http.EffectivePerson; +import com.x.base.core.project.jaxrs.WrapBoolean; +import com.x.processplatform.service.processing.ThisApplication; + +class ActionTest5 extends BaseAction { + + ActionResult execute(EffectivePerson effectivePerson, String id) throws Exception { + ActionResult result = new ActionResult<>(); + Wo wo = new Wo(); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + System.out.println("Action5_id:" + id); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + result.setData(wo); + return result; + } + + public static class Wo extends WrapBoolean { + + } +} \ No newline at end of file diff --git a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest52.java b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest52.java new file mode 100644 index 0000000000..5aca96a778 --- /dev/null +++ b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest52.java @@ -0,0 +1,23 @@ +package com.x.processplatform.service.processing.jaxrs.test; + +import com.x.base.core.project.http.ActionResult; +import com.x.base.core.project.http.EffectivePerson; +import com.x.base.core.project.jaxrs.WrapBoolean; +import com.x.processplatform.service.processing.ThisApplication; + +class ActionTest52 extends BaseAction { + + ActionResult execute(EffectivePerson effectivePerson) throws Exception { + ActionResult result = new ActionResult<>(); + Wo wo = new Wo(); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + System.out.println("Action52"); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + result.setData(wo); + return result; + } + + public static class Wo extends WrapBoolean { + + } +} \ No newline at end of file diff --git a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java index 365b0b815e..bb4043128a 100644 --- a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java +++ b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.container.AsyncResponse; import javax.ws.rs.container.Suspended; @@ -14,6 +15,7 @@ import javax.ws.rs.core.MediaType; import com.x.base.core.project.annotation.JaxrsDescribe; import com.x.base.core.project.annotation.JaxrsMethodDescribe; +import com.x.base.core.project.annotation.JaxrsParameterDescribe; import com.x.base.core.project.http.ActionResult; import com.x.base.core.project.http.EffectivePerson; import com.x.base.core.project.http.HttpMediaType; @@ -231,4 +233,39 @@ public class TestAction extends StandardJaxrsAction { } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); } + + @JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class) + @GET + @Path("test5/{id}") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void test5(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, + @JaxrsParameterDescribe("标识") @PathParam("id") String id) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionTest5().execute(effectivePerson, id); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } + + @JaxrsMethodDescribe(value = "test1.", action = ActionTest52.class) + @GET + @Path("test5/123") + @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) + @Consumes(MediaType.APPLICATION_JSON) + public void test5(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) { + ActionResult result = new ActionResult<>(); + EffectivePerson effectivePerson = this.effectivePerson(request); + try { + result = new ActionTest52().execute(effectivePerson); + } catch (Exception e) { + logger.error(e, effectivePerson, request, null); + result.error(e); + } + asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); + } } \ No newline at end of file -- GitLab