liurunyu
2025-08-27 1bbde5dfffbf69f75c3cab93f4a329dc83e7fd3e
蒸腾量测试计算中后端增加计算日序功能接口
1个文件已修改
22 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/vapor/TestCtrl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
    }
}