| | |
| | | List<LocNormal> updateList = new ArrayList<>(); |
| | | if (!Cools.isEmpty(list.get(i).getSupplier())) { // 存在入库单号的才进行erp更新 |
| | | // 判断原先平仓是否存在有货,如果有货数量进行累加 |
| | | LocNormal oldLocList = locNormalService.selectOne(new EntityWrapper<LocNormal>().eq("supplier", list.get(i).getSupplier()).and().eq("state", "1").eq("warehouse", list.get(i).getWarehouse())); |
| | | LocNormal oldLocList = locNormalService.selectOne(new EntityWrapper<LocNormal>().eq("supplier", list.get(i).getSupplier()).and().eq("state", "1").eq("warehouse", list.get(i).getWarehouse()).and().eq("matnr", list.get(i).getMatnr())); |
| | | if (!Cools.isEmpty(oldLocList)) { |
| | | Double updateAnfme = new Double(list.get(i).getAnfme().doubleValue()); |
| | | // 平仓入库(更新)逻辑 |
| | | BigDecimal increaseAnfme = new BigDecimal(String.valueOf(list.get(i).getAnfme())); |
| | | list.get(i).setAnfme(oldLocList.getAnfme().add(list.get(i).getAnfme())); |
| | | updateList.add(list.get(i)); |
| | | if (baseMapper.pdaLocNormalUpdate(updateList) > 0) { |
| | |
| | | custWaitPakinToLog(list.get(i), updateAnfme); |
| | | } |
| | | // erp更新 InStockbill和InStockBillEntry |
| | | erpService.incrementPakIn(list.get(i).getSupplier(), list.get(i).getMatnr(), list.get(i).getAnfme().doubleValue()); |
| | | erpService.incrementPakIn(list.get(i).getSupplier(), list.get(i).getMatnr(), increaseAnfme.doubleValue()); |
| | | } else { |
| | | // 平仓入库逻辑 |
| | | addList.add(list.get(i)); |