|
|
@@ -716,7 +716,9 @@ public class PurchaseManage { |
|
|
|
.le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax()) |
|
|
|
.ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin()) |
|
|
|
.eq(req.getStatus() != null, Purchase::getXcfhxApplyStatus, req.getStatus()) |
|
|
|
.eq(req.getSourceType() != null,Purchase::getSourceType,req.getSourceType() ) |
|
|
|
.eq(req.getSourceType() != null,Purchase::getSourceType,req.getSourceType()) |
|
|
|
.ge(Objects.nonNull(req.getAmountStart()),Purchase::getTransactionAmount,req.getAmountStart()) |
|
|
|
.le(Objects.nonNull(req.getAmountEnd()),Purchase::getTransactionAmount,req.getAmountEnd()) |
|
|
|
.orderByDesc(Purchase::getCreateOn); |
|
|
|
|
|
|
|
if (Boolean.TRUE.equals(req.getFinished())) { |
|
|
@@ -732,11 +734,14 @@ public class PurchaseManage { |
|
|
|
List<XcfhxApplyListVO> others = Lists.newArrayList(); |
|
|
|
if (CollUtil.isNotEmpty(purchases)) { |
|
|
|
Set<Long> projectIds = CollUtils.fieldSet(purchases, Purchase::getProjectId); |
|
|
|
List<Project> projects = projectIds.isEmpty() ? Lists.newArrayList() : projectService.listByIds(projectIds); |
|
|
|
List<Project> projects = projectIds.isEmpty() ? Lists.newArrayList() : projectService.list(Wrappers.lambdaQuery(Project.class) |
|
|
|
.in(Project::getId,projectIds) |
|
|
|
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName())); |
|
|
|
Map<Long, Project> projectMap = CollUtils.listToMap(projects, Project::getId); |
|
|
|
Map<Long, Contract> contractMap = projectIds.isEmpty() ? Maps.newHashMap() |
|
|
|
: contractService.listByProjectIds(projectIds); |
|
|
|
others = purchases.stream().map(w -> { |
|
|
|
others = purchases.stream().filter(w -> projectMap.containsKey(w.getProjectId())) |
|
|
|
.map(w -> { |
|
|
|
XcfhxApplyListVO item = XcfhxApplyListVO.builder() |
|
|
|
.bidId(w.getId()) |
|
|
|
.bizName(w.getBidName()) |
|
|
@@ -745,15 +750,12 @@ public class PurchaseManage { |
|
|
|
.createOn(w.getCreateOn()) |
|
|
|
.sourceType(w.getSourceType()) |
|
|
|
.build(); |
|
|
|
if(Objects.nonNull(w.getProjectId()) && projectMap.containsKey(w.getProjectId())){ |
|
|
|
Project project = projectMap.get(w.getProjectId()); |
|
|
|
item.setProjectCode(project.getProjectCode()); |
|
|
|
item.setProjectName(project.getProjectName()); |
|
|
|
item.setBuildOrgCode(project.getBuildOrgCode()); |
|
|
|
item.setBuildOrgName(project.getBuildOrgName()); |
|
|
|
}else{ |
|
|
|
item.setProjectName(w.getProjectName()); |
|
|
|
} |
|
|
|
Project project = projectMap.get(w.getProjectId()); |
|
|
|
item.setProjectCode(project.getProjectCode()); |
|
|
|
item.setProjectName(project.getProjectName()); |
|
|
|
item.setBuildOrgCode(project.getBuildOrgCode()); |
|
|
|
item.setBuildOrgName(project.getBuildOrgName()); |
|
|
|
|
|
|
|
Contract contract = contractMap.get(w.getId()); |
|
|
|
if (contract != null) { |
|
|
|
item.setContractAmount(contract.getTotalAmount()); |
|
|
|