Commit c640a644 authored by 刘鑫鹏's avatar 刘鑫鹏

修改BUG

parent ffacb08d
......@@ -3,6 +3,7 @@ package com.tiptimes.dao;
import com.tiptimes.ctrl.QuestionnaireVo;
import com.tiptimes.model.*;
import com.tiptimes.model.QuestionnaireDTO.AnswerDTO;
import com.tiptimes.model.QuestionnaireDTO.SaveQuestionByGroup;
import com.tiptimes.model.exportDTO.*;
import org.apache.ibatis.annotations.Param;
......@@ -402,6 +403,11 @@ public interface QuestionnaireDao {
@Param("questionnaireUuid") Long questionnaireUuid
);
List<SaveQuestionByGroup> queryReviewList(
@Param("createId") String createId,
@Param("questionnaireUuid") Long questionnaireUuid
);
Integer updateReportStatus(@Param("aId") Integer aId);
int saveQuestionByGroup(@Param("questionsId") int questionsId,
......
......@@ -2932,28 +2932,29 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
@Override
public List<SaveQuestionByGroup> queryReview(Long uid, String createId, int year) {
// 查询上报记录id
try {
Integer aId = questionnaireDao.queryReport(createId, uid);
ArrayList<SaveQuestionByGroup> saveQuestionByGroups = new ArrayList<>();
for (FormGroup formGroup : questionnaireDao.queryGroup(Integer.parseInt(uid.toString()))) {
String questionsId = formGroup.getQuestionId();
int questionId = Integer.parseInt(questionsId.split(",")[0]);
SaveQuestionByGroup saveQuestionByGroup = new SaveQuestionByGroup();
Review review = questionnaireDao.selectReview(questionId, aId, formGroup.getGroupId());
if (review == null) {
saveQuestionByGroups.add(null);
continue;
}
saveQuestionByGroup.setGroupId(formGroup.getGroupId());
saveQuestionByGroup.setStatus(review.getApprovalStatus());
saveQuestionByGroup.setScore(review.getScore());
saveQuestionByGroup.setRemark(review.getRemark());
saveQuestionByGroups.add(saveQuestionByGroup);
}
return saveQuestionByGroups;
} catch (Exception e) {
return null;
}
// try {
// Integer aId = questionnaireDao.queryReport(createId, uid);
// ArrayList<SaveQuestionByGroup> saveQuestionByGroups = new ArrayList<>();
// for (FormGroup formGroup : questionnaireDao.queryGroup(Integer.parseInt(uid.toString()))) {
// String questionsId = formGroup.getQuestionId();
// int questionId = Integer.parseInt(questionsId.split(",")[0]);
// SaveQuestionByGroup saveQuestionByGroup = new SaveQuestionByGroup();
// Review review = questionnaireDao.selectReview(questionId, aId, formGroup.getGroupId());
// if (review == null) {
// saveQuestionByGroups.add(null);
// continue;
// }
// saveQuestionByGroup.setGroupId(formGroup.getGroupId());
// saveQuestionByGroup.setStatus(review.getApprovalStatus());
// saveQuestionByGroup.setScore(review.getScore());
// saveQuestionByGroup.setRemark(review.getRemark());
// saveQuestionByGroups.add(saveQuestionByGroup);
// }
// return saveQuestionByGroups;
// } catch (Exception e) {
// return null;
// }
return questionnaireDao.queryReviewList(createId, uid);
}
@Override
......@@ -3031,7 +3032,8 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
// 按照,分割
for (String str : list) {
if (str == null) {
if (str == null|| str.trim().equals(",")) {
rows.add(new String[0]);
continue;
}
rows.add(str.split(","));
......@@ -3068,6 +3070,13 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
if (resultArray.length == 0) {
return new ArrayList<>();
}
for (String[] row : resultArray) {
for (int j = 0; j < row.length; j++) {
if (row[j] == null) {
row[j] = ""; // 将null替换为""
}
}
}
for (int i = 0; i < resultArray[0].length; i++) {
StringBuilder s = new StringBuilder();
......@@ -3088,7 +3097,8 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
// 按照,分割
for (String str : list) {
if (str == null) {
if (str == null|| str.trim().equals(",")) {
rows.add(new String[0]);
continue;
}
rows.add(str.split(","));
......@@ -3111,6 +3121,7 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
// 判断条件
List<String[]> resultList = new ArrayList<>();
for (String[] row : result) {
if ("是".equals(row[15]) || "是".equals(row[11])) {
resultList.add(row);
}
......@@ -3123,7 +3134,13 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
if (resultArray.length == 0) {
return new ArrayList<>();
}
for (String[] row : resultArray) {
for (int j = 0; j < row.length; j++) {
if (row[j] == null) {
row[j] = ""; // 将null替换为""
}
}
}
List<String> str = new ArrayList<>();
for (int i = 0; i < resultArray[0].length; i++) {
......
......@@ -2066,6 +2066,20 @@
ORDER BY spaceName
</select>
<select id="queryReviewList" resultType="com.tiptimes.model.QuestionnaireDTO.SaveQuestionByGroup">
SELECT tre.approval_status as status,
tre.group_id as groupId,
tre.score as score,
tre.remark as remark
FROM t_record tr
LEFT JOIN t_review tre on tre.record_id = tr.id
WHERE tr.create_id = #{createId}
AND tr.questionnaire_uuid = #{questionnaireUuid}
ORDER BY tre.group_id
</select>
<!-- <select id="queryArray" resultType="java.lang.Integer">-->
<!-- SELECT t_options.id FROM t_options-->
<!-- WHERE t_options.question_id IN-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment