From 01bbcc8559f9b0d2ce26b9d1a6419cd228c0a5ab Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Wed, 22 Nov 2023 11:52:58 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95=E6=AD=A5=E9=AA=A4=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=A1=A8=E5=8D=95=E7=89=88=E6=9C=AC=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1030247036715008]后端-修改工单步骤获取表单版本默认场景逻辑 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1030247036715008 --- .../form/SaveFormVersionDefaultSceneApi.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/main/java/neatlogic/module/tenant/api/form/SaveFormVersionDefaultSceneApi.java b/src/main/java/neatlogic/module/tenant/api/form/SaveFormVersionDefaultSceneApi.java index 8b70896f..50497d6b 100644 --- a/src/main/java/neatlogic/module/tenant/api/form/SaveFormVersionDefaultSceneApi.java +++ b/src/main/java/neatlogic/module/tenant/api/form/SaveFormVersionDefaultSceneApi.java @@ -56,25 +56,27 @@ public class SaveFormVersionDefaultSceneApi extends PrivateApiComponentBase { if (Objects.equals(defaultSceneUuid, sceneUuid)) { return null; } - JSONArray sceneList = config.getJSONArray("sceneList"); - if (CollectionUtils.isEmpty(sceneList)) { - return null; - } - boolean flag = false; - for (int i = 0; i < sceneList.size(); i++) { - JSONObject sceneObj = sceneList.getJSONObject(i); - String uuid = sceneObj.getString("uuid"); - if (Objects.equals(uuid, sceneUuid)) { - flag = true; - break; + String mainSceneUuid = config.getString("uuid"); + if (!Objects.equals(mainSceneUuid, sceneUuid)) { + boolean flag = false; + JSONArray sceneList = config.getJSONArray("sceneList"); + if (CollectionUtils.isNotEmpty(sceneList)) { + for (int i = 0; i < sceneList.size(); i++) { + JSONObject sceneObj = sceneList.getJSONObject(i); + String uuid = sceneObj.getString("uuid"); + if (Objects.equals(uuid, sceneUuid)) { + flag = true; + break; + } + } } - } - if (!flag) { - FormVo formVo = formMapper.getFormByUuid(formVersionVo.getFormUuid()); - if (formVo == null) { - throw new FormNotFoundException(formVersionVo.getFormUuid()); + if (!flag) { + FormVo formVo = formMapper.getFormByUuid(formVersionVo.getFormUuid()); + if (formVo == null) { + throw new FormNotFoundException(formVersionVo.getFormUuid()); + } + throw new FormVersionSceneNotFoundException(formVo.getName(), String.valueOf(formVersionVo.getVersion()), sceneUuid); } - throw new FormVersionSceneNotFoundException(formVo.getName(), String.valueOf(formVersionVo.getVersion()), sceneUuid); } config.put("defaultSceneUuid", sceneUuid); formVersionVo.setFormConfig(config); -- Gitee