|
@@ -52,14 +52,14 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
companyCertificateVos.forEach(item -> {
|
|
companyCertificateVos.forEach(item -> {
|
|
- if (ObjectUtil.isNotEmpty(item.getCompanyType())){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(item.getCompanyType())) {
|
|
String companyTypeNameByType = getCompanyTypeNameByType(item.getCompanyType());
|
|
String companyTypeNameByType = getCompanyTypeNameByType(item.getCompanyType());
|
|
item.setCompanyTypeName(companyTypeNameByType);
|
|
item.setCompanyTypeName(companyTypeNameByType);
|
|
}
|
|
}
|
|
CompanyCertificate companyCertificate = new CompanyCertificate();
|
|
CompanyCertificate companyCertificate = new CompanyCertificate();
|
|
companyCertificate.setCertificateId(item.getCertificateId());
|
|
companyCertificate.setCertificateId(item.getCertificateId());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
- if (ObjectUtil.isNotEmpty(item.getEffectiveDate())&&item.getEffectiveDate()!=0) {
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(item.getEffectiveDate()) && item.getEffectiveDate() != 0) {
|
|
Date effectivedate = new Date(item.getEffectiveDate() * 1000L);
|
|
Date effectivedate = new Date(item.getEffectiveDate() * 1000L);
|
|
if (effectivedate.compareTo(new Date()) > 0) {
|
|
if (effectivedate.compareTo(new Date()) > 0) {
|
|
item.setExpirationTime(0L);
|
|
item.setExpirationTime(0L);
|
|
@@ -68,14 +68,14 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
//查询实时证书过期时间更新证书预警状态
|
|
//查询实时证书过期时间更新证书预警状态
|
|
companyCertificate.setWarningStatus(2);
|
|
companyCertificate.setWarningStatus(2);
|
|
this.baseMapper.updateById(companyCertificate);
|
|
this.baseMapper.updateById(companyCertificate);
|
|
- if (ObjectUtil.isNotEmpty(item.getEffectiveDate())){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(item.getEffectiveDate())) {
|
|
long l = DateUtil.between(effectivedate, new Date(), DateUnit.DAY);
|
|
long l = DateUtil.between(effectivedate, new Date(), DateUnit.DAY);
|
|
item.setExpirationTime(l);
|
|
item.setExpirationTime(l);
|
|
item.setWarningStatus(2);
|
|
item.setWarningStatus(2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (ObjectUtil.isNotEmpty(item.getOperateDate())&&item.getOperateDate()!=0) {
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(item.getOperateDate()) && item.getOperateDate() != 0) {
|
|
Date opearteDate = new Date(item.getOperateDate() * 1000L);
|
|
Date opearteDate = new Date(item.getOperateDate() * 1000L);
|
|
if (opearteDate.compareTo(new Date()) > 0) {
|
|
if (opearteDate.compareTo(new Date()) > 0) {
|
|
item.setExpirationTime(0L);
|
|
item.setExpirationTime(0L);
|
|
@@ -83,14 +83,14 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
} else {
|
|
} else {
|
|
//查询实时证书过期时间更新证书预警状态
|
|
//查询实时证书过期时间更新证书预警状态
|
|
companyCertificate.setWarningStatus(2);
|
|
companyCertificate.setWarningStatus(2);
|
|
- if (ObjectUtil.isNotEmpty(item.getOperateDate())){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(item.getOperateDate())) {
|
|
long l = DateUtil.between(opearteDate, new Date(), DateUnit.DAY);
|
|
long l = DateUtil.between(opearteDate, new Date(), DateUnit.DAY);
|
|
item.setExpirationTime(l);
|
|
item.setExpirationTime(l);
|
|
item.setWarningStatus(2);
|
|
item.setWarningStatus(2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (ObjectUtil.isNotEmpty(item.getEffectiveFlag())&&item.getEffectiveFlag()==1||ObjectUtil.isNotEmpty(item.getOperateDate())&&item.getOperateFlag()==1){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(item.getEffectiveFlag()) && item.getEffectiveFlag() == 1 || ObjectUtil.isNotEmpty(item.getOperateDate()) && item.getOperateFlag() == 1) {
|
|
item.setWarningStatus(1);
|
|
item.setWarningStatus(1);
|
|
companyCertificate.setWarningStatus(1);
|
|
companyCertificate.setWarningStatus(1);
|
|
}
|
|
}
|
|
@@ -122,7 +122,7 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
@Override
|
|
@Override
|
|
public Boolean insertByAddBo(CompanyCertificateAddBo bo) {
|
|
public Boolean insertByAddBo(CompanyCertificateAddBo bo) {
|
|
CompanyCertificate add = BeanUtil.toBean(bo, CompanyCertificate.class);
|
|
CompanyCertificate add = BeanUtil.toBean(bo, CompanyCertificate.class);
|
|
- if (ObjectUtil.isNotEmpty(bo.getCompanyId())){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(bo.getCompanyId())) {
|
|
CompanyVo companyVo = iCompanyService.queryById(bo.getCompanyId());
|
|
CompanyVo companyVo = iCompanyService.queryById(bo.getCompanyId());
|
|
add.setCompanyName(companyVo.getCompanyName());
|
|
add.setCompanyName(companyVo.getCompanyName());
|
|
add.setCompanyType(companyVo.getCompanyType());
|
|
add.setCompanyType(companyVo.getCompanyType());
|
|
@@ -137,15 +137,15 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
}
|
|
}
|
|
add.setCertificateId(bo.getCertificateId());
|
|
add.setCertificateId(bo.getCertificateId());
|
|
if (bo.getCertificateType().equals(2)) {
|
|
if (bo.getCertificateType().equals(2)) {
|
|
- if (!bo.getInfoList().isEmpty()){
|
|
|
|
|
|
+ if (!bo.getInfoList().isEmpty()) {
|
|
List<CompanyCertificateInfo> infoList = bo.getInfoList();
|
|
List<CompanyCertificateInfo> infoList = bo.getInfoList();
|
|
- infoList.forEach(item->{
|
|
|
|
- if (Validator.isEmpty(item.getQualificationCategory())){
|
|
|
|
|
|
+ infoList.forEach(item -> {
|
|
|
|
+ if (Validator.isEmpty(item.getQualificationCategory())) {
|
|
throw new CustomException("资质名称不能为空");
|
|
throw new CustomException("资质名称不能为空");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
List<CompanyCertificateInfo> collect = infoList.stream().filter(s -> s.getItemClass().equals(1)).collect(Collectors.toList());
|
|
List<CompanyCertificateInfo> collect = infoList.stream().filter(s -> s.getItemClass().equals(1)).collect(Collectors.toList());
|
|
- if (collect.size()>=2){
|
|
|
|
|
|
+ if (collect.size() >= 2) {
|
|
throw new CustomException("主项重复");
|
|
throw new CustomException("主项重复");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -153,7 +153,7 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
}
|
|
}
|
|
//证书有效时间判断
|
|
//证书有效时间判断
|
|
if (ObjectUtil.isNotEmpty(bo.getIssuanceDate()) && ObjectUtil.isNotEmpty(bo.getEffectiveDate())) {
|
|
if (ObjectUtil.isNotEmpty(bo.getIssuanceDate()) && ObjectUtil.isNotEmpty(bo.getEffectiveDate())) {
|
|
- if (bo.getEffectiveFlag()==1) {
|
|
|
|
|
|
+ if (bo.getEffectiveFlag() == 1) {
|
|
bo.setWarningStatus(1);
|
|
bo.setWarningStatus(1);
|
|
} else {
|
|
} else {
|
|
Date issuancedate = new Date(bo.getIssuanceDate() * 1000L);
|
|
Date issuancedate = new Date(bo.getIssuanceDate() * 1000L);
|
|
@@ -249,6 +249,7 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
public String getCompanyTypeNameByType(Long companyType) {
|
|
public String getCompanyTypeNameByType(Long companyType) {
|
|
//公司类型判断
|
|
//公司类型判断
|
|
if (companyType == 1L) {
|
|
if (companyType == 1L) {
|
|
@@ -288,6 +289,7 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
public Integer getDocumentTypeByName(String documentTypeName) {
|
|
public Integer getDocumentTypeByName(String documentTypeName) {
|
|
//公司类型判断
|
|
//公司类型判断
|
|
switch (documentTypeName) {
|
|
switch (documentTypeName) {
|
|
@@ -372,9 +374,9 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
collect.forEach((k, v) -> {
|
|
collect.forEach((k, v) -> {
|
|
List<ExcelCompanyCertificateVo> excelCompanyCertificateVos = collect.get(k);
|
|
List<ExcelCompanyCertificateVo> excelCompanyCertificateVos = collect.get(k);
|
|
ExcelCompanyCertificateVo excelCompanyCertificateVo = excelCompanyCertificateVos.get(0);
|
|
ExcelCompanyCertificateVo excelCompanyCertificateVo = excelCompanyCertificateVos.get(0);
|
|
- excelCompanyCertificateVos.forEach(item -> {
|
|
|
|
|
|
+ excelCompanyCertificateVos.forEach(item -> {
|
|
CompanyCertificateInfo companyCertificateInfo = new CompanyCertificateInfo();
|
|
CompanyCertificateInfo companyCertificateInfo = new CompanyCertificateInfo();
|
|
- if (ObjectUtil.isNotEmpty(item.getDocumentTypeName())){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(item.getDocumentTypeName())) {
|
|
Integer zzDocumentTypeByName = getZzDocumentTypeByName(item.getDocumentTypeName());
|
|
Integer zzDocumentTypeByName = getZzDocumentTypeByName(item.getDocumentTypeName());
|
|
companyCertificateInfo.setItemClass(Long.valueOf(zzDocumentTypeByName));
|
|
companyCertificateInfo.setItemClass(Long.valueOf(zzDocumentTypeByName));
|
|
}
|
|
}
|
|
@@ -431,7 +433,7 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
companyCertificate.setIssuingAuthority(excelCompanyCertificateVo.getIssuingAuthority());
|
|
companyCertificate.setIssuingAuthority(excelCompanyCertificateVo.getIssuingAuthority());
|
|
companyCertificate.setCreateTime(DateUtils.getNowTime());
|
|
companyCertificate.setCreateTime(DateUtils.getNowTime());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
- vo.setSaveStatus( this.baseMapper.insert(companyCertificate));
|
|
|
|
|
|
+ vo.setSaveStatus(this.baseMapper.insert(companyCertificate));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -473,7 +475,7 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
companyCertificate.setIssuingAuthority(item.getIssuingAuthority());
|
|
companyCertificate.setIssuingAuthority(item.getIssuingAuthority());
|
|
companyCertificate.setCreateTime(DateUtils.getNowTime());
|
|
companyCertificate.setCreateTime(DateUtils.getNowTime());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
- vo.setSaveStatus( this.baseMapper.insert(companyCertificate));
|
|
|
|
|
|
+ vo.setSaveStatus(this.baseMapper.insert(companyCertificate));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -515,15 +517,15 @@ public class CompanyCertificateServiceImpl extends ServiceImpl<CompanyCertificat
|
|
companyCertificate.setIssuingAuthority(item.getIssuingAuthority());
|
|
companyCertificate.setIssuingAuthority(item.getIssuingAuthority());
|
|
companyCertificate.setCreateTime(DateUtils.getNowTime());
|
|
companyCertificate.setCreateTime(DateUtils.getNowTime());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
companyCertificate.setUpdateTime(DateUtils.getNowTime());
|
|
- vo.setSaveStatus( this.baseMapper.insert(companyCertificate));
|
|
|
|
|
|
+ vo.setSaveStatus(this.baseMapper.insert(companyCertificate));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if (vo.getSaveStatus()==1){
|
|
|
|
|
|
+ if (vo.getSaveStatus() == 1) {
|
|
return true;
|
|
return true;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|