skyouc
2 天以前 89255f6e9692026ffe4ce20bf4454c963a35ad69
移库任务优化
6个文件已修改
66 ■■■■■ 已修改文件
rsf-admin/src/page/task/TaskList.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/service/WcsService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/CompanysController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/task/TaskList.jsx
@@ -273,7 +273,7 @@
        }
    }
    return (
        record.taskStatus === 1 ?
        (record.taskStatus >= 1 && record.taskType  < 50) || (record.taskStatus == 101) ?
            <Button
                onClick={clickCancel}
                label="toolbar.cancel">
rsf-server/src/main/java/com/vincent/rsf/server/api/service/WcsService.java
@@ -8,5 +8,5 @@
    void agvTaskPickUpComplete(TaskInParam param);
    InTaskMsgDto getLocNo(TaskInParam param);
    InTaskMsgDto getLocNo(TaskInParam param) throws Exception;
}
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -95,7 +95,12 @@
        String ruleCode = generateTaskCode();
        // 获取库位号
        InTaskMsgDto locNo = getLocNo(param);
        InTaskMsgDto locNo = null;
        try {
            locNo = getLocNo(param);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        // 创建并保存任务
        Task task = createTask(ruleCode, locNo.getLocNo(), waitPakin.getBarcode(),
@@ -329,7 +334,7 @@
//        return locNo;
//    }
    @Override
    public InTaskMsgDto getLocNo(TaskInParam param) {
    public InTaskMsgDto getLocNo(TaskInParam param) throws Exception{
        String matnr = null;
        String batch = null;
        List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, param.getBarcode()));
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/CompanysController.java
@@ -114,7 +114,6 @@
        if (Objects.isNull(companys.getType())) {
            throw new CoolException("类型不能为空!!");
        }
        companys.setUpdateTime(null);
        companys.setUpdateBy(getLoginUserId());
        if (!companysService.updateById(companys)) {
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -226,7 +226,13 @@
            param.setIoType(TaskType.TASK_TYPE_OUT.type)
                    .setSourceStaNo(Integer.parseInt(deviceSite.getSite()))
                    .setLocType1(Integer.parseInt(orgLoc.getType()));
            InTaskMsgDto locNo = wcsService.getLocNo(param);
            InTaskMsgDto locNo = null;
            try {
                locNo = wcsService.getLocNo(param);
            } catch (Exception e) {
                log.error("<UNK>", e);
                throw new CoolException(e.getMessage());
            }
            targetLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, locNo.getLocNo()));
        } else {
            targetLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, map.get("tarLoc").toString()));
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -414,7 +414,7 @@
        Loc orgLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc()));
        if (Objects.isNull(orgLoc)) {
            throw new CoolException("目标库位不存在!");
            throw new CoolException("源库位不存在!");
        }
        if (!loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type)) {
@@ -444,12 +444,21 @@
//            throw new CoolException(e.getMessage());
//        }
        /**修改库位状态为F.在库*/
        if (!locService.update(new LambdaUpdateWrapper<Loc>().set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type).eq(Loc::getCode, task.getTargLoc()))) {
        if (!locService.update(new LambdaUpdateWrapper<Loc>()
                        .set(Loc::getBarcode, task.getBarcode())
                .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type)
                .eq(Loc::getCode, task.getTargLoc()))) {
            throw new CoolException("库位状态修改失败!!");
        }
        if (!locService.update(new LambdaUpdateWrapper<Loc>().set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type).eq(Loc::getCode, task.getOrgLoc()))) {
        if (!locService.update(new LambdaUpdateWrapper<Loc>()
                        .set(Loc::getBarcode, null)
                .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type).eq(Loc::getCode, task.getOrgLoc()))) {
            throw new CoolException("库位状态修改失败!!");
        }
        if (!locItemService.remove(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocCode, task.getOrgLoc()))) {
            throw new CoolException("源库位明细删除失败!");
        }
        if (!this.update(new LambdaUpdateWrapper<Task>().eq(Task::getId, task.getId()).set(Task::getTaskStatus, TaskStsType.UPDATED_IN.id))) {
@@ -524,18 +533,10 @@
                throw new CoolException("数据错误,作业中库存数据丢失!!");
            }
            if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
                locWorking.setWorkQty(0.0);
                locWorking.setAnfme(taskItem.getAnfme());
            } else {
                if (locWorking.getAnfme().compareTo(taskItem.getAnfme()) >= 0) {
                    locWorking.setWorkQty(0.0);
                    locWorking.setAnfme(Math.round((locWorking.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0);
                } else {
                    continue;
                }
            }
            BeanUtils.copyProperties(locWorking, locItem);
            locItem.setLocCode(loc.getCode()).setLocId(loc.getId()).setId(null);
            locItem.setWorkQty(0.0).setLocCode(loc.getCode()).setLocId(loc.getId()).setId(null);
            items.add(locItem);
        }
@@ -547,13 +548,11 @@
        //保存入出库流水
        saveStockItems(taskItems, task, null, null, taskItem.getWkType(), taskItem.getOrderType());
        if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) {
            throw new CoolException("作业中库存删除失败!!");
        }
        task.setTaskStatus(TaskStsType.UPDATED_IN.id);
        task.setTaskStatus(TaskStsType.UPDATED_IN.id).setUpdateTime(null);
        if (!taskService.updateById(task)) {
            throw new CoolException("任务状态修改失败!!");
        }
@@ -569,7 +568,10 @@
    @Override
    public R removeTask(Long[] ids) {
        List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
        List<Task> tasks = this.list(new LambdaQueryWrapper<Task>().in(Task::getId, ids).in(Task::getTaskStatus, longs));
        List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_IN.type, TaskType.TASK_TYPE_OUT.type, TaskType.TASK_TYPE_EMPITY_IN.type, TaskType.TASK_TYPE_EMPITY_OUT.type, TaskType.TASK_TYPE_MERGE_OUT.type);
        List<Task> tasks = this.list(new LambdaQueryWrapper<Task>()
                .in(Task::getTaskType, list)
                .in(Task::getId, ids).in(Task::getTaskStatus, longs));
        if (tasks.isEmpty()) {
            throw new CoolException("任务已处执行状态不可取消!!");
        }
@@ -831,9 +833,9 @@
            }
            //全板出库,删除临时库存
           if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) {
               throw new CoolException("临时库存清除失败!!");
           }
            if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) {
                throw new CoolException("临时库存清除失败!!");
            }
        }
@@ -938,7 +940,7 @@
            List<TaskItem> items = orderMap.get(key);
            try {
                //保存库存明细
                saveStockItems(items, task,  pakinItem.getId(), pakinItem.getAsnCode(), pakinItem.getWkType(), pakinItem.getType());
                saveStockItems(items, task, pakinItem.getId(), pakinItem.getAsnCode(), pakinItem.getWkType(), pakinItem.getType());
                //移出收货区库存, 修改组托状态
                removeReceiptStock(pakinItem);
            } catch (Exception e) {
@@ -1045,7 +1047,7 @@
                task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type) ) {
                task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
            stock.setLocCode(task.getTargLoc());
        } else {
            stock.setLocCode(task.getOrgLoc());