This commit is contained in:
wangjinlei
2024-04-28 10:25:31 +08:00
parent 3980da2fb1
commit dbe836f884
4 changed files with 46 additions and 4 deletions

View File

@@ -257,6 +257,7 @@ public class BuyOrderController {
return R.error(500, "信息中不能含有“+”、“&”符号!");
}
}
buyOrder.setOrderStatus("0");
buyOrderService.save(buyOrder);
//解决购物车相关问题
@@ -904,9 +905,9 @@ public class BuyOrderController {
LambdaQueryWrapper<UserCourseBuyEntity> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(UserCourseBuyEntity::getUserId,orderEntity.getUserId());
wrapper2.eq(UserCourseBuyEntity::getCatalogueId,s.getCatalogueId());
wrapper2.lt(UserCourseBuyEntity::getEndTime,new Date());
wrapper2.gt(UserCourseBuyEntity::getEndTime,new Date());
List<UserCourseBuyEntity> userCourseBuyEntities = userCourseBuyDao.selectList(wrapper2);
if(userCourseBuyEntities.size()>0){
if(userCourseBuyEntities.size()>0){//延长有效期
UserCourseBuyEntity userCourseBuyEntity = userCourseBuyEntities.get(0);
Calendar calendar = Calendar.getInstance();
calendar.setTime(userCourseBuyEntity.getEndTime());
@@ -917,6 +918,7 @@ public class BuyOrderController {
UserCourseBuyEntity userCourseBuyEntity = new UserCourseBuyEntity();
userCourseBuyEntity.setUserId(orderEntity.getUserId());
userCourseBuyEntity.setCourseId(s.getCourseId());
userCourseBuyEntity.setCatalogueId(s.getCatalogueId());
userCourseBuyEntity.setDays(s.getDays());
userCourseBuyEntity.setCreateTime(new Date());
userCourseBuyEntity.setStartTime(new Date());