1
20 小时以前 146df27ee40e25de46d577c18b249128d5c09c91
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -51,6 +51,8 @@
    private WaveService waveService;
    @Autowired
    private BasStationService basStationService;
    @Autowired
    private LocItemWorkingService locItemWorkingService;
    /**
@@ -220,8 +222,8 @@
                    if (resouce.equals(TaskResouceType.TASK_RESOUCE_STOCK_UP.val)){
                        //全板出库
                        DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                                .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type));
//                                .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
                                .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type)
                                .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel()));
                        if (Objects.isNull(deviceSite)) {
                            throw new CoolException("站点不支持越库!!");
                        }
@@ -229,8 +231,8 @@
                    } else {
                        //全板出库
                        DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                                .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_OUT.type));
//                                .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
                                .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_OUT.type)
                                .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel()));
                        if (Objects.isNull(deviceSite)) {
                            throw new CoolException("站点不支持全板出库!!");
                        }
@@ -286,6 +288,7 @@
                    throw new CoolException("主任务关联失败!!");
                }
            }
            locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()));
            List<TaskItem> taskItems = new ArrayList<>();
            listMap.get(key).forEach(item -> {
@@ -340,6 +343,21 @@
                if (!locItemService.updateById(item)) {
                    throw new CoolException("库存信息修改失败!!");
                }
                if (taskItem.getAnfme() > 0) {
                    LocItemWorking itemWorking = new LocItemWorking();
                    BeanUtils.copyProperties(taskItem, itemWorking);
                    itemWorking.setTaskId(task.getId())
                            .setQty(0.0)
                            .setLocId(loc.getId())
                            .setLocItemId(locItem.getId())
                            .setType("in")
                            .setLocCode(loc.getCode());
                    if (!locItemWorkingService.save(itemWorking)) {
                        throw new CoolException("临时库存更新失败!!");
                    }
                }
            });
            if (!taskItemService.saveBatch(taskItems)) {