liurunyu
5 天以前 44eb64bef08ce231ac95d5ee482b046014dc8afa
pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/vapor/TestCtrl.java
@@ -14,11 +14,11 @@
/**
 * @Author: liurunyu
 * @Date: 2025/8/22 10:20
 * @Description 不要删除!!! 为前端蒸腾量计算提供的服务
 * @Description 不要删除!!! 为前端蒸散量计算提供的服务
 */
@Slf4j
@Tag(name = "作物日蒸腾量计算测试", description = "作物日蒸腾量计算测试")
@Tag(name = "作物日蒸散量计算测试", description = "作物日蒸散量计算测试")
@RestController
@RequestMapping(path = "mdTest")
public class TestCtrl {
@@ -51,7 +51,23 @@
            }
            return BaseResponseUtils.buildSuccess(vo);
        } catch (Exception e) {
            log.error("查询所有作物的昨日蒸腾量异常", e);
            log.error("查询所有作物的昨日蒸散量异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 计算日序
     */
    @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()) ;
        }
    }
@@ -73,8 +89,14 @@
            Double et0 = Hargreaves.ET0(qo.kc, qo.maxTmp, qo.minTmp, zenithRadiation);
            return BaseResponseUtils.buildSuccess(et0);
        } catch (Exception e) {
            log.error("查询所有作物的昨日蒸腾量异常", e);
            log.error("查询所有作物的昨日蒸散量异常", e);
            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);
    }
}