|
|
@@ -995,11 +995,13 @@ public class KwsEnterpriseService {
|
|
|
|
|
|
|
|
|
List<KwsEntCheckTrack> list = kwsEntCheckTrackDao.findList(id);
|
|
|
+ boolean isValid = false;
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
- entDetailResVo.setValid(list.stream().anyMatch(item -> item.getStatus().equals(Global.NO)));
|
|
|
- } else {
|
|
|
- entDetailResVo.setValid(false);
|
|
|
+ isValid = list.stream()
|
|
|
+ .filter(item -> item.getStatus() != null)
|
|
|
+ .anyMatch(item -> item.getStatus().equals(Global.NO));
|
|
|
}
|
|
|
+ entDetailResVo.setValid(isValid);
|
|
|
return entDetailResVo;
|
|
|
}
|
|
|
|
|
|
@@ -1282,18 +1284,24 @@ public class KwsEnterpriseService {
|
|
|
|
|
|
//企业资质有效性判断 1、当前资质没过期,且状态是已认证 2、只要有认证过一次就算有效 参数判断
|
|
|
String checkType = String.valueOf(Global.NUMERICAL_TWO);
|
|
|
+ entCacheResDto.setValid(false); // 设置默认值
|
|
|
if (checkType.equals(Global.NUMERICAL_ONE)) {
|
|
|
List<CertificateResVo> certificates = queryCertificate(entId);
|
|
|
- for (CertificateResVo certificate : certificates) {
|
|
|
- Date expireTime = certificate.getExpireTime();
|
|
|
- entCacheResDto.setValid(DateUtil.compare(new Date(), expireTime) <= 0);
|
|
|
+ if (CollectionUtils.isNotEmpty(certificates)) {
|
|
|
+ // 只要有一个证书有效,则企业有效
|
|
|
+ boolean hasValidCertificate = certificates.stream()
|
|
|
+ .filter(cert -> cert.getExpireTime() != null)
|
|
|
+ .anyMatch(certificate -> DateUtil.compare(new Date(), certificate.getExpireTime()) <= 0);
|
|
|
+ entCacheResDto.setValid(hasValidCertificate);
|
|
|
}
|
|
|
} else {
|
|
|
List<KwsEntCheckTrack> entCheckTrackResDtoList = entCheck(entId);
|
|
|
- if (CollectionUtils.isEmpty(entCheckTrackResDtoList)) {
|
|
|
- entCacheResDto.setValid(false);
|
|
|
+ if (CollectionUtils.isNotEmpty(entCheckTrackResDtoList)) {
|
|
|
+ boolean hasApprovedRecord = entCheckTrackResDtoList.stream()
|
|
|
+ .filter(item -> item.getStatus() != null)
|
|
|
+ .anyMatch(item -> item.getStatus() == Global.NO);
|
|
|
+ entCacheResDto.setValid(hasApprovedRecord);
|
|
|
}
|
|
|
- entCacheResDto.setValid(entCheckTrackResDtoList.stream().anyMatch(item -> item.getStatus() == Global.NO));
|
|
|
}
|
|
|
|
|
|
return entCacheResDto;
|