复读剔除被删除的课程
This commit is contained in:
@@ -13,8 +13,10 @@ import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.common.service.BuyOrderService;
|
||||
import com.peanut.modules.common.service.JfTransactionDetailsService;
|
||||
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.UserCourseBuyService;
|
||||
import com.peanut.modules.medical.service.CourseService;
|
||||
import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo;
|
||||
import com.peanut.modules.pay.weChatPay.service.WxpayService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -43,6 +45,10 @@ public class CourseRelearnController {
|
||||
@Autowired
|
||||
private UserCourseBuyService userCourseBuyService;
|
||||
@Autowired
|
||||
private CourseService courseService;
|
||||
@Autowired
|
||||
private CourseCatalogueService courseCatalogueService;
|
||||
@Autowired
|
||||
private ShopProductService shopProductService;
|
||||
@Autowired
|
||||
private BuyOrderService buyOrderService;
|
||||
@@ -84,6 +90,10 @@ public class CourseRelearnController {
|
||||
@RequestMapping("/courseCatalogueCanRelearn")
|
||||
public R courseCatalogueCanRelearn(@RequestBody Map<String,Object> params){
|
||||
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>()
|
||||
.disableLogicDel()//查询出已删除数据
|
||||
.eq(UserCourseBuyEntity::getUserId, ShiroUtils.getUId())
|
||||
@@ -96,13 +106,18 @@ public class CourseRelearnController {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok().put("canRelearn",flag);
|
||||
}
|
||||
|
||||
//课程目录复读列表
|
||||
@RequestMapping("/relearnShopProductList")
|
||||
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<>();
|
||||
wrapper.leftJoin(ShopProductCourseEntity.class,ShopProductCourseEntity::getProductId,ShopProduct::getProductId);
|
||||
wrapper.selectAll(ShopProduct.class);
|
||||
@@ -136,6 +151,9 @@ public class CourseRelearnController {
|
||||
return R.error("未找到一年期商品");
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok().put("productList",new ArrayList<>());
|
||||
}
|
||||
|
||||
@RequestMapping("/relearnSave")
|
||||
@Transactional
|
||||
|
||||
Reference in New Issue
Block a user