|
|
@ -348,19 +348,10 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
Result<RegisterRelationDTO> registerRelation = userOpenFeignClient.resiRelationInfo(tokenDto.getUserId()); |
|
|
|
if (!registerRelation.success()){ |
|
|
|
throw new EpmetException(String.format("查询居民{%s}信息失败",tokenDto.getUserId())); |
|
|
|
} |
|
|
|
IcMatterAppointmentRecordEntity e = ConvertUtils.sourceToTarget(formDTO, IcMatterAppointmentRecordEntity.class); |
|
|
|
e.setCustomerId(customerId); |
|
|
|
if (StringUtils.isNotBlank(formDTO.getOrgId())){ |
|
|
|
e.setOrgId(formDTO.getOrgId()); |
|
|
|
e.setOrgType(formDTO.getOrgType()); |
|
|
|
}else { |
|
|
|
e.setOrgId(registerRelation.getData().getGridId()); |
|
|
|
e.setOrgType(PartyServiceCenterConstant.ORG_TYPE_GRID); |
|
|
|
} |
|
|
|
e.setOrgId(formDTO.getOrgId()); |
|
|
|
e.setOrgType(formDTO.getOrgType()); |
|
|
|
if (e.getOrgType().equals(PartyServiceCenterConstant.ORG_TYPE_GRID)){ |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(e.getOrgId()); |
|
|
|
if (null == gridInfo){ |
|
|
@ -540,10 +531,24 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
@Override |
|
|
|
public List<AppointmentRecordResultDTO> appointmentRecordMini(AppointmentRecordMiniFormDTO formDTO,TokenDto tokenDto) { |
|
|
|
List<AppointmentRecordResultDTO> result = matterAppointmentRecordDao.appointmentRecordMini(formDTO.getGridId(), tokenDto.getUserId()); |
|
|
|
if (CollectionUtils.isNotEmpty(result)){ |
|
|
|
return result; |
|
|
|
if (CollectionUtils.isEmpty(result)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
return new ArrayList<>(); |
|
|
|
List<AllMattersResultDTO> allMatters = baseDao.getAllMattersByOrgId(result.stream().map(m -> m.getMatterId()).collect(Collectors.toList())); |
|
|
|
allMatters.forEach(matter -> { |
|
|
|
List<TimeDTO> timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY); |
|
|
|
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE); |
|
|
|
result.forEach(r -> { |
|
|
|
if (r.getMatterId().equals(matter.getMatterId())){ |
|
|
|
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); |
|
|
|
List<String> time = new ArrayList<>(); |
|
|
|
List<String> list = Arrays.asList(r.getTimeId().split(",")); |
|
|
|
list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); |
|
|
|
r.setAppointmentTime(time); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|