From cc12f7e7ec1744df2158dd6fc7bede460366a738 Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 18 May 2022 23:39:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=8A=98=EC=9D=98=20=EC=8B=9D?= =?UTF-8?q?=ED=92=88=EA=B5=B0=20=EC=98=81=EC=96=91=EC=86=8C=20=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/FoodScoreCalculation.java | 45 ++++++++++++++----- .../logic/NutrientScoreCalculation.java | 6 ++- .../views/ftl/m/bf_growth/food_balance.ftl | 3 +- .../ftl/m/bf_growth/nutrient_balance.ftl | 2 +- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/backoffice/logic/FoodScoreCalculation.java b/src/main/java/com/backoffice/logic/FoodScoreCalculation.java index 6126d26..922bef5 100644 --- a/src/main/java/com/backoffice/logic/FoodScoreCalculation.java +++ b/src/main/java/com/backoffice/logic/FoodScoreCalculation.java @@ -150,7 +150,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food1(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(dqi_food_1>0 && dqi_food_2>0) return 5; else if(dqi_food_1>0) return 15; else return 0; @@ -166,7 +168,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food2(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(dqi_food_2>0) return 5; else return 0; }if(label==1) { @@ -205,7 +209,9 @@ public class FoodScoreCalculation { private double get_dqi_food4(double x) { // 0~5M은 곡물, 통곡물을 곡류로 합쳐 계산 // 둘 중 하나라도 섭취하면 5점 배점 - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(x>0 || dqi_food_5>0) return 0; else return 5; }else if(label==1) { @@ -238,7 +244,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food5(double x) { - if(label==1) { + if( x ==0 ) + return 0; + else if(label==1) { if(x<=29.56) return 2.5; else if(x<=59.15) return 1.25; else return 0; @@ -264,7 +272,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food6(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(x>0) return 0; else return 5; }else if(label==1) { @@ -297,7 +307,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food7(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(x>0) return 0; else return 5; }else if(label==1) { @@ -326,7 +338,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food8(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(x>0) return 0; else return 5; }else if(label==1) { @@ -355,7 +369,10 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food9(double x) { - if(label==0) { + + if( x ==0 ) + return 0; + else if(label==0) { if(x>0) return 0; else return 5; }else if(label==1) { @@ -384,7 +401,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food10(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(x>0) return 0; else return 5; }else if(label==1) { @@ -413,7 +432,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food11(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(x>0) return 0; else return 5; }else if(label==1) { @@ -442,7 +463,9 @@ public class FoodScoreCalculation { * @return */ private double get_dqi_food12(double x) { - if(label==0) { + if( x ==0 ) + return 0; + else if(label==0) { if(x>0) return 0; else return 5; }else if(label==1) { diff --git a/src/main/java/com/backoffice/logic/NutrientScoreCalculation.java b/src/main/java/com/backoffice/logic/NutrientScoreCalculation.java index 6027aad..13934a4 100644 --- a/src/main/java/com/backoffice/logic/NutrientScoreCalculation.java +++ b/src/main/java/com/backoffice/logic/NutrientScoreCalculation.java @@ -417,7 +417,8 @@ public class NutrientScoreCalculation { */ private double getSugarValue(double x, double from) { double result = 0; - if(x<=from) + //if(x<=from) + if(x>=from) result = 100; else if (from=from) result = 100; else if (from
+ <#if (model['rm_child']['m']>5)&&(model['rm_child']['m']<60)> - 자세히 보기 > +

오늘의 식품군

자세히 보기 >
  • diff --git a/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/nutrient_balance.ftl b/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/nutrient_balance.ftl index b6e9006..c49286f 100644 --- a/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/nutrient_balance.ftl +++ b/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/nutrient_balance.ftl @@ -71,7 +71,7 @@
    <#if (model['rm_child']['m']<60)> - 자세히 보기 > +

    오늘의 영양소

    자세히 보기 >