|
@@ -5298,6 +5298,93 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
return baseMapper.getCourseExamNumNoTenant(goodsId);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean updateExamBusiness() {
|
|
|
+ //模块卷
|
|
|
+ List<QuestionModule> modules = baseMapper.getModuleExam();
|
|
|
+ if (CollectionUtils.isNotEmpty(modules)){
|
|
|
+ modules.forEach(item -> {
|
|
|
+ Long tenantId = item.getTenantId();
|
|
|
+ SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getModuleExamId(),46);
|
|
|
+ if (ObjectUtils.isNull(copyRecord)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),4);
|
|
|
+ if (CollectionUtils.isEmpty(businesses)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //同步模块卷业务层次
|
|
|
+ businesses.forEach(bs -> {
|
|
|
+ bs.setId(null);
|
|
|
+ bs.setMajorId(item.getModuleExamId());
|
|
|
+ bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
|
|
|
+ bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
|
|
|
+ bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
|
|
|
+ bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
|
|
|
+ bs.setTenantId(tenantId);
|
|
|
+ baseMapper.saveExamBusiness(bs);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //章卷
|
|
|
+ List<QuestionChapter> chapters = baseMapper.getChapterExam();
|
|
|
+ if (CollectionUtils.isNotEmpty(chapters)){
|
|
|
+ chapters.forEach(item -> {
|
|
|
+ Long tenantId = item.getTenantId();
|
|
|
+ SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getChapterExamId(),44);
|
|
|
+ if (ObjectUtils.isNull(copyRecord)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),3);
|
|
|
+ if (CollectionUtils.isEmpty(businesses)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //同步模块卷业务层次
|
|
|
+ businesses.forEach(bs -> {
|
|
|
+ bs.setId(null);
|
|
|
+ bs.setMajorId(item.getChapterExamId());
|
|
|
+ bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
|
|
|
+ bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
|
|
|
+ bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
|
|
|
+ bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
|
|
|
+ bs.setTenantId(tenantId);
|
|
|
+
|
|
|
+ baseMapper.saveExamBusiness(bs);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //试卷
|
|
|
+ List<Exam> exam = baseMapper.getExam();
|
|
|
+ if (CollectionUtils.isNotEmpty(exam)){
|
|
|
+ exam.forEach(item -> {
|
|
|
+ Long tenantId = item.getTenantId();
|
|
|
+ SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getExamId(),28);
|
|
|
+ if (ObjectUtils.isNull(copyRecord)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),2);
|
|
|
+ if (CollectionUtils.isEmpty(businesses)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //同步模块卷业务层次
|
|
|
+ businesses.forEach(bs -> {
|
|
|
+ bs.setId(null);
|
|
|
+ bs.setMajorId(item.getExamId());
|
|
|
+ bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
|
|
|
+ bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
|
|
|
+ bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
|
|
|
+ bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
|
|
|
+ bs.setTenantId(tenantId);
|
|
|
+
|
|
|
+ baseMapper.saveExamBusiness(bs);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
private void updateHandoutsId(Long goodsId, Long tenantId, Long handoutsId) {
|
|
|
baseMapper.updateHandoutsId(goodsId, tenantId, handoutsId);
|