Commit 4866018724d888d2119a9d7348cac982ac58b219

Authored by liquanyu
1 parent 7ab1c55e8d

测量

Showing 1 changed file with 39 additions and 0 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java View file @ 4866018
... ... @@ -11,6 +11,7 @@
11 11 import com.lyms.platform.common.result.RespBuilder;
12 12 import com.lyms.platform.common.utils.DateUtil;
13 13 import com.lyms.platform.common.utils.ExceptionUtils;
  14 +import com.lyms.platform.common.utils.JsonUtil;
14 15 import com.lyms.platform.operate.web.request.MeasureAllInfoRequest;
15 16 import com.lyms.platform.operate.web.request.MeasureBabyInfoRequest;
16 17 import com.lyms.platform.operate.web.request.MeasureInfoRequest;
... ... @@ -28,6 +29,7 @@
28 29 import com.lyms.platform.permission.service.OrganizationService;
29 30 import com.lyms.platform.pojo.*;
30 31 import com.lyms.platform.query.*;
  32 +import net.sf.json.JSONObject;
31 33 import org.apache.commons.collections.CollectionUtils;
32 34 import org.apache.commons.collections.MapUtils;
33 35 import org.apache.commons.dbutils.DbUtils;
... ... @@ -91,6 +93,10 @@
91 93 @Autowired
92 94 private AutoMatchFacade autoMatchFacade;
93 95  
  96 +
  97 + @Autowired
  98 + private ArchiveDataServicer archiveDataServicer;
  99 +
94 100 private static String[] blood_item = new String[]{"--", "--", "--", "--", "--", "--", "--", "--", "--"};
95 101  
96 102 private static Integer MAX_TODAY_COUNT = 10000;
97 103  
... ... @@ -897,7 +903,40 @@
897 903 beforeHeight = chuModel.getHeight() == null ? "" : chuModel.getHeight();
898 904 tireNumber = chuModel.getTireNumber() == null ? "" : chuModel.getTireNumber();
899 905 bmi = chuModel.getBaricIndex() == null ? "" : chuModel.getBaricIndex();
  906 +
  907 +
900 908 }
  909 + }
  910 +
  911 + //如果初诊也没有孕前体重和身高 就在预约建档信息中获取
  912 + if (StringUtils.isEmpty(beforeHeight))
  913 + {
  914 + try {
  915 + ArchiveDataQuery query = new ArchiveDataQuery();
  916 + query.setIdCard(pat.getCardNo());
  917 + List<ArchiveData> list = archiveDataServicer.query(query.convertToQuery());
  918 + if (CollectionUtils.isNotEmpty(list))
  919 + {
  920 + ArchiveData data = list.get(0);
  921 + String json = data.getJsonData();
  922 + if (StringUtils.isNotEmpty(json))
  923 + {
  924 + JSONObject jsonObject = JsonUtil.getObj(json);
  925 + if (jsonObject != null && jsonObject.getJSONObject("history") != null)
  926 + {
  927 + JSONObject historyJsonObj = jsonObject.getJSONObject("history");
  928 +
  929 + beforeWeight = historyJsonObj.get("yqWeight") == null ? "" : historyJsonObj.get("yqWeight").toString();
  930 + beforeHeight = historyJsonObj.get("height") == null ? "" : historyJsonObj.get("height").toString();
  931 + }
  932 + }
  933 + }
  934 + }
  935 + catch (Exception e)
  936 + {
  937 + ExceptionUtils.catchException(e, " 就在预约建档信息中获取错误");
  938 + }
  939 +
901 940 }
902 941  
903 942 patInfo.put("beforeWeight", beforeWeight);