| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDto; |
| | | import com.ruoyi.procurementrecord.mapper.GasTankWarningMapper; |
| | | import com.ruoyi.procurementrecord.pojo.GasTankWarning; |
| | | import com.ruoyi.procurementrecord.service.GasTankWarningService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, List<Long> ids) { |
| | | List<GasTankWarning> list = new ArrayList<>(); |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | list = gasTankWarningMapper.selectList(null); |
| | | }else { |
| | | list = gasTankWarningMapper.selectBatchIds(ids); |
| | | LambdaQueryWrapper<GasTankWarning> objectLambdaQueryWrapper = new LambdaQueryWrapper<GasTankWarning>(); |
| | | if (CollectionUtils.isNotEmpty(ids)) { |
| | | objectLambdaQueryWrapper.in(GasTankWarning::getId, ids); |
| | | } |
| | | List<GasTankWarning> list = gasTankWarningMapper.selectList(objectLambdaQueryWrapper); |
| | | ExcelUtil<GasTankWarning> util = new ExcelUtil<>(GasTankWarning.class); |
| | | util.exportExcel(response, list, "储气罐预警.xlsx"); |
| | | } |