فهرست منبع

fix 商品添加考试安排

tanzh 3 سال پیش
والد
کامیت
a8028c2338

+ 32 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -24,6 +24,11 @@ import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.exam.domain.ExamApplyGoods;
+import com.zhongzheng.modules.exam.domain.ExamApplyUser;
+import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
+import com.zhongzheng.modules.exam.service.IExamApplyUserService;
+import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
@@ -99,6 +104,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     @Autowired
     private IClassGradeUserService iClassGradeUserService;
 
+    @Autowired
+    private IExamApplyGoodsService iExamApplyGoodsService;
+
+    @Autowired
+    private IExamApplyUserService iExamApplyUserService;
+
 
 
     @Override
@@ -387,6 +398,27 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             }
             goodsUserVo.setSecAllNum(secLong);
             goodsUserVo.setStuAllNum(studyLong);
+
+            //查询对应考试安排
+            List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsUserVo.getGoodsId());
+            if (examApplyGoodsVoList != null && examApplyGoodsVoList.size() > 0) {
+                List<ExamApplyGoodsVo> examApplyGoodsVos = new ArrayList<>();
+                examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
+                    LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
+                    lqw.eq(ExamApplyUser::getApplyId, examApplyGoodsVo.getApplyId());
+                    List<ExamApplyUser> examApplyUserList = iExamApplyUserService.list(lqw);
+                    if (examApplyUserList != null && examApplyUserList.size() > 0) {
+                        ArrayList<Long> userIds = new ArrayList<>();
+                        examApplyUserList.forEach(examApplyUser -> {
+                            userIds.add(examApplyUser.getUserId());
+                        });
+                        if (userIds.contains(bo.getUserId())) {
+                            examApplyGoodsVos.add(examApplyGoodsVo);
+                        }
+                    }
+                });
+                goodsUserVo.setExamApplyGoodsList(examApplyGoodsVos);
+            }
         }
         return goodsUserVos;
     }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -253,7 +253,11 @@ public class GoodsUserVo {
 	@ApiModelProperty("商品关联前培状态")
 	private Long beforeStatus;
 
-	/** 学习进度 */
+	/** 考试ID */
+	@ApiModelProperty("考试ID")
+	private Long applyId;
+
+	/** 考试标题 */
 	@ApiModelProperty("考试标题")
 	private String applyName;