|
|
|
@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class AdminExportExamRecordDomainServiceImpl implements AdminExportExamRecordDomainService { |
|
|
|
@ -36,7 +37,11 @@ public class AdminExportExamRecordDomainServiceImpl implements AdminExportExamRe |
|
|
|
List<ExportExamRecordDTO> exportList = dataList.stream().map(dto -> { |
|
|
|
ExportExamRecordDTO exportDTO = new ExportExamRecordDTO(); |
|
|
|
BeanUtil.copyProperties(dto, exportDTO); |
|
|
|
exportDTO.setScore(String.format("%.2f" , dto.getScore())); |
|
|
|
if (Objects.nonNull(dto.getScore())) { |
|
|
|
exportDTO.setScore(String.format("%.2f" , dto.getScore())); |
|
|
|
} else { |
|
|
|
exportDTO.setScore(""); |
|
|
|
} |
|
|
|
return exportDTO; |
|
|
|
}).toList(); |
|
|
|
EasyExcel.write(response.getOutputStream(), ExportExamRecordDTO.class) |
|
|
|
|