Commit f5af1eec672fee840c49bfd7340939c2e40ab325

Authored by 周峰
1 parent 6ce504d6

电视接口迁移到/api/tv下

huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/MobileController.java
... ... @@ -6,22 +6,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import io.swagger.annotations.Api;
7 7 import io.swagger.annotations.ApiOperation;
8 8 import org.jeecg.common.api.vo.Result;
9   -import org.jeecg.modules.system.entity.SysDictItem;
10   -import org.jeecg.modules.system.service.impl.SysDictItemServiceImpl;
11   -import org.jeecg.modules.wms.api.mobile.entity.TvTaskVo;
12 9 import org.jeecg.modules.wms.monitor.apkinfo.entity.ApkInfo;
13 10 import org.jeecg.modules.wms.monitor.apkinfo.service.IApkInfoService;
14   -import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
15   -import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
16   -import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl;
17   -import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl;
18 11 import org.jeecg.utils.StringUtils;
19   -import org.jeecg.utils.constant.QuantityConstant;
20 12 import org.springframework.beans.factory.annotation.Value;
21   -import org.springframework.web.bind.annotation.*;
  13 +import org.springframework.web.bind.annotation.PostMapping;
  14 +import org.springframework.web.bind.annotation.RequestBody;
  15 +import org.springframework.web.bind.annotation.RequestMapping;
  16 +import org.springframework.web.bind.annotation.RestController;
22 17  
23 18 import javax.annotation.Resource;
24   -import java.util.*;
  19 +import java.util.Map;
