From 32c7954ea2b5aa05b19bbaed4da14ae406e65c99 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 29 八月 2025 11:16:42 +0800 Subject: [PATCH] 使一个水肥机的历史数据查询支持一天的时间范围内查询 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/manure/ManureCtrl.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 51 insertions(+), 6 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/manure/ManureCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/manure/ManureCtrl.java index 1b6f71b..edce92b 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/manure/ManureCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/manure/ManureCtrl.java @@ -35,15 +35,43 @@ } /** + * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏈�鏂拌褰� + * @param manureId + * @return + */ + @GetMapping(path = "oneLast") + @SsoAop() + public BaseResponse<VoManure> oneLast(Long manureId){ + try { + if(manureId == null){ + return BaseResponseUtils.buildFail("姘磋偉鏈篿d涓嶈兘涓虹┖") ; + } + return BaseResponseUtils.buildSuccess(sv.oneLast(manureId)); + } catch (Exception e) { + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍 * @param qo * @return */ - @GetMapping(path = "history") + @GetMapping(path = "oneHistory") @SsoAop() - public BaseResponse<QueryResultVo<List<VoManure>>> selectHistory(ManureQo qo){ + public BaseResponse<QueryResultVo<List<VoManure>>> oneHistory(ManureQo qo){ try { - return BaseResponseUtils.buildSuccess(sv.selectHistory(qo)); + if(qo.manureId == null){ + return BaseResponseUtils.buildFail("姘磋偉鏈篿d涓嶈兘涓虹┖") ; + } + String dtStart = qo.timeStart ; + qo.completionTime(); + if(qo.timeStop == null || qo.timeStop.trim().equals("")){ + if(dtStart != null && !dtStart.trim().equals("")){ + qo.timeStop = dtStart + " 23:59:59"; + } + } + return BaseResponseUtils.buildSuccess(sv.oneHistory(qo)); } catch (Exception e) { return BaseResponseUtils.buildException(e.getMessage()) ; } @@ -54,11 +82,28 @@ * @param qo * @return */ - @GetMapping(path = "last") + @GetMapping(path = "someLast") @SsoAop() - public BaseResponse<QueryResultVo<List<VoManure>>> selectLast(ManureQo qo){ + public BaseResponse<QueryResultVo<List<VoManure>>> someLast(ManureQo qo){ try { - return BaseResponseUtils.buildSuccess(sv.selectLast(qo)); + qo.completionTime(); + return BaseResponseUtils.buildSuccess(sv.someLast(qo)); + } catch (Exception e) { + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍 + * @param qo + * @return + */ + @GetMapping(path = "someHistory") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoManure>>> someHistory(ManureQo qo){ + try { + qo.completionTime(); + return BaseResponseUtils.buildSuccess(sv.someHistory(qo)); } catch (Exception e) { return BaseResponseUtils.buildException(e.getMessage()) ; } -- Gitblit v1.8.0