From fb4e7fd8575a97467a972028a91484f71985656c Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期四, 12 九月 2024 17:03:47 +0800 Subject: [PATCH] # --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/TaskDetlLogServiceImpl.java | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/TaskDetlLogServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/TaskDetlLogServiceImpl.java index 94a0548..2e6c3c6 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/TaskDetlLogServiceImpl.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/TaskDetlLogServiceImpl.java @@ -1,12 +1,44 @@ package com.zy.asrs.wms.asrs.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zy.asrs.wms.asrs.entity.*; import com.zy.asrs.wms.asrs.mapper.TaskDetlLogMapper; -import com.zy.asrs.wms.asrs.entity.TaskDetlLog; +import com.zy.asrs.wms.asrs.service.TaskDetlFieldLogService; import com.zy.asrs.wms.asrs.service.TaskDetlLogService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; @Service("taskDetlLogService") public class TaskDetlLogServiceImpl extends ServiceImpl<TaskDetlLogMapper, TaskDetlLog> implements TaskDetlLogService { + @Autowired + private TaskDetlFieldLogService taskDetlFieldLogService; + + @Override + public List<TaskDetlLog> getTaskDetlLogByTaskId(Long taskId) { + List<TaskDetlLog> taskDetlLogs = this.list(new LambdaQueryWrapper<TaskDetlLog>().eq(TaskDetlLog::getTaskId, taskId)); + for (TaskDetlLog taskDetlLog : taskDetlLogs) { + List<TaskDetlFieldLog> list = taskDetlFieldLogService.list(new LambdaQueryWrapper<TaskDetlFieldLog>().eq(TaskDetlFieldLog::getDetlId, taskDetlLog.getId())); + taskDetlLog.syncField(list); + } + return taskDetlLogs; + } + + @Override + public List<Long> getTaskIdsByDetlId(Long detlId) { + return this.baseMapper.getTaskIdsByDetlId(detlId); + } + + @Override + public List<TaskDetlLog> parseDetl(List<TaskDetlLog> list) { + for (TaskDetlLog taskDetlLog : list) { + List<TaskDetlFieldLog> taskDetlFieldLogList = taskDetlFieldLogService.list(new LambdaQueryWrapper<TaskDetlFieldLog>().eq(TaskDetlFieldLog::getDetlId, taskDetlLog.getId())); + taskDetlLog.syncField(taskDetlFieldLogList); + } + return list; + } } -- Gitblit v1.9.1