25 20  
26 21 /**
27 22 */
... ... @@ -36,63 +31,6 @@ public class MobileController {
36 31 @Resource
37 32 private IApkInfoService apkInfoService;
38 33  
39   - @Resource
40   - private TaskHeaderServiceImpl taskHeaderService;
41   -
42   - @Resource
43   - private SysDictItemServiceImpl sysDictItemService;
44   -
45   - @Resource
46   - private TaskDetailServiceImpl taskDetailService;
47   -
48   - @GetMapping("taskOfStation")
49   - public Result<List<TvTaskVo>> importExcel(String code) {
50   - List<String> stationList = new ArrayList<>();
51   - if (StringUtils.isNotEmpty(code)) {
52   - stationList = Arrays.asList(code.split(","));
53   - }
54   -
55   - HashMap<String, String> typeMap = new HashMap<>();
56   - typeMap.put("100", "整盘入库");
57   - typeMap.put("200", "补充入库");
58   - typeMap.put("300", "整盘出库");
59   - typeMap.put("400", "分拣出库");
60   - typeMap.put("500", "空容器入库");
61   - typeMap.put("600", "空容器出库");
62   - typeMap.put("700", "盘点");
63   - typeMap.put("800", "移库");
64   - typeMap.put("900", "出库查看");
65   - typeMap.put("1000", "换站");
66   - typeMap.put("1100", "空托盘组入库");
67   - typeMap.put("1200", "空托盘组出库");
68   - typeMap.put("1300", "空托盘组换站");
69   -
70   - HashMap<String, String> statusMap = new HashMap<>();
71   - statusMap.put("1", "生成任务");
72   - statusMap.put("10", "下发任务");
73   - statusMap.put("50", "到达拣选台");
74   - statusMap.put("100", "任务完成");
75   -
76   - LambdaQueryWrapper<TaskHeader> hQuery = Wrappers.lambdaQuery();
77   - hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION)
78   - .in(stationList.size() > 0, TaskHeader::getToPortCode, stationList);
79   - List<TaskHeader> headers = taskHeaderService.list(hQuery);
80   -
81   - List<TvTaskVo> list = new ArrayList<>();
82   - for (TaskHeader header : headers) {
83   - header.setUserdef1(typeMap.get(header.getTaskType().toString()));
84   - header.setUserdef2(statusMap.get(header.getStatus().toString()));
85   - TvTaskVo vo = new TvTaskVo();
86   - LambdaQueryWrapper<TaskDetail> dQuery = Wrappers.lambdaQuery();
87   - dQuery.eq(TaskDetail::getTaskHeaderId, header.getId());
88   - List<TaskDetail> details = taskDetailService.list(dQuery);
89   -
90   - vo.setTaskHeader(header);
91   - vo.setTaskDetailList(details);
92   - list.add(vo);
93   - }
94   - return Result.OK("", list);
95   - }
96 34  
97 35 @PostMapping("/getUpdateApkInfo")
98 36 @ApiOperation("获取apk更新信息")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.tv;
  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.beans.factory.annotation.Value;
  15 +import org.springframework.web.bind.annotation.GetMapping;
  16 +import org.springframework.web.bind.annotation.RequestMapping;
  17 +import org.springframework.web.bind.annotation.RestController;
  18 +
  19 +import javax.annotation.Resource;
  20 +import java.util.ArrayList;
  21 +import java.util.Arrays;
  22 +import java.util.HashMap;
  23 +import java.util.List;
  24 +
  25 +/**
  26 + */
  27 +@Api(tags = "Mobile")
  28 +@RestController
  29 +@RequestMapping("/api/tv")
  30 +public class TvController {
  31 +
  32 + @Value(value = "${server.servlet.context-path}")
  33 + private String ctx;
  34 +
  35 + @Resource
  36 + private TaskHeaderServiceImpl taskHeaderService;
  37 +
  38 + @Resource
  39 + private TaskDetailServiceImpl taskDetailService;
  40 +
  41 + @GetMapping("taskOfStation")
  42 + public Result<List<TvTaskVo>> importExcel(String code) {
  43 + List<String> stationList = new ArrayList<>();
  44 + if (StringUtils.isNotEmpty(code)) {
  45 + stationList = Arrays.asList(code.split(","));
  46 + }
  47 +
  48 + HashMap<String, String> typeMap = new HashMap<>();
  49 + typeMap.put("100", "整盘入库");
  50 + typeMap.put("200", "补充入库");
  51 + typeMap.put("300", "整盘出库");
  52 + typeMap.put("400", "分拣出库");
  53 + typeMap.put("500", "空容器入库");
  54 + typeMap.put("600", "空容器出库");
  55 + typeMap.put("700", "盘点");
  56 + typeMap.put("800", "移库");
  57 + typeMap.put("900", "出库查看");
  58 + typeMap.put("1000", "换站");
  59 + typeMap.put("1100", "空托盘组入库");
  60 + typeMap.put("1200", "空托盘组出库");
  61 + typeMap.put("1300", "空托盘组换站");
  62 +
  63 + HashMap<String, String> statusMap = new HashMap<>();
  64 + statusMap.put("1", "生成任务");
  65 + statusMap.put("10", "下发任务");
  66 + statusMap.put("50", "到达拣选台");
  67 + statusMap.put("100", "任务完成");
  68 +
  69 + LambdaQueryWrapper<TaskHeader> hQuery = Wrappers.lambdaQuery();
  70 + hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION)
  71 + .in(stationList.size() > 0, TaskHeader::getToPortCode, stationList);
  72 + List<TaskHeader> headers = taskHeaderService.list(hQuery);
  73 +
  74 + List<TvTaskVo> list = new ArrayList<>();
  75 + for (TaskHeader header : headers) {
  76 + header.setUserdef1(typeMap.get(header.getTaskType().toString()));
  77 + header.setUserdef2(statusMap.get(header.getStatus().toString()));
  78 + TvTaskVo vo = new TvTaskVo();
  79 + LambdaQueryWrapper<TaskDetail> dQuery = Wrappers.lambdaQuery();
  80 + dQuery.eq(TaskDetail::getTaskHeaderId, header.getId());
  81 + List<TaskDetail> details = taskDetailService.list(dQuery);
  82 +
  83 + vo.setTaskHeader(header);
  84 + vo.setTaskDetailList(details);
  85 + list.add(vo);
  86 + }
  87 + return Result.OK("", list);
  88 + }
  89 +}
... ...