| | |
| | | if (null == appUserId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | TAppGift one = appGiftService.getOne(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, appUserId)); |
| | | |
| | | return ResultUtil.success(one == null ? 0 : one.getNum()); |
| | | Integer num = 0; |
| | | List<TAppGift> list = appGiftService.list(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, appUserId)); |
| | | for (TAppGift tAppGift : list) { |
| | | num += tAppGift.getNum(); |
| | | } |
| | | return ResultUtil.success(num); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "记录id", name = "detailsId", required = true, dataType = "string"), |
| | | }) |
| | | public ResultUtil<PointDetailsVo> redemptionDetails(Long detailsId) { |
| | | // try { |
| | | PointDetailsVo pointDetailsVo = uicService.queryRedemptionDetails(detailsId); |
| | | pointDetailsVo.getPics().remove(0); |
| | | return ResultUtil.success(pointDetailsVo); |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | ArrayList<String> list1 = new ArrayList<>(list11); |
| | | list1.add(coursePackage.getCoverDrawing()); |
| | | detailsVo.setPics(list1); |
| | | detailsVo.setClassHours(0); |
| | | if(coursePackage.getType() != 3){ |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = cpClient.queryConfigCoursePackData(pmdsServiceById.getCoursePackageConfigId()); |
| | | detailsVo.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | } |
| | | Collections.sort(detailsVo.getPics(), (s1, s2) -> { |
| | | if (s1.equals(coursePackage.getCoverDrawing())) { |
| | | return -1; // s1排在前面 |
| | |
| | | package com.dsh.activity.feignclient.course.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | |
| | | * 最多预约人数 |
| | | */ |
| | | private Integer maxSubscribeNumber; |
| | | |
| | | private Integer codeTime; |
| | | /** |
| | | * 上课开始时间 |
| | | */ |
| | |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 支付方式(1=微信,2=支付宝,3=玩湃币,4=积分,5=积分+微信,6=积分+支付宝) |
| | | * 支付方式(1=现金,2=玩湃币) |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 有效天数 |
| | | */ |
| | | private Integer validDays; |
| | | /** |
| | | * 课后练习课程id |
| | | */ |
| | | private Integer courseId; |
| | | /** |
| | | * 课后练习视频介绍 |
| | | */ |
| | | private String introduce; |
| | | /** |
| | | * 完成课后练习获取积分 |
| | | */ |
| | | private Integer integral; |
| | | /** |
| | | * 课程状态(1=未开始,2=进行中,3=已结束,4=已取消) |
| | | */ |
| | |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | private Integer type; |
| | | private Integer needNum; |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
| | |
| | | DATE_FORMAT(b.endTime, '%Y-%m-%d') as endTime |
| | | from t_user_coupon a |
| | | left join t_coupon b on (a.couponId = b.id) |
| | | where a.`status` = 1 and b.type != 3 and a.userId = #{uid} and |
| | | where a.`status` = 1 and b.type != 3 and (now() between b.startTime and b.endTime) and a.userId = #{uid} and |
| | | ( |
| | | b.useScope = 1 or (b.useScope = 2 and b.id IN (SELECT couponId FROM t_coupon_city where provinceCode = #{provinceCode} and cityCode = #{cityCode}) ) |
| | | or (b.useScope = 3 and b.id in (select couponId from t_coupon_store where storeId = #{storeId}))) |
| | |
| | | |
| | | List<CoursePackageStudent> list4 = cspsService.list(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getAppUserId, courseDetailReq.getAppUserId()) |
| | | .eq(CoursePackageStudent::getStudentId, courseDetailReq.getStuId()) |
| | | .eq(CoursePackageStudent::getCoursePackageId, tCoursePackage.getId()) |
| | | .in(CoursePackageStudent::getCoursePackageSchedulingId, collect2) |
| | | ); |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | .eq("status", 1) |
| | | .orderByDesc("insertTime")); |
| | | |
| | | List<Integer> ids = new ArrayList<>(); |
| | | for (CoursePackageOrderStudent tCoursePackagePayment : tCoursePackagePayments) { |
| | | ids.add(tCoursePackagePayment.getCoursePackageId()); |
| | | } |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 23, 59, 59); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<CoursePackageScheduling> list = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>() |
| | | .eq("appUserId", appUserId) |
| | | .eq("studentId", stuId) |
| | | .lt("classDate", sdf.format(calendar.getTime())) |
| | | .orderByAsc("classDate") |
| | | ); |
| | | List<Long> ids = list.stream().map(CoursePackageScheduling::getId).collect(Collectors.toList()); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd"); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); |
| | | if (tCoursePackagePayments.size() > 0) { |
| | | if (list.size() > 0) { |
| | | |
| | | // int pageNum = 1; // 页码 |
| | | int pageSize = 10; // 每页记录数 |
| | | Page<CoursePackageStudent> page = new Page<>(pageNum, pageSize); |
| | | IPage<CoursePackageStudent> coursePackageStudentPage = cpsMapper.selectPage(page, new QueryWrapper<CoursePackageStudent>() |
| | | .in("coursePackageId", ids) |
| | | .eq("studentId", stuId) |
| | | .eq("appUserId", appUserId) |
| | | .in("coursePackageSchedulingId", ids) |
| | | .eq("reservationStatus", 1)); |
| | | List<CoursePackageStudent> coursePackageStudent1 = coursePackageStudentPage.getRecords(); |
| | | |
| | |
| | | if (byId == null) { |
| | | continue; |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String dateString1 = sdf.format(byId.getClassDate()); |
| | | String dateString2 = sdf.format(byId.getEndDate()); |
| | | |
| | |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId, String lon, String lat) { |
| | | AppUser appUser = appuClient.queryAppUser(appUserId); |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | CoursePackageOrderStudent coursePackageOrderStudent = coursePackageOrderStudentService.getById(coursePayId); |
| | | CoursePackageOrder coursePackageOrder = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("appUserId", coursePackageOrderStudent.getAppUserId()) |
| | | .eq("coursePackageId", coursePackageOrderStudent.getCoursePackageId()) |
| | | .eq("payStatus", 2) |
| | | .eq("state", 1) |
| | | .like("studentIds", coursePackageOrderStudent.getStudentId()) |
| | | .orderByDesc("insertTime") |
| | | .last(" limit 0, 1") |
| | | ); |
| | | CoursePackageOrder coursePackageOrder = coursePackageOrderService.getById(coursePayId); |
| | | |
| | | |
| | | response.setChooseHours(coursePackageOrder.getClassHours()); |
| | |
| | | TCoursePackage coursePackage = coursePackageService.getById(coursePackageOrder.getCoursePackageId()); |
| | | String[] split = coursePackageOrder.getStudentIds().split(";"); |
| | | for (String id : split) { |
| | | if(coursePackage.getType() == 1){ |
| | | CoursePackageOrderStudent coursePackageOrderStudent = coursePackageOrderStudentService.getOne(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", id) |
| | | .eq("coursePackageId", coursePackageOrder.getCoursePackageId()).eq("status", 1).eq("state", 1)); |
| | | if (null == coursePackageOrderStudent) { |
| | |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent); |
| | | } |
| | | } |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackageOrderStudent.getId()); |
| | | courseCounsum.setChangeType(1); |
| | |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsumService.save(courseCounsum); |
| | | } |
| | | if(coursePackage.getType() == 2){ |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), null); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |