|
@@ -40,10 +40,7 @@ import javax.validation.constraints.Max;
|
|
|
import javax.validation.constraints.Min;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -96,19 +93,19 @@ public class TCUsualScoreController {
|
|
|
@ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber
|
|
|
) throws IOException {
|
|
|
tcUsualScoreService.getUsualScoreImportLock(cultureProgramId, courseId, paperNumber, examId);
|
|
|
- List<List<ExcelField>> excelFieldRowList = new ArrayList<>();
|
|
|
+ List<Set<ExcelField>> excelFieldRowList = new ArrayList<>();
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.queryUsualScore(cultureProgramId, courseId, paperNumber, examId, sysUser.getId());
|
|
|
if (CollectionUtils.isNotEmpty(tcUsualScoreList)) {
|
|
|
tcUsualScoreList.stream().peek(s -> {
|
|
|
- List<ExcelField> excelFieldList = new ArrayList<>();
|
|
|
- excelFieldList.addAll(new ArrayList<>(Arrays.asList(new ExcelField("studentCode", "学号", s.getStudentCode(), true), new ExcelField("name", "姓名", s.getName(), true))));
|
|
|
+ Set<ExcelField> excelFieldList = new LinkedHashSet<>();
|
|
|
+ excelFieldList.addAll(new LinkedHashSet<>(Arrays.asList(new ExcelField("studentCode", "学号", s.getStudentCode(), true), new ExcelField("name", "姓名", s.getName(), true))));
|
|
|
excelFieldRowList.add(excelFieldList);
|
|
|
}
|
|
|
).collect(Collectors.toList());
|
|
|
} else {
|
|
|
- List<ExcelField> excelFieldList = new ArrayList<>();
|
|
|
- excelFieldList.addAll(new ArrayList<>(Arrays.asList(new ExcelField("studentCode", "学号", true), new ExcelField("name", "姓名", true))));
|
|
|
+ Set<ExcelField> excelFieldList = new LinkedHashSet<>();
|
|
|
+ excelFieldList.addAll(new LinkedHashSet<>(Arrays.asList(new ExcelField("studentCode", "学号", true), new ExcelField("name", "姓名", true))));
|
|
|
excelFieldRowList.add(excelFieldList);
|
|
|
}
|
|
|
|
|
@@ -124,7 +121,7 @@ public class TCUsualScoreController {
|
|
|
if (Objects.nonNull(s.getEnable()) && s.getEnable() && !Objects.equals(s.getEvaluationName(),
|
|
|
SystemConstant.FINAL_SCORE_STR)) {
|
|
|
for (int y = 0; y < excelFieldRowList.size(); y++) {
|
|
|
- List<ExcelField> excelFieldList = excelFieldRowList.get(y);
|
|
|
+ Set<ExcelField> excelFieldList = excelFieldRowList.get(y);
|
|
|
excelFieldList.add(new ExcelField(s.getEvaluationName(), true));
|
|
|
}
|
|
|
}
|
|
@@ -144,8 +141,7 @@ public class TCUsualScoreController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "作业集合信息", response = Object.class)})
|
|
|
public Result usualScoreTemplateDownloadList(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
|
@ApiParam(value = "课程id", required = true) @RequestParam Long courseId) {
|
|
|
- List<ExcelField> excelFieldList = new ArrayList<>();
|
|
|
- excelFieldList = this.getUsualScoreList(cultureProgramId, courseId, excelFieldList);
|
|
|
+ Set<ExcelField> excelFieldList = this.getUsualScoreList(cultureProgramId, courseId);
|
|
|
excelFieldList.stream().peek(s -> s.setNull()).collect(Collectors.toList());
|
|
|
return ResultUtil.ok(excelFieldList);
|
|
|
}
|
|
@@ -249,15 +245,15 @@ public class TCUsualScoreController {
|
|
|
*
|
|
|
* @param cultureProgramId
|
|
|
* @param courseId
|
|
|
- * @param excelFieldList
|
|
|
* @return
|
|
|
*/
|
|
|
- protected List<ExcelField> getUsualScoreList(Long cultureProgramId, Long courseId, List<ExcelField> excelFieldList) {
|
|
|
+ protected Set<ExcelField> getUsualScoreList(Long cultureProgramId, Long courseId) {
|
|
|
ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(
|
|
|
cultureProgramId, courseId);
|
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
|
List<CourseWeightDto> courseWeightDtoList = obeCourseWeightResult.getSubmitForm();
|
|
|
|
|
|
+ Set<ExcelField> excelFieldList = new LinkedHashSet<>();
|
|
|
courseWeightDtoList.stream().peek(e -> {
|
|
|
List<CourseWeightDetailDto> courseWeightDetailDtoList = e.getEvaluationList();
|
|
|
courseWeightDetailDtoList.stream().peek(s -> {
|