diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java index 562dbb8..a8e1070 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java @@ -68,7 +68,9 @@ public class EnterpriseInformationController { @PreAuthorize("@ss.hasPermission('fta:enterprise-information:query')") public CommonResult 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") diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java index 685bd0c..c0b19cb 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java @@ -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; + } diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java index e4a044d..0b7db64 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java @@ -65,4 +65,11 @@ public interface EnterpriseInformationService { * @param status 结果 */ void updateEnterpriseInformationStatus(long id, Integer status); + + /** + * 查询该企业信息下的证书 + * @param respVO + * @return + */ + EnterpriseInformationRespVO selectCredentialManagement(EnterpriseInformationRespVO respVO); } diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java index d5a2fb0..3b03577 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java @@ -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 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 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 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);