1
skyouc
14 小时以前 dc40d8612fb49ad1282eca24d7bc1b3112c1f604
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -309,6 +309,9 @@
        waitPakins.forEach(pakin -> {
            BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
                    .eq(BasContainer::getCode, pakin.getBarcode()));
            if (Objects.isNull(container)) {
                throw new CoolException("容器未维护入库,请维护后再操作!!");
            }
            /**获取库位*/
            String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), container.getContainerType());
            if (Cools.isEmpty(targetLoc)) {
@@ -1064,22 +1067,22 @@
            throw new CoolException("目标库位不存在!!");
        }
//        List<LocItemWorking> workings = new ArrayList<>();
//        List<TaskItem> items = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()));
//        items.forEach(taskItem -> {
//            if (taskItem.getAnfme() > 0) {
//                LocItemWorking itemWorking = new LocItemWorking();
//                BeanUtils.copyProperties(taskItem, itemWorking);
//                itemWorking.setTaskId(task.getId())
//                        .setLocId(loc1.getId())
//                        .setLocCode(loc1.getCode());
//                workings.add(itemWorking);
//            }
//        });
//
//        if (!locItemWorkingService.saveBatch(workings)) {
//            throw new CoolException("临时库存更新失败!!");
//        }
        List<LocItemWorking> workings = new ArrayList<>();
        List<TaskItem> items = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()));
        items.forEach(taskItem -> {
            if (taskItem.getAnfme() > 0) {
                LocItemWorking itemWorking = new LocItemWorking();
                BeanUtils.copyProperties(taskItem, itemWorking);
                itemWorking.setTaskId(task.getId())
                        .setLocId(loc1.getId())
                        .setLocCode(loc1.getCode());
                workings.add(itemWorking);
            }
        });
        if (!locItemWorkingService.saveBatch(workings)) {
            throw new CoolException("临时库存更新失败!!");
        }
        loc1.setUseStatus(LocStsType.LOC_STS_TYPE_S.type);