chen.lin
9 小时以前 9f724c61dfa4dc4c0eea66253ea0780b023622ae
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -1889,8 +1889,10 @@
            List<TaskItem> items = orderMap.get(key);
            //保存入出库明细
            saveStockItems(items, task, pakinItem.getId(), pakinItem.getAsnCode(), pakinItem.getWkType(), pakinItem.getType(), loginUserId);
            //移出收货区库存, 修改组托状态
            //移出收货区库存, 修改组托状态(只有当source不为null时才需要移除收货区库存)
            if (Objects.nonNull(pakinItem.getSource())) {
            removeReceiptStock(pakinItem, loginUserId);
            }
        });
        Set<Long> pkinItemIds = taskItems.stream().map(TaskItem::getSource).collect(Collectors.toSet());
@@ -1926,6 +1928,10 @@
     */
    @Transactional(rollbackFor = Exception.class)
    public synchronized void removeReceiptStock(WaitPakinItem pakinItem, Long loginUserId) {
        // 如果source为null,说明组托明细不在收货区,无需移除收货区库存
        if (Objects.isNull(pakinItem.getSource())) {
            return;
        }
        WarehouseAreasItem itemServiceOne = warehouseAreasItemService.getOne(new LambdaQueryWrapper<WarehouseAreasItem>()
                .eq(WarehouseAreasItem::getId, pakinItem.getSource()));
        if (Objects.isNull(itemServiceOne)) {
@@ -1973,7 +1979,8 @@
                    .eq(LocItem::getMatnrId, taskItem.getMatnrId())
                    .eq(LocItem::getLocId, loc.getId())
                    .eq(StringUtils.isNotBlank(taskItem.getBatch()), LocItem::getBatch, taskItem.getBatch())
                    .eq(StringUtils.isNotBlank(taskItem.getFieldsIndex()), LocItem::getFieldsIndex, taskItem.getFieldsIndex()));
                    .eq(StringUtils.isNotBlank(taskItem.getFieldsIndex()), LocItem::getFieldsIndex, taskItem.getFieldsIndex())
            );
            if (Objects.isNull(locItem)) {
                BeanUtils.copyProperties(taskItem, item);
                item.setLocCode(loc.getCode())
@@ -1986,7 +1993,7 @@
                    throw new CoolException("库位明细更新失败!!");
                }
            } else {
                logger.error("当前票号:"  + locItem.getFieldsIndex()  + " 已在库内,请检查后再操作!!");
//                logger.error("当前票号:"  + locItem.getFieldsIndex()  + " 已在库内,请检查后再操作!!");
//                throw new CoolException("当前票号已在库内,请检查后再操作!!");
//                locItem.setAnfme(Math.round((locItem.getAnfme() + taskItem.getAnfme()) * 1000000) / 1000000.0)
//                        .setUpdateTime(new Date());