| | |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) { |
| | | continue; |
| | | } |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号 |
| | |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDto locDto : taskDto.getLocDtos()) { |
| | | if (locDto.getAnfme()==null || locDto.getAnfme() <= 0.0D) { continue; } |
| | | log.info(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch()); |
| | | if (locDto.getAnfme() == null || locDto.getAnfme() <= 0.0D) { |
| | | continue; |
| | | } |
| | | log.info("工作档明细:{},{},{},{}", locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch(),locDto.getAnfme()); |
| | | OrderDetl orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch(),locDto.getAnfme()); |
| | | if (orderDetl == null) { |
| | | orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), null,locDto.getAnfme()); |
| | |
| | | Iterator<LocDetlAdjustParam.LocDetlAdjust> iterator1 = list.iterator(); |
| | | while (iterator1.hasNext()) { |
| | | LocDetlAdjustParam.LocDetlAdjust adjust = iterator1.next(); |
| | | if (adjust.getCount() == 0) { continue; } |
| | | if (adjust.getCount() == 0) { |
| | | continue; |
| | | } |
| | | if (locDetl.getMatnr().equals(adjust.getMatnr()) && Cools.eq(locDetl.getBatch(), adjust.getBatch())) { |
| | | if (!locDetl.getAnfme().equals(adjust.getCount())) { |
| | | // todo 盘点记录 |
| | |
| | | |
| | | // 添加库存 |
| | | for (LocDetlAdjustParam.LocDetlAdjust adjust : list) { |
| | | if (adjust.getCount() == 0.0D) { continue; } |
| | | if (adjust.getCount() == 0.0D) { |
| | | continue; |
| | | } |
| | | Mat mat = matService.selectByMatnr(adjust.getMatnr()); |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.sync(mat); |
| | |
| | | hedAndDet.put("det", inDetTBS); |
| | | try { |
| | | inMS.createInOrder(inHed, inDetTBS); |
| | | log.info("入库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String sql = "UPDATE erp_InHedTB SET Temp3 = 'fault' WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | log.info("入库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + hed.getBillNo() + "'"); |
| | | erpSqlServer.delete(InHedTB.class, condition); |
| | | |
| | | for (InDetTB det : dets) { |
| | | HashMap<String, String> condition2 = new HashMap<>(); |
| | | condition2.put("BillNo", "'" + det.getBillNo() + "'"); |
| | |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | | if (order.getSettle() > 1L) { |
| | | throw new CoolException(inHedTB.getBillNo() + "正在出库,无法修改单据"); |
| | | throw new CoolException(inHedTB.getBillNo() + "正在入库,无法修改单据"); |
| | | } |
| | | orderService.remove(order.getId()); |
| | | } |
| | |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | log.info("入库单据成功详情,{}", orderDetl); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | log.info("出库单据成功详情,{}", orderDetl); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | hedAndDet.put("det", inDetTBS); |
| | | try { |
| | | inMS.createOutOrder(inHed, inDetTBS); |
| | | log.info("出库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String sql = "UPDATE erp_OutHedTB SET Temp3 = 'fault' WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | log.info("出库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | |
| | | } |
| | | } |
| | | } |