From d5ffec728c333461b466ba5761616f90076117e5 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期五, 19 四月 2024 17:57:04 +0800
Subject: [PATCH] 1、主要完成对一些基础类的替换,将以前老的bean对象换成新平台的bean对象。 2、对树的查询接口进行修改测试联调。 3、对列表数据的查询接口进行修改测试联调。 4、对通用保存接口进行编写测试。

---
 Source/platformProject/vci-platform-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 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..ea0a8c4 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,6 +1,8 @@
 package com.vci.frameworkcore.compatibility.impl;
 
+import com.vci.client.common.providers.ServiceProvider;
 import com.vci.corba.common.VCIError;
+import com.vci.corba.omd.data.AttributeValue;
 import com.vci.frameworkcore.compatibility.SmUserQueryServiceI;
 import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO;
 import com.vci.frameworkcore.pagemodel.SmUserVO;
@@ -21,8 +23,6 @@
 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;
@@ -35,6 +35,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 +90,7 @@
 	@Autowired(required = false)
 	@Lazy
 	private SmUserQueryServiceI self;
-	
+
 	/**
      *  鏍规嵁鐢ㄦ埛鍚嶈幏鍙栫敤鎴风殑瀵硅薄锛屼笉鍖哄垎澶у皬鍐�
      * @param userId 鐢ㄦ埛鍚�
@@ -121,10 +122,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 +153,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 +234,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 +248,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 +302,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 +618,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 +648,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 +691,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)){

--
Gitblit v1.9.3