1、企业基础信息详情页新增展示证书数据

This commit is contained in:
Wayne 2024-05-14 15:45:36 +08:00
parent a3d175b678
commit ef81cbfbc5
4 changed files with 155 additions and 2 deletions

View File

@ -68,7 +68,9 @@ public class EnterpriseInformationController {
@PreAuthorize("@ss.hasPermission('fta:enterprise-information:query')")
public CommonResult<EnterpriseInformationRespVO> getEnterpriseInformation(@RequestParam("id") Long id) {
EnterpriseInformationDO enterpriseInformation = enterpriseInformationService.getEnterpriseInformation(id);
return success(BeanUtils.toBean(enterpriseInformation, EnterpriseInformationRespVO.class));
EnterpriseInformationRespVO respVO = BeanUtils.toBean(enterpriseInformation, EnterpriseInformationRespVO.class);
respVO = enterpriseInformationService.selectCredentialManagement(respVO);
return success(respVO);
}
@GetMapping("/page")

View File

@ -96,4 +96,96 @@ public class EnterpriseInformationRespVO {
@ExcelIgnore
private String processInstanceId;
@Schema(description = "负责人证号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String principalCertificateNumber;
@Schema(description = "负责人姓名", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String principalName;
@Schema(description = "负责人人员类型", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String principalPersonnelType;
@Schema(description = "负责人性别", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private Integer principalSex;
@Schema(description = "负责人行业类别", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String principalCategoryOfEmployment;
@Schema(description = "负责人证初领日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private LocalDate principalDateOfIssue;
@Schema(description = "负责人证到期日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private LocalDate principalExpiryDate;
@Schema(description = "负责人证签发机关", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String principalLicenceIssuingAuthority;
@Schema(description = "负责人证图片", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String principalImageUrl;
@Schema(description = "安全员证号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String securityCertificateNumber;
@Schema(description = "安全员姓名", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String securityName;
@Schema(description = "安全员人员类型", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String securityPersonnelType;
@Schema(description = "安全员性别", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private Integer securitySex;
@Schema(description = "安全员行业类别", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String securityCategoryOfEmployment;
@Schema(description = "安全员证初领日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private LocalDate securityDateOfIssue;
@Schema(description = "安全员证到期日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private LocalDate securityExpiryDate;
@Schema(description = "安全员证签发机关", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String securityLicenceIssuingAuthority;
@Schema(description = "安全员证图片", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String securityImageUrl;
@Schema(description = "危化证经营方式", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String dangerBusinessPattern;
@Schema(description = "危化证发证机关", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String dangerLicenceIssuingAuthority;
@Schema(description = "危化证发证日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private LocalDate dangerDateOfIssue;
@Schema(description = "危化证到期日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private LocalDate dangerExpiryDate;
@Schema(description = "危化证图片", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelIgnore
private String dangerImageUrl;
}

View File

@ -65,4 +65,11 @@ public interface EnterpriseInformationService {
* @param status 结果
*/
void updateEnterpriseInformationStatus(long id, Integer status);
/**
* 查询该企业信息下的证书
* @param respVO
* @return
*/
EnterpriseInformationRespVO selectCredentialManagement(EnterpriseInformationRespVO respVO);
}

View File

@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum;
import cn.iocoder.yudao.module.fta.dal.dataobject.enterpriseinformation.CredentialManagementDO;
import cn.iocoder.yudao.module.fta.dal.mysql.enterpriseinformation.CredentialManagementMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -74,7 +75,7 @@ public class EnterpriseInformationServiceImpl implements EnterpriseInformationSe
principal.setSex(createReqVO.getPrincipalSex());
principal.setCategoryOfEmployment(createReqVO.getPrincipalCategoryOfEmployment());
principal.setStatus("未通过审核");
principal.setImageUrl(createReqVO.getDangerImageUrl());
principal.setImageUrl(createReqVO.getPrincipalImageUrl());
credentialManagementMapper.insert(principal);
// 插入 企业安全员证件
@ -173,6 +174,57 @@ public class EnterpriseInformationServiceImpl implements EnterpriseInformationSe
enterpriseInformationMapper.updateById(new EnterpriseInformationDO().setId(id).setStatus(status));
}
@Override
public EnterpriseInformationRespVO selectCredentialManagement(EnterpriseInformationRespVO respVO) {
// 查询负责人证件信息
LambdaQueryWrapper<CredentialManagementDO> principalWrapper = new LambdaQueryWrapper<>();
principalWrapper.eq(CredentialManagementDO::getInformationId,respVO.getId()).eq(CredentialManagementDO::getIdType,1);
CredentialManagementDO principalCredentialManagementDO = credentialManagementMapper.selectOne(principalWrapper);
if (principalCredentialManagementDO != null) {
respVO.setPrincipalCertificateNumber(principalCredentialManagementDO.getCertificateNumber());
respVO.setPrincipalName(principalCredentialManagementDO.getName());
respVO.setPrincipalPersonnelType(principalCredentialManagementDO.getPersonnelType());
respVO.setPrincipalSex(principalCredentialManagementDO.getSex());
respVO.setPrincipalCategoryOfEmployment(principalCredentialManagementDO.getCategoryOfEmployment());
respVO.setPrincipalDateOfIssue(principalCredentialManagementDO.getDateOfIssue());
respVO.setPrincipalExpiryDate(principalCredentialManagementDO.getExpiryDate());
respVO.setPrincipalLicenceIssuingAuthority(principalCredentialManagementDO.getLicenceIssuingAuthority());
respVO.setPrincipalImageUrl(principalCredentialManagementDO.getImageUrl());
}
// 查询安全证件信息
LambdaQueryWrapper<CredentialManagementDO> securityWrapper = new LambdaQueryWrapper<>();
securityWrapper.eq(CredentialManagementDO::getInformationId,respVO.getId()).eq(CredentialManagementDO::getIdType,0);
CredentialManagementDO securityCredentialManagementDO = credentialManagementMapper.selectOne(securityWrapper);
if (securityCredentialManagementDO != null) {
respVO.setSecurityCertificateNumber(securityCredentialManagementDO.getCertificateNumber());
respVO.setSecurityName(securityCredentialManagementDO.getName());
respVO.setSecurityPersonnelType(securityCredentialManagementDO.getPersonnelType());
respVO.setSecuritySex(securityCredentialManagementDO.getSex());
respVO.setSecurityCategoryOfEmployment(securityCredentialManagementDO.getCategoryOfEmployment());
respVO.setSecurityDateOfIssue(securityCredentialManagementDO.getDateOfIssue());
respVO.setSecurityExpiryDate(securityCredentialManagementDO.getExpiryDate());
respVO.setSecurityLicenceIssuingAuthority(securityCredentialManagementDO.getLicenceIssuingAuthority());
respVO.setSecurityImageUrl(securityCredentialManagementDO.getImageUrl());
}
// 查询危化证信息
if (respVO.getIsSecure() == 1){
LambdaQueryWrapper<CredentialManagementDO> dangerWrapper = new LambdaQueryWrapper<>();
dangerWrapper.eq(CredentialManagementDO::getInformationId,respVO.getId()).eq(CredentialManagementDO::getIdType,2);
CredentialManagementDO dangerCredentialManagementDO = credentialManagementMapper.selectOne(dangerWrapper);
if (dangerCredentialManagementDO != null) {
respVO.setDangerBusinessPattern(dangerCredentialManagementDO.getBusinessPattern());
respVO.setDangerLicenceIssuingAuthority(dangerCredentialManagementDO.getLicenceIssuingAuthority());
respVO.setDangerDateOfIssue(dangerCredentialManagementDO.getDateOfIssue());
respVO.setDangerExpiryDate(dangerCredentialManagementDO.getExpiryDate());
respVO.setDangerImageUrl(dangerCredentialManagementDO.getImageUrl());
}
}
return respVO;
}
private void validateLeaveExists(Long id) {
if (enterpriseInformationMapper.selectById(id) == null) {
throw exception(ENTERPRISE_INFORMATION_NOT_EXISTS);