he2802 3 tahun lalu
induk
melakukan
5f126cf55b

+ 17 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -19,10 +19,9 @@ import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.modules.base.service.ICertificateTpService;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
-import com.zhongzheng.modules.course.service.ICourseBusinessService;
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
-import com.zhongzheng.modules.course.service.ICourseMenuService;
-import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
+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.CourseMenuVo;
 import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
@@ -150,6 +149,12 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Autowired
     private IUserStudyRecordPhotoService userStudyRecordPhotoService;
 
+    @Autowired
+    private ICourseEducationTypeService iCourseEducationTypeService;
+
+    @Autowired
+    private ICourseProjectTypeService iCourseProjectTypeService;
+
     @Value("${oldStudySys.syncPath}")
     private String SYNC_PATH;
 
@@ -439,6 +444,14 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
 
     @Override
     public SyncUserCourseStudyRec syncStudyLogToOld(UserPeriodEditBo bo) {
+        CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
+        CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
+        CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
+
+        GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
+        if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
+            return null;
+        }
         UserVo userVo = iUserService.queryById(bo.getUserId());
         ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
         OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId,gradeUser.getOrderGoodsId()).last("limit 1"));
@@ -455,7 +468,6 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         studyRec.setCourseBuyTime(DateUtils.timestampToDateFormat(orderGoods.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
         studyRec.setClassNo(classGrade.getOfficialName());
         studyRec.setOrderGoodsId(orderGoods.getOrderGoodsId());
-        GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
         List<SyncUserChapterList> ChapterList = new ArrayList<>();
         GoodsCourseQueryBo goodsCourseQueryBo = new GoodsCourseQueryBo();
         goodsCourseQueryBo.setGoodsId(goodsVo.getGoodsId());
@@ -551,7 +563,6 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         params.put("stamp", nowTime.toString());
         params.put("sign", sign);
         params.put("jsonstr", JSONObject.toJSONString(studyRec));
-        System.out.println(params);
         String respone = "";
         try {
             respone = HttpUtils.postFormBody(SYNC_PATH, params);