|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.entity.result.StockVo; | 
|---|
|  |  |  | import com.zy.asrs.mapper.TagMapper; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.asrs.utils.MatUtils; | 
|---|
|  |  |  | import com.zy.common.model.DetlDto; | 
|---|
|  |  |  | import com.zy.common.utils.NodeUtils; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | 
|---|
|  |  |  | public class OpenServiceImpl implements OpenService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private OrderService orderService; | 
|---|
|  |  |  | private OrderPakinService orderPakinService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private OrderDetlService orderDetlService; | 
|---|
|  |  |  | private OrderDetlPakinService orderDetlPakinService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private OrderPakoutService orderPakoutService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private OrderDetlPakoutService orderDetlPakoutService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SnowflakeIdWorker snowflakeIdWorker; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  | public void pakinOrderCreate(OpenOrderPakinParam param) { | 
|---|
|  |  |  | callApiLogSaveOrder(param, "入库单", true); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | OrderPakin order = orderService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | OrderPakin order = orderPakinService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | if (!Cools.isEmpty(order) && order.getSettle() != 1) { | 
|---|
|  |  |  | throw new CoolException(param.getOrderNo() + "单据已有工作任务"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(order)) { | 
|---|
|  |  |  | boolean orderNo = orderService.delete(new EntityWrapper<OrderPakin>().eq("order_no", param.getOrderNo())); | 
|---|
|  |  |  | boolean orderNo1 = orderDetlService.delete(new EntityWrapper<OrderDetlPakout>().eq("order_no", param.getOrderNo())); | 
|---|
|  |  |  | boolean orderNo = orderPakinService.delete(new EntityWrapper<OrderPakin>().eq("order_no", param.getOrderNo())); | 
|---|
|  |  |  | boolean orderNo1 = orderDetlPakinService.delete(new EntityWrapper<OrderDetlPakin>().eq("order_no", param.getOrderNo())); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | DocType docType; | 
|---|
|  |  |  | 
|---|
|  |  |  | now,    // 修改时间 | 
|---|
|  |  |  | null    // 备注 | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | //order.setShipCode(String.valueOf(param.getDetails().get(0).getQuality())); | 
|---|
|  |  |  | if (!orderService.insert(order)) { | 
|---|
|  |  |  | if (!orderPakinService.insert(order)) { | 
|---|
|  |  |  | throw new CoolException("生成单据主档失败,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 单据明细档 | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Cools.isEmpty(mat)) { | 
|---|
|  |  |  | throw new CoolException(detlDto.getMatnr() + "编号商品检索失败,请先添加商品"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | OrderDetlPakout orderDetlPakout = new OrderDetlPakout(); | 
|---|
|  |  |  | OrderDetlPakin orderDetlPakout = new OrderDetlPakin(); | 
|---|
|  |  |  | orderDetlPakout.sync(mat); | 
|---|
|  |  |  | orderDetlPakout.setBatch(detlDto.getBatch()); | 
|---|
|  |  |  | orderDetlPakout.setAnfme(detlDto.getAnfme()); | 
|---|
|  |  |  | 
|---|
|  |  |  | orderDetlPakout.setTemp3(detlDto.getTemp3()); | 
|---|
|  |  |  | orderDetlPakout.setTemp4(detlDto.getTemp4()); | 
|---|
|  |  |  | orderDetlPakout.setInspect(detlDto.getQuality()); | 
|---|
|  |  |  | if (!orderDetlService.insert(orderDetlPakout)) { | 
|---|
|  |  |  | if (!orderDetlPakinService.insert(orderDetlPakout)) { | 
|---|
|  |  |  | throw new CoolException("生成单据明细失败,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public List<OpenOrderCompeteResult> pakinOrderComplete(OpenOrderCompleteParam param) { | 
|---|
|  |  |  | callApiLogSaveOrder(param, "出库单", true); | 
|---|
|  |  |  | callApiLogSaveOrder(param, "入库单", true); | 
|---|
|  |  |  | List<OpenOrderCompeteResult> results = new ArrayList<>(); | 
|---|
|  |  |  | if (!Cools.isEmpty(param) && !Cools.isEmpty(param.getOrderNo())) { | 
|---|
|  |  |  | // 指定订单 | 
|---|
|  |  |  | OrderPakin order = orderService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | OrderPakin order = orderPakinService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | if (null != order) { | 
|---|
|  |  |  | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); | 
|---|
|  |  |  | results.add(result); | 
|---|
|  |  |  | result.setOrderNo(order.getOrderNo()); | 
|---|
|  |  |  | result.setOrderTime(order.getOrderTime()); | 
|---|
|  |  |  | result.setOrderType(order.getDocType$()); | 
|---|
|  |  |  | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | for (OrderDetlPakout orderDetlPakout : orderDetlPakouts) { | 
|---|
|  |  |  | List<OrderDetlPakin> orderDetlPakouts = orderDetlPakinService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | for (OrderDetlPakin orderDetlPakout : orderDetlPakouts) { | 
|---|
|  |  |  | result.getOrderDetails().add(new DetlDto(orderDetlPakout.getOrderNo(), orderDetlPakout.getMatnr(), orderDetlPakout.getBatch(), orderDetlPakout.getQty())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (order.getSettle() == 4L) { | 
|---|
|  |  |  | // 修改订单状态 4.完成 ===>> 6.已上报 | 
|---|
|  |  |  | if (!orderService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | if (!orderPakinService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | throw new CoolException("服务器内部错误,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 所有订单 | 
|---|
|  |  |  | List<OrderPakin> orders = orderService.selectList(new EntityWrapper<OrderPakin>().eq("settle", 4L)); | 
|---|
|  |  |  | List<OrderPakin> orders = orderPakinService.selectList(new EntityWrapper<OrderPakin>().eq("settle", 4L)); | 
|---|
|  |  |  | for (OrderPakin order : orders) { | 
|---|
|  |  |  | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); | 
|---|
|  |  |  | results.add(result); | 
|---|
|  |  |  | result.setOrderNo(order.getOrderNo()); | 
|---|
|  |  |  | result.setOrderTime(order.getOrderTime()); | 
|---|
|  |  |  | result.setOrderType(order.getDocType$()); | 
|---|
|  |  |  | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | for (OrderDetlPakout orderDetlPakout : orderDetlPakouts) { | 
|---|
|  |  |  | List<OrderDetlPakin> orderDetlPakouts = orderDetlPakinService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | for (OrderDetlPakin orderDetlPakout : orderDetlPakouts) { | 
|---|
|  |  |  | result.getOrderDetails().add(new DetlDto(orderDetlPakout.getOrderNo(), orderDetlPakout.getMatnr(), orderDetlPakout.getBatch(), orderDetlPakout.getQty())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 修改订单状态 4.完成 ===>> 6.已上报 | 
|---|
|  |  |  | if (!orderService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | if (!orderPakinService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | throw new CoolException("服务器内部错误,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public void pakoutOrderCreate(OpenOrderPakoutParam param) { | 
|---|
|  |  |  | callApiLogSaveOrder(param, "出库单", true); | 
|---|
|  |  |  | OrderPakin order = orderService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | OrderPakout order = orderPakoutService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 | 
|---|
|  |  |  | if (!Cools.isEmpty(order)) { | 
|---|
|  |  |  | if (order.getSettle() > 1L) { | 
|---|
|  |  |  | throw new CoolException(param.getOrderNo() + "正在出库,无法修改单据"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderService.remove(order.getId()); | 
|---|
|  |  |  | orderPakoutService.remove(order.getId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | DocType docType; | 
|---|
|  |  |  | if (param.getOrderType().equals("调拨单")) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | // 单据主档 | 
|---|
|  |  |  | order = new OrderPakin( | 
|---|
|  |  |  | order = new OrderPakout( | 
|---|
|  |  |  | String.valueOf(snowflakeIdWorker.nextId()),    // 编号[非空] | 
|---|
|  |  |  | param.getOrderNo(),    // 订单编号 | 
|---|
|  |  |  | param.getInboundDate(),    // 单据日期 | 
|---|
|  |  |  | 
|---|
|  |  |  | null    // 备注 | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | order.setShipCode(param.getQuality()); | 
|---|
|  |  |  | if (!orderService.insert(order)) { | 
|---|
|  |  |  | if (!orderPakoutService.insert(order)) { | 
|---|
|  |  |  | throw new CoolException("生成单据主档失败,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 单据明细档 | 
|---|
|  |  |  | 
|---|
|  |  |  | orderDetlPakout.setTemp2(detlDto.getTemp2()); | 
|---|
|  |  |  | orderDetlPakout.setTemp3(detlDto.getTemp3()); | 
|---|
|  |  |  | orderDetlPakout.setTemp4(detlDto.getTemp4()); | 
|---|
|  |  |  | if (!orderDetlService.insert(orderDetlPakout)) { | 
|---|
|  |  |  | if (!orderDetlPakoutService.insert(orderDetlPakout)) { | 
|---|
|  |  |  | throw new CoolException("生成单据明细失败,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | List<OpenOrderCompeteResult> results = new ArrayList<>(); | 
|---|
|  |  |  | if (!Cools.isEmpty(param) && !Cools.isEmpty(param.getOrderNo())) { | 
|---|
|  |  |  | // 指定订单 | 
|---|
|  |  |  | OrderPakin order = orderService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | OrderPakout order = orderPakoutService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | if (null != order) { | 
|---|
|  |  |  | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); | 
|---|
|  |  |  | results.add(result); | 
|---|
|  |  |  | result.setOrderNo(order.getOrderNo()); | 
|---|
|  |  |  | result.setOrderTime(order.getOrderTime()); | 
|---|
|  |  |  | result.setOrderType(order.getDocType$()); | 
|---|
|  |  |  | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | for (OrderDetlPakout orderDetlPakout : orderDetlPakouts) { | 
|---|
|  |  |  | result.getOrderDetails().add(new DetlDto(orderDetlPakout.getOrderNo(), orderDetlPakout.getMatnr(), orderDetlPakout.getBatch(), orderDetlPakout.getQty())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (order.getSettle() == 4L) { | 
|---|
|  |  |  | // 修改订单状态 4.完成 ===>> 6.已上报 | 
|---|
|  |  |  | if (!orderService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | if (!orderPakoutService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | throw new CoolException("服务器内部错误,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 所有订单 | 
|---|
|  |  |  | List<OrderPakin> orders = orderService.selectList(new EntityWrapper<OrderPakin>().eq("settle", 4L)); | 
|---|
|  |  |  | for (OrderPakin order : orders) { | 
|---|
|  |  |  | List<OrderPakout> orders = orderPakoutService.selectList(new EntityWrapper<OrderPakout>().eq("settle", 4L)); | 
|---|
|  |  |  | for (OrderPakout order : orders) { | 
|---|
|  |  |  | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); | 
|---|
|  |  |  | results.add(result); | 
|---|
|  |  |  | result.setOrderNo(order.getOrderNo()); | 
|---|
|  |  |  | result.setOrderTime(order.getOrderTime()); | 
|---|
|  |  |  | result.setOrderType(order.getDocType$()); | 
|---|
|  |  |  | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectByOrderId(order.getId()); | 
|---|
|  |  |  | for (OrderDetlPakout orderDetlPakout : orderDetlPakouts) { | 
|---|
|  |  |  | result.getOrderDetails().add(new DetlDto(orderDetlPakout.getOrderNo(), orderDetlPakout.getMatnr(), orderDetlPakout.getBatch(), orderDetlPakout.getQty())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 修改订单状态 4.完成 ===>> 6.已上报 | 
|---|
|  |  |  | if (!orderService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | if (!orderPakoutService.updateSettle(order.getId(), 6L, null)) { | 
|---|
|  |  |  | throw new CoolException("服务器内部错误,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | public List<StockVo> queryStock() { | 
|---|
|  |  |  | return locDetlService.queryStockTotal(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //Tag tag = tagService.selectOne(new EntityWrapper<Tag>().eq("memo", matParam.getTagId())); | 
|---|
|  |  |  | //            if (tag == null) { | 
|---|
|  |  |  | //                throw new CoolException("出错,未找到分类"); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //            if (mat == null) { | 
|---|
|  |  |  | //                mat = new Mat(); | 
|---|
|  |  |  | //                mat.sync(matParam); | 
|---|
|  |  |  | ////            mat.setMatnr(param.getMatnr()); | 
|---|
|  |  |  | ////            mat.setMaktx(param.getMaktx()); | 
|---|
|  |  |  | ////            mat.setSpecs(param.getSpecs()); | 
|---|
|  |  |  | ////            mat.setModel(param.getModel()); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                mat.setTagId(tag.getId()); | 
|---|
|  |  |  | //                mat.setStatus(1); | 
|---|
|  |  |  | //                mat.setCreateTime(now); | 
|---|
|  |  |  | //                mat.setUpdateTime(now); | 
|---|
|  |  |  | //                if (!matService.insert(mat)) { | 
|---|
|  |  |  | //                    throw new CoolException("服务器内部错误,请联系管理员"); | 
|---|
|  |  |  | //                } else { | 
|---|
|  |  |  | //                    log.info("同步新物料[商品编号:{}]", mat.getMatnr()); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } else { | 
|---|
|  |  |  | //                mat.sync(matParam); | 
|---|
|  |  |  | //                mat.setTagId(tag.getId()); | 
|---|
|  |  |  | //                if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) { | 
|---|
|  |  |  | //                    throw new CoolException("更新已存在商品信息失败,请联系管理员"); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (wrkDetlLog.getOrderNo() != null && !wrkDetlLog.getOrderNo().isEmpty()) { | 
|---|
|  |  |  | LocDetlByTimeDTO locDetlByTimeDTO = new LocDetlByTimeDTO(); | 
|---|
|  |  |  | if (!Cools.isEmpty(wrkDetlLog.getOrderNo())) { | 
|---|
|  |  |  | OrderPakin order = orderService.selectByNo(wrkDetlLog.getOrderNo()); | 
|---|
|  |  |  | OrderPakout order = orderPakoutService.selectByNo(wrkDetlLog.getOrderNo()); | 
|---|
|  |  |  | if (!Cools.isEmpty(order)) { | 
|---|
|  |  |  | locDetlByTimeDTO.setDate(order.getOrderTime()); | 
|---|
|  |  |  | locDetlByTimeDTO.setWarehouse(order.getItemName()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | //        if (!Cools.isEmpty(locDetls)) { | 
|---|
|  |  |  | //            for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                if (!Cools.isEmpty(locDetl.getOrderNo())){ | 
|---|
|  |  |  | //                    Order order = orderService.selectByNo(locDetl.getOrderNo()); | 
|---|
|  |  |  | //                    if (!Cools.isEmpty(order)) { | 
|---|
|  |  |  | //                        locDetlByTimeDTO.setDate(order.getOrderTime()); | 
|---|
|  |  |  | //                        locDetlByTimeDTO.setWarehouse(order.getItemName()); | 
|---|
|  |  |  | //                        locDetlByTimeDTO.setOrderType(order.getDocType().toString()); | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                locDetlByTimeDTO.setMatnr(locDetl.getMatnr()); | 
|---|
|  |  |  | //                locDetlByTimeDTO.setLocNo(locDetl.getLocNo()); | 
|---|
|  |  |  | //                locDetlByTimeDTO.setBatch(locDetl.getBatch()); | 
|---|
|  |  |  | //                locDetlByTimeDTO.setAnfme(locDetl.getAnfme()); | 
|---|
|  |  |  | //                locDetlByTimeDTO.setOrderNo(locDetl.getOrderNo()); | 
|---|
|  |  |  | //                locDetlByTimeDTOS.add(locDetlByTimeDTO); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | return locDetlByTimeDTOS; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void orderDelete(String orderNo) { | 
|---|
|  |  |  | OrderPakin order = orderService.selectByNo(orderNo); | 
|---|
|  |  |  | public void orderPakinDelete(String orderNo) { | 
|---|
|  |  |  | OrderPakin order = orderPakinService.selectByNo(orderNo); | 
|---|
|  |  |  | if (order == null) { | 
|---|
|  |  |  | throw new CoolException("未查询到对应订单信息"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (order.getSettle() != 1) { | 
|---|
|  |  |  | throw new CoolException("该订单已有对应任务,禁止删除"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<OrderDetlPakout> OrderDetlPakout = orderDetlService.selectList(new EntityWrapper<OrderDetlPakout>().eq("order_no", orderNo)); | 
|---|
|  |  |  | List<OrderDetlPakout> OrderDetlPakout = orderDetlPakoutService.selectList(new EntityWrapper<OrderDetlPakout>().eq("order_no", orderNo)); | 
|---|
|  |  |  | if (!Cools.isEmpty(OrderDetlPakout)) { | 
|---|
|  |  |  | orderDetlService.delete(new EntityWrapper<OrderDetlPakout>().eq("order_no", orderNo)); | 
|---|
|  |  |  | orderDetlPakinService.delete(new EntityWrapper<OrderDetlPakin>().eq("order_no", orderNo)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderService.delete(new EntityWrapper<OrderPakin>().eq("order_no", orderNo)); | 
|---|
|  |  |  | orderPakinService.delete(new EntityWrapper<OrderPakin>().eq("order_no", orderNo)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void orderPakoutDelete(String orderNo) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | OrderPakout orderPakout = orderPakoutService.selectByNo(orderNo); | 
|---|
|  |  |  | if (orderPakout == null) { | 
|---|
|  |  |  | throw new CoolException("未查询到对应订单信息"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (orderPakout.getSettle() != 1) { | 
|---|
|  |  |  | throw new CoolException("该订单已有对应任务,禁止删除"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<OrderDetlPakout> orderDetlPakins = orderDetlPakoutService.selectList(new EntityWrapper<OrderDetlPakout>().eq("order_no", orderNo)); | 
|---|
|  |  |  | if (!Cools.isEmpty(orderDetlPakins)) { | 
|---|
|  |  |  | orderDetlPakoutService.delete(new EntityWrapper<OrderDetlPakout>().eq("order_no", orderNo)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderPakoutService.delete(new EntityWrapper<OrderPakout>().eq("order_no", orderNo)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|