skyouc
2 天以前 c48e3aabf2947e45a9db2eac3ef91190e8647655
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -285,7 +285,7 @@
        if (Objects.isNull(deviceSite)) {
            throw new CoolException("站点不存在!!");
        }
        DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(Integer.valueOf(deviceSite.getSite())));
        DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(deviceSite.getSite()));
        if (Cools.isEmpty(deviceBind)) {
            throw new CoolException("库位规则未知");
        }
@@ -970,7 +970,7 @@
                .setTaskStatus(TaskStsType.GENERATE_IN.id);
        TaskInParam param = new TaskInParam();
        param.setSourceStaNo(Integer.parseInt(task.getTargSite()))
        param.setSourceStaNo(task.getTargSite())
                .setIoType(type)
                .setLocType1(Integer.parseInt(loc.getType()));
        //获取新库位
@@ -979,7 +979,8 @@
        if (Objects.isNull(locInfo)) {
            throw new CoolException("获取库位失败!!");
        }
        task.setTargLoc(locInfo.getLocNo());
        task.setTargLoc(locInfo.getLocNo())
                .setOrgSite(task.getTargSite());
        if (!this.updateById(task)) {
            throw new CoolException("任务状态更新失败!!");
@@ -1143,14 +1144,23 @@
                    } catch (Exception e) {
                        throw new CoolException(e.getMessage());
                    }
                } else if (task.getResource().equals(TaskResouceType.TASK_RESOUCE_ORDER_TYPE.val)
                        || task.getResource().equals(TaskResouceType.TASK_RESOUCE_CHECK_TYPE.val)) {
                } else if (task.getResource().equals(TaskResouceType.TASK_RESOUCE_ORDER_TYPE.val)) {
                    WkOrderItem orderItem = asnOrderItemService.getById(key);
                    if (Objects.isNull(orderItem)) {
                        throw new CoolException("单据明细不存在!!");
                    }
                    try {
                        saveOutStockItem(maps.get(key), orderItem, null, null, loginUserId);
                        saveOutStockItem(maps.get(key), orderItem,  loginUserId);
                    } catch (Exception e) {
                        throw new CoolException(e.getMessage());
                    }
                } else if (task.getResource().equals(TaskResouceType.TASK_RESOUCE_CHECK_TYPE.val)) {
                    WkOrderItem orderItem = asnOrderItemService.getById(key);
                    if (Objects.isNull(orderItem)) {
                        throw new CoolException("单据明细不存在!!");
                    }
                    try {
                        saveOutStockItem(maps.get(key), null, null, orderItem, loginUserId);
                    } catch (Exception e) {
                        throw new CoolException(e.getMessage());
                    }
@@ -1207,7 +1217,7 @@
     * @version 1.0
     */
    @Transactional(rollbackFor = Exception.class)
    public void saveOutStockItem(List<TaskItem> taskItems, CheckDiffItem diffItem, Long loginUserId) {
    public void saveOutStockItem(List<TaskItem> taskItems, WkOrderItem diffItem, Long loginUserId) {
        try {
            saveOutStockItem(taskItems, null, null, diffItem, loginUserId);
        } catch (Exception e) {
@@ -1222,7 +1232,7 @@
     * @version 1.0
     */
    @Transactional(rollbackFor = Exception.class)
    public void saveOutStockItem(List<TaskItem> taskItems, WkOrderItem orderItem, WaveItem waveItem, CheckDiffItem diffItem, Long loginUserId) throws Exception {
    public void saveOutStockItem(List<TaskItem> taskItems, WkOrderItem orderItem, WaveItem waveItem, WkOrderItem diffItem, Long loginUserId) throws Exception {
        Stock stock = new Stock();
        String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null);
        if (StringUtils.isBlank(ruleCode)) {