mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
处理组织分页接口异常
This commit is contained in:
+9
-4
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.organ;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
@@ -26,10 +27,7 @@ import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
@@ -109,6 +107,9 @@ public class OrganController {
|
||||
@PreAuthorize("@ss.hasPermission('system:organ:query')")
|
||||
public CommonResult<PageResult<OrganRespVO>> getOrganPage(@Valid OrganPageReqVO pageVO) {
|
||||
PageResult<OrganizationDO> pageResult = organService.getOrganPage(pageVO);
|
||||
if(CollectionUtil.isEmpty(pageResult.getList())) {
|
||||
return success(new PageResult<>());
|
||||
}
|
||||
PageResult<OrganRespVO> bean = BeanUtils.toBean(pageResult, OrganRespVO.class);
|
||||
Set<Long> packageIds = bean.getList().stream().map(OrganRespVO::getPackageId).collect(Collectors.toSet());
|
||||
List<TenantPackageDO> tenantPackageDOS = tenantPackageMapper.selectBatchIds(packageIds);
|
||||
@@ -131,6 +132,10 @@ public class OrganController {
|
||||
HttpServletResponse response) throws IOException {
|
||||
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OrganizationDO> list = organService.getOrganPage(exportReqVO).getList();
|
||||
if(CollectionUtil.isEmpty(list)) {
|
||||
ExcelUtils.write(response, "组织.xls", "数据", OrganExportRespVO.class, new ArrayList<>());
|
||||
return;
|
||||
}
|
||||
Set<Long> organIds = list.stream().map(OrganizationDO::getId).collect(Collectors.toSet());
|
||||
Set<Long> packageIds = list.stream().map(OrganizationDO::getPackageId).collect(Collectors.toSet());
|
||||
List<TenantPackageDO> tenantPackageDOS = tenantPackageMapper.selectBatchIds(packageIds);
|
||||
|
||||
Reference in New Issue
Block a user