Commit b210986db31824e5abb536936f0c1bd5257db2a3

Authored by liquanyu
1 parent 79725fbd13

大同三打印

Showing 1 changed file with 80 additions and 65 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ b210986
... ... @@ -7933,93 +7933,108 @@
7933 7933 return br;
7934 7934 }
7935 7935  
7936   - AntenatalExaminationModel data = antExService.findOneById(id);
7937   - if (data == null || data.getYn() == YnEnums.NO.getId()) {
  7936 + AntenatalExaminationModel model = antExService.findOneById(id);
  7937 + if (model == null || model.getYn() == YnEnums.NO.getId()) {
7938 7938 br.setErrorcode(ErrorCodeConstants.NO_DATA);
7939 7939 br.setErrormsg("没有查询到数据");
7940 7940 return br;
7941 7941 }
7942 7942  
7943 7943  
7944   - Patients patients = patientsService.findOnePatientById(data.getParentId());
  7944 + Patients patients = patientsService.findOnePatientById(model.getParentId());
7945 7945 if (patients == null || patients.getYn() == YnEnums.NO.getId()) {
7946 7946 br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
7947 7947 br.setErrormsg("孕妇信息不存在");
7948 7948 return br;
7949 7949 }
  7950 + AntExQuery antExQuery = new AntExQuery();
  7951 + antExQuery.setYn(YnEnums.YES.getId());
  7952 + antExQuery.setPid(patients.getPid());
  7953 + antExQuery.setParentId(patients.getId());
  7954 + List<AntenatalExaminationModel> datas =
  7955 + antenatalExaminationService.queryAntenatalExamination(
  7956 + antExQuery.convertToQuery().addOrder(Sort.Direction.ASC, "created"));
7950 7957  
7951   - Map<String, Object> map = new LinkedHashMap<>();
  7958 + List<Map<String, Object>> results = new ArrayList<>();
  7959 + if (CollectionUtils.isNotEmpty(datas))
  7960 + {
  7961 + for (AntenatalExaminationModel data : datas)
  7962 + {
  7963 + Map<String, Object> map = new LinkedHashMap<>();
7952 7964  
7953   -
7954   - //产检基本信息
7955   - map.put("userName", patients.getUsername());
7956   - map.put("lastMenses", DateUtil.getyyyy_MM_dd(patients.getLastMenses()));
7957   - map.put("checkWeek", DateUtil.getWeekDesc(patients.getLastMenses(),data.getCheckDate()));
7958   - // 血压
7959   - String ssy = "";
7960   - String szy = "";
7961   - Map<String, String> chBpMap = JsonUtil.getMap(data.getBp());
7962   - if (MapUtils.isNotEmpty(chBpMap)) {
7963   - ssy = chBpMap.get("ssy");
7964   - szy = chBpMap.get("szy");
7965   - }
7966   - map.put("bp", ssy + "/" + szy);
7967   - map.put("weight", data.getWeight());
7968   - map.put("urineProtein", data.getUrineProtein()); //尿蛋白
7969   - map.put("hemoglobin", data.getHemoglobin()); //血红蛋白
7970   - String edema = "";
7971   - if (StringUtils.isNotEmpty(data.getEdema())) {
7972   - for (FuZhongEnums fuZhongEnums : FuZhongEnums.values()) {
7973   - if (data.getEdema().equals(fuZhongEnums.getId())) {
7974   - edema = fuZhongEnums.getName();
  7965 + //产检基本信息
  7966 + map.put("userName", patients.getUsername());
  7967 + map.put("lastMenses", DateUtil.getyyyy_MM_dd(patients.getLastMenses()));
  7968 + map.put("checkWeek", DateUtil.getWeekDesc(patients.getLastMenses(),data.getCheckDate()));
  7969 + // 血压
  7970 + String ssy = "";
  7971 + String szy = "";
  7972 + Map<String, String> chBpMap = JsonUtil.getMap(data.getBp());
  7973 + if (MapUtils.isNotEmpty(chBpMap)) {
  7974 + ssy = chBpMap.get("ssy");
  7975 + szy = chBpMap.get("szy");
7975 7976 }
7976   - }
7977   - }
7978   - map.put("edema", edema);//浮肿
7979   - String gongGao = "";
7980   - if (StringUtils.isNotEmpty(data.getGongGaoSelect())) {
7981   - if (StringUtils.isNotEmpty(data.getGongGaoType())) {
7982   - gongGao = GongJingEnums.getGongGaoNameById(data.getGongGaoSelect()) + "," + GongJingEnums.getHengZhiNameById(data.getGongGaoType());
7983   - } else {
7984   - gongGao = GongJingEnums.getGongGaoNameById(data.getGongGaoSelect());
7985   - }
7986   - } else if (StringUtils.isNotEmpty(data.getGongGao())) {
7987   - gongGao = data.getGongGao() ==null ? "" : data.getGongGao();
7988   - }
  7977 + map.put("bp", ssy + "/" + szy);
  7978 + map.put("weight", data.getWeight());
  7979 + map.put("urineProtein", data.getUrineProtein()); //尿蛋白
  7980 + map.put("hemoglobin", data.getHemoglobin()); //血红蛋白
  7981 + String edema = "";
  7982 + if (StringUtils.isNotEmpty(data.getEdema())) {
  7983 + for (FuZhongEnums fuZhongEnums : FuZhongEnums.values()) {
  7984 + if (data.getEdema().equals(fuZhongEnums.getId())) {
  7985 + edema = fuZhongEnums.getName();
  7986 + }
  7987 + }
  7988 + }
  7989 + map.put("edema", edema);//浮肿
  7990 + String gongGao = "";
  7991 + if (StringUtils.isNotEmpty(data.getGongGaoSelect())) {
  7992 + if (StringUtils.isNotEmpty(data.getGongGaoType())) {
  7993 + gongGao = GongJingEnums.getGongGaoNameById(data.getGongGaoSelect()) + "," + GongJingEnums.getHengZhiNameById(data.getGongGaoType());
  7994 + } else {
  7995 + gongGao = GongJingEnums.getGongGaoNameById(data.getGongGaoSelect());
  7996 + }
  7997 + } else if (StringUtils.isNotEmpty(data.getGongGao())) {
  7998 + gongGao = data.getGongGao() ==null ? "" : data.getGongGao();
  7999 + }
7989 8000  
7990   - map.put("gf", gongGao+(data.getAbdominalCircumference() == null ? "" : "/"+data.getAbdominalCircumference()));
7991   - //胎儿情况
7992   - String heartRate = "";
7993   - String fetalPosition = "";
7994   - String fetalPresentation = "";
7995   - if (CollectionUtils.isNotEmpty(data.getTireData())) {
7996   - for (Object temp : data.getTireData()) {
7997   - Map<String, Object> tire = (Map<String, Object>) temp;
7998   - if (tire != null) {
7999   - heartRate = tire.get("heartRate") == null ? "" : String.valueOf(tire.get("heartRate"));
8000   - fetalPosition = tire.get("fetalPosition") == null ? "" : FetalPositionEnums.getTitle(String.valueOf(tire.get("fetalPosition")));
8001   - fetalPresentation = tire.get("fetalPresentation") == null ? "" : FetalEnums.getTitle(String.valueOf(tire.get("fetalPresentation")));
  8001 + map.put("gf", gongGao+(data.getAbdominalCircumference() == null ? "" : "/"+data.getAbdominalCircumference()));
  8002 + //胎儿情况
  8003 + String heartRate = "";
  8004 + String fetalPosition = "";
  8005 + String fetalPresentation = "";
  8006 + if (CollectionUtils.isNotEmpty(data.getTireData())) {
  8007 + for (Object temp : data.getTireData()) {
  8008 + Map<String, Object> tire = (Map<String, Object>) temp;
  8009 + if (tire != null) {
  8010 + heartRate = tire.get("heartRate") == null ? "" : String.valueOf(tire.get("heartRate"));
  8011 + fetalPosition = tire.get("fetalPosition") == null ? "" : FetalPositionEnums.getTitle(String.valueOf(tire.get("fetalPosition")));
  8012 + fetalPresentation = tire.get("fetalPresentation") == null ? "" : FetalEnums.getTitle(String.valueOf(tire.get("fetalPresentation")));
  8013 + }
  8014 + }
8002 8015 }
8003   - }
8004   - }
8005 8016  
8006   - map.put("fetalPosition", fetalPosition);//胎方位
8007   - map.put("heartRate", heartRate);//胎心
8008   - map.put("fetalPresentation", fetalPresentation); //先露
8009   - map.put("bamnio", data.getBamnio());// 羊水
  8017 + map.put("fetalPosition", fetalPosition);//胎方位
  8018 + map.put("heartRate", heartRate);//胎心
  8019 + map.put("fetalPresentation", fetalPresentation); //先露
  8020 + map.put("bamnio", data.getBamnio());// 羊水
8010 8021  
8011 8022  
8012   - map.put("handle",data.getSecondaryDiagnosis());//处置
8013   - String checkDoctor = "";
8014   - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getCheckDoctor())) {
8015   - Users users = usersService.getUsers(Integer.parseInt(data.getCheckDoctor()));
8016   - if (users != null && users.getYn() == YnEnums.YES.getId()) {
8017   - checkDoctor = users.getName();
  8023 + map.put("handle",data.getSecondaryDiagnosis());//处置
  8024 + String checkDoctor = "";
  8025 + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getCheckDoctor())) {
  8026 + Users users = usersService.getUsers(Integer.parseInt(data.getCheckDoctor()));
  8027 + if (users != null && users.getYn() == YnEnums.YES.getId()) {
  8028 + checkDoctor = users.getName();
  8029 + }
  8030 + }
  8031 + map.put("checkDoctor", checkDoctor);
  8032 +
  8033 + results.add(map);
8018 8034 }
8019 8035 }
8020   - map.put("checkDoctor", checkDoctor);
8021 8036  
8022   - return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(map);
  8037 + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(results);
8023 8038 }
8024 8039 }