|
|
@@ -7,8 +7,10 @@ import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.bank.bo.*;
|
|
|
import com.zhongzheng.modules.bank.domain.QuestionBusiness;
|
|
|
import com.zhongzheng.modules.bank.domain.QuestionModule;
|
|
|
+import com.zhongzheng.modules.bank.domain.QuestionModuleChapter;
|
|
|
import com.zhongzheng.modules.bank.mapper.QuestionModuleMapper;
|
|
|
import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
|
|
|
+import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
|
|
|
import com.zhongzheng.modules.bank.service.IQuestionModuleService;
|
|
|
import com.zhongzheng.modules.bank.vo.QuestionModuleVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -37,6 +39,9 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
|
|
|
@Autowired
|
|
|
private IQuestionBusinessService iQuestionBusinessService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IQuestionModuleChapterService iQuestionModuleChapterService;
|
|
|
+
|
|
|
@Override
|
|
|
public QuestionModuleVo queryById(Long questionModuleId){
|
|
|
QuestionModule db = this.baseMapper.selectById(questionModuleId);
|
|
|
@@ -88,12 +93,22 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
|
|
|
for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
QuestionBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
QuestionBusiness addItem = BeanUtil.toBean(item, QuestionBusiness.class);
|
|
|
- addItem.setMajorId(add.getQuestionModuleId());
|
|
|
+ addItem.setMajorId(add.getModuleExamId());
|
|
|
addItem.setType(QuestionBusiness.TYPE_QUESTION_MODULE);
|
|
|
coll.add(addItem);
|
|
|
}
|
|
|
iQuestionBusinessService.saveBatch(coll);
|
|
|
}
|
|
|
+ if(bo.getChapterList()!=null){
|
|
|
+ Collection<QuestionModuleChapter> coll = new HashSet<>();
|
|
|
+ for(int i=0;i<bo.getChapterList().size();i++){
|
|
|
+ QuestionModuleChapterAddBo item = bo.getChapterList().get(i);
|
|
|
+ QuestionModuleChapter addItem = BeanUtil.toBean(item, QuestionModuleChapter.class);
|
|
|
+ addItem.setModuleExamId(add.getModuleExamId());
|
|
|
+ coll.add(addItem);
|
|
|
+ }
|
|
|
+ iQuestionModuleChapterService.saveBatch(coll);
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -104,18 +119,29 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
if(bo.getBusinessList()!=null){
|
|
|
- iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>().eq(QuestionBusiness::getMajorId, bo.getQuestionModuleId())
|
|
|
+ iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>().eq(QuestionBusiness::getMajorId, bo.getModuleExamId())
|
|
|
.eq(QuestionBusiness::getType,QuestionBusiness.TYPE_QUESTION_MODULE));
|
|
|
Collection<QuestionBusiness> coll = new HashSet<>();
|
|
|
for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
QuestionBusinessEditBo item = bo.getBusinessList().get(i);
|
|
|
QuestionBusiness addItem = BeanUtil.toBean(item, QuestionBusiness.class);
|
|
|
- addItem.setMajorId(update.getQuestionModuleId());
|
|
|
+ addItem.setMajorId(update.getModuleExamId());
|
|
|
addItem.setType(QuestionBusiness.TYPE_QUESTION_MODULE);
|
|
|
coll.add(addItem);
|
|
|
}
|
|
|
iQuestionBusinessService.saveBatch(coll);
|
|
|
}
|
|
|
+ if(bo.getChapterList()!=null){
|
|
|
+ iQuestionModuleChapterService.remove(new LambdaQueryWrapper<QuestionModuleChapter>().eq(QuestionModuleChapter::getModuleExamId, bo.getModuleExamId()));
|
|
|
+ Collection<QuestionModuleChapter> coll = new HashSet<>();
|
|
|
+ for(int i=0;i<bo.getChapterList().size();i++){
|
|
|
+ QuestionModuleChapterEditBo item = bo.getChapterList().get(i);
|
|
|
+ QuestionModuleChapter addItem = BeanUtil.toBean(item, QuestionModuleChapter.class);
|
|
|
+ addItem.setModuleExamId(bo.getModuleExamId());
|
|
|
+ coll.add(addItem);
|
|
|
+ }
|
|
|
+ iQuestionModuleChapterService.saveBatch(coll);
|
|
|
+ }
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
|