From f3930be134597f71ac1ffc09b0c343ee32dee7b1 Mon Sep 17 00:00:00 2001 From: luotaiqian <1147642922@qq.com> Date: Thu, 16 Jul 2026 16:21:47 +0800 Subject: [PATCH] init --- .../executor/OrgPersonnelCertExecutor.java | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/OrgPersonnelCertExecutor.java b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/OrgPersonnelCertExecutor.java index 4d3524d..af691d9 100644 --- a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/OrgPersonnelCertExecutor.java +++ b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/OrgPersonnelCertExecutor.java @@ -38,13 +38,13 @@ public class OrgPersonnelCertExecutor implements OrgPersonnelCertApi { OrgPersonnelCertEntity entity = orgPersonnelCertConvertor.addCmdToEntity(cmd); OrgPersonnelCertEntity result = orgPersonnelCertDomainService.add(entity); - return SingleResponse.success(toCO(result)); + return SingleResponse.success(orgPersonnelCertConvertor.entityToCO(result)); } @Override public SingleResponse get(Long id) { OrgPersonnelCertEntity entity = orgPersonnelCertDomainService.get(id); - return SingleResponse.success(toCO(entity)); + return SingleResponse.success(orgPersonnelCertConvertor.entityToCO(entity)); } @Override @@ -52,7 +52,7 @@ public class OrgPersonnelCertExecutor implements OrgPersonnelCertApi { OrgPersonnelCertEntity entity = orgPersonnelCertConvertor.modifyCmdToEntity(cmd); OrgPersonnelCertEntity result = orgPersonnelCertDomainService.modify(entity); - return SingleResponse.success(toCO(result)); + return SingleResponse.success(orgPersonnelCertConvertor.entityToCO(result)); } @Override @@ -79,33 +79,8 @@ public class OrgPersonnelCertExecutor implements OrgPersonnelCertApi { return PageResponse.of( pageResult.getRecords().stream() - .map(this::toCO) + .map(orgPersonnelCertConvertor::entityToCO) .collect(java.util.stream.Collectors.toList()), pageResult.getTotal()); } - - private OrgPersonnelCertCO toCO(OrgPersonnelCertEntity entity) { - if (entity == null) { - return null; - } - OrgPersonnelCertCO co = new OrgPersonnelCertCO(); - co.setId(entity.getId()); - co.setPersonnelId(entity.getPersonnelId()); - co.setCertName(entity.getCertName()); - co.setCertTypeCode(entity.getCertTypeCode()); - co.setCertTypeName(entity.getCertTypeName()); - co.setCertCategoryCode(entity.getCertCategoryCode()); - co.setCertCategoryName(entity.getCertCategoryName()); - co.setOperationCategoryCode(entity.getOperationCategoryCode()); - co.setOperationCategoryName(entity.getOperationCategoryName()); - co.setCertNo(entity.getCertNo()); - co.setIssueOrg(entity.getIssueOrg()); - co.setValidStartDate(entity.getValidStartDate()); - co.setValidEndDate(entity.getValidEndDate()); - co.setReviewDate(entity.getReviewDate()); - co.setCertAttachmentUrl(entity.getCertAttachmentUrl()); - co.setBusinessScope(entity.getBusinessScope()); - co.setTenantId(entity.getTenantId()); - return co; - } }