Commit 5b0ec621d8160551110953238ce1f5d6fe74003c
1 parent
b98016d8
增加站台任务电视看板接口
Showing
3 changed files
with
79 additions
and
0 deletions
.gitignore
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/TaskController.java
0 → 100644
1 | +package org.jeecg.modules.wms.api.mobile.controller; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import io.swagger.annotations.Api; | |
6 | +import org.jeecg.common.api.vo.Result; | |
7 | +import org.jeecg.modules.wms.api.mobile.entity.TvTaskVo; | |
8 | +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; | |
9 | +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | |
10 | +import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl; | |
11 | +import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl; | |
12 | +import org.jeecg.utils.StringUtils; | |
13 | +import org.jeecg.utils.constant.QuantityConstant; | |
14 | +import org.springframework.web.bind.annotation.GetMapping; | |
15 | +import org.springframework.web.bind.annotation.RequestMapping; | |
16 | +import org.springframework.web.bind.annotation.RestController; | |
17 | + | |
18 | +import javax.annotation.Resource; | |
19 | +import java.util.ArrayList; | |
20 | +import java.util.Arrays; | |
21 | +import java.util.List; | |
22 | + | |
23 | +/** | |
24 | + */ | |
25 | +@Api(tags = "Mobile") | |
26 | +@RestController | |
27 | +@RequestMapping("/api/mobile/task") | |
28 | +public class TaskController { | |
29 | + | |
30 | + @Resource | |
31 | + private TaskHeaderServiceImpl taskHeaderService; | |
32 | + | |
33 | + @Resource | |
34 | + private TaskDetailServiceImpl taskDetailService; | |
35 | + | |
36 | + @GetMapping("taskOfStation") | |
37 | + public Result<List<TvTaskVo>> importExcel(String code) { | |
38 | + List<String> stationList = new ArrayList<>(); | |
39 | + if (StringUtils.isNotEmpty(code)) { | |
40 | + stationList = Arrays.asList(code.split(",")); | |
41 | + } | |
42 | + | |
43 | + LambdaQueryWrapper<TaskHeader> hQuery = Wrappers.lambdaQuery(); | |
44 | + hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION) | |
45 | + .in(stationList.size() > 0, TaskHeader::getToPortCode, stationList); | |
46 | + List<TaskHeader> headers = taskHeaderService.list(hQuery); | |
47 | + | |
48 | + List<TvTaskVo> list = new ArrayList<>(); | |
49 | + for (TaskHeader header : headers) { | |
50 | + TvTaskVo vo = new TvTaskVo(); | |
51 | + LambdaQueryWrapper<TaskDetail> dQuery = Wrappers.lambdaQuery(); | |
52 | + dQuery.eq(TaskDetail::getTaskHeaderId, header.getId()); | |
53 | + List<TaskDetail> details = taskDetailService.list(dQuery); | |
54 | + | |
55 | + vo.setTaskHeader(header); | |
56 | + vo.setTaskDetailList(details); | |
57 | + list.add(vo); | |
58 | + } | |
59 | + return Result.OK("", list); | |
60 | + } | |
61 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/entity/TvTaskVo.java
0 → 100644
1 | +package org.jeecg.modules.wms.api.mobile.entity; | |
2 | + | |
3 | +import lombok.Data; | |
4 | +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; | |
5 | +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +@Data | |
10 | +public class TvTaskVo { | |
11 | + private TaskHeader taskHeader; | |
12 | + private List<TaskDetail> taskDetailList; | |
13 | +} | |
... | ... |