From 04731298d340ee3ad446f1786496c67b520cab03 Mon Sep 17 00:00:00 2001 From: liao Date: Fri, 3 Nov 2023 16:46:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=2077920=20=E8=A2=AB=E4=BB=A3=E6=9B=BF?= =?UTF-8?q?=E7=9A=84=E6=A0=87=E5=87=86=EF=BC=8C=E6=A0=87=E5=87=86=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=B2=A1=E6=9C=89=E5=8F=98=E4=B8=BA=E5=BA=9F=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/service/ILawsCommonService.java | 7 ++++ .../service/impl/LawsCommonServiceImpl.java | 33 +++++++++++++++++-- .../impl/LawsReplacedStandardServiceImpl.java | 10 ++++++ 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java index d7f7273b..cab0bdda 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java @@ -169,4 +169,11 @@ public interface ILawsCommonService { * @param response */ void esTemplateDownload(HttpServletResponse response) throws Exception; + + /** + * @Author: liao + * @Date: 2023/11/3 16:32 + * @Description: 将标准编号集合中的标准改成废止状态 + **/ + void updateToAbolish(List standardNumbers); } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java index ad4ed9c1..cc92c063 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java @@ -25,8 +25,7 @@ import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthUserServic import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectContentService; import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil; import com.jero.modules.laws.enterprise.util.WaterMarkUtil; -import com.jero.modules.laws.standard.entity.LawsNodeRelation; -import com.jero.modules.laws.standard.entity.LawsTreeNode; +import com.jero.modules.laws.standard.entity.*; import com.jero.modules.laws.standard.service.*; import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; @@ -128,6 +127,12 @@ public class LawsCommonServiceImpl implements ILawsCommonService { private WaterMarkUtil waterMarkUtil; @Autowired private ISarFileSplitInfoService sarFileSplitInfoService; + @Autowired + private ILawsDomesticStandardService lawsDomesticStandardService; + @Autowired + private ILawsOverseasStandardService lawsOverseasStandardService; + @Autowired + private ILawsEnterpriseStandardService lawsEnterpriseStandardService; /** * @Author: liao @@ -1929,6 +1934,30 @@ public class LawsCommonServiceImpl implements ILawsCommonService { } } + /** + * @Author: liao + * @Date: 2023/11/3 16:34 + * @Description: 将标准编号集合中的标准改成废止状态 + **/ + @Override + public void updateToAbolish(List standardNumbers) { + // 国标 + LambdaUpdateWrapper gbUpdateWrapper = new LambdaUpdateWrapper<>(); + gbUpdateWrapper.set(LawsDomesticStandard::getStandardState, "7"); + gbUpdateWrapper.in(LawsDomesticStandard::getStandardNumber, standardNumbers); + lawsDomesticStandardService.update(gbUpdateWrapper); + // 外标 + LambdaUpdateWrapper fbUpdateWrapper = new LambdaUpdateWrapper<>(); + fbUpdateWrapper.set(LawsOverseasStandard::getStandardState, "7"); + fbUpdateWrapper.in(LawsOverseasStandard::getStandardNumber, standardNumbers); + lawsOverseasStandardService.update(fbUpdateWrapper); + // 企标 + LambdaUpdateWrapper qbUpdateWrapper = new LambdaUpdateWrapper<>(); + qbUpdateWrapper.set(LawsEnterpriseStandard::getStandardState, 9); + qbUpdateWrapper.in(LawsEnterpriseStandard::getStandardNumber, standardNumbers); + lawsEnterpriseStandardService.update(qbUpdateWrapper); + } + /** * 创建企标导入模板的Workbook * diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsReplacedStandardServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsReplacedStandardServiceImpl.java index c212d076..816b3a6d 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsReplacedStandardServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsReplacedStandardServiceImpl.java @@ -1,11 +1,13 @@ package com.jero.modules.laws.standard.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.jero.modules.laws.common.service.ILawsCommonService; import com.jero.modules.laws.standard.entity.LawsReplacedStandard; import com.jero.modules.laws.standard.mapper.LawsReplacedStandardMapper; import com.jero.modules.laws.standard.service.ILawsReplacedStandardService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.jero.common.exception.JeroBootException; @@ -27,6 +29,9 @@ import java.util.stream.Collectors; @Transactional(rollbackFor = JeroBootException.class) public class LawsReplacedStandardServiceImpl extends ServiceImpl implements ILawsReplacedStandardService { + @Autowired + private ILawsCommonService lawsCommonService; + /** * @Author: liao * @Date: 2023/9/19 11:06 @@ -49,6 +54,11 @@ public class LawsReplacedStandardServiceImpl extends ServiceImpl