|
|
@@ -19,6 +19,8 @@ import com.fs.his.mapper.FsUserMapper;
|
|
|
import com.fs.his.service.IFsStorePaymentService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import lombok.Getter;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -37,6 +39,7 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankService
|
|
|
{
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(FsCourseQuestionBankServiceImpl.class);
|
|
|
@Autowired
|
|
|
private FsCourseQuestionBankMapper fsCourseQuestionBankMapper;
|
|
|
@Autowired
|
|
|
@@ -789,12 +792,14 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
|
|
|
questionSetters.put(1, FsCourseQuestionBankImportDTO::setQuestionB);
|
|
|
questionSetters.put(2, FsCourseQuestionBankImportDTO::setQuestionC);
|
|
|
questionSetters.put(3, FsCourseQuestionBankImportDTO::setQuestionD);
|
|
|
+// questionSetters.put(4, FsCourseQuestionBankImportDTO::setQuestionE);
|
|
|
|
|
|
Map<Integer, String> answerLettersMap = new HashMap<>();
|
|
|
answerLettersMap.put(0, "A");
|
|
|
answerLettersMap.put(1, "B");
|
|
|
answerLettersMap.put(2, "C");
|
|
|
answerLettersMap.put(3, "D");
|
|
|
+// answerLettersMap.put(4, "E");
|
|
|
|
|
|
return fsCourseQuestionBanks.stream().map(q -> {
|
|
|
FsCourseQuestionBankImportDTO dto = new FsCourseQuestionBankImportDTO();
|
|
|
@@ -809,15 +814,15 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
|
|
|
JSONArray array = JSON.parseArray(q.getQuestion());
|
|
|
array.forEach(jsonObject -> {
|
|
|
JSONObject json = (JSONObject) jsonObject;
|
|
|
- int index = json.getInteger("indexId");
|
|
|
- String name = json.getString("name");
|
|
|
- int isAnswer = json.getInteger("isAnswer");
|
|
|
-
|
|
|
- questionSetters.get(index).accept(dto, name);
|
|
|
- if (isAnswer == 1) {
|
|
|
- answersBuilder.append(answerLettersMap.get(index));
|
|
|
+ Integer index = json.getInteger("indexId");
|
|
|
+ String name = json.getString("name")==null?"":json.getString("name");
|
|
|
+ Integer isAnswer = json.getInteger("isAnswer");
|
|
|
+ if (index != null && questionSetters.get(index)!=null) {
|
|
|
+ questionSetters.get(index).accept(dto, name);
|
|
|
+ if (isAnswer == 1) {
|
|
|
+ answersBuilder.append(answerLettersMap.get(index));
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
dto.setAnswer(answersBuilder .toString());
|
|
|
return dto;
|