#
Junjie
2024-07-31 27d2e58cd0fbd6b7551299abbc86d83aa54033ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.zy.asrs.wms.asrs.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.wms.asrs.entity.Task;
import com.zy.asrs.wms.asrs.mapper.TaskLogMapper;
import com.zy.asrs.wms.asrs.entity.TaskLog;
import com.zy.asrs.wms.asrs.service.TaskDetlLogService;
import com.zy.asrs.wms.asrs.service.TaskLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
 
@Service("taskLogService")
public class TaskLogServiceImpl extends ServiceImpl<TaskLogMapper, TaskLog> implements TaskLogService {
 
    @Autowired
    private TaskDetlLogService taskDetlLogService;
 
    @Override
    public List<TaskLog> getByOrderDetlId(Long orderDetlId) {
        ArrayList<TaskLog> tasks = new ArrayList<>();
        List<Long> taskIds = taskDetlLogService.getTaskIdsByDetlId(orderDetlId);
        if (!taskIds.isEmpty()) {
            return this.list(new LambdaQueryWrapper<TaskLog>().in(TaskLog::getId, taskIds));
        }
        return tasks;
    }
}