Commit 89921fb2 authored by tianbo's avatar tianbo

fix(rule): 修复规则操作处理器中的空指针异常

- 返回空列表避免对空集合进行数据库查询操作
parent 5e8d1ea2
...@@ -29,6 +29,7 @@ import org.redisson.api.RLock; ...@@ -29,6 +29,7 @@ import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity; import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.time.LocalDate; import java.time.LocalDate;
...@@ -327,6 +328,9 @@ public class RuleActionHandler { ...@@ -327,6 +328,9 @@ public class RuleActionHandler {
private List<String> getOpeningSeqs(List<String> useCodes, List<TzBaseUnitLicence> unitLicenceList) { private List<String> getOpeningSeqs(List<String> useCodes, List<TzBaseUnitLicence> unitLicenceList) {
// 所有符合资质对应证ID // 所有符合资质对应证ID
List<String> enterpriseCertSeqs = unitLicenceList.stream().filter(unitLicence -> useCodes.contains(unitLicence.getUnitCode())).map(TzBaseUnitLicence::getEnterpriseCertSeq).collect(Collectors.toList()); List<String> enterpriseCertSeqs = unitLicenceList.stream().filter(unitLicence -> useCodes.contains(unitLicence.getUnitCode())).map(TzBaseUnitLicence::getEnterpriseCertSeq).collect(Collectors.toList());
if (ValidationUtil.isEmpty(enterpriseCertSeqs)) {
return Collections.emptyList();
}
// 正对应开通ID // 正对应开通ID
return openingApplicationMapper.selectOpeningSeqInEnterpriseCertSeq(enterpriseCertSeqs); return openingApplicationMapper.selectOpeningSeqInEnterpriseCertSeq(enterpriseCertSeqs);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment