| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackagePaymentConfig; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.entity.TCoursePackageType; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.model.StoreOfCourseVo; |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | |
| | | import com.dsh.course.model.QueryExamineCoursePackageLists; |
| | | import com.dsh.course.model.vo.response.Details; |
| | | import com.dsh.course.model.vo.response.ExchangeCoursePackageResponse; |
| | | import com.dsh.course.service.ICoursePackagePaymentConfigService; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.service.*; |
| | | import com.dsh.course.util.PageFactory; |
| | | import com.dsh.course.util.ResultUtil; |
| | | import com.dsh.course.util.TokenUtil; |
| | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据门店ids获取课包ids 根据课包ids 获取购课记录的用户ids |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePackage/getCoursePackageByStoreIds") |
| | | public List<Integer> getCoursePackageByStoreIds(@RequestBody List<Integer> storeIds){ |
| | | try { |
| | | // 获取当前课包的ids |
| | | List<Integer> courseIds = coursePackageService.list(new QueryWrapper<TCoursePackage>().in("storeId", storeIds)) |
| | | .stream().map(TCoursePackage::getId).collect(Collectors.toList()); |
| | | if (courseIds.size() == 0){ |
| | | return new ArrayList<>(); |
| | | }else{ |
| | | List<Integer> userIds = tcppmenService.list(new QueryWrapper<TCoursePackagePayment>().in("coursePackageId", courseIds)) |
| | | .stream().map(TCoursePackagePayment::getAppUserId).collect(Collectors.toList()); |
| | | return userIds; |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取课包 |
| | |
| | | |
| | | |
| | | return packagePaymentService.listStoreId(code); |
| | | } |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | @Autowired |
| | | private UserVideoDetailsService userVideoDetailsService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePackage/counts") |
| | | public Integer counts(@RequestBody Integer stuId){ |
| | | return coursePackageStudentService.count(new QueryWrapper<CoursePackageStudent>().eq("signInOrNot",1).eq("studentId",stuId)); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePackage/counts1") |
| | | public Integer counts1(@RequestBody Integer stuId){ |
| | | return userVideoDetailsService.count(new QueryWrapper<UserVideoDetails>().eq("appUserId",stuId)) ; |
| | | |
| | | } |
| | | /** |
| | | * 根据id获取课包 |
| | |
| | | @ApiImplicitParam(name = "lat",value = "纬度",dataType = "String"), |
| | | }) |
| | | public ResultUtil<ExchangeCoursePackageResponse> discountCourseDatas(Integer coursePackageDiscountId,String lon,String lat){ |
| | | try { |
| | | // try { |
| | | return ResultUtil.success(tcpdService.getWeekFreeCourseDetails(coursePackageDiscountId,lat,lon)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | courseVo.setCourseId(coursePackage.getId()); |
| | | courseVo.setName(coursePackage.getName()+"(" + store.getName() + ")"); |
| | | courseVo.setClassStartTime(coursePackage.getClassStartTime() +"-"+ coursePackage.getClassEndTime()); |
| | | courseVo.setCoverDrawing(coursePackage.getCoverDrawing()); |
| | | courseVo.setApplicantsNumber(count); |
| | | List<CoursePackagePaymentConfig> list1 = icppconfigService.list(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId",coursePackage.getId())); |