| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.inspect.pojo.InsOrder; |
| | | import com.ruoyi.inspect.dto.InsPlaceOrderDto; |
| | | import com.ruoyi.process.dto.InspectionOrderDto; |
| | | import com.ruoyi.process.dto.InspectionOrderBindingDto; |
| | | import com.ruoyi.process.pojo.InspectionOrderAttachment; |
| | | import com.ruoyi.process.pojo.InspectionOrder; |
| | | import com.ruoyi.process.service.InspectionOrderService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return Result.success(inspectionOrderService.addInspectionOrder(InspectionOrder)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询未绑定检验委托单") |
| | | @GetMapping("/pageUnboundInspectionOrder") |
| | | public Result<IPage<InspectionOrder>> pageUnboundInspectionOrder(InspectionOrder inspectionOrder, Page page) { |
| | | return Result.success(inspectionOrderService.pageUnboundInspectionOrder(page, inspectionOrder)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询可重复绑定的检验委托单") |
| | | @GetMapping("/pageSelectableInspectionOrder") |
| | | public Result<IPage<InspectionOrder>> pageSelectableInspectionOrder(InspectionOrder inspectionOrder, Page page) { |
| | | return Result.success(inspectionOrderService.pageUnboundInspectionOrder(page, inspectionOrder)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询检验委托单的历次下单记录") |
| | | @GetMapping("/pageInspectionOrderBindings") |
| | | public Result<IPage<InspectionOrderBindingDto>> pageInspectionOrderBindings(Page page, Integer inspectionOrderId, |
| | | Boolean includeDeleted) { |
| | | return Result.success(inspectionOrderService.pageInspectionOrderBindings(page, inspectionOrderId, includeDeleted)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询检验委托单附件") |
| | | @GetMapping("/listInspectionOrderAttachments") |
| | | public Result<List<InspectionOrderAttachment>> listInspectionOrderAttachments(Integer inspectionOrderId, |
| | | Long bindingId) { |
| | | return Result.success(inspectionOrderService.listInspectionOrderAttachments(inspectionOrderId, bindingId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取成品下单关联的委托单信息") |
| | | @GetMapping("/getInspectionOrderForPlaceOrder") |
| | | public Result<InspectionOrderDto> getInspectionOrderForPlaceOrder(Integer inspectionOrderId) { |
| | | return Result.success(inspectionOrderService.getInspectionOrderForPlaceOrder(inspectionOrderId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增成品下单并绑定检验委托单") |
| | | @PreAuthorize("@ss.hasPermi('add:insOrder')") |
| | | @PostMapping("/addInsOrderWithInspectionOrder") |
| | | public Result<Integer> addInsOrderWithInspectionOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) { |
| | | return Result.success(inspectionOrderService.addInsOrderWithInspectionOrder(insPlaceOrderDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "变更检验委托单关联") |
| | | @PreAuthorize("@ss.hasPermi('add:insOrder')") |
| | | @PostMapping("/changeBinding") |
| | | public Result changeBinding(Integer insOrderId, Integer inspectionOrderId, String reason) { |
| | | return Result.success(inspectionOrderService.changeBinding(insOrderId, inspectionOrderId, reason)); |
| | | } |
| | | |
| | | /** |
| | | * 委托单检验修改 |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 委托单检验查看详情 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据成品订单查询委托单详情") |
| | | @GetMapping("/getInspectionOrderByInsOderId") |
| | | public Result<InspectionOrderDto> getInspectionOrderByInsOderId(Integer insOrderId){ |
| | | return Result.success(inspectionOrderService.getInspectionOrderByInsOderId(insOrderId)); |
| | | } |
| | | |
| | | /** |
| | | * 委托单查询成品订单 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "委托单查询成品订单") |
| | | @GetMapping("/getInsOrderOnInspection") |
| | | public Result<IPage<InsOrder>> getInsOrderOnInspection(Page page ,InsOrder insOrder) throws Exception { |
| | | return Result.success(inspectionOrderService.getInsOrderOnInspection(page, insOrder)); |
| | | } |
| | | |
| | | /** |
| | | * 委托单成品报告上传 |
| | | * @return |
| | | */ |
| | |
| | | return Result.success(inspectionOrderService.uploadInspectionOrderFile(file, inspectionOrderId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "按下单记录上传委托单附件") |
| | | @PreAuthorize("@ss.hasPermi('add:insOrder')") |
| | | @PostMapping("/uploadInspectionOrderBindingFile") |
| | | public Result uploadInspectionOrderBindingFile(MultipartFile file, Long bindingId) { |
| | | return Result.success(inspectionOrderService.uploadInspectionOrderBindingFile(file, bindingId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "重试同步正式报告到检验委托单") |
| | | @PreAuthorize("@ss.hasPermi('add:insOrder')") |
| | | @PostMapping("/retryInspectionOrderReportSync") |
| | | public Result retryInspectionOrderReportSync(Integer insReportId) { |
| | | inspectionOrderService.syncReportFile(insReportId); |
| | | return Result.success(true); |
| | | } |
| | | |
| | | /** |
| | | * 导出检验委托单 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导出检验委托单") |
| | | @GetMapping("/exportInspectionOrder") |
| | | public void exportInspectionOrder(Integer inspectionOrderId, HttpServletResponse response){ |
| | | inspectionOrderService.exportInspectionOrder(inspectionOrderId, response); |
| | | public void exportInspectionOrder(Integer inspectionOrderId, Long bindingId, HttpServletResponse response){ |
| | | inspectionOrderService.exportInspectionOrder(inspectionOrderId, bindingId, response); |
| | | } |
| | | } |