init
parent
1061187a28
commit
f3930be134
|
|
@ -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<OrgPersonnelCertCO> 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue