|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.core.annotations.ManagerAuth; | 
|---|
|  |  |  | import com.core.common.BaseRes; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.R; | 
|---|
|  |  |  | import com.zy.asrs.entity.LocDetl; | 
|---|
|  |  |  | import com.zy.asrs.entity.OrderDetl; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.StoPreTab; | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | import com.zy.asrs.constant.AsrsConstants; | 
|---|
|  |  |  | import com.zy.asrs.entity.*; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.common.model.DetlDto; | 
|---|
|  |  |  | import com.zy.common.model.LocDto; | 
|---|
|  |  |  | import com.zy.common.model.OrderDto; | 
|---|
|  |  |  | import com.zy.common.model.OrderMergeVo; | 
|---|
|  |  |  | import com.zy.common.model.TaskDto; | 
|---|
|  |  |  | import com.zy.common.web.BaseController; | 
|---|
|  |  |  | import com.zy.system.service.ConfigService; | 
|---|
|  |  |  | import lombok.Synchronized; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | import java.util.stream.Collectors; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by vincent on 2022/3/26 | 
|---|
|  |  |  | 
|---|
|  |  |  | private LocMastService locMastService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private StaDescService staDescService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private WorkService workService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private BasDevpService basDevpService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private MatService matService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AgvLocMastService agvLocMastService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AgvBasDevpService agvBasDevpService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AgvWorkService agvWorkService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ManLocDetlService manLocDetlService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ManPakOutService manPakOutService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private DocTypeService docTypeService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    @PostMapping("/out/pakout/preview/auth") | 
|---|
|  |  |  | //    public R pakoutPreview(@RequestBody List<Long> ids) { | 
|---|
|  |  |  | //        if (Cools.isEmpty(ids)) { | 
|---|
|  |  |  | //            return R.parse(BaseRes.PARAM); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | //        List<OrderDetl> orderDetls = orderDetlService.selectBatchIds(ids); | 
|---|
|  |  |  | //        Set<DetlDto> detlDtos = new HashSet<>(); | 
|---|
|  |  |  | //        for (OrderDetl orderDetl : orderDetls) { | 
|---|
|  |  |  | //            if (DetlDto.hasList(detlDtos, orderDetl)) { | 
|---|
|  |  |  | //                DetlDto detlDto = DetlDto.find(detlDtos, orderDetl.getMatnr(), orderDetl.getBatch()); | 
|---|
|  |  |  | //                assert detlDto != null; | 
|---|
|  |  |  | //                detlDto.setAnfme(detlDto.getAnfme() + orderDetl.getAnfme()); | 
|---|
|  |  |  | //            } else { | 
|---|
|  |  |  | //                detlDtos.add(new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getAnfme())); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | //        List<LocDto> locDtos = new ArrayList<>(); | 
|---|
|  |  |  | //        for (DetlDto detlDto : detlDtos) { | 
|---|
|  |  |  | //            double issued = Optional.ofNullable(detlDto.getAnfme()).orElse(0.0D) ; | 
|---|
|  |  |  | //            List<LocDetl> locDetls = locDetlService.queryStock(detlDto.getMatnr(), detlDto.getBatch(), null); | 
|---|
|  |  |  | //            for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  | //                if (issued > 0) { | 
|---|
|  |  |  | //                    locDtos.add(new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(), issued>=locDetl.getAnfme()?locDetl.getAnfme():issued)); | 
|---|
|  |  |  | //                    // 剩余待出数量递减 | 
|---|
|  |  |  | //                    issued = issued - locDetl.getAnfme(); | 
|---|
|  |  |  | //                } else { | 
|---|
|  |  |  | //                    break; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | //        return R.ok().add(locDtos); | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AgvLocDetlService agvLocDetlService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ConfigService configService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AgvWrkMastService agvWrkMastService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/out/pakout/orderDetlIds/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R pakoutOrderDetlIds(@RequestParam Long orderId) throws InterruptedException { | 
|---|
|  |  |  | Thread.sleep(200); | 
|---|
|  |  |  | return R.ok().add(orderDetlService.selectByOrderId(orderId).stream().map(OrderDetl::getId).distinct().collect(Collectors.toList())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //出库 | 
|---|
|  |  |  | @PostMapping("/out/pakout/preview/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R pakoutPreview(@RequestBody List<Long> ids) { | 
|---|
|  |  |  | if (Cools.isEmpty(ids)) { | 
|---|
|  |  |  | return R.parse(BaseRes.PARAM); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<OrderDetl> orderDetls = orderDetlService.selectBatchIds(ids); | 
|---|
|  |  |  | List<LocDto> locDtos = new ArrayList<>(); | 
|---|
|  |  |  | for (OrderDetl orderDetl : orderDetls) { | 
|---|
|  |  |  | double issued = Optional.ofNullable(orderDetl.getAnfme()).orElse(0.0D) ; | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null); | 
|---|
|  |  |  | for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<OrderDetl> orderDetlList = orderDetlService.selectBatchIds(ids); | 
|---|
|  |  |  | //返回给前端的库位以及站点信息 | 
|---|
|  |  |  | List<LocDto> locDtoList = new ArrayList<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (OrderDetl orderDetl : orderDetlList) { | 
|---|
|  |  |  | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); | 
|---|
|  |  |  | Order order = orderService.selectByNo(orderDetl.getOrderNo()); | 
|---|
|  |  |  | DocType docType = docTypeService.selectById(order.getDocType()); | 
|---|
|  |  |  | if ("人工补货单".equals(docType.getDocName())) { | 
|---|
|  |  |  | if (issued <= 0.0D) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | issued = locDetlService.queryStockAndSetLocDto1(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrderNo(), locDtoList, issued, orderDetl.getThreeCode(), orderDetl.getDeadTime()); | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), | 
|---|
|  |  |  | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued); | 
|---|
|  |  |  | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); | 
|---|
|  |  |  | locDto.setStaNos(staNos); | 
|---|
|  |  |  | locDtos.add(locDto); | 
|---|
|  |  |  | // 剩余待出数量递减 | 
|---|
|  |  |  | issued = issued - locDetl.getAnfme(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued, orderDetl.getProcessSts()); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtoList.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (issued <= 0.0D) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //从平库寻找 | 
|---|
|  |  |  | //issued = manLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //先找AGV的库存,如果返回的issued大于0,则去四项库找 | 
|---|
|  |  |  | issued = agvLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrderNo(), locDtoList, issued, orderDetl.getThreeCode(), orderDetl.getDeadTime(), null); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //从四项库的库存里面找, | 
|---|
|  |  |  | //issued = locDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued, orderDetl.getProcessSts()); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtoList.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtos.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok().add(locDtos); | 
|---|
|  |  |  | return R.ok().add(locDtoList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //出库 | 
|---|
|  |  |  | @PostMapping("/bcp/out/pakout/preview/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R bcpPakoutPreview(@RequestBody List<Long> ids) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<OrderDetl> orderDetlList = orderDetlService.selectBatchIds(ids); | 
|---|
|  |  |  | //返回给前端的库位以及站点信息 | 
|---|
|  |  |  | List<LocDto> locDtoList = new ArrayList<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (OrderDetl orderDetl : orderDetlList) { | 
|---|
|  |  |  | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); | 
|---|
|  |  |  | Order order = orderService.selectByNo(orderDetl.getOrderNo()); | 
|---|
|  |  |  | DocType docType = docTypeService.selectById(order.getDocType()); | 
|---|
|  |  |  | if ("人工补货单".equals(docType.getDocName())) { | 
|---|
|  |  |  | if (issued <= 0.0D) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | issued = locDetlService.queryStockAndSetLocDto1(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrderNo(), locDtoList, issued, orderDetl.getThreeCode(), orderDetl.getDeadTime()); | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued, orderDetl.getProcessSts()); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtoList.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (issued <= 0.0D) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //从平库寻找 | 
|---|
|  |  |  | //issued = manLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //先找AGV的库存,如果返回的issued大于0,则去四项库找 | 
|---|
|  |  |  | issued = agvLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrderNo(), locDtoList, issued, orderDetl.getThreeCode(), orderDetl.getDeadTime(), "bcp"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //从四项库的库存里面找, | 
|---|
|  |  |  | //issued = locDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued, orderDetl.getProcessSts()); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtoList.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok().add(locDtoList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 二厂 | 
|---|
|  |  |  | * @param ids | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/bcp/out/pakout/preview/auth/v2") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R bcpPakoutPreviewV2(@RequestBody List<Long> ids) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<OrderDetl> orderDetlList = orderDetlService.selectBatchIds(ids); | 
|---|
|  |  |  | //返回给前端的库位以及站点信息 | 
|---|
|  |  |  | List<LocDto> locDtoList = new ArrayList<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (OrderDetl orderDetl : orderDetlList) { | 
|---|
|  |  |  | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); | 
|---|
|  |  |  | Order order = orderService.selectByNo(orderDetl.getOrderNo()); | 
|---|
|  |  |  | DocType docType = docTypeService.selectById(order.getDocType()); | 
|---|
|  |  |  | if ("人工补货单".equals(docType.getDocName())) { | 
|---|
|  |  |  | if (issued <= 0.0D) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | issued = locDetlService.queryStockAndSetLocDto1(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrderNo(), locDtoList, issued, orderDetl.getThreeCode(), orderDetl.getDeadTime()); | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued, orderDetl.getProcessSts()); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtoList.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (issued <= 0.0D) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //从平库寻找 | 
|---|
|  |  |  | //issued = manLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //先找AGV的库存,如果返回的issued大于0,则去四项库找 | 
|---|
|  |  |  | issued = agvLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrderNo(), locDtoList, issued, orderDetl.getThreeCode(), orderDetl.getDeadTime(), AsrsConstants.ERCHANG); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //从四项库的库存里面找, | 
|---|
|  |  |  | //issued = locDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued, orderDetl.getProcessSts()); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtoList.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok().add(locDtoList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/out/pakout/auth") | 
|---|
|  |  |  | @ManagerAuth(memo = "订单出库") | 
|---|
|  |  |  | public R pakout(@RequestBody List<LocDto> locDtos) { | 
|---|
|  |  |  | if (Cools.isEmpty(locDtos)) { | 
|---|
|  |  |  | return R.parse(BaseRes.PARAM); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<TaskDto> taskDtos = new ArrayList<>(); | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | @Synchronized | 
|---|
|  |  |  | public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (LocDto locDto : locDtos) { | 
|---|
|  |  |  | if (locDto.isLack()) { continue; } | 
|---|
|  |  |  | TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto); | 
|---|
|  |  |  | if (TaskDto.has(taskDtos, taskDto)) { | 
|---|
|  |  |  | TaskDto dto = TaskDto.find(taskDtos, taskDto); | 
|---|
|  |  |  | assert dto != null; | 
|---|
|  |  |  | dto.getLocDtos().addAll(taskDto.getLocDtos()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | taskDtos.add(taskDto); | 
|---|
|  |  |  | if (locDto.getAnfme() == 0) { | 
|---|
|  |  |  | return R.error(locDto.getMatnr() + ":出库数量为0"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // ----------------------------------------------------------------------------------------------- | 
|---|
|  |  |  | //判断是否可以生成出库工作档 | 
|---|
|  |  |  | boolean lack = true; | 
|---|
|  |  |  | for (LocDto locDto : locDtos) { | 
|---|
|  |  |  | //如果AGV出库站为空 和 四项库出库站为空 并且 有库存的情况下 则返回 | 
|---|
|  |  |  | if (Cools.isEmpty(locDto.getStaNo()) && Cools.isEmpty(locDto.getAgvStaNo()) && !locDto.isLack()) { | 
|---|
|  |  |  | return R.error(locDto.getLocNo() + "库位请选择出库站"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | AgvLocMast agvLocMast = agvLocMastService.selectById(locDto.getLocNo()); | 
|---|
|  |  |  | List<String> staNoList = agvBasDevpService.selectCacheShelvesStationCodeByLocType(agvLocMast.getLocType1()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //            Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "FOUR")); | 
|---|
|  |  |  | //            if (config != null) { | 
|---|
|  |  |  | //                if (config.getStatus().intValue() == 1) { | 
|---|
|  |  |  | //                    List<AgvWrkMast> agvWrkMasts = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>().eq("source_loc_no", locDto.getAgvStaNo())); | 
|---|
|  |  |  | //                    if (agvWrkMasts != null && !agvWrkMasts.isEmpty()) { | 
|---|
|  |  |  | //                        for (AgvWrkMast agvWrkMast : agvWrkMasts) { | 
|---|
|  |  |  | //                            if (agvWrkMast.getWrkSts() < 204) { | 
|---|
|  |  |  | //                                return R.error(locDto.getAgvStaNo() + "该站点已有任务,等任务完成或者货架搬走再叫料"); | 
|---|
|  |  |  | //                            } | 
|---|
|  |  |  | //                        } | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!staNoList.contains(locDto.getAgvStaNo())) { | 
|---|
|  |  |  | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", locDto.getAgvStaNo())); | 
|---|
|  |  |  | if (Cools.isEmpty(agvWrkMast.getPdcType())) { | 
|---|
|  |  |  | return R.error(locDto.getAgvStaNo() + "该站点已有出库任务,工作号:" + agvWrkMast.getWrkNo() + ",物料库位号:" + agvWrkMast.getSourceLocNo() + ",任务状态:" + agvWrkMast.getWrkSts$()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return R.error(locDto.getAgvStaNo() + "该站点已有出库任务,工作号:" + agvWrkMast.getWrkNo() + ",物料库位号:" + agvWrkMast.getSourceLocNo() + ",任务状态:" + agvWrkMast.getWrkSts$() + ",小车编号:" + agvWrkMast.getPdcType()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //如果所有库都没有库存,则返回 | 
|---|
|  |  |  | for (LocDto locDto : locDtos) { | 
|---|
|  |  |  | if (!locDto.isLack()) { | 
|---|
|  |  |  | lack = false; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (lack) { | 
|---|
|  |  |  | return R.error("库存不足"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Thread.sleep(500L); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 订单预校验  ===>> 1.订单状态; 2.订单带出数量 | 
|---|
|  |  |  | List<OrderDto> orderDtos = orderPreVerification(locDtos); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<TaskDto> taskDtos = new ArrayList<>(); | 
|---|
|  |  |  | List<TaskDto> agvTaskDtos = new ArrayList<>(); | 
|---|
|  |  |  | generateTaskDto(locDtos, taskDtos, agvTaskDtos); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //生成AGV出库任务 | 
|---|
|  |  |  | agvWorkService.stockOutWrkMast(agvTaskDtos, getUserId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 生成出库任务 | 
|---|
|  |  |  | taskDtos.stream().map(TaskDto::getLocNo).distinct().collect(Collectors.toList()); | 
|---|
|  |  |  | for (TaskDto taskDto : taskDtos) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); | 
|---|
|  |  |  | workService.stockOut(staNo, taskDto, getUserId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/process/out/pakout/auth") | 
|---|
|  |  |  | @ManagerAuth(memo = "加工出库") | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | @Synchronized | 
|---|
|  |  |  | public synchronized R processPakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //判断是否可以生成出库工作档 | 
|---|
|  |  |  | boolean lack = true; | 
|---|
|  |  |  | for (LocDto locDto : locDtos) { | 
|---|
|  |  |  | //如果AGV出库站为空 和 四项库出库站为空 并且 有库存的情况下 则返回 | 
|---|
|  |  |  | if (Cools.isEmpty(locDto.getStaNo()) && Cools.isEmpty(locDto.getAgvStaNo()) && !locDto.isLack()) { | 
|---|
|  |  |  | return R.error(locDto.getLocNo() + "库位请选择出库站"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | AgvLocMast agvLocMast = agvLocMastService.selectById(locDto.getLocNo()); | 
|---|
|  |  |  | List<String> staNoList = agvBasDevpService.selectCacheShelvesStationCodeByLocType(agvLocMast.getLocType1(), agvLocMast.getFloor()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!staNoList.contains(locDto.getAgvStaNo())) { | 
|---|
|  |  |  | return R.error(locDto.getAgvStaNo() + "该站点已有出库任务,无法选择该站点出库"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //如果所有库都没有库存,则返回 | 
|---|
|  |  |  | for (LocDto locDto : locDtos) { | 
|---|
|  |  |  | if (!locDto.isLack()) { | 
|---|
|  |  |  | lack = false; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (lack) { | 
|---|
|  |  |  | return R.error("库存不足"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Thread.sleep(500L); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 订单预校验  ===>> 1.订单状态; 2.订单带出数量 | 
|---|
|  |  |  | List<OrderDto> orderDtos = orderPreVerification(locDtos); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<TaskDto> taskDtos = new ArrayList<>(); | 
|---|
|  |  |  | List<TaskDto> agvTaskDtos = new ArrayList<>(); | 
|---|
|  |  |  | generateTaskDto(locDtos, taskDtos, agvTaskDtos); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //生成AGV出库任务 | 
|---|
|  |  |  | agvWorkService.processOut(agvTaskDtos, getUserId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 合并订单汇总预览 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @RequestMapping(value = "/order/merge/preview/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R mergePreview(@RequestParam(value = "orderIds[]") List<Long> orderIds) { | 
|---|
|  |  |  | return R.ok().add(orderService.mergePreview(orderIds)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/out/pakout/preview/merge/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R pakoutPreviewMerge(@RequestBody List<OrderMergeVo> list) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //返回给前端的库位以及站点信息 | 
|---|
|  |  |  | List<LocDto> locDtoList = new ArrayList<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (OrderMergeVo vo : list) { | 
|---|
|  |  |  | double issued = Optional.of(vo.getAnfme()).orElse(0.0D); | 
|---|
|  |  |  | if (issued <= 0.0D) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //先找AGV的库存,如果返回的issued大于0,则去四项库找 | 
|---|
|  |  |  | issued = agvLocDetlService.queryStockAndSetLocDto(vo.getMatnr(), vo.getBatch(), JSON.toJSONString(vo.getOrderDtos()), locDtoList, issued, vo.getCsocode(), vo.getIsoseq(), null); | 
|---|
|  |  |  | //从四项库的库存里面找, | 
|---|
|  |  |  | issued = locDetlService.queryStockAndSetLocDto(vo.getMatnr(), vo.getBatch(), JSON.toJSONString(vo.getOrderDtos()), locDtoList, issued, vo.getCsocode(), vo.getIsoseq()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | LocDto locDto = new LocDto(null, vo.getMatnr(), vo.getMaktx(), vo.getBatch(), JSON.toJSONString(vo.getOrderDtos()), issued); | 
|---|
|  |  |  | locDto.setLack(Boolean.TRUE); | 
|---|
|  |  |  | locDtoList.add(locDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return R.ok().add(locDtoList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | 生成出库任务dto | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private void generateTaskDto(List<LocDto> locDtos, List<TaskDto> taskDtos, List<TaskDto> agvTaskDtos) { | 
|---|
|  |  |  | // 根据 (库位 & 出库站) 分组; 理想状态:一组为一次出库任务 | 
|---|
|  |  |  | for (LocDto locDto : locDtos) { | 
|---|
|  |  |  | if (locDto.isLack()) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //AGV库 | 
|---|
|  |  |  | if (!Cools.isEmpty(locDto.getAgvStaNos())) { | 
|---|
|  |  |  | //平库 | 
|---|
|  |  |  | if ("无需站点".equals(locDto.getAgvStaNo())) { | 
|---|
|  |  |  | generateManPakout(locDto); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | generateTaskDtoForAgv(locDto, agvTaskDtos); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //四项库 | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | generateTaskDtoForBase(locDto, taskDtos); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | 生成AGV的任务dto | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private void generateTaskDtoForAgv(LocDto locDto, List<TaskDto> agvTaskDtos) { | 
|---|
|  |  |  | // 防止前端页面提取库位信息后,在其他地方对该库位生成了出库任务(库位状态非F状态) | 
|---|
|  |  |  | AgvLocMast agvLocMast = agvLocMastService.selectById(locDto.getLocNo()); | 
|---|
|  |  |  | if (!Cools.isEmpty(agvLocMast) && !agvLocMast.getLocSts().equals("F")) { | 
|---|
|  |  |  | throw new CoolException("库位号非在库状态,请重新选择出库库位===>>" + locDto.getLocNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getAgvStaNo(), locDto); | 
|---|
|  |  |  | if (TaskDto.has(agvTaskDtos, taskDto)) { | 
|---|
|  |  |  | TaskDto dto = TaskDto.find(agvTaskDtos, taskDto); | 
|---|
|  |  |  | assert dto != null; | 
|---|
|  |  |  | dto.getLocDtos().addAll(taskDto.getLocDtos()); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | agvTaskDtos.add(taskDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | 生成四项库的任务dto | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private void generateTaskDtoForBase(LocDto locDto, List<TaskDto> taskDtos) { | 
|---|
|  |  |  | // 防止前端页面提取库位信息后,在其他地方对该库位生成了出库任务(库位状态非F状态) | 
|---|
|  |  |  | LocMast locMast = locMastService.selectById(locDto.getLocNo()); | 
|---|
|  |  |  | if (!Cools.isEmpty(locMast) && !locMast.getLocSts().equals("F")) { | 
|---|
|  |  |  | throw new CoolException("库位号非在库状态,请重新选择出库库位===>>" + locDto.getLocNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto); | 
|---|
|  |  |  | //如果库位存在混载 | 
|---|
|  |  |  | if (TaskDto.has(taskDtos, taskDto)) { | 
|---|
|  |  |  | TaskDto dto = TaskDto.find(taskDtos, taskDto); | 
|---|
|  |  |  | assert dto != null; | 
|---|
|  |  |  | dto.getLocDtos().addAll(taskDto.getLocDtos()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | taskDtos.add(taskDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | 生成平库拣货单 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private void generateManPakout(LocDto locDto) { | 
|---|
|  |  |  | ManLocDetl manLocDetl = manLocDetlService.selectItem(locDto.getLocNo(), locDto.getMatnr(), locDto.getBatch(), locDto.getCsocode(), locDto.getIsoseq(), locDto.getContainerCode()); | 
|---|
|  |  |  | if (!Cools.isEmpty(manLocDetl) && !(locDto.getAnfme() > manLocDetl.getAnfme())) { | 
|---|
|  |  |  | manLocDetl.setStatus(0); | 
|---|
|  |  |  | manLocDetlService.update(manLocDetl, new EntityWrapper<ManLocDetl>().eq("loc_no", manLocDetl.getLocNo()).eq("matnr", manLocDetl.getMatnr())); | 
|---|
|  |  |  | //addPakOUT 生成拣货单成功 | 
|---|
|  |  |  | if (addPakOUT(locDto).equals(R.ok())) { | 
|---|
|  |  |  | Order order = orderService.selectByNo(locDto.getOrderNo()); | 
|---|
|  |  |  | if (Cools.isEmpty(order)) { | 
|---|
|  |  |  | throw new CoolException("查询订单失败,请联系管理员" + locDto.getOrderNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (order.getSettle() == 1) { | 
|---|
|  |  |  | if (!orderService.updateSettle(order.getId(), 2L, null)) { | 
|---|
|  |  |  | throw new CoolException("修改订单状态失败,请联系管理员" + locDto.getOrderNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("order_no", locDto.getOrderNo()).eq("matnr", locDto.getMatnr())); | 
|---|
|  |  |  | if (Cools.isEmpty(orderDetl)) { | 
|---|
|  |  |  | throw new CoolException("查询订单明细失败,请联系管理员" + locDto.getOrderNo() + locDto.getMatnr()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderDetl.setQty(orderDetl.getQty() + locDto.getAnfme()); | 
|---|
|  |  |  | if (!orderDetlService.update(orderDetl, new EntityWrapper<OrderDetl>().eq("order_no", locDto.getOrderNo()).eq("matnr", locDto.getMatnr()))) { | 
|---|
|  |  |  | throw new CoolException("修改订单明细失败,请联系管理员" + locDto.getOrderNo() + locDto.getMatnr()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | throw new CoolException("库存不足"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private R addPakOUT(LocDto locDto) { | 
|---|
|  |  |  | ManPakOut manPakOut = new ManPakOut(); | 
|---|
|  |  |  | manPakOut.setWrkNo(locDto.getOrderNo() + "-" + System.currentTimeMillis()); | 
|---|
|  |  |  | manPakOut.setWrkSts((long) 1); | 
|---|
|  |  |  | manPakOut.setAnfme(locDto.getAnfme()); | 
|---|
|  |  |  | manPakOut.setLocNo(locDto.getLocNo()); | 
|---|
|  |  |  | manPakOut.setMatnr(locDto.getMatnr()); | 
|---|
|  |  |  | manPakOut.setMaktx(locDto.getMaktx()); | 
|---|
|  |  |  | manPakOut.setDocNum(locDto.getOrderNo()); | 
|---|
|  |  |  | manPakOut.setCount(0.0); | 
|---|
|  |  |  | manPakOut.setStatus(0); | 
|---|
|  |  |  | manPakOut.setCreateTime(new Date()); | 
|---|
|  |  |  | manPakOut.setBatch(locDto.getBatch()); | 
|---|
|  |  |  | manPakOut.setUpdateTime(new Date()); | 
|---|
|  |  |  | manPakOut.setUuid(UUID.randomUUID().toString()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | manPakOut.setContainerCode(locDto.getContainerCode()); | 
|---|
|  |  |  | manPakOut.setCsocode(locDto.getCsocode()); | 
|---|
|  |  |  | manPakOut.setIsoseq(locDto.getIsoseq()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ManPakOut manPakOutExist = manPakOutService.selectOne(new EntityWrapper<ManPakOut>().eq("doc_num", locDto.getOrderNo())); | 
|---|
|  |  |  | if (Cools.isEmpty(manPakOutExist)) { | 
|---|
|  |  |  | manPakOut.setName(locDto.getMaktx()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | manPakOut.setUuid(manPakOutExist.getUuid()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | manPakOutService.insert(manPakOut); | 
|---|
|  |  |  | //        try{ | 
|---|
|  |  |  | //            if (!manPakOutService.insert(manPakOut)){ | 
|---|
|  |  |  | //                return R.error("添加拣货明细失败,请联系管理员"); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        }catch (Exception e){ | 
|---|
|  |  |  | //            return R.error("添加拣货明细失败,请联系管理员"); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | 订单预校验  ===>> 1.订单状态; 2.订单带出数量 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private List<OrderDto> orderPreVerification(List<LocDto> locDtos) { | 
|---|
|  |  |  | List<OrderDto> orderDtos = new ArrayList<>(); | 
|---|
|  |  |  | for (LocDto locDto : locDtos) { | 
|---|
|  |  |  | if (!isJSON(locDto.getOrderNo())) { | 
|---|
|  |  |  | //if (!Cools.isEmpty(locDto.getOrderNo())) { | 
|---|
|  |  |  | if (Cools.isEmpty(locDto.getOrderNo())) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | OrderDto orderDto = new OrderDto(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch(), locDto.getAnfme()); | 
|---|
|  |  |  | if (OrderDto.has(orderDtos, orderDto)) { | 
|---|
|  |  |  | OrderDto dto = OrderDto.find(orderDtos, orderDto); | 
|---|
|  |  |  | assert dto != null; | 
|---|
|  |  |  | dto.setAnfme(dto.getAnfme() + orderDto.getAnfme()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | orderDtos.add(orderDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 订单合并出库 | 
|---|
|  |  |  | List<OrderDto> orderDtoList = JSON.parseArray(locDto.getOrderNo(), OrderDto.class); | 
|---|
|  |  |  | for (OrderDto one : orderDtoList) { | 
|---|
|  |  |  | OrderDto orderDto = new OrderDto(one.getOrderNo(), locDto.getMatnr(), locDto.getBatch(), one.getAnfme()); | 
|---|
|  |  |  | if (OrderDto.has(orderDtos, orderDto)) { | 
|---|
|  |  |  | OrderDto dto = OrderDto.find(orderDtos, orderDto); | 
|---|
|  |  |  | assert dto != null; | 
|---|
|  |  |  | dto.setAnfme(dto.getAnfme() + orderDto.getAnfme()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | orderDtos.add(orderDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (OrderDto orderDto : orderDtos) { | 
|---|
|  |  |  | Order order = orderService.selectByNo(orderDto.getOrderNo()); | 
|---|
|  |  |  | if (order.getSettle() > 2) { | 
|---|
|  |  |  | throw new CoolException(orderDto.getOrderNo() + "订单已失效,请及时刷新页面"); | 
|---|
|  |  |  | //return R.error(orderDto.getOrderNo() + "订单已失效,请及时刷新页面"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return orderDtos; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|