|
@@ -47,11 +47,11 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
|
|
|
QuestionOther db = this.baseMapper.selectById(id);
|
|
|
JSONObject jsonObject = (JSONObject) JSONObject.parse(db.getJsonStr());
|
|
|
List<QuestionOld> qList = JSONArray.parseArray(String.valueOf(jsonObject.get("data")),QuestionOld.class);
|
|
|
- System.out.println(qList);
|
|
|
if (!db.getJsonStr().contains("\"msg\":\"获取成功\"")) {
|
|
|
throw new CustomException("同步请求错误");
|
|
|
}
|
|
|
int i = 100;
|
|
|
+ List<Long> qIdList = new ArrayList<>();
|
|
|
for(QuestionOld old : qList){
|
|
|
QuestionAddBo childAddBo = new QuestionAddBo();
|
|
|
String importNo = ServletUtils.getEncoded("IMPORT");
|
|
@@ -95,10 +95,12 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
|
|
|
childAddBo.setAnalysisContent(old.getAnalysis());
|
|
|
String answerQuestion="";
|
|
|
for(QuestionOldOptions options : old.getOptions()){
|
|
|
- if(options.getOptiontitle().equals("是")&&options.getIsanswer()){
|
|
|
- answerQuestion = "1";
|
|
|
- }else{
|
|
|
- answerQuestion = "0";
|
|
|
+ if(options.getIsanswer()){
|
|
|
+ if(options.getSerialnum().equals("A")){
|
|
|
+ answerQuestion = "1";
|
|
|
+ }else{
|
|
|
+ answerQuestion = "0";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
childAddBo.setAnswerQuestion(answerQuestion);
|
|
@@ -118,6 +120,9 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
|
|
|
addBo.setType(3);
|
|
|
}
|
|
|
addBo.setAnalysisContent(oldChild.getAnalysis());
|
|
|
+ if(oldChild.getAnalysis().startsWith("检查各类面层")){
|
|
|
+ System.out.println(oldChild.getAnalysis());
|
|
|
+ }
|
|
|
if(oldChild.getQuiztype()<3){
|
|
|
String answerQuestion="";
|
|
|
List<QuestionOptionsAddBo> optionsItemList = new ArrayList<>();
|
|
@@ -136,10 +141,12 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
|
|
|
else if(oldChild.getQuiztype()==4){
|
|
|
String answerQuestion="";
|
|
|
for(QuestionOldOptions options : oldChild.getOptions()){
|
|
|
- if(options.getOptiontitle().equals("是")&&options.getIsanswer()){
|
|
|
- answerQuestion = "1";
|
|
|
- }else{
|
|
|
- answerQuestion = "0";
|
|
|
+ if(options.getIsanswer()){
|
|
|
+ if(options.getSerialnum().equals("A")){
|
|
|
+ answerQuestion = "1";
|
|
|
+ }else{
|
|
|
+ answerQuestion = "0";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
addBo.setAnswerQuestion(answerQuestion);
|
|
@@ -148,8 +155,10 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
|
|
|
}
|
|
|
childAddBo.setOptionsList(optionsList);
|
|
|
}
|
|
|
- iQuestionService.insertByAddBoImport(childAddBo,i);
|
|
|
+ Long qId = iQuestionService.insertByAddBoImportBackId(childAddBo,i);
|
|
|
+ qIdList.add(qId);
|
|
|
i++;
|
|
|
+ System.out.println(qIdList.size());
|
|
|
}
|
|
|
return BeanUtil.toBean(db, QuestionOtherVo.class);
|
|
|
}
|