|
@@ -8,12 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
-import com.zhongzheng.modules.bank.mapper.QuestionMapper;
|
|
|
import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
|
|
|
-import com.zhongzheng.modules.course.domain.CourseModule;
|
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
-import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
@@ -25,14 +22,13 @@ import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeVo;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
|
|
|
import com.zhongzheng.modules.order.bo.*;
|
|
|
-import com.zhongzheng.modules.order.domain.Order;
|
|
|
import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderListVo;
|
|
|
-import com.zhongzheng.modules.order.vo.OrderVo;
|
|
|
+import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
|
|
|
import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
@@ -40,7 +36,6 @@ import com.zhongzheng.modules.user.service.IUserExamGoodsService;
|
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
import com.zhongzheng.modules.user.service.IUserSubscribeService;
|
|
|
-import io.swagger.models.auth.In;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -401,17 +396,29 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<OrderGoodsVo> listUserSubjectGoods(OrderSubjectUserBuyBo bo) {
|
|
|
- User user = iUserService.getOne(new LambdaQueryWrapper<User>()
|
|
|
- .eq(User::getIdCard,bo.getIdCard()).last("limit 1"));
|
|
|
- if(Validator.isNull(user)){
|
|
|
- throw new CustomException("该身份证号码用户不存在");
|
|
|
+ public List<OrderUserGoodsVo> listUserSubjectGoods(OrderSubjectUserBuyBo bo) {
|
|
|
+ List<OrderUserGoodsVo> allList = new ArrayList<>();
|
|
|
+ for(String idCard : bo.getIdCard()){
|
|
|
+ User user = iUserService.getOne(new LambdaQueryWrapper<User>()
|
|
|
+ .eq(User::getIdCard,idCard).last("limit 1"));
|
|
|
+ if(Validator.isNull(user)){
|
|
|
+ OrderUserGoodsVo goodsBo = new OrderUserGoodsVo();
|
|
|
+ goodsBo.setIdCard(idCard);
|
|
|
+ goodsBo.setGoodsList(new ArrayList<>());
|
|
|
+ allList.add(goodsBo);
|
|
|
+ }else{
|
|
|
+ GoodsQueryBo queryBo = new GoodsQueryBo();
|
|
|
+ queryBo.setSubjectId(bo.getSubjectId());
|
|
|
+ queryBo.setBusinessId(bo.getBusinessId());
|
|
|
+ queryBo.setUserId(user.getUserId());
|
|
|
+ List<OrderGoodsVo> list = this.baseMapper.listUserSubjectGoods(queryBo);
|
|
|
+ OrderUserGoodsVo goodsBo = new OrderUserGoodsVo();
|
|
|
+ goodsBo.setIdCard(idCard);
|
|
|
+ goodsBo.setGoodsList(list);
|
|
|
+ allList.add(goodsBo);
|
|
|
+ }
|
|
|
}
|
|
|
- GoodsQueryBo queryBo = new GoodsQueryBo();
|
|
|
- queryBo.setSubjectId(bo.getSubjectId());
|
|
|
- queryBo.setBusinessId(bo.getBusinessId());
|
|
|
- queryBo.setUserId(user.getUserId());
|
|
|
- return this.baseMapper.listUserSubjectGoods(queryBo);
|
|
|
+ return allList;
|
|
|
}
|
|
|
|
|
|
public boolean joinGrade(Long orderGoodsId, Long gradeId, Long userId, Long goodsId) {
|