|
@@ -10,9 +10,14 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
|
+import com.zhongzheng.modules.user.bo.UserPlanGoodsAddBo;
|
|
|
|
+import com.zhongzheng.modules.user.domain.UserPlanGoods;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserPlanCourceService;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserPlanGoodsService;
|
|
import com.zhongzheng.modules.user.vo.CalendarStudyVo;
|
|
import com.zhongzheng.modules.user.vo.CalendarStudyVo;
|
|
import com.zhongzheng.modules.user.vo.DaySectionVo;
|
|
import com.zhongzheng.modules.user.vo.DaySectionVo;
|
|
import com.zhongzheng.modules.user.vo.DayStudyVo;
|
|
import com.zhongzheng.modules.user.vo.DayStudyVo;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -41,6 +46,9 @@ import java.util.stream.Collectors;
|
|
@Service
|
|
@Service
|
|
public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> implements IUserPlanService {
|
|
public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> implements IUserPlanService {
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserPlanGoodsService userPlanGoodsService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public UserPlanVo queryById(Long planId){
|
|
public UserPlanVo queryById(Long planId){
|
|
UserPlan userPlan = this.baseMapper.selectById(planId);
|
|
UserPlan userPlan = this.baseMapper.selectById(planId);
|
|
@@ -191,6 +199,14 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
userPlan.setEndTime(bo.getEndTime());
|
|
userPlan.setEndTime(bo.getEndTime());
|
|
userPlan.setReminderTime(bo.getReminderTime());
|
|
userPlan.setReminderTime(bo.getReminderTime());
|
|
this.save(userPlan);
|
|
this.save(userPlan);
|
|
|
|
+ for (Long goodsId : bo.getGoodsId()) {
|
|
|
|
+ UserPlanGoodsAddBo userPlanGoodsAddBo = new UserPlanGoodsAddBo();
|
|
|
|
+ userPlanGoodsAddBo.setPlanId(userPlan.getPlanId());
|
|
|
|
+ userPlanGoodsAddBo.setSourceId(goodsId);
|
|
|
|
+ userPlanGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ userPlanGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ userPlanGoodsService.insertByAddBo(userPlanGoodsAddBo);
|
|
|
|
+ }
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -255,6 +271,17 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
userPlan.setReminderTime(bo.getReminderTime());
|
|
userPlan.setReminderTime(bo.getReminderTime());
|
|
userPlan.setPlanId(bo.getPlanId());
|
|
userPlan.setPlanId(bo.getPlanId());
|
|
this.updateById(userPlan);
|
|
this.updateById(userPlan);
|
|
|
|
+ LambdaQueryWrapper<UserPlanGoods> lqw = Wrappers.lambdaQuery();
|
|
|
|
+ lqw.eq(UserPlanGoods::getPlanId, userPlan.getPlanId());
|
|
|
|
+ userPlanGoodsService.remove(lqw);
|
|
|
|
+ for (Long goodsId : bo.getGoodsId()) {
|
|
|
|
+ UserPlanGoodsAddBo userPlanGoodsAddBo = new UserPlanGoodsAddBo();
|
|
|
|
+ userPlanGoodsAddBo.setPlanId(userPlan.getPlanId());
|
|
|
|
+ userPlanGoodsAddBo.setSourceId(goodsId);
|
|
|
|
+ userPlanGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ userPlanGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ userPlanGoodsService.insertByAddBo(userPlanGoodsAddBo);
|
|
|
|
+ }
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|