复读剔除被删除的课程

This commit is contained in:
wuchunlei
2025-05-26 13:13:20 +08:00
parent d712983311
commit 9b304fbffc

View File

@@ -13,8 +13,10 @@ import com.peanut.modules.common.entity.*;
import com.peanut.modules.common.service.BuyOrderService; import com.peanut.modules.common.service.BuyOrderService;
import com.peanut.modules.common.service.JfTransactionDetailsService; import com.peanut.modules.common.service.JfTransactionDetailsService;
import com.peanut.modules.common.service.MyUserService; import com.peanut.modules.common.service.MyUserService;
import com.peanut.modules.master.service.CourseCatalogueService;
import com.peanut.modules.master.service.ShopProductService; import com.peanut.modules.master.service.ShopProductService;
import com.peanut.modules.master.service.UserCourseBuyService; import com.peanut.modules.master.service.UserCourseBuyService;
import com.peanut.modules.medical.service.CourseService;
import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo; import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo;
import com.peanut.modules.pay.weChatPay.service.WxpayService; import com.peanut.modules.pay.weChatPay.service.WxpayService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -43,6 +45,10 @@ public class CourseRelearnController {
@Autowired @Autowired
private UserCourseBuyService userCourseBuyService; private UserCourseBuyService userCourseBuyService;
@Autowired @Autowired
private CourseService courseService;
@Autowired
private CourseCatalogueService courseCatalogueService;
@Autowired
private ShopProductService shopProductService; private ShopProductService shopProductService;
@Autowired @Autowired
private BuyOrderService buyOrderService; private BuyOrderService buyOrderService;
@@ -84,6 +90,10 @@ public class CourseRelearnController {
@RequestMapping("/courseCatalogueCanRelearn") @RequestMapping("/courseCatalogueCanRelearn")
public R courseCatalogueCanRelearn(@RequestBody Map<String,Object> params){ public R courseCatalogueCanRelearn(@RequestBody Map<String,Object> params){
boolean flag = false; boolean flag = false;
CourseCatalogueEntity cc = courseCatalogueService.getById(params.get("courseCatalogueId").toString());
if (cc != null) {
CourseEntity courseEntity = courseService.getById(cc.getCourseId());
if (courseEntity != null) {
List<UserCourseBuyEntity> list = userCourseBuyService.list(new MPJLambdaWrapper<UserCourseBuyEntity>() List<UserCourseBuyEntity> list = userCourseBuyService.list(new MPJLambdaWrapper<UserCourseBuyEntity>()
.disableLogicDel()//查询出已删除数据 .disableLogicDel()//查询出已删除数据
.eq(UserCourseBuyEntity::getUserId, ShiroUtils.getUId()) .eq(UserCourseBuyEntity::getUserId, ShiroUtils.getUId())
@@ -96,13 +106,18 @@ public class CourseRelearnController {
} }
} }
} }
}
}
return R.ok().put("canRelearn",flag); return R.ok().put("canRelearn",flag);
} }
//课程目录复读列表 //课程目录复读列表
@RequestMapping("/relearnShopProductList") @RequestMapping("/relearnShopProductList")
public R relearnShopProductList(@RequestBody Map<String,Object> params) { public R relearnShopProductList(@RequestBody Map<String,Object> params) {
CourseCatalogueEntity cc = courseCatalogueService.getById(params.get("catalogueId").toString());
if (cc != null) {
CourseEntity courseEntity = courseService.getById(cc.getCourseId());
if (courseEntity != null){
MPJLambdaWrapper<ShopProduct> wrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper<ShopProduct> wrapper = new MPJLambdaWrapper<>();
wrapper.leftJoin(ShopProductCourseEntity.class,ShopProductCourseEntity::getProductId,ShopProduct::getProductId); wrapper.leftJoin(ShopProductCourseEntity.class,ShopProductCourseEntity::getProductId,ShopProduct::getProductId);
wrapper.selectAll(ShopProduct.class); wrapper.selectAll(ShopProduct.class);
@@ -136,6 +151,9 @@ public class CourseRelearnController {
return R.error("未找到一年期商品"); return R.error("未找到一年期商品");
} }
} }
}
return R.ok().put("productList",new ArrayList<>());
}
@RequestMapping("/relearnSave") @RequestMapping("/relearnSave")
@Transactional @Transactional