| | |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.activity.IntroduceRewardsClient; |
| | | import com.dsh.account.feignclient.activity.UserConponClient; |
| | | import com.dsh.account.feignclient.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.CancelListClient; |
| | |
| | | import com.dsh.account.feignclient.course.CourseSessionNameClient; |
| | | import com.dsh.account.feignclient.course.model.StuSessionDetailsVo; |
| | | import com.dsh.account.feignclient.course.model.StuWithCoursesListVo; |
| | | import com.dsh.account.feignclient.course.model.StudentOfCourseVo; |
| | | import com.dsh.account.feignclient.other.StoreClient; |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp; |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.util.DateTimeHelper; |
| | | import com.dsh.account.util.ToolUtil; |
| | |
| | | |
| | | @Autowired |
| | | private CoursePaymentClient couPayClient; |
| | | |
| | | @Autowired |
| | | private UserConponClient userCClient; |
| | | |
| | | @Autowired |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private TAppUserMapper tauMapper; |
| | |
| | | return insVo; |
| | | } |
| | | |
| | | @Override |
| | | public List<PurchaseRecordVo> queryDeduRecordDetails(RecordTimeRequest timeRequest,Integer appUserId) { |
| | | List<PurchaseRecordVo> purchaseRecordVoList = new ArrayList<>(); |
| | | Date startTime = DateTimeHelper.getCurrentIdetMouthStart(timeRequest.getStartTime()); |
| | | Date endTime = DateTimeHelper.getCurrentIdeaMouthEnd(timeRequest.getEndTime()); |
| | | |
| | | List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList(startTime,endTime,appUserId); |
| | | purchaseRecordVoList.addAll(stuSourseList); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(startTime,endTime,timeRequest.getStuId(),appUserId); |
| | | purchaseRecordVoList.addAll(cancelCourseList); |
| | | List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(startTime,endTime,timeRequest.getStuId(),appUserId); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos); |
| | | List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>() |
| | | .eq("referralUserId",appUserId ) |
| | | .between("insertTime",timeRequest.getStartTime() ,timeRequest.getEndTime())); |
| | | List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(startTime, endTime, userIds); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | | |
| | | purchaseRecordVoList = dealDataOfTime(purchaseRecordVoList); |
| | | return purchaseRecordVoList; |
| | | } |
| | | |
| | | @Override |
| | | public List<CouponStuAvailableVo> queryStuOfConponDetails(Integer appUserId) { |
| | | List<CouponStuAvailableVo> availableVos = new ArrayList<>(); |
| | | availableVos = userCClient.queryUserWithConponList(appUserId); |
| | | return availableVos; |
| | | } |
| | | |
| | | @Override |
| | | public CourseDetailsOfContinuationResp queryStuOfCourseDetails(Integer lessonId, Integer stuId, Integer appUserId) { |
| | | CourseDetailsOfContinuationResp resp = new CourseDetailsOfContinuationResp(); |
| | | |
| | | StudentOfCourseVo studentCourse = couPayClient.getStudentCourse(lessonId,stuId,appUserId); |
| | | |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(studentCourse.getStoreId()); |
| | | |
| | | return resp; |
| | | } |
| | | |
| | | |
| | | public static List<PurchaseRecordVo> dealDataOfTime(List<PurchaseRecordVo> purchaseRecords) { |
| | | Collections.sort(purchaseRecords, new Comparator<PurchaseRecordVo>() { |
| | |
| | | return purchaseRecords; |
| | | } |
| | | |
| | | |
| | | // public static List<String> dealDataOfTime(List<String> timeStrings) { |
| | | // Collections.sort(timeStrings, new Comparator<String>() { |
| | | // @Override |
| | | // public int compare(String time1, String time2) { |
| | | // String[] parts1 = time1.split(" "); |
| | | // String[] parts2 = time2.split(" "); |
| | | // String[] dateParts1 = parts1[0].split("-"); |
| | | // String[] dateParts2 = parts2[0].split("-"); |
| | | // String[] timeParts1 = parts1[1].split(":"); |
| | | // String[] timeParts2 = parts2[1].split(":"); |
| | | // int month1 = Integer.parseInt(dateParts1[0]); |
| | | // int day1 = Integer.parseInt(dateParts1[1]); |
| | | // int hour1 = Integer.parseInt(timeParts1[0]); |
| | | // int minute1 = Integer.parseInt(timeParts1[1]); |
| | | // int month2 = Integer.parseInt(dateParts2[0]); |
| | | // int day2 = Integer.parseInt(dateParts2[1]); |
| | | // int hour2 = Integer.parseInt(timeParts2[0]); |
| | | // int minute2 = Integer.parseInt(timeParts2[1]); |
| | | // // 倒序排序 |
| | | // if (month1 != month2) { |
| | | // return month2 - month1; |
| | | // } else if (day1 != day2) { |
| | | // return day2 - day1; |
| | | // } else if (hour1 != hour2) { |
| | | // return hour2 - hour1; |
| | | // } else { |
| | | // return minute2 - minute1; |
| | | // } |
| | | // } |
| | | // }); |
| | | // return timeStrings; |
| | | // } |
| | | } |