From 3643a93230dbed9fdd876a5ef0aefb37c6aa34b1 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期一, 22 一月 2024 09:27:54 +0800 Subject: [PATCH] #堆垛机状态接口 --- src/main/java/com/zy/asrs/controller/OpenController.java | 68 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/OpenController.java b/src/main/java/com/zy/asrs/controller/OpenController.java index ba92e46..7ba2f1c 100644 --- a/src/main/java/com/zy/asrs/controller/OpenController.java +++ b/src/main/java/com/zy/asrs/controller/OpenController.java @@ -48,6 +48,8 @@ @Autowired private StaDescService staDescService; + @Autowired + private BasCrnpService basCrnpService; @Value("${wms.url}") private String wmsUrl; @@ -365,6 +367,72 @@ } } + @PostMapping("/getCrnStatus") + public R getCrnStatus(HttpServletRequest request) { + List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>()); + if (Cools.isEmpty(basCrnps)){ + return R.error("鏁版嵁搴撳紓甯革紝鍫嗗灈鏈哄垪琛ㄤ负绌�"); + } + List<Integer> crnStatusDtos = new ArrayList<>(); + for (BasCrnp basCrnp : basCrnps){ + CrnStatusDto crnStatusDto = new CrnStatusDto(); + crnStatusDto.setCrnNo(basCrnp.getCrnNo()); + if (basCrnp.getOutEnable().equals("N")){ + continue; + } + if (basCrnp.getCrnErr() != 0){ + continue; + } + if (basCrnp.getCrnSts() != 3){ + continue; + } + + crnStatusDtos.add(basCrnp.getCrnNo()); + + + } + + return R.ok(crnStatusDtos); + } + +// @PostMapping("/getCrnStatus") +// public R getCrnStatus(HttpServletRequest request) { +// List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>()); +// if (Cools.isEmpty(basCrnps)){ +// return R.error("鏁版嵁搴撳紓甯革紝鍫嗗灈鏈哄垪琛ㄤ负绌�"); +// } +// List<CrnStatusDto> crnStatusDtos = new ArrayList<>(); +// for (BasCrnp basCrnp : basCrnps){ +// CrnStatusDto crnStatusDto = new CrnStatusDto(); +// crnStatusDto.setCrnNo(basCrnp.getCrnNo()); +// if (basCrnp.getOutEnable().equals("N")){ +// crnStatusDto.setCrnStatus(500); +// crnStatusDto.setCrnErrMsg("鍫嗗灈鏈哄嚭搴撹绂佺敤"); +// crnStatusDtos.add(crnStatusDto); +// continue; +// } +// if (basCrnp.getCrnErr() != 0){ +// crnStatusDto.setCrnStatus(500); +// crnStatusDto.setCrnErrMsg("鍫嗗灈鏈哄浜庢姤璀︾姸鎬�"); +// crnStatusDtos.add(crnStatusDto); +// continue; +// } +// if (basCrnp.getCrnSts() != 3){ +// crnStatusDto.setCrnStatus(500); +// crnStatusDto.setCrnErrMsg("鍫嗗灈鏈哄浜庨潪鑷姩鐘舵��"); +// crnStatusDtos.add(crnStatusDto); +// continue; +// } +// +// crnStatusDto.setCrnStatus(200); +// crnStatusDto.setCrnErrMsg(""); +// crnStatusDtos.add(crnStatusDto); +// +// +// } +// +// return R.ok(crnStatusDtos); +// } } -- Gitblit v1.9.1