|
@@ -3,6 +3,7 @@ package com.zhongzheng.modules.base.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
@@ -20,6 +21,7 @@ import com.zhongzheng.modules.base.domain.ShoppingCart;
|
|
|
import com.zhongzheng.modules.base.mapper.ShoppingCartMapper;
|
|
|
import com.zhongzheng.modules.base.service.IShoppingCartService;
|
|
|
import com.zhongzheng.modules.base.vo.ShoppingCartVo;
|
|
|
+import com.zhongzheng.modules.course.domain.CourseChapter;
|
|
|
import com.zhongzheng.modules.distribution.domain.DistributionActivity;
|
|
|
import com.zhongzheng.modules.distribution.service.IDistributionActivityService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -174,6 +176,18 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, Sho
|
|
|
return this.remove(new LambdaQueryWrapper<ShoppingCart>().eq(ShoppingCart::getUserId,userId).eq(ShoppingCart::getGoodsId,goodsId));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean updateBatchChoice(ShoppingCartEditBo bo) {
|
|
|
+ for(Long id : bo.getIds()){
|
|
|
+ update(new LambdaUpdateWrapper<ShoppingCart>()
|
|
|
+ .set(ShoppingCart::getChoiceStatus,bo.getChoiceStatus())
|
|
|
+ .set(ShoppingCart::getUpdateTime,DateUtils.getNowTime())
|
|
|
+ .eq(ShoppingCart::getId,id)
|
|
|
+ .eq(ShoppingCart::getUserId,bo.getUserId()));
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
private boolean checkUnique(ShoppingCart entity) {
|
|
|
ShoppingCart info = getOne(new LambdaQueryWrapper<ShoppingCart>()
|
|
|
.eq(ShoppingCart::getUserId,entity.getUserId()).eq(ShoppingCart::getGoodsId,entity.getGoodsId()).last("limit 1"));
|