|
|
@ -181,7 +181,7 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 设置响应头
|
|
|
|
// 设置响应头
|
|
|
|
// URLEncoder.encode防止中文乱码
|
|
|
|
// URLEncoder.encode防止中文乱码
|
|
|
|
String fileName = URLEncoder.encode("演练记录表", "UTF-8"); |
|
|
|
String fileName = URLEncoder.encode("演练数据表", "UTF-8"); |
|
|
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
|
|
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
response.setCharacterEncoding("UTF-8"); |
|
|
|
response.setCharacterEncoding("UTF-8"); |
|
|
@ -192,7 +192,7 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R |
|
|
|
.registerConverter(new LongStringConverter()) |
|
|
|
.registerConverter(new LongStringConverter()) |
|
|
|
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) |
|
|
|
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
WriteSheet writeSheet = EasyExcel.writerSheet(1, "演练记录表").head(RehearsalExportDTO.class) |
|
|
|
WriteSheet writeSheet = EasyExcel.writerSheet(1, "演练数据表").head(RehearsalExportDTO.class) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
excelWriter.write(rehearsalList, writeSheet); |
|
|
|
excelWriter.write(rehearsalList, writeSheet); |
|
|
|
excelWriter.finish(); |
|
|
|
excelWriter.finish(); |
|
|
@ -243,15 +243,15 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R |
|
|
|
public IPage<RehearsalPlanEntity> rehearsalPlanPage(Map<String, Object> param, Query query) { |
|
|
|
public IPage<RehearsalPlanEntity> rehearsalPlanPage(Map<String, Object> param, Query query) { |
|
|
|
QueryWrapper<RehearsalPlanEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<RehearsalPlanEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
String unit = String.valueOf(param.get("unit")); |
|
|
|
String unit = String.valueOf(param.get("unit")); |
|
|
|
String startTime = String.valueOf(param.get("startTime")); |
|
|
|
String startTime = String.valueOf(param.get("scheduledStartTime")); |
|
|
|
String endTime = String.valueOf((param.get("endTime"))); |
|
|
|
String endTime = String.valueOf((param.get("scheduledEndTime"))); |
|
|
|
if (unit.equals("null") || unit.equals("")) { |
|
|
|
if (!unit.equals("null") && !unit.equals("")) { |
|
|
|
queryWrapper.lambda().eq(RehearsalPlanEntity::getUnit, unit); |
|
|
|
queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit); |
|
|
|
} |
|
|
|
} |
|
|
|
if (startTime.equals("null") || startTime.equals("")) { |
|
|
|
if (!startTime.equals("null") && !startTime.equals("")) { |
|
|
|
queryWrapper.lambda().ge(RehearsalPlanEntity::getScheduledStartTime, startTime); |
|
|
|
queryWrapper.lambda().ge(RehearsalPlanEntity::getScheduledStartTime, startTime); |
|
|
|
} |
|
|
|
} |
|
|
|
if (endTime.equals("null") || endTime.equals("")) { |
|
|
|
if (!endTime.equals("null") && !endTime.equals("")) { |
|
|
|
queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime); |
|
|
|
queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime); |
|
|
|
} |
|
|
|
} |
|
|
|
return this.page(Condition.getPage(query), queryWrapper); |
|
|
|
return this.page(Condition.getPage(query), queryWrapper); |
|
|
|