From 031fcd2dcd81d33117a4ffbb30888933091d6a1d Mon Sep 17 00:00:00 2001 From: qiuyt Date: Thu, 27 Feb 2025 14:29:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E5=AE=A1=E6=A0=B8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AE=A1=E6=A0=B8=E4=B8=8D=E9=80=9A=E8=BF=87=E7=AD=89?= =?UTF-8?q?=E5=8A=A8=E4=BD=9C=E4=BE=9B=E5=BA=94=E5=95=86=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8D=E6=9B=B4=E6=96=B0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/entity/purchase/SupCompanyEntity.java | 8 ++++++- .../purchase/impl/SupCompanyServiceImpl.java | 24 ++++++++++++++++++- .../mybatis/mapper/purchase/SupCompanyDao.xml | 5 +++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java b/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java index 5abf15a3..5469f8e5 100644 --- a/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java +++ b/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java @@ -314,6 +314,12 @@ public class SupCompanyEntity { private String productFailCout; @TableField(exist = false) private String prouctPassCout; + // 资质证书审核状态总数 + @TableField(exist = false) + private Integer supCertCount; + @TableField(exist = false) + private Integer supCertOkCount; - + @TableField(exist = false) + private Integer supCertNotCount; } diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java index c8936902..1579f630 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java @@ -1,9 +1,11 @@ package com.glxp.api.service.purchase.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.purchase.SupCompanyDao; import com.glxp.api.entity.purchase.SupCompanyEntity; +import com.glxp.api.req.purchase.FilterSupCertRequest; import com.glxp.api.req.purchase.FilterSupCompanyRequest; import com.glxp.api.service.purchase.SupCompanyService; import org.springframework.stereotype.Service; @@ -15,10 +17,12 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class SupCompanyServiceImpl extends ServiceImpl implements SupCompanyService { +public class SupCompanyServiceImpl extends ServiceImpl implements SupCompanyService { @Resource SupCompanyDao supCompanyDao; + @Resource + private SupCertServiceImpl supCertService; @Override public SupCompanyEntity findCompanyByUnitFk(String unitFk) { @@ -39,6 +43,24 @@ public class SupCompanyServiceImpl extends ServiceImpl companyEntities = supCompanyDao.filterCompany(companyRequest); + if (CollUtil.isNotEmpty(companyEntities)) { + for (SupCompanyEntity companyEntity : companyEntities) { + + if (companyEntity.getAuditStatus() == 1 && companyEntity.getSupCertCount() != companyEntity.getSupCertOkCount()) { + SupCompanyEntity supCompanyEntityNew = new SupCompanyEntity(); + supCompanyEntityNew.setCustomerId(companyEntity.getCustomerId()); + supCompanyEntityNew.setAuditStatus(3); + supCompanyDao.updateById(supCompanyEntityNew); + } else if (companyEntity.getSupCertCount() == companyEntity.getSupCertOkCount()) { + SupCompanyEntity supCompanyEntityNew = new SupCompanyEntity(); + supCompanyEntityNew.setCustomerId(companyEntity.getCustomerId()); + supCompanyEntityNew.setAuditStatus(1); + supCompanyDao.updateById(supCompanyEntityNew); + } + + } + } return supCompanyDao.filterCompany(companyRequest); } diff --git a/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml index de088107..b47a58f7 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml @@ -15,7 +15,10 @@