| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 已报名课程列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/registeredCourses") |
| | | @ApiOperation(value = "已报名课程列表", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<RegisterCourseVo>> queryRegisteredCoursesDetails(@RequestParam("stuId") Integer stuId){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.dsh.account.feignclient.activity; |
| | | |
| | | |
| | | import com.dsh.account.feignclient.activity.model.IntrduceOfUserRequest; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | |
| | | |
| | | |
| | | @PostMapping("/base/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestParam("startTime") Date startTime, |
| | | @RequestParam("endTime") Date endTime, |
| | | @RequestParam("userIds") List<Integer> userIds); |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody IntrduceOfUserRequest request); |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.dsh.account.feignclient.activity.model; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class IntrduceOfUserRequest { |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | private List<Integer> userIds; |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-competition") |
| | | public interface DeductionCompetitionsClient { |
| | | @PostMapping("/base/competition/getCompetitionsDetails") |
| | | List<PurchaseRecordVo> getStuSourseList(GetStuSourseList getStuSourseList); |
| | | List<PurchaseRecordVo> getStuSourseList(@RequestBody GetStuSourseList getStuSourseList); |
| | | |
| | | } |
| | |
| | | package com.dsh.account.feignclient.course; |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.GetStuSessionList; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CancelListClient { |
| | | |
| | | @PostMapping("/base/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestParam("startTime") Date startTime, |
| | | @RequestParam("endTime") Date endTime, |
| | | @RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody GetStuSessionList sessionList); |
| | | |
| | | } |
| | |
| | | import com.dsh.account.feignclient.course.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | |
| | | List<CourseOfStoreVo> getStoreOfCourses(); |
| | | |
| | | @PostMapping("/base/coursePack/stuOfCourses") |
| | | StuWithCoursesListVo getStuOfCoursesDetails(GetStuOfCoursesDetails getStuOfCoursesDetails); |
| | | StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody GetStuOfCoursesDetails getStuOfCoursesDetails); |
| | | |
| | | @PostMapping("/base/coursePack/continuingCourse") |
| | | StudentOfCourseVo getStudentCourse(GetStudentCourse getStudentCourse); |
| | | StudentOfCourseVo getStudentCourse(@RequestBody GetStudentCourse getStudentCourse); |
| | | |
| | | @PostMapping("/base/coursePack/afterCourseTwos") |
| | | List<AfterVideoVo> getAfterCourseTwos(@RequestParam("appUserId") Integer appUserId); |
| | |
| | | package com.dsh.account.feignclient.course; |
| | | |
| | | import com.dsh.account.feignclient.course.model.GetStudentCourse; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CourseRecordClient { |
| | | |
| | | @PostMapping("/base/courseRecord/queryDeduClassHours") |
| | | public Integer getDeductionClassHour(@RequestParam("courseId") Integer courseId, |
| | | @RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | public Integer getDeductionClassHour(@RequestBody GetStudentCourse course); |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/sessionNames") |
| | | List<StuSessionDetailsVo> getStuSessionList(GetStuSessionList getStuSessionList); |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestBody GetStuSessionList getStuSessionList); |
| | | |
| | | @PostMapping("/base/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(GetStuSessionList getStuSessionList); |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody GetStuSessionList getStuSessionList); |
| | | |
| | | } |
| | |
| | | import com.dsh.account.feignclient.other.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 15:54 |
| | | */ |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/nearbyStore") |
| | | List<StoreInfo> getAllNearbyStoreList(GetAllNearbyStoreList getAllNearbyStoreList); |
| | | List<StoreInfo> getAllNearbyStoreList(@RequestBody GetAllNearbyStoreList getAllNearbyStoreList); |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/storeOfLonLat") |
| | | List<StoreLonLatList> getAllStoreLonLats(GetAllNearbyStoreList getAllNearbyStoreList); |
| | | List<StoreLonLatList> getAllStoreLonLats(@RequestBody GetAllNearbyStoreList getAllNearbyStoreList); |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class RegisterCourseVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | |
| | | @ApiModelProperty(value = "课包封面图") |
| | | private String packageImg; |
| | | |
| | | @ApiModelProperty(value = "课包名称+门店名称") |
| | | private String courseNameStore; |
| | | |
| | | @ApiModelProperty(value = "上课时间段") |
| | | private String courseTime; |
| | | |
| | | @ApiModelProperty(value = "授课老师") |
| | | private String courseTeacher; |
| | | |
| | | @ApiModelProperty(value = "已上课时数") |
| | | private Integer courseNums; |
| | | |
| | | } |
| | |
| | | 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.activity.model.IntrduceOfUserRequest; |
| | | import com.dsh.account.feignclient.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.GetStuSourseList; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | getStuSourseList.setAppUserId(userIdFormRedis); |
| | | List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList(getStuSourseList); |
| | | purchaseRecordVoList.addAll(stuSourseList); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(localMonthStart,localMonthEnd,stuId,userIdFormRedis); |
| | | |
| | | GetStuSessionList sessionList = new GetStuSessionList(); |
| | | sessionList.setStartTime(localMonthStart); |
| | | sessionList.setEndTime(localMonthEnd); |
| | | sessionList.setStuId(stuId); |
| | | sessionList.setAppUserId(userIdFormRedis); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(sessionList); |
| | | |
| | | purchaseRecordVoList.addAll(cancelCourseList); |
| | | List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(getStuSessionList); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos); |
| | |
| | | .eq("referralUserId",userIdFormRedis ) |
| | | .between("insertTime",localMonthStart ,localMonthEnd)); |
| | | List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(localMonthStart, localMonthEnd, userIds); |
| | | IntrduceOfUserRequest request = new IntrduceOfUserRequest(); |
| | | request.setStartTime(localMonthStart); |
| | | request.setEndTime(localMonthEnd); |
| | | request.setUserIds(userIds); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(request); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | | insVo.setSessionNames(stuSessionList); |
| | | insVo.setDetails(dealDataOfTime(purchaseRecordVoList)); |
| | |
| | | insVo.setTotalNums(stuOfCoursesDetails.getTotalNums()); |
| | | insVo.setDeductedNums(stuOfCoursesDetails.getDeductedNums()); |
| | | insVo.setRemainingNums(stuOfCoursesDetails.getRemainingNums()); |
| | | Integer deductionClassHour = crClient.getDeductionClassHour(lessonId, stuId, userIdFormRedis); |
| | | GetStudentCourse course = new GetStudentCourse(); |
| | | course.setCourseId(lessonId); |
| | | course.setStuId(stuId); |
| | | course.setAppUserId(userIdFormRedis); |
| | | Integer deductionClassHour = crClient.getDeductionClassHour(course); |
| | | insVo.setDeductionClassHours(deductionClassHour); |
| | | } |
| | | |
| | |
| | | getStuSourseList.setAppUserId(appUserId); |
| | | List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList(getStuSourseList); |
| | | purchaseRecordVoList.addAll(stuSourseList); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(startTime,endTime,timeRequest.getStuId(),appUserId); |
| | | |
| | | GetStuSessionList sessionList = new GetStuSessionList(); |
| | | sessionList.setStartTime(startTime); |
| | | sessionList.setEndTime(endTime); |
| | | sessionList.setStuId(timeRequest.getStuId()); |
| | | sessionList.setAppUserId(appUserId); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(sessionList); |
| | | |
| | | purchaseRecordVoList.addAll(cancelCourseList); |
| | | GetStuSessionList getStuSessionList = new GetStuSessionList(); |
| | | getStuSessionList.setStartTime(startTime); |
| | |
| | | .eq("referralUserId",appUserId ) |
| | | .between("insertTime",startTime ,endTime)); |
| | | List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(startTime, endTime, userIds); |
| | | IntrduceOfUserRequest request = new IntrduceOfUserRequest(); |
| | | request.setStartTime(startTime); |
| | | request.setEndTime(endTime); |
| | | request.setUserIds(userIds); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(request); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | | |
| | | purchaseRecordVoList = dealDataOfTime(purchaseRecordVoList); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | import com.dsh.activity.feignclient.model.IntrduceOfUserRequest; |
| | | import com.dsh.activity.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.activity.service.IntroduceRewardsService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api |
| | |
| | | |
| | | |
| | | @PostMapping("/base/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestParam("startTime") Date startTime,@RequestParam("endTime") Date endTime,@RequestParam("userIds") List<Integer> userIds){ |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody IntrduceOfUserRequest request){ |
| | | List<PurchaseRecordVo> recordVos = new ArrayList<>(); |
| | | List<IntroduceRewards> list = idrService.list(new QueryWrapper<IntroduceRewards>() |
| | | .ge("startTime",startTime) |
| | | .lt("endTime",endTime)); |
| | | .ge("startTime",request.getStartTime()) |
| | | .lt("endTime",request.getEndTime())); |
| | | IntroduceRewards introduceRewards = list.get(0); |
| | | userIds.forEach( userId -> { |
| | | request.getUserIds().forEach( userId -> { |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseAmount("+"+introduceRewards.getGiveClass()); |
| | | recordVo.setPurchaseType("介绍有礼"); |
| | |
| | | package com.dsh.activity.feignclient; |
| | | |
| | | |
| | | import com.dsh.activity.feignclient.model.IntrduceOfUserRequest; |
| | | import com.dsh.activity.feignclient.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface IntroduceRewardsClient { |
| | | |
| | | @PostMapping("/base/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestParam("startTime") Date startTime, |
| | | @RequestParam("endTime") Date endTime, |
| | | @RequestParam("userIds") List<Integer> userIds); |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody IntrduceOfUserRequest request); |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient.model; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class IntrduceOfUserRequest { |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | private List<Integer> userIds; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.competition.entity.Competition; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.model.GetStuSourseList; |
| | | import com.dsh.competition.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.competition.service.CompetitionService; |
| | | import com.dsh.competition.service.UserCompetitionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private final SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | @PostMapping("/base/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestParam("startTime") Date startTime, @RequestParam("endTime") Date endTime, @RequestParam("appUserId") Integer appUserId){ |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody GetStuSourseList sourseList){ |
| | | |
| | | List<PurchaseRecordVo> recordVos = new ArrayList<>(); |
| | | |
| | |
| | | .eq("payType",3 ) |
| | | .eq("auditStatus",2)); |
| | | List<Integer> comIds = list.stream().map(Competition::getId).collect(Collectors.toList()); |
| | | List<UserCompetition> userCompetitions = ucttService.queryUsersCompetetions(startTime,endTime,appUserId,comIds); |
| | | List<UserCompetition> userCompetitions = ucttService.queryUsersCompetetions(sourseList.getStartTime(),sourseList.getEndTime(),sourseList.getAppUserId(),comIds); |
| | | if (userCompetitions.size() > 0){ |
| | | userCompetitions.forEach(coms ->{ |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | |
| | | package com.dsh.competition.feignclient; |
| | | |
| | | |
| | | import com.dsh.competition.feignclient.model.GetStuSourseList; |
| | | import com.dsh.competition.feignclient.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-competition") |
| | | public interface DeductionCompetitionsClient { |
| | | |
| | | @PostMapping("/base/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestParam("startTime") Date startTime, |
| | | @RequestParam("endTime") Date endTime, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody GetStuSourseList sourseList); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.feignclient.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 9:59 |
| | | */ |
| | | @Data |
| | | public class GetStuSourseList { |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | private Integer appUserId; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.GetStuSessionList; |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取课包对应的消费记录 |
| | | * @param stuId 学员id |
| | | * @param appUserId 用户id |
| | | * @param sessionList |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestParam("startTime") Date startTime, @RequestParam("endTime") Date endTime, @RequestParam("stuId") Integer stuId, @RequestParam("appUserId") Integer appUserId){ |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody GetStuSessionList sessionList){ |
| | | List<PurchaseRecordVo> purchaseRecordVos = new ArrayList<>(); |
| | | |
| | | List<TCoursePackagePayment> tCoursePackagePayments = tcppService.queryAllCoursePackage(startTime,endTime,null,stuId, appUserId); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = tcppService.queryAllCoursePackage(sessionList.getStartTime(),sessionList.getEndTime(),null,sessionList.getStuId(), sessionList.getAppUserId()); |
| | | List<Long> coursePackageIds = tCoursePackagePayments.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | |
| | | List<CancelledClasses> list = caceService.list(new QueryWrapper<CancelledClasses>() |
| | | .in("coursePackageId", coursePackageIds) |
| | | .between("insertTime",startTime,endTime)); |
| | | .between("insertTime",sessionList.getStartTime(),sessionList.getEndTime())); |
| | | if (list.size() > 0){ |
| | | list.forEach( canse -> { |
| | | PurchaseRecordVo purchaseRecordVo = new PurchaseRecordVo(); |
| | |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.*; |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | | import com.dsh.course.model.vo.CourseDetailRequest; |
| | | import com.dsh.course.service.PostCourseVideoService; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | |
| | | * 课程名称列表 |
| | | */ |
| | | @PostMapping("/base/coursePack/sessionNames") |
| | | public List<StuSessionDetailsVo> getStuSessionList(@RequestParam("startTime") Date startTime, @RequestParam("endTime") Date endTime, @RequestParam("stuId") Integer stuId, @RequestParam("appUserId") Integer appUserId){ |
| | | public List<StuSessionDetailsVo> getStuSessionList(@RequestBody CourseDetailRequest request){ |
| | | List<StuSessionDetailsVo> detailsVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(startTime,endTime,null,stuId,appUserId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(request.getStartTime(),request.getEndTime(),null,request.getStuId(),request.getAppUserId()); |
| | | if (byUserId.size() > 0){ |
| | | List<Integer> collect = byUserId.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | List<TCoursePackage> list = tcpService.list(new QueryWrapper<TCoursePackage>() |
| | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/stuOfCourses") |
| | | public StuWithCoursesListVo getStuOfCoursesDetails(@RequestParam("stuId") Integer stuId, @RequestParam("appUserId") Integer appUserId){ |
| | | public StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody GetStuOfCoursesDetails getStuOfCoursesDetails){ |
| | | StuWithCoursesListVo lisco = new StuWithCoursesListVo(); |
| | | Integer totalNu = 0; |
| | | Integer dedutNu = 0; |
| | | Integer remainNu = 0; |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,null,stuId,appUserId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,null,getStuOfCoursesDetails.getStuId(),getStuOfCoursesDetails.getAppUserId()); |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | totalNu = totalNu + tCoursePackagePayment.getTotalClassHours(); |
| | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/continuingCourse") |
| | | public StudentOfCourseVo getStudentCourse(@RequestParam("courseId") Integer courseId,@RequestParam("stuId") Integer stuId,@RequestParam("appUserId") Integer appUserId){ |
| | | public StudentOfCourseVo getStudentCourse(@RequestBody GetStudentCourse getStudentCourse){ |
| | | StudentOfCourseVo courseVo = new StudentOfCourseVo(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.queryAllCoursePackage(null,null,courseId,stuId,appUserId); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.queryAllCoursePackage(null,null,getStudentCourse.getCourseId(),getStudentCourse.getStuId(),getStudentCourse.getAppUserId()); |
| | | if (tCoursePackagePayments.size() > 0 ){ |
| | | |
| | | List<CourseHoursType> typeList = new ArrayList<>(); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.feignclient.model.GetStudentCourse; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | |
| | | |
| | | |
| | | @PostMapping("/base/courseRecord/queryDeduClassHours") |
| | | public Integer getDeductionClassHour(@RequestParam("courseId") Integer courseId,@RequestParam("stuId") Integer stuId,@RequestParam("appUserId") Integer appUserId){ |
| | | public Integer getDeductionClassHour(@RequestBody GetStudentCourse course){ |
| | | Integer sult = 0; |
| | | TCoursePackage coursePackage = tcpService.getById(courseId); |
| | | TCoursePackage coursePackage = tcpService.getById(course.getCourseId()); |
| | | if (null != coursePackage && coursePackage.getStatus() == 3){ |
| | | List<CoursePackageStudent> coursePackageStudents = cosService.queryStuDeduClassHourNums(courseId, stuId, appUserId); |
| | | List<CoursePackageStudent> coursePackageStudents = cosService.queryStuDeduClassHourNums(course.getCourseId(), course.getStuId(), course.getAppUserId()); |
| | | if (coursePackageStudents.size() > 0){ |
| | | List<CancelledClasses> list = caccService.list(new QueryWrapper<CancelledClasses>() |
| | | .eq("coursePackageId",courseId )); |
| | | .eq("coursePackageId",course.getCourseId() )); |
| | | if (list.size() > 0){ |
| | | for (CancelledClasses cancelledClasses : list) { |
| | | sult = sult + cancelledClasses.getCancelledClassesNumber(); |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | import com.dsh.course.feignclient.model.GetStuSessionList; |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CancelListClient { |
| | | |
| | | @PostMapping("/base/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestParam("startTime") Date startTime, |
| | | @RequestParam("endTime") Date endTime, |
| | | @RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody GetStuSessionList sessionList); |
| | | |
| | | } |
| | |
| | | import com.dsh.course.feignclient.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | |
| | | List<CourseOfStoreVo> getStoreOfCourses(); |
| | | |
| | | @PostMapping("/base/coursePack/stuOfCourses") |
| | | StuWithCoursesListVo getStuOfCoursesDetails(@RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody GetStuOfCoursesDetails getStuOfCoursesDetails); |
| | | |
| | | @PostMapping("/base/coursePack/continuingCourse") |
| | | StudentOfCourseVo getStudentCourse(@RequestParam("courseId") Integer courseId, |
| | | @RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | StudentOfCourseVo getStudentCourse(@RequestBody GetStudentCourse getStudentCourse); |
| | | |
| | | @PostMapping("/base/coursePack/afterCourseTwos") |
| | | List<AfterVideoVo> getAfterCourseTwos(@RequestParam("appUserId") Integer appUserId); |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | import com.dsh.course.feignclient.model.GetStudentCourse; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CourseRecordClient { |
| | | |
| | | @PostMapping("/base/courseRecord/queryDeduClassHours") |
| | | public Integer getDeductionClassHour(@RequestParam("courseId") Integer courseId, |
| | | @RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | public Integer getDeductionClassHour(@RequestBody GetStudentCourse course); |
| | | |
| | | } |
| | |
| | | |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.course.feignclient.model.StuSessionDetailsVo; |
| | | import com.dsh.course.model.vo.CourseDetailRequest; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/sessionNames") |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestParam("startTime") Date startTime, |
| | | @RequestParam("endTime") Date endTime, |
| | | @RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestBody CourseDetailRequest request); |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestParam("startTime") Date startTime, |
| | | @RequestParam("endTime") Date endTime, |
| | | @RequestParam("stuId") Integer stuId, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody CourseDetailRequest request); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 9:46 |
| | | */ |
| | | @Data |
| | | public class GetStuOfCoursesDetails { |
| | | private Integer stuId; |
| | | private Integer appUserId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 9:55 |
| | | */ |
| | | @Data |
| | | public class GetStuSessionList { |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | private Integer stuId; |
| | | private Integer appUserId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 9:48 |
| | | */ |
| | | @Data |
| | | public class GetStudentCourse { |
| | | private Integer courseId; |
| | | private Integer stuId; |
| | | private Integer appUserId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model.vo; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class CourseDetailRequest { |
| | | @ApiModelProperty(value = "开始时间") |
| | | Date startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | Date endTime; |
| | | |
| | | @ApiModelProperty(value = "学员id") |
| | | Integer stuId; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | Integer appUserId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.model.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StuCourseRequest { |
| | | |
| | | Integer courseId; |
| | | |
| | | Integer stuId; |
| | | |
| | | Integer appUserId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.Store; |
| | | import com.dsh.other.feignclient.model.GetAllNearbyStoreList; |
| | | import com.dsh.other.feignclient.model.StoreDetailOfCourse; |
| | | import com.dsh.other.feignclient.model.StoreInfo; |
| | | import com.dsh.other.feignclient.model.StoreLonLatList; |
| | |
| | | } |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/nearbyStore") |
| | | public List<StoreInfo> getAllNearbyStoreList(@RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude){ |
| | | String current = longitude+","+latitude; |
| | | public List<StoreInfo> getAllNearbyStoreList(@RequestBody GetAllNearbyStoreList list ){ |
| | | String current = list.getLongitude()+","+list.getLatitude(); |
| | | List<StoreInfo> storeInfos = new ArrayList<>(); |
| | | String cityCode = ""; |
| | | try { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(longitude, latitude); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(list.getLongitude(), list.getLatitude()); |
| | | cityCode = geocode.get("cityCode"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/storeOfLonLat") |
| | | public List<StoreLonLatList> getAllStoreLonLats(@RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude){ |
| | | public List<StoreLonLatList> getAllStoreLonLats(@RequestBody GetAllNearbyStoreList list ){ |
| | | List<StoreLonLatList> storeInfos = new ArrayList<>(); |
| | | try { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(longitude, latitude); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(list.getLongitude(), list.getLatitude()); |
| | | String cityCode = geocode.get("cityCode"); |
| | | List<Store> storeList = storeService.list(new QueryWrapper<Store>() |
| | | .eq("cityCode",cityCode)); |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | import com.dsh.other.feignclient.model.GetAllNearbyStoreList; |
| | | import com.dsh.other.feignclient.model.StoreDetailOfCourse; |
| | | import com.dsh.other.feignclient.model.StoreInfo; |
| | | import com.dsh.other.feignclient.model.StoreLonLatList; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/nearbyStore") |
| | | List<StoreInfo> getAllNearbyStoreList(@RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude); |
| | | List<StoreInfo> getAllNearbyStoreList(@RequestBody GetAllNearbyStoreList list); |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/storeOfLonLat") |
| | | List<StoreLonLatList> getAllStoreLonLats(@RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude); |
| | | List<StoreLonLatList> getAllStoreLonLats(@RequestBody GetAllNearbyStoreList list); |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 9:52 |
| | | */ |
| | | @Data |
| | | public class GetAllNearbyStoreList { |
| | | private String longitude; |
| | | private String latitude; |
| | | } |