| | |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.*; |
| | | import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp; |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.util.DateUtil; |
| | |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | return ResultUtil.success(istuService.queryDeduRecordDetails(timeRequest,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/renewal") |
| | | @ApiOperation(value = "课时详情-续课", tags = {"APP-开始上课"}) |
| | | @ApiOperation(value = "课时详情-续课课包详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<?> renewalOfCourses(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.queryStuOfCourseDetails(lessonId,stuId,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 课时详情-续课 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/conponList") |
| | | @ApiOperation(value = "课时详情-选择优惠券", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<CouponStuAvailableVo>> queryCouponList(HttpServletRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.queryStuOfConponDetails(userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课时详情-续课 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/payment") |
| | | @ApiOperation(value = "课时详情-支付", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<?> continuationOperation(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | try { |
| | | |
| | | return ResultUtil.success(); |
New file |
| | |
| | | package com.dsh.account.feignclient.activity; |
| | | |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface UserConponClient { |
| | | |
| | | |
| | | @PostMapping("/userConpon/getStuOfConpons") |
| | | public List<CouponStuAvailableVo> queryUserWithConponList(@RequestBody Integer appUserId); |
| | | |
| | | } |
| | |
| | | import com.dsh.account.feignclient.course.model.CourseOfStoreVo; |
| | | import com.dsh.account.feignclient.course.model.StuCourseResp; |
| | | import com.dsh.account.feignclient.course.model.StuWithCoursesListVo; |
| | | import com.dsh.account.feignclient.course.model.StudentOfCourseVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @PostMapping("/coursePack/stuOfCourses") |
| | | StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/coursePack/continuingCourse") |
| | | StudentOfCourseVo getStudentCourse(@RequestBody Integer courseId, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course.model; |
| | | |
| | | |
| | | import com.dsh.account.model.vo.sourceDetail.CourseHoursType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StudentOfCourseVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | |
| | | @ApiModelProperty(value = "课包封面图") |
| | | private String packageImg; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | | |
| | | @ApiModelProperty(value = "授课老师/教练") |
| | | private Integer coachId; |
| | | |
| | | @ApiModelProperty(value = "上课周 例如:每周二") |
| | | private String courseWeek; |
| | | |
| | | @ApiModelProperty(value = "上课时间:例如 14:00-16:00") |
| | | private String courseTime; |
| | | |
| | | @ApiModelProperty(value = "课时列表: 50 70 90") |
| | | private List<CourseHoursType> typeList; |
| | | |
| | | @ApiModelProperty(value = "支付价格") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "会员价") |
| | | private double vipAmount; |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private Integer wpGold; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other; |
| | | |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface StoreClient { |
| | | |
| | | |
| | | @PostMapping("/storeDetail/courseOfSto") |
| | | public StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId); |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreDetailOfCourse { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | String storeName; |
| | | |
| | | @ApiModelProperty(value = "门店地址") |
| | | String storeAddr; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.sourceDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponStuAvailableVo { |
| | | |
| | | @ApiModelProperty(value = "券id") |
| | | private Integer conponId; |
| | | |
| | | @ApiModelProperty(value = "券名称") |
| | | private String conponName; |
| | | |
| | | @ApiModelProperty(value = "券类型 1满减券(取 条件金额+扣减金额) 2代金券(取 扣减金额)") |
| | | private Integer conponType; |
| | | |
| | | @ApiModelProperty(value = "条件金额") |
| | | private double conditionalAmount; |
| | | |
| | | @ApiModelProperty(value = "扣减金额") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "有效期至 yyyy-MM-dd") |
| | | private String lifespan; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.sourceDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CourseDetailsOfContinuationResp { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | |
| | | @ApiModelProperty(value = "学员id") |
| | | private Integer stuId; |
| | | |
| | | @ApiModelProperty(value = "课包封面图") |
| | | private String packageImg; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | | |
| | | @ApiModelProperty(value = "授课老师") |
| | | private String teacherName; |
| | | |
| | | @ApiModelProperty(value = "上课周 例如:每周二") |
| | | private String courseWeek; |
| | | |
| | | @ApiModelProperty(value = "上课时间:例如 14:00-16:00") |
| | | private String courseTime; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "门店地址") |
| | | private String storeAddr; |
| | | |
| | | @ApiModelProperty(value = "课时列表: 50 70 90") |
| | | private List<CourseHoursType> typeList; |
| | | |
| | | @ApiModelProperty(value = "学员姓名") |
| | | private String stuName; |
| | | |
| | | @ApiModelProperty(value = "学员电话") |
| | | private String stuPhone; |
| | | |
| | | @ApiModelProperty(value = "学员年龄") |
| | | private Integer stuAge; |
| | | |
| | | @ApiModelProperty(value = "支付价格") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "会员价") |
| | | private double vipAmount; |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private double wpGold; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.sourceDetail; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CourseHoursType { |
| | | |
| | | @ApiModelProperty(value = "课时id") |
| | | private Integer courseConfigId; |
| | | |
| | | @ApiModelProperty(value = "课时数") |
| | | private Integer courseHourNums; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "课包id", dataType = "int") |
| | | private Integer lessonId; |
| | | |
| | | @ApiModelProperty(value = "开始时间", dataType = "string") |
| | | @ApiModelProperty(value = "开始时间 格式:yyyy-MM", dataType = "string") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间", dataType = "string") |
| | | @ApiModelProperty(value = "结束时间 格式:yyyy-MM", dataType = "string") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "类型:1购买课包 2消费扣除 3报名赛事 4介绍有礼 5全部", dataType = "int") |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | ClassDetailsInsVo querySessionDetailsDt(Integer userIdFormRedis, Integer lessonId, Integer stuId); |
| | | |
| | | List<PurchaseRecordVo> queryDeduRecordDetails(RecordTimeRequest timeRequest,Integer appUserId); |
| | | |
| | | List<CouponStuAvailableVo> queryStuOfConponDetails(Integer appUserId); |
| | | |
| | | CourseDetailsOfContinuationResp queryStuOfCourseDetails(Integer lessonId, Integer stuId, Integer appUserId); |
| | | |
| | | } |
| | |
| | | import com.dsh.account.entity.TAppUser; |
| | | 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.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.CancelListClient; |
| | |
| | | import com.dsh.account.feignclient.course.CourseSessionNameClient; |
| | | 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.StoreClient; |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | 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.ToolUtil; |
| | |
| | | |
| | | @Autowired |
| | | private CoursePaymentClient couPayClient; |
| | | |
| | | @Autowired |
| | | private UserConponClient userCClient; |
| | | |
| | | @Autowired |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private TAppUserMapper tauMapper; |
| | |
| | | return insVo; |
| | | } |
| | | |
| | | @Override |
| | | public List<PurchaseRecordVo> queryDeduRecordDetails(RecordTimeRequest timeRequest,Integer appUserId) { |
| | | List<PurchaseRecordVo> purchaseRecordVoList = new ArrayList<>(); |
| | | Date startTime = DateTimeHelper.getCurrentIdetMouthStart(timeRequest.getStartTime()); |
| | | Date endTime = DateTimeHelper.getCurrentIdeaMouthEnd(timeRequest.getEndTime()); |
| | | |
| | | List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList(startTime,endTime,appUserId); |
| | | purchaseRecordVoList.addAll(stuSourseList); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(startTime,endTime,timeRequest.getStuId(),appUserId); |
| | | purchaseRecordVoList.addAll(cancelCourseList); |
| | | List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(startTime,endTime,timeRequest.getStuId(),appUserId); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos); |
| | | List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>() |
| | | .eq("referralUserId",appUserId ) |
| | | .between("insertTime",timeRequest.getStartTime() ,timeRequest.getEndTime())); |
| | | List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(startTime, endTime, userIds); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | | |
| | | purchaseRecordVoList = dealDataOfTime(purchaseRecordVoList); |
| | | return purchaseRecordVoList; |
| | | } |
| | | |
| | | @Override |
| | | public List<CouponStuAvailableVo> queryStuOfConponDetails(Integer appUserId) { |
| | | List<CouponStuAvailableVo> availableVos = new ArrayList<>(); |
| | | availableVos = userCClient.queryUserWithConponList(appUserId); |
| | | return availableVos; |
| | | } |
| | | |
| | | @Override |
| | | public CourseDetailsOfContinuationResp queryStuOfCourseDetails(Integer lessonId, Integer stuId, Integer appUserId) { |
| | | CourseDetailsOfContinuationResp resp = new CourseDetailsOfContinuationResp(); |
| | | |
| | | StudentOfCourseVo studentCourse = couPayClient.getStudentCourse(lessonId,stuId,appUserId); |
| | | |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(studentCourse.getStoreId()); |
| | | |
| | | return resp; |
| | | } |
| | | |
| | | |
| | | public static List<PurchaseRecordVo> dealDataOfTime(List<PurchaseRecordVo> purchaseRecords) { |
| | | Collections.sort(purchaseRecords, new Comparator<PurchaseRecordVo>() { |
| | |
| | | return purchaseRecords; |
| | | } |
| | | |
| | | |
| | | // public static List<String> dealDataOfTime(List<String> timeStrings) { |
| | | // Collections.sort(timeStrings, new Comparator<String>() { |
| | | // @Override |
| | | // public int compare(String time1, String time2) { |
| | | // String[] parts1 = time1.split(" "); |
| | | // String[] parts2 = time2.split(" "); |
| | | // String[] dateParts1 = parts1[0].split("-"); |
| | | // String[] dateParts2 = parts2[0].split("-"); |
| | | // String[] timeParts1 = parts1[1].split(":"); |
| | | // String[] timeParts2 = parts2[1].split(":"); |
| | | // int month1 = Integer.parseInt(dateParts1[0]); |
| | | // int day1 = Integer.parseInt(dateParts1[1]); |
| | | // int hour1 = Integer.parseInt(timeParts1[0]); |
| | | // int minute1 = Integer.parseInt(timeParts1[1]); |
| | | // int month2 = Integer.parseInt(dateParts2[0]); |
| | | // int day2 = Integer.parseInt(dateParts2[1]); |
| | | // int hour2 = Integer.parseInt(timeParts2[0]); |
| | | // int minute2 = Integer.parseInt(timeParts2[1]); |
| | | // // 倒序排序 |
| | | // if (month1 != month2) { |
| | | // return month2 - month1; |
| | | // } else if (day1 != day2) { |
| | | // return day2 - day1; |
| | | // } else if (hour1 != hour2) { |
| | | // return hour2 - hour1; |
| | | // } else { |
| | | // return minute2 - minute1; |
| | | // } |
| | | // } |
| | | // }); |
| | | // return timeStrings; |
| | | // } |
| | | } |
| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Instant; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.*; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取指定月份开始时0点0分0秒 |
| | | * @param input 输入的时间,"yyyy-MM" |
| | | * @return |
| | | */ |
| | | public static Date getCurrentIdetMouthStart(String input) { |
| | | // 解析年月字符串 |
| | | YearMonth yearMonth = YearMonth.parse(input); |
| | | // 获取月份的开始时间(月初0点) |
| | | LocalDate startOfMonth = yearMonth.atDay(1); |
| | | LocalDateTime startDateTime = startOfMonth.atTime(LocalTime.MIN); |
| | | return Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 获取当月结束时23点59分59秒 |
| | | * |
| | | * @return |
| | |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取指定月份结束时23点59分59秒 |
| | | * @param input 输入的时间,"yyyy-MM" |
| | | * @return |
| | | */ |
| | | public static Date getCurrentIdeaMouthEnd(String input) { |
| | | // 解析年月字符串 |
| | | YearMonth yearMonth = YearMonth.parse(input); |
| | | // 获取月份的结束时间(月末23:59:59秒) |
| | | LocalDate endOfMonth = yearMonth.atEndOfMonth(); |
| | | LocalDateTime endDateTime = endOfMonth.atTime(23, 59, 59); |
| | | return Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 返回下月的这天 |
| | | * |
New file |
| | |
| | | package com.dsh.activity.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.feignclient.model.CouponStuAvailableVo; |
| | | import com.dsh.activity.service.CouponService; |
| | | import com.dsh.activity.service.UserCouponService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class UserConponController { |
| | | |
| | | @Autowired |
| | | private UserCouponService uconService; |
| | | |
| | | @Autowired |
| | | private CouponService cService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); |
| | | |
| | | @PostMapping("/userConpon/getStuOfConpons") |
| | | public List<CouponStuAvailableVo> queryUserWithConponList(@RequestBody Integer appUserId){ |
| | | |
| | | List<CouponStuAvailableVo> availableVos = new ArrayList<>(); |
| | | |
| | | List<UserCoupon> list = uconService.list(new QueryWrapper<UserCoupon>() |
| | | .eq("userId", appUserId) |
| | | .eq("status",1)); |
| | | if (list.size() > 0){ |
| | | List<Integer> collect = list.stream().map(UserCoupon::getCouponId).collect(Collectors.toList()); |
| | | List<Coupon> conponList = cService.list(new QueryWrapper<Coupon>() |
| | | .in("id", collect)); |
| | | for (Coupon coupon : conponList) { |
| | | CouponStuAvailableVo availableVo = new CouponStuAvailableVo(); |
| | | availableVo.setConponId(coupon.getId()); |
| | | availableVo.setConponName(coupon.getName()); |
| | | availableVo.setConponType(coupon.getType()); |
| | | Map<String,Object> conponRuleMap = cService.queryConponRuleOfJson(coupon.getId()); |
| | | switch (coupon.getType()){ |
| | | case 1: |
| | | Object conditionalAmount = conponRuleMap.get("conditionalAmount"); |
| | | Object deductionAmount = conponRuleMap.get("deductionAmount"); |
| | | availableVo.setConditionalAmount((double) conditionalAmount); |
| | | availableVo.setAmount((double) deductionAmount); |
| | | break; |
| | | case 2: |
| | | Object amount = conponRuleMap.get("deductionAmount"); |
| | | availableVo.setAmount((double)amount); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | availableVo.setLifespan(format.format(coupon.getEndTime())); |
| | | availableVos.add(availableVo); |
| | | } |
| | | } |
| | | return availableVos; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | public class JSONConpon { |
| | | |
| | | double conditionalAmount; |
| | | |
| | | double deductionAmount; |
| | | |
| | | String experienceName; |
| | | |
| | | public JSONConpon(double conditionalAmount, double deductionAmount, String experienceName) { |
| | | this.conditionalAmount = conditionalAmount; |
| | | this.deductionAmount = deductionAmount; |
| | | this.experienceName = experienceName; |
| | | } |
| | | |
| | | public JSONConpon() { |
| | | } |
| | | |
| | | public double getConditionalAmount() { |
| | | return conditionalAmount; |
| | | } |
| | | |
| | | public void setConditionalAmount(double conditionalAmount) { |
| | | this.conditionalAmount = conditionalAmount; |
| | | } |
| | | |
| | | public double getDeductionAmount() { |
| | | return deductionAmount; |
| | | } |
| | | |
| | | public void setDeductionAmount(double deductionAmount) { |
| | | this.deductionAmount = deductionAmount; |
| | | } |
| | | |
| | | public String getExperienceName() { |
| | | return experienceName; |
| | | } |
| | | |
| | | public void setExperienceName(String experienceName) { |
| | | this.experienceName = experienceName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient; |
| | | |
| | | import com.dsh.activity.feignclient.model.CouponStuAvailableVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface UserConponClient { |
| | | |
| | | |
| | | @PostMapping("/userConpon/getStuOfConpons") |
| | | public List<CouponStuAvailableVo> queryUserWithConponList(@RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponStuAvailableVo { |
| | | |
| | | @ApiModelProperty(value = "券id") |
| | | private Integer conponId; |
| | | |
| | | @ApiModelProperty(value = "券名称") |
| | | private String conponName; |
| | | |
| | | @ApiModelProperty(value = "券类型 1满减券(取 条件金额+扣减金额) 2代金券(取 扣减金额)") |
| | | private Integer conponType; |
| | | |
| | | @ApiModelProperty(value = "条件金额") |
| | | private double conditionalAmount; |
| | | |
| | | @ApiModelProperty(value = "扣减金额") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "有效期至 yyyy-MM-dd") |
| | | private String lifespan; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface CouponMapper extends BaseMapper<Coupon> { |
| | | |
| | | Map<String, Object> queryConponRuleOfJson(@Param("id") Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | |
| | | |
| | | @Data |
| | | public class ConponJsonRuleModel { |
| | | /** |
| | | * 条件金额 |
| | | */ |
| | | double conditionalAmount; |
| | | /** |
| | | * 抵扣金额(代金券 取 该字段) |
| | | */ |
| | | double deductionAmount; |
| | | /** |
| | | * 体验券名称 |
| | | */ |
| | | String experienceName; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.Coupon; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 服务类 |
| | |
| | | */ |
| | | public interface CouponService extends IService<Coupon> { |
| | | |
| | | Map<String, Object> queryConponRuleOfJson(Integer id); |
| | | |
| | | } |
| | |
| | | import com.dsh.activity.service.CouponService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 服务实现类 |
| | |
| | | @Service |
| | | public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> implements CouponService { |
| | | |
| | | @Override |
| | | public Map<String, Object> queryConponRuleOfJson(Integer id) { |
| | | return this.baseMapper.queryConponRuleOfJson(id); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.activity.mapper.CouponMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | <select id="queryConponRuleOfJson" resultType="java.util.Map"> |
| | | SELECT JSON_EXTRACT(content, "$.conditionalAmount") as conditionalAmount, |
| | | JSON_EXTRACT(content, "$.deductionAmount") as deductionAmount, |
| | | JSON_EXTRACT(content, "$.experienceName") as experienceName |
| | | FROM t_coupon |
| | | where 1=1 |
| | | <if test="id != null"> |
| | | and `id` = #{id} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody Date startTime,@RequestBody Date endTime,@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | List<PurchaseRecordVo> purchaseRecordVos = new ArrayList<>(); |
| | | |
| | | List<TCoursePackagePayment> tCoursePackagePayments = tcppService.queryAllCoursePackage(startTime,endTime,stuId, appUserId); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = tcppService.queryAllCoursePackage(startTime,endTime,null,stuId, appUserId); |
| | | List<Integer> coursePackageIds = tCoursePackagePayments.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | |
| | | List<CancelledClasses> list = caceService.list(new QueryWrapper<CancelledClasses>() |
| | |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.util.DateUtil; |
| | | import com.dsh.course.util.StrUtils; |
| | | import io.swagger.annotations.Api; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | @PostMapping("/coursePack/queryPayment") |
| | | public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | List<StuCourseResp> resps = new ArrayList<>(); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,stuId,appUserId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,null,stuId,appUserId); |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | |
| | | @PostMapping("/coursePack/sessionNames") |
| | | public List<StuSessionDetailsVo> getStuSessionList(@RequestBody Date startTime, @RequestBody Date endTime, @RequestBody Integer stuId, @RequestBody Integer appUserId){ |
| | | List<StuSessionDetailsVo> detailsVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(startTime,endTime,stuId,appUserId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(startTime,endTime,null,stuId,appUserId); |
| | | if (byUserId.size() > 0){ |
| | | List<Integer> collect = byUserId.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | List<TCoursePackage> list = tcpService.list(new QueryWrapper<TCoursePackage>() |
| | |
| | | @PostMapping("/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody Date startTime, @RequestBody Date endTime,@RequestBody Integer stuId, @RequestBody Integer appUserId) { |
| | | List<PurchaseRecordVo> purchaseRecordVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> coursePackage = packagePaymentService.queryAllCoursePackage(startTime,endTime,stuId, appUserId); |
| | | List<TCoursePackagePayment> coursePackage = packagePaymentService.queryAllCoursePackage(startTime,endTime,null,stuId, appUserId); |
| | | if (coursePackage.size() > 0 ){ |
| | | coursePackage.forEach( cspackage -> { |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | |
| | | Integer totalNu = 0; |
| | | Integer dedutNu = 0; |
| | | Integer remainNu = 0; |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,stuId,appUserId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,null,stuId,appUserId); |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | StuWithCoursesListVo resp = new StuWithCoursesListVo(); |
| | | totalNu = totalNu + tCoursePackagePayment.getTotalClassHours(); |
| | | dedutNu = dedutNu + tCoursePackagePayment.getLaveClassHours(); |
| | | remainNu = remainNu + (tCoursePackagePayment.getTotalClassHours()-tCoursePackagePayment.getLaveClassHours()); |
| | |
| | | return lisco; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/coursePack/continuingCourse") |
| | | public StudentOfCourseVo getStudentCourse(@RequestBody Integer courseId,@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | StudentOfCourseVo courseVo = new StudentOfCourseVo(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.queryAllCoursePackage(null,null,courseId,stuId,appUserId); |
| | | if (tCoursePackagePayments.size() > 0 ){ |
| | | |
| | | List<CourseHoursType> typeList = new ArrayList<>(); |
| | | tCoursePackagePayments.forEach(cou -> { |
| | | CourseHoursType hoursType = new CourseHoursType(); |
| | | hoursType.setCourseConfigId(cou.getId()); |
| | | hoursType.setCourseConfigId(cou.getClassHours()); |
| | | typeList.add(hoursType); |
| | | }); |
| | | TCoursePackagePayment tCoursePackagePayment = tCoursePackagePayments.get(0); |
| | | courseVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | courseVo.setTypeList(typeList); |
| | | |
| | | TCoursePackage coursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | courseVo.setPackageImg(coursePackage.getCoverDrawing()); |
| | | courseVo.setCourseName(coursePackage.getName()); |
| | | courseVo.setCoachId(coursePackage.getCoachId()); |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | List<Integer> integers = StrUtils.dealStrToList(classWeeks); |
| | | if (integers.size() > 0){ |
| | | StringBuilder courWeeks = new StringBuilder("每"); |
| | | for (Integer integer : integers) { |
| | | switch (integer){ |
| | | case 1: |
| | | courWeeks.append("周一、"); |
| | | break; |
| | | case 2: |
| | | courWeeks.append("周二、"); |
| | | break; |
| | | case 3: |
| | | courWeeks.append("周三、"); |
| | | break; |
| | | case 4: |
| | | courWeeks.append("周四、"); |
| | | break; |
| | | case 5: |
| | | courWeeks.append("周五、"); |
| | | break; |
| | | case 6: |
| | | courWeeks.append("周六、"); |
| | | break; |
| | | case 7: |
| | | courWeeks.append("周末、"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | if (courWeeks.length() > 0 && courWeeks.charAt(courWeeks.length() - 1) == ','){ |
| | | courWeeks.deleteCharAt(courWeeks.length() - 1); |
| | | } |
| | | courseVo.setCourseWeek(courWeeks.toString()); |
| | | } |
| | | |
| | | courseVo.setCourseTime(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | // TODO: 2023/6/30 查询会员折扣数据 |
| | | String payType = tCoursePackagePayment.getPayType(); |
| | | BigDecimal cashPayment = tCoursePackagePayment.getCashPayment(); |
| | | double cashPaymentValue = cashPayment.doubleValue(); |
| | | Integer playPaiCoin = tCoursePackagePayment.getPlayPaiCoin(); |
| | | switch (payType) { |
| | | case "1;2": |
| | | courseVo.setAmount(cashPaymentValue); |
| | | courseVo.setWpGold(playPaiCoin); |
| | | break; |
| | | case "1": |
| | | courseVo.setAmount(cashPaymentValue); |
| | | break; |
| | | case "2": |
| | | courseVo.setWpGold(playPaiCoin); |
| | | break; |
| | | } |
| | | |
| | | courseVo.setStoreId(coursePackage.getStoreId()); |
| | | } |
| | | |
| | | return courseVo; |
| | | } |
| | | } |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课程 |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 支付方式(1=现金,2=玩湃币) |
| | | */ |
| | | private Integer payType; |
| | | private String payType; |
| | | /** |
| | | * 有效天数 |
| | | */ |
| | |
| | | /** |
| | | * 支付方式(1=现金,2=玩湃币) |
| | | */ |
| | | private Integer payType; |
| | | private String payType; |
| | | /** |
| | | * 课时数 |
| | | */ |
| | |
| | | |
| | | @PostMapping("/coursePack/stuOfCourses") |
| | | StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody Integer stuId,@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/coursePack/continuingCourse") |
| | | StudentOfCourseVo getStudentCourse(@RequestBody Integer courseId, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CourseHoursType { |
| | | |
| | | @ApiModelProperty(value = "课时id") |
| | | private Integer courseConfigId; |
| | | |
| | | @ApiModelProperty(value = "课时数") |
| | | private Integer courseHourNums; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StudentOfCourseVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | |
| | | @ApiModelProperty(value = "课包封面图") |
| | | private String packageImg; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | | |
| | | @ApiModelProperty(value = "授课老师/教练") |
| | | private Integer coachId; |
| | | |
| | | @ApiModelProperty(value = "上课周 例如:每周二") |
| | | private String courseWeek; |
| | | |
| | | @ApiModelProperty(value = "上课时间:例如 14:00-16:00") |
| | | private String courseTime; |
| | | |
| | | @ApiModelProperty(value = "课时列表: 50 70 90") |
| | | private List<CourseHoursType> typeList; |
| | | |
| | | @ApiModelProperty(value = "支付价格") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "会员价") |
| | | private double vipAmount; |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private Integer wpGold; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | } |
| | |
| | | public interface TCoursePackagePaymentMapper extends BaseMapper<TCoursePackagePayment> { |
| | | |
| | | List<TCoursePackagePayment> queryAllCoursePackage(@Param("startTime")Date startTime, |
| | | @Param("endTime")Date endTime , |
| | | @Param("endTime")Date endTime , |
| | | @Param("coursePackId") Integer coursePackId, |
| | | @Param("stuId") Integer stuId, |
| | | @Param("appUserId") Integer appUserId); |
| | | |
| | |
| | | */ |
| | | public interface TCoursePackagePaymentService extends IService<TCoursePackagePayment> { |
| | | |
| | | List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime ,Integer stuId, Integer appUserId); |
| | | List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime ,Integer lessionId,Integer stuId, Integer appUserId); |
| | | |
| | | } |
| | |
| | | public class TCoursePackagePaymentServiceImpl extends ServiceImpl<TCoursePackagePaymentMapper, TCoursePackagePayment> implements TCoursePackagePaymentService { |
| | | |
| | | @Override |
| | | public List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime , Integer stuId, Integer appUserId) { |
| | | return this.baseMapper.queryAllCoursePackage(startTime,endTime,stuId,appUserId); |
| | | public List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime , Integer coursePackId, Integer stuId, Integer appUserId) { |
| | | return this.baseMapper.queryAllCoursePackage(startTime,endTime,coursePackId,stuId,appUserId); |
| | | } |
| | | } |
| | |
| | | return sBuilder.toString(); |
| | | } |
| | | |
| | | public static List<Integer> dealStrToList(String str){ |
| | | List<Integer> list = new ArrayList<>(); |
| | | if (null == str || str == "" || str.isEmpty()){ |
| | | return list; |
| | | } |
| | | String[] strArray = str.split(";"); |
| | | for (String numStr : strArray) { |
| | | int num = Integer.parseInt(numStr); |
| | | list.add(num); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | FROM t_course_package_payment5 |
| | | WHERE 1=1 |
| | | <if test=" stuId != null"> |
| | | and appUserId = #{stuId} |
| | | and studentId = #{stuId} |
| | | </if> |
| | | <if test="appUserId != null"> |
| | | and appUserId = #{appUserId} |
| | |
| | | <if test="startTime != null and endTime != null"> |
| | | and (insertTime between #{startTime} and #{endTime}) |
| | | </if> |
| | | <if test="coursePackId != null "> |
| | | and coursePackageId = #{coursePackId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | |
| | | import com.dsh.other.entity.Store; |
| | | import com.dsh.other.feignclient.model.StoreDetailOfCourse; |
| | | import com.dsh.other.service.StoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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; |
| | | |
| | | @RestController |
| | | @RequestMapping("/base/protocol") |
| | | public class StoreController { |
| | | |
| | | @Autowired |
| | | private StoreService stoService; |
| | | |
| | | |
| | | @PostMapping("/storeDetail/courseOfSto") |
| | | public StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId){ |
| | | StoreDetailOfCourse ofCourse = new StoreDetailOfCourse(); |
| | | Store store = stoService.getById(storeId); |
| | | if (null != store){ |
| | | ofCourse.setStoreName(store.getName()); |
| | | ofCourse.setStoreAddr(store.getAddress()); |
| | | } |
| | | return ofCourse; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | import com.dsh.other.feignclient.model.StoreDetailOfCourse; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface StoreClient { |
| | | |
| | | |
| | | @PostMapping("/storeDetail/courseOfSto") |
| | | public StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId); |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreDetailOfCourse { |
| | | |
| | | String storeName; |
| | | |
| | | String storeAddr; |
| | | |
| | | |
| | | } |