diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java index 6ff7d4b..0eeda1e 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java @@ -83,17 +83,20 @@ public class QhdJbgwInterface { try{ patients = getMainPatient(patients.getId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization == null || StringUtils.isEmpty(organization.getTownOrgId())) { continue; } + + + //居住地址 String jzSheng = CommonsHelper.getName1(patients.getProvinceRegisterId(), basicConfigService); String jzShi = CommonsHelper.getName1(patients.getCityRegisterId(), basicConfigService); @@ -180,8 +183,8 @@ public class QhdJbgwInterface { map.put("MENSESLASTDATE",DateUtil.getyyyy_MM_dd(patients.getLastMenses())); map.put("EXPECTEDCHILDBIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getDueDate())); - map.put("ORGNAME",basicConfig.getName()); - map.put("ORGCODE",basicConfig.getId()); + map.put("ORGNAME",organization.getName()); + map.put("ORGCODE",organization.getTownOrgId()); map.put("BUILDINGMANUALDATE",DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); map.put("NATIONALITYVALUE",getBasicConfig(patients.getPnationId())); map.put("BUILDWEEKS", ResolveUtils.getPregnancyWeek(patients, patients.getBookbuildingDate())); @@ -227,13 +230,14 @@ public class QhdJbgwInterface { Map map = new HashMap(); Patients patients = getMainPatient(antExChuModel.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization == null || StringUtils.isEmpty(organization.getTownOrgId())) { continue; } @@ -299,8 +303,8 @@ public class QhdJbgwInterface { map.put("MENSESLASTDATE",DateUtil.getyyyy_MM_dd(patients.getLastMenses())); map.put("EXPECTEDCHILDBIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getDueDate())); - map.put("ORGNAME",basicConfig.getName()); - map.put("ORGCODE",basicConfig.getId()); + map.put("ORGNAME",organization.getName()); + map.put("ORGCODE",organization.getTownOrgId()); map.put("BUILDINGMANUALDATE",DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); map.put("NATIONALITYVALUE",getBasicConfig(patients.getPnationId())); map.put("BUILDWEEKS", ResolveUtils.getPregnancyWeek(patients, patients.getBookbuildingDate())); @@ -637,13 +641,13 @@ public class QhdJbgwInterface { try{ Patients patients = getMainPatient(data.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization == null || StringUtils.isEmpty(organization.getTownOrgId())) { continue; } @@ -693,9 +697,9 @@ public class QhdJbgwInterface { } } map.put("FOLLOWUPDOCTORNAME",checkDoctor); - map.put("ORGCODE",basicConfig.getId()); + map.put("ORGCODE",organization.getTownOrgId()); - map.put("ORGNAME",basicConfig.getName()); + map.put("ORGNAME",organization.getName()); mList.add(map); }catch (Exception e){ @@ -738,13 +742,13 @@ public class QhdJbgwInterface { for(MaternalDeliverModel data : allList) { Patients patients = getMainPatient(data.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization1 = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization1 == null || StringUtils.isEmpty(organization1.getTownOrgId())) { continue; } @@ -984,9 +988,9 @@ public class QhdJbgwInterface { } }*/ - map.put("ORGCODE", basicConfig.getId()); + map.put("ORGCODE", organization1.getTownOrgId()); - map.put("ORGNAME", basicConfig.getName()); + map.put("ORGNAME", organization1.getName()); mList.add(map); } @@ -1031,13 +1035,13 @@ public class QhdJbgwInterface { try{ Patients patients = getMainPatient(babyModel.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization1 = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization1 == null || StringUtils.isEmpty(organization1.getTownOrgId())) { continue; } @@ -1075,9 +1079,9 @@ public class QhdJbgwInterface { map.put("BABYAPGAR1",map1.get("pf1").toString()); map.put("BABYAPGAR5",map1.get("pf5").toString()); } - map.put("ORGCODE",basicConfig.getId()); + map.put("ORGCODE",organization1.getTownOrgId()); - map.put("ORGNAME",basicConfig.getName()); + map.put("ORGNAME",organization1.getName()); mList.add(map); }catch (Exception e){ @@ -1129,13 +1133,13 @@ public class QhdJbgwInterface { Patients patients = getMainPatient(md.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization1 = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization1 == null || StringUtils.isEmpty(organization1.getTownOrgId())) { continue; } @@ -1226,8 +1230,8 @@ public class QhdJbgwInterface { } } map.put("FOLLOWUPDOCTORNAME",checkDoctor); - map.put("ORGCODE",basicConfig.getId()); - map.put("ORGNAME",basicConfig.getName()); + map.put("ORGCODE",organization1.getTownOrgId()); + map.put("ORGNAME",organization1.getName()); mList.add(map); }catch (Exception e){ @@ -1273,13 +1277,13 @@ public class QhdJbgwInterface { try{ Patients patients = getMainPatient(data.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization1 = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization1 == null || StringUtils.isEmpty(organization1.getTownOrgId())) { continue; } @@ -1343,8 +1347,8 @@ public class QhdJbgwInterface { } } map.put("FOLLOWUPDOCTORNAME",checkDoctor); - map.put("ORGCODE",basicConfig.getId()); - map.put("ORGNAME",basicConfig.getName()); + map.put("ORGCODE",organization1.getTownOrgId()); + map.put("ORGNAME",organization1.getName()); mList.add(map); @@ -1385,13 +1389,13 @@ public class QhdJbgwInterface { //获取母亲基本信息 Patients patients = getMainPatient(model.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization1 = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization1 == null || StringUtils.isEmpty(organization1.getTownOrgId())) { continue; } @@ -1677,9 +1681,9 @@ public class QhdJbgwInterface { if(newbornVisit.getNextVisitTimeDesc() != null){ map.put("NEXTVISITDATE",DateUtil.getyyyy_MM_dd(newbornVisit.getNextVisitTimeDesc())); } - map.put("ORGCODE",basicConfig.getId()); + map.put("ORGCODE",organization1.getTownOrgId()); - map.put("ORGNAME",basicConfig.getName()); + map.put("ORGNAME",organization1.getName()); if(newbornVisit.getSpine() != null){ if("未见异常".equals(newbornVisit.getSpine())){ map.put("SPINEABNORMCODE","1"); @@ -1743,13 +1747,13 @@ public class QhdJbgwInterface { //获取母亲基本信息 Patients patients = getMainPatient(babyModel.getParentId()); - if (patients == null || StringUtils.isEmpty(patients.getTownOrgId())) + if (patients == null || StringUtils.isEmpty(patients.getTownOrgId()) || !StringUtils.isNumeric(patients.getTownOrgId())) { continue; } - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(patients.getTownOrgId()); - if (basicConfig == null) + Organization organization1 = organizationService.getOrganization(Integer.parseInt(patients.getTownOrgId())); + if (organization1 == null || StringUtils.isEmpty(organization1.getTownOrgId())) { continue; } @@ -2128,8 +2132,8 @@ public class QhdJbgwInterface { } } - map.put("ORGCODE",basicConfig.getId()); - map.put("ORGNAME",basicConfig.getName()); + map.put("ORGCODE",organization1.getTownOrgId()); + map.put("ORGNAME",organization1.getName()); mList.add(map); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BasicConfigController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BasicConfigController.java index 2fd9550..2f4ed6c 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BasicConfigController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BasicConfigController.java @@ -165,6 +165,18 @@ public class BasicConfigController extends BaseController { return basicConfigFacade.getQhdBabyDiagnosis(); } + + /** + * 获取工位机构数据 + * @return + */ + @RequestMapping(method = RequestMethod.GET, value = "/getGwOrgs") + @ResponseBody + public BaseObjectResponse getGwOrgs() { + return basicConfigFacade.getGwOrgs(); + } + + /** * 获取高危因素 * diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java index 0e802ed..0cf9306 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java @@ -548,4 +548,30 @@ public class BasicConfigFacade { return new BaseObjectResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); } + + public BaseObjectResponse getGwOrgs() { + + + Map map = new HashMap(); + BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); + basicConfigQuery.setEnable(1); + basicConfigQuery.setTypeId("5cbd67f5f29960ef73349a70"); + + List towns = new ArrayList<>(); + + //所有数据 + List basicConfigList = basicConfigService.queryBasicConfig(basicConfigQuery); + + if (CollectionUtils.isNotEmpty(basicConfigList)) { + for (BasicConfig model : basicConfigList) { + Map data = new HashMap(); + data.put("id", model.getId()); + data.put("name", model.getName()); + towns.add(data); + } + } + + map.put("towns", towns); + return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); + } } \ No newline at end of file