From 663878fdcd0d44c105888014f4cdf7fc926f609f Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期三, 19 六月 2024 10:27:04 +0800 Subject: [PATCH] 1、去掉client包的相关更改。 2、修改登录鉴权修改。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java | 8 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLifeCycleServiceImpl.java | 7 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeBreakCodeDaoImpl.java | 7 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/OsMapToObjFunction.java | 4 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/WorkFlowEndedNotice.java | 31 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java | 450 +++++------ Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/autoconfigure/SpringMVCConfig.java | 17 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLifeCycleServiceI.java | 3 Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java | 27 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebLoServiceImpl.java | 222 ++--- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/RightControlUtil.java | 267 +++++++ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java | 3 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeEnumDaoImpl.java | 14 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/SmOperationServiceImpl.java | 28 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java | 28 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBaseServiceI.java | 3 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebDataRightController.java | 28 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/WebUtil.java | 101 +- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/WebProcessDaoImpl.java | 36 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebSecretServiceImpl.java | 6 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/WebProcessDaoI.java | 4 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java | 6 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java | 3 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebBoServiceI.java | 45 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebActionServiceImpl.java | 11 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIDataServiceI.java | 16 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeRuleDaoImpl.java | 9 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebLoServiceI.java | 81 +- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/VciFileObjectDaoImpl.java | 8 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/pageModel/BatchCBO.java | 88 +- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessDefineServiceImpl.java | 38 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java | 29 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/plugins/controller/AuditTaskController.java | 30 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java | 1 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java | 49 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessCommandServiceImpl.java | 70 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java | 359 ++++----- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java | 14 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java | 8 39 files changed, 1,213 insertions(+), 946 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/autoconfigure/SpringMVCConfig.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/autoconfigure/SpringMVCConfig.java index 244211d..9af6193 100644 --- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/autoconfigure/SpringMVCConfig.java +++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/autoconfigure/SpringMVCConfig.java @@ -114,6 +114,15 @@ } /** + * 瀹夊叏鐩稿叧鐨勬嫤鎴櫒 + * @return 瀹夊叏鐩稿叧鐨勬嫤鎴櫒 + */ + @Bean + public VciSecurityInterceptor vciSecurityInterceptor(){ + return new VciSecurityInterceptor(); + } + + /** * 澧炲姞PUT鍜孌ELETE鐨勬敮鎸� * @return 杩囨护鍣� */ @@ -270,14 +279,6 @@ return new VciLocaleInterceptor(); } - /** - * 瀹夊叏鐩稿叧鐨勬嫤鎴櫒 - * @return 瀹夊叏鐩稿叧鐨勬嫤鎴櫒 - */ - @Bean - public VciSecurityInterceptor vciSecurityInterceptor(){ - return new VciSecurityInterceptor(); - } /** diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java index 1237741..6f6112f 100644 --- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java +++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java @@ -7,6 +7,7 @@ import com.vci.starter.web.enumpck.ResultCodeEnum; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.SessionInfo; +import com.vci.starter.web.util.ApplicationContextProvider; import com.vci.starter.web.util.LangBaseUtil; import com.vci.starter.web.util.VciBaseUtil; import com.vci.starter.web.util.WebThreadLocalUtil; @@ -14,10 +15,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; +import javax.annotation.Resource; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -30,6 +36,7 @@ * @author weidy * @date 2019/11/7 2:32 PM */ +//@Configuration public class VciSecurityInterceptor implements HandlerInterceptor { /** @@ -46,8 +53,8 @@ /** * 浼氳瘽锛屾潈闄愶紝token鐨勬帴鍙� */ - @Autowired(required = false) - private VciSessionForLoginI sessionForLoginI; + @Autowired + private VciSessionForLoginI vciSessionForLoginI; /** * 鎵ц鎷︽埅 @@ -119,7 +126,7 @@ return false; }else{ if(!unCheckUrls.contains(url)){ - if(sessionForLoginI == null){ + if(vciSessionForLoginI == null){ //璇存槑娌″姙娉曟牎楠� String msg = "璇锋眰璺緞"+ url +"娌℃潈闄愯闂�"; if(logger.isErrorEnabled()) { @@ -129,11 +136,11 @@ return false; }else{ //鍒濆鍖栧钩鍙扮殑token - sessionForLoginI.initInvocationInfo(sessionInfo); + vciSessionForLoginI.initInvocationInfo(sessionInfo); String systemPrivateToken = request.getHeader(TokenKeyConstant.SYSTEM_PRIVATE_KEY); try { - if (sessionForLoginI.checkRequestRights(request, systemPrivateToken, sessionInfo, handler)) { + if (vciSessionForLoginI.checkRequestRights(request, systemPrivateToken, sessionInfo, handler)) { updateRequestTime(url,userToken); }else{ return false; @@ -159,7 +166,11 @@ SessionInfo sessionInfo = null; if(StringUtils.isNotBlank(userToken)){ try{ - sessionInfo = sessionForLoginI.getSessionInfoByToken(userToken); + if(vciSessionForLoginI == null){ + vciSessionForLoginI = ApplicationContextProvider.getBean(VciSessionForLoginI.class); + } + + sessionInfo = vciSessionForLoginI.getSessionInfoByToken(userToken); }catch (Throwable e){ logger.error("鑾峰彇token鍑洪敊",e); } @@ -207,8 +218,8 @@ while(url1.startsWith("/")){ url1 = url1.substring(1); } - if(sessionForLoginI != null && !unStorageRequestTimeUrls.contains(url1)){ - sessionForLoginI.updateRequestTime(userToken); + if(vciSessionForLoginI != null && !unStorageRequestTimeUrls.contains(url1)){ + vciSessionForLoginI.updateRequestTime(userToken); } } } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java index abe3257..d652b0e 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java @@ -1,11 +1,13 @@ package com.vci.frameworkcore.compatibility.impl; +import com.vci.corba.omd.data.BusinessObject; import com.vci.frameworkcore.compatibility.OrgDeptQueryServiceI; import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; import com.vci.frameworkcore.model.OrgDeptForPlatform1; import com.vci.frameworkcore.model.SmRoleForPlatform1; import com.vci.frameworkcore.pagemodel.OrgDepartmentVO; import com.vci.frameworkcore.pagemodel.SmRoleVO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.revision.bo.TreeWrapperOptions; import com.vci.starter.revision.service.RevisionModelUtil; import com.vci.starter.web.constant.QueryOptionConstant; @@ -285,12 +287,12 @@ if(!CollectionUtils.isEmpty(deptVOs)){ deptVOList.addAll(deptVOs); String sql = "select pluseruid,pldeptuid from pluserdept where pluseruid in (" + WebUtil.toInSql(userOids.toArray(new String[0])) + ")"; - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); + List<BusinessObject> cbos = boService.queryBySql(sql, null); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ - String userOid = cbo.getAttributeValue("pluseruid"); + String userOid = ObjectTool.getBOAttributeValue(cbo,"pluseruid"); List<String> deptOids = userDeptOidMap.getOrDefault(userOid,new ArrayList<>()); - deptOids.add(cbo.getAttributeValue("pldeptuid")); + deptOids.add(ObjectTool.getBOAttributeValue(cbo,"pldeptuid")); userDeptOidMap.put(userOid,deptOids); }); } 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 abc70d4..4fad0ab 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 @@ -3,6 +3,8 @@ import com.alibaba.fastjson.JSONObject; import com.vci.corba.common.PLException; import com.vci.corba.framework.data.FunctionInfo; +import com.vci.corba.framework.data.RoleRightInfo; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.portal.data.PLUILayout; import com.vci.frameworkcore.compatibility.ISmFunctionQueryService; import com.vci.frameworkcore.enumpck.ResourceControlTypeEnum; @@ -10,6 +12,7 @@ import com.vci.frameworkcore.model.SmRoleForPlatform1; import com.vci.frameworkcore.pagemodel.MenuVO; import com.vci.frameworkcore.pagemodel.SmFunctionVO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.*; @@ -18,6 +21,7 @@ import com.vci.web.service.UIEngineServiceI; import com.vci.web.service.WebBoServiceI; import com.vci.web.util.PlatformClientUtil; +import com.vci.web.util.RightControlUtil; import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -74,6 +78,8 @@ @Autowired private PlatformClientUtil platformClientUtil; + @Autowired + RightControlUtil rightControlUtil; /** * 鏌ヨ鎵�鏈夌殑鍔熻兘 * @@ -208,12 +214,21 @@ @Override public List<MenuVO> treeCurrentUserMenu(TreeQueryObject treeQueryObject, ResourceControlTypeEnum resourceControlTypeEnum) throws PLException { SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException(); - if(resourceControlTypeEnum == null){ - resourceControlTypeEnum = ResourceControlTypeEnum.BS; + String parentId; + + if (rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId())) { + // 绯荤粺鑿滃崟 + parentId = "systemManagmentNode" ; + } else if (rightControlUtil.isThreeAdminCurUser()) { + parentId = "systemManagmentNode" ; + } else { + parentId = "modelManagmentNode" ; } - FunctionInfo[] menus = platformClientUtil.getFrameworkService().getModuleListByParentId("modelManagmentNode", true); + RoleRightInfo[] userRoleRights = rightControlUtil.getRoleRightByUserName(sessionInfo.getUserId()); + Map<String, List<FunctionInfo>> map = rightControlUtil.getAllChildrenFunctionsByUserName( + parentId, sessionInfo.getUserId(), userRoleRights); List<MenuVO> functionVOList = new ArrayList<>(); - for (FunctionInfo menu : menus) { + for (FunctionInfo menu : map.get(parentId)) { if(!menu.isValid){ continue; } @@ -512,12 +527,12 @@ if(!CollectionUtils.isEmpty(functionVOS)){ functionVOList.addAll(functionVOS); String sql = "select plfuncoid,plroleoid from plroleright where plroleoid in (" + WebUtil.toInSql(roleOids.toArray(new String[0])) + ")"; - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); + List<BusinessObject> cbos = boService.queryBySql(sql, null); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ - String roleOid = cbo.getAttributeValue("plroleoid"); + String roleOid = ObjectTool.getBOAttributeValue(cbo,"plroleoid"); List<String> functionOids = roleFunctionOidMap.getOrDefault(roleOid,new ArrayList<>()); - functionOids.add(cbo.getAttributeValue("plfuncoid")); + functionOids.add(ObjectTool.getBOAttributeValue(cbo,"plfuncoid")); roleFunctionOidMap.put(roleOid,functionOids); }); } 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 d225f6e..6ad8bf9 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,11 +1,13 @@ package com.vci.frameworkcore.compatibility.impl; +import com.vci.corba.omd.data.BusinessObject; import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI; import com.vci.frameworkcore.constant.FrameWorkBtmTypeConstant; import com.vci.frameworkcore.enumpck.RoleClassifyEnum; import com.vci.frameworkcore.enumpck.RoleControlAreaEnum; import com.vci.frameworkcore.model.SmRoleForPlatform1; import com.vci.frameworkcore.pagemodel.SmRoleVO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; @@ -250,12 +252,12 @@ if(!CollectionUtils.isEmpty(roleVOS)){ roleVOList.addAll(roleVOS); String sql = "select pluseruid,plroleuid from pluserrole where pluseruid in (" + WebUtil.toInSql(userOids.toArray(new String[0])) + ")"; - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); + List<BusinessObject> cbos = boService.queryBySql(sql, null); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ - String userOid = cbo.getAttributeValue("pluseruid"); + String userOid = ObjectTool.getBOAttributeValue(cbo,"pluseruid"); List<String> roleOids = userRoleOidMap.getOrDefault(userOid,new ArrayList<>()); - roleOids.add(cbo.getAttributeValue("plroleuid")); + roleOids.add(ObjectTool.getBOAttributeValue(cbo,"plroleuid")); userRoleOidMap.put(userOid,roleOids); }); } @@ -415,12 +417,12 @@ if(!CollectionUtils.isEmpty(roleVOS)){ roleVOList.addAll(roleVOS); String sql = "select plroleoid,plfuncoid from plroleright where plfuncoid in (" + WebUtil.toInSql(userOids.toArray(new String[0])) + ")"; - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); + List<BusinessObject> cbos = boService.queryBySql(sql, null); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ - String funcOid = cbo.getAttributeValue("plfuncoid"); + String funcOid = ObjectTool.getBOAttributeValue(cbo,"plfuncoid"); List<String> roleOids = funcRoleOidMap.getOrDefault(funcOid,new ArrayList<>()); - roleOids.add(cbo.getAttributeValue("plroleoid")); + roleOids.add(ObjectTool.getBOAttributeValue(cbo,"plroleoid")); funcRoleOidMap.put(funcOid,roleOids); }); } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java index a61debc..60555d1 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java @@ -3,9 +3,11 @@ import com.vci.common.util.ThreeDES; import com.vci.corba.common.PLException; import com.vci.corba.framework.data.UserInfo; +import com.vci.corba.omd.data.BusinessObject; import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO; import com.vci.frameworkcore.pagemodel.SmUserVO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.enumpck.BooleanEnum; import com.vci.starter.web.enumpck.UserSecretEnum; import com.vci.starter.web.exception.VciBaseException; @@ -32,7 +34,7 @@ import java.util.stream.Collectors; import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; -import static com.vci.web.util.WebUtil.arryAndSqlToClientBusinessObject; +import static com.vci.web.util.WebUtil.arryAndSqlToBusinessObject; /** * 鐢ㄦ埛鐨勬煡璇㈢浉鍏崇殑鏈嶅姟锛屽彲浠ュ吋瀹硅�佸钩鍙板拰鑰佺殑pdm @@ -148,7 +150,7 @@ try{ String[][] sqlQueryResult = platformClientUtil.getBOFService().getSqlQueryResult(sql + fromSql, null); if(sqlQueryResult.length>0){ - com.vci.client.bof.ClientBusinessObject cbo = arryAndSqlToClientBusinessObject(queryWrapper.getSelectFieldSql(),sqlQueryResult[0]); + BusinessObject cbo = arryAndSqlToBusinessObject(queryWrapper.getSelectFieldSql(),sqlQueryResult[0]); return cbo2VO(cbo); } }catch (Exception e){ @@ -176,7 +178,7 @@ + " left join pluserdept up on " + queryWrapper.getTableNick() + ".pluid = up.pluseruid left join pldept pkDepartment on up.pldeptuid = pkDepartment.pluid " + " left join PLUSERPASSWORDSTRATEGY pkUserPassword on " +queryWrapper.getTableNick() + ".pluid = pkUserPassword.pluseruid " + queryWrapper.getLinkTableSql() + (StringUtils.isNotBlank(queryWrapper.getWhereSql())?(" where " + queryWrapper.getWhereSql()):""); - List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); + List<BusinessObject> dataList = boService.queryBySql(sql + fromSql, null); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ userVOList.add(cbo2VO(cbo)); @@ -285,7 +287,7 @@ + " left join pluserdept up on " + queryWrapper.getTableNick() + ".pluid = up.pluseruid left join pldept pkDepartment on up.pldeptuid = pkDepartment.pluid " + " left join PLUSERPASSWORDSTRATEGY pkUserPassword on " +queryWrapper.getTableNick() + ".pluid = pkUserPassword.pluseruid " + (QUERY_FIELD_ROLE.equalsIgnoreCase(queryField)?roleSql:"") + queryWrapper.getLinkTableSql() + (StringUtils.isNotBlank(queryWrapper.getWhereSql())?(" where " + queryWrapper.getWhereSql()):""); - List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); + List<BusinessObject> dataList = boService.queryBySql(sql + fromSql, null); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ userVOList.add(cbo2VO(cbo)); @@ -299,7 +301,7 @@ * @param cbo 涓氬姟鏁版嵁 * @return 鏄剧ず瀵硅薄 */ - private SmUserVO cbo2VO(com.vci.client.bof.ClientBusinessObject cbo){ + private SmUserVO cbo2VO(BusinessObject cbo){ SmUserDO userDO = new SmUserDO(); SmUserVO userVO = new SmUserVO(); WebUtil.copyValueToObjectFromCbos(cbo,userDO); @@ -353,7 +355,7 @@ } } } - List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql((isPage?("select " + pageSelectList.stream().collect(Collectors.joining(","))+ " from (select A.*,rownum RN from ( "):"") + sql + fromSql + (isPage?pageSubfix:""), null); + List<BusinessObject> dataList = boService.queryBySql((isPage?("select " + pageSelectList.stream().collect(Collectors.joining(","))+ " from (select A.*,rownum RN from ( "):"") + sql + fromSql + (isPage?pageSubfix:""), null); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ userVOList.add(cbo2VO(cbo)); @@ -669,13 +671,13 @@ + " left join pluserdept up on " + queryWrapper.getTableNick() + ".pluid = up.pluseruid left join pldept pkDepartment on up.pldeptuid = pkDepartment.pluid " + " left join PLUSERPASSWORDSTRATEGY pkUserPassword on " +queryWrapper.getTableNick() + ".pluid = pkUserPassword.pluseruid " + queryWrapper.getLinkTableSql() + (StringUtils.isNotBlank(queryWrapper.getWhereSql())?(" where " + queryWrapper.getWhereSql()):""); - List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); + List<BusinessObject> dataList = boService.queryBySql(sql + fromSql, null); List<Tree> treeList = new ArrayList<>(); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ Tree tree = new Tree(); - tree.setOid(cbo.getOid()); - tree.setText(cbo.getId() + " " + cbo.getName()); + tree.setOid(cbo.oid); + tree.setText(cbo.id + " " + cbo.name); Map<String,String> attributeMap = new HashMap<>(); WebUtil.copyValueToCboFromMap(cbo,attributeMap); tree.setAttributes(attributeMap); @@ -699,15 +701,15 @@ String sql = " select plpassword from pluser where pluid = :userOid"; Map<String,String> conditionMap = new HashMap<>(); conditionMap.put("userOid",userOid.trim()); - List<com.vci.client.bof.ClientBusinessObject> clientBusinessObjectList = boService.queryBySql(sql, conditionMap); - if(CollectionUtils.isEmpty(clientBusinessObjectList)){ + List<BusinessObject> BusinessObjectList = boService.queryBySql(sql, conditionMap); + if(CollectionUtils.isEmpty(BusinessObjectList)){ return false; } ThreeDES des = new ThreeDES();// 瀹炰緥鍖栦竴涓锟�? des.getKey("daliantan0v0");// 鐢熸垚瀵嗗寵 md5Password = des.getEncString(md5Password); - if(md5Password.equals(clientBusinessObjectList.get(0).getAttributeValue("plpassword"))){ + if(md5Password.equals(ObjectTool.getNewBOAttributeValue(BusinessObjectList.get(0),"plpassword"))){ return true; } return false; @@ -742,7 +744,7 @@ public SmPasswordStrategyVO getPasswordStrategyVOByOid(String oid){ VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class); queryWrapperForDO.eq("oid",oid.trim()); - List<com.vci.client.bof.ClientBusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " + + List<BusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " + queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() + (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null); if(!CollectionUtils.isEmpty(cboList)){ diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/plugins/controller/AuditTaskController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/plugins/controller/AuditTaskController.java index 45fd51f..f677a6a 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/plugins/controller/AuditTaskController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/plugins/controller/AuditTaskController.java @@ -1,9 +1,10 @@ package com.vci.plugins.controller; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientBusinessObjectOperation; + import com.vci.corba.common.PLException; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.query.data.KV; +import com.vci.omd.utils.ObjectTool; import com.vci.plugins.dto.AuditTaskDTO; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.util.VciBaseUtil; @@ -46,8 +47,8 @@ @PostMapping("/create") public BaseResult createByPrincipal(@RequestBody AuditTaskDTO auditTaskDTO) { VciBaseUtil.alertNotNull(auditTaskDTO.getProcessreviewoid(), "宸ヨ壓璇勫涓婚敭", auditTaskDTO.getPrincipal(), "璐熻矗浜�"); - ClientBusinessObjectOperation operation = new ClientBusinessObjectOperation(); - List<ClientBusinessObject> createList = new ArrayList<>(); +// BusinessObjectOperation operation = new BusinessObjectOperation(); + List<BusinessObject> createList = new ArrayList<>(); List<String> principalList = VciBaseUtil.str2List(auditTaskDTO.getPrincipal()); List<List<String>> oracleIn = WebUtil.switchListForOracleIn(principalList); try { @@ -65,17 +66,18 @@ "where us.pluid in " + principalStr; KV[][] kvs = platformClientUtil.getQueryService().queryBySql(sql); for (int index = 0; index < kvs.length; index++) { - ClientBusinessObject cbo = operation.initBusinessObject("audittask"); + BusinessObject cbo = platformClientUtil.getBOFService().initBusinessObject("audittask"); copyAttribute(cbo, auditTaskDTO); - cbo.setAttributeValue("principal", "PLUSERNAME".equals(kvs[index][0].key.toUpperCase(Locale.ROOT)) ? kvs[index][0].value : kvs[index][1].value); - cbo.setAttributeValue("departmentname","PLNAME".equals(kvs[index][0].key.toUpperCase(Locale.ROOT)) ? kvs[index][0].value : kvs[index][1].value); + ObjectTool.setBOAttributeValue(cbo, "principal", "PLUSERNAME".equals(kvs[index][0].key.toUpperCase(Locale.ROOT)) ? kvs[index][0].value : kvs[index][1].value); + ObjectTool.setBOAttributeValue(cbo,"departmentname","PLNAME".equals(kvs[index][0].key.toUpperCase(Locale.ROOT)) ? kvs[index][0].value : kvs[index][1].value); createList.add(cbo); } } catch ( PLException vciError) { vciError.printStackTrace(); } }); - operation.batchSaveCreateBuinessObject(createList.toArray(new ClientBusinessObject[0])); + + platformClientUtil.getBOFService().batchCreateBusinessObject(createList.toArray(new BusinessObject[0]),false,false); } catch ( PLException vciError) { vciError.printStackTrace(); return BaseResult.fail("鍒涘缓璇勫浠诲姟澶辫触"); @@ -89,7 +91,7 @@ * @param cbo 璇勫浠诲姟涓氬姟绫诲瀷瀵硅薄 * @param auditTaskDTO 璇勫浠诲姟椤甸潰浼犺緭瀵硅薄 */ - private void copyAttribute(ClientBusinessObject cbo, AuditTaskDTO auditTaskDTO) { + private void copyAttribute(BusinessObject cbo, AuditTaskDTO auditTaskDTO) { setAttribute(cbo, "assigner", StringUtils.isBlank(auditTaskDTO.getAssigner())? WebUtil.getCurrentUserId(): auditTaskDTO.getAssigner()); setAttribute(cbo, "principal", auditTaskDTO.getPrincipal()); setAttribute(cbo, "departmentName", auditTaskDTO.getDepartmentname()); @@ -107,13 +109,9 @@ * @param attributeName 瀛楁鍚� * @param attributeValue 瀛楁鍊� */ - private void setAttribute(ClientBusinessObject cbo, String attributeName, String attributeValue) { - try { - if (StringUtils.isNotBlank(attributeValue)) { - cbo.setAttributeValue(attributeName, attributeValue); - } - } catch (PLException vciError) { - vciError.printStackTrace(); + private void setAttribute(BusinessObject cbo, String attributeName, String attributeValue) { + if (StringUtils.isNotBlank(attributeValue)) { + ObjectTool.setBOAttributeValue(cbo, attributeName, attributeValue); } } } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java index 49a5d1e..b264d82 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java @@ -35,7 +35,6 @@ * @param treeQueryObject 鏍戞煡璇㈠璞� * @return 鏍戣妭鐐癸紝鍑虹幇閿欒浼氬湪寮傚父澶勭悊鍣ㄤ腑缁熶竴杩斿洖Json */ - @VciUnCheckRight @GetMapping("/treeMyMenu") public List<MenuVO> treeMyMenu(TreeQueryObject treeQueryObject) throws PLException { return functionQueryService.treeCurrentUserMenu(treeQueryObject, ResourceControlTypeEnum.BS); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebDataRightController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebDataRightController.java index 31af996..bb7b4bc 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebDataRightController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebDataRightController.java @@ -1,12 +1,6 @@ package com.vci.web.controller; - - - -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.uif.actions.client.DataRightUtil; -import com.vci.client.uif.engine.common.DefaultTableNode; -import com.vci.client.uif.engine.common.IDataNode; import com.vci.corba.common.PLException; +import com.vci.corba.omd.data.BusinessObject; import com.vci.starter.web.enumpck.DataSecretEnum; import com.vci.starter.web.enumpck.UserSecretEnum; import com.vci.starter.web.pagemodel.BaseResult; @@ -83,7 +77,7 @@ //鍏堝垽鏂瘑绾� //weidy淇敼锛屾崲鎴愪粠绾跨▼閲岃幏鍙栧綋鍓嶇敤鎴蜂俊鎭� SessionInfo si = WebUtil.getCurrentUserSessionInfo(); - DataRightUtil dataRightUtil = new DataRightUtil(new HashMap()); +// DataRightUtil dataRightUtil = new DataRightUtil(new HashMap()); StringBuilder sb = new StringBuilder(); return BaseResult.fail(""); } @@ -97,8 +91,9 @@ * @throws PLException 缂哄皯鐨勬椂鍊欎細鎶涘嚭寮傚父 */ protected Object getSelectedObject(BaseModelDTO boData) throws PLException { - IDataNode selectedObject = new DefaultTableNode(); - ClientBusinessObject cbo = new ClientBusinessObject(); + //姝ゆ柟娉曟病鏈夎寮曠敤锛屼笖IDataNode瀵硅薄娌℃湁 +// IDataNode selectedObject = new DefaultTableNode(); + BusinessObject cbo = new BusinessObject(); if(StringUtils.isBlank(boData.getOid())){ throw new PLException("娌℃湁鑾峰彇鍒版暟鎹殑涓婚敭",new String[0]); } @@ -111,12 +106,13 @@ if(StringUtils.isBlank(boData.getBtmname())){ throw new PLException("娌℃湁鑾峰彇鍒版暟鎹殑涓氬姟绫诲瀷",new String[0]); } - cbo.setOid(boData.getOid()); - cbo.setRevisionid(boData.getRevisionOid()); - cbo.setNameoid(boData.getNameOid()); - cbo.setBtmName(boData.getBtmname()); - selectedObject.setMasterObject(cbo); - return selectedObject; + cbo.oid = boData.getOid(); + cbo.revisionid = boData.getRevisionOid(); + cbo.nameoid = boData.getNameOid(); + cbo.btName = boData.getBtmname(); +// selectedObject.setMasterObject(cbo); +// return selectedObject; + return null; } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/WebProcessDaoI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/WebProcessDaoI.java index d035f70..85e9101 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/WebProcessDaoI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/WebProcessDaoI.java @@ -1,6 +1,6 @@ package com.vci.web.dao; -import com.vci.client.bof.ClientLinkObject; +import com.vci.corba.omd.data.LinkObject; import com.vci.corba.workflow.WorkflowServicePrx; import com.vci.corba.workflow.data.TasksAssignedInfo; import com.vci.starter.web.exception.VciBaseException; @@ -240,7 +240,7 @@ * @return * @throws VciBaseException */ - List<ClientLinkObject> getDataCloInTask(String taskOid, String executionId) throws VciBaseException; + List<LinkObject> getDataCloInTask(String taskOid, String executionId) throws VciBaseException; /** * 鑾峰彇娴佺▼涓寘鍚殑鎵�鏈夋暟鎹� diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeBreakCodeDaoImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeBreakCodeDaoImpl.java index 345e660..e0384b5 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeBreakCodeDaoImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeBreakCodeDaoImpl.java @@ -1,5 +1,6 @@ package com.vci.web.dao.impl; +import com.vci.corba.omd.data.BusinessObject; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.PageHelper; @@ -172,14 +173,14 @@ VciBaseUtil.alertNotNull(ruleOid,"瑙勫垯鍒嗙被",serialAccord,"娴佹按渚濇嵁"); Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("pkcoderule",ruleOid); - List<com.vci.client.bof.ClientBusinessObject> queryList = this.boService.queryCBO("codebreakcode", conditionMap); + List<BusinessObject> queryList = this.boService.queryCBO("codebreakcode", conditionMap); if (CollectionUtils.isEmpty(queryList)){ throw new VciBaseException("瑙勫垯鍒嗙被[{0}]鍦ㄧ郴缁熶腑涓嶅瓨鍦�",new String[]{ruleOid}); } conditionMap.clear(); String oid = ""; - for (com.vci.client.bof.ClientBusinessObject object : queryList) { - oid += object.getOid() + ","; + for (BusinessObject object : queryList) { + oid += object.oid + ","; } oid = "(" + oid.substring(0,oid.length() -1) + ")"; conditionMap.put("oid", QueryOptionConstant.IN + oid); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeEnumDaoImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeEnumDaoImpl.java index 4feea27..aeb2c4c 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeEnumDaoImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeEnumDaoImpl.java @@ -1,6 +1,6 @@ package com.vci.web.dao.impl; -import com.vci.client.omd.provider.BtmProvider; +import com.vci.corba.omd.data.BusinessObject; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.PageHelper; @@ -203,15 +203,17 @@ //鍏堟煡璇㈡槑缁嗭紝鏄庣粏搴旇涓嶄細鏈�1000鏉� Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("ruleOid",ruleOid); - String sql = " select a.oid as oid from " + BtmProvider.getInstance().getBTTableName(BtmIdConstant.OS_CODE_ENUM_BTM_TYPE) + " a left join " - + BtmProvider.getInstance().getBTTableName(BtmIdConstant.OS_CODE_RULE_ELEMENT_BTM_TYPE) + " b on a.pkCodeRuleElement = b.oid where b.pkCodeRule = :ruleOid"; - List<com.vci.client.bof.ClientBusinessObject> enumCbos = boService.queryBySql(sql, conditionMap); + //todo 姝ゆ殏鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String sql = " select a.oid as oid from " + BtmProvider.getInstance().getBTTableName(BtmIdConstant.OS_CODE_ENUM_BTM_TYPE) + " a left join " +// + BtmProvider.getInstance().getBTTableName(BtmIdConstant.OS_CODE_RULE_ELEMENT_BTM_TYPE) + " b on a.pkCodeRuleElement = b.oid where b.pkCodeRule = :ruleOid"; + String sql = ""; + List<BusinessObject> enumCbos = boService.queryBySql(sql, conditionMap); if(CollectionUtils.isEmpty(enumCbos)){ return new ArrayList<OsCodeEnumDO>(); } List<String> oidList = new ArrayList<String>(); - for(com.vci.client.bof.ClientBusinessObject cbo : enumCbos){ - oidList.add(cbo.getOid()); + for(BusinessObject cbo : enumCbos){ + oidList.add(cbo.oid); } return boService.selectByOidCollection(oidList,OsCodeEnumDO.class); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeRuleDaoImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeRuleDaoImpl.java index d2a3640..d27a34b 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeRuleDaoImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/OsCodeRuleDaoImpl.java @@ -1,5 +1,6 @@ package com.vci.web.dao.impl; +import com.vci.corba.omd.data.BusinessObject; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.PageHelper; import com.vci.starter.web.util.VciBaseUtil; @@ -163,7 +164,7 @@ */ @Override public long batchUpdateLcStatus(Collection<String> oids, String lcStatus) { - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(oids, "oscoderule"); + List<BusinessObject> cbos = boService.selectCBOByOidCollection(oids, "oscoderule"); if(CollectionUtils.isEmpty(cbos)){ return 0; } @@ -179,11 +180,11 @@ */ @Override public int updateLcStatus(String oid, String lcStatus) { - com.vci.client.bof.ClientBusinessObject cbo = boService.selectCBOByOid(oid, "oscoderule"); - if(cbo == null || StringUtils.isBlank(cbo.getOid())){ + BusinessObject cbo = boService.selectCBOByOid(oid, "oscoderule"); + if(cbo == null || StringUtils.isBlank(cbo.oid)){ return 0; } - lifeCycleService.transStatus(cbo.getBusinessObject(),lcStatus); + lifeCycleService.transStatus(cbo,lcStatus); return 1; } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/VciFileObjectDaoImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/VciFileObjectDaoImpl.java index 9dfc406..b73fdca 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/VciFileObjectDaoImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/VciFileObjectDaoImpl.java @@ -1,6 +1,8 @@ package com.vci.web.dao.impl; +import com.vci.corba.omd.data.BusinessObject; import com.vci.file.constant.VciFileBtmTypeConstant; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.util.VciBaseUtil; import com.vci.starter.web.wrapper.VciQueryWrapperForDO; @@ -239,10 +241,10 @@ public String selectSecret(String ownbizOid, String ownbizBtm) { if(StringUtils.isNotBlank(ownbizOid) && StringUtils.isNotBlank(ownbizBtm)){ //鏍¢獙鏁版嵁鐨勫瘑绾� - com.vci.client.bof.ClientBusinessObject cbo = boService.selectCBOByOid(ownbizOid, ownbizBtm); - if(cbo !=null && StringUtils.isNotBlank(cbo.getOid())){ + BusinessObject cbo = boService.selectCBOByOid(ownbizOid, ownbizBtm); + if(cbo !=null && StringUtils.isNotBlank(cbo.oid)){ //鏈夊彲鑳芥槸鍏堜笂浼犳枃浠讹紝鎵�浠ユ垜浠繖涓笉鍒ゆ柇鏄惁瀛樺湪 - return cbo.getAttributeValue("secretgrade"); + return ObjectTool.getBOAttributeValue(cbo,"secretgrade"); } } return null; diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/WebProcessDaoImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/WebProcessDaoImpl.java index 17ccc7b..747dc9e 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/WebProcessDaoImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/dao/impl/WebProcessDaoImpl.java @@ -1,14 +1,16 @@ package com.vci.web.dao.impl; -import com.vci.client.bof.ClientLinkObject; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.PLException; import com.vci.corba.common.data.UserEntityInfo; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.corba.omd.data.LinkObject; import com.vci.corba.workflow.WorkflowService; import com.vci.corba.workflow.WorkflowServicePrx; import com.vci.corba.workflow.data.*; import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; import com.vci.frameworkcore.pagemodel.SmUserVO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; @@ -606,7 +608,7 @@ * @throws VciBaseException */ @Override - public List<ClientLinkObject> getDataCloInTask(String taskOid, String executionid) throws VciBaseException { + public List<LinkObject> getDataCloInTask(String taskOid, String executionid) throws VciBaseException { Map<String,String> conditionMap = new HashMap<String, String>(); if(StringUtils.isNotBlank(taskOid)) { conditionMap.put("f_oid", taskOid.trim()); @@ -619,18 +621,18 @@ } private DataGrid getData(String linkType,Map<String,String> conditionMap,String referColumns) throws VciBaseException{ - List<ClientLinkObject> clos = loService.queryCLO(taskDataLink, conditionMap); + List<LinkObject> clos = loService.queryCLO(taskDataLink, conditionMap); Map<String,List<String>> btmOidMap = new HashMap<String, List<String>>(); if(clos!=null&&clos.size()>0){ - for(ClientLinkObject clo : clos){ + for(LinkObject clo : clos){ List<String> oids = null; - String btm = clo.getToBTMName().toLowerCase(); + String btm = clo.toBTName.toLowerCase(); if(btmOidMap.containsKey(btm)){ oids = btmOidMap.get(btm); }else{ oids = new ArrayList<String>(); } - oids.add(clo.getToOid()); + oids.add(clo.toOid); btmOidMap.put(btm, oids); } } @@ -648,7 +650,7 @@ }else { caluesList.add("*"); } - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btm, conditionMap,null,caluesList); + List<BusinessObject> cbos = boService.queryCBO(btm, conditionMap,null,caluesList); data.addAll(boService.cbos2Map(cbos)); } } @@ -726,21 +728,21 @@ PageHelper pageHelper = new PageHelper(-1); pageHelper.setSort("endTime"); pageHelper.setOrder(pageHelper.asc); - List<com.vci.client.bof.ClientBusinessObject> undoTaskCbos= boService.queryCBO(workitemBtmType, conditionMap); + List<BusinessObject> undoTaskCbos= boService.queryCBO(workitemBtmType, conditionMap); if(undoTaskCbos != null && undoTaskCbos.size() > 0) { - for(com.vci.client.bof.ClientBusinessObject cbo : undoTaskCbos) { + for(BusinessObject cbo : undoTaskCbos) { ProcessHistoryVO his = new ProcessHistoryVO(); - String taskName = cbo.getName(); + String taskName = cbo.name; if(StringUtils.contains(taskName,"-")) { taskName = taskName.substring(taskName.lastIndexOf("-") + 1); } his.setTaskName(taskName); - his.setCreateTime(String.valueOf(cbo.getCreateTime())); - String userIdString = cbo.getAttributeValue("principal"); + his.setCreateTime(String.valueOf(cbo.createTime)); + String userIdString = ObjectTool.getBOAttributeValue(cbo,"principal"); if(StringUtils.contains(userIdString,":")) { userIdString = userIdString.substring(userIdString.indexOf(":") + 1); } - his.setAssignee(cbo.getAttributeValue("principal")); + his.setAssignee(ObjectTool.getBOAttributeValue(cbo,"principal")); String userShowInfoString = ""; SmUserVO user = userQueryService.getUserByUserId(userIdString); if(user != null){ @@ -749,7 +751,7 @@ userShowInfoString = userIdString; } his.setAssigneeName(userShowInfoString); - his.setExecutionId(cbo.getAttributeValue("executionid")); + his.setExecutionId(ObjectTool.getBOAttributeValue(cbo,"executionid")); hisList.add(his); } @@ -936,19 +938,19 @@ oidList.add(oid); } //杞崲鎴�500闀垮害鐨� - List<com.vci.client.bof.ClientBusinessObject> cboList = new ArrayList<com.vci.client.bof.ClientBusinessObject>(); + List<BusinessObject> cboList = new ArrayList<BusinessObject>(); if(oidList.size()>500){ List<List<String>> oidListForIn = WebUtil.switchListForOracleIn(oidList); for(List<String> oidListForInRecord : oidListForIn){ Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oidListForInRecord.toArray(new String[0])) + ")" ); - List<com.vci.client.bof.ClientBusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); + List<BusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); cboList.addAll(tempCbos); } }else{ Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oidList.toArray(new String[0])) + ")" ); - List<com.vci.client.bof.ClientBusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); + List<BusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); cboList.addAll(tempCbos); } //鎵惧埌杩欎釜涓氬姟绫诲瀷鐨勮捣濮嬬姸鎬� diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/OsMapToObjFunction.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/OsMapToObjFunction.java index 6e559de..300019b 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/OsMapToObjFunction.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/OsMapToObjFunction.java @@ -1,5 +1,7 @@ package com.vci.web.other; +import com.vci.corba.omd.data.BusinessObject; + /** * 瀵硅薄鏈嶅姟涓紝map杞垚VO鐨勫璞� * @author weidy @@ -13,5 +15,5 @@ * @param data 鏁版嵁鐨勬槧灏� * @param obj 瀵硅薄 */ - void convert(com.vci.client.bof.ClientBusinessObject data, T obj); + void convert(BusinessObject data, T obj); } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/WorkFlowEndedNotice.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/WorkFlowEndedNotice.java index c6dad11..33f5ba3 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/WorkFlowEndedNotice.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/WorkFlowEndedNotice.java @@ -1,12 +1,13 @@ package com.vci.web.other; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientBusinessObjectOperation; import com.vci.corba.common.PLException; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.omd.utils.ObjectTool; import com.vci.web.annotation.FlowNotifyBefore; import com.vci.web.annotation.FlowNotifyWeb; import com.vci.web.bo.FlowNoticeInfo; import com.vci.web.service.WebBoServiceI; +import com.vci.web.util.PlatformClientUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,6 +31,10 @@ @Autowired private WebBoServiceI boService; + @Autowired + private PlatformClientUtil platformClientUtil; + + @FlowNotifyBefore public void callBefore(FlowNoticeInfo noticeInfo) { try { @@ -43,32 +48,32 @@ } String sql = "SELECT T_OID,T_BTWNAME FROM PLATFORMLT_INPUT WHERE F_OID = '" + wfOid + "'"; - ClientBusinessObjectOperation operation = new ClientBusinessObjectOperation(); - List<com.vci.client.bof.ClientBusinessObject> queryResult = boService.queryBySql(sql, new HashMap<>()); + List<BusinessObject> queryResult = boService.queryBySql(sql, new HashMap<>()); if (queryResult.size() == 0) { logger.info("娌℃湁鎵惧埌涓氬姟鏁版嵁"); return; } - String btmName = queryResult.get(0).getAttributeValue("t_btwname"); - String oid = queryResult.get(0).getAttributeValue("t_oid"); + String btmName = ObjectTool.getBOAttributeValue(queryResult.get(0),"t_btwname"); + String oid = ObjectTool.getBOAttributeValue(queryResult.get(0),"t_oid"); String querySql = "select cac.oid from PLATFORMBTM_CODEALLCODE cac\n" + " left join PLATFORMBTM_" + btmName + " wp on cac.CREATECODEOID = wp.OID\n" + " where wp.OID = '" + oid + "'"; Map<String, String> conditionMap = new HashMap<>(); conditionMap.put("oid", oid); - List<com.vci.client.bof.ClientBusinessObject> codeResult = boService.queryCBO(btmName, conditionMap); + List<BusinessObject> codeResult = boService.queryCBO(btmName, conditionMap); conditionMap.clear(); - conditionMap.put("createCodeOid", codeResult.get(0).getAttributeValue("oid")); - List<com.vci.client.bof.ClientBusinessObject> allCodeList = boService.queryCBO("codeAllCode", conditionMap); + conditionMap.put("createCodeOid", ObjectTool.getBOAttributeValue(queryResult.get(0),"oid")); + List<BusinessObject> allCodeList = boService.queryCBO("codeAllCode", conditionMap); if (allCodeList.size() == 0) { logger.info("娌℃湁鎵惧埌缂栫爜"); return; } - for (com.vci.client.bof.ClientBusinessObject codeAllCode : allCodeList) { - codeAllCode.setLcStatus("Editing"); - codeAllCode.setAttributeValue("lcstatus", "Editing"); + for (BusinessObject codeAllCode : allCodeList) { + codeAllCode.lcStatus = "Editing"; + ObjectTool.setBOAttributeValue(codeAllCode,"lcstatus", "Editing"); } - operation.batchUpdateBuinessObject(allCodeList.toArray(new ClientBusinessObject[0])); + + platformClientUtil.getBOFService().batchUpdateBusinessObject(allCodeList.toArray(new BusinessObject[0])); logger.info("缂栫爜鐢熷懡鍛ㄦ湡鎭㈠瀹屾垚"); } } catch (PLException e) { diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/pageModel/BatchCBO.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/pageModel/BatchCBO.java index a43d086..cd8b141 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/pageModel/BatchCBO.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/pageModel/BatchCBO.java @@ -1,8 +1,8 @@ package com.vci.web.pageModel; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.corba.omd.data.LinkObject; import org.springframework.util.CollectionUtils; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientLinkObject; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; @@ -17,42 +17,42 @@ /** * 绌虹殑涓氬姟绫诲瀷鏁扮粍 */ - private ClientBusinessObject[] nullCboArray = new ClientBusinessObject[0]; + private BusinessObject[] nullCboArray = new BusinessObject[0]; /** * 绌虹殑閾炬帴绫诲瀷鏁扮粍 */ - private ClientLinkObject[] nullCloArray = new ClientLinkObject[0]; + private LinkObject[] nullCloArray = new LinkObject[0]; /** * 鍒涘缓鐨勪笟鍔$被鍨� */ - private Set<ClientBusinessObject> createCbos = new HashSet<ClientBusinessObject>(); + private Set<BusinessObject> createCbos = new HashSet<BusinessObject>(); /** * 鍒涘缓鐨勯摼鎺ョ被鍨� */ - private Set<ClientLinkObject> createClos = new HashSet<ClientLinkObject>(); + private Set<LinkObject> createClos = new HashSet<LinkObject>(); /** * 鏇存柊鐨勪笟鍔$被鍨� */ - private Set<ClientBusinessObject> updateCbos = new HashSet<ClientBusinessObject>(); + private Set<BusinessObject> updateCbos = new HashSet<BusinessObject>(); /** * 鏇存柊鐨勯摼鎺ョ被鍨� */ - private Set<ClientLinkObject> updateClos = new HashSet<ClientLinkObject>(); + private Set<LinkObject> updateClos = new HashSet<LinkObject>(); /** * 鍒犻櫎涓氬姟绫诲瀷 */ - private Set<ClientBusinessObject> deleteCbos = new HashSet<ClientBusinessObject>(); + private Set<BusinessObject> deleteCbos = new HashSet<BusinessObject>(); /** * 鍒犻櫎鐨勯摼鎺ョ被鍨� */ - private Set<ClientLinkObject> deleteClos = new HashSet<ClientLinkObject>(); + private Set<LinkObject> deleteClos = new HashSet<LinkObject>(); /** * 鏉ユ簮鏁版嵁闆嗗悎 @@ -91,119 +91,119 @@ } } - public void addCreateCbo(ClientBusinessObject cbo){ + public void addCreateCbo(BusinessObject cbo){ this.createCbos.add(cbo); } - public void addCreateClo(ClientLinkObject clo){ + public void addCreateClo(LinkObject clo){ this.createClos.add(clo); } - public void addUpdateCbo(ClientBusinessObject cbo){ + public void addUpdateCbo(BusinessObject cbo){ this.updateCbos.add(cbo); } - public void addUpdateClo(ClientLinkObject clo){ + public void addUpdateClo(LinkObject clo){ this.updateClos.add(clo); } - public void addDeleteCbo(ClientBusinessObject cbo){ + public void addDeleteCbo(BusinessObject cbo){ this.deleteCbos.add(cbo); } - public void addDeleteClo(ClientLinkObject clo){ + public void addDeleteClo(LinkObject clo){ this.deleteClos.add(clo); } - public ClientBusinessObject[] getCreateCboArray(){ + public BusinessObject[] getCreateCboArray(){ if( this.createCbos == null){ - this.createCbos = new HashSet<ClientBusinessObject>(); + this.createCbos = new HashSet<BusinessObject>(); } - return this.createCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCboArray); + return this.createCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCboArray); } - public ClientLinkObject[] getCreateCloArray(){ + public LinkObject[] getCreateCloArray(){ if( this.createClos == null){ - this.createClos = new HashSet<ClientLinkObject>(); + this.createClos = new HashSet<LinkObject>(); } - return this.createClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCloArray); + return this.createClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCloArray); } - public ClientBusinessObject[] getUpdateCboArray(){ + public BusinessObject[] getUpdateCboArray(){ if( this.updateCbos == null){ - this.updateCbos = new HashSet<ClientBusinessObject>(); + this.updateCbos = new HashSet<BusinessObject>(); } - return this.updateCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCboArray); + return this.updateCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCboArray); } - public ClientLinkObject[] getUpdateCloArray(){ + public LinkObject[] getUpdateCloArray(){ if( this.updateClos == null){ - this.updateClos = new HashSet<ClientLinkObject>(); + this.updateClos = new HashSet<LinkObject>(); } - return this.updateClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCloArray); + return this.updateClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCloArray); } - public ClientBusinessObject[] getDeleteCboArray(){ + public BusinessObject[] getDeleteCboArray(){ if( this.deleteCbos == null){ - this.deleteCbos = new HashSet<ClientBusinessObject>(); + this.deleteCbos = new HashSet<BusinessObject>(); } return this.deleteCbos.toArray(nullCboArray); } - public ClientLinkObject[] getDeleteCloArray(){ + public LinkObject[] getDeleteCloArray(){ if( this.deleteClos == null){ - this.deleteClos = new HashSet<ClientLinkObject>(); + this.deleteClos = new HashSet<LinkObject>(); } return this.deleteClos.toArray(nullCloArray); } - public Set<ClientBusinessObject> getCreateCbos() { + public Set<BusinessObject> getCreateCbos() { return createCbos; } - public void setCreateCbos(Set<ClientBusinessObject> createCbos) { + public void setCreateCbos(Set<BusinessObject> createCbos) { this.createCbos = createCbos; } - public Set<ClientLinkObject> getCreateClos() { + public Set<LinkObject> getCreateClos() { return createClos; } - public void setCreateClos(Set<ClientLinkObject> createClos) { + public void setCreateClos(Set<LinkObject> createClos) { this.createClos = createClos; } - public Set<ClientBusinessObject> getUpdateCbos() { + public Set<BusinessObject> getUpdateCbos() { return updateCbos; } - public void setUpdateCbos(Set<ClientBusinessObject> updateCbos) { + public void setUpdateCbos(Set<BusinessObject> updateCbos) { this.updateCbos = updateCbos; } - public Set<ClientLinkObject> getUpdateClos() { + public Set<LinkObject> getUpdateClos() { return updateClos; } - public void setUpdateClos(Set<ClientLinkObject> updateClos) { + public void setUpdateClos(Set<LinkObject> updateClos) { this.updateClos = updateClos; } - public Set<ClientBusinessObject> getDeleteCbos() { + public Set<BusinessObject> getDeleteCbos() { return deleteCbos; } - public void setDeleteCbos(Set<ClientBusinessObject> deleteCbos) { + public void setDeleteCbos(Set<BusinessObject> deleteCbos) { this.deleteCbos = deleteCbos; } - public Set<ClientLinkObject> getDeleteClos() { + public Set<LinkObject> getDeleteClos() { return deleteClos; } - public void setDeleteClos(Set<ClientLinkObject> deleteClos) { + public void setDeleteClos(Set<LinkObject> deleteClos) { this.deleteClos = deleteClos; } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBaseServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBaseServiceI.java index f3a72a9..491fee7 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBaseServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBaseServiceI.java @@ -1,5 +1,6 @@ package com.vci.web.service; +import com.vci.corba.omd.data.BusinessObject; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.PageHelper; @@ -68,7 +69,7 @@ String sql = (StringUtils.isNotBlank(pageSql)?" select oid,ts,creator,createTime,modifier,modifyTime,name,label,description from (select A.* , rownum RN from (":"") + baseSql+ pageSql ; WebBoServiceI boService = ApplicationContextProvider.getApplicationContext().getBean(WebBoServiceI.class); - List<com.vci.client.bof.ClientBusinessObject> dataMap = boService.queryBySql(sql, null); + List<BusinessObject> dataMap = boService.queryBySql(sql, null); DataGrid<T> dataGrid = new DataGrid<>(); if(!CollectionUtils.isEmpty(dataMap)){ List<T> dataList = new ArrayList<>(); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLifeCycleServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLifeCycleServiceI.java index fe80c5f..e3e0992 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLifeCycleServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLifeCycleServiceI.java @@ -1,5 +1,6 @@ package com.vci.web.service; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.lcm.LifeCycle; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseQueryObject; @@ -59,7 +60,7 @@ * @param targetStatus 鐩爣鐘舵�侊紝涓嶅尯鍒嗗ぇ灏忓啓 * @throws VciBaseException 杞崲鐢熷懡鍛ㄦ湡鍑洪敊鐨勬椂鍊欐姏鍑哄紓甯� */ - void transCboStatus(List<com.vci.client.bof.ClientBusinessObject> cboList, String targetStatus) throws VciBaseException; + void transCboStatus(List<BusinessObject> cboList, String targetStatus) throws VciBaseException; /** * 閫氳繃缂栧彿鑾峰彇鐢熷懡鍛ㄦ湡鐘舵�佸璞★紝 diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIDataServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIDataServiceI.java index f2eeb6a..0cd9432 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIDataServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIDataServiceI.java @@ -1,7 +1,9 @@ package com.vci.web.service; -import com.vci.client.bof.RevisionValueObject; -import com.vci.client.bof.VersionValueObject; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.corba.omd.data.LinkObject; +import com.vci.corba.omd.data.RevisionDataInfo; +import com.vci.corba.omd.data.VersionDataInfo; import com.vci.starter.web.enumpck.VciChangeDocumentTypeEnum; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.model.BaseModel; @@ -69,7 +71,7 @@ * @return 鎵ц鐨勭粨鏋� * @throws VciBaseException 鎵ц鍑洪敊鐨勪細鎶涘嚭寮傚父锛屾垨鑰呬簨浠剁洿鎺ヨ繑鍥炰簡寮傚父 */ - BaseResult callPostEvent(Collection<com.vci.client.bof.ClientBusinessObject> cbos, Collection<com.vci.client.bof.ClientLinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException; + BaseResult callPostEvent(Collection<BusinessObject> cbos, Collection<LinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException; /** * 琛ㄥ崟鏁版嵁杞崲涓哄熀纭�瀵硅薄 @@ -112,7 +114,7 @@ * @param cbo 涓氬姟鏁版嵁瀵硅薄 * @return 鍩虹瀵硅薄 */ - BaseModel cbo2BaseModel(com.vci.client.bof.ClientBusinessObject cbo); + BaseModel cbo2BaseModel(BusinessObject cbo); /** * 涓氬姟鏁版嵁琛ㄥ崟瀵硅薄杞崲涓哄熀纭�鐨勫睘鎬� @@ -134,7 +136,7 @@ * @param baseModel 鍩虹瀵硅薄 * @return 鐗堟湰鐨勫璞� */ - RevisionValueObject getNextRevision(OsBtmTypeVO btmTypeVO, BaseModel baseModel); + RevisionDataInfo getNextRevision(OsBtmTypeVO btmTypeVO, BaseModel baseModel); /** * 鑾峰彇涓嬩竴涓増娆$殑鍙� @@ -142,7 +144,7 @@ * @param baseModel 鍩虹瀵硅薄 * @return 鐗堟湰鐨勫�煎璞� */ - VersionValueObject getNextVersion(OsBtmTypeVO btmTypeVO, BaseModel baseModel); + VersionDataInfo getNextVersion(OsBtmTypeVO btmTypeVO, BaseModel baseModel); /** * 鑾峰彇绗竴涓増娆� @@ -206,7 +208,7 @@ * @param cbo 涓氬姟绫诲瀷鐨勫璞� * @param editFlag 鏄惁涓虹紪杈� */ - void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, com.vci.client.bof.ClientBusinessObject cbo, boolean editFlag); + void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, BusinessObject cbo, boolean editFlag); /** * 閾炬帴绫诲瀷鐨勭紪杈戞暟鎹� diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebBoServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebBoServiceI.java index 634c6d8..88e3208 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebBoServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebBoServiceI.java @@ -1,8 +1,9 @@ package com.vci.web.service; -import com.vci.client.bof.ClientBusinessObject; import com.vci.common.qt.object.Condition; import com.vci.common.qt.object.QueryTemplate; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.corba.omd.data.LinkObject; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.PageHelper; @@ -40,7 +41,7 @@ * @return * @throws VciBaseException */ - ClientBusinessObject createCBOByBtmName(String btmName) throws VciBaseException; + BusinessObject createCBOByBtmName(String btmName) throws VciBaseException; /** * 鏍规嵁鏌ヨ鏉′欢鏉ユ煡璇笟鍔$被鍨嬩笅鐨勬暟鎹� @@ -49,7 +50,7 @@ * @return * @throws VciBaseException */ - List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap) throws VciBaseException; + List<BusinessObject> queryCBO(String btmType, Map<String, String> conditionMap) throws VciBaseException; /** * 鏀寔鎺掑簭鍜屽垎椤电殑鏌ヨ涓氬姟绫诲瀷涓嬬殑鏁版嵁 @@ -59,7 +60,7 @@ * @return * @throws VciBaseException */ - List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph) throws VciBaseException; + List<BusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph) throws VciBaseException; /** * 鏀寔鑷畾涔夋煡璇㈠瓧娈碉紙鍖呮嫭鍙傜収銆佹灇涓惧拰鐢熷懡鍛ㄦ湡锛� @@ -70,7 +71,7 @@ * @return * @throws VciBaseException */ - List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph, List<String> clauseList) throws VciBaseException; + List<BusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph, List<String> clauseList) throws VciBaseException; /** * 鎷疯礉鍒嗛〉鍜屾帓搴忕殑璁剧疆鍒版煡璇㈡ā鏉� @@ -86,7 +87,7 @@ * @param enumAttrName 鏋氫妇鐨勫悕绉� * @throws VciBaseException 鏌ヨ鏋氫妇鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ - void queryEnumText(com.vci.client.bof.ClientBusinessObject cbo, com.vci.client.bof.ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException; + void queryEnumText(BusinessObject cbo, LinkObject clo, List<String> enumAttrName) throws VciBaseException; /** * 缁欓摼鎺ョ被鍨嬭缃睘鎬� @@ -94,7 +95,7 @@ * @param attributeName 灞炴�х殑鍚嶇О * @param attributeValue 灞炴�х殑鍊� */ - void setAttributeValueForClo(com.vci.client.bof.ClientLinkObject clo, String attributeName, String attributeValue); + void setAttributeValueForClo(LinkObject clo, String attributeName, String attributeValue); /** * 浣跨敤鏌ヨ鏂规鏉ユ煡璇㈡暟鎹紝杩斿洖CBO @@ -104,7 +105,7 @@ * @return * @throws VciBaseException */ - List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap) throws VciBaseException; + List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap) throws VciBaseException; /** * 浣跨敤鏌ヨ鏂规鏉ユ煡璇㈡暟鎹紝杩斿洖CBO锛屾敮鎸佸垎椤� @@ -115,7 +116,7 @@ * @return * @throws VciBaseException */ - List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph) throws VciBaseException; + List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph) throws VciBaseException; /** * 浣跨敤鍚嶅瓧鑾峰彇鏌ヨ妯℃澘 @@ -136,7 +137,7 @@ * @return * @throws VciBaseException */ - List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph, List<String> clauseList) throws VciBaseException; + List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph, List<String> clauseList) throws VciBaseException; /** * 鏌ヨ鏁伴噺 @@ -182,7 +183,7 @@ * @return CBO * @throws VciBaseException */ - List<com.vci.client.bof.ClientBusinessObject> queryBySql(String sql, Map<String, String> conditionMap) throws VciBaseException; + List<BusinessObject> queryBySql(String sql, Map<String, String> conditionMap) throws VciBaseException; /** * 鍙敤sql璇彞鏌ヨ锛岃繖涓拰queryBySql鍖哄埆鏄紝鐗规畩鐨剆ql(濡傚寘鍚湁鍑芥暟鐨�)鍙互鐢ㄨ繖涓柟娉曪紝浣嗘槸鏈塻ql娉ㄥ叆椋庨櫓 @@ -190,7 +191,7 @@ * @return CBO * @throws VciBaseException 鏌ヨ鍑洪敊娲绘姏鍑哄紓甯� */ - List<com.vci.client.bof.ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException; + List<BusinessObject> queryByOnlySql(String sql) throws VciBaseException; /** * 鍙敤sql璇彞鏌ヨ锛岃繖涓拰queryBySqlForMap鍖哄埆鏄紝鐗规畩鐨剆ql(濡傚寘鍚湁鍑芥暟鐨�)鍙互鐢ㄨ繖涓柟娉曪紝浣嗘槸鏈塻ql娉ㄥ叆椋庨櫓 @@ -474,36 +475,36 @@ DataGrid queryGridClassByScheme(String queryScheme, Class c, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph) throws VciBaseException; /** - * ClientBusinessObject 杞负HashMap + * BusinessObject 杞负HashMap * @param cbos CBOS * @return map * @throws VciBaseException */ - List<Map> cbos2Map(List<ClientBusinessObject> cbos) throws VciBaseException; + List<Map> cbos2Map(List<BusinessObject> cbos) throws VciBaseException; /** - * ClientBusinessObject 杞负HashMap + * BusinessObject 杞负HashMap * @param cbo * @return * @throws VciBaseException */ - Map cbo2Map(com.vci.client.bof.ClientBusinessObject cbo) throws VciBaseException; + Map cbo2Map(BusinessObject cbo) throws VciBaseException; /** - * map杞负clientBusinessObject + * map杞负BusinessObject * @param map * @return * @throws VciBaseException */ - List<ClientBusinessObject> map2Cbos(List<Map> map) throws VciBaseException; + List<BusinessObject> map2Cbos(List<Map> map) throws VciBaseException; /** - * map杞负clientBusinessObject + * map杞负BusinessObject * @param map * @return * @throws VciBaseException */ - ClientBusinessObject map2Cbo(Map map) throws VciBaseException; + BusinessObject map2Cbo(Map map) throws VciBaseException; /** * 鎵归噺淇濆瓨涓氬姟绫诲瀷鍜岄摼鎺ョ被鍨嬬殑淇℃伅 @@ -572,7 +573,7 @@ * @return cbo * @throws VciBaseException 鍙傛暟涓虹┖锛屾暟鎹笉瀛樺湪浼氭姏鍑哄紓甯� */ - ClientBusinessObject selectCBOByOid(String oid,String btmName) throws VciBaseException; + BusinessObject selectCBOByOid(String oid,String btmName) throws VciBaseException; /** * 浣跨敤涓婚敭闆嗗悎鑾峰彇瀵硅薄 @@ -590,7 +591,7 @@ * @return 涓氬姟鏁版嵁鐨勯泦鍚� * @throws VciBaseException 鍙傛暟涓虹┖锛屾煡璇㈠嚭閿欎細鎶涘嚭寮傚父 */ - List<ClientBusinessObject> selectCBOByOidCollection(Collection<String> oidCollection,String btmName) throws VciBaseException; + List<BusinessObject> selectCBOByOidCollection(Collection<String> oidCollection,String btmName) throws VciBaseException; /** * 浣跨敤鏂扮殑鏌ヨ灏佽鍣ㄦ潵鏌ヨ diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebLoServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebLoServiceI.java index 77fa85b..413891b 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebLoServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebLoServiceI.java @@ -1,8 +1,7 @@ package com.vci.web.service; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientLinkObject; -import com.vci.client.bof.ClientLinkObjectOperation; +import com.vci.corba.omd.data.AttributeValue; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.data.LinkObject; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; @@ -16,12 +15,6 @@ public interface WebLoServiceI { - /** - * 鑾峰彇骞冲彴鐨勯摼鎺ョ被鍨嬬殑鎿嶄綔绫� - * @return - * @throws VciBaseException - */ - ClientLinkObjectOperation getLoOption() throws VciBaseException; /** * 鏍规嵁鏌ヨ鏉′欢鏉ユ煡璇㈤摼鎺ョ被鍨� @@ -30,7 +23,7 @@ * @return * @throws VciBaseException */ - List<ClientLinkObject> queryCLO(String linkType, Map<String, String> conditionMap) throws VciBaseException; + List<LinkObject> queryCLO(String linkType, Map<String, String> conditionMap) throws VciBaseException; /** * 鏍规嵁鏌ヨ鏉′欢鏉ユ煡璇㈤摼鎺ョ被鍨� @@ -40,7 +33,7 @@ * @return * @throws VciBaseException */ - List<ClientBusinessObject> queryLinkCbo(String linkType, String toBtmname, Map<String, String> conditionMap) throws VciBaseException; + List<BusinessObject> queryLinkCbo(String linkType, String toBtmname, Map<String, String> conditionMap) throws VciBaseException; /** * 鏌ヨ閾炬帴绫诲瀷 @@ -51,7 +44,7 @@ * @return * @throws VciBaseException */ - List<ClientLinkObject> queryCLO(String linkType, String toBtmName, int level, Map<String, String> conditionMap) throws VciBaseException; + List<LinkObject> queryCLO(String linkType, String toBtmName, int level, Map<String, String> conditionMap) throws VciBaseException; /** * 鏌ヨto绔殑涓氬姟绫诲瀷 @@ -62,7 +55,7 @@ * @return * @throws VciBaseException */ - List<ClientBusinessObject> queryLinkCbo(String linkType, String toBtmname, int level, Map<String, String> conditionMap) throws VciBaseException; + List<BusinessObject> queryLinkCbo(String linkType, String toBtmname, int level, Map<String, String> conditionMap) throws VciBaseException; /** * 鏌ヨ閾炬帴绫诲瀷 @@ -74,7 +67,7 @@ * @return * @throws VciBaseException */ - List<ClientLinkObject> queryCLO(String linkType, String toBtmName, + List<LinkObject> queryCLO(String linkType, String toBtmName, int level, boolean isDirection, Map<String, String> conditionMap) throws VciBaseException; @@ -89,7 +82,7 @@ * @return * @throws VciBaseException */ - List<ClientLinkObject> queryCLO(String linkType, String toBtmName, + List<LinkObject> queryCLO(String linkType, String toBtmName, int level, boolean isDirection, Map<String, String> conditionMap, PageHelper ph) throws VciBaseException; @@ -103,7 +96,7 @@ * @return * @throws VciBaseException */ - List<ClientBusinessObject> queryLinkCbo(String linkType, String toBtmname, + List<BusinessObject> queryLinkCbo(String linkType, String toBtmname, int level, boolean isDirection, Map<String, String> conditionMap) throws VciBaseException; @@ -114,7 +107,7 @@ * @return * @throws VciBaseException */ - Map<String,com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, boolean isDirection) throws VciBaseException; + Map<String,BusinessObject> queryLinkedCbo(LinkObject[] lo, boolean isDirection) throws VciBaseException; /** *鏌ヨ閾炬帴绫诲瀷鏌愮鐨勪笟鍔$被鍨� @@ -123,16 +116,16 @@ * @return * @throws VciBaseException */ - Map<String,com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(List los, boolean isDirection) throws VciBaseException; + Map<String,BusinessObject> queryLinkedCbo(List los, boolean isDirection) throws VciBaseException; - /** - *鏌ヨ閾炬帴绫诲瀷鏌愮鐨勪笟鍔$被鍨� - * @param clo 閾炬帴绫诲瀷瀵硅薄 - * @param isDirection 鏄惁鍙嶅悜 - * @return - * @throws VciBaseException - */ - Map<String,com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(ClientLinkObject[] clo, boolean isDirection) throws VciBaseException; +// /** +// *鏌ヨ閾炬帴绫诲瀷鏌愮鐨勪笟鍔$被鍨� +// * @param clo 閾炬帴绫诲瀷瀵硅薄 +// * @param isDirection 鏄惁鍙嶅悜 +// * @return +// * @throws VciBaseException +// */ +// Map<String,BusinessObject> queryLinkedCbo(LinkObject[] clo, boolean isDirection) throws VciBaseException; /** * 鏌ヨ閾炬帴绫诲瀷鏌愮鐨勪笟鍔$被鍨� @@ -142,7 +135,7 @@ * @return * @throws VciBaseException */ - Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(ClientLinkObject[] clol, + Map<String, BusinessObject> queryLinkedCbo(LinkObject[] clol, boolean isDirection, List<String> queryColumn) throws VciBaseException; /** @@ -153,40 +146,40 @@ * @return * @throws VciBaseException */ - Map<String, ClientBusinessObject> queryLinkedCbo(List los, + Map<String, BusinessObject> queryLinkedCbo(List los, boolean isDirection, List<String> queryColumn) throws VciBaseException; /** - * ClientLinkObject 杞负HashMap + * LinkObject 杞负HashMap * @param clos clos * @return map * @throws VciBaseException */ - List<Map> clos2Map(List<ClientLinkObject> clos) throws VciBaseException; + List<Map> clos2Map(List<LinkObject> clos) throws VciBaseException; /** - * ClientLinkObject 杞负HashMap + * LinkObject 杞负HashMap * @param clo * @return * @throws VciBaseException */ - Map clo2Map(ClientLinkObject clo) throws VciBaseException; + Map clo2Map(LinkObject clo) throws VciBaseException; /** - * map杞负ClientLinkObject + * map杞负LinkObject * @param map * @return * @throws VciBaseException */ - List<ClientLinkObject> map2Clos(List<Map> map) throws VciBaseException; + List<LinkObject> map2Clos(List<Map> map) throws VciBaseException; /** - * map杞负ClientLinkObject + * map杞负LinkObject * @param map * @return * @throws VciBaseException */ - ClientLinkObject map2Clo(Map map) throws VciBaseException; + LinkObject map2Clo(Map map) throws VciBaseException; /** * 淇濆瓨閾炬帴绫诲瀷瀵硅薄 @@ -194,7 +187,7 @@ * @return * @throws VciBaseException */ - List<ClientLinkObject> saveClientLinkObjects(List<ClientLinkObject> clos) throws VciBaseException; + List<LinkObject> saveLinkObjects(List<LinkObject> clos) throws VciBaseException; /** * 鍒涘缓杩炴帴绫诲瀷 @@ -202,7 +195,7 @@ * @return * @throws VciBaseException */ - ClientLinkObject createClientLinkObject(String loName) throws VciBaseException; + LinkObject createLinkObject(String loName) throws VciBaseException; /** * 鎷疯礉閾炬帴绫诲瀷 @@ -210,21 +203,21 @@ * @return * @throws VciBaseException */ - ClientLinkObject cloneClientLinkObject(ClientLinkObject clo) throws VciBaseException; + LinkObject cloneLinkObject(LinkObject clo) throws VciBaseException; /** * 鍒犻櫎閾炬帴绫诲瀷 * @param clos 閾炬帴绫诲瀷鐨勫唴瀹� * @throws VciBaseException */ - void deleteClientLinkObjects(List<ClientLinkObject> clos) throws VciBaseException; + void deleteLinkObjects(List<LinkObject> clos) throws VciBaseException; /** * 鏇存柊閾炬帴绫诲瀷 * @param clos 閾炬帴绫诲瀷鐨勫璞� * @throws VciBaseException 鎵ц鍑洪敊浼氭姏鍑哄紓甯� */ - void updateClientLinkObject(List<ClientLinkObject> clos) throws VciBaseException; + void updateLinkObject(List<LinkObject> clos) throws VciBaseException; /** * 鏌ヨ閾炬帴绫诲瀷鍜屼笟鍔$被鍨� @@ -272,8 +265,8 @@ * @param attributeName 灞炴�у悕绉� * @param attributeValue 灞炴�х殑鍊� */ - public default void setAttribute(com.vci.client.bof.ClientLinkObject clo,String attributeName,String attributeValue){ - com.vci.corba.omd.data.AttributeValue[] attrValues =clo.getLinkObject().newAttrValList; + public default void setAttribute(LinkObject clo,String attributeName,String attributeValue){ + com.vci.corba.omd.data.AttributeValue[] attrValues =clo.newAttrValList; ArrayList<com.vci.corba.omd.data.AttributeValue> attrValList = new ArrayList(); com.vci.corba.omd.data.AttributeValue attrVal; int i; @@ -306,6 +299,6 @@ attrValList.add(attrVal); } - clo.getLinkObject().newAttrValList = (com.vci.corba.omd.data.AttributeValue[])attrValList.toArray(new com.vci.corba.omd.data.AttributeValue[attrValList.size()]); + clo.newAttrValList = attrValList.toArray(new AttributeValue[attrValList.size()]); }; } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java index 1c81410..aba5f04 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java @@ -12,6 +12,8 @@ import com.vci.frameworkcore.compatibility.ISmFunctionQueryService; import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI; import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; +import com.vci.frameworkcore.enumpck.ResourceControlTypeEnum; +import com.vci.frameworkcore.pagemodel.SmFunctionVO; import com.vci.frameworkcore.pagemodel.SmUserVO; import com.vci.frameworkcore.properties.VciSecurityManageProperties; import com.vci.starter.web.annotation.bus.VciLoginAfter; @@ -40,6 +42,7 @@ import javax.annotation.Resource; import java.lang.reflect.Method; import java.util.Date; +import java.util.List; import java.util.Map; import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.*; diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java index 45f22b4..97b69cc 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java @@ -24,7 +24,8 @@ import java.util.*; import java.util.stream.Collectors; -import static com.vci.client.omd.attribpool.ui.VTDataTypePanel.*; +//import static com.vci.client.omd.attribpool.ui.VTDataTypePanel.*; +import static com.vci.omd.constants.AttributeConstants.*; /** * 灞炴�ф睜鏈嶅姟 --宸茬粡璋冪敤浜嗗钩鍙扮殑鏈嶅姟锛屽洜姝や笉鍦ㄦ彁渚汥ao灞� diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java index 2832ab8..d3fa3fa 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java @@ -1,8 +1,10 @@ package com.vci.web.service.impl; import com.vci.corba.common.PLException; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.etm.EnumItem; import com.vci.corba.omd.etm.EnumType; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.annotation.log.VciUnLog; import com.vci.starter.web.enumpck.UserSecretEnum; import com.vci.starter.web.exception.VciBaseException; @@ -323,8 +325,8 @@ @Override public List<KeyValue> getDataEnum(String oid, String btmname) { VciBaseUtil.alertNotNull(oid,"涓氬姟鏁版嵁鐨勪富閿�",btmname,"涓氬姟绫诲瀷"); - com.vci.client.bof.ClientBusinessObject cbo = boService.selectCBOByOid(oid, btmname); - String secret = cbo.getAttributeValue("secretGrade"); + BusinessObject cbo = boService.selectCBOByOid(oid, btmname); + String secret = ObjectTool.getBOAttributeValue(cbo,"secretGrade"); if(StringUtils.isBlank(secret)){ return new ArrayList<>(); }else{ diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLifeCycleServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLifeCycleServiceImpl.java index 5fedebe..64effb0 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLifeCycleServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLifeCycleServiceImpl.java @@ -1,6 +1,7 @@ package com.vci.web.service.impl; import com.vci.corba.common.PLException; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.lcm.Bound; import com.vci.corba.omd.lcm.LifeCycle; import com.vci.corba.omd.lcm.TransitionVO; @@ -151,12 +152,12 @@ * @throws VciBaseException 杞崲鐢熷懡鍛ㄦ湡鍑洪敊鐨勬椂鍊欐姏鍑哄紓甯� */ @Override - public void transCboStatus(List<com.vci.client.bof.ClientBusinessObject> cboList, + public void transCboStatus(List<BusinessObject> cboList, String targetStatus) throws VciBaseException { WebUtil.alertNotNull(cboList,"涓氬姟鏁版嵁瀵硅薄",targetStatus,"鐩爣瀵硅薄"); - com.vci.corba.omd.data.BusinessObject[] bos = new com.vci.corba.omd.data.BusinessObject[cboList.size()]; + BusinessObject[] bos = new BusinessObject[cboList.size()]; for(int i = 0 ; i < cboList.size() ; i ++){ - bos[i] = cboList.get(i).getBusinessObject(); + bos[i] = cboList.get(i); } transStatus(bos, targetStatus); } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java index 9c8cfdf..58b792c 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java @@ -1,7 +1,9 @@ package com.vci.web.service.impl; import com.vci.corba.common.PLException; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.ltm.LinkType; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.annotation.log.VciUnLog; import com.vci.starter.web.enumpck.VciFieldTypeEnum; import com.vci.starter.web.pagemodel.BaseQueryObject; @@ -270,11 +272,11 @@ "inner JOIN user_col_comments c on t.TABLE_NAME = c.table_name and t.COLUMN_NAME = c.column_name where " + "t.table_name = '" + VciBaseUtil.getTableName(btmTypeVO.getId()).toUpperCase(Locale.ROOT) + "' order by t.column_name asc"; Map<String, OsBtmTypeAttributeVO> attributeVOMap = btmTypeVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); - List<com.vci.client.bof.ClientBusinessObject> cbosList = boService.queryBySql(sql, new HashMap<>()); + List<BusinessObject> cbosList = boService.queryBySql(sql, new HashMap<>()); if(!CollectionUtils.isEmpty(cbosList)){ cbosList.stream().forEach(cbo->{ - String attrId = cbo.getAttributeValue("column_name"); - String dataType = cbo.getAttributeValue("data_type"); + String attrId = ObjectTool.getBOAttributeValue(cbo,"column_name"); + String dataType = ObjectTool.getBOAttributeValue(cbo,"data_type"); if(StringUtils.isNotBlank(dataType) && dataType.contains("(")){ dataType = dataType.substring(0,dataType.indexOf("(")); } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/SmOperationServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/SmOperationServiceImpl.java index 743809b..89cb783 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/SmOperationServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/SmOperationServiceImpl.java @@ -1,5 +1,7 @@ package com.vci.web.service.impl; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.pageModel.SmOperationVO; import com.vci.web.service.SmOperationServiceI; @@ -37,27 +39,27 @@ String sql = "select f.ploid from plfunction f where lower(f.plmoduleno) = :functionId"; Map<String,String> conditionMap = new HashMap<>(); conditionMap.put("functionId",functionId.toLowerCase(Locale.ROOT).trim()); - List<com.vci.client.bof.ClientBusinessObject> functionCbos = boService.queryBySql(sql, conditionMap); + List<BusinessObject> functionCbos = boService.queryBySql(sql, conditionMap); if(CollectionUtils.isEmpty(functionCbos)){ //閮芥病鏈夎繖涓姛鑳� return new ArrayList<>(); } - String functionOid = functionCbos.get(0).getAttributeValue("ploid"); + String functionOid = ObjectTool.getBOAttributeValue(functionCbos.get(0), "ploid"); conditionMap.clear(); conditionMap.put("functionOid",functionOid); sql = "select rf.plrightvalue from PLROLERIGHT rf left join pluserrole ur on rf.plroleoid = ur.plroleuid " + " where ur.pluseruid =:useroid and rf.plfuncoid = :functionOid"; conditionMap.put("useroid",VciBaseUtil.getCurrentUserOid()); - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, conditionMap); + List<BusinessObject> cbos = boService.queryBySql(sql, conditionMap); if(CollectionUtils.isEmpty(cbos)){ //娌℃湁鎺堟潈 return new ArrayList<>(); } - long rightValue = VciBaseUtil.getLong(cbos.get(0).getAttributeValue("plrightvalue")); + long rightValue = VciBaseUtil.getLong(ObjectTool.getBOAttributeValue(cbos.get(0), "plrightvalue")); //鑾峰彇鍏蜂綋鍖呭惈鍝簺鎸夐挳 sql = "select o.ploperoid,o.plno from PLFUNCOPERATION o where o.plfuncoid = :functionOid "; conditionMap.remove("useroid"); - List<com.vci.client.bof.ClientBusinessObject> operationLinkCbos = boService.queryBySql(sql, conditionMap); + List<BusinessObject> operationLinkCbos = boService.queryBySql(sql, conditionMap); if(CollectionUtils.isEmpty(operationLinkCbos)){ //鏍规湰娌℃湁鎸夐挳 return new ArrayList<>(); @@ -66,8 +68,8 @@ List<String> hasRightOids = new ArrayList<>(); Map<String,Integer> oidOrderMap = new HashMap<>(); operationLinkCbos.stream().forEach(cbo->{ - String operationOid = cbo.getAttributeValue("ploperoid"); - int orderNo = VciBaseUtil.getInt(cbo.getAttributeValue("plno")); + String operationOid = ObjectTool.getBOAttributeValue(cbo,"ploperoid"); + int orderNo = VciBaseUtil.getInt(ObjectTool.getBOAttributeValue(cbo,"plno")); if(hasRight(rightValue,orderNo)){ hasRightOids.add(operationOid); oidOrderMap.put(operationOid,orderNo); @@ -78,17 +80,17 @@ return new ArrayList<>(); } sql = "select ploid as oid,plname,pluniqueflag,pldesc,plalias,plsequence from ploperation where ploid in (" + VciBaseUtil.toInSql(hasRightOids.toArray(new String[0])) + ")"; - List<com.vci.client.bof.ClientBusinessObject> opertionCBOs = boService.queryBySql(sql, new HashMap<>()); + List<BusinessObject> opertionCBOs = boService.queryBySql(sql, new HashMap<>()); List<SmOperationVO> operationVOS = new ArrayList<>(); Optional.ofNullable(opertionCBOs).orElseGet(()->new ArrayList<>()).stream().forEach(cbo->{ SmOperationVO operationVO = new SmOperationVO(); operationVO.setFunctionOid(functionOid); - operationVO.setOid(cbo.getOid()); - operationVO.setUniqueFlag(cbo.getAttributeValue("pluniqueflag")); - operationVO.setName(cbo.getAttributeValue("plname")); - operationVO.setAlias(cbo.getAttributeValue("plalias")); + operationVO.setOid(cbo.oid); + operationVO.setUniqueFlag(ObjectTool.getBOAttributeValue(cbo,"pluniqueflag")); + operationVO.setName(ObjectTool.getBOAttributeValue(cbo,"plname")); + operationVO.setAlias(ObjectTool.getBOAttributeValue(cbo,"plalias")); operationVO.setOrderNo(String.valueOf(oidOrderMap.get(operationVO.getOid()))); - operationVO.setDescription(cbo.getAttributeValue("pldesc")); + operationVO.setDescription(ObjectTool.getBOAttributeValue(cbo,"pldesc")); operationVO.setModuleNo(functionId); operationVOS.add(operationVO); }); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java index 11ebca6..f5d358d 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java @@ -1,9 +1,6 @@ package com.vci.web.service.impl; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientLinkObject; -import com.vci.client.bof.RevisionValueObject; -import com.vci.client.bof.VersionValueObject; +import com.vci.client.common.providers.ClientServiceProvider; import com.vci.corba.common.PLException; import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.data.LinkObject; @@ -13,6 +10,7 @@ import com.vci.file.pagemodel.VciFileObjectVO; import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; import com.vci.frameworkcore.lcstatuspck.ReleaseDataLCStatus; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.revision.bo.TreeWrapperOptions; import com.vci.starter.web.annotation.bus.VciChangeDataAfter; import com.vci.starter.web.annotation.bus.VciChangeDataBefore; @@ -250,7 +248,7 @@ UIFormDataVO formDataVO = new UIFormDataVO(); replaceMap.put("oid", formQuery.getOid().trim()); if(!formDefineVO.isLinkTypeFlag()) { - List<com.vci.client.bof.ClientBusinessObject> cbos = null; + List<BusinessObject> cbos = null; if (StringUtils.isNotBlank(queryTemplate)) { replaceMap.put("oid", formQuery.getOid().trim()); cbos = boService.queryCBOByScheme(queryTemplate, conditionMap, replaceMap, null, queryFieldList.stream().collect(Collectors.toList())); @@ -259,7 +257,7 @@ cbos = boService.queryCBO(formQuery.getBtmname(), conditionMap, null, queryFieldList.stream().collect(Collectors.toList())); } if (!CollectionUtils.isEmpty(cbos)) { - com.vci.client.bof.ClientBusinessObject cbo = cbos.get(0); + BusinessObject cbo = cbos.get(0); formDataVO.setData(boService.cbo2Map(cbo)); } else { throw new VciBaseException(DATA_OID_NOT_EXIST); @@ -394,7 +392,7 @@ if(treeQuery.isQueryRoot()){ //鏄煡璇㈡牴鑺傜偣 - List<com.vci.client.bof.ClientBusinessObject> rootCbos = null; + List<BusinessObject> rootCbos = null; if(StringUtils.isNotBlank(queryTemplate)){ //璇存槑鏄彍鍗曢噷瀹氫箟浜嗘煡璇㈡ā鏉跨殑 rootCbos = boService.queryCBOByScheme(queryTemplate, null, replaceMap); @@ -430,7 +428,7 @@ return rootTreeList; }else{ //杩欎釜涓嶆槸璺熻妭鐐癸紝浣嗘槸涓�鑸彧鏄鍔犱竴涓�愮骇鏌ヨ锛屽洜涓哄叏閮ㄦ煡璇㈢殑鏃跺�欙紝鍦ㄦ牴鑺傜偣宸茬粡鍏ㄩ儴鏌ヨ瀹屼簡 - List<com.vci.client.bof.ClientBusinessObject> thisChildren = null; + List<BusinessObject> thisChildren = null; if (StringUtils.isNotBlank(queryTemplate)) { thisChildren = boService.queryCBOByScheme(queryTemplate, treeQuery.getConditionMap(), replaceMap, null, queryFieldList); } else { @@ -545,7 +543,7 @@ */ private void queryTreeForBO(List<Tree> rootTreeList, String queryTemplate,List<String> queryFieldList,TreeQueryObject treeQueryObject) { for (Tree rootTree : rootTreeList) { - List<com.vci.client.bof.ClientBusinessObject> thisChildren = null; + List<BusinessObject> thisChildren = null; Map<String,String> sourceDataMap = rootTree.getAttributes(); sourceDataMap.put("f_oid",rootTree.getOid()); Map<String,String> conditionMap = new HashMap<>(); @@ -592,7 +590,7 @@ * @param parentOid 涓婄骇鐨勪富閿� * @return 鏍� */ - private List<Tree> cbo2Trees(Collection<com.vci.client.bof.ClientBusinessObject> cbos,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){ + private List<Tree> cbo2Trees(Collection<BusinessObject> cbos,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){ final int[] i = {0}; List<Tree> rootList = new ArrayList<>(); List<Tree> children = new ArrayList<>(); @@ -601,7 +599,7 @@ tree.setOid(getValueByExpress(cbo,valueField)); tree.setText(getValueByExpress(cbo,textField)); if(StringUtils.isNotBlank(parentFieldName)){ - tree.setParentId(cbo.getAttributeValue(parentFieldName)); + tree.setParentId(ObjectTool.getBOAttributeValue(cbo,parentFieldName)); } tree.setAttributes(boService.cbo2Map(cbo)); tree.setIndex(i[0] + ""); @@ -636,10 +634,10 @@ List<Tree> children = new ArrayList<>(); boAndLOS.stream().forEach(boAndLO->{ Tree tree = new Tree(); - com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); - cbo.setBusinessObject(boAndLO.bo); - com.vci.client.bof.ClientLinkObject clo = new com.vci.client.bof.ClientLinkObject(); - clo.setLinkObject(boAndLO.lo); + BusinessObject cbo = new BusinessObject(); + cbo = boAndLO.bo; + LinkObject clo = new LinkObject(); + clo = boAndLO.lo; Map<String,String> cloMap = loService.clo2Map(clo); Map<String,String> cbo2Map = boService.cbo2Map(cbo); if(!CollectionUtils.isEmpty(cbo2Map)){ @@ -653,9 +651,9 @@ tree.setParentId(boAndLO.lo.oid + TREE_NODE_ID_SEP + boAndLO.lo.fromOid); }else { if (parentFieldName.contains(".")) { - tree.setParentId(cbo.getAttributeValue(parentFieldName)); + tree.setParentId(ObjectTool.getBOAttributeValue(cbo,parentFieldName)); } else { - tree.setParentId(clo.getAttributeValue(parentFieldName)); + tree.setParentId(ObjectTool.getLOAttributeValue(clo,parentFieldName)); } } @@ -680,7 +678,7 @@ * @param fieldExpress 琛ㄨ揪寮忕殑鍊� * @return 杞崲鍚庣殑鍊� */ - private String getValueByExpress(com.vci.client.bof.ClientBusinessObject cbo,String fieldExpress){ + private String getValueByExpress(BusinessObject cbo,String fieldExpress){ if(StringUtils.isBlank(fieldExpress)){ return ""; } @@ -691,7 +689,7 @@ List<String> fieldList = VciBaseUtil.str2List(fieldExpress); StringBuilder sb = new StringBuilder(); fieldList.stream().forEach(field->{ - sb.append(cbo.getAttributeValue(field)).append(" "); + sb.append(ObjectTool.getBOAttributeValue(cbo,field)).append(" "); }); return sb.toString().trim(); } @@ -872,12 +870,12 @@ * @throws VciBaseException 鎵ц鍑洪敊鐨勪細鎶涘嚭寮傚父锛屾垨鑰呬簨浠剁洿鎺ヨ繑鍥炰簡寮傚父 */ @Override - public BaseResult callPostEvent(Collection<com.vci.client.bof.ClientBusinessObject> cbos, Collection<com.vci.client.bof.ClientLinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{ + public BaseResult callPostEvent(Collection<BusinessObject> cbos, Collection<LinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{ if(CollectionUtils.isEmpty(cbos)){ return BaseResult.success(); } - String btmType = !CollectionUtils.isEmpty(cbos)?cbos.stream().findFirst().get().getBtmName():null; - String linkType = !CollectionUtils.isEmpty(clos)?clos.stream().findFirst().get().getLinkObject().ltName:null; + String btmType = !CollectionUtils.isEmpty(cbos)?cbos.stream().findFirst().get().btName:null; + String linkType = !CollectionUtils.isEmpty(clos)?clos.stream().findFirst().get().ltName:null; if(StringUtils.isNotBlank(postEvent)){ //鍓嶇疆浜嬩欢 //bean鐨勫悕瀛�#鏂规硶; 鎴栬�呭叏璺緞銆傛渶鍚庝竴涓槸鏂规硶鐨勫悕瀛� @@ -1063,32 +1061,32 @@ return beforeResult; } //灏佽鏁版嵁 - BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,false,false); + BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,false,false); if(!resultCbo.isSuccess()){ return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs()); } //鎵ц淇濆瓨 BaseResult<Map<String,Object>> result = BaseResult.success(); - com.vci.client.bof.ClientBusinessObject afterCBO = null; + BusinessObject afterCBO = null; try { - BusinessObject resultBO = platformClientUtil.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false); - afterCBO = new com.vci.client.bof.ClientBusinessObject(); - afterCBO.setBusinessObject(resultBO); + BusinessObject resultBO = platformClientUtil.getBOFService().createBusinessObject(resultCbo.getObj(),false,false); + afterCBO = new BusinessObject(); + afterCBO = resultBO; result.setObj(boService.cbo2Map(afterCBO)); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){ - fileObjectService.releasedFile(afterCBO.getBtmName(),afterCBO.getOid(),formDataDTO.getReleaseFileOids()); + fileObjectService.releasedFile(afterCBO.btName,afterCBO.oid,formDataDTO.getReleaseFileOids()); } //鍚庣疆浜嬩欢 String afterEvent = formDataDTO.getPostEvent(); try { - callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{afterCBO}).collect(Collectors.toList()),null, afterEvent, VciChangeDocumentTypeEnum.ADD); + callPostEvent(Arrays.stream(new BusinessObject[]{afterCBO}).collect(Collectors.toList()),null, afterEvent, VciChangeDocumentTypeEnum.ADD); }catch (Throwable e){ //璇存槑鍚庣疆浜嬩欢鍑虹幇浜嗛敊璇紝閭d箞灏遍渶瑕佸垹闄や互鍓嶇殑杩欐潯鏁版嵁 try { - platformClientUtil.getBOFService().deleteBusinessObject(afterCBO.getBusinessObject(),1); + platformClientUtil.getBOFService().deleteBusinessObject(afterCBO,1); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } @@ -1107,7 +1105,7 @@ * @param newVersion 鏂扮増娆� * @return 鎵ц鐨勭粨鏋� */ - private BaseResult<com.vci.client.bof.ClientBusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion){ + private BaseResult<BusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion){ //鎵╁睍灞炴�х殑鍊� Map<String, String> data = formDataDTO.getData(); Map<String,String> dataLow = new HashMap<>(); @@ -1148,7 +1146,7 @@ if(!result.isSuccess()){ return result; } - com.vci.client.bof.ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,newRevision,newVersion); + BusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,newRevision,newVersion); return BaseResult.success(cbo); } @@ -1158,41 +1156,41 @@ * @return 鍩虹瀵硅薄 */ @Override - public BaseModel cbo2BaseModel(com.vci.client.bof.ClientBusinessObject cbo){ + public BaseModel cbo2BaseModel(BusinessObject cbo){ BaseModel baseModel = new BaseModel(); - baseModel.setOid(cbo.getOid()); - baseModel.setNameOid(cbo.getNameoid()); - baseModel.setRevisionOid(cbo.getRevisionid()); - baseModel.setBtmname(cbo.getBtmName()); - baseModel.setLastR(String.valueOf(cbo.getIsLastR())); - baseModel.setLastV(String.valueOf(cbo.getIsLastV())); - baseModel.setFirstR(String.valueOf(cbo.getIsFirstR())); - baseModel.setFirstV(String.valueOf(cbo.getIsFirstV())); - baseModel.setCreator(cbo.getCreator()); + baseModel.setOid(cbo.oid); + baseModel.setNameOid(cbo.nameoid); + baseModel.setRevisionOid(cbo.revisionid); + baseModel.setBtmname(cbo.btName); + baseModel.setLastR(String.valueOf(cbo.isLastR)); + baseModel.setLastV(String.valueOf(cbo.isLastV)); + baseModel.setFirstR(String.valueOf(cbo.isFirstR)); + baseModel.setFirstV(String.valueOf(cbo.isFirstV)); + baseModel.setCreator(cbo.creator); try { - baseModel.setCreateTime(new Date(cbo.getCreateTime())); - baseModel.setLastModifyTime(new Date(cbo.getLastModifyTime())); - baseModel.setTs(new Date(cbo.getTs())); + baseModel.setCreateTime(new Date(cbo.createTime)); + baseModel.setLastModifyTime(new Date(cbo.modifyTime)); + baseModel.setTs(new Date(cbo.ts)); // baseModel.setCheckInTime(VciDateUtil.str2Date(cbo.getCheckinTime(), VciDateUtil.DateTimeFormat)); // baseModel.setCheckOutTime(VciDateUtil.str2Date(cbo.getCheckoutTime(), VciDateUtil.DateTimeFormat)); }catch (Throwable e){ } - baseModel.setLastModifier(cbo.getLastModifier()); - baseModel.setRevisionRule(cbo.getRevisionRule()); - baseModel.setVersionRule(cbo.getVersionRule()); - baseModel.setRevisionSeq(cbo.getRevisionSeq()); - baseModel.setRevisionValue(cbo.getRevisionValue()); - baseModel.setVersionSeq(cbo.getVersionSeq()); - baseModel.setVersionValue(cbo.getVersionValue()); - baseModel.setLcStatus(cbo.getLcStatus()); - baseModel.setId(cbo.getId()); - baseModel.setName(cbo.getName()); - baseModel.setDescription(cbo.getDescription()); - baseModel.setOwner(cbo.getOwner()); + baseModel.setLastModifier(cbo.modifier); + baseModel.setRevisionRule(cbo.revisionRule); + baseModel.setVersionRule(cbo.versionRule); + baseModel.setRevisionSeq(cbo.revisionSeq); + baseModel.setRevisionValue(cbo.revisionValue); + baseModel.setVersionSeq(cbo.versionSeq); + baseModel.setVersionValue(cbo.versionValue); + baseModel.setLcStatus(cbo.lcStatus); + baseModel.setId(cbo.id); + baseModel.setName(cbo.name); + baseModel.setDescription(cbo.description); + baseModel.setOwner(cbo.owner); // baseModel.setCheckInBy(cbo.getCheckinBy()); // baseModel.setCheckOutBy(cbo.getCheckoutBy()); - baseModel.setCopyFromVersion(cbo.getCopyFromVersion()); + baseModel.setCopyFromVersion(cbo.fromVersion); return baseModel; } @@ -1240,7 +1238,7 @@ * @return 鐗堟湰鐨勫璞� */ @Override - public RevisionValueObject getNextRevision(OsBtmTypeVO btmTypeVO, BaseModel baseModel){ + public RevisionDataInfo getNextRevision(OsBtmTypeVO btmTypeVO, BaseModel baseModel){ try { if(baseModel.getRevisionValue() == null){ baseModel.setRevisionValue(""); @@ -1256,10 +1254,10 @@ * @param info corba瀵硅薄 * @return java瀵硅薄 */ - private RevisionValueObject changeRevisionValueInfoToObject(RevisionDataInfo info) { - RevisionValueObject object = new RevisionValueObject(); - object.setRevisionVal(info.revisionVal); - object.setRevisionSeq(info.revisionSeq); + private RevisionDataInfo changeRevisionValueInfoToObject(RevisionDataInfo info) { + RevisionDataInfo object = new RevisionDataInfo(); + object.revisionVal = info.revisionVal; + object.revisionSeq = info.revisionSeq; return object; } @@ -1270,7 +1268,7 @@ * @return 鐗堟湰鐨勫�煎璞� */ @Override - public VersionValueObject getNextVersion(OsBtmTypeVO btmTypeVO, BaseModel baseModel){ + public VersionDataInfo getNextVersion(OsBtmTypeVO btmTypeVO, BaseModel baseModel){ try{ return changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextVersionValue(WebUtil.getTableName(btmTypeVO.getId()),baseModel.getRevisionOid(),baseModel.getNameOid(),WebUtil.getInt(btmTypeVO.getVersionRule()))); }catch (PLException vciError){ @@ -1283,10 +1281,10 @@ * @param info 鐗堟鐨勫�� * @return java瀵硅薄 */ - private VersionValueObject changeRevisionValueInfoToObject(VersionDataInfo info) { - VersionValueObject object = new VersionValueObject(); - object.setVersionVal(info.versionVal); - object.setVersionSeq(info.versionSeq); + private VersionDataInfo changeRevisionValueInfoToObject(VersionDataInfo info) { + VersionDataInfo object = new VersionDataInfo(); + object.versionVal = info.versionVal; + object.versionSeq = info.versionSeq; return object; } /** @@ -1331,25 +1329,25 @@ //灏佽鏁版嵁 List<BusinessObject> addBos = new ArrayList<>(); List<BusinessObject> afterBOs = new ArrayList<>(); - List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>(); + List<BusinessObject> afterCBOs = new ArrayList<>(); Map<String,List<String>> releasedFileOids = new HashMap<>(); for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) { - BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, false, false, false); + BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, false, false, false); if (!resultCbo.isSuccess()) { return BaseResult.fail(resultCbo.getMsg(), resultCbo.getMsgObjs()); } - addBos.add(resultCbo.getObj().getBusinessObject()); + addBos.add(resultCbo.getObj()); //鎵ц淇濆瓨 if (!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())) { - releasedFileOids.put(resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids()); + releasedFileOids.put(resultCbo.getObj().oid,formDataDTO.getReleaseFileOids()); } } try { BusinessObject[] resultBOs = platformClientUtil.getBOFService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false); afterBOs = Arrays.stream(resultBOs).collect(Collectors.toList()); Arrays.stream(resultBOs).forEach(bo->{ - com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); - cbo.setBusinessObject(bo); + BusinessObject cbo = new BusinessObject(); + cbo = bo; afterCBOs.add(cbo); }); } catch (PLException vciError) { @@ -1398,25 +1396,25 @@ return beforeResult; } //灏佽鏁版嵁 - BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,true,false,false); + BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,true,false,false); if(!resultCbo.isSuccess()){ return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs()); } //鎵ц淇濆瓨 BaseResult<Map<String,Object>> result = BaseResult.success(); try { - platformClientUtil.getBOFService().updateBusinessObject(resultCbo.getObj().getBusinessObject()); + platformClientUtil.getBOFService().updateBusinessObject(resultCbo.getObj()); result.setObj(boService.cbo2Map(resultCbo.getObj())); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){ - fileObjectService.releasedFile(resultCbo.getObj().getBtmName(),resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids()); + fileObjectService.releasedFile(resultCbo.getObj().btName,resultCbo.getObj().oid,formDataDTO.getReleaseFileOids()); } //鍚庣疆浜嬩欢 String afterEvent = formDataDTO.getPostEvent(); try { - callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); + callPostEvent(Arrays.stream(new BusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); }catch (Throwable e){ throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); } @@ -1443,27 +1441,27 @@ return beforeResult; } //灏佽鏁版嵁 - BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); + BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); if(!resultCbo.isSuccess()){ return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs()); } //鎵ц淇濆瓨 BaseResult<Map<String,Object>> result = BaseResult.success(); try { - BusinessObject bo = platformClientUtil.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); - com.vci.client.bof.ClientBusinessObject afterCbo = new com.vci.client.bof.ClientBusinessObject(); - afterCbo.setBusinessObject(bo); + BusinessObject bo = platformClientUtil.getBOFService().createBusinessObject(resultCbo.getObj(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); + BusinessObject afterCbo = new BusinessObject(); + afterCbo = bo; result.setObj(boService.cbo2Map(afterCbo)); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){ - fileObjectService.releasedFile(resultCbo.getObj().getBtmName(),resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids()); + fileObjectService.releasedFile(resultCbo.getObj().btName,resultCbo.getObj().oid,formDataDTO.getReleaseFileOids()); } //鍚庣疆浜嬩欢 String afterEvent = formDataDTO.getPostEvent(); try { - callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); + callPostEvent(Arrays.stream(new BusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); }catch (Throwable e){ throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); } @@ -1493,16 +1491,16 @@ //灏佽鏁版嵁 List<BusinessObject> updateCBOS = new ArrayList<>(); Map<String,List<String>> releasedFileOids = new HashMap<>(); - List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>(); + List<BusinessObject> afterCBOs = new ArrayList<>(); for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) { - BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, true, false, false); + BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, true, false, false); if (!resultCbo.isSuccess()) { return BaseResult.fail(resultCbo.getMsg(), resultCbo.getMsgObjs()); } - updateCBOS.add(resultCbo.getObj().getBusinessObject()); + updateCBOS.add(resultCbo.getObj()); //鎵ц淇濆瓨 if (!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())) { - releasedFileOids.put(resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids()); + releasedFileOids.put(resultCbo.getObj().oid,formDataDTO.getReleaseFileOids()); } } try { @@ -1540,7 +1538,7 @@ String btmName = deleteDataDTO.getDataList().get(0).getBtmname(); List<String> oidList = deleteDataDTO.getDataList().stream().map(BaseModelDTO::getOid).collect(Collectors.toList()); //鐪嬬湅绾ц仈鍒犻櫎銆傚彧鏈夎嚜宸卞紩鐢ㄨ嚜宸辩殑鏃跺�欏彲浠ョ骇鑱斿垹闄� - List<com.vci.client.bof.ClientBusinessObject> cbo = null; + List<BusinessObject> cbo = null; if(deleteDataDTO.isCascade()){ //绾ц仈鍒犻櫎 OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); @@ -1559,8 +1557,8 @@ if(CollectionUtils.isEmpty(cbo)){ return BaseResult.fail("娌℃湁鍦ㄧ郴缁熶腑鎵惧埌杩欎簺鏁版嵁锛屾湭鎵ц鍒犻櫎鎿嶄綔"); } - List<com.vci.client.bof.ClientBusinessObject> finalCbo = cbo; - Collection<Collection<String>> oidCollections = WebUtil.switchCollectionForOracleIn(finalCbo.stream().map(com.vci.client.bof.ClientBusinessObject::getOid).collect(Collectors.toList())); + List<BusinessObject> finalCbo = cbo; + Collection<Collection<String>> oidCollections = WebUtil.switchCollectionForOracleIn(finalCbo.stream().map(bo -> bo.oid).collect(Collectors.toList())); List<OsUsedAttributeVO> usedAttributeVOS = null; boolean adminCascade = false; if("admin".equalsIgnoreCase(VciBaseUtil.getCurrentUserId()) && deleteDataDTO.isAdminCascade()){ @@ -1595,7 +1593,7 @@ Map<String,String> conditionMap = new HashMap<>(); conditionMap.put(usedAttributeVO.getId(),QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")"); if(StringUtils.isNotBlank(usedAttributeVO.getPkBtmType())) { - List<com.vci.client.bof.ClientBusinessObject> tempCbos = boService.queryCBO(usedAttributeVO.getPkBtmType(), conditionMap); + List<BusinessObject> tempCbos = boService.queryCBO(usedAttributeVO.getPkBtmType(), conditionMap); if(!CollectionUtils.isEmpty(tempCbos)){ finalCbo.addAll(tempCbos); } @@ -1608,12 +1606,11 @@ } VciBaseUtil.switchCollectionForOracleIn(finalCbo).stream().forEach(cbos->{ try { - platformClientUtil.getBOFService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new BusinessObject[0]),1); + platformClientUtil.getBOFService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),1); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } }); - System.out.println("zheshi shazi "); return BaseResult.success(); } @@ -1649,7 +1646,7 @@ //璇存槑鍓嶇疆浜嬩欢娌℃湁鎵ц鎴愬姛 return beforeResult; } - com.vci.client.bof.ClientLinkObject clo = null; + LinkObject clo = null; String prefix = ""; if(formLinkDataDTO.isDirection()){ prefix = LO_FROM_PREFIX; @@ -1677,9 +1674,9 @@ } //鏌ヨfrom绔殑 - com.vci.client.bof.ClientBusinessObject fromCbo = new com.vci.client.bof.ClientBusinessObject(); + BusinessObject fromCbo = new BusinessObject(); try { - fromCbo.setBusinessObject(platformClientUtil.getBOFService().readBusinessObject(fromOid,fromBtmName)); + fromCbo = platformClientUtil.getBOFService().readBusinessObject(fromOid,fromBtmName); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } @@ -1692,52 +1689,45 @@ } }); //灏佽to绔殑 - BaseResult<com.vci.client.bof.ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO,formDefineVO,toOid,toBtmName,boData); + BaseResult<BusinessObject> result = wrapperToCbo(formLinkDataDTO,formDefineVO,toOid,toBtmName,boData); if(!result.isSuccess()){ return BaseResult.fail(result.getMsg(),result.getMsgObjs()); } - com.vci.client.bof.ClientBusinessObject toCbo = result.getObj(); + BusinessObject toCbo = result.getObj(); //鍒濆鍖栭摼鎺ョ被鍨嬬殑鍊� - BaseResult<com.vci.client.bof.ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, false); + BaseResult<LinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, false); if(!resultClo.isSuccess()){ return BaseResult.fail(resultClo.getMsg(),resultClo.getMsgObjs()); } clo = resultClo.getObj(); - if(formLinkDataDTO.isDirection()){ - clo.setFromBO(toCbo); - clo.setToBO(fromCbo); - } else { - clo.setFromBO(fromCbo); - clo.setToBO(toCbo); - } //鎵ц淇濆瓨 BusinessObject[] bos = new BusinessObject[1]; - toCbo.dealBusinessObjectNullValue(); - clo.dealLinkObjectNullValue(); - bos[0] = toCbo.getBusinessObject(); + ObjectTool.dealBusinessObjectNullValue(toCbo); + ObjectTool.dealLinkObjectNullValue(clo); + bos[0] = toCbo; try { - platformClientUtil.getBOFService().createBusinessObjectWithLink(bos,clo.getLinkObject()); + platformClientUtil.getBOFService().createBusinessObjectWithLink(bos,clo); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){ - fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.getOid(),formLinkDataDTO.getReleaseFileOids()); + fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.oid,formLinkDataDTO.getReleaseFileOids()); } //鍚庣疆浜嬩欢 String afterEvent = formLinkDataDTO.getPostEvent(); try { - callPostEvent(null,Arrays.stream(new com.vci.client.bof.ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); + callPostEvent(null,Arrays.stream(new LinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); }catch (Throwable e){ //璇存槑鍚庣疆浜嬩欢鍑虹幇浜嗛敊璇紝閭d箞灏遍渶瑕佸垹闄や互鍓嶇殑杩欐潯鏁版嵁 try { - platformClientUtil.getBOFService().deleteBusinessObject(toCbo.getBusinessObject(),1); - platformClientUtil.getBOFService().deleteLinkObject(clo.getLinkObject()); + platformClientUtil.getBOFService().deleteBusinessObject(toCbo,1); + platformClientUtil.getBOFService().deleteLinkObject(clo); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); } - return BaseResult.success(clo.getOid()); + return BaseResult.success(clo.oid); } /** @@ -1748,7 +1738,7 @@ * @param editFlag 鏄惁涓虹紪杈� * @return 閾炬帴绫诲瀷鐨勫唴瀹� */ - private BaseResult<com.vci.client.bof.ClientLinkObject> wrapperOnlyCLO(FormLinkDataDTO formLinkDataDTO,Map<String,String> loData,UIFormDefineVO formDefineVO,boolean editFlag){ + private BaseResult<LinkObject> wrapperOnlyCLO(FormLinkDataDTO formLinkDataDTO,Map<String,String> loData,UIFormDefineVO formDefineVO,boolean editFlag){ Map<String,String> baseDataMap = formLinkDataDTO2MapLow(formLinkDataDTO); Map<String,String> allDataMap = new HashMap<>(); allDataMap.putAll(loData); @@ -1764,32 +1754,33 @@ return result; } //澶勭悊涓氬姟绫诲瀷寰楀埌鏁版嵁 - ClientLinkObject clo ; + LinkObject clo ; if(editFlag){ try { LinkObject linkObject = platformClientUtil.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType()); - clo = new ClientLinkObject(); - clo.setLinkObject(linkObject); + clo = new LinkObject(); + clo = linkObject; } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } }else{ - clo = new ClientLinkObject(); + clo = new LinkObject(); //澶勭悊鍒濆鍖栫殑鏁版嵁 - clo.setOid(VciBaseUtil.getPk()); - clo.setCreator(VciBaseUtil.getCurrentUserId()); - clo.setCreateTime(System.currentTimeMillis()); - clo.setTs(System.currentTimeMillis()); - clo.setLoName(formLinkDataDTO.getLinkType()); + clo.oid = VciBaseUtil.getPk(); + clo.creator = VciBaseUtil.getCurrentUserId(); + clo.createTime = System.currentTimeMillis(); + clo.ts = System.currentTimeMillis(); + clo.ltName = formLinkDataDTO.getLinkType(); } // - allDataMap.forEach((key,value)->{ + LinkObject finalClo = clo; + allDataMap.forEach((key, value)->{ if(editFlag&&("lastmodifier".equalsIgnoreCase(key) || "lastmodifytime".equalsIgnoreCase(key) || "ts".equalsIgnoreCase(key) || "creator".equalsIgnoreCase(key) || "createtime".equalsIgnoreCase(key))){ //骞冲彴涓嶈兘浼犻�掕繖涓� }else{ - loService.setAttribute(clo,key,value); + loService.setAttribute(finalClo,key,value); } }); return BaseResult.success(clo); @@ -1805,7 +1796,7 @@ * @param boData to鐨勬暟鎹� * @return 鍖呭惈鐨勫璞� */ - private BaseResult<com.vci.client.bof.ClientBusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData){ + private BaseResult<BusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData){ Map<String,String> dataLow = new HashMap<>(); boData.forEach((key,value)->{ dataLow.put(key.toLowerCase(),value); @@ -1832,7 +1823,7 @@ if(!result.isSuccess()){ return result; } - com.vci.client.bof.ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,formLinkDataDTO.isToUpRevision(),formLinkDataDTO.isToUpVersion()); + BusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,formLinkDataDTO.isToUpRevision(),formLinkDataDTO.isToUpVersion()); return BaseResult.success(cbo); } @@ -1925,41 +1916,41 @@ * @param newVersion 鏄惁鍗囩増娆� * @return cbo瀵硅薄 */ - public com.vci.client.bof.ClientBusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion){ + public BusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion){ String btmName = baseDataMap.get("btmname"); String oid = baseDataMap.get("oid"); -// ClientBusinessObject cbo = new ClientBusinessObject(); - ClientBusinessObject cbo = new ClientBusinessObject(); +// BusinessObject cbo = new BusinessObject(); + BusinessObject cbo = new BusinessObject(); String copyfromversion = baseDataMap.get("copyfromversion"); OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); List<String> attributeList = btmTypeVO.getAttributes().stream().map(attribute -> attribute.getId()).collect(Collectors.toList()); if(editFlag || newRevision || newVersion){ try { - cbo.setBusinessObject(platformClientUtil.getBOFService().readBusinessObject(editFlag?oid:copyfromversion,btmName)); + cbo = platformClientUtil.getBOFService().readBusinessObject(editFlag?oid:copyfromversion,btmName); } catch (PLException vciError) { throw new VciBaseException("浣跨敤涓婚敭鍦ㄧ郴缁熶腑娌℃湁鏌ヨ鍒版暟鎹�",new String[]{oid},vciError); } if(btmTypeVO.isRevisionFlag() && newRevision){ - cbo.setOid(VciBaseUtil.getPk()); - cbo.setCopyFromVersion(copyfromversion); + cbo.oid = VciBaseUtil.getPk(); + cbo.fromVersion = copyfromversion; if(btmTypeVO.isInputRevisionFlag() && StringUtils.isNotBlank(baseDataMap.getOrDefault("revisionvalue",""))){ //鎵嬪姩鐨勶紝鎵�浠ヤ笉澶勭悊鐗堟湰瑙勫垯浜� - cbo.setRevisionValue(baseDataMap.get("revisionvalue")); + cbo.revisionValue = baseDataMap.get("revisionvalue"); }else{ //璇存槑鏄崌鐗� BaseModel baseModel = cbo2BaseModel(cbo); - RevisionValueObject revisionValueObject = getNextRevision(btmTypeVO,baseModel); - cbo.setRevisionid(VciBaseUtil.getPk()); - cbo.setRevisionSeq((short) revisionValueObject.getRevisionSeq()); - cbo.setRevisionValue(revisionValueObject.getRevisionVal()); - cbo.setIsLastR(true); - cbo.setIsFirstR(false); + RevisionDataInfo revisionValueObject = getNextRevision(btmTypeVO,baseModel); + cbo.revisionid = VciBaseUtil.getPk(); + cbo.revisionSeq = revisionValueObject.revisionSeq; + cbo.revisionValue = revisionValueObject.revisionVal; + cbo.isLastR = true; + cbo.isFirstR = false; //澶勭悊鐗堟 - cbo.setVersionValue(getFirstVersion(btmTypeVO.getVersionRule())); - cbo.setVersionRule(btmTypeVO.getVersionRule()); - cbo.setVersionSeq((short) 0); - cbo.setIsLastV(true); - cbo.setIsFirstV(true); + cbo.versionValue = getFirstVersion(btmTypeVO.getVersionRule()); + cbo.versionRule = btmTypeVO.getVersionRule(); + cbo.versionSeq = (short) 0; + cbo.isLastV = true; + cbo.isFirstV = true; } //鍗囩増鐨勬椂鍊欙紝鐢熷懡鍛ㄦ湡鐨勭姸鎬侀渶瑕佹敼鍔ㄥ埌榛樿鐘舵�� if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){ @@ -1973,19 +1964,19 @@ if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){ throw new VciBaseException("{0}閲岀殑鐢熷懡鍛ㄦ湡璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐢熷懡鍛ㄦ湡",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()}); } - cbo.setLcStatus(lifeCycleVO.startState); + cbo.lcStatus = lifeCycleVO.startState; } } if(btmTypeVO.isRevisionFlag() && newVersion){ - cbo.setCopyFromVersion(copyfromversion); - cbo.setOid(VciBaseUtil.getPk()); + cbo.fromVersion = copyfromversion; + cbo.oid = VciBaseUtil.getPk(); //杩欐槸鍗囩増娆★紝涓嶅瓨鍦ㄥ嵆鍗囩増鏈紝鍙堝崌鐗堟鐨勬儏鍐� BaseModel baseModel = cbo2BaseModel(cbo); - VersionValueObject versionValueObject = getNextVersion(btmTypeVO,baseModel); - cbo.setVersionValue(versionValueObject.getVersionVal()); - cbo.setVersionSeq((short) versionValueObject.getVersionSeq()); - cbo.setIsLastV(true); - cbo.setIsFirstV(false); + VersionDataInfo versionValueObject = getNextVersion(btmTypeVO,baseModel); + cbo.versionValue = versionValueObject.versionVal; + cbo.versionSeq = versionValueObject.versionSeq; + cbo.isLastV = true; + cbo.isFirstV = false; //鍗囩増鐨勬椂鍊欙紝鐢熷懡鍛ㄦ湡鐨勭姸鎬侀渶瑕佹敼鍔ㄥ埌榛樿鐘舵�� if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){ //鏌ヨ鐢熷懡鍛ㄦ湡 @@ -1998,65 +1989,65 @@ if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){ throw new VciBaseException("{0}閲岀殑鐢熷懡鍛ㄦ湡璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐢熷懡鍛ㄦ湡",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()}); } - cbo.setLcStatus(lifeCycleVO.startState); + cbo.lcStatus = lifeCycleVO.startState; } } }else{ //鎴戜滑闇�瑕佸皢灞炴�у垵濮嬪寲 - if(StringUtils.isBlank(cbo.getOid()) || (newRevision || newVersion)){ - cbo.setOid(VciBaseUtil.getPk()); + if(StringUtils.isBlank(cbo.oid) || (newRevision || newVersion)){ + cbo.oid = VciBaseUtil.getPk(); } - if(StringUtils.isBlank(cbo.getCreator())){ - cbo.setCreator(VciBaseUtil.getCurrentUserId()); + if(StringUtils.isBlank(cbo.creator)){ + cbo.creator = VciBaseUtil.getCurrentUserId(); } - if(cbo.getCreateTime() != 0){ - cbo.setCreateTime(System.currentTimeMillis()); + if(cbo.createTime != 0){ + cbo.createTime = System.currentTimeMillis(); } - if(StringUtils.isBlank(cbo.getOwner())){ - cbo.setOwner(cbo.getCreator()); + if(StringUtils.isBlank(cbo.owner)){ + cbo.owner = cbo.creator; } - cbo.setTs(System.currentTimeMillis()); - if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId()) && (StringUtils.isBlank(cbo.getLcStatus()) || newRevision || newVersion)){ + cbo.ts = System.currentTimeMillis(); + if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId()) && (StringUtils.isBlank(cbo.lcStatus) || newRevision || newVersion)){ //鏌ヨ鐢熷懡鍛ㄦ湡 OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId()); if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.getOid())){ throw new VciBaseException("{0}閲岀殑鐢熷懡鍛ㄦ湡璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐢熷懡鍛ㄦ湡",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()}); } - cbo.setLcStatus(lifeCycleVO.getStartStatus()); - cbo.setLctId(btmTypeVO.getLifeCycleId()); + cbo.lcStatus = lifeCycleVO.getStartStatus(); + cbo.lctId = btmTypeVO.getLifeCycleId(); } - if(StringUtils.isBlank(cbo.getBtmName())){ - cbo.setBtmName(btmTypeVO.getId()); + if(StringUtils.isBlank(cbo.btName)){ + cbo.btName = btmTypeVO.getId(); } if(btmTypeVO.isRevisionFlag()){ //瑕佺鐞嗙増鏈� if(btmTypeVO.isInputRevisionFlag() && StringUtils.isNotBlank(baseDataMap.getOrDefault("revisionvalue",""))){ //鎵嬪姩鐨勶紝鎵�浠ヤ笉澶勭悊鐗堟湰瑙勫垯浜� - cbo.setRevisionValue(baseDataMap.get("revisionvalue")); + cbo.revisionValue = baseDataMap.get("revisionvalue"); }else { OsRevisionRuleVO ruleVO = revisionRuleServiceI.getRevisionRuleById(btmTypeVO.getRevisionRuleId()); if (ruleVO == null || StringUtils.isBlank(ruleVO.getOid())) { throw new VciBaseException("{0}閲岀殑鐗堟湰瑙勫垯璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐗堟湰瑙勫垯", new String[]{btmTypeVO.getName(), btmTypeVO.getRevisionRuleId()}); } - cbo.setRevisionValue(ruleVO.getStartCode()); + cbo.revisionValue = ruleVO.getStartCode(); } - if (StringUtils.isBlank(cbo.getNameoid())) { - cbo.setNameoid(VciBaseUtil.getPk()); + if (StringUtils.isBlank(cbo.nameoid)) { + cbo.nameoid = VciBaseUtil.getPk(); } - if (StringUtils.isBlank(cbo.getRevisionid())) { - cbo.setRevisionid(VciBaseUtil.getPk()); + if (StringUtils.isBlank(cbo.revisionid)) { + cbo.revisionid = VciBaseUtil.getPk(); } - cbo.setIsFirstR(true); - cbo.setIsLastR(true); - cbo.setRevisionRule(btmTypeVO.getRevisionRuleId()); - cbo.setRevisionSeq((short) 0); + cbo.isFirstR = true; + cbo.isLastR = true; + cbo.revisionRule = btmTypeVO.getRevisionRuleId(); + cbo.revisionSeq = (short) 0; //鐪嬬湅鏄惁闇�瑕佸鐞嗙増娆� - cbo.setVersionValue(getFirstVersion(btmTypeVO.getVersionRule())); - cbo.setVersionRule(btmTypeVO.getVersionRule()); - cbo.setVersionSeq((short) 0); - cbo.setIsLastV(true); - cbo.setIsFirstV(true); + cbo.versionValue = getFirstVersion(btmTypeVO.getVersionRule()); + cbo.versionRule = btmTypeVO.getVersionRule(); + cbo.versionSeq = (short) 0; + cbo.isLastV = true; + cbo.isFirstV = true; } } // Iterator<Map.Entry<String, String>> iterator = baseDataMap.entrySet().iterator(); @@ -2098,18 +2089,12 @@ * @param editFlag 鏄惁涓虹紪杈� */ @Override - public void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, com.vci.client.bof.ClientBusinessObject cbo, boolean editFlag){ + public void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, BusinessObject cbo, boolean editFlag){ dataLow.forEach((key,value)->{ if(editFlag&¬SendOnEdit(key)){ //骞冲彴涓嶈兘浼犻�掕繖涓� }else{ - try { -// if(!SystemAttribute.bosysAttList().contains(key)){ - cbo.setAttributeValueWithNoCheck(key, value, !editFlag); -// } - } catch (PLException vciError) { - throw new VciBaseException("{0}鐨勫�间笉绗﹀悎瑕佹眰锛屽綋鍓嶆槸{1}", new String[]{key, value}, vciError); - } + ObjectTool.setBOAttributeValue(cbo,key,value); } }); baseDataLow.forEach((key,value)->{ @@ -2118,23 +2103,11 @@ }else{ if(editFlag) { //缂栬緫鐨勬椂鍊欏彲浠ラ兘璁剧疆 - try { -// if(!SystemAttribute.bosysAttList().contains(key)){ - cbo.setAttributeValueWithNoCheck(key, value, !editFlag); -// } - } catch (PLException vciError) { - throw new VciBaseException("{0}鐨勫�间笉绗﹀悎瑕佹眰锛屽綋鍓嶆槸{1}", new String[]{key, value}, vciError); - } + ObjectTool.setBOAttributeValue(cbo,key,value); }else{ //鍙渶瑕佸鐞唅d,name,description锛屽瘑绾у嵆鍙紝鍏朵綑鐨勯兘宸茬粡琚缃簡 if(basicFields.contains(key) &&StringUtils.isNotBlank(value)){ - try { -// if(!SystemAttribute.bosysAttList().contains(key)){ - cbo.setAttributeValueWithNoCheck(key, value, true); -// } - } catch (PLException vciError) { - throw new VciBaseException("{0}鐨勫�间笉绗﹀悎瑕佹眰锛屽綋鍓嶆槸{1}", new String[]{key, value}, vciError); - } + ObjectTool.setBOAttributeValue(cbo,key,value); } } } @@ -2170,7 +2143,7 @@ //璇存槑鍓嶇疆浜嬩欢娌℃湁鎵ц鎴愬姛 return beforeResult; } - com.vci.client.bof.ClientLinkObject clo = null; + LinkObject clo = null; String prefix = formLinkDataDTO.isDirection()?LO_FROM_PREFIX:LO_TO_PREFIX; String toOid = formLinkDataDTO.isDirection()?formLinkDataDTO.getFoid():formLinkDataDTO.getToid(); String toBtmName = formLinkDataDTO.isDirection()?formLinkDataDTO.getFbtmname():formLinkDataDTO.getTbtmname(); @@ -2188,10 +2161,10 @@ } }); } - com.vci.client.bof.ClientBusinessObject toCbo =null; + BusinessObject toCbo =null; if(!CollectionUtils.isEmpty(boData)) { //灏佽to绔殑 - BaseResult<com.vci.client.bof.ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO, formDefineVO, toOid, toBtmName, boData); + BaseResult<BusinessObject> result = wrapperToCbo(formLinkDataDTO, formDefineVO, toOid, toBtmName, boData); if (!result.isSuccess()) { return BaseResult.fail(result.getMsg(), result.getMsgObjs()); } @@ -2199,41 +2172,34 @@ } //鍒濆鍖栭摼鎺ョ被鍨嬬殑鍊� - BaseResult<com.vci.client.bof.ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, true); + BaseResult<LinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, true); if(!resultClo.isSuccess()){ return BaseResult.fail(resultClo.getMsg(),resultClo.getMsgObjs()); } clo = resultClo.getObj(); - if(toCbo!=null) { - if (formLinkDataDTO.isDirection()) { - clo.setFromBO(toCbo); - } else { - clo.setToBO(toCbo); - } - } try { - platformClientUtil.getBOFService().updateLinkObject(clo.getLinkObject()); + platformClientUtil.getBOFService().updateLinkObject(clo); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } //淇濆瓨to绔垨鑰協rom绔� try{ - platformClientUtil.getBOFactoryService().updateBusinessObject(toCbo.getBusinessObject()); + platformClientUtil.getBOFactoryService().updateBusinessObject(toCbo); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){ - fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.getOid(),formLinkDataDTO.getReleaseFileOids()); + fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.oid,formLinkDataDTO.getReleaseFileOids()); } //鍚庣疆浜嬩欢 String afterEvent = formLinkDataDTO.getPostEvent(); try { - callPostEvent(null,Arrays.stream(new com.vci.client.bof.ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); + callPostEvent(null,Arrays.stream(new LinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); }catch (Throwable e){ //鍚庣疆浜嬩欢鏈夐棶棰樹簡灏卞彧鑳芥槸杩欐牱浜嗭紝娌″姙娉曟仮澶� throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); } - return BaseResult.success(clo.getOid()); + return BaseResult.success(clo.oid); } /** @@ -2249,31 +2215,31 @@ if(deleteLinkDataDTO.getDataList().stream().anyMatch(s->StringUtils.isBlank(s.getOid()) || StringUtils.isBlank(s.getLinkType()))){ throw new VciBaseException("鏈夋暟鎹殑涓婚敭(鎴栭摼鎺ョ被鍨嬶級娌℃湁鍊硷紝鏃犳硶鍒犻櫎"); } - List<ClientLinkObject> clos = new ArrayList<>(); + List<LinkObject> clos = new ArrayList<>(); VciBaseUtil.switchListForOracleIn(deleteLinkDataDTO.getDataList()).stream().forEach(linkModelDTOs->{ Map<String,String> conditionMap = new HashMap<>(); conditionMap.put("oid",QueryOptionConstant.IN +"(" + VciBaseUtil.toInSql(linkModelDTOs.stream().map(BaseLinkModelDTO::getOid).toArray(String[]::new)) +")"); - List<ClientLinkObject> clientLinkObjects = loService.queryCLO(linkModelDTOs.get(0).getLinkType(), conditionMap); - if(!CollectionUtils.isEmpty(clientLinkObjects)){ - clos.addAll(clientLinkObjects); + List<LinkObject> LinkObjects = loService.queryCLO(linkModelDTOs.get(0).getLinkType(), conditionMap); + if(!CollectionUtils.isEmpty(LinkObjects)){ + clos.addAll(LinkObjects); } }); if(CollectionUtils.isEmpty(clos)){ throw new VciBaseException("浣跨敤涓婚敭娌℃湁鍦ㄧ郴缁熶腑鎵惧埌閾炬帴绫诲瀷鐨勬暟鎹�"); } - Map<String,List<ClientLinkObject>> fromBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.getFromBTMName())); - Map<String,List<ClientLinkObject>> toBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.getToBTMName())); - Map<String,List<com.vci.client.bof.ClientBusinessObject>> fromBtmDataGroups = new HashMap<>(); - Map<String,List<com.vci.client.bof.ClientBusinessObject>> toBtmDataGroups = new HashMap<>(); + Map<String,List<LinkObject>> fromBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.fromBTName)); + Map<String,List<LinkObject>> toBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.toBTName)); + Map<String,List<BusinessObject>> fromBtmDataGroups = new HashMap<>(); + Map<String,List<BusinessObject>> toBtmDataGroups = new HashMap<>(); if(!CollectionUtils.isEmpty(fromBtmGroups)){ fromBtmGroups.forEach((btmType,cloList)->{ - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getFromOid).collect(Collectors.toList()), btmType); + List<BusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(clo -> clo.fromOid).collect(Collectors.toList()), btmType); fromBtmDataGroups.put(btmType,cbos); }); } if(!CollectionUtils.isEmpty(toBtmGroups)){ toBtmGroups.forEach((btmType,cloList)->{ - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getToOid).collect(Collectors.toList()), btmType); + List<BusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(clo -> clo.toOid).collect(Collectors.toList()), btmType); toBtmDataGroups.put(btmType,cbos); }); } @@ -2288,19 +2254,19 @@ if(attr.toLowerCase().startsWith(LO_FROM_PREFIX)){ fromBtmDataGroups.forEach((btm,cbos)->{ String attrNotPrefix = attr.substring(LO_FROM_PREFIX.length()); - if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(s.getAttributeValue(attrNotPrefix)))){ + if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(ObjectTool.getBOAttributeValue(s, attrNotPrefix)))){ throw new VciBaseException("鏁版嵁鐨勫唴瀹逛笉鍏佽鍒犻櫎,{0}", new String[]{deleteLinkDataDTO.getCheckNotDeleteMsg()}); } }); }else if(attr.toLowerCase().startsWith(LO_TO_PREFIX)){ toBtmDataGroups.forEach((btm,cbos)->{ String attrNotPrefix = attr.substring(LO_TO_PREFIX.length()); - if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(s.getAttributeValue(attrNotPrefix)))){ + if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(ObjectTool.getBOAttributeValue(s, attrNotPrefix)))){ throw new VciBaseException("鏁版嵁鐨勫唴瀹逛笉鍏佽鍒犻櫎,{0}", new String[]{deleteLinkDataDTO.getCheckNotDeleteMsg()}); } }); }else { - if (clos.stream().anyMatch(s -> attrValue.equalsIgnoreCase(s.getAttributeValue(attr)))) { + if (clos.stream().anyMatch(s -> attrValue.equalsIgnoreCase(ObjectTool.getLOAttributeValue(s,attr)))) { throw new VciBaseException("鏁版嵁鐨勫唴瀹逛笉鍏佽鍒犻櫎,{0}", new String[]{deleteLinkDataDTO.getCheckNotDeleteMsg()}); } } @@ -2309,7 +2275,7 @@ //閾炬帴绫诲瀷鏈韩涓�鑸笉浼氭湁鍏宠仈 List<LinkObject> los = new ArrayList<>(); clos.stream().forEach(clo->{ - los.add(clo.getLinkObject()); + los.add(clo); }); try { platformClientUtil.getBOFactoryService().batchDeleteLinkObject(los.toArray(new LinkObject[0])); @@ -2319,7 +2285,7 @@ if(deleteLinkDataDTO.isDeleteFromData()){ fromBtmDataGroups.forEach((btm,cbos)->{ try{ - platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1); + platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),1); }catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } @@ -2328,7 +2294,7 @@ if(deleteLinkDataDTO.isDeleteToData()){ toBtmDataGroups.forEach((btm,cbos)->{ try{ - platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1); + platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),1); }catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } @@ -2402,7 +2368,7 @@ referConfigVO.setConditionMap(new HashMap<>()); } - List<com.vci.client.bof.ClientBusinessObject> cbos = null; + List<BusinessObject> cbos = null; String oidFieldName = StringUtils.isNotBlank(referConfigVO.getParentUsedField())?referConfigVO.getParentUsedField():referConfigVO.getValueField(); if(referConfigVO.isSelectAllLevel()) { String parentOidSql = ""; @@ -2477,7 +2443,7 @@ @Override public List<Map<String,String>> getDataAttr(String btmname, String oid) { VciBaseUtil.alertNotNull(btmname,"涓氬姟绫诲瀷鐨勪俊鎭�",oid,"涓氬姟鏁版嵁鐨勪富閿�"); - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid)); + List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid)); List<Map<String,String>> dataMap = new ArrayList<>(); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebActionServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebActionServiceImpl.java index 9353bdf..5732df5 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebActionServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebActionServiceImpl.java @@ -1,13 +1,15 @@ package com.vci.web.service.impl; -import com.vci.client.portal.utility.UITools; +//import com.vci.client.portal.utility.UITools; import com.vci.corba.common.PLException; import com.vci.corba.portal.data.PLAction; import com.vci.starter.web.exception.VciBaseException; import com.vci.web.pageModel.UIActionVO; import com.vci.web.service.WebActionServiceI; +import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** @@ -18,6 +20,11 @@ @Service public class WebActionServiceImpl implements WebActionServiceI { + /** + * 骞冲彴鐨勮皟鐢ㄥ伐鍏风被 + */ + @Autowired + private PlatformClientUtil platformClientUtil; /** * action瀵硅薄 @@ -29,7 +36,7 @@ public UIActionVO getActionByOid(String oid) throws VciBaseException { WebUtil.alertNotNull(oid,"action鐨勪富閿�"); try { - PLAction action = UITools.getService() + PLAction action = platformClientUtil.getUIService() .getPLActionById(oid); if(action == null || StringUtils.isBlank(action.plOId)){ throw new VciBaseException("杩欎釜action鍦ㄧ郴缁熶腑涓嶅瓨鍦�"); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java index a2c2054..611d40d 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java @@ -1,8 +1,7 @@ package com.vci.web.service.impl; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientLinkObject; import com.vci.client.common.oq.OQTool; +import com.vci.client.common.providers.ClientServiceProvider; import com.vci.common.qt.object.*; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.PLException; @@ -15,6 +14,7 @@ import com.vci.corba.query.data.BtmRefQueryOption; import com.vci.corba.query.data.KV; import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.annotation.Column; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.enumpck.BooleanEnum; @@ -123,7 +123,7 @@ /** * 宸茬粡鍒涘缓杩囩殑涓氬姟瀵硅薄 */ - private static Map<String, ClientBusinessObject> hasCreatedCbos = new HashMap<String, ClientBusinessObject>(); + private static Map<String, BusinessObject> hasCreatedCbos = new HashMap<String, BusinessObject>(); /** * 涓氬姟瀵硅薄榛樿灞炴�� @@ -149,7 +149,7 @@ * @throws VciBaseException 鍒濆鍖栧嚭閿欑殑鏄細鎶涘嚭寮傚父 */ @Override - public ClientBusinessObject createCBOByBtmName(String btmName) + public BusinessObject createCBOByBtmName(String btmName) throws VciBaseException { if(btmName!=null){ btmName = btmName.trim().toLowerCase(); @@ -162,13 +162,14 @@ throw new VciBaseException(msgCodePrefix +"noHasUserid"); } try { +// ClientServiceProvider.getBOFService().initBusinessObject(btmName); 鍙互杩涜鏇挎崲 hasCreatedCbos.put(btmName, createBusinessObject(btmName)); } catch (Exception e) { logger.error("鍒涘缓涓氬姟绫诲瀷瀵硅薄",e); throw new VciBaseException(msgCodePrefix + "initBoError",new String[]{btmName}); } } - ClientBusinessObject cbo = cloneClientBusinessObject(hasCreatedCbos.get(btmName)); + BusinessObject cbo = cloneBusinessObject(hasCreatedCbos.get(btmName)); return cbo; } @@ -177,44 +178,45 @@ * @param boName 涓氬姟绫诲瀷鍚嶇О * @return 涓氬姟鏁版嵁瀵硅薄 */ - public ClientBusinessObject createBusinessObject(String boName) { + public BusinessObject createBusinessObject(String boName) throws PLException { +// ClientServiceProvider.getBOFService().initBusinessObject(boName); OsBtmTypeVO btmTypeVO = btmService.getBtmById(boName); String userName = WebUtil.getCurrentUserId(); - ClientBusinessObject bo = new ClientBusinessObject(); - bo.setOid((new ObjectUtility()).getNewObjectID36()); - bo.setRevisionid((new ObjectUtility()).getNewObjectID36()); - bo.setNameoid((new ObjectUtility()).getNewObjectID36()); - bo.setBtmName(boName); - bo.setIsLastR(true); - bo.setIsFirstR(true); - bo.setIsFirstV(true); - bo.setIsLastV(true); - bo.setCreator(userName); - bo.setCreateTime(System.currentTimeMillis()); - bo.setLastModifier(userName); - bo.setLastModifyTime(System.currentTimeMillis()); - bo.setRevisionRule(btmTypeVO.getRevisionRuleId()); - bo.setVersionRule(String.valueOf(btmTypeVO.getVersionRule())); + BusinessObject bo = new BusinessObject(); + bo.oid = (new ObjectUtility()).getNewObjectID36(); + bo.revisionid = (new ObjectUtility()).getNewObjectID36(); + bo.nameoid = (new ObjectUtility()).getNewObjectID36(); + bo.btName = boName; + bo.isLastR = true; + bo.isFirstR = true; + bo.isFirstV = true; + bo.isLastV = true; + bo.creator = userName; + bo.createTime = System.currentTimeMillis(); + bo.modifier = userName; + bo.modifyTime = System.currentTimeMillis(); + bo.revisionRule = btmTypeVO.getRevisionRuleId(); + bo.versionRule = String.valueOf(btmTypeVO.getVersionRule()); if(StringUtils.isNotBlank(btmTypeVO.getRevisionRuleId())){ OsRevisionRuleVO revisionRuleVO = revisionRuleService.getRevisionRuleById(btmTypeVO.getRevisionRuleId()); - bo.setRevisionValue(revisionRuleVO.getStartCode()); + bo.revisionValue = revisionRuleVO.getStartCode(); } - bo.setRevisionSeq((short) 1); - bo.setVersionSeq((short) 1); - bo.setVersionValue(getVersionValue(WebUtil.getInt(btmTypeVO.getVersionRule()))); - bo.setLctId(btmTypeVO.getLifeCycleId()); + bo.revisionSeq = (short) 1; + bo.versionSeq = (short) 1; + bo.versionValue = getVersionValue(WebUtil.getInt(btmTypeVO.getVersionRule())); + bo.lctId = btmTypeVO.getLifeCycleId(); if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){ OsLifeCycleVO lifeCycleVO = lifeService.getLifeCycleById(btmTypeVO.getLifeCycleId()); //todo 鏃犳硶鑾峰彇鏁版嵁 - // bo.setLcStatus(lifeCycleVO.getStartStatus()); + bo.lcStatus = lifeCycleVO == null ? "" : lifeCycleVO.getStartStatus(); } - bo.setId(""); - bo.setName(""); - bo.setDescription(""); - bo.setOwner(userName); + bo.id = ""; + bo.name = ""; + bo.description = ""; + bo.owner = userName; // bo.setCheckinBy(userName); - bo.setCopyFromVersion(""); + bo.fromVersion = ""; this.initTypeAttributeValue(bo,btmTypeVO); return bo; } @@ -224,15 +226,9 @@ * @param cbo 涓氬姟鏁版嵁瀵硅薄 * @param btmTypeVO 涓氬姟绫诲瀷鐨勬樉绀哄璞� */ - private void initTypeAttributeValue(ClientBusinessObject cbo,OsBtmTypeVO btmTypeVO) { + private void initTypeAttributeValue(BusinessObject cbo,OsBtmTypeVO btmTypeVO) { Optional.ofNullable(btmTypeVO.getAttributes()).orElseGet(()->new ArrayList<>()).stream().forEach(attribute->{ - try { - cbo.setAttributeValueWithNoCheck(attribute.getId(),attribute.getDefaultValue()); - } catch (PLException vciError) { - if(logger.isErrorEnabled()){ - logger.error("璁剧疆灞炴�х殑鍊肩殑鏃跺�欏嚭鐜颁簡閿欒",vciError); - } - } + ObjectTool.setBOAttributeValue(cbo,attribute.getId(),attribute.getDefaultValue()); }); } @@ -257,49 +253,42 @@ * @param cbo 浠ュ墠鐨勪笟鍔℃暟鎹璞� * @return 鎷疯礉鍚庣殑瀵硅薄 */ - private ClientBusinessObject cloneClientBusinessObject(ClientBusinessObject cbo){ + private BusinessObject cloneBusinessObject(BusinessObject cbo){ if(cbo !=null){ BusinessObject businessObject = new BusinessObject(); - BusinessObject bo = cbo.getBusinessObject(); businessObject.oid = new ObjectUtility().getNewObjectID36(); businessObject.revisionid = new ObjectUtility().getNewObjectID36(); businessObject.nameoid = new ObjectUtility().getNewObjectID36(); - businessObject.btName = bo.btName; - businessObject.isLastR = bo.isLastR; - businessObject.isFirstR = bo.isFirstR; - businessObject.isLastV = bo.isLastV; - businessObject.isFirstV = bo.isFirstV; + businessObject.btName = cbo.btName; + businessObject.isLastR = cbo.isLastR; + businessObject.isFirstR = cbo.isFirstR; + businessObject.isLastV = cbo.isLastV; + businessObject.isFirstV = cbo.isFirstV; businessObject.creator = WebUtil.getCurrentUserId(); businessObject.createTime = System.currentTimeMillis(); - businessObject.modifier = bo.modifier; - businessObject.modifyTime = bo.modifyTime; - businessObject.revisionRule = bo.revisionRule; - businessObject.versionRule = bo.versionRule; - businessObject.revisionSeq = bo.revisionSeq; - businessObject.revisionValue = bo.revisionValue; - businessObject.versionSeq = bo.versionSeq; - businessObject.versionValue = bo.versionValue; - businessObject.lctId = bo.lctId; - businessObject.lcStatus = bo.lcStatus; + businessObject.modifier = cbo.modifier; + businessObject.modifyTime = cbo.modifyTime; + businessObject.revisionRule = cbo.revisionRule; + businessObject.versionRule = cbo.versionRule; + businessObject.revisionSeq = cbo.revisionSeq; + businessObject.revisionValue = cbo.revisionValue; + businessObject.versionSeq = cbo.versionSeq; + businessObject.versionValue = cbo.versionValue; + businessObject.lctId = cbo.lctId; + businessObject.lcStatus = cbo.lcStatus; businessObject.ts = System.currentTimeMillis(); - businessObject.id = bo.id; - businessObject.name = bo.name; - businessObject.description = bo.description; + businessObject.id = cbo.id; + businessObject.name = cbo.name; + businessObject.description = cbo.description; businessObject.owner = businessObject.creator; -// businessObject.checkinBy = bo.checkinBy; -// businessObject.checkinTime = bo.checkinTime; -// businessObject.checkoutBy = bo.checkoutBy; -// businessObject.checkoutTime = bo.checkoutTime; - businessObject.fromVersion = bo.fromVersion; - if(bo.newAttrValList !=null){ - businessObject.newAttrValList = clone(bo.newAttrValList); + businessObject.fromVersion = cbo.fromVersion; + if(cbo.newAttrValList !=null){ + businessObject.newAttrValList = clone(cbo.newAttrValList); } - if(bo.hisAttrValList !=null){ - businessObject.hisAttrValList = clone(bo.hisAttrValList); + if(cbo.hisAttrValList !=null){ + businessObject.hisAttrValList = clone(cbo.hisAttrValList); } - ClientBusinessObject cbo2 = new ClientBusinessObject(); - cbo2.setBusinessObject(businessObject); - return cbo2; + return businessObject; }else { return null; } @@ -399,12 +388,12 @@ String fieldName = referInfo.split("\\.")[1].trim().toLowerCase(); Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put(fieldName,QueryOptionConstant.IN + "(" + WebUtil.toInSql(value.toArray(new String[0])) + ")"); - List<com.vci.client.bof.ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null, Arrays.asList(new String[]{"oid",fieldName})); + List<BusinessObject> cbos = queryCBO(btmName,conditionMap,null, Arrays.asList(new String[]{"oid",fieldName})); Map<String,String> data = new HashMap<String, String>(); if(cbos!=null && cbos.size() > 0){ - for(ClientBusinessObject cbo : cbos){ - data.put(cbo.getAttributeValue(fieldName),cbo.getOid()); + for(BusinessObject cbo : cbos){ + data.put(ObjectTool.getBOAttributeValue(cbo,fieldName),cbo.oid); } } return data; @@ -433,10 +422,10 @@ throw new VciBaseException("灞炴��" + columnName + "鐨勫�间负绌�"); } conditionMap.put(columnName,QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oidSet.toArray(new String[0])) + ")"); - List<ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null,Arrays.asList(new String[]{columnName})); + List<BusinessObject> cbos = queryCBO(btmName,conditionMap,null,Arrays.asList(new String[]{columnName})); if(cbos !=null && cbos.size() >0){ - for(ClientBusinessObject cbo : cbos){ - String oid = cbo.getAttributeValue(columnName); + for(BusinessObject cbo : cbos){ + String oid = ObjectTool.getBOAttributeValue(cbo,columnName); if(oidSet.contains(oid)){ oidSet.remove(oid); } @@ -473,7 +462,7 @@ * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬槸鎶涘嚭寮傚父 */ @Override - public List<ClientBusinessObject> queryCBO(String btmType, + public List<BusinessObject> queryCBO(String btmType, Map<String, String> conditionMap) throws VciBaseException { List<String> clauseList = new ArrayList<String>(); clauseList.add("*"); @@ -490,7 +479,7 @@ * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬槸鎶涘嚭寮傚父 */ @Override - public List<ClientBusinessObject> queryCBO(String btmType, + public List<BusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph) throws VciBaseException { List<String> clauseList = new ArrayList<String>(); @@ -508,7 +497,7 @@ * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬槸鎶涘嚭寮傚父 */ @Override - public List<ClientBusinessObject> queryCBO(String btmType, + public List<BusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph, List<String> clauseList) throws VciBaseException { QueryTemplate qt = new QueryTemplate(); @@ -559,8 +548,8 @@ * @return 鏌ヨ鍑烘潵鐨勫�� * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ - private List<ClientBusinessObject> baseQueryCBO(QueryTemplate qt,Map<String,String> conditionMap,PageHelper ph,List<String> clauseList) throws VciBaseException{ - List<ClientBusinessObject> allCbos = new ArrayList<ClientBusinessObject>(); + private List<BusinessObject> baseQueryCBO(QueryTemplate qt,Map<String,String> conditionMap,PageHelper ph,List<String> clauseList) throws VciBaseException{ + List<BusinessObject> allCbos = new ArrayList<BusinessObject>(); if(clauseList == null){ clauseList = new ArrayList<String>(); clauseList.add("*"); @@ -621,10 +610,10 @@ ObjectQueryService.FindBTMObjectsV3Result bos = qtService.findBTMObjectsV3(qt.getId(), OQTool.qtTOXMl(qt).asXML(), refOpts.toArray(new BtmRefQueryOption[refOpts.size()])); if (bos != null && bos.count > 0) { for (BusinessObject bo : bos.returnValue) { - ClientBusinessObject cbo = new ClientBusinessObject(); - cbo.setBusinessObject(bo); - queryEnumText(cbo,enumAttrName); - allCbos.add(cbo); +// BusinessObject cbo = new BusinessObject(); +// cbo = bo; + queryEnumText(bo,enumAttrName); +// allCbos.add(cbo); } //鍥犱负淇敼浜嗘煡璇㈢殑鏂瑰紡锛屾墍浠ュ氨涓嶉渶瑕佸崟鐙煡璇㈠弬鐓� } @@ -719,13 +708,13 @@ * 鏌ヨ鐢熷懡鍛ㄦ湡鐨勫�� * @param cbos 涓氬姟瀵硅薄 */ - private void queryLcStatus(List<ClientBusinessObject> cbos){ + private void queryLcStatus(List<BusinessObject> cbos){ if(!CollectionUtils.isEmpty(cbos)){ Map<String, OsStatusVO> statusVOMap = statusService.selectAllStatusMap(); cbos.stream().forEach(cbo->{ try{ - cbo.setAttributeValueWithNoCheck("lcStatus_text", statusVOMap.getOrDefault(cbo.getLcStatus(),new OsStatusVO()).getName()); + ObjectTool.setBOAttributeValue(cbo,"lcStatus_text", statusVOMap.getOrDefault(cbo.lcStatus,new OsStatusVO()).getName()); }catch(Exception e){ logger.error("鑾峰彇鐢熷懡鍛ㄦ湡涓姸鎬佺殑鏄剧ず鏂囨湰鍑洪敊",e); } @@ -739,7 +728,7 @@ * @param enumAttrName 鏋氫妇灞炴�х殑鍊� * @throws VciBaseException */ - private void queryEnumText(ClientBusinessObject cbo,List<String> enumAttrName) throws VciBaseException{ + private void queryEnumText(BusinessObject cbo,List<String> enumAttrName) throws VciBaseException{ queryEnumText(cbo,null,enumAttrName); } @@ -751,16 +740,16 @@ * @throws VciBaseException 鏌ヨ鏋氫妇鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ @Override - public void queryEnumText(ClientBusinessObject cbo, ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException{ + public void queryEnumText(BusinessObject cbo, LinkObject clo, List<String> enumAttrName) throws VciBaseException{ if(enumAttrName.size()>0){//鏌ヨ鏋氫妇 for(String enumAttr:enumAttrName){//鏍煎紡涓� code_field code鏄灇涓剧殑缂栫爜锛宖ield鏄綋鍓嶄笟鍔$被鍨嬪瓨鍌ㄦ灇涓惧�肩殑瀛楁 if(enumAttr.toLowerCase().equals("creator_name")){ //鍒涘缓浜虹殑鍚嶇О String creator = ""; if(cbo!=null){ - creator = cbo.getCreator(); + creator = cbo.creator; }else{ - creator = clo.getCreator(); + creator = clo.creator; } if(StringUtils.isNotBlank(creator)){ String userTrueName = userQueryService.getUserNameByUserId(creator); @@ -770,9 +759,9 @@ //鏈�鍚庝慨鏀逛汉鍚嶇О String modifier = ""; if(cbo!=null){ - modifier = cbo.getLastModifier(); + modifier = cbo.modifier; }else{ - modifier = clo.getLastModifier(); + modifier = clo.modifier; } if(StringUtils.isNotBlank(modifier)){ String userTrueName = userQueryService.getUserNameByUserId(modifier); @@ -784,7 +773,7 @@ if(fields.contains("_")){ String valueField = ""; valueField = fields.split("_")[0]; - String value = cbo.getAttributeValue(valueField); + String value = ObjectTool.getBOAttributeValue(cbo,valueField);; if(StringUtils.isNotBlank(value)){ String userTrueName = userQueryService.getUserNameByUserId(value); setValueToCboOrClo(cbo,clo,enumAttr,userTrueName); @@ -803,9 +792,9 @@ } String enumKey = ""; if (cbo != null) { - enumKey = cbo.getAttributeValue(valueFieldName); + enumKey = ObjectTool.getBOAttributeValue(cbo,valueFieldName); } else if (clo != null) { - enumKey = clo.getAttributeValue(valueFieldName); + enumKey = ObjectTool.getLOAttributeValue(clo,valueFieldName); } String enumText = ""; if (WebUtil.isNotNull(enumKey)) { @@ -829,10 +818,10 @@ * @param attr 灞炴�у悕 * @param value 鍊� */ - private void setValueToCboOrClo(ClientBusinessObject cbo,ClientLinkObject clo,String attr,String value){ + private void setValueToCboOrClo(BusinessObject cbo,LinkObject clo,String attr,String value){ try { if (cbo != null) { - cbo.setAttributeValueWithNoCheck(attr, value); + ObjectTool.setBOAttributeValue(cbo, attr, value); }else{ setAttributeValueForClo(clo,attr, value); } @@ -848,8 +837,8 @@ * @param attributeValue 灞炴�х殑鍊� */ @Override - public void setAttributeValueForClo(ClientLinkObject clo, String attributeName, String attributeValue) { - AttributeValue[] attrValues = clo.getLinkObject().newAttrValList; + public void setAttributeValueForClo(LinkObject clo, String attributeName, String attributeValue) { + AttributeValue[] attrValues = clo.newAttrValList; ArrayList<AttributeValue> attrValList = new ArrayList(); AttributeValue attrVal; int i; @@ -882,7 +871,7 @@ attrValList.add(attrVal); } - clo.getLinkObject().newAttrValList = (AttributeValue[]) attrValList.toArray(new AttributeValue[attrValList.size()]); + clo.newAttrValList = attrValList.toArray(new AttributeValue[attrValList.size()]); } @@ -892,7 +881,7 @@ * @param enumAttrName 鏋氫妇灞炴�� * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ - private void queryEnumTextClo(ClientLinkObject clo,List<String> enumAttrName) throws VciBaseException{ + private void queryEnumTextClo(LinkObject clo,List<String> enumAttrName) throws VciBaseException{ queryEnumText(null,clo,enumAttrName); } @@ -905,7 +894,7 @@ * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ @Override - public List<ClientBusinessObject> queryCBOByScheme(String queryScheme, + public List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap) throws VciBaseException { PageHelper ph = new PageHelper(-1); @@ -923,7 +912,7 @@ * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ @Override - public List<ClientBusinessObject> queryCBOByScheme(String queryScheme, + public List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph) throws VciBaseException { List<String> clauseList = new ArrayList<String>(); @@ -1002,7 +991,7 @@ * @throws VciBaseException 鏌ヨ鍑洪敊浼氭姏鍑哄紓甯� */ @Override - public List<ClientBusinessObject> queryCBOByScheme(String queryScheme, + public List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph, List<String> clauseList) throws VciBaseException { QueryTemplate qt = getQtByName(queryScheme,replaceMap); @@ -1134,11 +1123,11 @@ * @throws VciBaseException 鏌ヨ鍑洪敊浼氭姏鍑哄紓甯� */ @Override - public List<ClientBusinessObject> queryBySql(String sql, + public List<BusinessObject> queryBySql(String sql, Map<String, String> conditionMap) throws VciBaseException { List<Map> allData = queryBySqlForMap(sql,conditionMap); if(allData == null || allData.size() == 0){ - return new ArrayList<ClientBusinessObject>(); + return new ArrayList<BusinessObject>(); }else{ return map2Cbos(allData); } @@ -1151,10 +1140,10 @@ * @throws VciBaseException 鏌ヨ鍑洪敊娲绘姏鍑哄紓甯� */ @Override - public List<ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException{ + public List<BusinessObject> queryByOnlySql(String sql) throws VciBaseException{ List<Map> allData = queryByOnlySqlForMap(sql); if(allData == null || allData.size() == 0){ - return new ArrayList<ClientBusinessObject>(); + return new ArrayList<BusinessObject>(); }else{ return map2Cbos(allData); } @@ -1367,11 +1356,11 @@ allFieldAttrMap.put(columnName.toLowerCase(),fieldName); } List<T> allObject = new ArrayList<T>(); - List<ClientBusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c), conditionMap, ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));//鎵ц鏌ヨ + List<BusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c), conditionMap, ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));//鎵ц鏌ヨ List<String> oids = new ArrayList<String>(); if(allCbos!=null&&allCbos.size()>0){ - for(ClientBusinessObject cbo : allCbos){ + for(BusinessObject cbo : allCbos){ T obj = null; try { obj = c.newInstance(); @@ -1381,7 +1370,7 @@ } catch (IllegalAccessException e) { } if(obj !=null){ - oids.add(cbo.getOid()); + oids.add(cbo.oid); allObject.add(obj); } } @@ -1472,10 +1461,10 @@ allFieldAttrMap.put(columnName.toLowerCase(),fieldName); } List<T> allObject = new ArrayList<T>(); - List<ClientBusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList())); + List<BusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList())); List<String> oids = new ArrayList<String>(); if(allCbos!=null&&allCbos.size()>0){ - for(ClientBusinessObject cbo : allCbos){ + for(BusinessObject cbo : allCbos){ T obj = null; try { obj = c.newInstance(); @@ -1485,7 +1474,7 @@ } catch (IllegalAccessException e) { } if(obj !=null){ - oids.add(cbo.getOid()); + oids.add(cbo.oid); allObject.add(obj); } } @@ -1539,7 +1528,7 @@ * @param isEdit 鏄惁涓虹紪杈� * @throws VciBaseException 璁剧疆鍑洪敊浼氭姏鍑哄紓甯� */ - private void setValueToCbo(Object obj,String btmType,ClientBusinessObject cbo ,boolean isEdit) throws VciBaseException{ + private void setValueToCbo(Object obj,String btmType,BusinessObject cbo ,boolean isEdit) throws VciBaseException{ Field pkField = WebUtil.getPkFieldForObj(obj.getClass()); if(pkField == null){ throw new VciBaseException("{0}绫讳腑娌℃湁瀹氫箟涓婚敭灞炴��",new Object[]{obj.getClass()}); @@ -1547,10 +1536,10 @@ //涓婚敭 Object pkValue = WebUtil.getValueFromField(pkField.getName(), obj); if(pkValue == null || (pkValue instanceof String && WebUtil.isNull(pkValue.toString()))){ - WebUtil.setValueToField(pkField.getName(), obj, cbo.getOid()); - pkValue = cbo.getOid(); + WebUtil.setValueToField(pkField.getName(), obj, cbo.oid); + pkValue = cbo.oid; }else{ - cbo.setOid(pkValue.toString()); + cbo.oid = pkValue.toString(); } //杩涜闈炵┖锛岄暱搴︼紝閲嶅鐨勬牎楠屻�傘�傛牎楠岄�氳繃鐨勮祴鍊� Map<String,String> fieldMap = WebUtil.getFieldNameMap(obj.getClass()); @@ -1592,7 +1581,7 @@ //璇存槑涓嶈兘閲嶅锛岄偅涔堝氨闇�瑕佹煡璇竴涓� Map<String,String> queryRepeatMap = getOneQuery(attrName, value); if(isEdit){ - queryRepeatMap.put("oid", QueryOptionConstant.NOTEQUAL + cbo.getOid()); + queryRepeatMap.put("oid", QueryOptionConstant.NOTEQUAL + cbo.oid); } if(queryCount(btmType, queryRepeatMap)>0){ throw new VciBaseException("{0}瀛楁鐨勫�納1}鍦ㄧ郴缁熶腑宸茬粡瀛樺湪", new Object[]{columnText,value}); @@ -1605,16 +1594,12 @@ if(isEdit && checkUnAttrUnEdit(attrName)){ //缂栬緫鐨勬椂鍊欙紝TS鍜孫ID涓嶈兘璁剧疆.鍥犱负骞冲彴閭f帴鍙h缃簡灏变細鎶ラ敊 }else { - try { - //闇�瑕佸垽鏂槸鍚﹂粯璁ょ殑灞炴�э紝濡傛灉鏄粯璁ゅ睘鎬э紝鍒欎娇鐢ㄥ璞$殑璧嬪�肩殑鏂瑰紡 - if (WebUtil.isDefaultField(fieldName) && WebUtil.inArray(new String[]{"id", "name", "description","lcstatus","revisionvalue","versionvalue"}, fieldName.toLowerCase())) { - WebUtil.setValueToField(fieldName, cbo, value); - cbo.setAttributeValueWithNoCheck(attrName.toLowerCase(), value); - } else { - cbo.setAttributeValueWithNoCheck(attrName.toLowerCase(), value); - } - } catch (PLException e) { - throw WebUtil.getVciBaseException(e); + //闇�瑕佸垽鏂槸鍚﹂粯璁ょ殑灞炴�э紝濡傛灉鏄粯璁ゅ睘鎬э紝鍒欎娇鐢ㄥ璞$殑璧嬪�肩殑鏂瑰紡 + if (WebUtil.isDefaultField(fieldName) && WebUtil.inArray(new String[]{"id", "name", "description","lcstatus","revisionvalue","versionvalue"}, fieldName.toLowerCase())) { + WebUtil.setValueToField(fieldName, cbo, value); + ObjectTool.setBOAttributeValue(cbo, attrName.toLowerCase(), value); + } else { + ObjectTool.setBOAttributeValue(cbo, attrName.toLowerCase(), value); } } } @@ -1633,7 +1618,7 @@ if(list==null){ throw new VciBaseException(VciBaseException.paramNull); } - Set<ClientBusinessObject> allCbos = new HashSet<ClientBusinessObject>(); + Set<BusinessObject> allCbos = new HashSet<BusinessObject>(); for(T obj : list){ //闇�瑕佸鐞嗛粯璁ゅ�� Field pkField = WebUtil.getPkFieldForObj(obj.getClass()); @@ -1641,7 +1626,7 @@ throw new VciBaseException("{0}瀵硅薄涓病鏈夎缃富閿殑灞炴��",new Object[]{obj.getClass()}); } String btmType = WebUtil.getBtmTypeByObject(obj.getClass()); - ClientBusinessObject cbo = createCBOByBtmName(btmType); + BusinessObject cbo = createCBOByBtmName(btmType); setValueToCbo(obj,btmType,cbo,false); allCbos.add(cbo); } @@ -1684,9 +1669,9 @@ if(list==null){ throw new VciBaseException(VciBaseException.paramNull); } - Set<ClientBusinessObject> allUpdateCbos = new HashSet<ClientBusinessObject>(); - Set<ClientBusinessObject> allDeleteCbos = new HashSet<ClientBusinessObject>(); - Set<ClientBusinessObject> allAddCbos = new HashSet<ClientBusinessObject>(); + Set<BusinessObject> allUpdateCbos = new HashSet<BusinessObject>(); + Set<BusinessObject> allDeleteCbos = new HashSet<BusinessObject>(); + Set<BusinessObject> allAddCbos = new HashSet<BusinessObject>(); Map<String,String> btmOidsMap = new HashMap<String, String>(); for(T obj : list){ String btmType = WebUtil.getBtmTypeByObject(obj.getClass()); @@ -1707,7 +1692,7 @@ } btmOidsMap.put(btmType, tempOids); } - List<ClientBusinessObject> needUpdateCbos = new ArrayList<ClientBusinessObject>(); + List<BusinessObject> needUpdateCbos = new ArrayList<BusinessObject>(); Iterator<String> it = btmOidsMap.keySet().iterator(); while(it.hasNext()){ String btmType = it.next(); @@ -1725,12 +1710,12 @@ } //涓婚敭 Object pkValue = WebUtil.getValueFromField(pkField.getName(), obj); - ClientBusinessObject cbo = null; + BusinessObject cbo = null; if(pkValue == null || (pkValue instanceof String && WebUtil.isNull(pkValue.toString()))){ continue; }else{ - for(ClientBusinessObject tempCbo : needUpdateCbos){ - if(tempCbo.getOid().equalsIgnoreCase(pkValue.toString().trim())){ + for(BusinessObject tempCbo : needUpdateCbos){ + if(tempCbo.oid.equalsIgnoreCase(pkValue.toString().trim())){ cbo = tempCbo; break; } @@ -1738,7 +1723,7 @@ } String btmType = WebUtil.getBtmTypeByObject(obj.getClass()); //鎷疯礉涔嬪墠鍏堟竻闄ゅ凡缁忔湁鐨勫�� - cbo.getBusinessObject().newAttrValList = new AttributeValue[0]; + cbo.newAttrValList = new AttributeValue[0]; setValueToCbo(obj,btmType,cbo,true); allUpdateCbos.add(cbo); } @@ -1797,8 +1782,8 @@ if(list==null){ throw new VciBaseException(VciBaseException.paramNull); } - Set<ClientBusinessObject> allDeleteCbos = new HashSet<ClientBusinessObject>(); - Map<String,List<ClientBusinessObject>> btmBos = new HashMap<String, List<ClientBusinessObject>>(); + Set<BusinessObject> allDeleteCbos = new HashSet<BusinessObject>(); + Map<String,List<BusinessObject>> btmBos = new HashMap<String, List<BusinessObject>>(); for(Object obj : list){ //鏈夊彲鑳戒笉灞炰簬鍚屼竴涓笟鍔$被鍨嬩笅 Field pkField = WebUtil.getPkFieldForObj(obj.getClass()); @@ -1808,7 +1793,7 @@ String btmType = WebUtil.getBtmTypeByObject(obj.getClass()); String pkValue = WebUtil.getValueFromFieldForCbo(pkField, obj); //鎵�浠ヨ繖閲屼篃鏄洿鎺ユ煡璇㈢殑鍗曚釜' - List<ClientBusinessObject> deleteCbos = queryCBO(btmType, getOneQuery( + List<BusinessObject> deleteCbos = queryCBO(btmType, getOneQuery( WebUtil.getCboAttrNameFromField(pkField, obj.getClass()), pkValue)); if(deleteCbos!=null){ allDeleteCbos.addAll(deleteCbos); @@ -1838,7 +1823,7 @@ * @param btmBos 涓氬姟鏁版嵁 * @throws VciBaseException 琚紩鐢ㄧ殑鏃跺�欎細鎶涘嚭寮傚父 */ - private void checkCanDelete(Map<String,List<ClientBusinessObject>> btmBos) throws VciBaseException{ + private void checkCanDelete(Map<String,List<BusinessObject>> btmBos) throws VciBaseException{ //鏌ユ壘琛ㄦ槸鍚﹁鍏朵粬鐨勫睘鎬у紩鐢� if(!btmBos.isEmpty()){ Iterator<String> it = btmBos.keySet().iterator(); @@ -1848,13 +1833,13 @@ List<OsUsedAttributeVO> usedAttrVOs = btmService.listBtmUsedInfo(btmType); Map<String, List<OsUsedAttributeVO>> allReferAttr = Optional.ofNullable(usedAttrVOs).orElseGet(()->new ArrayList<>()).stream().collect(Collectors.groupingBy(s -> s.getPkBtmType())); - List<ClientBusinessObject> thisBtmTypeBo = btmBos.get(btmType); + List<BusinessObject> thisBtmTypeBo = btmBos.get(btmType); if(thisBtmTypeBo.size()== 0){ return; } String oids = ""; - for(ClientBusinessObject cbo : thisBtmTypeBo){ - oids += "'" + cbo.getOid() + "',"; + for(BusinessObject cbo : thisBtmTypeBo){ + oids += "'" + cbo.oid + "',"; } oids = WebUtil.removeComma(oids); if(!allReferAttr.isEmpty()){ @@ -1904,13 +1889,13 @@ conditionMap = new HashMap<String, String>(); } conditionMap.put(QUERY_FILTER_SECRET,BooleanEnum.FASLE.getValue());//鏌ヨ鐨勬椂鍊欎笉鑳芥煡璇㈠瘑绾� - List<ClientBusinessObject> allCbos = queryCBO(btmType, conditionMap); + List<BusinessObject> allCbos = queryCBO(btmType, conditionMap); BatchCBO batchCbo = new BatchCBO(); if(allCbos.size()>0){ - Map<String,List<ClientBusinessObject>> btmBos = new HashMap<String, List<ClientBusinessObject>>(); + Map<String,List<BusinessObject>> btmBos = new HashMap<String, List<BusinessObject>>(); btmBos.put(btmType, allCbos); checkCanDelete(btmBos); - Set<ClientBusinessObject> allDeleteCbos = new HashSet<ClientBusinessObject>(); + Set<BusinessObject> allDeleteCbos = new HashSet<BusinessObject>(); allDeleteCbos.addAll(allCbos); batchCbo.setDeleteCbos(allDeleteCbos); } @@ -1943,24 +1928,24 @@ selectSql += ",btmname "; } sql = selectSql + fromSql; - List<ClientBusinessObject> allDelete =queryBySql(sql, conditionMap); + List<BusinessObject> allDelete =queryBySql(sql, conditionMap); if(allDelete.size() == 0){ return batchCbo;//娌℃湁鍒犻櫎浠讳綍鏁版嵁 } //鎵綽tmType; - String btmType = allDelete.get(0).getAttributeValue("btmName"); - Map<String,List<ClientBusinessObject>> btmBos = new HashMap<String, List<ClientBusinessObject>>(); + String btmType = ObjectTool.getBOAttributeValue(allDelete.get(0),"btmName"); + Map<String,List<BusinessObject>> btmBos = new HashMap<String, List<BusinessObject>>(); btmBos.put(btmType, allDelete); checkCanDelete(btmBos); - Set<ClientBusinessObject> allDeleteCbos = new HashSet<ClientBusinessObject>(); + Set<BusinessObject> allDeleteCbos = new HashSet<BusinessObject>(); //鎴戜滑闇�瑕佷粠鍚庡彴鏌ヨ鏁翠釜鐨勫唴瀹规墠鍙互鎵ц鍒犻櫎锛� String oids = ""; - for(ClientBusinessObject cbo : allDelete){ - oids += "'" + cbo.getOid() + "',"; + for(BusinessObject cbo : allDelete){ + oids += "'" + cbo.oid + "',"; } conditionMap.clear(); conditionMap.put("oid", QueryOptionConstant.IN + "(" + WebUtil.removeComma(oids) + ")"); - List<ClientBusinessObject> inDbCbos = queryCBO(btmType, conditionMap); + List<BusinessObject> inDbCbos = queryCBO(btmType, conditionMap); allDeleteCbos.addAll(inDbCbos); batchCbo.setDeleteCbos(allDeleteCbos); @@ -1991,14 +1976,14 @@ Map<String,String> conditionMap = getOneQuery("oid", pkValue); List<String> causeList = new ArrayList<>(); causeList.add("ts"); - List<ClientBusinessObject> cbos = queryCBO(WebUtil.getBtmTypeByObject(obj.getClass()), conditionMap,new PageHelper(-1),causeList); + List<BusinessObject> cbos = queryCBO(WebUtil.getBtmTypeByObject(obj.getClass()), conditionMap,new PageHelper(-1),causeList); if(CollectionUtils.isEmpty(cbos)){ return false; } if(ts.contains(".")){ ts = ts.substring(0,ts.lastIndexOf(".")); } - return cbos.get(0).getTs() == Long.valueOf(ts); + return cbos.get(0).ts == Long.valueOf(ts); } /** @@ -2047,7 +2032,7 @@ ph = new PageHelper(-1); ph.setQueryTotal(true); } - List<ClientBusinessObject> allCbos = queryCBO(btmType, conditionMap, ph, clauseList); + List<BusinessObject> allCbos = queryCBO(btmType, conditionMap, ph, clauseList); DataGrid dg = new DataGrid(); if(allCbos.size()>0){ List<Map> mapList = cbos2Map(allCbos); @@ -2123,7 +2108,7 @@ if(ph == null){ ph = new PageHelper(-1,true); } - List<ClientBusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap,replaceMap, ph, clauseList); + List<BusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap,replaceMap, ph, clauseList); DataGrid dg = new DataGrid(); if(allCbos.size()>0){ List<Map> mapList = cbos2Map(allCbos); @@ -2224,29 +2209,29 @@ } /** - * ClientBusinessObject 杞负HashMap + * BusinessObject 杞负HashMap * @param cbos CBOS * @return map * @throws VciBaseException 杞崲鍑洪敊浼氭姏鍑哄紓甯� */ @Override - public List<Map> cbos2Map(List<ClientBusinessObject> cbos) + public List<Map> cbos2Map(List<BusinessObject> cbos) throws VciBaseException { List<Map> mapList = new ArrayList<Map>(); - for(ClientBusinessObject cbo : cbos){ + for(BusinessObject cbo : cbos){ mapList.add(cbo2Map(cbo)); } return mapList; } /** - * ClientBusinessObject 杞负HashMap + * BusinessObject 杞负HashMap * @param cbo 涓氬姟鏁版嵁瀵硅薄 * @return map * @throws VciBaseException 杞崲鍑洪敊浼氭姏鍑哄紓甯� */ @Override - public Map cbo2Map(ClientBusinessObject cbo) throws VciBaseException { + public Map cbo2Map(BusinessObject cbo) throws VciBaseException { Map<String,String> map = new HashMap<String, String>(); WebUtil.copyValueToMapFromCbos(cbo, map); return map; @@ -2254,15 +2239,15 @@ /** - * map杞负clientBusinessObject + * map杞负BusinessObject * @param mapList map鍒楄〃 * @return 涓氬姟鏁版嵁鍒楄〃 * @throws VciBaseException 杞崲鍑洪敊浼氭姏鍑哄紓甯� */ @Override - public List<ClientBusinessObject> map2Cbos(List<Map> mapList) + public List<BusinessObject> map2Cbos(List<Map> mapList) throws VciBaseException { - List<ClientBusinessObject> cboList = new ArrayList<ClientBusinessObject>(); + List<BusinessObject> cboList = new ArrayList<BusinessObject>(); for(Map map : mapList){ cboList.add(map2Cbo(map)); } @@ -2271,14 +2256,14 @@ /** - * map杞负clientBusinessObject + * map杞负BusinessObject * @param map map * @return 涓氬姟鏁版嵁 * @throws VciBaseException 杞崲鍑洪敊浼氭姏鍑哄紓甯� */ @Override - public ClientBusinessObject map2Cbo(Map map) throws VciBaseException { - ClientBusinessObject cbo = new ClientBusinessObject(); + public BusinessObject map2Cbo(Map map) throws VciBaseException { + BusinessObject cbo = new BusinessObject(); WebUtil.copyValueToCboFromMap(cbo, map); return cbo; } @@ -2326,13 +2311,13 @@ * @param cbos 瀹㈡埛绔璞� * @return 涓氬姟瀵硅薄 */ - private BusinessObject[] cboArray2Bo(ClientBusinessObject[] cbos){ + private BusinessObject[] cboArray2Bo(BusinessObject[] cbos){ if(cbos == null ||cbos.length == 0){ return new BusinessObject[0]; } BusinessObject[] bos = new BusinessObject[cbos.length]; for(int i = 0; i < cbos.length; i++){ - bos[i] = cbos[i].getBusinessObject(); + bos[i] = cbos[i]; } return bos; } @@ -2342,13 +2327,13 @@ * @param clos 瀹㈡埛绔璞� * @return 涓氬姟瀵硅薄 */ - private LinkObject[] cloArray2Lo(ClientLinkObject[] clos){ + private LinkObject[] cloArray2Lo(LinkObject[] clos){ if(clos == null ||clos.length == 0){ return new LinkObject[0]; } LinkObject[] bos = new LinkObject[clos.length]; for(int i = 0; i < clos.length; i++){ - bos[i] = clos[i].getLinkObject(); + bos[i] = clos[i]; } return bos; } @@ -2357,10 +2342,10 @@ * 鍒犻櫎鏋氫妇鍜屽弬鐓х殑灞炴�� * @param cbos 涓氬姟鏁版嵁 */ - private void deleteReferAttrInCbo(Set<ClientBusinessObject> cbos){ + private void deleteReferAttrInCbo(Set<BusinessObject> cbos){ if(cbos !=null){ - for(ClientBusinessObject cbo : cbos){ - BusinessObject bo = cbo.getBusinessObject(); + for(BusinessObject cbo : cbos){ + BusinessObject bo = cbo; List<AttributeValue> newAttr = new ArrayList<AttributeValue>(); if (bo.newAttrValList != null) { for (int i = 0; i < bo.newAttrValList.length; ++i) { @@ -2374,7 +2359,7 @@ } } bo.newAttrValList = newAttr.toArray(new AttributeValue[0]); - cbo.setBusinessObject(bo); + cbo = bo; } } } @@ -2410,11 +2395,11 @@ * @throws VciBaseException 鍙傛暟涓虹┖锛屾暟鎹笉瀛樺湪浼氭姏鍑哄紓甯� */ @Override - public ClientBusinessObject selectCBOByOid(String oid, String btmName) throws VciBaseException { + public BusinessObject selectCBOByOid(String oid, String btmName) throws VciBaseException { VciBaseUtil.alertNotNull(oid,"涓婚敭",btmName,"涓氬姟绫诲瀷"); Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("oid", oid.trim()); - List<ClientBusinessObject> cbos = queryCBO(btmName, conditionMap); + List<BusinessObject> cbos = queryCBO(btmName, conditionMap); if(CollectionUtils.isEmpty(cbos)){ throw new VciBaseException("鏁版嵁鍦ㄧ郴缁熶腑涓嶅瓨鍦▄0}",new String[]{oid}); } @@ -2456,15 +2441,15 @@ * @throws VciBaseException 鍙傛暟涓虹┖锛屾煡璇㈠嚭閿欎細鎶涘嚭寮傚父 */ @Override - public List<ClientBusinessObject> selectCBOByOidCollection(Collection<String> oidCollection, String btmName) throws VciBaseException { + public List<BusinessObject> selectCBOByOidCollection(Collection<String> oidCollection, String btmName) throws VciBaseException { VciBaseUtil.alertNotNull(oidCollection,"涓婚敭闆嗗悎",btmName,"涓氬姟绫诲瀷"); Collection<Collection<String>> oidCollections = WebUtil.switchCollectionForOracleIn(oidCollection); - List<ClientBusinessObject> doList = new ArrayList<ClientBusinessObject>(); + List<BusinessObject> doList = new ArrayList<BusinessObject>(); for(Collection<String> oids: oidCollections){ Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oids.toArray(new String[0])) + ")"); - List<ClientBusinessObject> list = queryCBO(btmName, conditionMap); + List<BusinessObject> list = queryCBO(btmName, conditionMap); if(CollectionUtils.isEmpty(list)){ throw new VciBaseException("{0}鏉℃暟鎹湪绯荤粺涓笉瀛樺湪",new String[]{String.valueOf(oids.size())}); } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java index b95a7d5..74c8dd5 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java @@ -1,8 +1,6 @@ package com.vci.web.service.impl; -import com.vci.client.omd.linktype.util.Tool; -import com.vci.client.omd.provider.BtmProvider; -import com.vci.client.omd.provider.LinkTypeProvider; +import com.vci.client.common.providers.WebServiceProvider; import com.vci.corba.common.PLException; import com.vci.corba.omd.atm.AttributeDef; import com.vci.corba.omd.btm.BTMServicePrx; @@ -48,7 +46,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; -import static com.vci.client.omd.attribpool.ui.VTDataTypePanel.*; +import static com.vci.omd.constants.AttributeConstants.*; /** @@ -630,21 +628,25 @@ btmService.addBizType(btmItem); //鎵ц瀹屾垚浜嗛渶瑕佸垱寤鸿〃 //鑾峰彇鐨勬椂鍊欎笉涓�瀹氬埛鏂颁簡缂撳瓨锛岃繖鏍峰氨鑾峰彇涓嶅埌淇℃伅 - String btmTableName = BtmProvider.getInstance().getBTTableName(btmItem.name); + //OmdHelper + //todo 姝ゅ崰鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String btmTableName = BtmProvider.getInstance().getBTTableName(btmItem.name); + String btmTableName = null; String sql = "create Table " + btmTableName + "(" + "\n\tOID VARCHAR2(36) not null,\n\tREVISIONOID VARCHAR2(36),\n\tNAMEOID VARCHAR2(36),\n\tBtmName VARCHAR2(36),\n\tISLastR CHAR(1),\n\tISFirstR CHAR(1),\n\tISLastV CHAR(1),\n\tISFirstV CHAR(1),\n\tCreator VARCHAR2(36),\n\tCreateTime TIMESTAMP,\n\tLastModifier VARCHAR2(36),\n\tLastModifyTime TIMESTAMP,\n\tRevisionRule VARCHAR2(36),\n\tVersionRule VARCHAR2(36),\n\tRevisionSeq NUMBER,\n\tRevisionValue VARCHAR2(10),\n\tVersionSeq NUMBER,\n\tVersionValue VARCHAR2(10),\n\tLCTID VARCHAR2(36),\n\tLCStatus VARCHAR2(36),\n\tTS TIMESTAMP,\n\tID VARCHAR2(36),\n\tNAME VARCHAR2(128),\n\tDESCRIPTION VARCHAR2(255),\n\tOWNER VARCHAR2(36),\n\tCHECKINBY VARCHAR2(36),\n\tCHECKINTIME TIMESTAMP,\n\tCHECKOUTBY VARCHAR2(36),\n\tCHECKOUTTIME TIMESTAMP,\n\tCOPYFROMVERSION VARCHAR2(36),\n\t"; String[] apNameArray = btmItem.apNameArray; if(apNameArray!=null && apNameArray.length>0){ for(String attrId : apNameArray){ OsAttributeVO attrVO = attributeMap.get(attrId.toLowerCase().trim()); if(attrVO!=null) { - String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); - sql = sql + abSql; + //todo 姝ゅ崰鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); +// sql = sql + abSql; }else{ logger.info("涓氬姟绫诲瀷{}閲岀殑灞炴�}娌℃壘鍒�",btmTableName,attrId.toLowerCase().trim()); } } } - String alterSql = BtmProvider.getInstance().getAddPKSql(btmItem.name); +// String alterSql = BtmProvider.getInstance().getAddPKSql(btmItem.name); sql = sql.substring(0, sql.lastIndexOf(",")); sql = sql + "\n)"; //TODO 鏆傛椂涓嶆竻妤氱敤浣曠鏂瑰紡鍒涘缓琛紝姝ゅ鍏堟敞閲婃帀 @@ -1122,12 +1124,15 @@ */ private void addAttrToDB(Collection<String> addedAbList,String btmType,boolean linkType){ if (!CollectionUtils.isEmpty(addedAbList)) { - String tableName = linkType? LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); + //todo 姝ゆ殏鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String tableName = linkType? LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); + String tableName = null; String addSql = "alter table " + tableName + " add("; Map<String, OsAttributeVO> attributeMap = attrService.selectAllAttributeMap(); for (String abName : addedAbList) { AttributeDef abItem = attrService.attributeVO2DO(attributeMap.get(abName)); - addSql = addSql + Tool.getInstance().getAbSql(abItem); + //todo 姝ゆ殏鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// addSql = addSql + Tool.getInstance().getAbSql(abItem); } addSql = VciBaseUtil.removeComma(addSql.replace("\n\t","")); addSql = addSql + ")"; @@ -1143,13 +1148,14 @@ */ private void removeAttrToDB(Collection<String> removeAbList,String btmType,boolean linkType){ if (!CollectionUtils.isEmpty(removeAbList)) { - String tableName = linkType?LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); - String removeSql = "alter table " + tableName + " drop("; - for (String abName : removeAbList) { - removeSql = removeSql + abName + ","; - } - removeSql = VciBaseUtil.removeComma(removeSql.replace("\n\t","")); - removeSql = removeSql + ")"; + //todo 姝ゆ殏鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String tableName = linkType?LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); +// String removeSql = "alter table " + tableName + " drop("; +// for (String abName : removeAbList) { +// removeSql = removeSql + abName + ","; +// } +// removeSql = VciBaseUtil.removeComma(removeSql.replace("\n\t","")); +// removeSql = removeSql + ")"; //TODO 涓嶆竻妤氬叿浣撲娇鐢ㄤ粈涔堟柟娉曪紝鏆傛椂娉ㄩ噴锛屼絾涓嶈鍒犻櫎 // DDLToolClient.getService().batchExecuteUpdateOracle(new String[]{removeSql}); } @@ -1275,14 +1281,17 @@ for(LinkType linkType : linkTypes){ try{ platformClientUtil.getLinkTypeService().addLinkType(linkType); - String tableName = LinkTypeProvider.getInstance().getLTTableName(linkType.name); + //todo 姝ゆ殏鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String tableName = LinkTypeProvider.getInstance().getLTTableName(linkType.name); + String tableName = null; String sql = "create table " + tableName + "(" + "\n\tOID VARCHAR2(36) not null,\n\tCreator VARCHAR2(36),\n\tCreateTime TIMESTAMP,\n\tLastModifier VARCHAR2(36),\n\tLastModifyTime TIMESTAMP,\n\tTS TIMESTAMP,\n\t"; String[] apNameArray = linkType.attributes; if(apNameArray!=null && apNameArray.length>0){ for(String attrId : apNameArray){ OsAttributeVO attrVO = attributeMap.get(attrId.toLowerCase().trim()); - String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); - sql = sql + abSql; + //todo 姝ゆ殏鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); +// sql = sql + abSql; } } sql = sql.substring(0, sql.lastIndexOf(",")); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebLoServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebLoServiceImpl.java index f7c0e14..5eab0de 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebLoServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebLoServiceImpl.java @@ -2,18 +2,16 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; -import com.vci.client.bof.BOFactoryClient; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientLinkObject; -import com.vci.client.bof.ClientLinkObjectOperation; import com.vci.client.common.oq.OQTool; import com.vci.common.qt.object.*; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.PLException; import com.vci.corba.omd.data.AttributeValue; +import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.data.LinkObject; import com.vci.corba.query.ObjectQueryService; import com.vci.corba.query.data.BOAndLO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; @@ -55,10 +53,6 @@ */ private Logger logger = LoggerFactory.getLogger(getClass()); - /** - * LO鎿嶄綔绫� - */ - private ClientLinkObjectOperation loOperation = new ClientLinkObjectOperation(); @Autowired private WebBoServiceI boService; @@ -95,32 +89,28 @@ LO_BASE_FIELD_MAP.put("linkTypeName","linkTypeName"); } - @Override - public ClientLinkObjectOperation getLoOption() throws VciBaseException { - return loOperation; - } @Override - public List<ClientLinkObject> queryCLO(String linkType, + public List<LinkObject> queryCLO(String linkType, Map<String, String> conditionMap) throws VciBaseException { return queryCLO(linkType, "", 1, conditionMap); } @Override - public List<ClientBusinessObject> queryLinkCbo(String linkType, - String toBtmname, Map<String, String> conditionMap) + public List<BusinessObject> queryLinkCbo(String linkType, + String toBtmname, Map<String, String> conditionMap) throws VciBaseException { return queryLinkCbo(linkType, toBtmname, 1, conditionMap); } @Override - public List<ClientLinkObject> queryCLO(String linkType, String toBtmName, + public List<LinkObject> queryCLO(String linkType, String toBtmName, int level, Map<String, String> conditionMap) throws VciBaseException { return queryCLO(linkType, toBtmName, level, false, conditionMap); } @Override - public List<ClientLinkObject> queryCLO(String linkType, String toBtmName, + public List<LinkObject> queryCLO(String linkType, String toBtmName, int level, boolean isDirection,Map<String, String> conditionMap) throws VciBaseException { return queryCLO(linkType,toBtmName,level,isDirection,conditionMap,new PageHelper(-1)); } @@ -135,9 +125,9 @@ * @param ph 鎺掑簭鍜屽垎椤碉紝閾炬帴涓�鑸笉寤鸿鍒嗛〉 */ @Override - public List<ClientLinkObject> queryCLO(String linkType, String toBtmName, + public List<LinkObject> queryCLO(String linkType, String toBtmName, int level, boolean isDirection,Map<String, String> conditionMap,PageHelper ph) throws VciBaseException { - List<ClientLinkObject> rtnOBJs = new ArrayList<ClientLinkObject>(); + List<LinkObject> rtnOBJs = new ArrayList<LinkObject>(); QueryTemplate qt = new QueryTemplate(); qt.setId("queryLO"); qt.setType(QTConstants.TYPE_LINK); @@ -192,8 +182,8 @@ LinkObject[] bos = platformClientUtil.getQueryService().findLTObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML()); if (bos != null && bos.length > 0) { for (LinkObject bo : bos) { - ClientLinkObject clo = new ClientLinkObject(); - clo.setLinkObject(bo); + LinkObject clo = new LinkObject(); + clo = bo; rtnOBJs.add(clo); } @@ -208,17 +198,17 @@ @Override - public List<ClientBusinessObject> queryLinkCbo(String linkType, + public List<BusinessObject> queryLinkCbo(String linkType, String toBtmname, int level, Map<String, String> conditionMap) throws VciBaseException { return queryLinkCbo(linkType, toBtmname, level, false, conditionMap); } @Override - public List<ClientBusinessObject> queryLinkCbo(String linkType, + public List<BusinessObject> queryLinkCbo(String linkType, String toBtmName, int level,boolean isDirection, Map<String, String> conditionMap) throws VciBaseException { - List<ClientBusinessObject> rtnOBJs = new ArrayList<ClientBusinessObject>(); + List<BusinessObject> rtnOBJs = new ArrayList<BusinessObject>(); QueryTemplate qt = new QueryTemplate(); qt.setId("queryLO"); qt.setType(QTConstants.TYPE_LINK); @@ -246,8 +236,8 @@ BOAndLO[] bos = platformClientUtil.getQueryService().getBOAndLOS(qt.getId(), OQTool.qtTOXMl(qt).asXML(),btmOid); if (bos != null && bos.length > 0) { for (BOAndLO blo : bos) { - ClientBusinessObject cbo = new ClientBusinessObject(); - cbo.setBusinessObject(blo.bo); + BusinessObject cbo = new BusinessObject(); + cbo = blo.bo; rtnOBJs.add(cbo); } return rtnOBJs; @@ -258,36 +248,36 @@ } return rtnOBJs; } +// +// @Override +// public Map<String, BusinessObject> queryLinkedCbo(LinkObject[] lo, +// boolean isDirection) throws VciBaseException { +// LinkObject[] clos = new LinkObject[lo.length]; +// for(int i =0 ; i < lo.length; i ++){ +// LinkObject clo = new LinkObject(); +// clo = lo[i]; +// clos[i] = clo; +// } +// return queryLinkedCbo(clos,isDirection); +// } @Override - public Map<String, ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, - boolean isDirection) throws VciBaseException { - ClientLinkObject[] clos = new ClientLinkObject[lo.length]; - for(int i =0 ; i < lo.length; i ++){ - ClientLinkObject clo = new ClientLinkObject(); - clo.setLinkObject(lo[i]); - clos[i] = clo; - } - return queryLinkedCbo(clos,isDirection); - } - - @Override - public Map<String, ClientBusinessObject> queryLinkedCbo(List los, + public Map<String, BusinessObject> queryLinkedCbo(List los, boolean isDirection) throws VciBaseException { return queryLinkedCbo(los,isDirection,new ArrayList<String>()); } @Override - public Map<String, ClientBusinessObject> queryLinkedCbo(List los, + public Map<String, BusinessObject> queryLinkedCbo(List los, boolean isDirection,List<String> queryColumn) throws VciBaseException { - ClientLinkObject[] clos = new ClientLinkObject[los.size()]; + LinkObject[] clos = new LinkObject[los.size()]; for(int i = 0 ; i < los.size(); i ++){ Object o = los.get(i); - ClientLinkObject clo = new ClientLinkObject(); + LinkObject clo = new LinkObject(); if(o instanceof LinkObject){ - clo.setLinkObject((LinkObject)o); - }else if(o instanceof ClientLinkObject){ - clo = (ClientLinkObject)o; + clo = (LinkObject)o; + }else if(o instanceof LinkObject){ + clo = (LinkObject)o; } clos[i] = clo; } @@ -295,31 +285,31 @@ } @Override - public Map<String, ClientBusinessObject> queryLinkedCbo( - ClientLinkObject[] clol, boolean isDirection) throws VciBaseException { + public Map<String, BusinessObject> queryLinkedCbo( + LinkObject[] clol, boolean isDirection) throws VciBaseException { return queryLinkedCbo(clol,isDirection,new ArrayList<String>()); } /***** * */ @Override - public Map<String, ClientBusinessObject> queryLinkedCbo( - ClientLinkObject[] clol, boolean isDirection,List<String> queryColumn) throws VciBaseException{ + public Map<String, BusinessObject> queryLinkedCbo( + LinkObject[] clol, boolean isDirection,List<String> queryColumn) throws VciBaseException{ Map<String/*t_oid鎴栬�協_oid*/,String/*oid*/> linkBoOidMap = new HashMap<String, String>(); Map<String,String> btmTypeOidMap = new HashMap<String, String>(); for(int i = 0 ; i < clol.length; i ++){ - ClientLinkObject clo = clol[i]; + LinkObject clo = clol[i]; if(clo!=null){ String btmType = ""; String btmOid = ""; if(isDirection){ - linkBoOidMap.put(clo.getToOid(),clo.getOid()); - btmType = clo.getToBTMName().toLowerCase().trim(); - btmOid = clo.getToOid(); + linkBoOidMap.put(clo.toOid,clo.oid); + btmType = clo.toBTName.toLowerCase().trim(); + btmOid = clo.toOid; }else{ - linkBoOidMap.put(clo.getFromOid(),clo.getOid()); - btmType = clo.getFromBTMName().toLowerCase().trim(); - btmOid = clo.getFromOid(); + linkBoOidMap.put(clo.fromOid,clo.oid); + btmType = clo.fromBTName.toLowerCase().trim(); + btmOid = clo.fromOid; } String oids = ""; if(btmTypeOidMap.containsKey(btmType)){ @@ -329,7 +319,7 @@ btmTypeOidMap.put(btmType, oids); } } - Map<String,ClientBusinessObject> linkedCboMap = new HashMap<>(); + Map<String,BusinessObject> linkedCboMap = new HashMap<>(); Iterator<String> it = btmTypeOidMap.keySet().iterator(); while(it.hasNext()){ String btmType = it.next(); @@ -346,10 +336,10 @@ } Map<String,String> conditionMap = new HashMap<>(); conditionMap.put("oid",oids); - List<ClientBusinessObject> allCbo = boService.queryCBO(btmType, conditionMap,new PageHelper(-1),clauseList); + List<BusinessObject> allCbo = boService.queryCBO(btmType, conditionMap,new PageHelper(-1),clauseList); if(allCbo.size()>0){ - for(ClientBusinessObject cbo : allCbo){ - String linkOid = linkBoOidMap.get(cbo.getOid()); + for(BusinessObject cbo : allCbo){ + String linkOid = linkBoOidMap.get(cbo.oid); linkedCboMap.put(linkOid, cbo); } } @@ -358,24 +348,24 @@ } @Override - public List<Map> clos2Map(List<ClientLinkObject> clos) throws VciBaseException { + public List<Map> clos2Map(List<LinkObject> clos) throws VciBaseException { List<Map> allMap = new ArrayList<Map>(); - for(ClientLinkObject clo : clos){ + for(LinkObject clo : clos){ allMap.add(clo2Map(clo)); } return allMap; } @Override - public Map clo2Map(ClientLinkObject clo) throws VciBaseException { + public Map clo2Map(LinkObject clo) throws VciBaseException { Map<String,String> map = new HashMap<String, String>(); WebUtil.copyValueToMapFromClos(clo, map); return map; } @Override - public List<ClientLinkObject> map2Clos(List<Map> map) throws VciBaseException { - List<ClientLinkObject> allClo = new ArrayList<ClientLinkObject>(); + public List<LinkObject> map2Clos(List<Map> map) throws VciBaseException { + List<LinkObject> allClo = new ArrayList<LinkObject>(); for(Map m : map){ allClo.add(map2Clo(m)); } @@ -383,8 +373,8 @@ } @Override - public ClientLinkObject map2Clo(Map map) throws VciBaseException { - ClientLinkObject clo = new ClientLinkObject(); + public LinkObject map2Clo(Map map) throws VciBaseException { + LinkObject clo = new LinkObject(); WebUtil.copyValueToCloFromMap(clo, map); return clo; } @@ -397,47 +387,47 @@ * @throws VciBaseException */ @Override - public List<ClientLinkObject> saveClientLinkObjects(List<ClientLinkObject> clos) throws VciBaseException { + public List<LinkObject> saveLinkObjects(List<LinkObject> clos) throws VciBaseException { if(clos == null || clos.size() == 0){ throw new VciBaseException("娌℃湁瑕佷繚瀛樼殑涓氬姟绫诲瀷鏁版嵁"); } List<LinkObject> linkObjects = new ArrayList<LinkObject>(); - for(ClientLinkObject clo : clos){ + for(LinkObject clo : clos){ //闇�瑕佺湅鐪嬪熀鏈殑淇℃伅鏄惁鏈� - if(StringUtils.isBlank(clo.getLoName())){ + if(StringUtils.isBlank(clo.ltName)){ throw new VciBaseException("閾炬帴绫诲瀷鐨勫悕绉颁负绌�"); } - if(StringUtils.isBlank(clo.getOid())){ - clo.setOid((new ObjectUtility()).getNewObjectID36()); + if(StringUtils.isBlank(clo.oid)){ + clo.oid = (new ObjectUtility()).getNewObjectID36(); } - if(StringUtils.isBlank(clo.getCreator())){ - clo.setCreator(WebUtil.getCurrentUserId()); + if(StringUtils.isBlank(clo.creator)){ + clo.creator = WebUtil.getCurrentUserId(); } - if(clo.getCreateTime() == 0){ - clo.setCreateTime(VciDateUtil.getNowTime()); + if(clo.createTime == 0){ + clo.createTime = VciDateUtil.getNowTime(); } - if(StringUtils.isBlank(clo.getLastModifier())){ - clo.setLastModifier(clo.getCreator()); + if(StringUtils.isBlank(clo.modifier)){ + clo.modifier = clo.creator; } - if(clo.getLastModifyTime() == 0){ - clo.setLastModifyTime(clo.getCreateTime()); + if(clo.modifyTime == 0){ + clo.modifyTime = clo.createTime; } - if(clo.getTs() == 0){ - clo.setTs(clo.getCreateTime()); + if(clo.ts == 0){ + clo.ts = clo.createTime; } - linkObjects.add(clo.getLinkObject()); + linkObjects.add(clo); } try { - LinkObject[] savedLinkObject = BOFactoryClient.getBOFactoryService().batchCreateLinkObject(linkObjects.toArray(new LinkObject[0])); - List<ClientLinkObject> savedClientLinkObject = new ArrayList<ClientLinkObject>(); + LinkObject[] savedLinkObject = platformClientUtil.getBOFactoryService().batchCreateLinkObject(linkObjects.toArray(new LinkObject[0])); + List<LinkObject> savedListLinkObject = new ArrayList<LinkObject>(); if(savedLinkObject != null && savedLinkObject.length > 0){ for(LinkObject linkObject : savedLinkObject){ - ClientLinkObject clo = new ClientLinkObject(); - clo.setLinkObject(linkObject); - savedClientLinkObject.add(clo); + LinkObject clo = new LinkObject(); + clo = linkObject; + savedListLinkObject.add(clo); } } - return savedClientLinkObject; + return savedListLinkObject; } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } @@ -451,13 +441,11 @@ * @throws VciBaseException */ @Override - public ClientLinkObject createClientLinkObject(String loName) throws VciBaseException { + public LinkObject createLinkObject(String loName) throws VciBaseException { WebUtil.alertNotNull(loName,"閾炬帴"); - try { - return loOperation.createLinkObject(loName,WebUtil.getCurrentUserId()); - } catch (PLException vciError) { - throw WebUtil.getVciBaseException(vciError); - } + return null; + //todo 鍦ㄥ钩鍙伴噷闈㈤渶瑕佷紶鍏ュ璞★紝鐜板湪鏄瓧绗︿覆锛岄渶瑕佺湅骞冲彴濡備綍澶勭悊 +// return loOperation.createLinkObject(loName,WebUtil.getCurrentUserId()); } /** @@ -468,9 +456,9 @@ * @throws VciBaseException */ @Override - public ClientLinkObject cloneClientLinkObject(ClientLinkObject clo) throws VciBaseException { - ClientLinkObject newClo = new ClientLinkObject(); - String JSONString = JSONObject.toJSONStringWithDateFormat(clo.getLinkObject(),VciDateUtil.DateTimeMillFormat,SerializerFeature.WriteDateUseDateFormat); + public LinkObject cloneLinkObject(LinkObject clo) throws VciBaseException { + LinkObject newClo = new LinkObject(); + String JSONString = JSONObject.toJSONStringWithDateFormat(clo,VciDateUtil.DateTimeMillFormat,SerializerFeature.WriteDateUseDateFormat); LinkObject lo = JSONObject.parseObject(JSONString,LinkObject.class); if(lo.newAttrValList == null) { lo.newAttrValList = new AttributeValue[0]; @@ -478,13 +466,13 @@ if(lo.hisAttrValList == null) { lo.hisAttrValList = new AttributeValue[0]; } - newClo.setLinkObject(lo); - newClo.setOid((new ObjectUtility()).getNewObjectID36()); - newClo.setCreator(WebUtil.getCurrentUserId()); - newClo.setCreateTime(VciDateUtil.getNowTime()); - newClo.setLastModifier(newClo.getCreator()); - newClo.setLastModifyTime(newClo.getCreateTime()); - newClo.setTs(newClo.getCreateTime()); + newClo = lo; + newClo.oid = (new ObjectUtility()).getNewObjectID36(); + newClo.creator = WebUtil.getCurrentUserId(); + newClo.createTime = VciDateUtil.getNowTime(); + newClo.modifier = newClo.creator; + newClo.modifyTime = newClo.createTime; + newClo.ts = newClo.createTime; return newClo; } @@ -495,10 +483,10 @@ * @throws VciBaseException */ @Override - public void deleteClientLinkObjects(List<ClientLinkObject> clos) throws VciBaseException { + public void deleteLinkObjects(List<LinkObject> clos) throws VciBaseException { if(clos!=null){ try { - loOperation.batchdDeleteLinkObject(clos.toArray(new ClientLinkObject[0])); + platformClientUtil.getBOFactoryService().batchDeleteLinkObject(clos.toArray(new LinkObject[0])); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } @@ -511,10 +499,10 @@ * @throws VciBaseException */ @Override - public void updateClientLinkObject(List<ClientLinkObject> clos) throws VciBaseException { + public void updateLinkObject(List<LinkObject> clos) throws VciBaseException { if(clos!=null){ try { - loOperation.batchUpdateLinkObject(clos.toArray(new ClientLinkObject[0])); + platformClientUtil.getBOFactoryService().batchUpdateLinkObject(clos.toArray(new LinkObject[0])); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } @@ -709,8 +697,8 @@ List<String> finalEnumFields = enumFields; final Integer[] total = {totalHolder.value}; Arrays.stream(linkObjects.returnValue).forEach(lo->{ - ClientLinkObject clo = new ClientLinkObject(); - clo.setLinkObject(lo); + LinkObject clo = new LinkObject(); + clo = lo; Map<String, String> map = new HashMap<>(); boService.queryEnumText(null,clo, finalEnumFields); WebUtil.copyValueToMapFromClos(clo,map); @@ -744,14 +732,14 @@ //鍒嗛〉涓嶈瓒呰繃1000 Map<String,String> boConditionMap =new HashMap<>(); boConditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oids.toArray(new String[0])) + ")"); - List<ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, fromFieldsFix); + List<BusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, fromFieldsFix); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ dataGrid.getData().forEach(data->{ Map<String, String> map = (Map<String, String>) data; - if(map.getOrDefault("f_oid","").equals(cbo.getOid())){ + if(map.getOrDefault("f_oid","").equals(cbo.oid)){ fromFieldsFix.stream().forEach(fromField->{ - map.put("f_oid." + fromField,cbo.getAttributeValue(fromField)); + map.put("f_oid." + fromField, ObjectTool.getBOAttributeValue(cbo,fromField)); }); } }); @@ -768,14 +756,14 @@ //鍒嗛〉涓嶈瓒呰繃1000 Map<String,String> boConditionMap =new HashMap<>(); boConditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oids.toArray(new String[0])) + ")"); - List<ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, toFieldsFix); + List<BusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, toFieldsFix); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ dataGrid.getData().forEach(data->{ Map<String, String> map = (Map<String, String>) data; - if(map.getOrDefault("t_oid","").equals(cbo.getOid())){ + if(map.getOrDefault("t_oid","").equals(cbo.oid)){ toFieldsFix.stream().forEach(toField->{ - map.put("t_oid." + toField,cbo.getAttributeValue(toField)); + map.put("t_oid." + toField,ObjectTool.getBOAttributeValue(cbo,toField)); }); } }); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessCommandServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessCommandServiceImpl.java index 5efa41b..5bcf33a 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessCommandServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessCommandServiceImpl.java @@ -1,11 +1,13 @@ package com.vci.web.service.impl; -import com.vci.client.bof.ClientLinkObject; import com.vci.corba.common.data.UserEntityInfo; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.corba.omd.data.LinkObject; import com.vci.corba.workflow.data.FlowInstanceInfo; import com.vci.corba.workflow.data.MapTransfersInfo; import com.vci.corba.workflow.data.TasksAssignedInfo; import com.vci.file.dto.VciFileObjectDTO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.constant.QueryOptionConstant; import com.vci.starter.web.enumpck.DataSecretEnum; import com.vci.starter.web.exception.VciBaseException; @@ -146,7 +148,7 @@ Map<String, String> conditionMap = WebUtil.getOidQuery(config.getOids()); conditionMap.put(WebBoServiceI.QUERY_FILTER_SECRET, "false"); conditionMap.put(WebBoServiceI.QUERY_FILTER_DATARIGHT, "false"); - List<com.vci.client.bof.ClientBusinessObject> allCbo = boService.queryCBO(config.getBtmType().toLowerCase().trim(), conditionMap); + List<BusinessObject> allCbo = boService.queryCBO(config.getBtmType().toLowerCase().trim(), conditionMap); if (allCbo == null || allCbo.size() == 0) { throw new VciBaseException(msgCodePrefix + "dataNotNull", new String[]{}); } @@ -154,11 +156,11 @@ //鏌ヨ鏁版嵁鏄惁宸茬粡鍙戣捣浜嗘祦绋� //鏌ヨinput杩炴帴閲屾槸涓嶆槸鏈夋祦绋嬪疄渚嬶紝骞朵笖娴佺▼瀹炰緥涓嶇瓑浜庣粓姝� conditionMap.put("oid", " in (select f_oid from platformlt_" + processDao.getTaskDataLink() + " where oid " + conditionMap.get("oid").replace("\\IN", " in ") + ")"); - List<com.vci.client.bof.ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); + List<BusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); if (workInstanceCbos != null && workInstanceCbos.size() > 0) { - for (com.vci.client.bof.ClientBusinessObject workInstance : workInstanceCbos) { - if (!workInstance.getLcStatus().equalsIgnoreCase("Obsoleted")) { - throw new VciBaseException(msgCodePrefix + "dataSubmitedToProcess", new String[]{workInstance.getName(), workInstance.getCreator()}); + for (BusinessObject workInstance : workInstanceCbos) { + if (!workInstance.lcStatus.equalsIgnoreCase("Obsoleted")) { + throw new VciBaseException(msgCodePrefix + "dataSubmitedToProcess", new String[]{workInstance.name, workInstance.creator}); } } } @@ -167,14 +169,14 @@ String[][] objectPropertyValues = new String[allCbo.size()][4]; String[] objIds = new String[allCbo.size()];//涓氬姟鏁版嵁鐨勭粍浠� for (int i = 0; i < allCbo.size(); i++) { - com.vci.client.bof.ClientBusinessObject cbo = allCbo.get(i); + BusinessObject cbo = allCbo.get(i); String[] values = new String[4]; - values[0] = cbo.getOid(); - values[1] = cbo.getRevisionid(); - values[2] = cbo.getNameoid(); - values[3] = cbo.getBtmName(); + values[0] = cbo.oid; + values[1] = cbo.revisionid; + values[2] = cbo.nameoid; + values[3] = cbo.btName; objectPropertyValues[i] = values; - objIds[i] = cbo.getOid(); + objIds[i] = cbo.oid; } FlowInstanceInfo flowInstanceInfo = new FlowInstanceInfo(); @@ -471,15 +473,15 @@ Map<String, String> conditionMap = new HashMap<String, String>(); conditionMap.put("f_btwname", processDao.getWorkitemBtmType()); conditionMap.put("f_oid", QueryOptionConstant.IN + "(" + WebUtil.toInSql(taskIds) + ")"); - List<ClientLinkObject> allLinkData = loService.queryCLO(processDao.getTaskDataLink(), conditionMap); + List<LinkObject> allLinkData = loService.queryCLO(processDao.getTaskDataLink(), conditionMap); String[][] objectPropertyValues = new String[allLinkData.size()][4]; for (int i = 0; i < allLinkData.size(); i++) { - ClientLinkObject clo = allLinkData.get(i); + LinkObject clo = allLinkData.get(i); String[] values = new String[4]; - values[0] = clo.getToOid(); - values[1] = clo.getToRevisionOid(); - values[2] = clo.getToNameOid(); - values[3] = clo.getToBTMName(); + values[0] = clo.toOid; + values[1] = clo.toRevOid; + values[2] = clo.toNameOid; + values[3] = clo.toBTName; objectPropertyValues[i] = values; } if ("鏈懡鍚嶈矾鐢�".equalsIgnoreCase(outCome)) { @@ -592,24 +594,24 @@ //鏌ヨ娴佺▼瀹炰緥 Map<String, String> conditionMap = new HashMap<String, String>(); conditionMap.put("executionid", executionId.trim() + "*");//浼氭湁瀛愭祦绋� - List<com.vci.client.bof.ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); + List<BusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); if (workInstanceCbos == null || workInstanceCbos.size() == 0) { throw new VciBaseException(msgCodePrefix + "executionNotExist"); } //鍒ゆ柇鏄惁閮芥槸鎵ц鐘舵�侊紝鍓嶇鐨勫垽鏂兘琚烦杩� - List<com.vci.client.bof.ClientBusinessObject> needUpdateCbos = new ArrayList<>(); + List<BusinessObject> needUpdateCbos = new ArrayList<>(); List<String> workInstanceOids = new ArrayList<String>(); - for (com.vci.client.bof.ClientBusinessObject cbo : workInstanceCbos) { - if (!cbo.getLcStatus().equalsIgnoreCase("Executing")) { + for (BusinessObject cbo : workInstanceCbos) { + if (!cbo.lcStatus.equalsIgnoreCase("Executing")) { throw new VciBaseException(msgCodePrefix + "processNotExecutionStatus"); } needUpdateCbos.add(cbo); - workInstanceOids.add(cbo.getAttributeValue("executionid")); + workInstanceOids.add(ObjectTool.getBOAttributeValue(cbo,"executionid")); } //鎵剧浉鍏崇殑娴佺▼浠诲姟瀵硅薄锛屽苟涓旀槸姝e湪鎵ц涓殑 conditionMap.put("executionid", QueryOptionConstant.IN + "(" + WebUtil.toInSql(workInstanceOids.toArray(new String[0])) + ")"); conditionMap.put("lcstatus", "Executing"); - List<com.vci.client.bof.ClientBusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); + List<BusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); if (workItemCbos != null && workItemCbos.size() > 0) { needUpdateCbos.addAll(workItemCbos); } @@ -632,24 +634,24 @@ //鏌ヨ娴佺▼瀹炰緥 Map<String, String> conditionMap = new HashMap<String, String>(); conditionMap.put("executionid", executionId.trim() + "*");//浼氭湁瀛愭祦绋� - List<com.vci.client.bof.ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); + List<BusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); if (workInstanceCbos == null || workInstanceCbos.size() == 0) { throw new VciBaseException(msgCodePrefix + "executionNotExist"); } //鍒ゆ柇鏄惁閮芥槸鎵ц鐘舵�侊紝鍓嶇鐨勫垽鏂兘琚烦杩� - List<com.vci.client.bof.ClientBusinessObject> needUpdateCbos = new ArrayList<>(); + List<BusinessObject> needUpdateCbos = new ArrayList<>(); List<String> workInstanceOids = new ArrayList<String>(); - for (com.vci.client.bof.ClientBusinessObject cbo : workInstanceCbos) { - if (!cbo.getLcStatus().equalsIgnoreCase("Suspended")) { + for (BusinessObject cbo : workInstanceCbos) { + if (!cbo.lcStatus.equalsIgnoreCase("Suspended")) { throw new VciBaseException(msgCodePrefix + "processNotSuspendedStatus"); } needUpdateCbos.add(cbo); - workInstanceOids.add(cbo.getOid()); + workInstanceOids.add(cbo.oid); } //鎵剧浉鍏崇殑娴佺▼浠诲姟瀵硅薄锛屽苟涓旀槸姝e湪鎵ц涓殑 conditionMap.put("executionid", QueryOptionConstant.IN + "(" + WebUtil.toInSql(workInstanceOids.toArray(new String[0])) + ")"); conditionMap.put("lcstatus", "Suspended"); - List<com.vci.client.bof.ClientBusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); + List<BusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); if (workItemCbos != null && workItemCbos.size() > 0) { needUpdateCbos.addAll(workItemCbos); } @@ -706,7 +708,7 @@ } } List<String> causeList = Arrays.asList(new String[]{primaryKeyName}); - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btmType, conditionMap, null, causeList); + List<BusinessObject> cbos = boService.queryCBO(btmType, conditionMap, null, causeList); if (cbos == null || cbos.size() == 0) { throw new VciBaseException("鍙戣捣娴佺▼鐨勪笟鍔℃暟鎹叏閮ㄤ笉绗﹀悎瑕佹眰"); } @@ -715,9 +717,9 @@ for (String oid : oidArray) { oidSet.add(oid); } - for (com.vci.client.bof.ClientBusinessObject cbo : cbos) { - if (oidSet.contains(cbo.getAttributeValue(primaryKeyName))) { - oidSet.remove(cbo.getAttributeValue(primaryKeyName)); + for (BusinessObject cbo : cbos) { + if (oidSet.contains(ObjectTool.getBOAttributeValue(cbo,primaryKeyName))) { + oidSet.remove(ObjectTool.getBOAttributeValue(cbo,primaryKeyName)); } } if (oidSet.size() > 0) { diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessDefineServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessDefineServiceImpl.java index 77b29f6..f0721d5 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessDefineServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebProcessDefineServiceImpl.java @@ -1,7 +1,6 @@ package com.vci.web.service.impl; -import com.vci.client.bof.ClientLinkObject; -import com.vci.client.workflow.editor.FlowConstants; +import com.vci.corba.omd.data.LinkObject; import com.vci.file.pagemodel.VciFileObjectVO; import com.vci.frameworkcore.compatibility.OrgDeptQueryServiceI; import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI; @@ -23,6 +22,7 @@ import com.vci.web.pageModel.*; import com.vci.web.properties.WebProperties; import com.vci.web.service.*; +import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; import org.dom4j.Document; @@ -60,6 +60,9 @@ @Autowired private WebProcessCommandServiceI proCmdService; + + @Autowired + private PlatformClientUtil platformClientUtil; /** * 涓氬姟鏁版嵁鏈嶅姟 @@ -440,14 +443,14 @@ map.put("detailUrl",detailUrl== null?"":detailUrl); map.put("UIContentCode",UIContent); //澧炲姞鏌ヨ鍏宠仈鐨勪笟鍔℃暟鎹� - List<ClientLinkObject> linkObjects = processDao.getDataCloInTask("",executionid); + List<LinkObject> linkObjects = processDao.getDataCloInTask("",executionid); StringBuilder sb = new StringBuilder(); String thisBusinessOid = ""; if(linkObjects!=null && linkObjects.size()>0){ Set<String> oidSet = new HashSet<String>(); //鍘婚櫎閲嶅 - for(ClientLinkObject clo : linkObjects){ - oidSet.add(clo.getToOid()); + for(LinkObject clo : linkObjects){ + oidSet.add(clo.toOid); } for(String oidString : oidSet) { sb.append(oidString).append(","); @@ -480,11 +483,12 @@ } for (Iterator<?> a = root.elementIterator(); a.hasNext();) { Element next = (Element) a.next(); - String cellName = next.attributeValue(FlowConstants.XMLNAME); - if(cellName != null && cellName.equals(name)) { - map.put("customerbuttoninfo",next.attributeValue(FlowConstants.URL_PATH)); - break; - } + //todo FlowConstants姝ゅ崰鏃犳硶寮曠敤锛屽悗缁細杩涜璋冩暣锛屽啀杩涜寮曠敤 +// String cellName = next.attributeValue(FlowConstants.XMLNAME); +// if(cellName != null && cellName.equals(name)) { +// map.put("customerbuttoninfo",next.attributeValue(FlowConstants.URL_PATH)); +// break; +// } } }catch (Exception e) { throw new VciBaseException("璇诲彇娴佺▼鐨剎ml鍐呭鍑虹幇浜嗛敊璇�"); @@ -644,19 +648,19 @@ */ @Override public DataGrid getFilesInProcess(Map<String, String> conditionMap, String taskOid, String executionId,PageHelper pageHelper) throws VciBaseException{ - List<ClientLinkObject> cloByTask = processDao.getDataCloInTask(taskOid,executionId); + List<LinkObject> cloByTask = processDao.getDataCloInTask(taskOid,executionId); if(cloByTask == null || cloByTask.size() == 0){ throw new VciBaseException("娌℃湁鍏宠仈鐨勪笟鍔℃暟鎹�"); } Map<String,List<String>> busOid_btmMap = new HashMap<String, List<String>>(); Set<String> fileOidSet = new HashSet(); - for(ClientLinkObject clo:cloByTask){ - if(FileTypeConstants.FILE_DATA_TABLE.equals(clo.getToBTMName())){ - fileOidSet.add(clo.getToOid()); + for(LinkObject clo:cloByTask){ + if(FileTypeConstants.FILE_DATA_TABLE.equals(clo.toBTName)){ + fileOidSet.add(clo.toOid); }else { - List<String> thisBtmOids = busOid_btmMap.getOrDefault(clo.getToBTMName(),new ArrayList<>()); - thisBtmOids.add(clo.getToOid()); - busOid_btmMap.put(clo.getToBTMName(), thisBtmOids); + List<String> thisBtmOids = busOid_btmMap.getOrDefault(clo.toBTName,new ArrayList<>()); + thisBtmOids.add(clo.toOid); + busOid_btmMap.put(clo.toBTName, thisBtmOids); } } DataGrid dg = new DataGrid(); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebSecretServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebSecretServiceImpl.java index 76e99b9..7e3d5d5 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebSecretServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebSecretServiceImpl.java @@ -1,7 +1,9 @@ package com.vci.web.service.impl; +import com.vci.corba.omd.data.BusinessObject; import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; import com.vci.frameworkcore.pagemodel.SmUserVO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.web.enumpck.DataSecretEnum; import com.vci.starter.web.enumpck.UserSecretEnum; import com.vci.starter.web.exception.VciBaseException; @@ -314,10 +316,10 @@ Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("startip",ip.trim()); - List<com.vci.client.bof.ClientBusinessObject> ipCbos = boService.queryCBO(EnumIdConstant.IPSECRET_BTMNAME,conditionMap,null, Arrays.asList(new String[]{"ipsecret"})); + List<BusinessObject> ipCbos = boService.queryCBO(EnumIdConstant.IPSECRET_BTMNAME,conditionMap,null, Arrays.asList(new String[]{"ipsecret"})); int ipSecret = 0; if(ipCbos!=null&& ipCbos.size()>0){ - ipSecret = WebUtil.getInt(ipCbos.get(0).getAttributeValue("ipsecret")); + ipSecret = WebUtil.getInt(ObjectTool.getBOAttributeValue(ipCbos.get(0), "ipsecret")); } if(ipSecret == 0){ ipSecret = getMinIpSecret(); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/RightControlUtil.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/RightControlUtil.java new file mode 100644 index 0000000..7403ec3 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/RightControlUtil.java @@ -0,0 +1,267 @@ +package com.vci.web.util; +import com.vci.client.common.objects.RoleObject; +import com.vci.common.exception.VciException; +import com.vci.corba.common.PLException; +import com.vci.corba.framework.data.FunctionInfo; +import com.vci.corba.framework.data.RoleInfo; +import com.vci.corba.framework.data.RoleRightInfo; +import com.vci.starter.web.pagemodel.SessionInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +@Slf4j +@Component +public class RightControlUtil { + + + @Resource + private PlatformClientUtil platformClientUtil; + + // add by xchao 2012.09.20 缁熶竴褰掓暣绠$悊鍛樸�佸紑鍙戣�呯敤鎴峰垽鏂� + // 浠ヤ究灏嗘潵鏈夊彲鑳戒慨鏀圭鐞嗗憳銆佸紑鍙戣�呯敤鎴凤紝瀵逛簬鍒ゆ柇渚濈劧鏈夋晥 + private static String userAdminEnum = "user.admin"; + private String userNameAdmin = null; + private static String userDeveloperEnum = "user.developer"; + private String userNameDeveloper = null; + private String userNameRoot = null; + private static String userRootEnum = "user.rooter"; + public boolean isAdmin(String userName){ + return userName.equals(getUserNameAdmin(userAdminEnum)); + } + + public boolean isDeveloper(String userName){ + return userName.equals(getUserNameDeveloper(userDeveloperEnum)); + } + + public boolean isRoot(String userName){ + return userName.equals(getUserNameRoot(userRootEnum)); + } + + /** + * 鏄惁涓虹鐞嗗憳銆佸紑鍙戣�呯敤鎴� + * @param userName 鐧诲綍鐢ㄦ埛鍚� + * @return 鍒ゆ柇缁撴灉 + */ + public boolean isAdminOrDeveloperOrRoot(String userName){ + return isAdmin(userName) || isDeveloper(userName)||isRoot(userName); + } + + /** + * 鑾峰彇閰嶇疆鐨勭鐞嗗憳 + * @param key 閰嶇疆key + * @return 绠$悊鍛樿处鍙� + */ + public String getUserNameAdmin(String key) { + if (userNameAdmin == null) { + synchronized (RightControlUtil.class) { + if (userNameAdmin == null) { + try { + userNameAdmin = platformClientUtil.getFrameworkService().getConfigValue(key); + }catch (PLException e){ + log.error(e.code, e.messages); + } + } + } + } + return userNameAdmin; + } + /** + * 鑾峰彇閰嶇疆鐨勫紑鍙戜汉鍛� + * @param key 閰嶇疆key + * @return 寮�鍙戜汉鍛樿处鍙� + */ + public String getUserNameDeveloper(String key) { + if (userNameDeveloper == null) { + synchronized (RightControlUtil.class) { + if (userNameDeveloper == null) { + try { + userNameDeveloper = platformClientUtil.getFrameworkService().getConfigValue(key); + }catch (PLException e){ + log.error(e.code, e.messages); + } + } + } + } + return userNameDeveloper; + } + + /** + * 鑾峰彇閰嶇疆鐨勭鐞嗗憳 + * @param key 閰嶇疆key + * @return 绠$悊鍛樿处鍙� + */ + public String getUserNameRoot(String key) { + if (userNameRoot == null) { + synchronized (RightControlUtil.class) { + if (userNameRoot == null) { + try { + userNameRoot = platformClientUtil.getFrameworkService().getConfigValue(key); + }catch (PLException e){ + log.error(e.code, e.messages); + } + } + } + } + return userNameRoot; + } + + /** + * 鍒ゆ柇褰撳墠鏄惁涓轰笁鍏冪敤鎴� + * @return + */ + public boolean isThreeAdminCurUser() { + SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException(); + try { + RoleInfo[] roles = platformClientUtil.getFrameworkService().fetchRoleInfoByUserId(sessionInfo.getUserId()); + for (RoleInfo role : roles) { + if (role.name.equalsIgnoreCase("绯荤粺绠$悊鍛�")){ + return true; + } + else if (role.name.equalsIgnoreCase("瀹夊叏绠$悊鍛�")){ + return true; + } + else if (role.name.equalsIgnoreCase("瀹¤绠$悊鍛�")){ + return true; + } + } + } catch (PLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return false; + } + + /** + * 鑾峰彇褰撳墠鐢ㄦ埛鐨勬潈闄� + * @param userName + * @return + */ + public RoleRightInfo[] getRoleRightByUserName(String userName){ + RoleRightInfo[] roleRightByUserName = new RoleRightInfo[0]; + try { + roleRightByUserName = platformClientUtil.getFrameworkService().getRoleRightByUserName(userName); + } catch (PLException e) { + e.printStackTrace(); + log.error(e.code,e.messages); + } + return roleRightByUserName; + } + + + /** + * 鑾峰彇褰撳墠鐢ㄦ埛鍏锋湁鏉冮檺鐨勬墍鏈夋ā鍧� + * @param parentId, 鐖舵ā鍧梚d + * @param userName锛� 鐢ㄦ埛鍚� + * @param userRoleRights, 褰撳墠鐢ㄦ埛鍏锋湁鐨勬潈闄� + * @return + */ + public Map<String, List<FunctionInfo>> getAllChildrenFunctionsByUserName(String parentId, String userName, RoleRightInfo[] userRoleRights) { + Map<String, List<RoleRightInfo>> mapRight = new LinkedHashMap<String, List<RoleRightInfo>>(); + for (int i = 0; i < userRoleRights.length; i++) { + RoleRightInfo right = userRoleRights[i]; + + List<RoleRightInfo> lstRight = null; + if (mapRight.containsKey(right.funcId)) { + lstRight = mapRight.get(right.funcId); + } else { + lstRight = new ArrayList<RoleRightInfo>(); + } + lstRight.add(right); + mapRight.put(right.funcId, lstRight); + } + + FunctionInfo[] AllFunction = getFunctionsByParentId(parentId, userName); + Map<String, List<FunctionInfo>> map = new LinkedHashMap<String, List<FunctionInfo>>(); + boolean isAllShow = isDeveloper(userName) || isAdmin(userName) || !isFunctionSwithOn(); + boolean isHasRight = false; + FunctionInfo func; + for (int i = 0; i < AllFunction.length; i++) { + func = AllFunction[i]; + //System.out.println("=== FUNC:ID=" + func.getId()+ " ParentID=" + func.getParentId() + "; Name=" + func.getName()); + isHasRight = false; + if (isAllShow) { + isHasRight = true; + } else { + List<RoleRightInfo> lstRight = null; + if (mapRight.containsKey(func.id)) { + lstRight = mapRight.get(func.id); + //System.out.println(" === 鏈夋巿鏉冧俊鎭�"); + } + + if (lstRight == null) + isHasRight = false; + else{ + if (lstRight.size() > 0) + isHasRight = true; +// for (int j = 0; j < lstRight.size(); j++) { +// long lRight = lstRight.get(j).getRightValue(); +// if (lRight != 0){ +// isHasRight = true; +// //System.out.println(" === 鏈夋巿鏉�"); +// +// break; +// } +// } + } + } + + if (!isHasRight) { + continue; + } + String cparentId = func.parentId; + + //System.out.println("####==== ParentId=" + cparentId + "; Func=" + func.getName()); + List<FunctionInfo> lstFunc = null; + if (map.containsKey(cparentId)) { + lstFunc = map.get(cparentId); + } else { + lstFunc = new ArrayList<FunctionInfo>(); + } + lstFunc.add(func); + map.put(cparentId, lstFunc); + } + return map; + } + + + public FunctionInfo[] getFunctionsByParentId(String parentId, String userName) { + + FunctionInfo[] funcObjs = null; + try { + if(isDeveloper(userName)){ + funcObjs = platformClientUtil.getFrameworkService().getChildrenFunctionsByParentId(parentId, true); + } else { + funcObjs = platformClientUtil.getFrameworkService().getChildrenFunctionsByParentId(parentId, false); + } + } catch (PLException e) { + e.printStackTrace(); + log.error(e.code, e.messages); + } + return funcObjs; + } + + /** + * 鍒ゆ柇鍔熻兘鏉冮檺鏄惁寮�鍚� + * @return + */ + public boolean isFunctionSwithOn() { + String functionRightSwith = null; + try { + functionRightSwith = platformClientUtil.getFrameworkService().getConfigValue("function.right.swith"); + } catch (PLException e) { + e.printStackTrace(); + log.error(e.code, e.messages); + } + if(functionRightSwith != null && "on".equalsIgnoreCase(functionRightSwith)){ + return true; + } + + return false; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/WebUtil.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/WebUtil.java index 6dbfdcb..cd11d1d 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/WebUtil.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/WebUtil.java @@ -2,8 +2,6 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; -import com.vci.client.bof.ClientBusinessObject; -import com.vci.client.bof.ClientLinkObject; import com.vci.client.common.objects.UserEntityObject; import com.vci.common.exception.VciException; import com.vci.corba.common.PLException; @@ -11,6 +9,7 @@ import com.vci.corba.omd.data.AttributeValue; import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.data.LinkObject; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.revision.bo.TreeWrapperOptions; import com.vci.starter.web.annotation.*; import com.vci.starter.web.constant.QueryOptionConstant; @@ -1078,9 +1077,9 @@ * @param cbo 涓氬姟鏁版嵁 * @param obj 瀵硅薄 */ - public static void copyValueToObjectFromCbos(com.vci.client.bof.ClientBusinessObject cbo,Object obj){ + public static void copyValueToObjectFromCbos(BusinessObject cbo,Object obj){ if(cbo!=null){ - copyValueToObjectFromBos(cbo.getBusinessObject(),obj); + copyValueToObjectFromBos(cbo,obj); } } @@ -1090,9 +1089,9 @@ * @param obj 瀵硅薄 * @param fieldAttrMap 灞炴�ф槧灏� */ - public static void copyValueToObjectFromCbos(com.vci.client.bof.ClientBusinessObject cbo,Object obj,Map<String,String> fieldAttrMap){ + public static void copyValueToObjectFromCbos(BusinessObject cbo,Object obj,Map<String,String> fieldAttrMap){ if(cbo!=null){ - copyValueToObjectFromBos(cbo.getBusinessObject(),obj,fieldAttrMap); + copyValueToObjectFromBos(cbo,obj,fieldAttrMap); } } @@ -1218,9 +1217,9 @@ * @param cbo 涓氬姟鏁版嵁 * @param map map */ - public static void copyValueToMapFromCbos(com.vci.client.bof.ClientBusinessObject cbo,Map<String,String> map){ + public static void copyValueToMapFromCbos(BusinessObject cbo,Map<String,String> map){ if(cbo!=null){ - copyValueToMapFromBos(cbo.getBusinessObject(),map); + copyValueToMapFromBos(cbo,map); } } @@ -1256,9 +1255,9 @@ * @param clo 閾炬帴绫诲瀷 * @param map map */ - public static void copyValueToMapFromClos(com.vci.client.bof.ClientLinkObject clo,Map<String,String> map){ + public static void copyValueToMapFromClos(LinkObject clo,Map<String,String> map){ if(clo!=null){ - copyValueToMapFromLos(clo.getLinkObject(),map); + copyValueToMapFromLos(clo,map); } } @@ -1297,9 +1296,9 @@ * @param obj 瀵硅薄 * @param fieldAttrMap 灞炴�ap */ - public static void copyValueToObjectFromClos(ClientLinkObject clo,Object obj,Map<String,String> fieldAttrMap){ + public static void copyValueToObjectFromClos(LinkObject clo,Object obj,Map<String,String> fieldAttrMap){ if(clo!=null){ - copyValueToObjectFromLos(clo.getLinkObject(),obj,fieldAttrMap); + copyValueToObjectFromLos(clo,obj,fieldAttrMap); } } @@ -1351,7 +1350,7 @@ * @param cbo 閾炬帴绫诲瀷 * @param map 瀵硅薄 */ - public static void copyValueToCboFromMap(com.vci.client.bof.ClientBusinessObject cbo,Map<String,String> map) throws VciBaseException{ + public static void copyValueToCboFromMap(BusinessObject cbo,Map<String,String> map) throws VciBaseException{ if(map!=null){ Iterator<String> it = map.keySet().iterator(); while(it.hasNext()){ @@ -1360,15 +1359,11 @@ if(value == null){ value = ""; } - try { - if(isDefaultField(key)){ - setValueToField(key, cbo, value); - } - cbo.setAttributeValueWithNoCheck(key.toLowerCase(), value); - } catch (PLException e) { - throw WebUtil.getVciBaseException(e); - } - } + if(isDefaultField(key)){ + setValueToField(key, cbo, value); + } + ObjectTool.setBOAttributeValue(cbo,key.toLowerCase(), value); + } } } @@ -1377,7 +1372,7 @@ * @param clo 閾炬帴绫诲瀷 * @param map 瀵硅薄 */ - public static void copyValueToCloFromMap(ClientLinkObject clo,Map<String,String> map) throws VciBaseException{ + public static void copyValueToCloFromMap(LinkObject clo,Map<String,String> map) throws VciBaseException{ if(map!=null){ Iterator<String> it = map.keySet().iterator(); while(it.hasNext()){ @@ -1386,16 +1381,12 @@ if(value == null){ value = ""; } - try { - if(isDefaultField(key)){ - setValueToField(key, clo, value); - }else { - clo.setAttributeValue(key.toLowerCase(), value); - } - } catch (PLException e) { - throw WebUtil.getVciBaseException(e); - } - } + if(isDefaultField(key)){ + setValueToField(key, clo, value); + }else { + ObjectTool.setLOAttributeValue(clo,key.toLowerCase(), value); + } + } } } @@ -1406,10 +1397,10 @@ * @throws VciBaseException 鎷疯礉鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ public static void copyValueToBoFromObj(BusinessObject bo,Object obj) throws VciBaseException{ - ClientBusinessObject cbo = new ClientBusinessObject(); - cbo.setBusinessObject(bo); + BusinessObject cbo = new BusinessObject(); + cbo = bo; copyValueToCboFromObj(cbo,obj); - bo = cbo.getBusinessObject(); + bo = cbo; } /** @@ -1418,7 +1409,7 @@ * @param obj 鏁版嵁瀵硅薄 * @throws VciBaseException 鎷疯礉鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 */ - public static void copyValueToCboFromObj(ClientBusinessObject cbo ,Object obj) throws VciBaseException{ + public static void copyValueToCboFromObj(BusinessObject cbo ,Object obj) throws VciBaseException{ Map<String,String> fieldMap = getFieldNameMap(obj.getClass());//鍏堟煡鎵炬墍鏈夐渶瑕佹寔涔呭寲鍒板钩鍙扮殑灞炴�э紝涓嶉渶瑕佹寔涔呭寲鐨勫氨涓嶇敤璧嬪�间簡 Iterator<String> it = fieldMap.keySet().iterator(); while(it.hasNext()){ @@ -1430,15 +1421,11 @@ if(value==null){ value = ""; } - try { - if(isDefaultField(fieldName)){ - setValueToField(fieldName, cbo, value); - } - cbo.setAttributeValue(attrName.toLowerCase(), value); - } catch (PLException e) { - throw WebUtil.getVciBaseException(e); - } - } + if(isDefaultField(fieldName)){ + setValueToField(fieldName, cbo, value); + } + ObjectTool.setBOAttributeValue(cbo,attrName.toLowerCase(), value); + } } } @@ -1665,19 +1652,19 @@ * @param wrapperOptions 灏佽鐨勪俊鎭� * @return 鏍戝垪琛� */ - public static <T,R> List<Tree> cboList2Trees(List<? extends com.vci.client.bof.ClientBusinessObject> doList, TreeWrapperOptions wrapperOptions, Function<T,R> f){ + public static <T,R> List<Tree> cboList2Trees(List<? extends BusinessObject> doList, TreeWrapperOptions wrapperOptions, Function<T,R> f){ if(CollectionUtils.isEmpty(doList)){ return new ArrayList<>(); } List<Tree> allTree = new ArrayList<Tree>(); List<Tree> children = new ArrayList<Tree>(); for (int i = 0 ; i < doList.size();i++) { - com.vci.client.bof.ClientBusinessObject cbo = doList.get(i); + BusinessObject cbo = doList.get(i); Tree tree =new Tree(); List<String> oidFieldNames = VciBaseUtil.str2List(wrapperOptions.getOidFieldName()); List<String> oidValues = new LinkedList<>(); oidFieldNames.stream().forEach( s->{ - oidValues.add(cbo.getAttributeValue(s)); + oidValues.add(ObjectTool.getBOAttributeValue(cbo, s)); }); tree.setOid(oidValues.stream().collect(Collectors.joining(wrapperOptions.getOidValueSep()))); if(f !=null){ @@ -1686,12 +1673,12 @@ List<String> textFieldNames = VciBaseUtil.str2List(wrapperOptions.getTextFieldName()); List<String> textValues = new LinkedList<>(); textFieldNames.stream().forEach( s->{ - textValues.add(cbo.getAttributeValue(s)); + textValues.add(ObjectTool.getBOAttributeValue(cbo, s)); }); tree.setText(textValues.stream().collect(Collectors.joining(wrapperOptions.getTextValueSep()))); } if(StringUtils.isNotBlank(wrapperOptions.getParentFieldName())){ - tree.setParentId(cbo.getAttributeValue(wrapperOptions.getParentFieldName())); + tree.setParentId(ObjectTool.getBOAttributeValue(cbo, wrapperOptions.getParentFieldName())); } if(wrapperOptions.isAllAttributes()) { try { @@ -1735,23 +1722,23 @@ return allTree; } - public static com.vci.client.bof.ClientBusinessObject arryAndSqlToClientBusinessObject(String sqlStr,String[] valueArry) { - com.vci.client.bof.ClientBusinessObject clientBusinessObject = new com.vci.client.bof.ClientBusinessObject(); + public static BusinessObject arryAndSqlToBusinessObject(String sqlStr,String[] valueArry) { + BusinessObject BusinessObject = new BusinessObject(); try { PlainSelect select = (PlainSelect) CCJSqlParserUtil.parse(sqlStr); - com.vci.corba.omd.data.AttributeValue[] attributeValues = new com.vci.corba.omd.data.AttributeValue[valueArry.length]; + AttributeValue[] attributeValues = new AttributeValue[valueArry.length]; for (int i = 0; i < select.getSelectItems().size(); i++) { SelectItem selectItem = select.getSelectItem(i); - com.vci.corba.omd.data.AttributeValue attributeValue = new com.vci.corba.omd.data.AttributeValue(); + AttributeValue attributeValue = new AttributeValue(); attributeValue.attrName = selectItem.getAlias().getName(); attributeValue.attrVal = valueArry[i]; attributeValues[i] = attributeValue; } - clientBusinessObject.getBusinessObject().newAttrValList= attributeValues; + BusinessObject.newAttrValList= attributeValues; }catch (Exception e){ logger.error("鏁版嵁瑙f瀽閿欒",e); return null; } - return clientBusinessObject; + return BusinessObject; } } -- Gitblit v1.9.3