#
Junjie
2024-09-07 8eba3203511d8edbc5ee04aa82eceeaa3e38f889
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java
@@ -53,6 +53,7 @@
                //保存任务历史档
                TaskLog taskLog = new TaskLog();
                taskLog.sync(task);
                taskLog.setId(null);
                if (!taskLogService.save(taskLog)) {
                    throw new CoolException("保存任务历史档失败");
                }
@@ -70,6 +71,8 @@
                for (TaskDetl taskDetl : taskDetls) {
                    TaskDetlLog taskDetlLog = new TaskDetlLog();
                    taskDetlLog.sync(taskDetl);
                    taskDetlLog.setId(null);
                    taskDetlLog.setTaskId(taskLog.getId());
                    if (!taskDetlLogService.save(taskDetlLog)) {
                        throw new CoolException("保存任务明细历史档失败");
                    }
@@ -80,6 +83,8 @@
                        //明细扩展字段数据保存至历史档
                        TaskDetlFieldLog taskDetlFieldLog = new TaskDetlFieldLog();
                        taskDetlFieldLog.sync(detlField);
                        taskDetlFieldLog.setId(null);
                        taskDetlFieldLog.setDetlId(taskDetlLog.getId());
                        if (!taskDetlFieldLogService.save(taskDetlFieldLog)) {
                            throw new CoolException("明细扩展字段转历史档案失败");
                        }
@@ -100,6 +105,10 @@
                //更新订单信息
                for (TaskDetl taskDetl : taskDetls) {
                    if (taskDetl.getDetlId() == null) {
                        continue;
                    }
                    OrderDetl orderDetl = orderDetlService.getById(taskDetl.getDetlId());
                    if (orderDetl == null) {
                        throw new CoolException("订单明细不存在");
@@ -146,7 +155,9 @@
        InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build());
        try {
            //获取入库完成任务
            List<Task> list = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskSts, 200));
            List<Task> list = taskService.list(new LambdaQueryWrapper<Task>()
                    .eq(Task::getTaskSts, 200)
                    .in(Task::getTaskType, 101, 53, 57));
            if (list.isEmpty()) {
                return;
            }
@@ -157,6 +168,7 @@
                //保存任务历史档
                TaskLog taskLog = new TaskLog();
                taskLog.sync(task);
                taskLog.setId(null);
                if (!taskLogService.save(taskLog)) {
                    throw new CoolException("保存任务历史档失败");
                }
@@ -174,6 +186,8 @@
                for (TaskDetl taskDetl : taskDetls) {
                    TaskDetlLog taskDetlLog = new TaskDetlLog();
                    taskDetlLog.sync(taskDetl);
                    taskDetlLog.setId(null);
                    taskDetlLog.setTaskId(taskLog.getId());
                    if (!taskDetlLogService.save(taskDetlLog)) {
                        throw new CoolException("保存任务明细历史档失败");
                    }
@@ -184,6 +198,8 @@
                        //明细扩展字段数据保存至历史档
                        TaskDetlFieldLog taskDetlFieldLog = new TaskDetlFieldLog();
                        taskDetlFieldLog.sync(detlField);
                        taskDetlFieldLog.setId(null);
                        taskDetlFieldLog.setDetlId(taskDetlLog.getId());
                        if (!taskDetlFieldLogService.save(taskDetlFieldLog)) {
                            throw new CoolException("明细扩展字段转历史档案失败");
                        }
@@ -204,6 +220,10 @@
                //更新订单信息
                for (TaskDetl taskDetl : taskDetls) {
                    if (taskDetl.getDetlId() == null) {
                        continue;
                    }
                    OrderDetl orderDetl = orderDetlService.getById(taskDetl.getDetlId());
                    if (orderDetl == null) {
                        throw new CoolException("订单明细不存在");