From 0888cf078640e6db9fba2b7fcaa29f449e017371 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 30 十月 2024 11:41:56 +0800
Subject: [PATCH] 属性池修改接口调整

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java
index 1030cb5..6a05746 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java
@@ -98,6 +98,7 @@
         PLActionCls pac = new PLActionCls();
         pac.name = pLActionCls.getName();
         pac.pid = pLActionCls.getPid();
+        pac.id = pLActionCls.getId();
         pac.description = pLActionCls.getDescription() == null ? "" : pLActionCls.getDescription();
         pac.creator = WebUtil.getCurrentUserId();
         pac.createTime = System.currentTimeMillis();
@@ -566,6 +567,57 @@
         }
         return BaseResult.success();
     }
+    /**
+     * 鏌ヨAction鍙傛暟鍒楄〃鏁版嵁
+     * actionOid 鍙傛暟涓婚敭
+     * @return 淇濆瓨缁撴灉
+     */
+    @Override
+    public BaseResult getPLActionParam(String actionOid) throws PLException {
+        if (StringUtils.isBlank(actionOid)){
+            throw new PLException("500", new String[]{"Action涓婚敭涓嶈兘涓虹┖锛�"});
+        }
+        PLActionParam[] paramArrays = platformClientUtil.getUIService().getPLActionParamArrayByActionId(actionOid);
+        List<PLActionParamDTO> dtos = new ArrayList<>();
+        for (PLActionParam paramArray : paramArrays) {
+            PLActionParamDTO dto = new PLActionParamDTO();
+            dto.setAction(paramArray.action);
+            dto.setOid(paramArray.oid);
+            dto.setName(paramArray.name);
+            dto.setDescription(paramArray.description);
+            dto.setDefaultValue(paramArray.defaultValue);
+            dtos.add(dto);
+        }
+        return BaseResult.dataList(dtos);
+    }
+
+    /**
+     * 鍒犻櫎鍒嗙被
+     * @param dto 鍒嗙被瀵硅薄
+     * @return 澶勭悊缁撴灉
+     * @throws PLException
+     */
+    @Override
+    public BaseResult deleteActionCls(PLActionClsDTO dto) throws PLException {
+        PLActionCls[] clses = platformClientUtil.getUIService().getPLActionClsArray();
+        // 灏嗘墍鏈夊垎绫荤埗鍒嗙被淇濆瓨
+        HashSet<String> clsPids = new HashSet<String>();
+        for (PLActionCls plActionCls : clses) {
+            clsPids.add(plActionCls.pid);
+        }
+        if (dto.getName().equals("鏈垎绫�")) {
+            throw new PLException("500", new String[]{"鏈垎绫讳笉鑳藉垹闄�!"});
+        }
+        if (clsPids.contains(dto.getId())) {
+            throw new PLException("500", new String[]{"璇ュ垎绫讳笅瀛樺湪瀛愬垎绫讳笉鑳藉垹闄わ紒\n璇峰垹闄ゆ鍒嗙被涓嬬殑瀛愬垎绫伙紒"});
+        }
+        // 鎵ц鍒犻櫎鎿嶄綔
+        String message = platformClientUtil.getUIService().deletePLActionClsById(dto.getId());
+        if (message.startsWith("0")) {
+            throw new PLException("500", new String[]{"鍒犻櫎鍒嗙被澶辫触锛�" + message.substring(1)});
+        }
+        return BaseResult.success("鍒嗙被鍒犻櫎鎴愬姛锛�" + message.substring(1));
+    }
 
     public boolean isValidPageForamt(PLActionExpDTO plActionExpDTO) throws PLException {
 

--
Gitblit v1.9.3