Browse Source

信创页面优化

tags/24080901
PoffyZhang 6 months ago
parent
commit
5637e0fdb1
3 changed files with 23 additions and 13 deletions
  1. +14
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  2. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/XcfhxListReq.java
  3. +5
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/impl/XinchuangServiceImpl.java

+ 14
- 12
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java View File

@@ -716,7 +716,9 @@ public class PurchaseManage {
.le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax()) .le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax())
.ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin()) .ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin())
.eq(req.getStatus() != null, Purchase::getXcfhxApplyStatus, req.getStatus()) .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); .orderByDesc(Purchase::getCreateOn);


if (Boolean.TRUE.equals(req.getFinished())) { if (Boolean.TRUE.equals(req.getFinished())) {
@@ -732,11 +734,14 @@ public class PurchaseManage {
List<XcfhxApplyListVO> others = Lists.newArrayList(); List<XcfhxApplyListVO> others = Lists.newArrayList();
if (CollUtil.isNotEmpty(purchases)) { if (CollUtil.isNotEmpty(purchases)) {
Set<Long> projectIds = CollUtils.fieldSet(purchases, Purchase::getProjectId); 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, Project> projectMap = CollUtils.listToMap(projects, Project::getId);
Map<Long, Contract> contractMap = projectIds.isEmpty() ? Maps.newHashMap() Map<Long, Contract> contractMap = projectIds.isEmpty() ? Maps.newHashMap()
: contractService.listByProjectIds(projectIds); : contractService.listByProjectIds(projectIds);
others = purchases.stream().map(w -> {
others = purchases.stream().filter(w -> projectMap.containsKey(w.getProjectId()))
.map(w -> {
XcfhxApplyListVO item = XcfhxApplyListVO.builder() XcfhxApplyListVO item = XcfhxApplyListVO.builder()
.bidId(w.getId()) .bidId(w.getId())
.bizName(w.getBidName()) .bizName(w.getBidName())
@@ -745,15 +750,12 @@ public class PurchaseManage {
.createOn(w.getCreateOn()) .createOn(w.getCreateOn())
.sourceType(w.getSourceType()) .sourceType(w.getSourceType())
.build(); .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()); Contract contract = contractMap.get(w.getId());
if (contract != null) { if (contract != null) {
item.setContractAmount(contract.getTotalAmount()); item.setContractAmount(contract.getTotalAmount());


+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/XcfhxListReq.java View File

@@ -5,6 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;


import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;


/** /**
@@ -20,6 +21,9 @@ import java.time.LocalDateTime;
public class XcfhxListReq extends PagePo { public class XcfhxListReq extends PagePo {


private String bidName; private String bidName;
private String projectName;
private BigDecimal amountStart;
private BigDecimal amountEnd;


private Integer status; private Integer status;




+ 5
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/impl/XinchuangServiceImpl.java View File

@@ -37,10 +37,14 @@ public class XinchuangServiceImpl extends ServiceImpl<XinchuangMapper, Xinchuang
public List<XcfhxApplyListVO> listXcfhxApplyListVO(XcfhxListReq req) { public List<XcfhxApplyListVO> listXcfhxApplyListVO(XcfhxListReq req) {
LambdaQueryWrapper<Xinchuang> query = Wrappers.lambdaQuery(Xinchuang.class) LambdaQueryWrapper<Xinchuang> query = Wrappers.lambdaQuery(Xinchuang.class)
.like(StrUtil.isNotBlank(req.getBidName()), Xinchuang::getBidName, req.getBidName()) .like(StrUtil.isNotBlank(req.getBidName()), Xinchuang::getBidName, req.getBidName())
.like(StrUtil.isNotBlank(req.getProjectName()), Xinchuang::getProjectName, req.getProjectName())
.le(req.getCreateOnMax() != null, Xinchuang::getCreateOn, req.getCreateOnMax()) .le(req.getCreateOnMax() != null, Xinchuang::getCreateOn, req.getCreateOnMax())
.ge(req.getCreateOnMin() != null, Xinchuang::getCreateOn, req.getCreateOnMin()) .ge(req.getCreateOnMin() != null, Xinchuang::getCreateOn, req.getCreateOnMin())
.eq(req.getStatus() != null, Xinchuang::getStatus, req.getStatus()) .eq(req.getStatus() != null, Xinchuang::getStatus, req.getStatus())
.eq(req.getSourceType() != null,Xinchuang::getSourceType,req.getSourceType() )
.eq(req.getSourceType() != null,Xinchuang::getSourceType,req.getSourceType())
//如果查金额 就查不到 手动新增的
.eq(req.getAmountStart() != null, Xinchuang::getId, 0L)
.eq(req.getAmountEnd() != null, Xinchuang::getId, 0L)
.orderByDesc(Xinchuang::getCreateOn); .orderByDesc(Xinchuang::getCreateOn);
if (Boolean.TRUE.equals(req.getFinished())) { if (Boolean.TRUE.equals(req.getFinished())) {
query.eq(Xinchuang::getStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode()); query.eq(Xinchuang::getStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode());


Loading…
Cancel
Save