@@ -1,6 +1,7 @@ | |||||
package com.ningdatech.pmapi.filemanage.manage; | package com.ningdatech.pmapi.filemanage.manage; | ||||
import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
@@ -66,7 +67,7 @@ public class DocumentationManage { | |||||
documentationService.page(page, Wrappers.lambdaQuery(Documentation.class) | documentationService.page(page, Wrappers.lambdaQuery(Documentation.class) | ||||
.eq(Objects.nonNull(param.getGroupId()), Documentation::getGroupId, param.getGroupId())); | .eq(Objects.nonNull(param.getGroupId()), Documentation::getGroupId, param.getGroupId())); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -129,7 +129,7 @@ public class ProjectFileManage { | |||||
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()) | .eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()) | ||||
.orderByDesc(Project::getUpdateOn)); | .orderByDesc(Project::getUpdateOn)); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -108,7 +108,7 @@ public class GovProjectCollectionManage { | |||||
.orderByDesc(GovBizProjectBaseinfo::getBizTime); | .orderByDesc(GovBizProjectBaseinfo::getBizTime); | ||||
baseinfoService.page(page,wrapper); | baseinfoService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -135,7 +135,7 @@ public class AppAppraisalManage { | |||||
.like(StringUtils.isNotBlank(req.getApplicationName()),ProjectApplication::getApplicationName,req.getApplicationName()); | .like(StringUtils.isNotBlank(req.getApplicationName()),ProjectApplication::getApplicationName,req.getApplicationName()); | ||||
projectApplicationService.page(page,wrapper); | projectApplicationService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -191,7 +191,7 @@ public class AppAppraisalManage { | |||||
.like(StringUtils.isNotBlank(req.getApplicationName()),ProjectApplication::getApplicationName,req.getApplicationName()); | .like(StringUtils.isNotBlank(req.getApplicationName()),ProjectApplication::getApplicationName,req.getApplicationName()); | ||||
projectApplicationService.page(page,wrapper); | projectApplicationService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -78,7 +78,7 @@ public class IndicatorConfigManage { | |||||
.orderByDesc(PerformanceIndicatorProjectTemplate::getCreateOn); | .orderByDesc(PerformanceIndicatorProjectTemplate::getCreateOn); | ||||
indicatorProjectTemplateService.page(page,wrapper); | indicatorProjectTemplateService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -117,7 +117,7 @@ public class OrgSelfAppraisalManage { | |||||
.in(PerformanceAppraisal::getId,paIds) | .in(PerformanceAppraisal::getId,paIds) | ||||
.orderByDesc(PerformanceAppraisal::getUpdateOn); | .orderByDesc(PerformanceAppraisal::getUpdateOn); | ||||
performanceAppraisalService.page(page,wrapper); | performanceAppraisalService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -153,7 +153,7 @@ public class OrgSelfAppraisalManage { | |||||
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()); | .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()); | ||||
projectService.page(page,wrapper); | projectService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -206,7 +206,7 @@ public class OrgSelfAppraisalManage { | |||||
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()); | .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()); | ||||
projectService.page(page,wrapper); | projectService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<PerformanceAppraisalProjectVO> res = page.getRecords().stream() | List<PerformanceAppraisalProjectVO> res = page.getRecords().stream() | ||||
@@ -106,7 +106,7 @@ public class PerformanceAppraisalPlanManage { | |||||
.orderByDesc(PerformanceAppraisal::getUpdateOn); | .orderByDesc(PerformanceAppraisal::getUpdateOn); | ||||
// 如果登录用户是区域管理员,能看到本区域的评价计划 | // 如果登录用户是区域管理员,能看到本区域的评价计划 | ||||
performanceAppraisalService.page(page,wrapper); | performanceAppraisalService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -922,7 +922,7 @@ public class PerformanceAppraisalPlanManage { | |||||
.in(ProjectApplication::getProjectVersion,projectVersions) | .in(ProjectApplication::getProjectVersion,projectVersions) | ||||
.orderByDesc(ProjectApplication::getCreateOn); | .orderByDesc(ProjectApplication::getCreateOn); | ||||
applicationService.page(page,wrapper); | applicationService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<PerformanceAppraisalApplicationVO> res = page.getRecords().stream().map(r -> { | List<PerformanceAppraisalApplicationVO> res = page.getRecords().stream().map(r -> { | ||||
@@ -128,7 +128,7 @@ public class RectifyAuditManage { | |||||
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) | LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) | ||||
.in(PerformanceAppraisal::getId, appraisalIdList).orderByDesc(PerformanceAppraisal::getUpdateOn); | .in(PerformanceAppraisal::getId, appraisalIdList).orderByDesc(PerformanceAppraisal::getUpdateOn); | ||||
performanceAppraisalService.page(page, wrapper); | performanceAppraisalService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -205,7 +205,7 @@ public class RectifyAuditManage { | |||||
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | .like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | ||||
projectService.page(page, wrapper); | projectService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -276,7 +276,7 @@ public class RectifyAuditManage { | |||||
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | .like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | ||||
projectService.page(page, wrapper); | projectService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -112,7 +112,7 @@ public class RectifyManage { | |||||
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) | LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) | ||||
.in(PerformanceAppraisal::getId, paIds).orderByDesc(PerformanceAppraisal::getUpdateOn); | .in(PerformanceAppraisal::getId, paIds).orderByDesc(PerformanceAppraisal::getUpdateOn); | ||||
performanceAppraisalService.page(page, wrapper); | performanceAppraisalService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -168,7 +168,7 @@ public class RectifyManage { | |||||
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | .like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | ||||
projectService.page(page, wrapper); | projectService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -219,7 +219,7 @@ public class RectifyManage { | |||||
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | .like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()); | ||||
projectService.page(page, wrapper); | projectService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<PerformanceAppraisalProjectVO> res = page.getRecords().stream().map(p -> { | List<PerformanceAppraisalProjectVO> res = page.getRecords().stream().map(p -> { | ||||
@@ -279,7 +279,7 @@ public class DeclaredProjectManage { | |||||
.like(StringUtils.isNotBlank(params.getProjectName()), ProjectDraft::getProjectName, params.getProjectName()) | .like(StringUtils.isNotBlank(params.getProjectName()), ProjectDraft::getProjectName, params.getProjectName()) | ||||
.orderByDesc(ProjectDraft::getUpdateOn); | .orderByDesc(ProjectDraft::getUpdateOn); | ||||
projectDraftService.page(page, wrapper); | projectDraftService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<ProjectDraftVO> res = page.getRecords().stream().map(record -> { | List<ProjectDraftVO> res = page.getRecords().stream().map(record -> { | ||||
@@ -146,7 +146,7 @@ public class ApplicationManage { | |||||
.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode()) | .eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode()) | ||||
.eq(Project::getStatus, ProjectStatusEnum.TO_BE_APP_REGISTER.getCode()) | .eq(Project::getStatus, ProjectStatusEnum.TO_BE_APP_REGISTER.getCode()) | ||||
.eq(Project::getBuildOrgCode,orgCode)); | .eq(Project::getBuildOrgCode,orgCode)); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -75,7 +75,7 @@ public class ProjectCollectionManage { | |||||
collectionService.page(page,wrapper); | collectionService.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -190,7 +190,7 @@ public class ProjectLibManage { | |||||
query.eq(Project::getNewest, Boolean.TRUE); | query.eq(Project::getNewest, Boolean.TRUE); | ||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
long total; | long total; | ||||
if ((total = page.getTotal()) == 0) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
UserFullInfoDTO finalUser = user; | UserFullInfoDTO finalUser = user; | ||||
@@ -266,7 +266,7 @@ public class ProjectLibManage { | |||||
} | } | ||||
return item; | return item; | ||||
}); | }); | ||||
return PageVo.of(records, total); | |||||
return PageVo.of(records, page.getTotal()); | |||||
} | } | ||||
private BigDecimal computeAmount(BigDecimal cuurentAmount,List<ProjectRenewalFundDeclaration> prfs) { | private BigDecimal computeAmount(BigDecimal cuurentAmount,List<ProjectRenewalFundDeclaration> prfs) { | ||||
@@ -1188,7 +1188,7 @@ public class ProjectLibManage { | |||||
wrapper.orderByDesc(ProjectApplication::getUpdateOn); | wrapper.orderByDesc(ProjectApplication::getUpdateOn); | ||||
projectApplicationService.page(page, wrapper); | projectApplicationService.page(page, wrapper); | ||||
if (0L == page.getTotal()) { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -1,6 +1,7 @@ | |||||
package com.ningdatech.pmapi.sys.service.impl; | package com.ningdatech.pmapi.sys.service.impl; | ||||
import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
@@ -49,7 +50,7 @@ public class EarlyWarningRecordsServiceImpl extends ServiceImpl<EarlyWarningReco | |||||
this.page(page,wrapper); | this.page(page,wrapper); | ||||
if(0L == page.getTotal()){ | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||