| | |
| | | throw new CoolException(fbillno + "单据正在作业中,无法删除"); |
| | | } |
| | | Mat mat = matService.selectBySku(exdInstockSource.getFitemid() + ""); |
| | | boolean delete = orderDetlService.delete(new EntityWrapper<OrderDetl>() |
| | | .eq("order_no", order.getOrderNo()) |
| | | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("order_no", order.getOrderNo()) |
| | | .eq("matnr", mat.getMatnr()) |
| | | .eq("batch", exdInstockSource.getFbatchno()) |
| | | .eq("anfme", exdInstockSource.getFqty())); |
| | | if (delete) { |
| | | log.info("删除订单明细成功,订单号={},物料号={},批号={},数量={}成功",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | .eq("anfme", exdInstockSource.getFqty()<0 ? -exdInstockSource.getFqty():exdInstockSource.getFqty())); |
| | | if (orderDetl != null) { |
| | | boolean delete = orderDetlService.deleteById(orderDetl.getId()); |
| | | if (delete) { |
| | | log.info("删除订单明细成功,订单号={},物料号={},批号={},数量={}成功",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | }else { |
| | | log.error("删除订单明细失败,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | throw new CoolException(fbillno + "单据明细删除失败"); |
| | | } |
| | | }else { |
| | | log.error("删除订单明细失败,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | throw new CoolException(fbillno + "单据明细删除失败"); |
| | | log.error("没有查询到订单明细,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | throw new CoolException(fbillno + "没有查询到订单明细"); |
| | | } |
| | | |
| | | int orderNo = orderDetlService.selectCount(new EntityWrapper<OrderDetl>().eq("order_no", order.getOrderNo())); |
| | | if(orderNo==0){ |
| | | orderService.remove(order.getId()); |
| | |
| | | throw new CoolException(fbillno + "单据正在作业中,无法删除"); |
| | | } |
| | | Mat mat = matService.selectBySku(exdInstockSource.getFitemid() + ""); |
| | | boolean delete = orderDetlService.delete(new EntityWrapper<OrderDetl>() |
| | | .eq("order_no", order.getOrderNo()) |
| | | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("order_no", order.getOrderNo()) |
| | | .eq("matnr", mat.getMatnr()) |
| | | .eq("batch", exdInstockSource.getFbatchno()) |
| | | .eq("anfme", exdInstockSource.getFqty())); |
| | | if (delete) { |
| | | log.info("删除订单明细成功,订单号={},物料号={},批号={},数量={}成功",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | .eq("anfme", exdInstockSource.getFqty()<0 ? -exdInstockSource.getFqty():exdInstockSource.getFqty())); |
| | | if (orderDetl != null) { |
| | | boolean delete = orderDetlService.deleteById(orderDetl.getId()); |
| | | if (delete) { |
| | | log.info("删除订单明细成功,订单号={},物料号={},批号={},数量={}成功",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | }else { |
| | | log.error("删除订单明细失败,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | throw new CoolException(fbillno + "单据明细删除失败"); |
| | | } |
| | | }else { |
| | | log.error("删除订单明细失败,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | throw new CoolException(fbillno + "单据明细删除失败"); |
| | | log.error("没有查询到订单明细,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty()); |
| | | throw new CoolException(fbillno + "没有查询到订单明细"); |
| | | } |
| | | int orderNo = orderDetlService.selectCount(new EntityWrapper<OrderDetl>().eq("order_no", order.getOrderNo())); |
| | | if(orderNo==0){ |