| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.mdm.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.basesetting.machine.service.MachineService; |
| | | import org.springblade.mdm.basesetting.producedivision.entity.MdmDept; |
| | |
| | | import org.springblade.mdm.machinefile.service.MachineFileService; |
| | | import org.springblade.mdm.machinefile.vo.*; |
| | | import org.springblade.mdm.program.vo.CompareDataVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @Autowired |
| | | private FileSendRecordService fileSendRecordService; |
| | | |
| | | @GetMapping("/file-page") |
| | | @Operation(summary = "工控网目录文件列表", description = "工控网目录文件列表") |
| | | @GetMapping("/page") |
| | | @Operation(summary = "下发文件记录列表", description = "下发文件记录列表") |
| | | public R<IPage<FileSendRecordVO>> page(FileSendRecordQueryVO query) { |
| | | |
| | | if(query.getCreateTimeEnd()!=null){ |
| | | query.setCreateTimeEnd(query.getCreateTimeEnd().plusDays(1)); |
| | | } |
| | | return R.data(fileSendRecordService.pageQuery(query)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "下发文件记录表导出", description = "下发文件记录表导出") |
| | | public void export(FileSendRecordQueryVO query, HttpServletResponse response) { |
| | | query.setCurrent(1); |
| | | query.setSize(Integer.MAX_VALUE); |
| | | |
| | | //IPage<MachineBackFileVO> pages = service.pageQuery(query); |
| | | IPage<FileSendRecordVO> pages = fileSendRecordService.pageQuery(query); |
| | | List<FileSendRecordExcelVO> list = new ArrayList<>(); |
| | | pages.getRecords().forEach(m ->{ |
| | | FileSendRecordExcelVO excelVO = new FileSendRecordExcelVO(); |
| | | BeanUtils.copyProperties(m, excelVO); |
| | | list.add(excelVO); |
| | | }); |
| | | ExcelUtil.export(response, "下发文件记录表" + DateUtil.time(), "下发文件记录表", list, FileSendRecordExcelVO.class); |
| | | } |
| | | |
| | | } |