From 0b393384a97d3f9133cc34d325c9daa0c19f239a Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期四, 29 八月 2024 15:45:44 +0800
Subject: [PATCH] 1、增加链接类型查询模板设置排序的下拉框数据接口。 2、保存Action参数数据接口。 3、修改Action参数数据接口。 4、删除Action参数数据接口。
---
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java | 37 +++++++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java | 23 +++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java | 24 ++++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java | 9 +
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java | 72 +++++++++++++-
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java | 55 ++++++++++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java | 26 +++++
7 files changed, 233 insertions(+), 13 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java
new file mode 100644
index 0000000..070f307
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java
@@ -0,0 +1,37 @@
+package com.vci.dto;
+
+import lombok.Data;
+
+/**
+ * Action鍙傛暟鍒楄〃浼犺緭瀵硅薄
+ * @author yuxc
+ * @date 2024/8/28 16:40
+ */
+@Data
+public class PLActionParamDTO implements java.io.Serializable{
+
+ /**
+ * 绂佹淇敼杩欎釜鍊�
+ */
+ private static final long serialVersionUID = 2009350578651813260L;
+ /**
+ * 涓婚敭
+ */
+ public String oid;
+ /**
+ * 鍙傛暟鍚嶇О
+ */
+ public String name;
+ /**
+ * 榛樿鍊�
+ */
+ public String defaultValue;
+ /**
+ * 鎻愮ず淇℃伅
+ */
+ public String description;
+ /**
+ * 鐖禷ction鐨処D
+ */
+ public String action;
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java
index fa65c57..56ff805 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java
@@ -1,10 +1,7 @@
package com.vci.web.controller;
import com.vci.corba.common.PLException;
-import com.vci.dto.PLActionClsDTO;
-import com.vci.dto.PLActionDTO;
-import com.vci.dto.PLActionExpDTO;
-import com.vci.dto.PLActionQueryDTO;
+import com.vci.dto.*;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.VciBaseUtil;
@@ -185,6 +182,56 @@
osActionServiceI.exportAction(plActionExpDTO, response);
}catch (Throwable e) {
throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
+ }
}
+
+ /**
+ * 淇濆瓨Action鍙傛暟鏁版嵁
+ * dto action浼犺緭瀵硅薄
+ * @return 淇濆瓨缁撴灉
+ */
+ @PostMapping("/savePLActionParam")
+ public BaseResult savePLActionParam(@RequestBody PLActionParamDTO dto){
+ try {
+ return osActionServiceI.savePLActionParam(dto);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 淇敼Action鍙傛暟鏁版嵁
+ * dto action浼犺緭瀵硅薄
+ * @return 淇濆瓨缁撴灉
+ */
+ @PostMapping("/updatePLActionParam")
+ public BaseResult updatePLActionParam(@RequestBody PLActionParamDTO dto){
+ try {
+ return osActionServiceI.updatePLActionParam(dto);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+ /**
+ * 鍒犻櫎Action鍙傛暟鏁版嵁
+ * oid 鍙傛暟涓婚敭
+ * @return 淇濆瓨缁撴灉
+ */
+ @DeleteMapping("/deletePLActionParam")
+ public BaseResult deletePLActionParam(String oid){
+ try {
+ return osActionServiceI.deletePLActionParam(oid);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
}
}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
index cb3bc49..9bbe900 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
@@ -279,4 +279,28 @@
throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
}
}
+
+
+ /**
+ * 鑾峰彇璁剧疆鎺掑簭瀛楁鐨勬帓搴忓瓧娈�
+ * @param linkType 閾炬帴绫诲瀷鐨勭紪鍙�
+ * @param btmType 涓氬姟绫诲瀷鐨勭紪鍙�
+ * @param direction 姝�/鍙嶅悜
+ * @return 灞炴�х殑淇℃伅
+ */
+ @GetMapping("/getAllOrderbyAttributeByLink")
+ public BaseResult<List<String>> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction){
+
+ try {
+ List<String> osLinkTypeAttributes = linkTypeService.getAllOrderbyAttributeByLink(linkType, btmType, direction);
+ return BaseResult.dataList(osLinkTypeAttributes);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java
index 07d7105..95e28e9 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java
@@ -1,10 +1,7 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
-import com.vci.dto.PLActionClsDTO;
-import com.vci.dto.PLActionDTO;
-import com.vci.dto.PLActionExpDTO;
-import com.vci.dto.PLActionQueryDTO;
+import com.vci.dto.*;
import com.vci.starter.web.pagemodel.BaseResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;
@@ -78,4 +75,22 @@
* @param plActionExpDTO 瀵煎嚭灞炴�ц缃璞�
*/
void exportAction(PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException, IOException;
+ /**
+ * 淇濆瓨Action鍙傛暟鏁版嵁
+ * dto action浼犺緭瀵硅薄
+ * @return 淇濆瓨缁撴灉
+ */
+ BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException;
+ /**
+ * 淇敼Action鍙傛暟鏁版嵁
+ * dto action浼犺緭瀵硅薄
+ * @return 淇濆瓨缁撴灉
+ */
+ BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException;
+ /**
+ * 鍒犻櫎Action鍙傛暟鏁版嵁
+ * oid 鍙傛暟涓婚敭
+ * @return 淇濆瓨缁撴灉
+ */
+ BaseResult deletePLActionParam(String oid) throws PLException;
}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
index 63ee265..adf9e4b 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
@@ -173,4 +173,13 @@
* @return 灞炴�х殑淇℃伅
*/
List<OsLinkTypeAttributeVO> getAllAttributeByLink(String name) throws PLException, ParseException;
+
+ /**
+ * 鑾峰彇璁剧疆鎺掑簭瀛楁鐨勬帓搴忓瓧娈�
+ * @param linkType 閾炬帴绫诲瀷鐨勭紪鍙�
+ * @param btmType 涓氬姟绫诲瀷鐨勭紪鍙�
+ * @param direction 姝�/鍙嶅悜
+ * @return 灞炴�х殑淇℃伅
+ */
+ List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException;
}
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 8d8e922..fd3d7b9 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
@@ -6,11 +6,7 @@
import com.vci.corba.portal.data.PLAction;
import com.vci.corba.portal.data.PLActionCls;
import com.vci.corba.portal.data.PLActionParam;
-import com.vci.dto.PLActionClsDTO;
-import com.vci.dto.PLActionDTO;
-import com.vci.dto.PLActionExpDTO;
-import com.vci.dto.PLActionQueryDTO;
-import com.vci.pagemodel.OsAttributeVO;
+import com.vci.dto.*;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
@@ -503,6 +499,72 @@
ControllerUtil.writeFileToResponse(response,excelPath);
FileUtil.del(defaultTempFolder + File.separator);
}
+ /**
+ * 淇濆瓨Action鍙傛暟鏁版嵁
+ * dto action浼犺緭瀵硅薄
+ * @return 淇濆瓨缁撴灉
+ */
+ @Override
+ public BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException {
+ if(dto.getName() == null || dto.getName().equals("")) {
+ throw new PLException("500",new String[]{"鍙傛暟鍚嶇О涓嶈兘涓虹┖"});
+ }
+ PLActionParam param = new PLActionParam();
+ param.oid = "";
+ param.name = dto.getName();
+ param.defaultValue = dto.getDefaultValue();
+ param.description = dto.getDescription();
+ param.action = dto.getAction();
+ String message = platformClientUtil.getUIService().createPLActionParam(param);
+
+ if(message.startsWith("0")) {
+ if(message.equals("01")) {
+ throw new PLException("500",new String[]{"鍙傛暟鍚嶅凡缁忓瓨鍦紒"});
+ } else {
+ throw new PLException("500",new String[]{"娣诲姞鎸夐挳鍙傛暟鏃跺彂鐢熷紓甯革細" + message.substring(1)});
+ }
+ }
+ return BaseResult.success();
+ }
+
+ @Override
+ public BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException {
+ if(dto.getName() == null || dto.getName().equals("")) {
+ throw new PLException("500",new String[]{"鍙傛暟鍚嶇О涓嶈兘涓虹┖"});
+ }
+ PLActionParam param = new PLActionParam();
+ param.oid = dto.getOid();
+ param.name = dto.getName();
+ param.defaultValue = dto.getDefaultValue();
+ param.description = dto.getDescription();
+ param.action = dto.getAction();
+ String message = platformClientUtil.getUIService().editPLActionParam(param);
+
+ if(message.startsWith("0")) {
+ if(message.equals("01")) {
+ throw new PLException("500",new String[]{"鍙傛暟鍚嶅凡缁忓瓨鍦紒"});
+ } else {
+ throw new PLException("500",new String[]{"娣诲姞鎸夐挳鍙傛暟鏃跺彂鐢熷紓甯革細" + message.substring(1)});
+ }
+ }
+ return BaseResult.success();
+ }
+ /**
+ * 鍒犻櫎Action鍙傛暟鏁版嵁
+ * oid 鍙傛暟涓婚敭
+ * @return 淇濆瓨缁撴灉
+ */
+ @Override
+ public BaseResult deletePLActionParam(String oid) throws PLException {
+ if(StringUtils.isBlank(oid)){
+ throw new PLException("500", new String[]{"鍙傛暟涓婚敭涓嶈兘涓虹┖"});
+ }
+ String message = platformClientUtil.getUIService().deletePLActionParam(oid);
+ if (message.startsWith("0")) {
+ throw new PLException("500", new String[]{"鍒犻櫎鎸夐挳鍙傛暟鏃跺彂鐢熷紓甯革細" + message.substring(1)});
+ }
+ return BaseResult.success();
+ }
public boolean isValidPageForamt(PLActionExpDTO plActionExpDTO) throws PLException {
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
index f69df86..4bd9c0c 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -4,6 +4,7 @@
import cn.hutool.core.util.ZipUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.vci.common.qt.object.QTConstants;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
@@ -752,6 +753,31 @@
}
return links;
}
+ /**
+ * 鑾峰彇璁剧疆鎺掑簭瀛楁鐨勬帓搴忓瓧娈�
+ * @param linkType 閾炬帴绫诲瀷鐨勭紪鍙�
+ * @param btmType 涓氬姟绫诲瀷鐨勭紪鍙�
+ * @param direction 姝�/鍙嶅悜
+ * @return 灞炴�х殑淇℃伅
+ */
+ @Override
+ public List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException {
+ List<String> abNames = new ArrayList<>(Arrays.asList("OID", "Creator", "CreateTime", "LastModifier", "LASTMODIFYTIME", "F_OID",
+ "F_REVISIONOID", "F_NAMEOID", "F_BtwName", "T_OID", "T_REVISIONOID", "T_NAMEOID", "T_BtwName", "TS" ));
+ AttributeDef[] attributes = platformClientUtil.getLinkTypeService().getAttributes(linkType);
+ for (AttributeDef attribute : attributes) {
+ abNames.add(String.valueOf(attribute.name));
+ }
+ String wrapper = "T_OID.";
+ if(direction.equals(QTConstants.DIRECTION_OPPOSITE)){
+ wrapper = "F_OID.";
+ }
+ List<OsBtmTypeAttributeVO> bizTypeQTDs = btmService.getBizTypeQTDs(btmType);
+ for (OsBtmTypeAttributeVO bizTypeQTD : bizTypeQTDs) {
+ abNames.add(wrapper + bizTypeQTD.getId());
+ }
+ return abNames;
+ }
/**
* 淇閾炬帴绫诲瀷鐨剎ml鏂囦欢
--
Gitblit v1.9.3