From 1bbde5dfffbf69f75c3cab93f4a329dc83e7fd3e Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 27 八月 2025 15:29:01 +0800
Subject: [PATCH] 蒸腾量测试计算中后端增加计算日序功能接口
---
pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/vapor/TestCtrl.java | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/vapor/TestCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/vapor/TestCtrl.java
index d018757..d428097 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/vapor/TestCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/vapor/TestCtrl.java
@@ -56,6 +56,22 @@
}
}
+ /**
+ * 璁$畻鏃ュ簭
+ */
+ @GetMapping(path = "dateIndex")
+ @SsoAop()
+ public BaseResponse<Integer> dateIndex(String y_m_d){
+ try {
+ Long days = DateTime.daysBetweenyyyy_MM_dd(y_m_d, y_m_d.substring(0, 4) + "-01-01");
+ Integer dateIndex = days.intValue() + 1 ;
+ return BaseResponseUtils.buildSuccess(dateIndex);
+ } catch (Exception e) {
+ log.error("璁$畻鏃ュ簭寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
@PostMapping(path = "calculate", consumes = MediaType.APPLICATION_JSON_VALUE)
@SsoAop()
public BaseResponse<Double> calculate(@RequestBody TestQo qo){
@@ -77,4 +93,10 @@
return BaseResponseUtils.buildException(e.getMessage()) ;
}
}
+
+ public static void main(String[] args) {
+ String ymd = "2025-08-22" ;
+ String year = ymd.substring(0, 4) ;
+ System.out.println(year);
+ }
}
--
Gitblit v1.8.0