BigScreenService.java
5.61 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package com.huaheng.api.general.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.huaheng.api.general.domain.BigScreenTask;
import com.huaheng.common.constant.QuantityConstant;
import com.huaheng.pc.task.taskDetail.domain.TaskDetail;
import com.huaheng.pc.task.taskDetail.service.TaskDetailService;
import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author yiwenpeng
* @date 2022/9/7 09:51
*/
@Component
public class BigScreenService {
@Resource
TaskHeaderService taskHeaderService;
@Resource
TaskDetailService taskDetailService;
public List<BigScreenTask> selectReceiptTask() {
List<TaskHeader> taskHeaders = taskHeaderService.list(new LambdaQueryWrapper<TaskHeader>()
.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED)//任务完成
.eq(TaskHeader::getZoneCode, "B")
.in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLERECEIPT, QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT)//整盘入库、补充入库
.orderByDesc(TaskHeader::getCreated)
.last("limit 10"));
List<BigScreenTask> bigScreenTaskList = new ArrayList<>();
for (TaskHeader taskHeader : taskHeaders) {
List<TaskDetail> taskDetails=taskDetailService.list(new LambdaQueryWrapper<TaskDetail>().eq(TaskDetail::getTaskId,taskHeader.getId()));
if (taskDetails.size()==0) {
continue;
}
TaskDetail taskDetail=taskDetails.get(0);
BigScreenTask bigScreenTask = new BigScreenTask();
bigScreenTask.setTaskId(taskHeader.getId());
bigScreenTask.setQty(taskDetail.getQty());
bigScreenTask.setMaterialCode(taskDetail.getMaterialCode());
bigScreenTask.setToLocation(taskHeader.getToLocation());
bigScreenTask.setMaterialName(taskDetail.getMaterialName());
bigScreenTask.setFromLocation(taskHeader.getFromLocation());
bigScreenTask.setContainerCode(taskHeader.getContainerCode());
bigScreenTask.setMaterialCode(taskDetail.getMaterialCode());
if (taskHeader.getStatus().toString().equals("1")) {
bigScreenTask.setStatus("创建状态");
} else if (taskHeader.getStatus().toString().equals("100")) {
bigScreenTask.setStatus("任务完成");
} else {
bigScreenTask.setStatus("执行状态");
}
if (taskHeader.getTaskType().toString().equals("100")) {
bigScreenTask.setTaskType("整盘入库");
}
if (taskHeader.getTaskType().toString().equals("200")) {
bigScreenTask.setTaskType("补充入库");
}
//if (taskHeader.getTaskType().toString().equals("900")) {
// bigScreenTask.setTaskType("盘点任务");
//}
bigScreenTaskList.add(bigScreenTask);
}
return bigScreenTaskList;
}
public List<BigScreenTask> selectShipmentTask() {
List<TaskHeader> taskHeaders = taskHeaderService.list(new LambdaQueryWrapper<TaskHeader>()
.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED)//任务完成
.eq(TaskHeader::getZoneCode, "B")
.in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLESHIPMENT, QuantityConstant.TASK_TYPE_SORTINGSHIPMENT)//整盘出库、分拣出库
.orderByDesc(TaskHeader::getCreated)
.last("limit 10"));
List<BigScreenTask> bigScreenTaskList = new ArrayList<>();
for (TaskHeader taskHeader : taskHeaders) {
List<TaskDetail> taskDetails=taskDetailService.list(new LambdaQueryWrapper<TaskDetail>().eq(TaskDetail::getTaskId,taskHeader.getId()));
if (taskDetails.size()==0) {
continue;
}
TaskDetail taskDetail=taskDetails.get(0);
BigScreenTask bigScreenTask = new BigScreenTask();
bigScreenTask.setQty(taskDetail.getQty());
bigScreenTask.setMaterialName(taskDetail.getMaterialName());
bigScreenTask.setTaskId(taskHeader.getId());
bigScreenTask.setMaterialCode(taskDetail.getMaterialCode());
bigScreenTask.setToLocation(taskHeader.getToLocation());
bigScreenTask.setFromLocation(taskHeader.getFromLocation());
bigScreenTask.setContainerCode(taskHeader.getContainerCode());
if (taskHeader.getStatus().toString().equals("1")) {
bigScreenTask.setStatus("创建状态");
} else if (taskHeader.getStatus().toString().equals("100")) {
bigScreenTask.setStatus("任务完成");
} else {
bigScreenTask.setStatus("执行状态");
}
if (taskHeader.getTaskType().toString().equals("300")) {
bigScreenTask.setTaskType("整盘出库");
}
if (taskHeader.getTaskType().toString().equals("400")) {
bigScreenTask.setTaskType("分拣出库");
}
//if (taskHeader.getTaskType().toString().equals("900")) {
// bigScreenTask.setTaskType("盘点任务");
//}
bigScreenTaskList.add(bigScreenTask);
}
return bigScreenTaskList;
}
}