浏览代码

年龄模版处理

chengyao 4 年之前
父节点
当前提交
22a1ee5aed
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

+ 6 - 2
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -584,8 +584,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     }
                     homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0":homePage.getNewbornDay());
                 }else if("天".equals(ageUnitString)||"日".equals(ageUnitString)){
-                    homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
-                    homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? homePage.getAge() : homePage.getNewbornDay());
+                    if(StringUtils.isEmpty(homePage.getNewbornMonth())&&StringUtils.isEmpty(homePage.getNewbornDay())){
+                        homePage.setNewbornDay(homePage.getAge());
+                    }else{
+                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
+                        homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0" : homePage.getNewbornDay());
+                    }
                 }
                 else if("时".equals(ageUnitString)){
                     homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());