Bläddra i källkod

Merge branch 'dev/20201123_1.4.8'

chengyao 4 år sedan
förälder
incheckning
f907b126ec
1 ändrade filer med 42 tillägg och 0 borttagningar
  1. 42 0
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

+ 42 - 0
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -38,6 +38,7 @@ import com.diagbot.vo.TaskVO;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -562,6 +563,47 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         List<HomeDiagnoseInfo> homePageList = new ArrayList<>();
         List<HomeOperationInfo> homeOperationInfoList = new ArrayList<>();
         if (homePage != null) {
+            if(StringUtils.isNotEmpty(homePage.getAge())){
+                //兼容数据库出现 .03岁数据 作后期判断处理
+                String ageData = homePage.getAge();
+                String ageUnitString = homePage.getAgeUnit() == null ? "" : homePage.getAgeUnit();
+                if(homePage.getAge().contains(".")&&"岁".equals(ageUnitString)){
+                    String ageString = homePage.getAge().split("\\.")[0];
+                    //该年龄作为判断使用
+                    homePage.setAge(StringUtils.isEmpty(ageString)==true? "0"+homePage.getAge():homePage.getAge());
+                }
+                //根据时间单位对模版年龄进行区分
+                if(Double.parseDouble(homePage.getAge())<=1&& "岁".equals(ageUnitString)){
+                    homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
+                    homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0":homePage.getNewbornDay());
+                }else if("月".equals(ageUnitString)){
+                    if(StringUtils.isEmpty(homePage.getNewbornDay())==true){
+                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? homePage.getAge() : homePage.getNewbornMonth());
+                    }else if(StringUtils.isEmpty(homePage.getNewbornMonth())==true&&StringUtils.isEmpty(homePage.getNewbornDay())==false){
+                        homePage.setNewbornMonth("0");
+                    }
+                    homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0":homePage.getNewbornDay());
+                }else if("天".equals(ageUnitString)||"日".equals(ageUnitString)){
+                    if(StringUtils.isEmpty(homePage.getNewbornMonth())&&StringUtils.isEmpty(homePage.getNewbornDay())){
+                        homePage.setNewbornDay(homePage.getAge());
+                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
+                    }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());
+                    homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0":homePage.getNewbornDay());
+                }else if(Double.parseDouble(homePage.getAge())>1&& "岁".equals(ageUnitString)){
+                    homePage.setNewbornMonth("-");
+                    homePage.setNewbornDay("-");
+                }
+                homePage.setAge(ageData+(StringUtils.isEmpty(homePage.getAgeUnit())==true ? "":homePage.getAgeUnit()));
+
+            }
+            //去掉年龄单位
+            homePage.setAgeUnit("");
             // 获取首页出院诊断、病理诊断
             homePageList = homeDiagnoseInfoFacade.list(new QueryWrapper<HomeDiagnoseInfo>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())