lisy
2023-08-01 6dd3ce5d438e90e453bf3e44e287aa835ffda339
cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java
@@ -4,7 +4,9 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.course.entity.*;
import com.dsh.course.feignclient.account.AppUserClient;
import com.dsh.course.feignclient.account.StudentClient;
import com.dsh.course.feignclient.account.model.AppUser;
import com.dsh.course.feignclient.account.model.Student;
import com.dsh.course.feignclient.model.*;
import com.dsh.course.feignclient.other.StoreClient;
import com.dsh.course.feignclient.other.model.Store;
@@ -71,7 +73,8 @@
    @Autowired
    private TCourseService tcService;
    @Resource
    private StudentClient studentClient;
    @Autowired
    private TCoursePackageTypeService coursePackageTypeService;
@@ -97,17 +100,13 @@
     * @param stuId 学员id
     * @return  课包列表
     */
    @ResponseBody
    @PostMapping("/base/coursePack/queryPayment")
    public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId){
        Integer userIdFormRedis = null;
        try {
            userIdFormRedis = tokenUtil.getUserIdFormRedis();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        List<StuCourseResp> resps = new ArrayList<>();
        Student student = studentClient.queryStudentById(stuId);
        List<TCoursePackagePayment> byUserId = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>()
                .eq("appUserId",userIdFormRedis)
                .eq("appUserId",student.getAppUserId())
                .eq("studentId",stuId));
        if (byUserId.size() > 0 ){
@@ -119,6 +118,8 @@
                resp.setTotalCourseNums(tCoursePackagePayment.getTotalClassHours());
                resp.setResidueNums(tCoursePackagePayment.getLaveClassHours());
                resp.setDeductionNums(tCoursePackagePayment.getTotalClassHours()-tCoursePackagePayment.getLaveClassHours());
                String afterDayDate = DateUtil.getAfterDayDate2(tCoursePackage.getInsertTime(),tCoursePackage.getValidDays() + "");
                resp.setPeriodOfValidity(afterDayDate);
                resps.add(resp);
            }
        }
@@ -129,6 +130,7 @@
     *
     * 获取发布的 课包列表
     */
    @ResponseBody
    @PostMapping("/base/coursePack/storeOfCourse")
    public List<CourseOfStoreVo> getStuCourseWithStores(@RequestBody WeeksOfCourseRest courseRest){
        List<CourseOfStoreVo> course = new ArrayList<>();
@@ -377,12 +379,13 @@
    }
    @PostMapping("/base/coursePack/allAmountPayRecordOfUser")
    public List<TCoursePackagePayment> getAmountPayRecord(@RequestBody Integer appUserId){
    public List<TCoursePackagePayment> getAmountPayRecord(@RequestBody BillingDataRequestVo billingDataRequestVo){
        return packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>()
                .eq("appUserId",appUserId)
                .eq("appUserId",billingDataRequestVo.getAppUserId())
                .notIn("payType",3)
                .eq("payStatus",2)
                .eq("state",1));
                .eq("state",1)
                .between("insertTime",billingDataRequestVo.getMonthStart(),billingDataRequestVo.getMonthEnd()));
    }