外食计算器功能优化修改

This commit is contained in:
xiezhijun
2021-02-20 19:38:17 +08:00
parent afdee0abdf
commit 3f3fcda862
15 changed files with 822 additions and 108 deletions

View File

@ -0,0 +1,20 @@
package com.stdiet.common.utils;
public class HealthyUtils {
public static final double maxHeatEveryDayLess = 250.0;
/**
* 计算每天最大摄入量
* @param age 年龄
* @param tall 身高
* @param weight 体重
* @return
*/
public static long calculateMaxHeatEveryDay(Integer age, Integer tall, Double weight){
age = age == null ? 0 : age;
tall = tall == null ? 0 : tall;
weight = weight == null ? 0.0 : weight;
return Math.round(655+(9.5*weight/2)+(1.8*tall)-(4.7*age) - maxHeatEveryDayLess);
}
}