fix 77920 被代替的标准,标准状态没有变为废止

This commit is contained in:
liao
2023-11-03 16:46:42 +08:00
parent fd98641a3a
commit 04731298d3
3 changed files with 48 additions and 2 deletions
@@ -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<String> standardNumbers);
}
@@ -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<String> standardNumbers) {
// 国标
LambdaUpdateWrapper<LawsDomesticStandard> gbUpdateWrapper = new LambdaUpdateWrapper<>();
gbUpdateWrapper.set(LawsDomesticStandard::getStandardState, "7");
gbUpdateWrapper.in(LawsDomesticStandard::getStandardNumber, standardNumbers);
lawsDomesticStandardService.update(gbUpdateWrapper);
// 外标
LambdaUpdateWrapper<LawsOverseasStandard> fbUpdateWrapper = new LambdaUpdateWrapper<>();
fbUpdateWrapper.set(LawsOverseasStandard::getStandardState, "7");
fbUpdateWrapper.in(LawsOverseasStandard::getStandardNumber, standardNumbers);
lawsOverseasStandardService.update(fbUpdateWrapper);
// 企标
LambdaUpdateWrapper<LawsEnterpriseStandard> qbUpdateWrapper = new LambdaUpdateWrapper<>();
qbUpdateWrapper.set(LawsEnterpriseStandard::getStandardState, 9);
qbUpdateWrapper.in(LawsEnterpriseStandard::getStandardNumber, standardNumbers);
lawsEnterpriseStandardService.update(qbUpdateWrapper);
}
/**
* 创建企标导入模板的Workbook
*
@@ -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<LawsReplacedStandardMapper, LawsReplacedStandard> implements ILawsReplacedStandardService {
@Autowired
private ILawsCommonService lawsCommonService;
/**
* @Author: liao
* @Date: 2023/9/19 11:06
@@ -49,6 +54,11 @@ public class LawsReplacedStandardServiceImpl extends ServiceImpl<LawsReplacedSta
replacedStandardList.add(replacedStandard);
});
saveBatch(replacedStandardList);
if (1 == type) {
// 代替的标准号变成废止状态
lawsCommonService.updateToAbolish(replacedList);
}
}
/**