|
|
@@ -182,7 +182,6 @@ public class MhFireDutyServiceImpl extends AbstractCrudService<MhFireDutyMapper,
|
|
|
MhFireDuty::getDutyDate, startTime, endTime)
|
|
|
.eq(MhFireDuty::getIsDeleted, 0)
|
|
|
.orderByDesc(MhFireDuty::getDutyDate);
|
|
|
-
|
|
|
page = this.page(page, queryWrapper);
|
|
|
List<MhFireDuty> dutyList = page.getRecords();
|
|
|
if (CollectionUtils.isEmpty(dutyList)) {
|
|
|
@@ -222,22 +221,15 @@ public class MhFireDutyServiceImpl extends AbstractCrudService<MhFireDutyMapper,
|
|
|
* 生成Excel
|
|
|
*/
|
|
|
@Override
|
|
|
- public void exportExcel(List<Long> ids, HttpServletResponse response) throws IOException {
|
|
|
- if (ids.isEmpty()) {
|
|
|
- throw new BusinessException("请选择需要导出的记录!");
|
|
|
- }
|
|
|
+ public void exportExcel(HttpServletResponse response, LocalDate startTime, LocalDate endTime, String memberName) throws IOException {
|
|
|
|
|
|
- // 1. 查询所有主表数据
|
|
|
- List<MhFireDuty> dutyList = new ArrayList<>();
|
|
|
- for (Long id : ids) {
|
|
|
- MhFireDuty duty = this.getById(id);
|
|
|
- if (duty != null) {
|
|
|
- dutyList.add(duty);
|
|
|
- }
|
|
|
- }
|
|
|
- if (dutyList.isEmpty()) {
|
|
|
- throw new BusinessException("所选记录不存在!");
|
|
|
- }
|
|
|
+ LambdaQueryWrapper<MhFireDuty> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.like(StringUtils.isNotBlank(memberName), MhFireDuty::getMember, memberName)
|
|
|
+ .between(Objects.nonNull(startTime) && Objects.nonNull(endTime),
|
|
|
+ MhFireDuty::getDutyDate, startTime, endTime)
|
|
|
+ .eq(MhFireDuty::getIsDeleted, 0)
|
|
|
+ .orderByDesc(MhFireDuty::getDutyDate);
|
|
|
+ List<MhFireDuty> dutyList = this.list(queryWrapper);
|
|
|
|
|
|
List<Long> dutyIds = dutyList.stream().map(MhFireDuty::getId).collect(Collectors.toList());
|
|
|
List<MhFireDutyBusiness> allBusiness = businessMapper.selectList(
|