From ef5018d575a22697e468ed949fab746e68912d75 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期二, 27 八月 2024 10:53:38 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTOList.java | 23 Source/plt-web/plt-web-ui/src/api/systemModel/mangeModel/api.js | 58 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java | 54 Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue | 456 ++++++++ Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java | 14 Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue | 189 +++ Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/ExpExcelConditionVO.java | 54 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java | 195 +++ Source/plt-web/plt-web-parent/plt-web/src/main/resources/menuConfig.json | 222 ++- Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue | 456 ++++++++ Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/DeletePortalVIDTOList.java | 24 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/AppConfigDetailInfoVO.java | 28 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java | 94 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 4 Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue | 0 /dev/null | 13 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java | 60 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java | 72 Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue | 0 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java | 812 ++++++++++++-- Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java | 26 Bin/properties/menuConfig.json | 91 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java | 332 +++++ Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTO.java | 64 + 24 files changed, 3,005 insertions(+), 336 deletions(-) diff --git a/Bin/jre-linux/lib/security/trusted.libraries b/Bin/jre-linux/lib/security/trusted.libraries deleted file mode 100644 index e69de29..0000000 --- a/Bin/jre-linux/lib/security/trusted.libraries +++ /dev/null diff --git a/Bin/properties/menuConfig.json b/Bin/properties/menuConfig.json new file mode 100644 index 0000000..ff3052b --- /dev/null +++ b/Bin/properties/menuConfig.json @@ -0,0 +1,91 @@ +{ + "hasChildren": true, + "children": [ + { + "hasChildren": true, + "children": [], + "id": "systemManagmentNode", + "name": "绠$悊鍔熻兘妯″潡", + "parentId": "VCIBaseTreeNode", + "code": "systemManagmentNode", + "alias": "system", + "meta": { + "keepAlive": false + }, + "sort": 2, + "soruce": "", + "path": "views/systemModel/mangeModel/index" + }, + { + "hasChildren": true, + "children": [], + "id": "modelManagmentNode", + "name": "涓氬姟鍔熻兘妯″潡", + "parentId": "VCIBaseTreeNode", + "code": "modelManagmentNode", + "alias": "model", + "meta": { + "keepAlive": false + }, + "sort": 3, + "soruce": "", + "path": "views/systemModel/businessModel/index" + }, + { + "hasChildren": true, + "children": [], + "id": "operateNode", + "name": "鎿嶄綔绫诲瀷绠$悊", + "parentId": "VCIBaseTreeNode", + "code": "operateNode", + "alias": "operate", + "meta": { + "keepAlive": false + }, + "sort": 4, + "soruce": "", + "path": "views/systemModel/operateType/index" + }, + { + "hasChildren": false, + "children": [], + "id": "sysOptionNode", + "name": "绯荤粺閰嶇疆", + "parentId": "VCIBaseTreeNode", + "code": "sysOptionNode", + "alias": "sysOption", + "meta": { + "keepAlive": false + }, + "sort": 5, + "soruce": "", + "path": "views/systemModel/systemConfig/index" + }, + { + "hasChildren": false, + "children": [], + "id": "sysMonitorNode", + "name": "绯荤粺杩愯鐩戞帶", + "parentId": "VCIBaseTreeNode", + "code": "sysMonitorNode", + "alias": "sysMonitor", + "meta": { + "keepAlive": false + }, + "sort": 5, + "soruce": "", + "path": "views/systemModel/systemMonitor/index" + } + ], + "id": "VCIBaseTreeNode", + "name": "绯荤粺妯″潡閰嶇疆", + "parentId": "systemManagmentNode", + "code": "rootNode", + "alias": "root", + "meta": { + "keepAlive": false + }, + "sort": 0, + "soruce": "", + "path": "" +} \ No newline at end of file diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTO.java new file mode 100644 index 0000000..c284dc5 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTO.java @@ -0,0 +1,64 @@ +package com.vci.dto; + +public class ClonePortalVIDTO implements java.io.Serializable{ + private static final long serialVersionUID = -721829341919731723L; + /** + * 鍏嬮殕鐨勮〃鍗曞璞� + */ + private PortalVIDTO oldPortalVIDTO; + /** + *鏂拌〃鍗�/琛ㄦ牸鍚嶇О + */ + private String viName; + /*** + *涓氬姟绫诲瀷 + */ + private String typeName; + + /** + * 0: 涓氬姟绫诲瀷; 1: 閾炬帴绫诲瀷. 榛樿0 + */ + private short typeFlag; + + + public PortalVIDTO getOldPortalVIDTO() { + return oldPortalVIDTO; + } + + public void setOldPortalVIDTO(PortalVIDTO oldPortalVIDTO) { + this.oldPortalVIDTO = oldPortalVIDTO; + } + + public String getViName() { + return viName; + } + + public void setViName(String viName) { + this.viName = viName; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public short getTypeFlag() { + return typeFlag; + } + + public void setTypeFlag(short typeFlag) { + this.typeFlag = typeFlag; + } + + @Override + public String toString() { + return "ClonePortalVIDTO{" + + "oldPortalVIDTO=" + oldPortalVIDTO + + ", viName='" + viName + '\'' + + ", typeName='" + typeName + '\'' + + '}'; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTOList.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTOList.java new file mode 100644 index 0000000..75c25b0 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ClonePortalVIDTOList.java @@ -0,0 +1,23 @@ +package com.vci.dto; + +import java.util.List; + +public class ClonePortalVIDTOList implements java.io.Serializable{ + + private List<ClonePortalVIDTO> clonePortalVIDTOList; + + public List<ClonePortalVIDTO> getClonePortalVIDTOList() { + return clonePortalVIDTOList; + } + + public void setClonePortalVIDTOList(List<ClonePortalVIDTO> clonePortalVIDTOList) { + this.clonePortalVIDTOList = clonePortalVIDTOList; + } + + @Override + public String toString() { + return "ClonePortalVIDTOList{" + + "clonePortalVIDTOList=" + clonePortalVIDTOList + + '}'; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/DeletePortalVIDTOList.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/DeletePortalVIDTOList.java new file mode 100644 index 0000000..6fa4161 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/DeletePortalVIDTOList.java @@ -0,0 +1,24 @@ +package com.vci.dto; + +import java.util.List; + +public class DeletePortalVIDTOList implements java.io.Serializable{ + private static final long serialVersionUID = 3618617014834926325L; + + private List<PortalVIDTO> portalVIDTOList; + + public List<PortalVIDTO> getPortalVIDTOList() { + return portalVIDTOList; + } + + public void setPortalVIDTOList(List<PortalVIDTO> portalVIDTOList) { + this.portalVIDTOList = portalVIDTOList; + } + + @Override + public String toString() { + return "DeletePortalVIDTOList{" + + "portalVIDTOList=" + portalVIDTOList + + '}'; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java index 4747ade..73670f7 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java @@ -51,9 +51,7 @@ /** * 寰呴�夋嫨鐨勫睘鎬у瓧娈� */ - private List<String[]> itemSelectoutFields=new ArrayList<>(); - - + private List<String> itemSelectoutFieldList=new ArrayList<>(); /** * 闇�瑕佷娇鐢ㄧ殑闆嗗悎 */ @@ -614,12 +612,12 @@ this.itemSeniorQueryBOS = itemSeniorQueryBOS; } - public List<String[]> getItemSelectoutFields() { - return itemSelectoutFields; + public List<String> getItemSelectoutFieldList() { + return itemSelectoutFieldList; } - public void setItemSelectoutFields(List<String[]> itemSelectoutFields) { - this.itemSelectoutFields = itemSelectoutFields; + public void setItemSelectoutFieldList(List<String> itemSelectoutFieldList) { + this.itemSelectoutFieldList = itemSelectoutFieldList; } public List<String> getItemSearchFieldList() { @@ -712,7 +710,7 @@ ", itemPageSize='" + itemPageSize + '\'' + ", itemImgWH='" + itemImgWH + '\'' + ", itemOutFields='" + itemOutFields + '\'' + - ", itemSelectoutFields=" + itemSelectoutFields + + ", itemSelectoutFieldList=" + itemSelectoutFieldList + ", itemOutFieldList=" + itemOutFieldList + ", itemKeyFields='" + itemKeyFields + '\'' + ", itemSearchFieldList=" + itemSearchFieldList + diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/AppConfigDetailInfoVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/AppConfigDetailInfoVO.java new file mode 100644 index 0000000..bb87b86 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/AppConfigDetailInfoVO.java @@ -0,0 +1,28 @@ +package com.vci.pagemodel; + +import com.vci.corba.framework.data.AppConfigDetailInfo; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 绯荤粺閰嶇疆瀵硅薄 + * @author ludc + * @date 2024/8/24 13:54 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AppConfigDetailInfoVO { + + /** + * 闇�瑕佺殑鍙傛暟瀵硅薄 + */ + private AppConfigDetailInfo appConfigDetailInfo; + + /** + * 鏄惁涓烘搷浣滈厤缃」鍒嗛厤 + */ + private boolean isConfCategorys; + +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/ExpExcelConditionVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/ExpExcelConditionVO.java new file mode 100644 index 0000000..5695483 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/ExpExcelConditionVO.java @@ -0,0 +1,54 @@ +package com.vci.pagemodel; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * 瀵煎嚭excel鏃剁殑鎺ュ彛鏉′欢瀵硅薄 + * @author ludc + * @date 2024/8/24 11:38 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ExpExcelConditionVO { + + /** + * 瀵煎嚭璧峰椤� + */ + private Integer startPage; + + /** + * 瀵煎嚭缁撴潫椤� + */ + private Integer endPage; + + /** + * 瀵煎嚭绫诲瀷锛氬叏閮ㄥ鍑猴細all锛岄�夋嫨瀵煎嚭锛歴elect锛屾寜椤电爜瀵煎嚭锛歱age + */ + private String expType; + + /** + * 瀵煎嚭鐨勫睘鎬у垪琛紙閰嶅悎isSelectExp浣跨敤锛� + */ + private List<String> expAttrNames; + + /** + * 鎸夐�夋嫨瀵煎嚭鏃讹紝閫夋嫨鐨勬暟鎹殑鍞竴鏍囪瘑锛氳兘閫氳繃璇ヨ〃绀烘煡璇㈠埌鍏蜂綋鏁版嵁鐨� + */ + private List<String> selectDataIdentify; + + /** + * 瀵煎嚭鐨勬枃浠跺悕锛氬鏋滆浼犵殑璇濓紝鍙墠绔嚜宸变紶鏂囦欢鍚庣紑 + */ + private String expFileName; + + /** + * 鍏朵粬瀵煎嚭鏉′欢 + */ + private Map<String,Object> conditionMap; +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java index 09b7139..66328b6 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java @@ -135,10 +135,36 @@ private Boolean isValid; /** + * 鍚堝苟浜唂unctionOperate瀵硅薄涓殑灞炴�х殑妯″潡鐨刬d + */ + private String funcId; + + /** + * 妯″潡涓嬪叧鑱旂殑鎿嶄綔绫诲瀷id + */ + private String operId; + + /** * 鍓嶇鏄惁闅愯棌 */ private HashMap<String,Boolean> meta = new HashMap<>(); + public void setFuncId(String funcId) { + this.funcId = funcId; + } + + public void setOperId(String operId) { + this.operId = operId; + } + + public String getFuncId() { + return funcId; + } + + public String getOperId() { + return operId; + } + public void setPathC(String pathC) { this.pathC = pathC; } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java index 0685871..e4e47af 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java @@ -2,6 +2,11 @@ import com.vci.common.exception.VciException; import com.vci.corba.common.PLException; +import com.vci.corba.framework.data.AppConfigCategoryInfo; +import com.vci.corba.framework.data.AppConfigDetailInfo; +import com.vci.corba.framework.data.FuncOperationInfo; +import com.vci.corba.framework.data.OperateInfo; +import com.vci.pagemodel.ExpExcelConditionVO; import com.vci.pagemodel.MenuVO; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseResult; @@ -41,10 +46,37 @@ boolean delModule(MenuVO menuVO); /** + * 鍒犻櫎妯″潡涓嬪叧鑱旂殑鎿嶄綔绫诲瀷 + * @param funcOperationInfo + * @return + */ + boolean delFuncOperation(FuncOperationInfo funcOperationInfo); + + /** * 澧炲姞鎿嶄綔绫诲瀷 * @return */ - boolean addOperationType(List<MenuVO> menuVOList); + boolean addFuncOperationType(List<FuncOperationInfo> funcOperationInfoList); + + /** + * 澧炲姞鎿嶄綔绫诲瀷 + * @return + */ + OperateInfo addOperationType(OperateInfo operateInfo); + + /** + * 淇敼鎿嶄綔绫诲瀷 + * @param operateInfo + * @return + */ + OperateInfo updateOperationType(OperateInfo operateInfo) throws VciBaseException; + + /** + * 鍒犻櫎鎿嶄綔绫诲瀷 + * @param operateInfo + * @return + */ + boolean delOperationType(OperateInfo operateInfo); /** * 鍒犻櫎闈炵郴缁熸ā鍧� @@ -91,33 +123,39 @@ //绯荤粺閰嶇疆鐩稿叧鎺ュ彛 /** - * 鏌ヨ绯荤粺閰嶇疆鍒嗙被 + * 鏌ヨ绯荤粺閰嶇疆鏍� */ - List<Object>getSysConfTree(); + List<AppConfigCategoryInfo>getAppConfigCategoryInfo(); /** - * 澧炲姞绯荤粺閰嶇疆 + * 鏍规嵁鍒嗙被ID杩斿洖鍏ㄩ儴鐨� AppConfigDetail 瀵硅薄 * @return */ - boolean addSysConf(); + List<AppConfigDetailInfo> getAppConfigDetailsByID(String clsId); /** - * 淇敼绯荤粺閰嶇疆 + * 澧炲姞閰嶇疆椤瑰垎绫绘垨閰嶇疆椤� * @return */ - boolean updateSysConf(); + boolean addAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/); /** - * 鍒犻櫎绯荤粺閰嶇疆 + * 淇敼閰嶇疆椤瑰垎绫绘垨閰嶇疆椤� * @return */ - boolean delSysConf(); + boolean updateAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/); /** - * 瀵煎嚭绯荤粺閰嶇疆 + * 鍒犻櫎閰嶇疆椤瑰垎绫绘垨閰嶇疆椤� + * @return + */ + boolean delAppConf(String[] ids,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/); + + /** + * 瀵煎嚭绯荤粺閰嶇疆(閰嶇疆椤瑰垎绫绘垨閰嶇疆椤�) * @param response * @return */ - String exportSysConf(HttpServletResponse response); + String exportSysConf(ExpExcelConditionVO expExcelConditionVO, HttpServletResponse response) throws IOException; } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java index 8cde4ca..ea1bf1a 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java @@ -34,6 +34,7 @@ import com.vci.web.util.RightControlUtil; import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; +import org.apache.el.stream.Stream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -319,22 +320,25 @@ if(childType == 2){ try{ FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(parentId, "", false); - for(int i = 0;i < infos.length ;i++){ - FuncOperationInfo info = infos[i]; - MenuVO menuVO = new MenuVO(); - menuVO.setChildType(childType); - menuVO.setId(info.id); - menuVO.setCode(info.funcId); - menuVO.setId(info.operId); - menuVO.setName(info.operName); - //menuVO.setOperIndentify(info.operIndentify); - menuVO.setAlias(info.operAlias); - menuVO.setRemark(info.operDesc); - menuVO.setSort((int) info.number); - menuVO.setModeType("FunctionObject"); - menuVO.setIsValid(info.isValid); - menuVO.setHasChildren(false); - menuVOList.add(menuVO); + if(Func.isNotEmpty(infos.length)){ + childType = this.checkChildObject(infos[0].id); //閮芥槸鍚屼竴灞傛墍浠ュ彇绗竴涓嵆鍙煡璇㈡槸浠�涔堢被鍨� + for(int i = 0;i < infos.length ;i++){ + FuncOperationInfo info = infos[i]; + MenuVO menuVO = new MenuVO(); + menuVO.setChildType(childType); + menuVO.setId(info.id); + menuVO.setFuncId(info.funcId); + menuVO.setCode(info.operIndentify); + menuVO.setOperId(info.operId); + menuVO.setName(info.operName); + menuVO.setAlias(info.operAlias); + menuVO.setRemark(info.operDesc); + menuVO.setSort((int) info.number); + menuVO.setModeType("FunctionObject"); + menuVO.setIsValid(info.isValid); + menuVO.setHasChildren(false); + menuVOList.add(menuVO); + } } }catch (PLException e) { e.printStackTrace(); @@ -343,12 +347,15 @@ }else if(childType == 1){ try{ FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll); - for(int i = 0;i < funcInfos.length; i++){ - FunctionInfo funcInfo = funcInfos[i]; - MenuVO menuVO = this.functionInfoToMenuVO(funcInfo); - menuVO.setChildType(childType); - menuVO.setModeType("FunctionObject"); - menuVOList.add(menuVO); + if(Func.isNotEmpty(funcInfos.length)){ + childType = this.checkChildObject(funcInfos[0].id); //閮芥槸鍚屼竴灞傛墍浠ュ彇绗竴涓嵆鍙煡璇㈡槸浠�涔堢被鍨� + for(int i = 0;i < funcInfos.length; i++){ + FunctionInfo funcInfo = funcInfos[i]; + MenuVO menuVO = this.functionInfoToMenuVO(funcInfo); + menuVO.setChildType(childType); + menuVO.setModeType("FunctionObject"); + menuVOList.add(menuVO); + } } }catch (PLException e) { e.printStackTrace(); @@ -361,14 +368,18 @@ } }else{ try{ - MenuVO parentNode; + MenuVO parentNode = null; //灏嗚繑鍥炵殑鑺傜偣澶栧眰濂椾笂褰撳墠鐖惰妭鐐� - if(parentId.equals("systemManagmentNode")){ + if("systemManagmentNode".equals(parentId)){ parentNode = JsonConfigReader.getSysModuleConf().getSystemManagmentNode(); - }else{ + }else if("modelManagmentNode".equals(parentId)){ parentNode = JsonConfigReader.getSysModuleConf().getModelManagmentNode(); } - List<MenuVO> menuVOS = new ArrayList<>(); + //濡傛灉鏌ヨ鐨勬槸绗竴灞傝妭鐐瑰氨闇�瑕佺洿鎺ヨ繑鍥瀞ystemManagmentNode鎴杕odelManagmentNode鑺傜偣 + if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){ + menuVOList.add(parentNode); + return menuVOList; + } //鏌ヨ鐨勪笁绾ц妭鐐� FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll); for(int i = 0;i < funcInfos.length; i++){ @@ -376,10 +387,9 @@ MenuVO menuVO = this.functionInfoToMenuVO(funcInfo); menuVO.setModeType("FunctionObject"); menuVO.setChildType(childType); - menuVOS.add(menuVO); + menuVOList.add(menuVO); } - parentNode.setChildren(menuVOS); - menuVOList.add(parentNode); + return menuVOList; }catch (PLException e) { e.printStackTrace(); throw new VciBaseException(String.valueOf(e.code),e.messages); @@ -455,8 +465,8 @@ @Override public int checkChildObject(String moduleId) throws VciBaseException { long res = 0; - try{ - res = ClientSession.getFrameworkService().checkChildObject(moduleId); + try{//20D63A69-C6BC-8519-8B2B-E5ACFEA62394 + res = platformClientUtil.getFrameworkService().checkChildObject(moduleId); }catch (PLException e) { e.printStackTrace(); throw new VciBaseException(String.valueOf(e.code),e.messages); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java index e3b50dc..bd566c1 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java @@ -1,17 +1,14 @@ package com.vci.frameworkcore.compatibility.impl; -import com.vci.client.common.excel.ExcelDocumentUtils; import com.vci.common.exception.VciException; -import com.vci.common.locale.LocaleDisplay; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.PLException; import com.vci.corba.common.data.UserEntityInfo; -import com.vci.corba.framework.data.FuncOperationInfo; -import com.vci.corba.framework.data.FunctionInfo; -import com.vci.corba.framework.data.OperateInfo; +import com.vci.corba.framework.data.*; import com.vci.frameworkcore.compatibility.SmHMSysModConfigServiceI; -import com.vci.pagemodel.MenuVO; -import com.vci.client.common.excel.SheetDataSet; +import com.vci.pagemodel.*; +import com.vci.starter.poi.bo.SheetDataSet; +import com.vci.starter.poi.bo.SheetRowData; import com.vci.starter.poi.bo.WriteExcelData; import com.vci.starter.poi.bo.WriteExcelOption; import com.vci.starter.poi.util.ExcelUtil; @@ -31,6 +28,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.*; import java.util.*; +import java.util.stream.Collectors; /** * 棣栭〉绯荤粺妯″潡閰嶇疆娣诲姞鎸夐挳銆佹坊鍔犳搷浣滅被鍨嬬瓑鎺ュ彛鏈嶅姟 @@ -166,34 +164,33 @@ } /** + * 鍒犻櫎妯″潡涓嬪叧鑱旂殑鎿嶄綔绫诲瀷 + * @param funcOperationInfo + * @return + */ + @Override + public boolean delFuncOperation(FuncOperationInfo funcOperationInfo) { + VciBaseUtil.alertNotNull(funcOperationInfo,"鍒犻櫎鐨勬搷浣滅被鍨嬪垪琛�"); + return foDelegate.deleteFuncOperation(funcOperationInfo); + } + + /** * 澧炲姞鎿嶄綔绫诲瀷 * @return */ @Override - public boolean addOperationType(List<MenuVO> menuVOList) { - VciBaseUtil.alertNotNull(menuVOList,"娣诲姞鎿嶄綔绫诲瀷鐨勫垪琛�"); + public boolean addFuncOperationType(List<FuncOperationInfo> funcOperationInfoList) { + VciBaseUtil.alertNotNull(funcOperationInfoList,"娣诲姞鐨勬搷浣滅被鍨嬪垪琛�");//灏嗘搷浣滅被鍨嬬粍瑁呮垚闇�瑕佸瓨鍌ㄧ殑瀵硅薄 List<FuncOperationInfo> objs = new ArrayList<>(); - //灏嗘搷浣滅被鍨嬬粍瑁呮垚闇�瑕佸瓨鍌ㄧ殑瀵硅薄 - menuVOList.stream().forEach(menuVO -> { - FuncOperationInfo info = new FuncOperationInfo(); - //info.id = menuVO.getId() == null ? "" : menuVO.getId(); - info.funcId = menuVO.getParentId() == null ? "" : menuVO.getParentId(); - info.operId = menuVO.getId() == null ? "" : menuVO.getId(); - info.operName = menuVO.getName() == null ? "" : menuVO.getName(); - //info.operIndentify = menuVO.getOperIndentify() == null ? "" : menuVO.getOperIndentify(); - info.operAlias = menuVO.getAlias() == null ? "" : menuVO.getAlias(); - info.operDesc = menuVO.getRemark() == null ? "" : menuVO.getRemark(); + funcOperationInfoList.stream().forEach(info -> { + if(Func.isBlank(info.funcId)){ + throw new VciBaseException("鐖秈d涓嶈兘涓虹┖锛�"); + } + if(Func.isBlank(info.operId)){ + throw new VciBaseException("鏈幏鍙栨搷浣滃悕绉帮紒"); + } info.number = -1; info.isValid = true; - /*VCIBaseTreeNode node = (VCIBaseTreeNode)treePaths[i].getLastPathComponent(); - OperateObject operateObject = (OperateObject) node.getObj(); - obj.setFuncId(funcObj.getId()); - obj.setOperId(operateObject.getId()); - obj.setOperName(operateObject.getName()); - obj.setOperIndentify(operateObject.getIdentify()); - obj.setOperAlias(operateObject.getAlias()); - obj.setNumber(-1); - obj.setIsValid(true);*/ objs.add(info); }); @@ -209,6 +206,120 @@ throw new VciBaseException(exceptionMessage); } return res; + } + + /** + * 澧炲姞鎿嶄綔绫诲瀷 + * @return + */ + @Override + public OperateInfo addOperationType(OperateInfo operateInfo) throws VciBaseException { + try { + //鏍¢獙 + this.checkItem(operateInfo); + String s = foDelegate.saveOperate(operateInfo); + /**杩斿洖1琛ㄧず鍚嶇О鏈夐噸澶嶏紝杩斿洖2琛ㄧず鏍囪瘑鏈夐噸澶�,杩斿洖3琛ㄧず椤哄簭鏈夐噸澶�**/ + if (s.equals("1")) { + throw new VciBaseException("鍚嶇О瀛樺湪閲嶅锛�"); + } else if (s.equals("2")) { + throw new VciBaseException("鏍囪瘑瀛樺湪閲嶅锛�"); + } else if (s.equals("3")) { + throw new VciBaseException("椤哄簭瀛樺湪閲嶅锛�"); + } + operateInfo.id = s; + return operateInfo; + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + throw new VciBaseException(exceptionMessage); + } + } + + /** + * 淇敼鎿嶄綔绫诲瀷 + * @param operateInfo + * @return + */ + @Override + public OperateInfo updateOperationType(OperateInfo operateInfo) throws VciBaseException { + try { + this.checkItem(operateInfo); + String res = foDelegate.updateOperate(operateInfo); + /**杩斿洖1琛ㄧず鍚嶇О鏈夐噸澶嶏紝杩斿洖2琛ㄧず鏍囪瘑鏈夐噸澶�,杩斿洖3琛ㄧず椤哄簭鏈夐噸澶�**/ + if (res.equals("1")) { + throw new VciBaseException("鍚嶇О瀛樺湪閲嶅锛�"); + } else if (res.equals("2")) { + throw new VciBaseException("鏍囪瘑瀛樺湪閲嶅锛�"); + } else if (res.equals("3")) { + throw new VciBaseException("椤哄簭瀛樺湪閲嶅锛�"); + } + return operateInfo; + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + throw new VciBaseException(exceptionMessage); + } + } + + /** + * 鍒犻櫎鎿嶄綔绫诲瀷 + * @param operateInfo + * @return + */ + @Override + public boolean delOperationType(OperateInfo operateInfo) throws VciBaseException { + try { + /**妫�鏌ュ綋鍓嶆搷浣滄槸鍚﹁寮曠敤,0琛ㄧず鏃犲紩鐢紝1琛ㄧず琚ā鍧楀紩鐢紝2琛ㄧず宸叉湁鏉冮檺淇℃伅**/ + int res = foDelegate.checkOperateIsReferenced(operateInfo.id); + if(res == 1){ + throw new VciBaseException("褰撳墠鎿嶄綔宸茶妯″潡寮曠敤锛屽垹闄よ鎿嶄綔鐨勫悓鏃朵細灏嗗叾浠庢ā鍧椾笅绉婚櫎锛岀‘璁ゆ墽琛屽垹闄ゅ悧锛�"); + }else if(res == 2){ + throw new VciBaseException("褰撳墠鎿嶄綔宸茬粡鍦ㄦ潈闄愭ā鍧楄鍒嗛厤杩囨潈闄愶紝鍒犻櫎璇ユ搷浣滅殑鍚屾椂浼氬皢鍏朵粠鐢ㄦ埛鐨勬潈闄愪腑绉婚櫎锛岀‘璁ゆ墽琛屽垹闄ゅ悧锛�"); + } + return foDelegate.deleteOperate(operateInfo.id); + } catch (VciBaseException e) { + e.printStackTrace(); + String exceptionMessage = VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + throw new VciBaseException(exceptionMessage); + } + } + + /** + * 鏍¢獙 + * @param operateInfo + * @return + */ + private void checkItem(OperateInfo operateInfo) { + if (Func.isBlank(operateInfo.name)) { + throw new VciBaseException("鍚嶇О涓嶈兘涓虹┖锛�"); + } + if (Func.isBlank(operateInfo.identify)) { + throw new VciBaseException("鏍囪瘑涓嶈兘涓虹┖锛�"); + } + if (Func.isBlank(operateInfo.alias)) { + throw new VciBaseException("鍒悕涓嶈兘涓虹┖锛�"); + } + /*if (operateInfo.seq > -1){ + throw new VciBaseException("璇疯緭鍏ユ纭殑鎿嶄綔椤哄簭鍊硷紒"); + }*/ + /*long seq = operateInfo.seq; + Pattern pattern = Pattern.compile("[0-9]*"); + Matcher isNum = pattern.matcher(seq); + if( !isNum.matches() ){ + throw new VciBaseException("鎿嶄綔鐨勯『搴忓�煎彧鑳芥槸[0-9]涔嬮棿鐨勬暟瀛�,骞朵笖蹇呴』鏄鏁存暟.\n闀垮害涓嶅厑璁歌緭鍏ュ皬鏁版垨鑰呰礋鏁�!"); + }*/ + if (operateInfo.name.length() > 128) { + throw new VciBaseException("鍚嶇О闀垮害涓嶈兘瓒呰繃128锛�"); + } + if (operateInfo.desc.length() > 255) { + throw new VciBaseException("鎻忚堪闀垮害涓嶈兘瓒呰繃255锛�"); + } + if (operateInfo.alias.length() > 128) { + throw new VciBaseException("鍒悕闀垮害涓嶈兘瓒呰繃255锛�"); + } } /** @@ -279,7 +390,7 @@ //鍐檈xcel String excelPath = defaultTempFolder + File.separator + "module.xls"; final List<String> columns = new ArrayList<String>(Arrays.asList("PLNAME","PLRESOURCEC","PLSUFFIXC","PLRESOURCEB", - "PLSUFFIXB","PLMODULENO","PLDESC","PLISVALID","PLIMAGE","PLMODULESEQUENCE","PLALIASNAME", + "PLSUFFIXB","PLDESC","PLISVALID","PLIMAGE","PLMODULESEQUENCE","PLALIASNAME", "PLMODULENAME","PLRESOURCEDOTNET","PLRESOURCEMOBIL","绾у埆","鍒悕","PLNO","PLISVALID", "PLNAME","PLUNIQUEFLAG","PLDESC","PLALIAS","PLSEQUENCE"));// 璁剧疆琛ㄥ崟鍒楀悕 //int count = transmitTreeObject.getCurrentTreeNode().getChildCount(); @@ -316,7 +427,7 @@ excelDataList.add(new WriteExcelData(row,6, ""+datas[i][6])); excelDataList.add(new WriteExcelData(row,7, ""+datas[i][7])); excelDataList.add(new WriteExcelData(row,8, ""+datas[i][8])); - excelDataList.add(new WriteExcelData(row,9, ""+datas[i][9])); + excelDataList.add(new WriteExcelData(row,9,""+datas[i][9])); excelDataList.add(new WriteExcelData(row,10,""+datas[i][10])); excelDataList.add(new WriteExcelData(row,11,""+datas[i][11])); excelDataList.add(new WriteExcelData(row,12,""+datas[i][12])); @@ -329,7 +440,6 @@ excelDataList.add(new WriteExcelData(row,19,""+datas[i][19])); excelDataList.add(new WriteExcelData(row,20,""+datas[i][20])); excelDataList.add(new WriteExcelData(row,21,""+datas[i][21])); - excelDataList.add(new WriteExcelData(row,22,""+datas[i][22])); } } WriteExcelOption excelOption = new WriteExcelOption(excelDataList); @@ -349,11 +459,10 @@ boolean isSuccess = collectionDatas(files); logger.info("姝e湪瀵煎叆琛ㄥ崟浜哄憳淇℃伅......"); logger.info("count==="+count); - boolean resBoolean = false; if(isSuccess == false){ - resBoolean = importExcelData(count); + isSuccess = importExcelData(count); } - return resBoolean ? BaseResult.success("瀵煎叆鎴愬姛锛�"):BaseResult.fail("瀵煎叆澶辫触锛�"); + return isSuccess ? BaseResult.success("瀵煎叆鎴愬姛锛�"):BaseResult.fail("瀵煎叆澶辫触锛�"); } /** @@ -361,7 +470,7 @@ * @return */ @Override - public boolean updateAlias(MenuVO menuVO) throws VciException { + public boolean updateAlias(MenuVO menuVO) throws VciBaseException { String alias = menuVO.getAlias(); if ("".equals(alias)){ throw new VciBaseException("璇峰~鍐欐搷浣滃埆鍚�!"); @@ -371,29 +480,296 @@ return foDelegate.updateFuncOperation(id , alias, isValid); } + /** + * 鏌ヨ绯荤粺閰嶇疆鏍� + * @return + */ @Override - public List<Object> getSysConfTree() { - return null; + public List<AppConfigCategoryInfo> getAppConfigCategoryInfo() { + try { + AppConfigCategoryInfo[] appConfigCategorys = foDelegate.getAppConfigCategorys(); + return Arrays.asList(appConfigCategorys); + } catch (VciBaseException e) { + e.printStackTrace(); + String exceptionMessage = VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + throw new VciBaseException(exceptionMessage); + } } + /** + * 鏍规嵁鍒嗙被ID杩斿洖鍏ㄩ儴鐨� AppConfigDetail 瀵硅薄 + * @return + */ @Override - public boolean addSysConf() { + public List<AppConfigDetailInfo> getAppConfigDetailsByID(String clsId) { + try { + AppConfigDetailInfo[] appConfigDetailInfos = foDelegate.getAppConfigDetailsByID(clsId); + return Arrays.asList(appConfigDetailInfos); + } catch (VciBaseException e) { + e.printStackTrace(); + String exceptionMessage = VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + throw new VciBaseException(exceptionMessage); + } + } + + /** + * 澧炲姞閰嶇疆椤瑰垎绫绘垨閰嶇疆椤� + * @return + */ + @Override + public boolean addAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/) { + VciBaseUtil.alertNotNull(appConfigDetailInfo,"娣诲姞鐨勬搷浣滅被鍨�"); + boolean rs = false; + try { + String id = ""; + if(isConfCategorys){ + AppConfigCategoryInfo appConfigCategoryInfo = new AppConfigCategoryInfo(); + appConfigCategoryInfo.name = appConfigDetailInfo.name; + appConfigCategoryInfo.desc = appConfigDetailInfo.desc; + this.checkConf(appConfigCategoryInfo); + id = foDelegate.saveAppConfigCategory(appConfigCategoryInfo); + }else{ + this.checkConfItem(appConfigDetailInfo); + id = foDelegate.saveAppConfigDetail(appConfigDetailInfo); + } + appConfigDetailInfo.id = id; + rs = true; + } catch (VciBaseException e) { + e.printStackTrace(); + String exceptionMessage = VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + rs = false; + throw new VciBaseException(exceptionMessage); + } + return rs; + } + + /** + * 淇敼閰嶇疆椤瑰垎绫绘垨閰嶇疆椤� + * @return + */ + @Override + public boolean updateAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/) { + VciBaseUtil.alertNotNull(appConfigDetailInfo,"娣诲姞鐨勬搷浣滅被鍨�"); + boolean rs = false; + try { + if(isConfCategorys){ + AppConfigCategoryInfo appConfigCategoryInfo = new AppConfigCategoryInfo(); + appConfigCategoryInfo.id = appConfigDetailInfo.id; + appConfigCategoryInfo.name = appConfigDetailInfo.name; + appConfigCategoryInfo.desc = appConfigDetailInfo.desc; + this.checkConf(appConfigCategoryInfo); + rs = foDelegate.updateAppConfigCategory(appConfigCategoryInfo); + }else{ + this.checkConfItem(appConfigDetailInfo); + rs = foDelegate.updateAppConfigDetail(appConfigDetailInfo); + } + } catch (VciBaseException e) { + e.printStackTrace(); + String exceptionMessage = VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + throw new VciBaseException(exceptionMessage); + } + return rs; + } + + /** + * 鍒犻櫎閰嶇疆椤瑰垎绫绘垨閰嶇疆椤� + * @return + */ + @Override + public boolean delAppConf(String[] ids,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/) { + VciBaseUtil.alertNotNull(ids,"寰呭垹闄ょ殑涓婚敭鍒楄〃"); + boolean res = false; + if(isConfCategorys){ + if (this.hasAppConfigDetail(ids)) { + throw new VciBaseException("鍒犻櫎鐨勯厤缃」鍒嗙被涓嬪瓨鍦ㄥ叧鑱旀暟鎹紒"); + } + res = foDelegate.deleteAppConfigCategory(ids); + }else { + res = foDelegate.deleteAppConfigDetail(ids); + } + return res; + } + + /** + * 妫�鏌ユ槸鍚﹀瓨鍦ㄥ紩鐢ㄥ叧绯� + * @param ids + * @return + */ + private boolean hasAppConfigDetail(final String[] ids){ + for (int i = 0; i < ids.length; i++) { + AppConfigDetailInfo[] appConfigDetailsByID = foDelegate.getAppConfigDetailsByID(ids[i]); + if(Func.isNotEmpty(appConfigDetailsByID)){ + return true; + } + } return false; } - @Override - public boolean updateSysConf() { - return false; + /** + * 閰嶇疆椤瑰垎绫绘牎楠� + * @param obj + */ + private void checkConf(AppConfigCategoryInfo obj) { + if ("".equals(obj.name)) { + throw new VciBaseException("鍚嶇О涓嶈兘涓虹┖锛�"); + } } - @Override - public boolean delSysConf() { - return false; + /** + * 閰嶇疆椤规牎楠� + * @param obj + */ + private void checkConfItem(AppConfigDetailInfo obj) { + if ("".equals(obj.name)) { + throw new VciBaseException("鍚嶇О涓嶈兘涓虹┖锛�"); + } + /*AppConfigDetailInfo[] appConfigDetailInfoByName = foDelegate.getAppConfigDetailInfoByName(obj.name); + if(appConfigDetailInfoByName != null && appConfigDetailInfoByName.length > 0){ + throw new VciBaseException("閰嶇疆椤瑰悕绉伴噸澶嶏紒"); + }*/ + if ("".equals(obj.key)){ + throw new VciBaseException("涓婚敭涓嶈兘涓虹┖锛�"); + } + if ("".equals(obj.value)){ + throw new VciBaseException("閿�间笉鑳戒负绌�!"); + } } + /** + * 瀵煎嚭绯荤粺閰嶇疆 + * @param response + * @return + */ @Override - public String exportSysConf(HttpServletResponse response) { - return null; + public String exportSysConf(ExpExcelConditionVO expExcelConditionVO, HttpServletResponse response) throws IOException { + //璁剧疆鏂囦欢鍚嶅拰璺緞 + String expFileName = expExcelConditionVO.getExpFileName(); + if(Func.isNotBlank(expFileName) && expFileName.contains(".xls")){ + throw new VciBaseException("璁剧疆鐨勬枃浠跺悕涓湭璁剧疆鏂囦欢鍚庣紑锛屾垨鍚庣紑璁剧疆鏈夎锛屽綋鍓嶄粎鏀寔瀵煎嚭.xls鏍煎紡锛�"); + } + expFileName = Func.isBlank(expFileName) ? "appConfig.xls":expFileName; + String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); + //鍐檈xcel + String excelPath = defaultTempFolder + File.separator + expFileName; + //鍏堝垽鏂槸鍏ㄩ儴瀵煎嚭杩樻槸閫夋嫨鏁版嵁瀵煎嚭 + Map<String, Object> conditionMap = expExcelConditionVO.getConditionMap(); + if (Func.isEmpty(conditionMap)) { + throw new VciBaseException("缂哄皯蹇呰瀵煎嚭鏉′欢锛�"); + } + //鎸囧畾瀵煎嚭鐨勫睘鎬у悕 + List<String> expAttrNames = expExcelConditionVO.getExpAttrNames(); + if(Func.isEmpty(expAttrNames)){ + throw new VciBaseException("璇烽�夋嫨鎮ㄨ瀵煎嚭鐨勫睘鎬э紒"); + } + //鍏堝尯鍒嗘槸瀵煎嚭鐨勯厤缃」鍒嗙被杩樻槸閰嶇疆椤硅鎯� + boolean isExpAppConfDetail = (boolean) conditionMap.get("isExpAppConfDetail"); + //鍥犱负AppConfigDetailInfo涓殑灞炴�у寘鍚簡AppConfigCategoryInfo涓殑灞炴�ф墍浠ュ厛閫氱敤浜� + List<AppConfigDetailInfo> appConfigDetailInfos = new ArrayList<>(); + //閫変腑瀵煎嚭鏁版嵁鐨勫敮涓�鏍囪瘑 + List<String> selectDataIdentify = expExcelConditionVO.getSelectDataIdentify(); + //褰撳墠鐣岄潰瀵煎嚭閫昏緫锛屽彧瀛樺湪鍏ㄩ儴鍜岄�夋嫨瀵煎嚭 + String expType = expExcelConditionVO.getExpType(); + if(!isExpAppConfDetail){ + AppConfigCategoryInfo[] appConfigCategorys = foDelegate.getAppConfigCategorys(); + List<AppConfigCategoryInfo> filterAppConfigInfo = null; + if("select".equals(expType)){ + filterAppConfigInfo = Arrays.stream(appConfigCategorys).filter(item -> { + if (selectDataIdentify.contains(item.id)) { + return true; + } + return false; + }).collect(Collectors.toList()); + }else{ + filterAppConfigInfo = new ArrayList<>(Arrays.asList(appConfigCategorys)); + } + if (Func.isNotEmpty(filterAppConfigInfo)) { + filterAppConfigInfo.stream().forEach(item->{ + AppConfigDetailInfo appConfigDetailInfo = new AppConfigDetailInfo(); + appConfigDetailInfo.id = item.id; + appConfigDetailInfo.name = item.name; + appConfigDetailInfo.desc = item.desc; + appConfigDetailInfos.add(appConfigDetailInfo); + }); + } + }else{ + String clsId = (String)conditionMap.get("clsId"); + if(Func.isBlank(clsId)){ + throw new VciBaseException("鏈幏鍙栧埌鏌ヨ閰嶇疆椤圭殑閰嶇疆椤瑰垎绫讳富閿�"); + } + AppConfigDetailInfo[] configDetailInfos = foDelegate.getAppConfigDetailsByID(clsId); + List<AppConfigDetailInfo> filterAppConfigInfo = null; + if("select".equals(expType)){ + filterAppConfigInfo = Arrays.stream(configDetailInfos).filter(item -> { + if (selectDataIdentify.contains(item.id)) { + return true; + } + return false; + }).collect(Collectors.toList()); + }else{ + filterAppConfigInfo = new ArrayList<>(Arrays.asList(configDetailInfos)); + } + if (Func.isNotEmpty(filterAppConfigInfo)) { + appConfigDetailInfos.addAll(filterAppConfigInfo); + } + } + //璁剧疆鍒楀悕 + List<String> columns = new ArrayList<>(); + //鏍规嵁瀵煎嚭鍒楄缃垪鍚� + Map<String,Integer> colAttrMap = new HashMap<>(); //瀵煎嚭鐨勫垪鍜屽睘鎬ф槧灏� + for (int i = 0; i < expAttrNames.size(); i++) { + String attrName = expAttrNames.get(i); + switch (attrName){ + case "name": + columns.add("鍚嶇О"); + break; + case "key": + columns.add("key"); + break; + case "value": + columns.add("value"); + break; + case "desc": + columns.add("鎻忚堪"); + break; + } + colAttrMap.put(attrName,i); + } + + new File(excelPath).createNewFile(); + //璁剧疆鍒� + List<WriteExcelData> excelDataList = new ArrayList<>(); + //璁剧疆鍒楀ご + for (int index = 0; index < columns.size(); index++) { + excelDataList.add(new WriteExcelData(0,index, columns.get(index))); + } + //澶勭悊鏁版嵁瀵煎嚭 + if(Func.isEmpty(appConfigDetailInfos)){ + excelDataList.add(new WriteExcelData(1,1, "鏈幏鍙栧埌瑕佸鍑虹殑鏁版嵁锛岃鍒锋柊鍚庡皾璇曢噸鏂板鍑猴紒")); + }else{ + for (int i = 0; i < appConfigDetailInfos.size(); i++) { + AppConfigDetailInfo appConfigDetailInfo = appConfigDetailInfos.get(i); + int row = i+1; + if(Func.isNotEmpty(colAttrMap.get("name"))){ + excelDataList.add(new WriteExcelData(row,colAttrMap.get("name"), appConfigDetailInfo.name)); + } + if(Func.isNotEmpty(colAttrMap.get("key"))){ + excelDataList.add(new WriteExcelData(row,colAttrMap.get("key"), appConfigDetailInfo.key)); + } + if(Func.isNotEmpty(colAttrMap.get("value"))){ + excelDataList.add(new WriteExcelData(row,colAttrMap.get("value"), appConfigDetailInfo.value)); + } + if(Func.isNotEmpty(colAttrMap.get("desc"))){ + excelDataList.add(new WriteExcelData(row,colAttrMap.get("desc"), appConfigDetailInfo.desc)); + } + } + } + WriteExcelOption excelOption = new WriteExcelOption(excelDataList); + ExcelUtil.writeDataToFile(excelPath, excelOption); + return excelPath; } /** @@ -410,28 +786,26 @@ if (sheetDataSets != null && !sheetDataSets.isEmpty()) { for (SheetDataSet sheet : sheetDataSets) { // sheet涓嶈兘涓虹┖骞朵笖蹇呴』鏈夊嚭琛ㄥご澶栫殑涓�鏉℃暟鎹� - if (sheet != null && sheet.getDataSet() != null && sheet.getDataSet().size() > 1) { - List<String[]> dataSet = sheet.getDataSet(); + if (sheet != null && sheet.getRowData() != null && sheet.getRowData().size() > 1) { + List<SheetRowData> dataSet = sheet.getRowData(); String fParentId=""; //绗竴绾х殑id(绗簩绾х殑parentid) boolean boo=true; boolean first=false; String[] pd=new String[100]; int jibie=2; - for (int i = 1; i < dataSet.size(); i++) { - //fileDatas = new ArrayList<FunctionObject>(); - String[] oneData = dataSet.get(i); + for (int i = 0; i < dataSet.size(); i++) { + Map<Integer, String> oneData = dataSet.get(i).getData(); String id = ObjectUtility.getNewObjectID36(); FunctionInfo funObj=new FunctionInfo(); boolean onebl=false; boolean twobl=false; boolean same=false; - String plName=oneData[0]; - //TODO: 杩欓噷缁濆浼氬嚭闂锛屽鍑虹殑绗竴灞傜殑绾у埆閮芥槸0锛岄兘涓嶄細瀛樺湪绛変簬1鐨勶紝鎵�浠ュ钩鍙拌繖鍎跨瓑浜�1搴旇鏄笉瀵圭殑 - if(oneData[14].equals("0")) { + String plName = Func.isBlank(oneData.get(0)) ? "":oneData.get(0); + if(oneData.get(14).equals("1")) { try { onebl = foDelegate.firstLevel(plName); - } catch (VciException e) { + } catch (VciBaseException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -441,14 +815,13 @@ try { fParentId = foDelegate.changeFirstLevel(funObj,plName); pd[2]=fParentId; - } catch (VciException e) { + } catch (VciBaseException e) { // TODO Auto-generated catch block e.printStackTrace(); } funObj.id = fParentId; fileFunctionDatas.add(funObj); first=true; - } else { funObj.id = id; @@ -462,14 +835,14 @@ } //######################### 鍚堝苟 ######################### for(jibie=2;jibie<100;jibie++){ - if(oneData[14].equals(String.valueOf(jibie))){ + if(oneData.get(14).equals(String.valueOf(jibie))){ if(first == true && boo == true){ try { if(pd[jibie]==null){ pd[jibie]=""; } twobl=foDelegate.secondLevel(plName,pd[jibie]); - } catch (VciException e) { + } catch (VciBaseException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -495,12 +868,12 @@ } } - if(oneData[14].equals("-1")) { + if(oneData.get(14).equals("-1")) { importExcelData(count); FuncOperationInfo foObj = new FuncOperationInfo(); int len=fileFunctionDatas.size(); //**************鍚屼竴鑺傜偣涓嬩笉鑳芥湁鐩稿悓鐨勬搷浣滅被鍨�******************** - String dataOperName=oneData[18]; + String dataOperName=oneData.get(18); String plFuncOid=fileFunctionDatas.get(len-1).id; try { same = foDelegate.selSameOper(dataOperName,plFuncOid); @@ -513,29 +886,29 @@ foObj.id = id; foObj.funcId = fileFunctionDatas.get(len-1).id; try { - OperateInfo operObj = foDelegate.fetchOperateTypeByName(oneData[18]); + OperateInfo operObj = foDelegate.fetchOperateTypeByName(oneData.get(18)); foObj.operId = operObj.id; - } catch (VciException e) { + } catch (VciBaseException e) { // TODO Auto-generated catch block e.printStackTrace(); } - foObj.number = Integer.parseInt(oneData[16]); - foObj.operAlias = oneData[15]; - foObj.isValid = Integer.parseInt(oneData[17]) != 0; + foObj.number = Integer.parseInt(oneData.get(16)); + foObj.operAlias = oneData.get(15); + foObj.isValid = Integer.parseInt(oneData.get(17)) != 0; try { foDelegate.saveFuncOperation2(foObj); - } catch (VciException e) { + } catch (VciBaseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { - foObj.number = Integer.parseInt(oneData[16]); - foObj.operAlias = oneData[15]; - foObj.isValid = Integer.parseInt(oneData[17]) != 0; + foObj.number = Integer.parseInt(oneData.get(16)); + foObj.operAlias = oneData.get(15); + foObj.isValid = Integer.parseInt(oneData.get(17)) != 0; try { foDelegate.updateOperation(foObj,dataOperName,plFuncOid); - } catch (VciException e) { + } catch (VciBaseException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -558,7 +931,7 @@ private boolean importExcelData(int count) throws PLException { boolean b=false; try { - b= foDelegate.importModules(fileFunctionDatas.toArray(new FunctionInfo[]{}),count); + b = foDelegate.importModules(fileFunctionDatas.toArray(new FunctionInfo[fileFunctionDatas.size()]),count); } catch (VciBaseException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -576,13 +949,8 @@ * @data 2014-3-11 */ private List<SheetDataSet> getFileList(File f) throws PLException, IOException { - // 鑾峰彇娴� - BufferedInputStream fileInputStream = new BufferedInputStream( - new FileInputStream(f)); - String name = f.getName(); // 鑾峰彇琛╨ist - List<SheetDataSet> sheetDataSets = ExcelDocumentUtils - .readExcelDocument(name, fileInputStream); + List<SheetDataSet> sheetDataSets = ExcelUtil.readDataObjectFromExcel(f); return sheetDataSets; } @@ -618,13 +986,13 @@ if(isFunction){ if(!plDatas[i][16].trim().equals("") && plDatas[i][16]!=null && !plDatas[i][16].equals("-1")){ bw.write("insert into plfunction values('"+plDatas[i][0]+"','"+plDatas[i][1]+"',"+"'"+plDatas[i][2]+"',"+"'"+plDatas[i][3]+"',"+"'"+plDatas[i][4]+"'," - +"'"+plDatas[i][5]+"',"+"'"+plDatas[i][6]+"',"+"'"+plDatas[i][7]+"',"+"'"+plDatas[i][8]+"',"+"'"+plDatas[i][9]+"',"+"'"+plDatas[i][10]+"',"+"'"+plDatas[i][11]+"'," - +"'"+plDatas[i][12]+"',"+"'"+plDatas[i][13]+"',"+"'"+plDatas[i][14]+"',"+"'"+plDatas[i][15]+"');"); + +"',"+"'"+plDatas[i][5]+"',"+"'"+plDatas[i][6]+"',"+"'"+plDatas[i][7]+"',"+"'"+plDatas[i][8]+"',"+"'"+plDatas[i][9]+"',"+"'"+plDatas[i][10]+"'," + +"'"+plDatas[i][11]+"',"+"'"+plDatas[i][12]+"',"+"'"+plDatas[i][13]+"',"+"'"+plDatas[i][14]+"');"); bw.write("\r\n"); } - if(!plDatas[i][16].trim().equals("") && plDatas[i][16]!=null && plDatas[i][16].equals("-1")){ - bw.write("insert into plfuncoperation values('"+plDatas[i][17]+"','"+plDatas[i][18]+"',"+"'"+plDatas[i][19]+"',"+"'"+plDatas[i][20]+"',"+"'"+plDatas[i][21]+"'," - +"'"+plDatas[i][22]+"');"); + if(!plDatas[i][15].trim().equals("") && plDatas[i][15]!=null && plDatas[i][15].equals("-1")){ + bw.write("insert into plfuncoperation values('"+plDatas[i][16]+"','"+plDatas[i][17]+"',"+"'"+plDatas[i][18]+"',"+"'"+plDatas[i][19]+"',"+"'"+plDatas[i][20]+"'," + +"'"+plDatas[i][21]+"');"); bw.write("\r\n"); } }else{ @@ -695,20 +1063,19 @@ return res; } - public void fuzhi(FunctionInfo functionInfo,String[] oneData){ - functionInfo.name = oneData[0]; - functionInfo.resourceC = oneData[1]; - functionInfo.suffixC = oneData[2]; - functionInfo.desc = oneData[6]; - functionInfo.resourceB = oneData[3]; - functionInfo.suffixB = oneData[4]; - functionInfo.seq = Integer.parseInt(oneData[9]); - //funObj.setModuleNo(Integer.parseInt(oneData[5])); - functionInfo.image = oneData[8]; - functionInfo.isValid = Integer.parseInt(oneData[7]) != 0; - functionInfo.aliasName = oneData[10]; - functionInfo.resourceDotNet = oneData[12]; - functionInfo.resourceMobile = oneData[13]; + public void fuzhi(FunctionInfo functionInfo,Map<Integer,String> oneData){ + functionInfo.name = oneData.get(0); + functionInfo.resourceC = oneData.get(1); + functionInfo.suffixC = oneData.get(2); + functionInfo.desc = oneData.get(5); + functionInfo.resourceB = oneData.get(3); + functionInfo.suffixB = oneData.get(4); + functionInfo.seq = Integer.parseInt(oneData.get(8)); + functionInfo.image = oneData.get(7); + functionInfo.isValid = Integer.parseInt(oneData.get(6)) != 0; + functionInfo.aliasName = oneData.get(9); + functionInfo.resourceDotNet = oneData.get(11); + functionInfo.resourceMobile = oneData.get(12); } /** @@ -722,12 +1089,12 @@ * @return * @throws VciException */ - public boolean firstLevel(String plName) throws VciException{ + public boolean firstLevel(String plName) throws VciBaseException{ try{ return platformClientUtil.getFrameworkService().firstLevel(plName); }catch (PLException e) { e.printStackTrace(); - throw new VciException(String.valueOf(e.code), e.messages); + throw new VciBaseException(String.valueOf(e.code), e.messages); } } @@ -735,7 +1102,7 @@ * 瑕嗙洊閲嶅悕鐨勭涓�绾ф暟鎹� * add by caill * */ - public String changeFirstLevel(FunctionInfo functionInfo,String plName) throws VciException{ + public String changeFirstLevel(FunctionInfo functionInfo,String plName) throws VciBaseException{ String fParentId=""; try { fParentId= platformClientUtil.getFrameworkService().changeFirstLevel(functionInfo, plName); @@ -743,7 +1110,6 @@ // TODO Auto-generated catch block e.printStackTrace(); } - return fParentId; } @@ -751,12 +1117,12 @@ * 鍒ゆ柇绗簩绾ф暟鎹湁娌℃湁閲嶅悕鐨� * add by caill * */ - public boolean secondLevel(String plName,String fParentId) throws VciException{ + public boolean secondLevel(String plName,String fParentId) throws VciBaseException{ try{ return platformClientUtil.getFrameworkService().secondLevel(plName,fParentId); }catch (PLException e) { e.printStackTrace(); - throw new VciException(String.valueOf(e.code), e.messages); + throw new VciBaseException(String.valueOf(e.code), e.messages); } } @@ -827,13 +1193,29 @@ } /** + * 绉婚櫎妯″潡涓嬬殑鎿嶄綔 + * @param funcOperationInfo + * @return + * @throws VciException + */ + public boolean deleteFuncOperation(FuncOperationInfo funcOperationInfo) throws VciBaseException{ + boolean res = true; + try{ + res = platformClientUtil.getFrameworkService().deleteFuncOperation(funcOperationInfo, this.getUserEntityInfo()); + }catch (PLException e) { + e.printStackTrace(); + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + return res; + } + + /** * VO杞珼O瀵硅薄 * @return */ public FunctionInfo menuVO2FunctionInfo(MenuVO object){ FunctionInfo info = new FunctionInfo(); info.id = object.getId() == null ? "" : object.getId(); - //info.layer = object.getLayer(); info.name = object.getName() == null ? "" : object.getName(); info.parentId = object.getParentId() == null ? "" : object.getParentId(); info.resourceC = object.getPathC() == null ? "" : object.getPathC(); @@ -842,7 +1224,6 @@ //info.suffixB = object.getSuffixB() == null ? "" : object.getSuffixB(); info.desc = object.getRemark() == null ? "" : object.getRemark(); info.seq = object.getSort(); - //info.moduleNo = object.getModuleNo(); info.image = object.getSource() == null ? "" : object.getSource(); info.isValid = object.getIsValid(); info.aliasName = object.getAlias() == null ? "" : object.getAlias(); @@ -862,7 +1243,6 @@ */ private FunctionInfo check(MenuVO menuVO,String type) { FunctionInfo obj = new FunctionInfo(); - //鑾峰彇琛ㄥ崟杈撳叆鐨勫�� String modelName = menuVO.getName(); String csIdentity = menuVO.getPathC(); @@ -871,36 +1251,35 @@ String resDotNet = menuVO.getResourceDotNet(); String resMobile = menuVO.getResourceMobile(); - //int moduleNo = transferStringToNum(moduleNoTxt.getText()); - int sequence = menuVO.getSort(); + int sequence = Func.isNotEmpty(menuVO.getSort()) ? menuVO.getSort():1; String description = menuVO.getRemark(); - if("".equals(modelName) || "null".equals(modelName) || modelName == null) { + if(Func.isBlank(modelName)) { throw new VciBaseException("妯″潡鍚嶄笉鑳戒负绌猴紒"); }else if(modelName.length() > 128) { throw new VciBaseException("妯″潡鍚嶉暱搴︿笉鑳借秴杩�128锛�"); - }else if(description.length() > 255) { + }else if(Func.isNotBlank(description) && description.length() > 255) { throw new VciBaseException("鎻忚堪闀垮害涓嶈兘瓒呰繃255锛�"); - }else if(csIdentity != null && !"".equals(csIdentity) && csIdentity.length() > 255) { + }else if(Func.isNotBlank(csIdentity) && csIdentity.length() > 255) { throw new VciBaseException("C/S鏍囪瘑闀垮害涓嶈兘瓒呰繃255锛�"); - } else if(resDotNet != null && !"".equals(resDotNet) && resDotNet.length() > 255) { + } else if(Func.isNotBlank(resDotNet) && resDotNet.length() > 255) { throw new VciBaseException(".NET鏍囪瘑闀垮害涓嶈兘瓒呰繃255锛�"); - }else if(resMobile != null && !"".equals(resMobile) && resMobile.length() > 255) { + }else if(Func.isNotBlank(resMobile) && resMobile.length() > 255) { throw new VciBaseException("Mobile鏍囪瘑闀垮害涓嶈兘瓒呰繃255锛�"); } else if (sequence < 0) { throw new VciBaseException("搴忓彿涓嶈兘灏忎簬0锛�"); } if(type.equals("add")){ //缁檕bject瀵硅薄璧嬪�� - String parentId = ""; + /*String parentId = ""; if(menuVO.getModeType().equals("FunctionObject")) { parentId = menuVO.getParentId(); }else if("modelManagmentNode".equals(menuVO.getParentId())) { parentId = "modelManagmentNode"; }else if("systemManagmentNode".equals(menuVO.getParentId())) { parentId = "systemManagmentNode"; - } - obj.parentId = parentId; + }*/ + obj.parentId = menuVO.getParentId(); }else{ obj.id = menuVO.getId(); obj.parentId = menuVO.getParentId(); @@ -909,11 +1288,11 @@ obj.resourceC = csIdentity; obj.desc = description; obj.resourceB = bsIdentity; - obj.suffixC = ""; - obj.suffixB = ""; + /*obj.suffixC = ""; + obj.suffixB = "";*/ obj.seq = sequence; obj.image = menuVO.getSource(); - obj.isValid = menuVO.getValid();//1鏈夋晥0鏃犳晥 + obj.isValid = Func.isNotEmpty(menuVO.getValid()) ? menuVO.getValid():false; obj.aliasName = aliasName; obj.resourceDotNet = resDotNet; obj.resourceMobile = resMobile; @@ -939,7 +1318,7 @@ int len = funObject.length; List<FunctionInfo> funInfoList = new ArrayList<FunctionInfo>(); for(int i = count ; i<len ; i++){ - if(funObject[i].parentId!=null){ + if(Func.isNotBlank(funObject[i].parentId)){ FunctionInfo funInfo = funObject[i]; funInfoList.add(funInfo); } @@ -974,7 +1353,7 @@ return same; } - public OperateInfo fetchOperateTypeByName(String name) throws VciException { + public OperateInfo fetchOperateTypeByName(String name) throws VciBaseException { try{ OperateInfo info = platformClientUtil.getFrameworkService().fetchOperateTypeByName(name); return info; @@ -988,12 +1367,13 @@ * 淇濆瓨鎿嶄綔绫诲瀷 * add by caill * */ - public boolean saveFuncOperation2(FuncOperationInfo funcOperationInfo) throws VciException{ + public boolean saveFuncOperation2(FuncOperationInfo funcOperationInfo) throws VciBaseException{ try { platformClientUtil.getFrameworkService().saveFuncOperation2(funcOperationInfo,this.getUserEntityInfo()); } catch (PLException e) { // TODO Auto-generated catch block e.printStackTrace(); + throw new VciBaseException(String.valueOf(e.code), e.messages); } return true; } @@ -1002,26 +1382,208 @@ * 瑕嗙洊鎿嶄綔绫诲瀷 * add by caill * */ - public String updateOperation(FuncOperationInfo funcOperationInfo,String dataOperName,String plFuncOid) throws VciException{ + public String updateOperation(FuncOperationInfo funcOperationInfo,String dataOperName,String plFuncOid) throws VciBaseException{ try { platformClientUtil.getFrameworkService().updateOperation(funcOperationInfo,this.getUserEntityInfo(),dataOperName,plFuncOid); } catch (PLException e) { // TODO Auto-generated catch block e.printStackTrace(); + throw new VciBaseException(String.valueOf(e.code), e.messages); } return null; } - public boolean updateFuncOperation(String id , String alias, boolean isSelected) throws VciException { + public boolean updateFuncOperation(String id , String alias, boolean isSelected) throws VciBaseException { boolean res = false; try{ res = platformClientUtil.getFrameworkService().updateFuncOperation(id, alias, isSelected, this.getUserEntityInfo()); }catch(PLException e){ - throw new VciException(String.valueOf(e.code), e.messages); + throw new VciBaseException(String.valueOf(e.code), e.messages); } return res; } + /** + * 淇濆瓨鎿嶄綔绫诲瀷 + * + * @param operateInfo + * @return + * @throws VciException + */ + public String saveOperate(OperateInfo operateInfo) throws VciBaseException { + String res = ""; + try{ + res = platformClientUtil.getFrameworkService().saveOperate(operateInfo,this.getUserEntityInfo()); + }catch (PLException e) { + e.printStackTrace(); + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + return res; + } + + /** + * 淇敼鎿嶄綔绫诲瀷 + * + * @param operateInfo + * @return + * @throws VciException + */ + public String updateOperate(OperateInfo operateInfo) throws VciBaseException { + String res = ""; + try{ + res = platformClientUtil.getFrameworkService().updateOperate(operateInfo,this.getUserEntityInfo()); + }catch (PLException e) { + e.printStackTrace(); + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + return res; + } + + /** + * 鍒犻櫎鎿嶄綔绫诲瀷 + * + * @param id + * @return + * @throws VciException + */ + public boolean deleteOperate(String id) throws VciBaseException { + boolean res = true; + try{ + res = platformClientUtil.getFrameworkService().deleteOperate(id,this.getUserEntityInfo()); + }catch (PLException e) { + e.printStackTrace(); + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + return res; + } + + /** + * 妫�鏌ユ搷浣滄槸鍚﹁寮曠敤 + * @param operateId + * @return 0琛ㄧず鏃犲紩鐢紝1琛ㄧず琚ā鍧楀紩鐢紝2琛ㄧず鏈夋潈闄愪俊鎭� + * @throws VciException + */ + public int checkOperateIsReferenced(String operateId) throws VciBaseException { + try{ + return (int)platformClientUtil.getFrameworkService().checkOperateIsReferenced(operateId); + }catch (PLException e) { + e.printStackTrace(); + throw new VciBaseException(String.valueOf(e.code),e.messages); + } + } + + /** + * 杩斿洖鍏ㄩ儴鐨� AppConfigCategory 瀵硅薄 + * @return + * @throws VciException + */ + public AppConfigCategoryInfo[] getAppConfigCategorys() throws VciBaseException{ + try{ + AppConfigCategoryInfo[] infos = platformClientUtil.getFrameworkService().getAppConfigCategorys(this.getUserEntityInfo()); + return infos; + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** + * 鏍规嵁鍒嗙被ID杩斿洖鍏ㄩ儴鐨� AppConfigDetail 瀵硅薄 + */ + public AppConfigDetailInfo[] getAppConfigDetailsByID(String clsfId) throws VciBaseException{ + try{ + AppConfigDetailInfo[] infos = platformClientUtil.getFrameworkService().getAppConfigDetailsByCatId(clsfId, this.getUserEntityInfo()); + return infos; + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** + * 娣诲姞銆佷繚瀛� AppConfigCategory 瀵硅薄 + * @param object AppConfigCategoryInfo 瀵硅薄 + */ + public String saveAppConfigCategory(AppConfigCategoryInfo object) throws VciBaseException{ + try{ + return platformClientUtil.getFrameworkService().saveAppConfigCategory(object, this.getUserEntityInfo()); + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** + * 淇敼銆佹洿鏂� AppConfigCategory 瀵硅薄 + * @param object AppConfigCategoryInfo 瀵硅薄 + */ + public boolean updateAppConfigCategory(AppConfigCategoryInfo object) throws VciBaseException{ + try{ + return platformClientUtil.getFrameworkService().updateAppConfigCategory(object, this.getUserEntityInfo()); + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** + * 鏍规嵁鍚嶇О鏌ヨ閰嶇疆椤� + * @param name + * @return + * @throws VciBaseException + */ + public AppConfigDetailInfo[] getAppConfigDetailInfoByName(String name) throws VciBaseException{ + try{ + AppConfigDetailInfo[] appConfigDetailsByName = platformClientUtil.getFrameworkService().getAppConfigDetailsByName(name, this.getUserEntityInfo()); + return appConfigDetailsByName; + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** + * 鏍规嵁 ID 鍒犻櫎 AppConfigCategory 瀵硅薄锛堟壒閲忥級 + * @param ids AppConfigCategory 瀵硅薄鐨� ID 鍒楄〃 + */ + public boolean deleteAppConfigCategory(String[] ids) throws VciBaseException{ + try{ + return platformClientUtil.getFrameworkService().deleteAppConfigCategory(ids, this.getUserEntityInfo()); + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** 娣诲姞銆佷繚瀛� AppConfigDetail 瀵硅薄 + * @param info AppConfigDetailInfo 瀵硅薄 + */ + public String saveAppConfigDetail(AppConfigDetailInfo info) throws VciBaseException{ + try{ + return platformClientUtil.getFrameworkService().saveAppConfigDetail(info, this.getUserEntityInfo()); + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** + * 淇敼銆佹洿鏂� AppConfigDetail 瀵硅薄 + * @param info AppConfigDetailInfo 瀵硅薄 + */ + public boolean updateAppConfigDetail(AppConfigDetailInfo info) throws VciBaseException{ + try{ + return platformClientUtil.getFrameworkService().updateAppConfigDetail(info, this.getUserEntityInfo()); + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + + /** + * 鏍规嵁 ID 鍒犻櫎 AppConfigDetail 瀵硅薄锛堟壒閲忥級 + * @param ids AppConfigDetail 瀵硅薄鐨� ID 鍒楄〃 + */ + public boolean deleteAppConfigDetail(String[] ids) throws VciBaseException{ + try{ + return platformClientUtil.getFrameworkService().deleteAppConfigDetail(ids, this.getUserEntityInfo()); + }catch(PLException e){ + throw new VciBaseException(String.valueOf(e.code), e.messages); + } + } + } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java index 966811e..8137581 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java @@ -1,8 +1,13 @@ package com.vci.web.controller; import com.vci.constant.FrameWorkLangCodeConstant; +import com.vci.corba.framework.data.AppConfigDetailInfo; +import com.vci.corba.framework.data.FuncOperationInfo; +import com.vci.corba.framework.data.OperateInfo; import com.vci.frameworkcore.compatibility.ISmFunctionQueryService; import com.vci.frameworkcore.compatibility.SmHMSysModConfigServiceI; +import com.vci.pagemodel.AppConfigDetailInfoVO; +import com.vci.pagemodel.ExpExcelConditionVO; import com.vci.pagemodel.MenuVO; import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.exception.VciBaseException; @@ -33,7 +38,6 @@ */ @RestController @RequestMapping("/hmSysModConfigController") -@VciUnCheckRight public class HMSysModConfigController { /** @@ -79,7 +83,7 @@ @PostMapping("/addModel") public BaseResult addModel(@RequestBody MenuVO menuVO) { try { - return BaseResult.success(hmSysModConfigService.addModule(menuVO),"妯″潡澧炲姞鎴愬姛"); + return BaseResult.success(hmSysModConfigService.addModule(menuVO),"妯″潡澧炲姞鎴愬姛!"); }catch (Exception e){ e.printStackTrace(); String errorMsg = "澧炲姞妯″潡鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); @@ -123,6 +127,23 @@ } /** + * 鍒犻櫎妯″潡涓嬪叧鑱旂殑鎿嶄綔绫诲瀷 + * @param funcOperationInfo + * @return + */ + @DeleteMapping("/delFuncOperation") + public BaseResult delFuncOperation(@RequestBody FuncOperationInfo funcOperationInfo) { + try { + return BaseResult.success(hmSysModConfigService.delFuncOperation(funcOperationInfo),"妯″潡涓嬫搷浣滅被鍨嬪垹闄ゆ垚鍔�"); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "妯″潡涓嬫搷浣滅被鍨嬪垹闄ゆ椂鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** * 绠$悊鍔熻兘妯″潡銆佷笟鍔″姛鑳芥ā鍧椾笅鐨勫彾瀛愯妭鐐光�斾慨鏀规搷浣滃埆鍚嶆帴鍙� * @param menuVO * @return @@ -133,7 +154,24 @@ return BaseResult.success(hmSysModConfigService.updateAlias(menuVO),"鎿嶄綔鍒悕淇敼鎴愬姛"); }catch (Exception e){ e.printStackTrace(); - String errorMsg = "鎿嶄綔鍒悕淇敼鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + String errorMsg = "鎿嶄綔绫诲瀷鍒悕淇敼鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + * 娣诲姞鎿嶄綔绫诲瀷涓庢ā鍧楃殑鍏宠仈鍏崇郴 + * @param funcOperationInfoList + * @return + */ + @PostMapping("/addFuncOperationType") + public BaseResult addFuncOperationType(@RequestBody List<FuncOperationInfo> funcOperationInfoList) { + try { + return BaseResult.success(hmSysModConfigService.addFuncOperationType(funcOperationInfoList),"涓哄綋鍓嶆ā鍧楁坊鍔犳搷浣滅被鍨嬫垚鍔�"); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "涓哄綋鍓嶆ā鍧楁坊鍔犳搷浣滅被鍨嬫椂鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e); logger.error(errorMsg); throw new VciBaseException(errorMsg); } @@ -141,16 +179,50 @@ /** * 娣诲姞鎿嶄綔绫诲瀷 - * @param menuVOList + * @param operateInfo * @return */ @PostMapping("/addOperationType") - public BaseResult addOperationType(@RequestBody List<MenuVO> menuVOList) { + public BaseResult addOperationType(@RequestBody OperateInfo operateInfo) { try { - return BaseResult.success(hmSysModConfigService.addOperationType(menuVOList),"鎿嶄綔绫诲瀷娣诲姞鎴愬姛"); + return BaseResult.success(hmSysModConfigService.addOperationType(operateInfo),"娣诲姞鎿嶄綔绫诲瀷鎴愬姛"); }catch (Exception e){ e.printStackTrace(); String errorMsg = "鍒犻櫎妯″潡鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + * 淇敼鎿嶄綔绫诲瀷 + * @param operateInfo + * @return + */ + @PutMapping("/updateOperationType") + public BaseResult updateOperationType(@RequestBody OperateInfo operateInfo) { + try { + return BaseResult.success(hmSysModConfigService.updateOperationType(operateInfo),"淇敼鎿嶄綔绫诲瀷鎴愬姛"); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "淇敼鎿嶄綔绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + * 鍒犻櫎鎿嶄綔绫诲瀷 + * @param operateInfo + * @return + */ + @DeleteMapping("/delOperationType") + public BaseResult delOperationType(@RequestBody OperateInfo operateInfo) { + try { + return BaseResult.success(hmSysModConfigService.delOperationType(operateInfo),"鍒犻櫎鎿嶄綔绫诲瀷鎴愬姛"); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "鍒犻櫎鎿嶄綔绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); logger.error(errorMsg); throw new VciBaseException(errorMsg); } @@ -234,7 +306,7 @@ * 瀵煎叆妯″潡 * @return */ - @GetMapping("/importModule") + @PostMapping("/importModule") public BaseResult importModule(@RequestParam("files") List<MultipartFile> files) { LinkedList<File> fileList = new LinkedList<>(); try { @@ -244,7 +316,7 @@ file.transferTo(file1); fileList.add(file1); } - if(Func.isEmpty(fileList)){ + if(Func.isNotEmpty(fileList)){ return hmSysModConfigService.importModule(fileList); } else { return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"鏃犲鍏ョ殑鏂囦欢"}); @@ -256,4 +328,111 @@ } } + /** + *鏌ヨ绯荤粺閰嶇疆鏍� + * @return + */ + @GetMapping("/getAppConfigCategoryInfo") + public BaseResult getAppConfigCategoryInfo() { + try { + return BaseResult.dataList(hmSysModConfigService.getAppConfigCategoryInfo()); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "鏌ヨ绯荤粺閰嶇疆鍒楄〃鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + *鏍规嵁鍒嗙被ID杩斿洖鍏ㄩ儴鐨� AppConfigDetail 瀵硅薄 + * @return + */ + @GetMapping("/getAppConfigDetailsByID") + public BaseResult getAppConfigDetailsByID(String clsId) { + try { + return BaseResult.dataList(hmSysModConfigService.getAppConfigDetailsByID(clsId)); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "鏌ヨ閰嶇疆椤瑰垪琛ㄦ椂鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + * 娣诲姞鎿嶄綔绫诲瀷 + * @param appConfigDetailInfoVO + * @return + */ + @PostMapping("/addAppConf") + public BaseResult addAppConf(@RequestBody AppConfigDetailInfoVO appConfigDetailInfoVO) { + try { + boolean res = hmSysModConfigService.addAppConf(appConfigDetailInfoVO.getAppConfigDetailInfo(), appConfigDetailInfoVO.isConfCategorys()); + return res ? BaseResult.success("娣诲姞鎿嶄綔绫诲瀷鎴愬姛"):BaseResult.fail("娣诲姞鎿嶄綔绫诲瀷澶辫触锛�"); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "娣诲姞鎿嶄綔绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + * 淇敼鎿嶄綔绫诲瀷 + * @param appConfigDetailInfoVO + * @return + */ + @PutMapping("/updateAppConf") + public BaseResult updateAppConf(@RequestBody AppConfigDetailInfoVO appConfigDetailInfoVO) { + try { + boolean res = hmSysModConfigService.updateAppConf(appConfigDetailInfoVO.getAppConfigDetailInfo(),appConfigDetailInfoVO.isConfCategorys()); + return res ? BaseResult.success("淇敼鎿嶄綔绫诲瀷鎴愬姛"):BaseResult.fail("淇敼鎿嶄綔绫诲瀷澶辫触锛�"); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "淇敼鎿嶄綔绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + * 鍒犻櫎鎿嶄綔绫诲瀷 + * @param ids + * @param isConfCategorys + * @return + */ + @DeleteMapping("/delAppConf") + public BaseResult delAppConf(String[] ids,boolean isConfCategorys) { + try { + return hmSysModConfigService.delAppConf(ids,isConfCategorys) ? BaseResult.success("鍒犻櫎鎿嶄綔绫诲瀷鎴愬姛"):BaseResult.fail("鍒犻櫎鎿嶄綔绫诲瀷澶辫触锛�"); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "鍒犻櫎鎿嶄綔绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + + /** + * 瀵煎嚭绯荤粺閰嶇疆(閰嶇疆椤瑰垎绫绘垨閰嶇疆椤�) + * @return + */ + @PostMapping("/exportSysConf") + public void exportSysConf(@RequestBody ExpExcelConditionVO expExcelConditionVO, HttpServletResponse response) { + try { + String excelPath = hmSysModConfigService.exportSysConf(expExcelConditionVO,response); + ControllerUtil.writeFileToResponse(response,excelPath); + } catch (Exception e) { + String msg = "瀵煎嚭绯荤粺閰嶇疆鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + try { + //鍑洪敊鏃� + e.printStackTrace(); + ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + } + } + } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java index 8e9cf64..b86ab56 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java @@ -1,16 +1,25 @@ package com.vci.web.controller; +import com.vci.corba.common.PLException; +import com.vci.dto.ClonePortalVIDTOList; +import com.vci.dto.DeletePortalVIDTOList; +import com.vci.dto.OsBtmTypeDTO; import com.vci.dto.PortalVIDTO; import com.vci.pagemodel.KeyValue; import com.vci.pagemodel.PortalVIVO; +import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.DataGrid; +import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.enumpck.ItemDblEnum; import com.vci.web.enumpck.ItemTypeEnum; import com.vci.web.service.OsPortalVIServiceI; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -23,6 +32,12 @@ @RestController @RequestMapping("/portalVIController") public class WebPortalVIController { + /** + * 鏃ュ織 + */ + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired private OsPortalVIServiceI portalVIServiceI; /** * 琛ㄥ崟鍒楄〃 @@ -31,24 +46,93 @@ * @param baseQueryObject 鏌ヨ鏉′欢 * @return 鍒楄〃鐨勫唴瀹� */ - @GetMapping( "/referDataGrid") + @GetMapping( "/gridPortalVIDatas") @VciBusinessLog(operateName = "琛ㄥ崟/琛ㄦ牸鍒楄〃") - public DataGrid<PortalVIVO> referDataGrid(BaseQueryObject baseQueryObject){ + public DataGrid<PortalVIVO> gridPortalVIDatas(BaseQueryObject baseQueryObject){ return portalVIServiceI.gridPortalVIVOs(baseQueryObject); } + + /** + *鏍规嵁琛ㄥ崟id鑾峰彇鍏蜂綋鏁版嵁 + * @param id + * @return + */ + @GetMapping( "/getPortalVIById") + @VciBusinessLog(operateName = "鑾峰彇琛ㄥ崟/琛ㄦ牸鏁版嵁") + public BaseResult getPortalVIById(@RequestBody String id,@RequestBody String viType){ + try{ + PortalVIVO portalVIVO= portalVIServiceI.getPortalVIById(id,viType); + return BaseResult.success(portalVIVO); + }catch (Throwable e){ + e.printStackTrace(); + String exceptionMessage = "鍒涘缓涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } /** * 琛ㄥ崟/table淇濆瓨 * @param portalVIDTO * @return */ @PostMapping("/savePortalVI") - @VciBusinessLog(operateName = "娣诲姞琛ㄥ崟/琛ㄦ牸") + @VciBusinessLog(operateName = "淇濆瓨琛ㄥ崟/琛ㄦ牸") public BaseResult savePortalVI(@RequestBody PortalVIDTO portalVIDTO){ if(StringUtils.isNotBlank(portalVIDTO.getId())){ - return portalVIServiceI.edit(portalVIDTO); + return portalVIServiceI.editSave(portalVIDTO); }else{ - return portalVIServiceI.add(portalVIDTO); + return portalVIServiceI.addSave(portalVIDTO); + } + + } + /** + * 涓氬姟绫诲瀷鍒犻櫎 + * btmTypeDTO 涓氬姟绫诲瀷瀵硅薄 + * @return 鍒犻櫎缁撴灉 + */ + @DeleteMapping("/delete") + @VciBusinessLog(operateName = "鍒犻櫎琛ㄥ崟/琛ㄦ牸") + public BaseResult delete(@RequestBody DeletePortalVIDTOList deletePortalVIDTOList){ + try { + return portalVIServiceI.delete(deletePortalVIDTOList) ? BaseResult.success("鍒犻櫎鎴愬姛锛�"):BaseResult.fail("鍒犻櫎澶辫触锛�"); + } catch (PLException e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎琛ㄥ崟鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + /** + * 涓氬姟绫诲瀷鍒犻櫎 + * btmTypeDTO 涓氬姟绫诲瀷瀵硅薄 + * @return 鍒犻櫎缁撴灉 + */ + @DeleteMapping("/deleteByIds") + @VciBusinessLog(operateName = "鍒犻櫎琛ㄥ崟/琛ㄦ牸") + public BaseResult deleteByIds(@RequestBody String ids){ + try { + return portalVIServiceI.delete(ids) ? BaseResult.success("鍒犻櫎鎴愬姛锛�"):BaseResult.fail("鍒犻櫎澶辫触锛�"); + } catch (PLException e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎琛ㄥ崟鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + /** + * + */ + @PostMapping("/clone") + @VciBusinessLog(operateName = "鍒犻櫎琛ㄥ崟/琛ㄦ牸") + public BaseResult clone(@RequestBody ClonePortalVIDTOList portalVIDTOList){ + try { + return portalVIServiceI.clone(portalVIDTOList) ? BaseResult.success("鍒犻櫎鎴愬姛锛�"):BaseResult.fail("鍒犻櫎澶辫触锛�"); + } catch (Throwable e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎琛ㄥ崟鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); } } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java index 45125b2..62df51c 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java @@ -1,5 +1,8 @@ package com.vci.web.service; +import com.vci.corba.common.PLException; import com.vci.corba.portal.data.PortalVI; +import com.vci.dto.ClonePortalVIDTOList; +import com.vci.dto.DeletePortalVIDTOList; import com.vci.dto.PortalVIDTO; import com.vci.pagemodel.PortalVIVO; import com.vci.starter.web.exception.VciBaseException; @@ -23,7 +26,7 @@ * @param baseQueryObject 鏌ヨ瀵硅薄 * @return 閾炬帴绫诲瀷鐨勬樉绀哄璞� */ - DataGrid<PortalVIVO> gridPortalVIVOs(BaseQueryObject baseQueryObject); + DataGrid<PortalVIVO> gridPortalVIVOs(BaseQueryObject baseQueryObject)throws VciBaseException; /*** * 娣诲姞琛ㄥ崟/琛ㄦ牸 @@ -31,15 +34,47 @@ * @return * @throws VciBaseException */ - BaseResult add(PortalVIDTO portalVIDTO) throws VciBaseException; + BaseResult addSave(PortalVIDTO portalVIDTO) throws VciBaseException; + /*** + * 鑾峰彇鍗曟潯鏁版嵁 + * @param id + * @return viType + * @throws VciBaseException + */ + PortalVIVO getPortalVIById(String id,String viType) throws PLException; /*** * 鏇存敼琛ㄥ崟/琛ㄦ牸 * @param portalVIDTO * @return * @throws VciBaseException */ - BaseResult edit(PortalVIDTO portalVIDTO) throws VciBaseException; + BaseResult editSave(PortalVIDTO portalVIDTO) throws VciBaseException; + + /** + * 鍒犻櫎鏁版嵁 + * @param portalVIDTOList + * @return + * @throws PLException + */ + boolean delete(DeletePortalVIDTOList portalVIDTOList)throws PLException; + /** + * 鍒犻櫎鏁版嵁 + * @param ids + * @return + * @throws PLException + */ + boolean delete(String ids)throws PLException; + + /** + * 鍏嬮殕鏁版嵁 + * @param portalVIDTOList + * @return + * @throws PLException + */ + boolean clone(ClonePortalVIDTOList portalVIDTOList)throws Throwable; + + /** *鏌ヨ鎵�鏈夎〃鍗曟垨鑰呰〃鏍� @@ -76,4 +111,17 @@ * @return */ public PortalVI portalVIDTOO2VI(PortalVIDTO portalVIDTO); + + /** + * PortalVI杞垚DTO + * @param PortalVIS + * @return + */ + public List<PortalVIDTO> portalVIO2DTOS(Collection<PortalVI> PortalVIS); + /*** + * PortalVI杞垚DTO + * @param portalVI + * @return + */ + public PortalVIDTO portalVIO2DTO(PortalVI portalVI); } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java index 77fd212..080e08e 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java @@ -1311,8 +1311,8 @@ String attrPath = attributeService.exportAttributes("btmattr", attributes.stream().collect(Collectors.joining(",")),true); //绉诲姩灞炴�у埌閾炬帴绫诲瀷鏂囦欢澶归噷闈㈠幓 - cn.hutool.core.io.FileUtil.move(new File(attrPath), new File(defaultTempFolder),true); - cn.hutool.core.io.FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\"))); + FileUtil.move(new File(attrPath), new File(defaultTempFolder),true); + FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\"))); }catch (IOException e) { throw new RuntimeException(e); } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java index 4b51876..76e4cc3 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java @@ -5,9 +5,7 @@ import com.vci.corba.common.PLException; import com.vci.corba.portal.PortalService.GetPagePortalVIArrayByPageInfoResult; import com.vci.corba.portal.data.PortalVI; -import com.vci.dto.PRMDTO; -import com.vci.dto.PRMItemDTO; -import com.vci.dto.PortalVIDTO; +import com.vci.dto.*; import com.vci.model.*; import com.vci.pagemodel.*; import com.vci.starter.web.exception.VciBaseException; @@ -22,9 +20,12 @@ import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.UITools; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -37,6 +38,10 @@ */ @Service public class OsPortalVIServiceImpl implements OsPortalVIServiceI { + /** + * 鏃ュ織 + */ + private Logger logger = LoggerFactory.getLogger(getClass()); /** * 鍔犺浇鑷韩 */ @@ -72,19 +77,22 @@ } String viName=StringUtils.isBlank(conditionMap.get("viName"))?"":conditionMap.get("viName"); String viTypeLabel=StringUtils.isBlank(conditionMap.get("viType"))?"":conditionMap.get("viType"); - PortalVIType portalVIType= PortalVIType.getByLabel(viTypeLabel); + PortalVIType portalVIType= PortalVIType.getByName(viTypeLabel); Short viType=-1; if(portalVIType!=null){ viType=portalVIType.getIntVal(); } String viTypeFlagLabel=StringUtils.isBlank(conditionMap.get("viTypeFlag"))?"":conditionMap.get("viTypeFlag"); - PortalVITypeFlag portalVITypeFlag= PortalVITypeFlag.getByLabel(viTypeFlagLabel); + PortalVITypeFlag portalVITypeFlag= PortalVITypeFlag.getByName(viTypeFlagLabel); Short viTypeFlag=-1; if(portalVITypeFlag!=null){ viTypeFlag=portalVITypeFlag.getIntVal(); } long pageIndex=baseQueryObject.getPage(); long pageSize=baseQueryObject.getLimit(); + if(pageSize==-1){ + pageSize=25; + } DataGrid<PortalVIVO> dataGrid = new DataGrid<>(); try { GetPagePortalVIArrayByPageInfoResult pagePortalVIArrayByPageInfoResult= platformClientUtil.getPortalService().getPagePortalVIArrayByPageInfo(typeName,viName,viType,viTypeFlag,pageIndex,pageSize); @@ -110,9 +118,30 @@ * @throws PLException */ @Override - public BaseResult add(PortalVIDTO portalVIDTO) throws VciBaseException { + public BaseResult addSave(PortalVIDTO portalVIDTO) throws VciBaseException { return savePortalVIDTO(portalVIDTO,false); } + + /** + * 鏍规嵁琛ㄥ崟id鑾峰彇鍏蜂綋鏁版嵁 + * @param id + * @param viType + * @return + * @throws VciBaseException + */ + @Override + public PortalVIVO getPortalVIById(String id,String viType) throws PLException { + VciBaseUtil.alertNotNull(id,"涓婚敭涓虹┖锛�"); + String lableName=PortalVIType.Form.getLabel(); + if(PortalVIType.Table.getName()==viType){ + lableName=PortalVIType.Table.getLabel(); + } + PortalVIVO portalVIVO=new PortalVIVO(); + PortalVI portalVI= platformClientUtil.getPortalService().getPortalVIById(id); + portalVIVO=portalVIDOO2VO(portalVI); + return portalVIVO; + } + /*** * 琛ㄥ崟/琛ㄦ牸鏇存敼 * @param portalVIDTO @@ -120,9 +149,102 @@ * @throws PLException */ @Override - public BaseResult edit(PortalVIDTO portalVIDTO) throws VciBaseException { + public BaseResult editSave(PortalVIDTO portalVIDTO) throws VciBaseException { return savePortalVIDTO(portalVIDTO,true); } + + @Override + public boolean delete(DeletePortalVIDTOList portalVIDTOList) throws PLException { + if(portalVIDTOList==null||CollectionUtils.isEmpty(portalVIDTOList.getPortalVIDTOList())){ + VciBaseUtil.alertNotNull("璇烽�夋嫨瑕佸垹闄ょ殑瀵硅薄!"); + } + try { + for(PortalVIDTO portalVIDTO:portalVIDTOList.getPortalVIDTOList()) { + boolean formFlag = false; + short viType = portalVIDTO.getViType(); + String typeName = portalVIDTO.getTypeName(); + String viewName = portalVIDTO.getViName(); + String id = portalVIDTO.getId(); + if (viType == PortalVIType.Form.getIntVal()) { + // 鍒ゆ柇璇ヨ〃鍗曟槸鍚﹀湪琛ㄦ牸涓寮曠敤 + formFlag = platformClientUtil.getPortalService().judgeDeleteButton(id, typeName); + if (formFlag) { + throw new Throwable(viewName + "琛ㄥ崟宸茬粡鍦ㄨ〃鏍间腑琚紩鐢紝璇烽噸鏂伴�夋嫨瑕佸垹闄ょ殑瀵硅薄!"); + } + } + // 鍒ゆ柇璇ヨ〃鍗曟垨琛ㄦ牸鏄惁鍦║I瀹氫箟鏃惰寮曠敤 + formFlag = platformClientUtil.getPortalService().judgeUpdateButton(viType, viewName, typeName); + if (formFlag) { + throw new Throwable(viewName + "鏁版嵁宸茬粡琚玌I缁勪欢寮曠敤锛岃閲嶆柊閫夋嫨瑕佸垹闄ょ殑瀵硅薄!"); + } + UITools.getService().deletePortalVIByID(id); + } + }catch (Throwable e){ + String exceptionMessage = "鍒犻櫎琛ㄥ崟鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + throw new PLException("100",new String[]{exceptionMessage}); + } + return true; + } + + @Override + public boolean delete(String ids) throws PLException { + VciBaseUtil.alertNotNull(ids,"涓婚敭"); + List<String> idsList= VciBaseUtil.str2List(ids); + List<PortalVI> PortalVIList= new ArrayList<>(); + DeletePortalVIDTOList portalVIDTOList=new DeletePortalVIDTOList(); + idsList.stream().forEach(id->{ + PortalVI portalVI= null; + try { + portalVI = platformClientUtil.getPortalService().getPortalVIById(id); + PortalVIList.add(portalVI); + } catch (PLException e) { + e.printStackTrace(); + } + }); + portalVIDTOList.setPortalVIDTOList(portalVIO2DTOS(PortalVIList)); + return delete(portalVIDTOList); + } + + /** + * 琛ㄥ崟/琛ㄦ牸鍏嬮殕 + * @param clonePortalVIDTOList + * @return + * @throws VciBaseException + */ + @Override + public boolean clone(ClonePortalVIDTOList clonePortalVIDTOList) throws VciBaseException { + if(clonePortalVIDTOList==null||CollectionUtils.isEmpty(clonePortalVIDTOList.getClonePortalVIDTOList())){ + throw new VciBaseException("璇烽�夋嫨瑕佸厠闅嗙殑瀵硅薄!"); + } + try { + for (ClonePortalVIDTO clonedestObject : clonePortalVIDTOList.getClonePortalVIDTOList()) { + String viName = clonedestObject.getViName(); + PortalVIDTO portalVIDTO = clonedestObject.getOldPortalVIDTO(); + String typeName = clonedestObject.getTypeName(); + short typeFlag = clonedestObject.getTypeFlag(); + if (viName != null) { + VciBaseUtil.alertNotNull(viName, "鍏嬮殕鍚嶇О涓嶅厑璁镐负绌�"); + PortalVI portalVI = UITools.getService().getPortalVIById(portalVIDTO.getId()); + portalVI.id = ObjectUtility.getNewObjectID36(); + portalVI.viName = viName; + //濡傛灉鍏嬮殕閫夋嫨浜嗕笟鍔$被鍨嬪垯鎷疯礉鍒版柊鐨勪笟鍔$被鍨嬩笅 + if (StringUtils.isNotBlank(typeName)) { + portalVI.typeName = typeName; + } + if (typeFlag == PortalVITypeFlag.BtmType.getIntVal() || typeFlag == PortalVITypeFlag.LinkType.getIntVal()) { + portalVI.typeFlag = typeFlag; + } + UITools.getService().savePortalVI(portalVI); + } + } + }catch (PLException e){ + throw new VciBaseException("鍏嬮殕鍑虹幇寮傚父:"+e.getMessage()); + } + return true; + } + + private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit) { boolean _isBtm=false; @@ -158,7 +280,7 @@ throw new Throwable("璇�"+labelName+"宸茬粡琚紩鐢紝涓嶈兘淇敼鍚嶇О!"); } } catch (PLException e) { - throw new Throwable("鏌ヨ"); + throw new Throwable("鏌ヨ鍘熸湁琛ㄥ崟鍑虹幇寮傚父:"+e.getMessage()); } if (!portalVI.id.equals(portalVIDTO.getId())) { if (portalVI.viName.equals(portalVIDTO.getViName())) { @@ -175,48 +297,29 @@ }else{ flag=platformClientUtil.getPortalService().judgeUpdateButton(portalVIDTO.getTypeFlag(), portalVIDTO.getViName(), portalVIDTO.getTypeName()); } - flag= saveForm(portalVIDTO,isEdit); + PortalVI pvi=portalVIDTOO2VI(portalVIDTO); + if (!isEdit) { + flag= platformClientUtil.getPortalService().savePortalVI(pvi); + } else { + flag= platformClientUtil.getPortalService().updatePortalVI(pvi); + } if(flag){ return BaseResult.success("淇濆瓨"+labelName+"鎴愬姛!"); }else{ new Throwable("淇濆瓨"+labelName+"澶辫触!"); } } catch (Throwable e) { - // throw new VciBaseException("淇濆瓨琛ㄥ崟鍑虹幇寮傚父锛�"+e.getMessage()); - return BaseResult.fail("淇濆瓨"+labelName+"鍑虹幇寮傚父锛�"+e.getMessage()); + String exceptionMessage = "淇濆瓨"+labelName+"鍑虹幇寮傚父锛�"+ VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } return BaseResult.success("淇濆瓨"+labelName+"鎴愬姛!"); } - - /** - * 琛ㄥ崟/琛ㄦ牸 - * @param portalVIDTO - * @param isEdit - * @return - */ - private boolean saveForm(PortalVIDTO portalVIDTO,boolean isEdit) { - List<PRMItemDO> prmItemList = new ArrayList<PRMItemDO>(); - try { - PortalVI pvi=portalVIDTOO2VI(portalVIDTO); - boolean res=false; - if (!isEdit) { - res= platformClientUtil.getPortalService().savePortalVI(pvi); - } else { - res= platformClientUtil.getPortalService().updatePortalVI(pvi); - } - return res; - } catch (Throwable e) { - e.printStackTrace(); - return false; - } - } - @Override public Map<String, PortalVIVO> selectAllPortalVIMap() throws VciBaseException { return null; } - - /** * 鍒ゆ柇姣忛〉琛屾暟瀹氫箟鏄惁姝g‘ @@ -294,6 +397,22 @@ }); return portalVIS; } + /** + * 琛ㄥ崟鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄 + * @param PortalVIS 琛ㄥ崟鐨勫璞� + * @return 鏄剧ず瀵硅薄 + */ + @Override + public List<PortalVIDTO> portalVIO2DTOS(Collection<PortalVI> PortalVIS) { + List<PortalVIDTO>PortalVIDTOS = new ArrayList<>(); + Optional.ofNullable(PortalVIS).orElseGet(()->new ArrayList<>()).stream().forEach(PortalVI -> { + PortalVIDTO PPortalVIDTO = portalVIO2DTO(PortalVI); + PortalVIDTOS.add(PPortalVIDTO); + }); + return PortalVIDTOS; + } + + /** * 琛ㄥ崟鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄 @@ -317,7 +436,24 @@ } return portalVI; } - + /** + * 琛ㄥ崟鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄 + * @param portalVI + * @return + */ + @Override + public PortalVIDTO portalVIO2DTO(PortalVI portalVI) { + PortalVIDTO portalVIDTO=new PortalVIDTO(); + portalVIDTO.setId(portalVI.id); + portalVIDTO.setTypeFlag(portalVI.typeFlag); + portalVIDTO.setTypeName(portalVI.typeName); + portalVIDTO.setViName(portalVI.viName); + portalVIDTO.setViType(portalVI.viType); + short viType =portalVIDTO.getViType(); + PRMDO prmdo= UITools.getPRM(portalVI.prm); + portalVIDTO.setPrm(prmDOO2DTOS(prmdo,viType)); + return portalVIDTO; + } /** * 琛ㄥ崟鏁版嵁瀵硅薄杞崲 * @param prmdto @@ -332,6 +468,20 @@ return prmdo; } + /** + * 琛ㄥ崟鏁版嵁瀵硅薄杞崲 + * @param prmdo + * @param viType + * @return + */ + private PRMDTO prmDOO2DTOS( PRMDO prmdo, short viType) { + PRMDTO prmdto=new PRMDTO(); + prmdto.setShowCols(prmdo.getShowCols()); + prmdto.setFormQtName(prmdo.getFormQtName()); + prmdto.setPrmItemList(pRMItemDOO2DTOS(prmdo.getPrmItemList(),viType)); + return prmdto; + } + @Override public PortalVIVO portalVIDOO2VO(PortalVI portalVI) { PortalVIVO portalVIVO=new PortalVIVO(); @@ -341,8 +491,10 @@ portalVIVO.setViName(portalVI.viName); portalVIVO.setViType(portalVI.viType); String prm= portalVI.prm; - PRMDO prmdo= UITools.getPRM(prm); - portalVIVO.setPrm(prmDOO2VOS(prmdo,portalVI.viType)); + if(StringUtils.isNotBlank(prm)) { + PRMDO prmdo = UITools.getPRM(prm); + portalVIVO.setPrm(prmDOO2VOS(prmdo, portalVI.viType)); + } return portalVIVO; } private PRMVO prmDOO2VOS(PRMDO prmdo,short viType){ @@ -366,6 +518,15 @@ Optional.ofNullable(prmItemDTOS).orElseGet(()->new ArrayList<>()).stream().forEach(PRMItemDTO -> { PRMItemDO PRMItemDO = pRMItemDTOO2DO(PRMItemDTO,viType); portalVIVOS.add(PRMItemDO); + }); + return portalVIVOS; + } + + public List<PRMItemDTO> pRMItemDOO2DTOS(Collection<PRMItemDO> prmItemDOS,short viType) { + List<PRMItemDTO> portalVIVOS = new ArrayList<>(); + Optional.ofNullable(prmItemDOS).orElseGet(()->new ArrayList<>()).stream().forEach(prmItemDO -> { + PRMItemDTO prmItemDTO = pRMItemDOO2DTO(prmItemDO,viType); + portalVIVOS.add(prmItemDTO); }); return portalVIVOS; } @@ -501,7 +662,72 @@ } return prmItemVO; } - + /** + * 鏁版嵁瀵硅薄杞崲 + * @param prmItemDO 鏁版嵁瀵硅薄 + * @param viType 琛ㄥ崟绫诲瀷 + * @return + */ + private PRMItemDTO pRMItemDOO2DTO(PRMItemDO prmItemDO,short viType) { + PRMItemDTO prmItemDTO=new PRMItemDTO(); + prmItemDTO.setItemBat(prmItemDO.getItemBat()); + prmItemDTO.setItemCols(prmItemDO.getItemCols()); + prmItemDTO.setItemEQ(prmItemDO.getItemEQ()); + prmItemDTO.setItemDbl(prmItemDO.getItemDbl()); + prmItemDTO.setItemCut(prmItemDO.getItemCut()); + prmItemDTO.setItemOR(prmItemDO.getItemOR()); + prmItemDTO.setItemAddFilter(prmItemDO.getItemAddFilter()); + prmItemDTO.setItemField(prmItemDO.getItemField()); + prmItemDTO.setItemImgWH(prmItemDO.getItemImgWH()); + prmItemDTO.setItemCtrlDisplyCol(prmItemDO.getItemCtrlDisplyCol());//鎺у埗鏄剧ず鍒� + prmItemDTO.setItemDateFormat(prmItemDO.getItemDateFormat());// 鏁版嵁涓烘棩鏈熺被鍨嬫椂鐨勬牸寮忓寲瀛楃涓� 濡� yyyy-MM-dd HH:mm:ss + prmItemDTO.setItemInObj(prmItemDO.getItemInObj()); + prmItemDTO.setItemName(prmItemDO.getItemName()); + prmItemDTO.setItemCustomClass(prmItemDO.getItemCustomClass());//鑷畾涔夌被璺緞 + prmItemDTO.setItemIsHidden(prmItemDO.getItemIsHidden()); + prmItemDTO.setItemIsEditable(prmItemDO.getItemIsEditable()); + prmItemDTO.setItemIsRequired(prmItemDO.getItemIsRequired()); + prmItemDTO.setItemFieldWidth(prmItemDO.getItemFieldWidth()); + prmItemDTO.setItemTxf(prmItemDO.getItemTxf()); + prmItemDTO.setItemRows(prmItemDO.getItemRows()); + prmItemDTO.setItemHrefConf(prmItemDO.getItemHrefConf());//瓒呴摼鎺ラ厤缃� + prmItemDTO.setItemTips(prmItemDO.getItemTips()); + prmItemDTO.setItemTrim(prmItemDO.getItemTrim()); + prmItemDTO.setItemDateFormat(prmItemDO.getItemDateFormat()); + prmItemDTO.setItemCtrlDisplyCondition(prmItemDO.getItemCtrlDisplyCondition());////鎺у埗鏄剧ず鏉′欢 + prmItemDTO.setItemEditableProgram(prmItemDO.getItemEditableProgram()); + prmItemDTO.setItemEditCondition(prmItemDO.getItemEditCondition()); + prmItemDTO.setItemHrefFields(prmItemDO.getItemHrefFields());//瓒呴摼鎺ュ瓧娈� + prmItemDTO.setItemValueList(prmItemDO.getItemValueList()); + prmItemDTO.setItemValue(prmItemDO.getItemValue()); + prmItemDTO.setItemStyle(prmItemDO.getItemStyle()); + prmItemDTO.setItemShowExpression(prmItemDO.getItemShowExpression());// 鏄剧ず琛ㄨ揪寮� ${aa}-${bb} + prmItemDTO.setItemSeniorQueryColsCounts(prmItemDO.getItemSeniorQueryColsCounts());//楂樼骇鏌ヨ鍚勫垪浣跨敤娆℃暟 + prmItemDTO.setItemQuerySql(prmItemDO.getItemQuerySql());//楂樼骇鏌ヨsql + prmItemDTO.setItemType(prmItemDO.getItemType());//灞炴�у熀鏈被鍨� + prmItemDTO.setItemTypeText(ItemTypeEnum.getTextByValue(prmItemDO.getItemType()));//灞炴�у熀鏈被鍨嬫樉绀哄�� + prmItemDTO.setItemScript(prmItemDO.getItemScript()); + prmItemDTO.setItemRight(prmItemDO.getItemRight()); + prmItemDTO.setItemQueryRefFields(prmItemDO.getItemQueryRefFields());//鏌ヨ鍏宠仈鍒� + prmItemDTO.setItemQtName(prmItemDO.getItemQtName()); + prmItemDTO.setItemParentFolderName(prmItemDO.getItemParentFolderName());//鐖舵枃浠跺す鍚嶇О + prmItemDTO.setItemPageSize(prmItemDO.getItemPageSize()); + prmItemDTO.setItemOutType(prmItemDO.getItemOutType()); + prmItemDTO.setItemOutFields(prmItemDO.getItemOutFields()); + prmItemDTO.setItemListVal(prmItemDO.getItemListVal());//鍙傜収鍊� + prmItemDTO.setItemListTxt(prmItemDO.getItemListTxt()); + prmItemDTO.setItemListTable(prmItemDO.getItemListTable()); + prmItemDTO.setItemKeyFields(prmItemDO.getItemKeyFields()); + prmItemDTO.setItemIsShowFolder(prmItemDO.getItemIsShowFolder());//鏄惁鏄剧ず鏂囦欢澶� + prmItemDTO.setItemIsNavigatorExpand(prmItemDO.getItemIsNavigatorExpand());////鏌ヨ鍖哄煙鏄剧ず鎺у埗 + prmItemDTO.setItemIsHttpSave(prmItemDO.getItemIsHttpSave()); + prmItemDTO.setItemHttpVolumnPath(prmItemDO.getItemHttpVolumnPath()); + prmItemDTO.setItemHttpPathField(prmItemDO.getItemHttpPathField()); + if(viType==PortalVIType.Table.getIntVal()) {//濡傛灉鏄〃鏍� + initTableConfigDOO2VOData(prmItemDTO,prmItemDO); + } + return prmItemDTO; + } /** * 鍒濆鍖栬〃鏍兼墍鐢ㄧ壒娈婂瓧娈甸厤缃� * @param prmItemVO @@ -510,9 +736,9 @@ private void initTableConfigDOO2VOData(PRMItemVO prmItemVO,PRMItemDO prmItemDO){ prmItemVO.setItemFieldWidthList(initItemFieldWidthList(prmItemDO.getItemOutFields(),prmItemDO.getItemFieldWidth()));//鍒楁樉绀哄娈� itemOutFieldList 鐩稿尮閰� prmItemVO.setItemSeniorQueryBOS(initItemSeniorQueryBOData(prmItemDO.getItemSeniorQueryCols(),prmItemDO.getItemSeniorQueryColsCounts(),prmItemDO.getItemQuerySql()));//楂樼骇鏌ヨ瀵硅薄 - List<String> allKeyList= getRefFormVIName(prmItemVO.getItemInObj()); - List<String> itemOutFieldList =VciBaseUtil.str2List(prmItemVO.getItemOutFields()); - List<String> itemKeyFieldList =VciBaseUtil.str2List(prmItemVO.getItemKeyFields()); + List<String> allKeyList= getRefFormVIName(prmItemDO.getItemInObj()); + List<String> itemOutFieldList =VciBaseUtil.str2List(prmItemDO.getItemOutFields()); + List<String> itemKeyFieldList =VciBaseUtil.str2List(prmItemDO.getItemKeyFields()); List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); prmItemVO.setItemSelectoutFieldList(itemSelectoutFieldList);//寰呴�夋嫨鐨勫睘鎬у瓧娈� prmItemVO.setItemOutFieldList(itemOutFieldList);//闇�瑕佷娇鐢ㄧ殑闆嗗悎 @@ -525,6 +751,24 @@ * @param prmItemDTO * @param prmItemDO */ + private void initTableConfigDOO2VOData(PRMItemDTO prmItemDTO,PRMItemDO prmItemDO){ + prmItemDTO.setItemFieldWidthList(initItemFieldWidthList(prmItemDO.getItemOutFields(),prmItemDO.getItemFieldWidth()));//鍒楁樉绀哄娈� itemOutFieldList 鐩稿尮閰� + prmItemDTO.setItemSeniorQueryBOS(initItemSeniorQueryBOData(prmItemDO.getItemSeniorQueryCols(),prmItemDO.getItemSeniorQueryColsCounts(),prmItemDO.getItemQuerySql()));//楂樼骇鏌ヨ瀵硅薄 + List<String> allKeyList= getRefFormVIName(prmItemDO.getItemInObj()); + List<String> itemOutFieldList =VciBaseUtil.str2List(prmItemDO.getItemOutFields()); + List<String> itemKeyFieldList =VciBaseUtil.str2List(prmItemDO.getItemKeyFields()); + List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); + prmItemDTO.setItemSelectoutFieldList(itemSelectoutFieldList);//寰呴�夋嫨鐨勫睘鎬у瓧娈� + prmItemDTO.setItemOutFieldList(itemOutFieldList);//闇�瑕佷娇鐢ㄧ殑闆嗗悎 + List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); + prmItemDTO.setItemSearchFieldList(itemSearchFieldList);//寰呮悳绱㈠瓧娈� + prmItemDTO.setItemKeyFieldList(itemKeyFieldList);//鎼滅储瀛楁 + } + /** + * 鍒濆鍖栬〃鏍兼墍鐢ㄧ壒娈婂瓧娈甸厤缃� + * @param prmItemDTO + * @param prmItemDO + */ private void initTableConfigDTOO2DOData(PRMItemDO prmItemDO,PRMItemDTO prmItemDTO){ prmItemDO.setItemOutFields(VciBaseUtil.array2String(prmItemDTO.getItemOutFieldList().toArray(new String[]{})));//闇�瑕佷娇鐢ㄧ殑瀛楁 diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/resources/menuConfig.json b/Source/plt-web/plt-web-parent/plt-web/src/main/resources/menuConfig.json index ff3052b..a40e583 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/resources/menuConfig.json +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/resources/menuConfig.json @@ -1,91 +1,141 @@ { - "hasChildren": true, - "children": [ - { - "hasChildren": true, - "children": [], - "id": "systemManagmentNode", - "name": "绠$悊鍔熻兘妯″潡", - "parentId": "VCIBaseTreeNode", - "code": "systemManagmentNode", - "alias": "system", - "meta": { - "keepAlive": false + "sysModuleNode": { + "hasChildren": true, + "children": [ + { + "hasChildren": true, + "children": [], + "id": "systemManagmentNode", + "name": "绠$悊鍔熻兘妯″潡", + "parentId": "VCIBaseTreeNode", + "code": "systemManagmentNode", + "alias": "system", + "meta": { + "keepAlive": false + }, + "sort": 2, + "soruce": "", + "path": "views/systemModel/mangeModel/index" }, - "sort": 2, - "soruce": "", - "path": "views/systemModel/mangeModel/index" + { + "hasChildren": true, + "children": [], + "id": "modelManagmentNode", + "name": "涓氬姟鍔熻兘妯″潡", + "parentId": "VCIBaseTreeNode", + "code": "modelManagmentNode", + "alias": "model", + "meta": { + "keepAlive": false + }, + "sort": 3, + "soruce": "", + "path": "views/systemModel/businessModel/index" + }, + { + "hasChildren": true, + "children": [], + "id": "operateNode", + "name": "鎿嶄綔绫诲瀷绠$悊", + "parentId": "VCIBaseTreeNode", + "code": "operateNode", + "alias": "operate", + "meta": { + "keepAlive": false + }, + "sort": 4, + "soruce": "", + "path": "views/systemModel/operateType/index" + }, + { + "hasChildren": false, + "children": [], + "id": "sysOptionNode", + "name": "绯荤粺閰嶇疆", + "parentId": "VCIBaseTreeNode", + "code": "sysOptionNode", + "alias": "sysOption", + "meta": { + "keepAlive": false + }, + "sort": 5, + "soruce": "", + "path": "views/systemModel/systemConfig/index" + }, + { + "hasChildren": false, + "children": [], + "id": "sysMonitorNode", + "name": "绯荤粺杩愯鐩戞帶", + "parentId": "VCIBaseTreeNode", + "code": "sysMonitorNode", + "alias": "sysMonitor", + "meta": { + "keepAlive": false + }, + "sort": 5, + "soruce": "", + "path": "views/systemModel/systemMonitor/index" + } + ], + "id": "VCIBaseTreeNode", + "name": "绯荤粺妯″潡閰嶇疆", + "parentId": "systemManagmentNode", + "code": "rootNode", + "alias": "root", + "meta": { + "keepAlive": false }, - { - "hasChildren": true, - "children": [], - "id": "modelManagmentNode", - "name": "涓氬姟鍔熻兘妯″潡", - "parentId": "VCIBaseTreeNode", - "code": "modelManagmentNode", - "alias": "model", - "meta": { - "keepAlive": false - }, - "sort": 3, - "soruce": "", - "path": "views/systemModel/businessModel/index" - }, - { - "hasChildren": true, - "children": [], - "id": "operateNode", - "name": "鎿嶄綔绫诲瀷绠$悊", - "parentId": "VCIBaseTreeNode", - "code": "operateNode", - "alias": "operate", - "meta": { - "keepAlive": false - }, - "sort": 4, - "soruce": "", - "path": "views/systemModel/operateType/index" - }, - { - "hasChildren": false, - "children": [], - "id": "sysOptionNode", - "name": "绯荤粺閰嶇疆", - "parentId": "VCIBaseTreeNode", - "code": "sysOptionNode", - "alias": "sysOption", - "meta": { - "keepAlive": false - }, - "sort": 5, - "soruce": "", - "path": "views/systemModel/systemConfig/index" - }, - { - "hasChildren": false, - "children": [], - "id": "sysMonitorNode", - "name": "绯荤粺杩愯鐩戞帶", - "parentId": "VCIBaseTreeNode", - "code": "sysMonitorNode", - "alias": "sysMonitor", - "meta": { - "keepAlive": false - }, - "sort": 5, - "soruce": "", - "path": "views/systemModel/systemMonitor/index" - } - ], - "id": "VCIBaseTreeNode", - "name": "绯荤粺妯″潡閰嶇疆", - "parentId": "systemManagmentNode", - "code": "rootNode", - "alias": "root", - "meta": { - "keepAlive": false + "sort": 0, + "soruce": "", + "path": "" }, - "sort": 0, - "soruce": "", - "path": "" + "systemManagmentNode": { + "hasChildren": true, + "children": [], + "childType": -1, + "id": "systemManagmentNode", + "name": "绠$悊鍔熻兘妯″潡", + "parentId": "VCIBaseTreeNode", + "code": "systemManagmentNode", + "alias": "system", + "meta": { + "keepAlive": false + }, + "sort": 2, + "soruce": "", + "path": "views/systemModel/mangeModel/index" + }, + "modelManagmentNode": { + "hasChildren": true, + "children": [], + "childType": -1, + "id": "modelManagmentNode", + "name": "涓氬姟鍔熻兘妯″潡", + "parentId": "VCIBaseTreeNode", + "code": "modelManagmentNode", + "alias": "model", + "meta": { + "keepAlive": false + }, + "sort": 3, + "soruce": "", + "path": "views/systemModel/businessModel/index" + }, + "operateNode": { + "hasChildren": true, + "children": [], + "childType": -1, + "id": "operateNode", + "name": "鎿嶄綔绫诲瀷绠$悊", + "parentId": "VCIBaseTreeNode", + "code": "operateNode", + "alias": "operate", + "meta": { + "keepAlive": false + }, + "sort": 4, + "soruce": "", + "path": "views/systemModel/operateType/index" + } } \ No newline at end of file diff --git a/Source/plt-web/plt-web-ui/src/api/systemModel/mangeModel/api.js b/Source/plt-web/plt-web-ui/src/api/systemModel/mangeModel/api.js new file mode 100644 index 0000000..ec4b2c1 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/api/systemModel/mangeModel/api.js @@ -0,0 +1,58 @@ +import request from '@/router/axios'; + +// 鍒楄〃鏌ヨ +export function getSysModelTreeMenuByPID(params) { + return request({ + url: "/api/hmSysModConfigController/getSysModelTreeMenuByPID", + method: "get", + params + }); +} + +// 鏂板 +export function addModel(params) { + return request({ + url: "/api/hmSysModConfigController/addModel", + method: "post", + data:params + }); +} + +// 淇敼 +export function updateModel(params) { + return request({ + url: "/api/hmSysModConfigController/updateModel", + method: "put", + data:params + }); +} + +// 鍒犻櫎 +export function delModule(params) { + return request({ + url: "/api/hmSysModConfigController/delModule", + method: "delete", + data:params + }); +} + +// 瀵煎嚭sql +export function exportFunctionSql (params) { + return request({ + url: '/api/hmSysModConfigController/exportFunctionSql', + method: 'get', + headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, + responseType: 'blob', + params + }) +} + +// 澧炲姞鎿嶄綔绫诲瀷 +export function addOperationType(data) { + return request({ + url: "/api/hmSysModConfigController/addOperationType", + method: "post", + data + }); +} + diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue new file mode 100644 index 0000000..548091c --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue @@ -0,0 +1,456 @@ +<template> + <el-container> + <el-aside> + <basic-container> + <div style="max-height: calc(100vh - 170px);overflow: auto"> + <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> + <span slot-scope="{ node, data }" class="el-tree-node__label"> + <span style="font-size: 15px"> + <i class="el-icon-s-promotion"></i> + {{ (node || {}).label }} + </span> + </span> + </avue-tree> + </div> + </basic-container> + </el-aside> + + <el-main> + <basic-container> + <el-form ref="form" :model="form" label-width="85px" style="height: 79vh"> + <span v-if="form.childType !== 0"> + <el-form-item label="妯″潡鍚嶏細"> + <el-input v-model="form.name" placeholder="璇疯緭鍏ユā鍧楀悕"></el-input> + </el-form-item> + <el-form-item label="妯″潡鍒悕锛�"> + <el-input v-model="form.alias" placeholder="妯″潡鍒悕鐢ㄦ潵璁板綍鏃ュ織浣跨敤"></el-input> + </el-form-item> + <el-form-item label="C/S锛�"> + <el-input v-model="form.pathC" :rows="3" placeholder="璇疯緭鍏/S璺緞" type="textarea"></el-input> + </el-form-item> + <el-form-item label="B/S锛�"> + <el-input v-model="form.path" :rows="3" placeholder="璇疯緭鍏/S璺緞" type="textarea"></el-input> + </el-form-item> + <el-form-item label=".NET锛�"> + <el-input v-model="form.resourceDotNet" :rows="3" placeholder="璇疯緭鍏�.NET" type="textarea"></el-input> + </el-form-item> + <el-form-item label="Mobile锛�"> + <el-input v-model="form.resourceMobile" :rows="3" placeholder="璇疯緭鍏obile" type="textarea"></el-input> + </el-form-item> + <el-form-item label="搴忓彿锛�"> + <el-input v-model="form.sort" placeholder="鏁板瓧锛屾弿杩拌妯″潡鍦ㄥ叾鐖舵ā鍧椾笅鐨勬樉绀洪『搴�"></el-input> + </el-form-item> + <el-form-item label="绠�鍥撅細"> + <el-input v-model="form.source"></el-input> + </el-form-item> + <el-form-item label="鎻忚堪锛�"> + <el-input v-model="form.remark" :rows="3" placeholder="璇疯緭鍏ユ弿杩�" type="textarea"></el-input> + </el-form-item> + <el-form-item label="鏄惁鏈夋晥锛�"> + <el-switch + v-model="form.isValid" + active-color="#13ce66" + inactive-color="#ff4949"> + </el-switch> + <el-link :underline="false" style="margin-left: 20px" type="danger">涓嶇敓鏁堬紙涓嶉�夋嫨锛夋椂锛岃妯″潡鍦ㄥ姛鑳芥ā鍧楁巿鏉冮噷涓嶆樉绀�</el-link> + </el-form-item> + </span> + <span v-if="form.childType === 0"> + <el-form-item label="鍚嶇О锛�"> + <el-input v-model="form.name" :disabled="form.childType === 0" placeholder="璇疯緭鍏ュ悕绉�"></el-input> + </el-form-item> + <el-form-item label="鏍囪瘑锛�"> + <el-input v-model="form.code" :disabled="form.childType === 0" placeholder="璇疯緭鍏ユ爣璇�"></el-input> + </el-form-item> + <el-form-item label="鍒悕锛�"> + <el-input v-model="form.alias" placeholder="璇疯緭鍏ュ埆鍚�"></el-input> + </el-form-item> + <el-form-item label="缂栧彿锛�"> + <el-input v-model="form.sort" :disabled="form.childType === 0" placeholder="璇疯緭鍏ョ紪鍙�"></el-input> + </el-form-item> + <el-form-item label="鎻忚堪锛�"> + <el-input v-model="form.remark" :disabled="form.childType === 0" placeholder="璇疯緭鍏ユ弿杩�"></el-input> + </el-form-item> + <el-form-item label="鏄惁鏈夋晥锛�"> + <el-switch + v-model="form.isValid" + active-color="#13ce66" + inactive-color="#ff4949"> + </el-switch> + + </el-form-item> + </span> + </el-form> + <div v-if="form.childType && form.childType !== 0" class="btnBox"> + <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain + size="small" + type="primary" @click="addClickHandler">澧炲姞 + </el-button> + <el-button v-if="addStatus" icon="el-icon-check" plain size="small" + type="success" @click="addSaveClickHandler">淇濆瓨 + </el-button> + <el-button v-if="!editStatus" :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" + @click="editClickHandler">淇敼 + </el-button> + <el-button v-if="editStatus" icon="el-icon-check" plain size="small" + type="success" @click="editSaveClickHandler">淇濆瓨 + </el-button> + <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" + @click="delClickHandler">鍒犻櫎 + </el-button> + <el-button :disabled="mangeShowBtn ? true : childTypeBtn" icon="el-icon-circle-plus-outline" plain + size="small" + type="primary" @click="addMethodsClickHandler">澧炲姞鎿嶄綔绫诲瀷 + </el-button> + <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" + type="danger" + @click="addClickHandler">鍒犻櫎闈炵郴缁熸ā鍧� + </el-button> + <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" + type="danger" + @click="addClickHandler">鍒犻櫎涓氬姟妯″潡 + </el-button> + <el-button :disabled="!mangeShowBtn" icon="el-icon-upload2" plain size="small" type="primary" + @click="upLoadClickHandler">瀵煎叆 + </el-button> + <el-button :disabled="!mangeShowBtn" icon="el-icon-download" plain size="small" type="primary" + @click="exportClickHandler">瀵煎嚭 + </el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">瀵煎嚭sql + </el-button> + </div> + <div v-if="form.childType === 0" class="btnBox"> + <el-button icon="el-icon-edit" plain size="small" type="primary">淇敼鍒悕 + </el-button> + <el-button icon="el-icon-close" plain size="small" type="danger">鍒犻櫎 + </el-button> + </div> + </basic-container> + </el-main> + <el-dialog + v-dialogDrag + :visible.sync="methodsVisble" + append-to-body="true" + class="avue-dialog" + title="鎿嶄綔鍒嗙被" + width="60%" + > + <avue-crud + ref="methodsCrud" + :data="methodsData" + :option="methodsOption" + :table-loading="methodsLoading" + @row-click="rowMethodsClickHandler" + @selection-change="selectMethodsChange"> + + </avue-crud> + <span slot="footer" class="dialog-footer"> + <el-button @click="methodsVisble = false">鍙� 娑�</el-button> + <el-button type="primary" @click="methodsSaveClickHandler">淇� 瀛�</el-button> + </span> + </el-dialog> + </el-container> +</template> + +<script> +//绠$悊鍔熻兘妯″潡 +import { + getSysModelTreeMenuByPID, + addModel, + updateModel, + delModule, + exportFunctionSql, + addOperationType +} from "@/api/systemModel/mangeModel/api" +import func from "@/util/func"; +import basicOption from "@/util/basic-option"; + +export default { + name: "index", + data() { + return { + lastIndex: null, + methodsList: [], + methodsData: [], + methodsOption: { + ...basicOption, + addBtn: false, + menu: false, + height: 500, + column: [ + { + label: '鎿嶄綔鍒嗙被', + prop: 'name', + sortable: true, + } + ] + }, + methodsLoading: false, + methodsVisble: false, + defalutName: ['name', 'alias', 'pathC', 'path', 'resourceDotNet', 'resourceMobile', 'sort', 'source', 'remark', 'code'], + refresh: Math.random(), + addStatus: false, + editStatus: false, + nodeRow: {}, + form: {}, + treeData: [], + treeOption: { + height: 'auto', + menu: false, + addBtn: false, + defaultExpandAll: false, + props: { + label: 'name', + value: 'id', + children: 'children', + }, + lazy: true, + treeLoad: (node, resolve) => { + const params = { + parentId: node.level === 0 ? "modelManagmentNode" : node.data.id, + modeType: node.level === 0 ? "firstNode" : node.data.modeType, + } + getSysModelTreeMenuByPID(params).then(res => { + resolve(res.data.data.map(item => { + return { + ...item, + id: item.id, + name: item.name, + leaf: !item.hasChildren + } + })) + }) + } + }, + } + }, + created() { + }, + computed: { + /** + * childType + * 涓�-1 鍏ㄩ儴鎸夐挳灞曠ず 绂佺敤淇敼 鍒犻櫎 澧炲姞鎿嶄綔绫诲瀷 + * 涓嶄负-1 闅愯棌 鍒犻櫎闈炵郴缁熸ā鍧� 鍒犻櫎涓氬姟妯″潡 + * 涓�1鏃� 绂佺敤鎿嶄綔绫诲瀷銆佸鍏ャ�佸鍑� + * 涓�2鏃� 绂佺敤澧炲姞 瀵煎叆 瀵煎嚭 + * mangeShowBtn 涓� true 璇存槑鏄《灞傝妭鐐� 鍏ㄩ儴鎸夐挳灞曠ず 绂佺敤淇敼 鍒犻櫎 澧炲姞鎿嶄綔绫诲瀷 + * @returns {Number} + */ + mangeShowBtn() { + return this.form.childType === -1; + }, + childTypeBtn() { + return this.form.childType === 1; + } + }, + methods: { + // 鏍戣鐐瑰嚮 + nodeClick(row) { + console.log(row.childType); + this.form = {...row}; + this.nodeRow = {...row}; + this.addStatus = false; + this.editStatus = false; + }, + + // 鏂板鎸夐挳 + addClickHandler() { + this.resetFormValue(); + this.addStatus = true; + this.editStatus = false; + }, + + // 娓呯┖琛ㄥ崟缁戝畾鍊� + resetFormValue() { + this.defalutName.forEach(key => { + this.form[key] = null; + }) + this.form.isValid = false; + }, + + // 鏂板淇濆瓨鎸夐挳 + addSaveClickHandler() { + if (!this.form.name) { + this.$message.error('妯″潡鍚嶄笉鑳戒负绌�'); + return + } + if (this.form.name.length > 128) { + this.$message.error('妯″潡鍚嶉暱搴﹁秴杩�128锛�'); + return + } + if (this.form.remark && this.form.remark.length > 255) { + this.$message.error('鎻忚堪闀垮害瓒呰繃255锛�'); + return + } + if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { + this.$message.error('.NET鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.pathC && this.form.pathC.length > 255) { + this.$message.error('C/S鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { + this.$message.error('Mobile鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + this.form.parentId = this.form.id; + addModel(this.form).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.msg); + this.addStatus = false; + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + } + }) + }, + + // 淇敼鎸夐挳 + editClickHandler() { + console.log(this.form); + this.editStatus = true; + this.addStatus = false; + }, + + // 淇敼淇濆瓨 + editSaveClickHandler() { + if (!this.form.name) { + this.$message.error('妯″潡鍚嶄笉鑳戒负绌�'); + return + } + if (this.form.name.length > 128) { + this.$message.error('妯″潡鍚嶉暱搴﹁秴杩�128锛�'); + return + } + if (this.form.remark && this.form.remark.length > 255) { + this.$message.error('鎻忚堪闀垮害瓒呰繃255锛�'); + return + } + if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { + this.$message.error('.NET鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.pathC && this.form.pathC.length > 255) { + this.$message.error('C/S鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { + this.$message.error('Mobile鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + + updateModel(this.form).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.msg); + this.editStatus = false; + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + } + }) + }, + + // 鍒犻櫎鎸夐挳 + delClickHandler() { + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + delModule(this.form).then(res => { + console.log(res); + if (res.data.code === 200) { + this.$message.success(res.data.msg); + this.resetFormValue(); + this.addStatus = false; + this.editStatus = false; + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + + // 瀵煎嚭sql + sqlClickExportClick() { + exportFunctionSql({isFunction: true}).then(res => { + func.downloadFileByBlobHandler(res); + this.$message.success('瀵煎嚭鎴愬姛'); + }).catch(err => { + this.$message.error(err); + }); + }, + + // 鎿嶄綔鍒嗙被澶氶�� + selectMethodsChange(list) { + this.methodsList = list; + }, + + // 澧炲姞鎿嶄綔绫诲瀷 + addMethodsClickHandler() { + this.methodsLoading = true; + getSysModelTreeMenuByPID({parentId: 'sysOptionNode'}).then(res => { + if (res.data.code === 200) { + this.methodsVisble = true; + const data = res.data.data[0].children; + this.methodsData = data; + this.methodsLoading = false; + } + }) + }, + + // 澧炲姞鎿嶄綔绫诲瀷淇濆瓨 + methodsSaveClickHandler() { + let list = this.methodsList.map(item => { + return { + funcId: this.nodeRow.id, + operId: item.id, + operName: item.name, + operIndentify: item.code, + operAlias: item.alias, + operDesc: item.remark + } + }) + addOperationType(list).then(res => { + console.log(res) + if (res.data.code === 200) { + this.methodsVisble = false; + this.$message.success(res.data.msg); + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + this.resetFormValue(); + this.form.childType = null; + } + }) + }, + + // 鐐瑰嚮琛� + rowMethodsClickHandler(row) { + func.rowClickHandler( + row, + this.$refs.methodsCrud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.methodsList = []; + } + ); + }, + } +} +</script> + +<style lang="scss" scoped> +::v-deep { + .el-form-item .el-select { + width: 100%; + } +} + +.btnBox { + display: flex; + justify-content: center; +} +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue new file mode 100644 index 0000000..8709445 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue @@ -0,0 +1,456 @@ +<template> + <el-container> + <el-aside> + <basic-container> + <div style="max-height: calc(100vh - 170px);overflow: auto"> + <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> + <span slot-scope="{ node, data }" class="el-tree-node__label"> + <span style="font-size: 15px"> + <i class="el-icon-s-promotion"></i> + {{ (node || {}).label }} + </span> + </span> + </avue-tree> + </div> + </basic-container> + </el-aside> + + <el-main> + <basic-container> + <el-form ref="form" :model="form" label-width="85px" style="height: 79vh"> + <span v-if="form.childType !== 0"> + <el-form-item label="妯″潡鍚嶏細"> + <el-input v-model="form.name" placeholder="璇疯緭鍏ユā鍧楀悕"></el-input> + </el-form-item> + <el-form-item label="妯″潡鍒悕锛�"> + <el-input v-model="form.alias" placeholder="妯″潡鍒悕鐢ㄦ潵璁板綍鏃ュ織浣跨敤"></el-input> + </el-form-item> + <el-form-item label="C/S锛�"> + <el-input v-model="form.pathC" :rows="3" placeholder="璇疯緭鍏/S璺緞" type="textarea"></el-input> + </el-form-item> + <el-form-item label="B/S锛�"> + <el-input v-model="form.path" :rows="3" placeholder="璇疯緭鍏/S璺緞" type="textarea"></el-input> + </el-form-item> + <el-form-item label=".NET锛�"> + <el-input v-model="form.resourceDotNet" :rows="3" placeholder="璇疯緭鍏�.NET" type="textarea"></el-input> + </el-form-item> + <el-form-item label="Mobile锛�"> + <el-input v-model="form.resourceMobile" :rows="3" placeholder="璇疯緭鍏obile" type="textarea"></el-input> + </el-form-item> + <el-form-item label="搴忓彿锛�"> + <el-input v-model="form.sort" placeholder="鏁板瓧锛屾弿杩拌妯″潡鍦ㄥ叾鐖舵ā鍧椾笅鐨勬樉绀洪『搴�"></el-input> + </el-form-item> + <el-form-item label="绠�鍥撅細"> + <el-input v-model="form.source"></el-input> + </el-form-item> + <el-form-item label="鎻忚堪锛�"> + <el-input v-model="form.remark" :rows="3" placeholder="璇疯緭鍏ユ弿杩�" type="textarea"></el-input> + </el-form-item> + <el-form-item label="鏄惁鏈夋晥锛�"> + <el-switch + v-model="form.isValid" + active-color="#13ce66" + inactive-color="#ff4949"> + </el-switch> + <el-link :underline="false" style="margin-left: 20px" type="danger">涓嶇敓鏁堬紙涓嶉�夋嫨锛夋椂锛岃妯″潡鍦ㄥ姛鑳芥ā鍧楁巿鏉冮噷涓嶆樉绀�</el-link> + </el-form-item> + </span> + <span v-if="form.childType === 0"> + <el-form-item label="鍚嶇О锛�"> + <el-input v-model="form.name" :disabled="form.childType === 0" placeholder="璇疯緭鍏ュ悕绉�"></el-input> + </el-form-item> + <el-form-item label="鏍囪瘑锛�"> + <el-input v-model="form.code" :disabled="form.childType === 0" placeholder="璇疯緭鍏ユ爣璇�"></el-input> + </el-form-item> + <el-form-item label="鍒悕锛�"> + <el-input v-model="form.alias" placeholder="璇疯緭鍏ュ埆鍚�"></el-input> + </el-form-item> + <el-form-item label="缂栧彿锛�"> + <el-input v-model="form.sort" :disabled="form.childType === 0" placeholder="璇疯緭鍏ョ紪鍙�"></el-input> + </el-form-item> + <el-form-item label="鎻忚堪锛�"> + <el-input v-model="form.remark" :disabled="form.childType === 0" placeholder="璇疯緭鍏ユ弿杩�"></el-input> + </el-form-item> + <el-form-item label="鏄惁鏈夋晥锛�"> + <el-switch + v-model="form.isValid" + active-color="#13ce66" + inactive-color="#ff4949"> + </el-switch> + + </el-form-item> + </span> + </el-form> + <div v-if="form.childType && form.childType !== 0" class="btnBox"> + <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain + size="small" + type="primary" @click="addClickHandler">澧炲姞 + </el-button> + <el-button v-if="addStatus" icon="el-icon-check" plain size="small" + type="success" @click="addSaveClickHandler">淇濆瓨 + </el-button> + <el-button v-if="!editStatus" :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" + @click="editClickHandler">淇敼 + </el-button> + <el-button v-if="editStatus" icon="el-icon-check" plain size="small" + type="success" @click="editSaveClickHandler">淇濆瓨 + </el-button> + <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" + @click="delClickHandler">鍒犻櫎 + </el-button> + <el-button :disabled="mangeShowBtn ? true : childTypeBtn" icon="el-icon-circle-plus-outline" plain + size="small" + type="primary" @click="addMethodsClickHandler">澧炲姞鎿嶄綔绫诲瀷 + </el-button> + <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" + type="danger" + @click="addClickHandler">鍒犻櫎闈炵郴缁熸ā鍧� + </el-button> + <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" + type="danger" + @click="addClickHandler">鍒犻櫎涓氬姟妯″潡 + </el-button> + <el-button :disabled="!mangeShowBtn" icon="el-icon-upload2" plain size="small" type="primary" + @click="upLoadClickHandler">瀵煎叆 + </el-button> + <el-button :disabled="!mangeShowBtn" icon="el-icon-download" plain size="small" type="primary" + @click="exportClickHandler">瀵煎嚭 + </el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">瀵煎嚭sql + </el-button> + </div> + <div v-if="form.childType === 0" class="btnBox"> + <el-button icon="el-icon-edit" plain size="small" type="primary">淇敼鍒悕 + </el-button> + <el-button icon="el-icon-close" plain size="small" type="danger">鍒犻櫎 + </el-button> + </div> + </basic-container> + </el-main> + <el-dialog + v-dialogDrag + :visible.sync="methodsVisble" + append-to-body="true" + class="avue-dialog" + title="鎿嶄綔鍒嗙被" + width="60%" + > + <avue-crud + ref="methodsCrud" + :data="methodsData" + :option="methodsOption" + :table-loading="methodsLoading" + @row-click="rowMethodsClickHandler" + @selection-change="selectMethodsChange"> + + </avue-crud> + <span slot="footer" class="dialog-footer"> + <el-button @click="methodsVisble = false">鍙� 娑�</el-button> + <el-button type="primary" @click="methodsSaveClickHandler">淇� 瀛�</el-button> + </span> + </el-dialog> + </el-container> +</template> + +<script> +//绠$悊鍔熻兘妯″潡 +import { + getSysModelTreeMenuByPID, + addModel, + updateModel, + delModule, + exportFunctionSql, + addOperationType +} from "@/api/systemModel/mangeModel/api" +import func from "@/util/func"; +import basicOption from "@/util/basic-option"; + +export default { + name: "index", + data() { + return { + lastIndex: null, + methodsList: [], + methodsData: [], + methodsOption: { + ...basicOption, + addBtn: false, + menu: false, + height: 500, + column: [ + { + label: '鎿嶄綔鍒嗙被', + prop: 'name', + sortable: true, + } + ] + }, + methodsLoading: false, + methodsVisble: false, + defalutName: ['name', 'alias', 'pathC', 'path', 'resourceDotNet', 'resourceMobile', 'sort', 'source', 'remark', 'code'], + refresh: Math.random(), + addStatus: false, + editStatus: false, + nodeRow: {}, + form: {}, + treeData: [], + treeOption: { + height: 'auto', + menu: false, + addBtn: false, + defaultExpandAll: false, + props: { + label: 'name', + value: 'id', + children: 'children', + }, + lazy: true, + treeLoad: (node, resolve) => { + const params = { + parentId: node.level === 0 ? "systemManagmentNode" : node.data.id, + modeType: node.level === 0 ? "firstNode" : node.data.modeType, + } + getSysModelTreeMenuByPID(params).then(res => { + resolve(res.data.data.map(item => { + return { + ...item, + id: item.id, + name: item.name, + leaf: !item.hasChildren + } + })) + }) + } + }, + } + }, + created() { + }, + computed: { + /** + * childType + * 涓�-1 鍏ㄩ儴鎸夐挳灞曠ず 绂佺敤淇敼 鍒犻櫎 澧炲姞鎿嶄綔绫诲瀷 + * 涓嶄负-1 闅愯棌 鍒犻櫎闈炵郴缁熸ā鍧� 鍒犻櫎涓氬姟妯″潡 + * 涓�1鏃� 绂佺敤鎿嶄綔绫诲瀷銆佸鍏ャ�佸鍑� + * 涓�2鏃� 绂佺敤澧炲姞 瀵煎叆 瀵煎嚭 + * mangeShowBtn 涓� true 璇存槑鏄《灞傝妭鐐� 鍏ㄩ儴鎸夐挳灞曠ず 绂佺敤淇敼 鍒犻櫎 澧炲姞鎿嶄綔绫诲瀷 + * @returns {Number} + */ + mangeShowBtn() { + return this.form.childType === -1; + }, + childTypeBtn() { + return this.form.childType === 1; + } + }, + methods: { + // 鏍戣鐐瑰嚮 + nodeClick(row) { + console.log(row.childType); + this.form = {...row}; + this.nodeRow = {...row}; + this.addStatus = false; + this.editStatus = false; + }, + + // 鏂板鎸夐挳 + addClickHandler() { + this.resetFormValue(); + this.addStatus = true; + this.editStatus = false; + }, + + // 娓呯┖琛ㄥ崟缁戝畾鍊� + resetFormValue() { + this.defalutName.forEach(key => { + this.form[key] = null; + }) + this.form.isValid = false; + }, + + // 鏂板淇濆瓨鎸夐挳 + addSaveClickHandler() { + if (!this.form.name) { + this.$message.error('妯″潡鍚嶄笉鑳戒负绌�'); + return + } + if (this.form.name.length > 128) { + this.$message.error('妯″潡鍚嶉暱搴﹁秴杩�128锛�'); + return + } + if (this.form.remark && this.form.remark.length > 255) { + this.$message.error('鎻忚堪闀垮害瓒呰繃255锛�'); + return + } + if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { + this.$message.error('.NET鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.pathC && this.form.pathC.length > 255) { + this.$message.error('C/S鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { + this.$message.error('Mobile鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + this.form.parentId = this.form.id; + addModel(this.form).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.msg); + this.addStatus = false; + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + } + }) + }, + + // 淇敼鎸夐挳 + editClickHandler() { + console.log(this.form); + this.editStatus = true; + this.addStatus = false; + }, + + // 淇敼淇濆瓨 + editSaveClickHandler() { + if (!this.form.name) { + this.$message.error('妯″潡鍚嶄笉鑳戒负绌�'); + return + } + if (this.form.name.length > 128) { + this.$message.error('妯″潡鍚嶉暱搴﹁秴杩�128锛�'); + return + } + if (this.form.remark && this.form.remark.length > 255) { + this.$message.error('鎻忚堪闀垮害瓒呰繃255锛�'); + return + } + if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { + this.$message.error('.NET鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.pathC && this.form.pathC.length > 255) { + this.$message.error('C/S鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { + this.$message.error('Mobile鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + + updateModel(this.form).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.msg); + this.editStatus = false; + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + } + }) + }, + + // 鍒犻櫎鎸夐挳 + delClickHandler() { + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + delModule(this.form).then(res => { + console.log(res); + if (res.data.code === 200) { + this.$message.success(res.data.msg); + this.resetFormValue(); + this.addStatus = false; + this.editStatus = false; + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + + // 瀵煎嚭sql + sqlClickExportClick() { + exportFunctionSql({isFunction: true}).then(res => { + func.downloadFileByBlobHandler(res); + this.$message.success('瀵煎嚭鎴愬姛'); + }).catch(err => { + this.$message.error(err); + }); + }, + + // 鎿嶄綔鍒嗙被澶氶�� + selectMethodsChange(list) { + this.methodsList = list; + }, + + // 澧炲姞鎿嶄綔绫诲瀷 + addMethodsClickHandler() { + this.methodsLoading = true; + getSysModelTreeMenuByPID({parentId: 'sysOptionNode'}).then(res => { + if (res.data.code === 200) { + this.methodsVisble = true; + const data = res.data.data[0].children; + this.methodsData = data; + this.methodsLoading = false; + } + }) + }, + + // 澧炲姞鎿嶄綔绫诲瀷淇濆瓨 + methodsSaveClickHandler() { + let list = this.methodsList.map(item => { + return { + funcId: this.nodeRow.id, + operId: item.id, + operName: item.name, + operIndentify: item.code, + operAlias: item.alias, + operDesc: item.remark + } + }) + addOperationType(list).then(res => { + console.log(res) + if (res.data.code === 200) { + this.methodsVisble = false; + this.$message.success(res.data.msg); + this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + this.resetFormValue(); + this.form.childType = null; + } + }) + }, + + // 鐐瑰嚮琛� + rowMethodsClickHandler(row) { + func.rowClickHandler( + row, + this.$refs.methodsCrud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.methodsList = []; + } + ); + }, + } +} +</script> + +<style lang="scss" scoped> +::v-deep { + .el-form-item .el-select { + width: 100%; + } +} + +.btnBox { + display: flex; + justify-content: center; +} +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue new file mode 100644 index 0000000..281ec3b --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue @@ -0,0 +1,189 @@ +<template> + <el-container> + <el-aside> + <basic-container> + <div style="max-height: calc(100vh - 170px);overflow: auto"> + <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> + <span slot-scope="{ node, data }" class="el-tree-node__label"> + <span style="font-size: 15px"> + <i class="el-icon-s-promotion"></i> + {{ (node || {}).label }} + </span> + </span> + </avue-tree> + </div> + </basic-container> + </el-aside> + + <el-main> + <basic-container> + <el-form ref="form" :model="form" label-width="85px" style="height: 79vh"> + <el-form-item label="鍚嶇О锛�"> + <el-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�"></el-input> + </el-form-item> + <el-form-item label="鏍囪瘑锛�"> + <el-input v-model="form.code" placeholder="璇疯緭鍏ユ爣璇�"></el-input> + </el-form-item> + <el-form-item label="鍒悕锛�"> + <el-input v-model="form.alias" placeholder="璇疯緭鍏ュ埆鍚�"></el-input> + </el-form-item> + <el-form-item label="缂栧彿锛�"> + <el-input v-model="form.sort" placeholder="璇疯緭鍏ョ紪鍙�"></el-input> + </el-form-item> + <el-form-item label="鎻忚堪锛�"> + <el-input v-model="form.remark" placeholder="璇疯緭鍏ユ弿杩�"></el-input> + </el-form-item> + </el-form> + <div class="btnBox"> + <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain + size="small" + type="primary" @click="addClickHandler">澧炲姞 + </el-button> + <el-button v-if="addStatus" icon="el-icon-check" plain size="small" + type="success" @click="addSaveClickHandler">淇濆瓨 + </el-button> + <el-button :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" + @click="addClickHandler">淇敼 + </el-button> + <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" + @click="addClickHandler">鍒犻櫎 + </el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆sql + </el-button> + </div> + </basic-container> + </el-main> + </el-container> +</template> + +<script> +//绠$悊鍔熻兘妯″潡 +import {getSysModelTreeMenuByPID, addModel} from "@/api/systemModel/mangeModel/api" + +export default { + name: "index", + data() { + return { + addStatus: false, + nodeRow: {}, + form: {}, + treeData: [], + treeOption: { + height: 'auto', + menu: false, + addBtn: false, + defaultExpandAll: false, + props: { + label: 'name', + value: 'id', + children: 'children', + }, + lazy: true, + treeLoad: (node, resolve) => { + const params = { + parentId: node.level === 0 ? "operateNode" : node.data.id, + modeType: node.level === 0 ? "firstNode" : node.data.modeType, + } + getSysModelTreeMenuByPID(params).then(res => { + resolve(res.data.data.map(item => { + return { + ...item, + id: item.id, + name: item.name, + leaf: !item.hasChildren + } + })) + }) + } + }, + } + }, + created() { + }, + computed: { + /** + * childType + * 涓�-1 鍏ㄩ儴鎸夐挳灞曠ず 绂佺敤淇敼 鍒犻櫎 澧炲姞鎿嶄綔绫诲瀷 + * 涓嶄负-1 闅愯棌 鍒犻櫎闈炵郴缁熸ā鍧� 鍒犻櫎涓氬姟妯″潡 + * 涓�1鏃� 绂佺敤鎿嶄綔绫诲瀷銆佸鍏ャ�佸鍑� + * 涓�2鏃� 绂佺敤澧炲姞 瀵煎叆 瀵煎嚭 + * mangeShowBtn 涓� true 璇存槑鏄《灞傝妭鐐� 鍏ㄩ儴鎸夐挳灞曠ず 绂佺敤淇敼 鍒犻櫎 澧炲姞鎿嶄綔绫诲瀷 + * @returns {Number} + */ + mangeShowBtn() { + return this.form.childType === -1; + }, + childTypeBtn() { + return this.form.childType === 1; + } + }, + methods: { + // 鏍戣鐐瑰嚮 + nodeClick(row) { + console.log(row); + this.form = {...row}; + this.nodeRow = {...row}; + this.addStatus = false; + }, + + // 鏂板鎸夐挳 + addClickHandler() { + for (const key in this.form) { + if (this.form.hasOwnProperty(key)) { + this.form[key] = null; + } + } + this.addStatus = true; + }, + + // 淇濆瓨鎸夐挳 + addSaveClickHandler() { + console.log(this.form) + if (!this.form.name) { + this.$message.error('妯″潡鍚嶄笉鑳戒负绌�'); + return + } + if (this.form.name.length > 128) { + this.$message.error('妯″潡鍚嶉暱搴﹁秴杩�128锛�'); + return + } + if (this.form.remark && this.form.remark.length > 255) { + this.$message.error('鎻忚堪闀垮害瓒呰繃255锛�'); + return + } + if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { + this.$message.error('.NET鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.pathc && this.form.pathc.length > 255) { + this.$message.error('C/S鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { + this.$message.error('Mobile鏍囪瘑闀垮害涓嶈兘255锛�'); + return + } + console.log(this.nodeRow); + this.form.parentId = this.nodeRow.id; + this.form.modeType = this.nodeRow.modeType; + addModel(this.form).then(res => { + console.log(res) + this.addStatus = false; + }) + } + } +} +</script> + +<style lang="scss" scoped> +::v-deep { + .el-form-item .el-select { + width: 100%; + } +} + +.btnBox { + display: flex; + justify-content: center; +} +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/systemModule/systemConfig/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue similarity index 100% rename from Source/plt-web/plt-web-ui/src/views/systemModule/systemConfig/index.vue rename to Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue diff --git a/Source/plt-web/plt-web-ui/src/views/systemModule/systemMonitor/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue similarity index 100% rename from Source/plt-web/plt-web-ui/src/views/systemModule/systemMonitor/index.vue rename to Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue diff --git a/Source/plt-web/plt-web-ui/src/views/systemModule/businessModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModule/businessModel/index.vue deleted file mode 100644 index 54b19c1..0000000 --- a/Source/plt-web/plt-web-ui/src/views/systemModule/businessModel/index.vue +++ /dev/null @@ -1,13 +0,0 @@ -<template> - -</template> - -<script> -export default { - name: "index" -} -</script> - -<style scoped> - -</style> diff --git a/Source/plt-web/plt-web-ui/src/views/systemModule/mangeModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModule/mangeModel/index.vue deleted file mode 100644 index 82a0b37..0000000 --- a/Source/plt-web/plt-web-ui/src/views/systemModule/mangeModel/index.vue +++ /dev/null @@ -1,13 +0,0 @@ -<template> - -</template> - -<script> -export default { -name: "index" -} -</script> - -<style scoped> - -</style> diff --git a/Source/plt-web/plt-web-ui/src/views/systemModule/operateType/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModule/operateType/index.vue deleted file mode 100644 index 54b19c1..0000000 --- a/Source/plt-web/plt-web-ui/src/views/systemModule/operateType/index.vue +++ /dev/null @@ -1,13 +0,0 @@ -<template> - -</template> - -<script> -export default { - name: "index" -} -</script> - -<style scoped> - -</style> -- Gitblit v1.9.3