From 93f7335e1a52591662d5d37f41ac352860b2ca2a Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期二, 04 六月 2024 18:39:50 +0800 Subject: [PATCH] 1、对象引用改动。 --- Source/platformProject/vci-platform-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java | 44 +++++++++++++++++++++++--------------------- 1 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Source/platformProject/vci-platform-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java b/Source/platformProject/vci-platform-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java index 6abf11a..fe1f8a3 100644 --- a/Source/platformProject/vci-platform-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java +++ b/Source/platformProject/vci-platform-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java @@ -1,10 +1,10 @@ package com.vci.frameworkcore.compatibility.impl; -import com.vci.corba.common.VCIError; +import com.vci.client.common.providers.ServiceProvider; +import com.vci.corba.common.PLException; import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO; import com.vci.frameworkcore.pagemodel.SmUserVO; -import com.vci.rmip.allcommon.ThreeDES; import com.vci.starter.web.enumpck.BooleanEnum; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; @@ -21,13 +21,10 @@ import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import plm.bs.bom.clientobject.ClientBusinessObject; import java.util.*; import java.util.stream.Collectors; @@ -35,6 +32,7 @@ import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; import static com.vci.web.constant.CacheNameConstant.VCI_OBJECT_SERVICE; import static com.vci.web.constant.CacheNameConstant.VCI_USER; +import static com.vci.web.util.WebUtil.arryAndSqlToClientBusinessObject; /** * 鐢ㄦ埛鐨勬煡璇㈢浉鍏崇殑鏈嶅姟锛屽彲浠ュ吋瀹硅�佸钩鍙板拰鑰佺殑pdm @@ -89,7 +87,7 @@ @Autowired(required = false) @Lazy private SmUserQueryServiceI self; - + /** * 鏍规嵁鐢ㄦ埛鍚嶈幏鍙栫敤鎴风殑瀵硅薄锛屼笉鍖哄垎澶у皬鍐� * @param userId 鐢ㄦ埛鍚� @@ -121,10 +119,14 @@ + " 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<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); - if(!CollectionUtils.isEmpty(dataList)){ - ClientBusinessObject cbo = dataList.get(0); - return cbo2VO(cbo); + try{ + String[][] sqlQueryResult = ServiceProvider.getBOFService().getSqlQueryResult(sql + fromSql, null); + if(sqlQueryResult.length>0){ + com.vci.client.bof.ClientBusinessObject cbo = arryAndSqlToClientBusinessObject(queryWrapper.getSelectFieldSql(),sqlQueryResult[0]); + return cbo2VO(cbo); + } + }catch (Exception e){ + throw new VciBaseException("鏁版嵁瑙f瀽閿欒:" + e ); } return null; } @@ -148,7 +150,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<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); + List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ userVOList.add(cbo2VO(cbo)); @@ -229,7 +231,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<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); + List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ userVOList.add(cbo2VO(cbo)); @@ -243,7 +245,7 @@ * @param cbo 涓氬姟鏁版嵁 * @return 鏄剧ず瀵硅薄 */ - private SmUserVO cbo2VO(ClientBusinessObject cbo){ + private SmUserVO cbo2VO(com.vci.client.bof.ClientBusinessObject cbo){ SmUserDO userDO = new SmUserDO(); SmUserVO userVO = new SmUserVO(); WebUtil.copyValueToObjectFromCbos(cbo,userDO); @@ -297,7 +299,7 @@ } } } - List<ClientBusinessObject> dataList = boService.queryBySql((isPage?("select " + pageSelectList.stream().collect(Collectors.joining(","))+ " from (select A.*,rownum RN from ( "):"") + sql + fromSql + (isPage?pageSubfix:""), null); + 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); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ userVOList.add(cbo2VO(cbo)); @@ -613,7 +615,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<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); + List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); List<Tree> treeList = new ArrayList<>(); if(!CollectionUtils.isEmpty(dataList)){ dataList.stream().forEach(cbo->{ @@ -643,7 +645,7 @@ String sql = " select plpassword from pluser where pluid = :userOid"; Map<String,String> conditionMap = new HashMap<>(); conditionMap.put("userOid",userOid.trim()); - List<ClientBusinessObject> clientBusinessObjectList = boService.queryBySql(sql, conditionMap); + List<com.vci.client.bof.ClientBusinessObject> clientBusinessObjectList = boService.queryBySql(sql, conditionMap); if(CollectionUtils.isEmpty(clientBusinessObjectList)){ return false; } @@ -686,7 +688,7 @@ public SmPasswordStrategyVO getPasswordStrategyVOByOid(String oid){ VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class); queryWrapperForDO.eq("oid",oid.trim()); - List<ClientBusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " + + List<com.vci.client.bof.ClientBusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " + queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() + (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null); if(!CollectionUtils.isEmpty(cboList)){ @@ -748,7 +750,7 @@ String sql = "update pllogoninfo set plwrongnum = 0 where pluserid in (select pluid from pluser where plusername='" + userId + "')"; try { platformClientUtil.getBOFactoryService().executeUpdateSql(sql); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -771,7 +773,7 @@ String sql = "update pluser set plpassword = '" + encPassword + "' where pluid = '" + userOid.trim() + "'"; try { platformClientUtil.getBOFactoryService().executeUpdateSql(sql); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -788,7 +790,7 @@ String sql = "update pllogoninfo set plwrongnum = " + wrongCount +" where pluserid ='" + userOid + "'"; try { platformClientUtil.getBOFactoryService().executeUpdateSql(sql); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -803,7 +805,7 @@ String sql = "update pllogoninfo set pllogontime = sysdate where pluserid ='" + userOid + "'"; try { platformClientUtil.getBOFactoryService().executeUpdateSql(sql); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } -- Gitblit v1.9.3