diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java index 290a583e7e..ffd71c8489 100755 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java @@ -127,13 +127,18 @@ public class WorkdiaryServiceRecordServiceImpl extends BaseServiceImpl entity.setOrgIdPath(gi.getPids().concat(":").concat(gi.getId()))); + .ifPresent(gi -> { + entity.setOrgIdPath(gi.getPids().concat(":").concat(gi.getId())); + entity.setAgencyId(gi.getPid()); + }); IcResiUserDTO applicant = getResultDataOrThrowsException(userOpenFeignClient.getIcResiUserDTO(dto.getApplicantId()), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未找到申请人信息"); + entity.setCustomerId(EpmetRequestHolder.getLoginUserCustomerId()); if (applicant != null) { entity.setApplicantName(applicant.getName()); + entity.setCustomerId(applicant.getCustomerId()); } insert(entity); } @@ -142,6 +147,26 @@ public class WorkdiaryServiceRecordServiceImpl extends BaseServiceImpl { + entity.setOrgIdPath(gi.getPids().concat(":").concat(gi.getId())); + entity.setAgencyId(gi.getPid()); + }); + } + + if (StringUtils.isNotBlank(dto.getApplicantId())) { + IcResiUserDTO applicant = getResultDataOrThrowsException(userOpenFeignClient.getIcResiUserDTO(dto.getApplicantId()), ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未找到申请人信息"); + + if (applicant != null) { + entity.setApplicantName(applicant.getName()); + entity.setCustomerId(applicant.getCustomerId()); + } + } + updateById(entity); }