diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java b/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java index 2d01f7c0..ecd866dd 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.jero.payment.service.impl; +import cn.hutool.core.collection.CollStreamUtil; import com.alibaba.druid.sql.visitor.functions.If; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -157,26 +158,26 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.select(PayPaymentRecordSub::getProjectId,PayPaymentRecordSub::getPaymentStatus); wrapper.eq(PayPaymentRecordSub::getLastSign, LastSignEnum.LAST.getCode()); wrapper.eq(PayPaymentRecordSub::getDelFlag, PayProjectCommon.NO); List RecordSubList = payPaymentCheckService.list(wrapper); - + Map projectIdPaymentStatusMap = CollStreamUtil.toMap(RecordSubList, PayPaymentRecordSub::getProjectId, PayPaymentRecordSub::getPaymentStatus); for (PayCommonProject commonProject : list) { //如果是会议类型,就查询会议的具体类型 + String id = commonProject.getId(); if (commonProject.getProjectType().equals(Integer.parseInt(ProjectCommon.PROJECT_TYPE3))) { - String id = commonProject.getId(); PayMeeting payMeeting = payMeetingService.getMeetingBySituationId(id); commonProject.setMeetingType(payMeeting.getMeetingType()); commonProject.setSituationId(id); } //插入待审核状态,供前端判断是否显示审核按钮 //先查审核记录表有没有待审核的 - for(PayPaymentRecordSub recordSub : RecordSubList){ - if(commonProject.getId().equals(recordSub.getProjectId())){ - if(PaymentStatusEnum.TO_BE_REVIEWED.getCode().equals(recordSub.getPaymentStatus())){ - commonProject.setCheckPaymentStatus(recordSub.getPaymentStatus()); - continue; - } + if(projectIdPaymentStatusMap.containsKey(id)){ + String paymentStatus = projectIdPaymentStatusMap.get(id); + if(PaymentStatusEnum.TO_BE_REVIEWED.getCode().equals(paymentStatus)){ + commonProject.setCheckPaymentStatus(paymentStatus); + continue; } } //再查项目主表状态是不是待审核