diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ff22940cb5..f7bef02d54 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -149,6 +149,9 @@ public enum EpmetErrorCode { // 删除可预约事项存在预约记录时提示 MATTER_EXISTS_APPOINTMENT_ERROR(8526, "尚有未履行的预约存在,请确认后操作"), + // 预约某事项在某时间段存在记录时 + APPOINTMENT_TIME_ERROR(8527, "该时间段已被预约,请选择其他时间段"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 03344c2a5e..382e65c112 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -231,8 +231,21 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl l = new LambdaQueryWrapper<>(); + l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) + .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getAppointmentDate()) + .eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING) + .eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO); + List records = matterAppointmentRecordDao.selectList(l); + if (CollectionUtils.isNotEmpty(records)){ + List timeIds = new ArrayList<>(); + records.forEach(r -> { + timeIds.addAll(Arrays.asList(r.getTimeId().split(","))); + }); + if (timeIds.retainAll(Arrays.asList(formDTO.getTimeId().split(",")))){ + throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode()); + } + } CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); if (null == staffInfo){ throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId()));