From f5af1eec672fee840c49bfd7340939c2e40ab325 Mon Sep 17 00:00:00 2001 From: zf <27208084@qq.com> Date: Mon, 31 Jul 2023 16:06:02 +0800 Subject: [PATCH] 电视接口迁移到/api/tv下 --- huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/MobileController.java | 72 +++++------------------------------------------------------------------- huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 67 deletions(-) create mode 100644 huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/MobileController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/MobileController.java index c639d1a..0bfc894 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/MobileController.java +++ b/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; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.api.vo.Result; -import org.jeecg.modules.system.entity.SysDictItem; -import org.jeecg.modules.system.service.impl.SysDictItemServiceImpl; -import org.jeecg.modules.wms.api.mobile.entity.TvTaskVo; import org.jeecg.modules.wms.monitor.apkinfo.entity.ApkInfo; import org.jeecg.modules.wms.monitor.apkinfo.service.IApkInfoService; -import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; -import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; -import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl; -import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl; import org.jeecg.utils.StringUtils; -import org.jeecg.utils.constant.QuantityConstant; import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.*; +import java.util.Map; /** */ @@ -36,63 +31,6 @@ public class MobileController { @Resource private IApkInfoService apkInfoService; - @Resource - private TaskHeaderServiceImpl taskHeaderService; - - @Resource - private SysDictItemServiceImpl sysDictItemService; - - @Resource - private TaskDetailServiceImpl taskDetailService; - - @GetMapping("taskOfStation") - public Result<List<TvTaskVo>> importExcel(String code) { - List<String> stationList = new ArrayList<>(); - if (StringUtils.isNotEmpty(code)) { - stationList = Arrays.asList(code.split(",")); - } - - HashMap<String, String> typeMap = new HashMap<>(); - typeMap.put("100", "整盘入库"); - typeMap.put("200", "补充入库"); - typeMap.put("300", "整盘出库"); - typeMap.put("400", "分拣出库"); - typeMap.put("500", "空容器入库"); - typeMap.put("600", "空容器出库"); - typeMap.put("700", "盘点"); - typeMap.put("800", "移库"); - typeMap.put("900", "出库查看"); - typeMap.put("1000", "换站"); - typeMap.put("1100", "空托盘组入库"); - typeMap.put("1200", "空托盘组出库"); - typeMap.put("1300", "空托盘组换站"); - - HashMap<String, String> statusMap = new HashMap<>(); - statusMap.put("1", "生成任务"); - statusMap.put("10", "下发任务"); - statusMap.put("50", "到达拣选台"); - statusMap.put("100", "任务完成"); - - LambdaQueryWrapper<TaskHeader> hQuery = Wrappers.lambdaQuery(); - hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION) - .in(stationList.size() > 0, TaskHeader::getToPortCode, stationList); - List<TaskHeader> headers = taskHeaderService.list(hQuery); - - List<TvTaskVo> list = new ArrayList<>(); - for (TaskHeader header : headers) { - header.setUserdef1(typeMap.get(header.getTaskType().toString())); - header.setUserdef2(statusMap.get(header.getStatus().toString())); - TvTaskVo vo = new TvTaskVo(); - LambdaQueryWrapper<TaskDetail> dQuery = Wrappers.lambdaQuery(); - dQuery.eq(TaskDetail::getTaskHeaderId, header.getId()); - List<TaskDetail> details = taskDetailService.list(dQuery); - - vo.setTaskHeader(header); - vo.setTaskDetailList(details); - list.add(vo); - } - return Result.OK("", list); - } @PostMapping("/getUpdateApkInfo") @ApiOperation("获取apk更新信息") diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java new file mode 100644 index 0000000..f310b68 --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java @@ -0,0 +1,89 @@ +package org.jeecg.modules.wms.api.tv; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import io.swagger.annotations.Api; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.wms.api.mobile.entity.TvTaskVo; +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; +import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl; +import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl; +import org.jeecg.utils.StringUtils; +import org.jeecg.utils.constant.QuantityConstant; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +/** + */ +@Api(tags = "Mobile") +@RestController +@RequestMapping("/api/tv") +public class TvController { + + @Value(value = "${server.servlet.context-path}") + private String ctx; + + @Resource + private TaskHeaderServiceImpl taskHeaderService; + + @Resource + private TaskDetailServiceImpl taskDetailService; + + @GetMapping("taskOfStation") + public Result<List<TvTaskVo>> importExcel(String code) { + List<String> stationList = new ArrayList<>(); + if (StringUtils.isNotEmpty(code)) { + stationList = Arrays.asList(code.split(",")); + } + + HashMap<String, String> typeMap = new HashMap<>(); + typeMap.put("100", "整盘入库"); + typeMap.put("200", "补充入库"); + typeMap.put("300", "整盘出库"); + typeMap.put("400", "分拣出库"); + typeMap.put("500", "空容器入库"); + typeMap.put("600", "空容器出库"); + typeMap.put("700", "盘点"); + typeMap.put("800", "移库"); + typeMap.put("900", "出库查看"); + typeMap.put("1000", "换站"); + typeMap.put("1100", "空托盘组入库"); + typeMap.put("1200", "空托盘组出库"); + typeMap.put("1300", "空托盘组换站"); + + HashMap<String, String> statusMap = new HashMap<>(); + statusMap.put("1", "生成任务"); + statusMap.put("10", "下发任务"); + statusMap.put("50", "到达拣选台"); + statusMap.put("100", "任务完成"); + + LambdaQueryWrapper<TaskHeader> hQuery = Wrappers.lambdaQuery(); + hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION) + .in(stationList.size() > 0, TaskHeader::getToPortCode, stationList); + List<TaskHeader> headers = taskHeaderService.list(hQuery); + + List<TvTaskVo> list = new ArrayList<>(); + for (TaskHeader header : headers) { + header.setUserdef1(typeMap.get(header.getTaskType().toString())); + header.setUserdef2(statusMap.get(header.getStatus().toString())); + TvTaskVo vo = new TvTaskVo(); + LambdaQueryWrapper<TaskDetail> dQuery = Wrappers.lambdaQuery(); + dQuery.eq(TaskDetail::getTaskHeaderId, header.getId()); + List<TaskDetail> details = taskDetailService.list(dQuery); + + vo.setTaskHeader(header); + vo.setTaskDetailList(details); + list.add(vo); + } + return Result.OK("", list); + } +} -- libgit2 0.22.2