Browse Source

修改终验列表查询

tags/24080901
WendyYang 8 months ago
parent
commit
47d59149e9
2 changed files with 8 additions and 22 deletions
  1. +5
    -18
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java
  2. +3
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java

+ 5
- 18
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java View File

@@ -16,7 +16,6 @@ import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.common.util.ExcelExportStyle;
import com.hz.pm.api.common.util.StrUtils;
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectdeclared.model.entity.Contract;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst;
@@ -26,12 +25,9 @@ import com.hz.pm.api.projectdeclared.service.IContractService;
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService;
import com.hz.pm.api.projectdeclared.service.IPurchaseService;
import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
@@ -41,12 +37,10 @@ import com.hz.pm.api.projectlib.model.vo.TenderListInfoVO;
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
@@ -65,14 +59,10 @@ import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import static com.hz.pm.api.staging.enums.MsgTypeEnum.PROJECT_REVIEW;
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE;

/**
* @Classname FinalAcceptanceManage
* @Description 终验
@@ -105,7 +95,7 @@ public class FinalAcceptanceManage {
* @return \
*/
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
UserInfoDetails user = LoginUserUtil.loginUserDetail();
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
//待终验 并且还未过期
//只能看自己单位的
@@ -120,14 +110,11 @@ public class FinalAcceptanceManage {
query.eq(Project::getNewest, Boolean.TRUE);
query.orderByAsc(Project::getApprovalDate);
Page<Project> page = projectService.page(req.page(), query);
long total;
if ((total = page.getTotal()) == 0) {
if (page.getTotal() == 0) {
return PageVo.empty();
}
List<Long> allProjectIds = new ArrayList<>();
for (Project project : page.getRecords()) {
allProjectIds.add(project.getId());
}

Set<Long> allProjectIds = CollUtils.fieldSet(page.getRecords(), Project::getId);
List<Purchase> purchases = purchaseService.listByProjectIds(allProjectIds);
Map<Long, List<Purchase>> purchaseMap = CollUtils.group(purchases, Purchase::getProjectId);
Map<Long, Contract> contractMap = contractService.listByProjectIds(projectIds);
@@ -176,7 +163,7 @@ public class FinalAcceptanceManage {
}
return item;
});
return PageVo.of(records, total);
return PageVo.of(records, page.getTotal());
}

public void exportList(HttpServletResponse response, ProjectListReq param) {


+ 3
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java View File

@@ -4,12 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.ningdatech.basic.util.CollUtils;
import io.swagger.models.auth.In;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@@ -30,13 +29,13 @@ public interface IPurchaseService extends IService<Purchase> {
.orderByAsc(Purchase::getId));
}

default List<Purchase> listByProjectIds(List<Long> projectIds) {
default List<Purchase> listByProjectIds(Collection<Long> projectIds) {
return list(Wrappers.lambdaQuery(Purchase.class)
.in(Purchase::getProjectId, projectIds)
.orderByAsc(Purchase::getId));
}

default Set<Long> listProjectIdByStatus(TenderStatusEnum... status){
default Set<Long> listProjectIdByStatus(TenderStatusEnum... status) {
List<Integer> statusCodes = Arrays.stream(status)
.map(TenderStatusEnum::getTenderStatus)
.collect(Collectors.toList());


Loading…
Cancel
Save