| | |
| | | package com.ruoyi.cwgl.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.cwgl.domain.vo.DispatchOrderAttachmentVo; |
| | | import com.ruoyi.cwgl.domain.vo.DispatchOrderItemVo; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import com.ruoyi.cwgl.service.IDispatchOrderService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 调度单Controller |
| | |
| | | public TableDataInfo list(DispatchOrder dispatchOrder) |
| | | { |
| | | startPage(); |
| | | List<DispatchOrder> list = dispatchOrderService.selectDispatchOrderList(dispatchOrder); |
| | | List<DispatchOrder> list = dispatchOrderService.selectDispatchOrderList2(dispatchOrder); |
| | | return getDataTable(list); |
| | | } /** |
| | | * 查询调度单列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('cwgl:dispatchOrder:item')") |
| | | @GetMapping("/item") |
| | | public AjaxResult item(String no) |
| | | { |
| | | List<DispatchOrderItemVo> list = dispatchOrderService.selectDispatchOrderItem(no); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询调度单列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('cwgl:dispatchOrder:attachment')") |
| | | @GetMapping("/attachment") |
| | | public TableDataInfo attachment(String no) |
| | | { |
| | | startPage(); |
| | | |
| | | List<DispatchOrderAttachmentVo> list = dispatchOrderService.selectDispatchOrderAttachment(no); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('cwgl:dispatchOrder:attachment')") |
| | | @GetMapping("/downAttachment") |
| | | public void downAttachment(String no, HttpServletResponse response) throws Exception { |
| | | String filePath = dispatchOrderService.downAttachment(no); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, FileUtils.getName(filePath)); |
| | | FileUtils.writeBytes(filePath, response.getOutputStream()); |
| | | } |
| | | |
| | | /** |
| | |
| | | dispatchOrderService.export(dispatchOrder,exportKey); |
| | | return AjaxResult.success("导出请求成功,请稍后点击下载...!"); |
| | | } |
| | | /** |
| | | * 导出调度单列表 |
| | | * @param dispatchOrder 查询条件对象 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('cwgl:dispatchOrder:export')") |
| | | @Log(title = "调度单", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export2") |
| | | public AjaxResult export2(DispatchOrder dispatchOrder,String exportKey) |
| | | { |
| | | dispatchOrderService.export2(dispatchOrder,exportKey); |
| | | return AjaxResult.success("导出请求成功,请稍后点击下载...!"); |
| | | } |
| | | |
| | | |
| | | |
| | | |