2 文件已复制
1 文件已重命名
24个文件已修改
32个文件已添加
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.RecordTimeRequest; |
| | | import com.dsh.account.service.TAppUserService; |
| | |
| | | package com.dsh.account.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> |
| | |
| | | * 用户头像 |
| | | */ |
| | | private String headImg; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.activity; |
| | | |
| | | |
| | | 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.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface IntroduceRewardsClient { |
| | | |
| | | |
| | | @PostMapping("/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody List<Integer> userIds); |
| | | |
| | | } |
| | |
| | | package com.dsh.account.feignclient.competition; |
| | | |
| | | |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.PurchaseRecordVo; |
| | | 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-competition") |
| | | public interface DeductionCompetitionsClient { |
| | | @PostMapping("/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestParam("appUserId") Integer appUserId); |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
copy from cloud-server-account/src/main/java/com/dsh/account/model/vo/classDetails/classInsVo/PurchaseRecordVo.java
copy to cloud-server-account/src/main/java/com/dsh/account/feignclient/competition/model/PurchaseRecordVo.java
File was copied from cloud-server-account/src/main/java/com/dsh/account/model/vo/classDetails/classInsVo/PurchaseRecordVo.java |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | package com.dsh.account.feignclient.competition.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
New file |
| | |
| | | package com.dsh.account.feignclient.course; |
| | | |
| | | 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.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CancelListClient { |
| | | |
| | | @PostMapping("/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
| | |
| | | package com.dsh.account.feignclient.course; |
| | | |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.StuSessionDetailsVo; |
| | | 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("/coursePack/sessionNames") |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestParam("stuId") Integer stuId,@RequestParam("appUserId") Integer appUserId); |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | /** |
| | |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Mapper |
| | | public interface TAppUserMapper extends BaseMapper<TAppUser> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.account.entity.TStudent; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | /** |
| | |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Mapper |
| | | public interface TStudentMapper extends BaseMapper<TStudent> { |
| | | |
| | | } |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.StuSessionDetailsVo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "学员姓名") |
| | | private String stuName; |
| | | |
| | | @ApiModelProperty(value = "课时有效期(xxxx-xx-xx)") |
| | | private String periodOfValidity; |
| | | |
| | | @ApiModelProperty(value = "总学时数") |
| | | private Integer totalNums; |
| | |
| | | @ApiModelProperty(value = "课包名称列表") |
| | | private List<StuSessionDetailsVo> sessionNames; |
| | | |
| | | @ApiModelProperty(value = "已扣课时数") |
| | | private Integer deductionClassHours; |
| | | |
| | | @ApiModelProperty(value = "课包列表") |
| | | private List<ClassDataDetails> details; |
| | | private List<PurchaseRecordVo> details; |
| | | |
| | | } |
| | |
| | | package com.dsh.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.activity.IntroduceRewardsClient; |
| | | 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.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.service.TStudentService; |
| | | import com.dsh.account.util.DateTimeHelper; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | private CourseSessionNameClient sessionNameClient; |
| | | |
| | | @Autowired |
| | | private DeductionCompetitionsClient dcttClient; |
| | | |
| | | @Autowired |
| | | private CancelListClient cancelcClient; |
| | | |
| | | @Autowired |
| | | private IntroduceRewardsClient idrClient; |
| | | |
| | | @Autowired |
| | | private TAppUserMapper tauMapper; |
| | | |
| | | @Override |
| | | public void addStuOfAppUser(StuDetailsReq stu,Integer appUserId) { |
| | |
| | | @Override |
| | | public ClassDetailsInsVo querySessionDetailsDt(Integer userIdFormRedis, Integer lessonId, Integer stuId) { |
| | | ClassDetailsInsVo insVo = new ClassDetailsInsVo(); |
| | | List<StuSessionDetailsVo> stuSessionList = sessionNameClient.getStuSessionList(stuId,userIdFormRedis); |
| | | Date localMonthStart = DateTimeHelper.getCurrentMouthStart(); |
| | | Date localMonthEnd = DateTimeHelper.getCurrentMouthEnd(); |
| | | List<StuSessionDetailsVo> stuSessionList = sessionNameClient.getStuSessionList(localMonthStart,localMonthEnd,stuId,userIdFormRedis); |
| | | TStudent tStudent = this.baseMapper.selectById(stuId); |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | insVo.setStuId(tStudent.getId()); |
| | | insVo.setStuName(tStudent.getName()); |
| | | insVo.setStuImage(tStudent.getHeadImg()); |
| | | |
| | | insVo.setSessionNames(stuSessionList); |
| | | List<PurchaseRecordVo> purchaseRecordVoList = new ArrayList<>(); |
| | | |
| | | List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList(localMonthStart,localMonthEnd,userIdFormRedis); |
| | | purchaseRecordVoList.addAll(stuSourseList); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(localMonthStart,localMonthEnd,stuId,userIdFormRedis); |
| | | purchaseRecordVoList.addAll(cancelCourseList); |
| | | List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(localMonthStart,localMonthEnd,stuId,userIdFormRedis); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos); |
| | | List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>() |
| | | .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); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | | insVo.setSessionNames(stuSessionList); |
| | | insVo.setDetails(dealDataOfTime(purchaseRecordVoList)); |
| | | |
| | | insVo.setTotalNums(0); |
| | | insVo.setDeductedNums(0); |
| | | insVo.setRemainingNums(0); |
| | | insVo.setDeductionClassHours(0); |
| | | } |
| | | |
| | | return insVo; |
| | | } |
| | | |
| | | |
| | | public static List<PurchaseRecordVo> dealDataOfTime(List<PurchaseRecordVo> purchaseRecords) { |
| | | Collections.sort(purchaseRecords, new Comparator<PurchaseRecordVo>() { |
| | | @Override |
| | | public int compare(PurchaseRecordVo record1, PurchaseRecordVo record2) { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | Date date1 = null; |
| | | Date date2 = null; |
| | | try { |
| | | date1 = dateFormat.parse(record1.getPurchaseTime()); |
| | | date2 = dateFormat.parse(record2.getPurchaseTime()); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 倒序排序 |
| | | return date2.compareTo(date1); |
| | | } |
| | | }); |
| | | 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; |
| | | // } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取当月结束时23点59分59秒 |
| | | * |
| | | * @return |
| | | */ |
| | | public static Date getCurrentMouthEnd() { |
| | | Date d = getSystemDate(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(d); |
| | | int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); |
| | | calendar.set(Calendar.DAY_OF_MONTH, lastDay); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | /** |
| | | * 返回下月的这天 |
| | | * |
| | | * @param date |
New file |
| | |
| | | package com.dsh.activity.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | import com.dsh.activity.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.activity.service.IntroduceRewardsService; |
| | | 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.Date; |
| | | import java.util.List; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class IntroduceRewardsController { |
| | | |
| | | |
| | | @Autowired |
| | | private IntroduceRewardsService idrService; |
| | | |
| | | private final SimpleDateFormat mat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | |
| | | @PostMapping("/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody Date startTime, @RequestBody Date endTime, @RequestBody List<Integer> userIds){ |
| | | List<PurchaseRecordVo> recordVos = new ArrayList<>(); |
| | | List<IntroduceRewards> list = idrService.list(new QueryWrapper<IntroduceRewards>() |
| | | .ge("startTime",startTime) |
| | | .lt("endTime",endTime)); |
| | | IntroduceRewards introduceRewards = list.get(0); |
| | | userIds.forEach( userId -> { |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseAmount("+"+introduceRewards.getGiveClass()); |
| | | recordVo.setPurchaseType("介绍有礼"); |
| | | recordVos.add(recordVo); |
| | | } ); |
| | | return recordVos; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_coupon") |
| | | public class Coupon extends Model<Coupon> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 优惠券类型(1=满减券,2=代金券,3=体验券) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 优惠券规则JSON |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 优惠券说明 |
| | | */ |
| | | private String illustrate; |
| | | /** |
| | | * 发放方式(1=积分购买,2=注册赠送,3=自动发券) |
| | | */ |
| | | private Integer distributionMethod; |
| | | /** |
| | | * 兑换方式(1=积分,2=积分+现金) |
| | | */ |
| | | private Integer redemptionMethod; |
| | | /** |
| | | * 所需现金 |
| | | */ |
| | | private BigDecimal cash; |
| | | /** |
| | | * 所属积分 |
| | | */ |
| | | private BigDecimal integral; |
| | | /** |
| | | * 用户人群(1=全部用户,2=年度会员,3=已有学员用户) |
| | | */ |
| | | private Integer userPopulation; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | private Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | private Integer pickUpQuantity; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private Date endTime; |
| | | /** |
| | | * 使用范围(1=全国,2=指定城市,3=指定门店) |
| | | */ |
| | | private Integer useScope; |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 审核状态(1=待审核,2=已通过,3=已拒绝) |
| | | */ |
| | | private Integer auditStatus; |
| | | /** |
| | | * 审核人id |
| | | */ |
| | | private Integer auditUserId; |
| | | /** |
| | | * 审核备注 |
| | | */ |
| | | private String auditRemark; |
| | | /** |
| | | * 状态(1=未开始,2=已开始,3=已结束,4=已取消) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_introduce_rewards") |
| | | public class IntroduceRewards extends Model<IntroduceRewards> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private Date endTime; |
| | | /** |
| | | * 赠送课时 |
| | | */ |
| | | private Integer giveClass; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_coupon") |
| | | public class UserCoupon extends Model<UserCoupon> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | private Integer couponId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | /** |
| | | * 状态(1=待核销,2=已核销) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 核销人员id |
| | | */ |
| | | private Integer verificationUserId; |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | private Date verificationTime; |
| | | /** |
| | | * 领取时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_points_merchandise") |
| | | public class UserPointsMerchandise extends Model<UserPointsMerchandise> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | private Integer pointsMerchandiseId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | /** |
| | | * 状态(1=待核销,2=已核销) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 核销人员id |
| | | */ |
| | | private Integer verificationUserId; |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | private Date verificationTime; |
| | | /** |
| | | * 领取时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient; |
| | | |
| | | |
| | | 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.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface IntroduceRewardsClient { |
| | | |
| | | @PostMapping("/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody List<Integer> userIds); |
| | | |
| | | } |
File was renamed from cloud-server-account/src/main/java/com/dsh/account/model/vo/classDetails/classInsVo/PurchaseRecordVo.java |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | package com.dsh.activity.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.Coupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CouponMapper extends BaseMapper<Coupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface IntroduceRewardsMapper extends BaseMapper<IntroduceRewards> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserCouponMapper extends BaseMapper<UserCoupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserPointsMerchandiseMapper extends BaseMapper<UserPointsMerchandise> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.Coupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CouponService extends IService<Coupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface IntroduceRewardsService extends IService<IntroduceRewards> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserCouponService extends IService<UserCoupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserPointsMerchandiseService extends IService<UserPointsMerchandise> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.mapper.CouponMapper; |
| | | import com.dsh.activity.service.CouponService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> implements CouponService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | import com.dsh.activity.mapper.IntroduceRewardsMapper; |
| | | import com.dsh.activity.service.IntroduceRewardsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class IntroduceRewardsServiceImpl extends ServiceImpl<IntroduceRewardsMapper, IntroduceRewards> implements IntroduceRewardsService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.mapper.UserCouponMapper; |
| | | import com.dsh.activity.service.UserCouponService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class UserCouponServiceImpl extends ServiceImpl<UserCouponMapper, UserCoupon> implements UserCouponService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | import com.dsh.activity.mapper.UserPointsMerchandiseMapper; |
| | | import com.dsh.activity.service.UserPointsMerchandiseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class UserPointsMerchandiseServiceImpl extends ServiceImpl<UserPointsMerchandiseMapper, UserPointsMerchandise> implements UserPointsMerchandiseService { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!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"/> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.activity.mapper.IntroduceRewardsMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.activity.mapper.UserCouponMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.activity.mapper.UserPointsMerchandiseMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | |
| | | </mapper> |
| | |
| | | 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.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | 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("/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestParam("appUserId") Integer appUserId){ |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody Date startTime, @RequestBody Date endTime,@RequestParam("appUserId") Integer appUserId){ |
| | | |
| | | 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(appUserId,comIds); |
| | | List<UserCompetition> userCompetitions = ucttService.queryUsersCompetetions(startTime,endTime,appUserId,comIds); |
| | | if (userCompetitions.size() > 0){ |
| | | userCompetitions.forEach(coms ->{ |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | |
| | | 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.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-competition") |
| | | public interface DeductionCompetitionsClient { |
| | | |
| | | @PostMapping("/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestParam("appUserId") Integer appUserId); |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | |
| | | } |
| | |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public interface UserCompetitionMapper extends BaseMapper<UserCompetition> { |
| | | |
| | | |
| | | List<UserCompetition> queryUsersCompetetions(@Param("appUserId") Integer appUserId,@Param("comIds") List<Integer> comIds); |
| | | List<UserCompetition> queryUsersCompetetions(@Param("startTime") Date startTime, |
| | | @Param("endTime") Date endTime , |
| | | @Param("appUserId") Integer appUserId, |
| | | @Param("comIds") List<Integer> comIds); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public interface UserCompetitionService extends IService<UserCompetition> { |
| | | |
| | | |
| | | List<UserCompetition> queryUsersCompetetions(Integer appUserId, List<Integer> comIds); |
| | | List<UserCompetition> queryUsersCompetetions(Date startTime, Date endTime ,Integer appUserId, List<Integer> comIds); |
| | | |
| | | } |
| | |
| | | import com.dsh.competition.service.UserCompetitionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<UserCompetition> queryUsersCompetetions(Integer appUserId, List<Integer> comIds) { |
| | | return this.baseMapper.queryUsersCompetetions(appUserId,comIds); |
| | | public List<UserCompetition> queryUsersCompetetions(Date startTime, Date endTime , Integer appUserId, List<Integer> comIds) { |
| | | return this.baseMapper.queryUsersCompetetions(startTime,endTime,appUserId,comIds); |
| | | } |
| | | } |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="startTime != null and endTime != null"> |
| | | and (insertTime between #{startTime} and #{endTime}) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | |
| | | 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.PurchaseRecordVo; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | 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.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CancelSourceController { |
| | | |
| | | |
| | | @Autowired |
| | | private CancelledClassesService caceService; |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService tcppService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | |
| | | /** |
| | | * 获取课包对应的消费记录 |
| | | * @param stuId 学员id |
| | | * @param appUserId 用户id |
| | | * @return |
| | | */ |
| | | @PostMapping("/cancelSource/cancelList") |
| | | 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<Integer> coursePackageIds = tCoursePackagePayments.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | |
| | | List<CancelledClasses> list = caceService.list(new QueryWrapper<CancelledClasses>() |
| | | .in("coursePackageId", coursePackageIds) |
| | | .between("insertTime",startTime,endTime)); |
| | | if (list.size() > 0){ |
| | | list.forEach( canse -> { |
| | | PurchaseRecordVo purchaseRecordVo = new PurchaseRecordVo(); |
| | | purchaseRecordVo.setPurchaseTime(format.format(canse.getInsertTime())); |
| | | purchaseRecordVo.setPurchaseType(""); |
| | | purchaseRecordVo.setPurchaseAmount("-"+canse.getCancelledClassesNumber()); |
| | | purchaseRecordVos.add(purchaseRecordVo); |
| | | }); |
| | | } |
| | | return purchaseRecordVos; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | |
| | | |
| | | @PostMapping("/course/queryList") |
| | | public List<ExerciseVideo> queryStuCourseAfterVideos(List<Integer> courseIds){ |
| | | public List<ExerciseVideo> queryStuCourseAfterVideos(@RequestBody List<Integer> courseIds){ |
| | | List<ExerciseVideo> videos = new ArrayList<>(); |
| | | List<TCourse> list = courseService.list(new QueryWrapper<TCourse>() |
| | | .in("id", courseIds) |
| | |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.CourseOfStoreVo; |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.course.feignclient.model.StuCourseResp; |
| | | import com.dsh.course.feignclient.model.StuSessionDetailsVo; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Autowired |
| | | private TCoursePackageService tcpService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | /** |
| | | * 获取 没有学员信息的图片配置 |
| | | * @param stuId 学员id |
| | |
| | | @PostMapping("/coursePack/queryPayment") |
| | | public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | List<StuCourseResp> resps = new ArrayList<>(); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(stuId,appUserId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(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(@RequestParam("stuId") Integer stuId,@RequestParam("appUserId") Integer appUserId){ |
| | | 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(stuId,appUserId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(startTime,endTime,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>() |
| | |
| | | } |
| | | return detailsVos; |
| | | } |
| | | |
| | | @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); |
| | | if (coursePackage.size() > 0 ){ |
| | | coursePackage.forEach( cspackage -> { |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseAmount("+"+cspackage.getClassHours()); |
| | | recordVo.setPurchaseTime(format.format(cspackage.getInsertTime())); |
| | | recordVo.setPurchaseType("购买课包"); |
| | | purchaseRecordVos.add(recordVo); |
| | | }); |
| | | } |
| | | return purchaseRecordVos; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_cancelled_classes") |
| | | public class CancelledClasses extends Model<CancelledClasses> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 消课凭证 |
| | | */ |
| | | private String voucher; |
| | | /** |
| | | * 消课数量 |
| | | */ |
| | | private Integer cancelledClassesNumber; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | 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.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CancelListClient { |
| | | |
| | | @PostMapping("/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
| | |
| | | import com.dsh.course.feignclient.model.ExerciseVideo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface CourseListClient { |
| | | |
| | | @PostMapping("/course/queryList") |
| | | List<ExerciseVideo> queryStuCourseAfterVideos(List<Integer> courseIds); |
| | | List<ExerciseVideo> queryStuCourseAfterVideos(@RequestBody List<Integer> courseIds); |
| | | } |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.course.feignclient.model.StuSessionDetailsVo; |
| | | 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("/coursePack/sessionNames") |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestParam("stuId") Integer stuId, @RequestParam("appUserId") Integer appUserId); |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | |
| | | @PostMapping("/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
copy from cloud-server-account/src/main/java/com/dsh/account/model/vo/classDetails/classInsVo/PurchaseRecordVo.java
copy to cloud-server-course/src/main/java/com/dsh/course/feignclient/model/PurchaseRecordVo.java
File was copied from cloud-server-account/src/main/java/com/dsh/account/model/vo/classDetails/classInsVo/PurchaseRecordVo.java |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "类型名称") |
| | | private String purchaseType; |
| | | |
| | | @ApiModelProperty(value = "类型变动时间 例如 06-29 10:48") |
| | | @ApiModelProperty(value = "类型变动时间") |
| | | private String purchaseTime; |
| | | |
| | | @ApiModelProperty(value = "类型涉及金额 例如 +100 -50") |
| | | @ApiModelProperty(value = "类型涉及金额") |
| | | private String purchaseAmount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CancelledClassesMapper extends BaseMapper<CancelledClasses> { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface TCoursePackagePaymentMapper extends BaseMapper<TCoursePackagePayment> { |
| | | |
| | | List<TCoursePackagePayment> queryAllCoursePackage(@Param("stuId") Integer stuId, |
| | | List<TCoursePackagePayment> queryAllCoursePackage(@Param("startTime")Date startTime, |
| | | @Param("endTime")Date endTime , |
| | | @Param("stuId") Integer stuId, |
| | | @Param("appUserId") Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CancelledClassesService extends IService<CancelledClasses> { |
| | | |
| | | } |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface TCoursePackagePaymentService extends IService<TCoursePackagePayment> { |
| | | |
| | | List<TCoursePackagePayment> queryAllCoursePackage(Integer stuId,Integer appUserId); |
| | | List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime ,Integer stuId, Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.mapper.CancelledClassesMapper; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class CancelledClassesServiceImpl extends ServiceImpl<CancelledClassesMapper, CancelledClasses> implements CancelledClassesService { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class TCoursePackagePaymentServiceImpl extends ServiceImpl<TCoursePackagePaymentMapper, TCoursePackagePayment> implements TCoursePackagePaymentService { |
| | | |
| | | @Override |
| | | public List<TCoursePackagePayment> queryAllCoursePackage(Integer stuId,Integer appUserId) { |
| | | return this.baseMapper.queryAllCoursePackage(stuId,appUserId); |
| | | public List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime , Integer stuId, Integer appUserId) { |
| | | return this.baseMapper.queryAllCoursePackage(startTime,endTime,stuId,appUserId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.course.web; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/cancelled-classes") |
| | | public class CancelledClassesController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.CancelledClassesMapper"> |
| | | |
| | | </mapper> |
| | |
| | | <if test="appUserId != null"> |
| | | and appUserId = #{appUserId} |
| | | </if> |
| | | <if test="startTime != null and endTime != null"> |
| | | and (insertTime between #{startTime} and #{endTime}) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |