From 99bac1ebecd5adf552835c9fe084b0dd3f0a25b7 Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期三, 17 七月 2024 16:43:27 +0800 Subject: [PATCH] 增加、修改、删除链接接口的修改 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java | 35 ++++++++++++++++++----------------- 1 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java index 4374a0a..2320280 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java @@ -1,28 +1,23 @@ package com.vci.frameworkcore.compatibility.impl; +import com.vci.constant.FrameWorkBtmTypeConstant; import com.vci.corba.common.PLException; import com.vci.corba.common.data.UserEntityInfo; import com.vci.corba.framework.data.RoleInfo; import com.vci.corba.omd.data.BusinessObject; import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI; -import com.vci.frameworkcore.constant.FrameWorkBtmTypeConstant; -import com.vci.frameworkcore.dto.SmRoleDTO; +import com.vci.constant.FrameWorkBtmTypeConstant; +import com.vci.dto.SmRoleDTO; import com.vci.frameworkcore.enumpck.RoleClassifyEnum; import com.vci.frameworkcore.enumpck.RoleControlAreaEnum; -import com.vci.frameworkcore.model.SmRoleForPlatform1; -import com.vci.frameworkcore.model.dto.SmUserDTO; -import com.vci.frameworkcore.model.po.SmRolePO; -import com.vci.frameworkcore.model.po.SmUserPO; -import com.vci.frameworkcore.pagemodel.OrgDepartmentVO; -import com.vci.frameworkcore.pagemodel.SmRoleVO; -import com.vci.frameworkcore.pagemodel.SmUserVO; -import com.vci.frameworkcore.properties.ConfigReader; +import com.vci.model.SmRoleForPlatform1; +import com.vci.po.SmRolePO; +import com.vci.pagemodel.SmRoleVO; import com.vci.omd.utils.ObjectTool; import com.vci.starter.poi.bo.ReadExcelOption; import com.vci.starter.poi.constant.ExcelLangCodeConstant; import com.vci.starter.poi.util.ExcelUtil; import com.vci.starter.web.constant.QueryOptionConstant; -import com.vci.starter.web.enumpck.UserSecretEnum; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.*; import com.vci.starter.web.util.LangBaseUtil; @@ -86,7 +81,7 @@ if(Func.isEmpty(conditionMap)){ return null; } - VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap,SmRoleForPlatform1.class); + VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap, SmRoleForPlatform1.class); List<SmRoleForPlatform1> smRoleForPlatform1s = boService.selectByQueryWrapper(queryWrapper, SmRoleForPlatform1.class); if(Func.isNotEmpty(smRoleForPlatform1s) && Func.isNotBlank(smRoleForPlatform1s.get(0).getPluid())){ //瑙掕壊鍚嶄笉鑳介噸澶嶆墍浠ョ洿鎺ュ彇绗竴涓厓绱� @@ -646,16 +641,22 @@ VciBaseUtil.alertNotNull( smRoleDTO,"娣诲姞鐨勮鑹插璞�", smRoleDTO.getName(),"瑙掕壊鍚�"); - //鏌ヨ鏁版嵁搴撲腑鐨勶紝鏍规嵁瑙掕壊鍚嶆煡 + //鏍规嵁瑙掕壊涓婚敭鏌ヨ锛岀‘淇濅慨鏀圭殑瑙掕壊瀛樺湪 Map<String, String> conditionMap = new HashMap<>(); - conditionMap.put("plname",smRoleDTO.getName()); + conditionMap.put("pluid",smRoleDTO.getOid()); SmRoleVO dbSmRoleVO = getRoleByConditionMap(conditionMap); //鏍规嵁涓婚敭娌℃煡璇㈠埌浜嗙敤鎴� if(Func.isEmpty(dbSmRoleVO) || Func.isBlank(dbSmRoleVO.getOid())){ throw new PLException("500", new String[] { "褰撳墠淇敼鐨勮鑹蹭笉瀛樺湪!"}); } - //瑙掕壊鍚嶇浉绛夛紝浣嗘槸涓婚敭涓嶇浉绛夛紝璇存槑淇敼涓虹殑瑙掕壊鍚嶅凡瀛樺湪锛屼笉鑳介噸澶� - if(dbSmRoleVO.getName().equals(smRoleDTO.getName()) && !dbSmRoleVO.getOid().equals(smRoleDTO.getOid())){ + //鏌ヨ鏁版嵁搴撲腑鐨勶紝鏍规嵁瑙掕壊鍚嶆煡閲� + conditionMap.clear(); + conditionMap.put("plname",smRoleDTO.getName()); + //鎺掗櫎鎺夊綋鍓嶄慨鏀圭殑鐢ㄦ埛 + conditionMap.put("pluid",QueryOptionConstant.NOTEQUAL + smRoleDTO.getName()); + SmRoleVO reapeatSmRoleVO = getRoleByConditionMap(conditionMap); + //璇存槑淇敼涓虹殑瑙掕壊鍚嶅凡瀛樺湪锛屼笉鑳介噸澶� + if(Func.isNotEmpty(reapeatSmRoleVO) && smRoleDTO.getName().equals(reapeatSmRoleVO)){ throw new PLException("500", new String[] { "璇ヨ鑹插悕绉板凡缁忓瓨鍦�,璇蜂慨鏀�!"}); } SmRoleDTO smRoleDTO1 = new SmRoleDTO(); @@ -692,7 +693,7 @@ * @throws VciBaseException */ @Override - public BaseResult importRole(File file) throws VciBaseException { + public BaseResult importRole(File file) throws Exception { VciBaseUtil.alertNotNull(file,"excel鏂囦欢"); if(!file.exists()){ throw new VciBaseException("瀵煎叆鐨別xcel鏂囦欢涓嶅瓨鍦�,{0}",new String[]{file.getPath()}); -- Gitblit v1.9.3