自动化立体仓库 - WMS系统
skyouc
2 天以前 b4c6f129662be7fb14f71235817a24e15f824449
src/main/java/com/zy/asrs/task/handler/WorkLogHandler.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.zy.asrs.entity.*;
import com.zy.asrs.enums.TaskStatusType;
import com.zy.asrs.service.*;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
@@ -132,6 +133,7 @@
        return SUCCESS;
    }
    @Transactional(rollbackFor = Exception.class)
    public ReturnT<String> AgvStart(Task task) {
        try {
            List<TaskDetl> taskDetls = taskDetlService.selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo()));
@@ -153,7 +155,7 @@
            }
            // 入库 --------------------------------------------------------------------------------
            if (task.getWrkSts() == 5) {
            if (task.getWrkSts().equals(TaskStatusType.AGV_INVENTORY_UPDATED_IN.type)) {
                // 全板入库
                if (task.getIoType() == 1) {
                    // 入库通知单
@@ -183,7 +185,7 @@
                }
                // 出库 --------------------------------------------------------------------------------
            } else if (task.getWrkSts() == 15) {
            } else if (task.getWrkSts().equals(TaskStatusType.AGV_INVENTORY_UPDATED_OUT.type)) {
//                if (!Cools.isEmpty(wrkDetls)) {
//                    if (!orderService.saveHandlerOrder(Boolean.FALSE, wrkMast, wrkDetls)) {
//                        exceptionHandle("生成手动出库单据[workNo={0}]失败", wrkMast.getWrkNo());
@@ -191,21 +193,6 @@
//                }
            }
            for (TaskDetl taskDetl :taskDetls){
                TaskDetlLog taskDetlLog = new TaskDetlLog();
                BeanUtils.copyProperties(taskDetl, taskDetlLog);
                // 保存工作明细档历史档
                if (!taskDetlLogService.insert(taskDetlLog)) {
                exceptionHandle("保存工作明细历史档[workNo={0}]失败", task.getWrkNo());
                }
                // 删除工作明细档
                if (!taskDetlService.deleteById(taskDetl)) {
                exceptionHandle("删除工作明细档[workNo={0}]失败", task.getWrkNo());
                }
            }
            TaskLog taskLog = new TaskLog();
            BeanUtils.copyProperties(task, taskLog);
            // 保存工作主档历史档
@@ -217,6 +204,22 @@
            if (!taskService.deleteById(task)) {
                exceptionHandle("删除工作主档[workNo={0}]失败", task.getWrkNo());
            }
            List<TaskDetl> taskDetls2 = taskDetlService.selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo()));
            for (TaskDetl taskDetl :taskDetls2){
                TaskDetlLog taskDetlLog = new TaskDetlLog();
                BeanUtils.copyProperties(taskDetl, taskDetlLog);
                taskDetlLog.setLogId(taskLog.getId());
                taskDetlLog.setId(null);
                // 保存工作明细档历史档
                if (!taskDetlLogService.insert(taskDetlLog)) {
                exceptionHandle("保存工作明细历史档[workNo={0}]失败", task.getWrkNo());
                }
                // 删除工作明细档
                if (!taskDetlService.deleteById(taskDetl)) {
                exceptionHandle("删除工作明细档[workNo={0}]失败", task.getWrkNo());
                }
            }
        } catch (Exception e) {
            log.error("fail", e);