Explorar el Código

信创页面优化

tags/24080901
PoffyZhang hace 4 meses
padre
commit
5637e0fdb1
Se han modificado 3 ficheros con 23 adiciones y 13 borrados
  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 Ver fichero

@@ -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());


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

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

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

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

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

private Integer status;



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

@@ -37,10 +37,14 @@ public class XinchuangServiceImpl extends ServiceImpl<XinchuangMapper, Xinchuang
public List<XcfhxApplyListVO> listXcfhxApplyListVO(XcfhxListReq req) {
LambdaQueryWrapper<Xinchuang> query = Wrappers.lambdaQuery(Xinchuang.class)
.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())
.ge(req.getCreateOnMin() != null, Xinchuang::getCreateOn, req.getCreateOnMin())
.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);
if (Boolean.TRUE.equals(req.getFinished())) {
query.eq(Xinchuang::getStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode());


Cargando…
Cancelar
Guardar