| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AppointmentRecordVo getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search) { |
| | | AppointmentRecordVo recordVo = new AppointmentRecordVo(); |
| | | TStudent tStudent = this.baseMapper.selectOne(new QueryWrapper<TStudent>() |
| | | .eq("id",stuId ) |
| | | .eq("appUserId",appUserId)); |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | recordVo.setStuId(tStudent.getId()); |
| | | recordVo.setStuName(tStudent.getName()); |
| | | WeeksOfCourseRest courseRest = new WeeksOfCourseRest(); |
| | | courseRest.setAppUserId(appUserId); |
| | | courseRest.setStuId(stuId); |
| | | List<RecordAppoint> recordAppoints = couPayClient.obtainStudentClassDetailsData(courseRest); |
| | | if (ToolUtil.isEmpty(appointStatus)){ |
| | | recordVo.setAppointStatus(0); |
| | | }else { |
| | | recordVo.setAppointStatus(appointStatus); |
| | | if (recordAppoints.size() > 0 ){ |
| | | public List<RecordAppoint> getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search) { |
| | | WeeksOfCourseRest courseRest = new WeeksOfCourseRest(); |
| | | courseRest.setAppUserId(appUserId); |
| | | courseRest.setStuId(stuId); |
| | | List<RecordAppoint> recordAppoints = couPayClient.obtainStudentClassDetailsData(courseRest); |
| | | if (recordAppoints.size() > 0) { |
| | | if (ToolUtil.isNotEmpty(appointStatus) && appointStatus != 0) { |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getStatus().equals(appointStatus)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(search)){ |
| | | recordVo.setAppointStatus(appointStatus); |
| | | if (recordAppoints.size() > 0 ){ |
| | | if (ToolUtil.isNotEmpty(search)) { |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getCoursePackageName().contains(search)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(timeType)){ |
| | | |
| | | if (ToolUtil.isNotEmpty(timeType) && timeType != 0) { |
| | | Date lastOfDate = DateUtil.getLastOfDate(); |
| | | switch (timeType){ |
| | | switch (timeType) { |
| | | case 1: |
| | | Date lastWeekStartDate = DateUtil.getLastWeekStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 2: |
| | | Date lastMonthStartDate = DateUtil.getLastMonthStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 3: |
| | | Date lastYearStartDate = DateUtil.getLastYearStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | break; |
| | | |
| | | } |
| | | } |
| | | recordVo.setAppointList(recordAppoints); |
| | | } |
| | | return recordVo; |
| | | return recordAppoints; |
| | | } |
| | | |
| | | @Override |