| | |
| | | lcStatus = treeQueryObject.getConditionMap().getOrDefault("lcStatus",null); |
| | | } |
| | | if(StringUtils.isNotBlank(id) || StringUtils.isNotBlank(lcStatus) ){ |
| | | String tableName = VciBaseUtil.getTableName(treeQueryObject.getConditionMap().get("btmTypeId"),true); |
| | | String tableName = this.getTableName(treeQueryObject.getConditionMap().get("btmTypeId"),treeQueryObject.getConditionMap().get("id"), treeQueryObject.getConditionMap().get("lcStatus")); |
| | | doList = codeClassifyMapper |
| | | .selectCodeClassifyDOByTree( |
| | | treeQueryObject.getConditionMap().get("id"), |
| | |
| | | VciBaseUtil.checkAdminTenant() ? null:AuthUtil.getTenantId(), |
| | | tableName |
| | | ); |
| | | // 证明是查顶层节点 |
| | | if(StringUtils.isNotBlank(id)){ |
| | | // 有时候查询total过慢会导致无法加载,现在修改查询总数为连表查询但是就导致顶层节点无法查询出总数 |
| | | String total = commonsMapper.selectCountByTableName(tableName); |
| | | doList.get(0).setTotal(total); |
| | | } |
| | | }else{ |
| | | // 只要前端会传参数过来就不会出现走这句的情况,所以查询总数没在这儿添加 |
| | | doList =codeClassifyMapper.selectCodeClassifyVOByTree( |
| | |
| | | } |
| | | |
| | | /** |
| | | * 分类加载时获取业务类型id,拼接业务类型表名 |
| | | * @return |
| | | */ |
| | | private String getTableName(String btmTypeId,String id,String lcStatus){ |
| | | if(Func.isNotEmpty(btmTypeId)){ |
| | | return VciBaseUtil.getTableName(btmTypeId,true); |
| | | } |
| | | LambdaQueryWrapper<CodeClassify> wrapper = Wrappers.<CodeClassify>query() |
| | | .lambda().select(CodeClassify::getBtmTypeId) |
| | | .eq(CodeClassify::getLcStatus, lcStatus) |
| | | .isNotNull(CodeClassify::getBtmTypeId) |
| | | .last("limit 1") |
| | | .eq(CodeClassify::getId,id).isNull(CodeClassify::getParentCodeClassifyOid); |
| | | |
| | | CodeClassify codeClassify = codeClassifyMapper.selectOne(wrapper); |
| | | if(Func.isEmpty(codeClassify) || Func.isEmpty(codeClassify.getBtmTypeId())){ |
| | | throw new ServiceException("查询主数据总数时,未获取到业务类型ID!"); |
| | | } |
| | | return VciBaseUtil.getTableName(codeClassify.getBtmTypeId(),true); |
| | | } |
| | | |
| | | /** |
| | | * 根据树形查询对象来查询数据对象 |
| | | * |
| | | * @param treeQueryObject 树形查询对象 |