| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.enums.WeeksEnum; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.model.CourseOfStoreVo; |
| | | import com.dsh.account.feignclient.course.model.StuCourseResp; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.feignclient.other.ImgConfigClient; |
| | | import com.dsh.account.feignclient.other.model.TImgConfig; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.AddAppUserVo; |
| | | import com.dsh.account.model.LoginSMSCodeVo; |
| | | import com.dsh.account.model.LoginWeChatVo; |
| | | import com.dsh.account.model.vo.classDetails.CourseVenue; |
| | | import com.dsh.account.model.vo.classDetails.RegisteredCourse; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.model.vo.classDetails.WeekedCourse; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; |
| | | |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.util.*; |
| | | import com.dsh.account.util.akeylogin.Md5Util; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | private JwtTokenUtil jwtTokenUtil; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private CoursePaymentClient paymentClient; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id,String longitude,String latitude) { |
| | | TAppUser tAppUser = this.baseMapper.selectById(id); |
| | |
| | | classInfoVo.setDeductedNums(deduct); |
| | | classInfoVo.setRemainingNums(remain); |
| | | |
| | | List<CourseOfStoreVo> storeOfCourses = paymentClient.getStoreOfCourses(); |
| | | |
| | | List<WeekedCourse> courses = new ArrayList<>(); |
| | | |
| | | |
| | | |
| | | |
| | | if (storeOfCourses.size() > 0){ |
| | | Map<Integer, List<CourseOfStoreVo>> map = storeOfCourses.stream().collect(Collectors.groupingBy(CourseOfStoreVo::getStoreId)); |
| | | for (Map.Entry<Integer, List<CourseOfStoreVo>> integerListEntry : map.entrySet()) { |
| | | WeekedCourse weekedCourse = new WeekedCourse(); |
| | | |
| | | Integer key = integerListEntry.getKey(); |
| | | System.out.println(key); |
| | | List<CourseOfStoreVo> value = integerListEntry.getValue(); |
| | | System.out.println(value); |
| | | } |
| | | |
| | | } |
| | | // classInfoVo.setWeekCourseList(); |
| | | }else { |
| | | classInfoVo.setIsThere(2); |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 处理数据 |
| | | * @param storeOfCourses |
| | | * @return |
| | | */ |
| | | public List<WeekedCourse> dealDatas(List<CourseOfStoreVo> storeOfCourses){ |
| | | List<WeekedCourse> weekedCourses = new ArrayList<>(); |
| | | |
| | | int weekStr = LocalDateTimeUtils.getWeekStr(); |
| | | for (int i = 1; i < 8; i++) { |
| | | if (weekStr == i){ |
| | | for (CourseOfStoreVo storeOfCours : storeOfCourses) { |
| | | String[] split = storeOfCours.getClassWeeks().split(";"); |
| | | List<String> list = Arrays.asList(split); |
| | | if (list.contains(weekStr)){ |
| | | WeekedCourse weekedCourse = new WeekedCourse(); |
| | | weekedCourse.setIsToday(1); |
| | | weekedCourse.setWeekNum(weekStr); |
| | | weekedCourse.setWeekStr(WeeksEnum.getStr(weekStr)); |
| | | String weekOfDays = LocalDateTimeUtils.getWeekOfDays(weekStr); |
| | | weekedCourse.setDayStr(weekOfDays); |
| | | |
| | | List<CourseVenue> courseVenues = new ArrayList<>(); |
| | | // courseVenues.add(); |
| | | weekedCourse.setDetails(courseVenues); |
| | | } |
| | | } |
| | | }else { |
| | | for (CourseOfStoreVo storeOfCours : storeOfCourses) { |
| | | String[] split = storeOfCours.getClassWeeks().split(";"); |
| | | List<String> list = Arrays.asList(split); |
| | | if (list.contains(i)){ |
| | | WeekedCourse weekedCourse = new WeekedCourse(); |
| | | weekedCourse.setIsToday(1); |
| | | weekedCourse.setWeekNum(weekStr); |
| | | weekedCourse.setWeekStr(WeeksEnum.getStr(weekStr)); |
| | | String weekOfDays = LocalDateTimeUtils.getWeekOfDays(weekStr); |
| | | weekedCourse.setDayStr(weekOfDays); |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return weekedCourses; |
| | | } |
| | | |
| | | |
| | | /** |