| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletException; |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "添加检验下单数据") |
| | | @PreAuthorize("@ss.hasPermi('add:insOrder')") |
| | | @PostMapping("/addInsOrder") |
| | | public Result<?> addInsOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) { |
| | | return Result.success(insOrderService.addInsOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder())); |
| | |
| | | public Result<?> delInsOrder(Integer insOrderId) { |
| | | // 查询订单 |
| | | InsOrder order = insOrderService.getById(insOrderId); |
| | | if (!order.getState().equals(2)) { |
| | | if (!(order.getState().equals(2) || order.getState().equals(3))) { |
| | | throw new ErrorException("只有退回订单才能删除"); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "根据订单id查询样品") |
| | | @GetMapping("/getSampleByOrderId") |
| | | public Result<List<InsSample>> getSampleByOrderId(Integer insOrderId) { |
| | | return Result.success(insSampleService.list(Wrappers.<InsSample>lambdaQuery() |
| | | .eq(InsSample::getInsOrderId, insOrderId))); |
| | | return Result.success(insSampleService.getSampleByOrderId(insOrderId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据样品id查询检验项树") |
| | |
| | | insOrderService.rawAllInsOrderExport(sampleOrderDto,response); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "修改样品型号") |
| | | @PostMapping("/updateSampleModel") |
| | | public Result<?> updateSampleModel(@RequestBody List<InsSample> insSampleList) { |
| | | for (InsSample insSample : insSampleList) { |
| | | insOrderService.updateSampleModel(insSample); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前时间是否没有该检测项的抽样计划") |
| | | @PostMapping("/judgeNotSpotCheckOrder") |
| | | public Result<?> judgeNotSpotCheckOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) { |
| | | return insOrderService.judgeNotSpotCheckOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder()); |
| | | } |
| | | |
| | | } |