|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 计算日序 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @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){ | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|