| | |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | | if (order.getSettle() > 1L) { |
| | | throw new CoolException(inHedTB.getBillNo() + "正在出库,无法修改单据"); |
| | | throw new CoolException(inHedTB.getBillNo() + "正在入库,无法修改单据"); |
| | | } |
| | | orderService.remove(order.getId()); |
| | | } |
| | |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | | inHedTB.getBillNo(), // 订单编号 |
| | | DateUtils.convert(inHedTB.getMakeDate()), // 单据日期 |
| | | DateUtils.convert(inHedTB.getBillDate()), // 单据日期 |
| | | docType.getDocId(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | log.info("入库单据成功详情,{}", orderDetl); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | log.info("出库单据成功详情,{}", orderDetl); |
| | | } |
| | | return true; |
| | | } |