|
@@ -6,10 +6,8 @@ import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.bank.bo.*;
|
|
import com.zhongzheng.modules.bank.bo.*;
|
|
|
import com.zhongzheng.modules.bank.domain.QuestionBusiness;
|
|
import com.zhongzheng.modules.bank.domain.QuestionBusiness;
|
|
|
import com.zhongzheng.modules.bank.domain.QuestionChapter;
|
|
import com.zhongzheng.modules.bank.domain.QuestionChapter;
|
|
|
-import com.zhongzheng.modules.bank.domain.QuestionChapterBusiness;
|
|
|
|
|
import com.zhongzheng.modules.bank.mapper.QuestionChapterMapper;
|
|
import com.zhongzheng.modules.bank.mapper.QuestionChapterMapper;
|
|
|
import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
|
|
import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
|
|
|
-import com.zhongzheng.modules.bank.service.IQuestionChapterBusinessService;
|
|
|
|
|
import com.zhongzheng.modules.bank.service.IQuestionChapterService;
|
|
import com.zhongzheng.modules.bank.service.IQuestionChapterService;
|
|
|
import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
|
|
import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -36,7 +34,7 @@ import java.util.stream.Collectors;
|
|
|
public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMapper, QuestionChapter> implements IQuestionChapterService {
|
|
public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMapper, QuestionChapter> implements IQuestionChapterService {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private IQuestionChapterBusinessService iQuestionChapterBusinessService;
|
|
|
|
|
|
|
+ private IQuestionBusinessService iQuestionBusinessService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public QuestionChapterVo queryById(Long chapterExamId){
|
|
public QuestionChapterVo queryById(Long chapterExamId){
|
|
@@ -85,14 +83,15 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
boolean result = this.save(add);
|
|
boolean result = this.save(add);
|
|
|
if(bo.getBusinessList()!=null){
|
|
if(bo.getBusinessList()!=null){
|
|
|
- Collection<QuestionChapterBusiness> coll = new HashSet<>();
|
|
|
|
|
|
|
+ Collection<QuestionBusiness> coll = new HashSet<>();
|
|
|
for(int i=0;i<bo.getBusinessList().size();i++){
|
|
for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
- QuestionChapterBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
|
|
- QuestionChapterBusiness addItem = BeanUtil.toBean(item, QuestionChapterBusiness.class);
|
|
|
|
|
- addItem.setChapterExamId(add.getChapterExamId());
|
|
|
|
|
|
|
+ QuestionBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
|
|
+ QuestionBusiness addItem = BeanUtil.toBean(item, QuestionBusiness.class);
|
|
|
|
|
+ addItem.setMajorId(add.getChapterExamId());
|
|
|
|
|
+ addItem.setType(QuestionBusiness.TYPE_QUESTION_CHAPTER);
|
|
|
coll.add(addItem);
|
|
coll.add(addItem);
|
|
|
}
|
|
}
|
|
|
- iQuestionChapterBusinessService.saveBatch(coll);
|
|
|
|
|
|
|
+ iQuestionBusinessService.saveBatch(coll);
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
@@ -104,15 +103,17 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
|
|
|
validEntityBeforeSave(update);
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
if(bo.getBusinessList()!=null){
|
|
if(bo.getBusinessList()!=null){
|
|
|
- iQuestionChapterBusinessService.remove(new LambdaQueryWrapper<QuestionChapterBusiness>().eq(QuestionChapterBusiness::getChapterExamId, bo.getChapterExamId()));
|
|
|
|
|
- Collection<QuestionChapterBusiness> coll = new HashSet<>();
|
|
|
|
|
|
|
+ iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>().eq(QuestionBusiness::getMajorId, bo.getChapterExamId())
|
|
|
|
|
+ .eq(QuestionBusiness::getType,QuestionBusiness.TYPE_QUESTION_CHAPTER));
|
|
|
|
|
+ Collection<QuestionBusiness> coll = new HashSet<>();
|
|
|
for(int i=0;i<bo.getBusinessList().size();i++){
|
|
for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
- QuestionChapterBusinessEditBo item = bo.getBusinessList().get(i);
|
|
|
|
|
- QuestionChapterBusiness addItem = BeanUtil.toBean(item, QuestionChapterBusiness.class);
|
|
|
|
|
- addItem.setChapterExamId(update.getChapterExamId());
|
|
|
|
|
|
|
+ QuestionBusinessEditBo item = bo.getBusinessList().get(i);
|
|
|
|
|
+ QuestionBusiness addItem = BeanUtil.toBean(item, QuestionBusiness.class);
|
|
|
|
|
+ addItem.setMajorId(update.getChapterExamId());
|
|
|
|
|
+ addItem.setType(QuestionBusiness.TYPE_QUESTION_CHAPTER);
|
|
|
coll.add(addItem);
|
|
coll.add(addItem);
|
|
|
}
|
|
}
|
|
|
- iQuestionChapterBusinessService.saveBatch(coll);
|
|
|
|
|
|
|
+ iQuestionBusinessService.saveBatch(coll);
|
|
|
}
|
|
}
|
|
|
return this.updateById(update);
|
|
return this.updateById(update);
|
|
|
}
|
|
}
|