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