|
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.user.bo.UserPlanGoodsAddBo;
|
|
|
import com.zhongzheng.modules.user.domain.UserPlanGoods;
|
|
@@ -52,7 +53,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public UserPlanVo queryById(Long planId){
|
|
|
+ public UserPlanVo queryById(Long planId,Long UserId){
|
|
|
UserPlan userPlan = this.baseMapper.selectById(planId);
|
|
|
//得到日历日期
|
|
|
UserPlanVo userPlanVo = new UserPlanVo();
|
|
@@ -65,13 +66,13 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
userPlanVo.setPitchNum(userPlan.getPitchNum());
|
|
|
userPlanVo.setStudyNum(userPlan.getStudyNum());
|
|
|
userPlanVo.setPlanId(userPlan.getPlanId());
|
|
|
- List<GoodsVo> goodsVos = userPlanGoodsService.selectGoods(planId);
|
|
|
+ List<GoodsUserVo> goodsVos = userPlanGoodsService.selectGoods(planId,UserId);
|
|
|
userPlanVo.setGoodsVos(goodsVos);
|
|
|
// List转成数组
|
|
|
Long[] array = new Long[goodsVos.size()];
|
|
|
// 输出数组
|
|
|
List<Long> arrys = new ArrayList<>();
|
|
|
- for (GoodsVo goodsVo : goodsVos) {
|
|
|
+ for (GoodsUserVo goodsVo : goodsVos) {
|
|
|
arrys.add(goodsVo.getGoodsId());
|
|
|
}
|
|
|
arrys.toArray(array);
|
|
@@ -115,13 +116,13 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
userPlanVo.setPitchNum(userPlan.getPitchNum());
|
|
|
userPlanVo.setStudyNum(userPlan.getStudyNum());
|
|
|
userPlanVo.setPlanId(userPlan.getPlanId());
|
|
|
- List<GoodsVo> goodsVos = userPlanGoodsService.selectGoods(userPlan.getPlanId());
|
|
|
+ List<GoodsUserVo> goodsVos = userPlanGoodsService.selectGoods(userPlanVo.getPlanId(),userPlanVo.getUserId());
|
|
|
userPlanVo.setGoodsVos(goodsVos);
|
|
|
// List转成数组
|
|
|
Long[] array = new Long[goodsVos.size()];
|
|
|
// 输出数组
|
|
|
List<Long> arrys = new ArrayList<>();
|
|
|
- for (GoodsVo goodsVo : goodsVos) {
|
|
|
+ for (GoodsUserVo goodsVo : goodsVos) {
|
|
|
arrys.add(goodsVo.getGoodsId());
|
|
|
}
|
|
|
arrys.toArray(array);
|
|
@@ -163,6 +164,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
|
|
|
@Override
|
|
|
public Boolean insertByAddBo(UserPlanAddBo bo) throws ParseException {
|
|
|
+ validEntityPlanBeforeSave(bo);
|
|
|
UserPlan userPlan = new UserPlan();
|
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
|
|
|
Long sumUp=0L;
|
|
@@ -334,7 +336,6 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
|
|
|
@Override
|
|
|
public UserPlanVo listPlan(UserPlanEditBo bo) throws ParseException {
|
|
|
- validEntityPlanBeforeSave(bo);
|
|
|
UserPlanVo userPlanVo = new UserPlanVo();
|
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
|
|
|
for (Long aLong : bo.getGoodsId()) {
|
|
@@ -469,7 +470,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
*
|
|
|
* @param bo 实体类数据
|
|
|
*/
|
|
|
- private void validEntityPlanBeforeSave(UserPlanEditBo bo){
|
|
|
+ private void validEntityPlanBeforeSave(UserPlanAddBo bo){
|
|
|
//判断是否商品已被生成过课程
|
|
|
Integer rank = baseMapper.selectCountGoods(bo);
|
|
|
if (rank > 0){
|