From 5056af07922b451b6edaaff615e34d88ce77dd16 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 13 九月 2024 10:59:34 +0800 Subject: [PATCH] ui上下文导出接口修改 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java | 77 +++++++++++++++++++++++++++++++++++--- 1 files changed, 70 insertions(+), 7 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 8d8e922..1030cb5 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; @@ -131,6 +127,7 @@ PLActionCls[] clses = platformClientUtil.getUIService().getPLActionClsArray(); PLActionClsDTO treDto = new PLActionClsDTO(); treDto.setName("Action鍒嗙被"); + treDto.setId("root"); Map<String, List<PLActionCls>> allDataMap = Arrays.stream(clses).collect(Collectors.groupingBy(pl -> pl.pid)); for (PLActionCls cls : clses) { @@ -138,7 +135,7 @@ PLActionClsDTO parentDto = new PLActionClsDTO(); parentDto.setId(cls.id); parentDto.setName(cls.name); - parentDto.setPid(cls.pid); + parentDto.setPid("root"); parentDto.setDescription(cls.description); parentDto.setCreator(cls.creator); parentDto.setCreateTime(cls.createTime); @@ -190,7 +187,7 @@ Constraint[] consArray ; if(StringUtils.isNotBlank(dto.getPlactioncls())){ consArray = new Constraint[7]; - consArray[6] = new Constraint("plactioncls", dto.getPlactioncls()); + consArray[6] = new Constraint("plactioncls", dto.getPlactioncls().equals("root") ? "": dto.getPlactioncls()); }else { consArray = new Constraint[6]; } @@ -503,6 +500,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 { -- Gitblit v1.9.3