TRX пре 1 година
родитељ
комит
0442baee60

+ 9 - 31
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/quest/QuestService.java

@@ -129,8 +129,12 @@ public class QuestService {
                             Object answer = linkedHashMap.get("answer");
                             String value = "";
                             if (answer != null) {
-                                if (answer instanceof List<?>) {
-                                    value = answer.toString();
+                                if (answer instanceof LinkedHashMap<?, ?>) {
+                                    LinkedHashMap tempMap = (LinkedHashMap) answer;
+                                    value = tempMap.get("value").toString();
+                                    if (tempMap.containsKey("supplementary")) {
+                                        value += ": " + tempMap.get("supplementary").toString();
+                                    }
                                 } else if (answer instanceof String) {
                                     value = answer.toString();
                                 } else {
@@ -139,33 +143,6 @@ public class QuestService {
                             }
                             map.put(questionId, value);
                         }
-
-//                        log.info("1112 : {}", data.toString());
-//                        String str = data.toString();
-//                        JSONArray jsonArray = new JSONArray(str);
-//                        for (int i = 0; i < jsonArray.size(); i++) {
-//                            JSONObject jsonObject = jsonArray.getJSONObject(i);
-//                            String questionId = jsonObject.get("questionId").toString();
-//                            if (!titleMap.containsKey(questionId)) {
-//                                QuestTitleModel titleModel = new QuestTitleModel();
-//                                titleModel.setQuestionId(questionId);
-//                                String question = jsonObject.get("question").toString();
-//                                titleModel.setQuestion(question);
-//                                titles.add(titleModel);
-//                                titleMap.put(questionId, question);
-//                            }
-//                            Object answer = jsonObject.get("answer");
-//                            String value = "";
-//                            if (answer != null) {
-//                                if (answer instanceof JSONArray) {
-//                                    JSONArray arr = (JSONArray) answer;
-//                                    value = arr.toString();
-//                                } else {
-//                                    value = answer.toString();
-//                                }
-//                            }
-//                            map.put(questionId, value);
-//                        }
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
@@ -181,9 +158,10 @@ public class QuestService {
         execlParam.setDatas(maps);
         List<CommonExeclTd> tds = new ArrayList<>();
         for (QuestTitleModel titleModel : titles) {
-            tds.add(CommonExeclTd.build(titleModel.getQuestion(), titleModel.getQuestionId(), 6));
+            tds.add(CommonExeclTd.build(titleModel.getQuestion(),
+                    titleModel.getQuestionId(), 8));
         }
-        tds.add(CommonExeclTd.build("时间", "timeStr", 6));
+        tds.add(CommonExeclTd.build("时间", "timeStr"));
         execlParam.setTds(tds);
         ExcelUtils.commonExecuteExcel(request, response, execlParam);
     }