| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.Coach; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.activity.IntroduceRewardsClient; |
| | |
| | | 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.NoticeClient; |
| | | import com.dsh.account.feignclient.other.QuestionClient; |
| | | import com.dsh.account.feignclient.other.StoreClient; |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.account.feignclient.other.model.StoreInfo; |
| | | import com.dsh.account.feignclient.other.model.StoreLonLatList; |
| | | import com.dsh.account.feignclient.other.model.SysNotice; |
| | | import com.dsh.account.mapper.CoachMapper; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.vo.classDetails.ClasspaymentRequest; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuListVo; |
| | | import com.dsh.account.model.vo.exploreDetail.ExploreDatasVo; |
| | | import com.dsh.account.model.vo.exploreDetail.LonLatRequest; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionDetailsVo; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionIns; |
| | | 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.DateUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private NoticeClient noClient; |
| | | |
| | | @Autowired |
| | | private QuestionClient quesClient; |
| | | |
| | | @Autowired |
| | | private TAppUserMapper tauMapper; |
| | | |
| | | @Autowired |
| | | private CoachMapper coachMapper; |
| | | |
| | | @Override |
| | | public void addStuOfAppUser(StuDetailsReq stu,Integer appUserId) { |
| | |
| | | purchaseRecordVoList.addAll(purchaseRecordVos); |
| | | List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>() |
| | | .eq("referralUserId",appUserId ) |
| | | .between("insertTime",timeRequest.getStartTime() ,timeRequest.getEndTime())); |
| | | .between("insertTime",startTime ,endTime)); |
| | | List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(startTime, endTime, userIds); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | |
| | | CourseDetailsOfContinuationResp resp = new CourseDetailsOfContinuationResp(); |
| | | |
| | | StudentOfCourseVo studentCourse = couPayClient.getStudentCourse(lessonId,stuId,appUserId); |
| | | resp.setCoursePackageId(studentCourse.getCoursePackageId()); |
| | | resp.setStuId(stuId); |
| | | resp.setPackageImg(studentCourse.getPackageImg()); |
| | | resp.setCourseName(studentCourse.getCourseName()); |
| | | Coach coach = coachMapper.selectById(studentCourse.getCoachId()); |
| | | resp.setTeacherName(coach.getName()); |
| | | resp.setCourseWeek(studentCourse.getCourseWeek()); |
| | | resp.setCourseTime(studentCourse.getCourseTime()); |
| | | |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(studentCourse.getStoreId()); |
| | | resp.setStoreName(courseOfStore.getStoreName()); |
| | | resp.setStoreAddr(courseOfStore.getStoreAddr()); |
| | | |
| | | resp.setTypeList(studentCourse.getTypeList()); |
| | | TStudent tStudent = this.baseMapper.selectById(stuId); |
| | | resp.setStuName(tStudent.getName()); |
| | | resp.setStuPhone(tStudent.getPhone()); |
| | | resp.setStuAge(DateUtil.age(tStudent.getBirthday())); |
| | | resp.setAmount(studentCourse.getAmount()); |
| | | resp.setVipAmount(studentCourse.getVipAmount()); |
| | | resp.setWpGold(studentCourse.getWpGold()); |
| | | return resp; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysNotice> querySystemNoticeDetails() { |
| | | return noClient.getSysNoticeDetails(); |
| | | } |
| | | |
| | | @Override |
| | | public SysNotice queryNoticeData(Integer noId) { |
| | | return noClient.getSysNoticeBuId(noId); |
| | | } |
| | | |
| | | @Override |
| | | public QuestionDetailsVo queryQuestionData() { |
| | | return quesClient.getSysQuestionDetails(); |
| | | } |
| | | |
| | | @Override |
| | | public QuestionIns queryQuestionDataInfo(Integer quesId) { |
| | | return quesClient.getSysQuestionBuId(quesId); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> queryCustomerDetails() { |
| | | return noClient.queryCustomerTel(); |
| | | } |
| | | |
| | | @Override |
| | | public ExploreDatasVo queryIndexOfExplores(LonLatRequest llrequest) { |
| | | ExploreDatasVo datasVo = new ExploreDatasVo(); |
| | | List<StoreInfo> allNearbyStoreList = storeClient.getAllNearbyStoreList(llrequest.getLongitude(),llrequest.getLatitude()); |
| | | List<StoreLonLatList> allStoreLonLats = storeClient.getAllStoreLonLats(llrequest.getLongitude(), llrequest.getLatitude()); |
| | | datasVo.setStoreLists(allNearbyStoreList); |
| | | datasVo.setLonLatLists(allStoreLonLats); |
| | | return datasVo; |
| | | } |
| | | |
| | | @Override |
| | | public List<StuListVo> switchStudentActions(Integer appUserId, Integer stuId) { |
| | | List<StuListVo> stuListVos = new ArrayList<>(); |
| | | List<TStudent> tStudents = this.baseMapper.selectList(new QueryWrapper<TStudent>() |
| | | .eq("appUserId", appUserId) |
| | | .eq("state",1)); |
| | | if (tStudents.size() > 0) { |
| | | tStudents.forEach(sts -> { |
| | | if (Objects.equals(sts.getId(), stuId)) { |
| | | sts.setIsDefault(1); |
| | | } else { |
| | | sts.setIsDefault(2); |
| | | } |
| | | this.baseMapper.updateById(sts); |
| | | |
| | | StuListVo vo = new StuListVo(); |
| | | vo.setStuId(sts.getId()); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | vo.setBirthday(simpleDateFormat.format(sts.getBirthday())); |
| | | vo.setStuName(sts.getName()); |
| | | vo.setStuAge(DateUtil.age(sts.getBirthday())); |
| | | vo.setStuHeight(sts.getHeight()); |
| | | vo.setStuWeight(sts.getWeight()); |
| | | vo.setIsNot(sts.getIsDefault()); |
| | | stuListVos.add(vo); |
| | | }); |
| | | } |
| | | return stuListVos; |
| | | } |
| | | |
| | | |
| | |
| | | return purchaseRecords; |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil renewClassPayment(Integer userIdFormRedis, ClasspaymentRequest request) { |
| | | // TODO: 2023/7/5 |
| | | switch (request.getPayType()){ |
| | | case 1: |
| | | WeChatPayment(); |
| | | break; |
| | | case 2: |
| | | AlipayPayment(); |
| | | break; |
| | | case 3: |
| | | PlaypaiGoldPayment(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | public void WeChatPayment(){ |
| | | |
| | | } |
| | | |
| | | public void AlipayPayment(){ |
| | | |
| | | } |
| | | |
| | | public void PlaypaiGoldPayment(){ |
| | | |
| | | } |
| | | |
| | | |
| | | } |