Procházet zdrojové kódy

fix 同步公共课程

he2802 před 2 roky
rodič
revize
d5595a1b79

+ 16 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -27,10 +27,7 @@ import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
 import com.zhongzheng.modules.course.domain.CourseProjectType;
 import com.zhongzheng.modules.course.service.*;
-import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
-import com.zhongzheng.modules.course.vo.CourseMenuVo;
-import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
-import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
@@ -173,6 +170,9 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Autowired
     private ICourseChapterSectionService iCourseChapterSectionService;
 
+    @Autowired
+    private ICourseChapterService iCourseChapterService;
+
     @Value("${oldStudySys.syncPath}")
     private String SYNC_PATH;
 
@@ -331,10 +331,10 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             UserPeriodStatusVo oldData = userPeriodStatusService.queryById(id);
             Long goodsId;
             String userName = "系统自动审核通过";
+            UserPeriod period = getById(oldData.getPeriodId());
             if (ObjectUtils.isNotNull(bo.getGoodsId())){
                 goodsId = bo.getGoodsId();
             }else {
-                UserPeriod period = getById(oldData.getPeriodId());
                 goodsId = period.getGoodsId();
             }
             //获取业务学时审核数据
@@ -380,6 +380,17 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             userPeriods.eq(UserPeriodStatus::getPeriodStatus, 1);
             userPeriods.eq(UserPeriodStatus::getStatus, 2);
             userPeriodStatusService.update(userPeriodStatus, userPeriods);
+
+            CourseChapterVo chapterVo = iCourseChapterService.queryById(period.getChapterId());
+            if(Validator.isNotEmpty(chapterVo)&&Validator.isNotEmpty(chapterVo.getCommonSign())&&chapterVo.getCommonSign()==1){
+                if(bo.getStatus()==0){
+                    LambdaUpdateWrapper<OrderGoods> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+                    objectLambdaUpdateWrapper.eq(OrderGoods::getOrderGoodsId, period.getOrderGoodsId());
+                    objectLambdaUpdateWrapper.set(OrderGoods::getSevenClassStatus, 4);
+                    iOrderGoodsService.update(null, objectLambdaUpdateWrapper);
+                }
+            }
+
         }
         //更新班级学员信息
         ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();