| | |
| | | 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; |
| | |
| | | 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 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 |
| | |
| | | @Autowired(required = false) |
| | | @Lazy |
| | | private SmUserQueryServiceI self; |
| | | |
| | | |
| | | /** |
| | | * 根据用户名获取用户的对象,不区分大小写 |
| | | * @param userId 用户名 |
| | |
| | | + " 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("数据解析错误:" + e ); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | + " 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)); |
| | |
| | | + " 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)); |
| | |
| | | * @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); |
| | |
| | | } |
| | | } |
| | | } |
| | | 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)); |
| | |
| | | + " 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->{ |
| | |
| | | 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; |
| | | } |
| | |
| | | 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)){ |