Commit 00ee7cd82e4819f14ec7ffc61fe5e078670b0931
1 parent
4fcea70b39
Exists in
master
and in
6 other branches
桃城区建档2.0 、3.0实时同步
Showing 2 changed files with 169 additions and 70 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
View file @
00ee7cd
... | ... | @@ -123,30 +123,21 @@ |
123 | 123 | * 将来源于v2.0的数据同步到当前版本中 |
124 | 124 | * |
125 | 125 | * @param param |
126 | - | |
126 | + */ | |
127 | 127 | @RequestMapping(method = RequestMethod.POST, value = "/v2/saveOrUpdate") |
128 | 128 | @ResponseBody |
129 | 129 | public BaseResponse saveOrUpdateByV2(@RequestBody SyncV2YunBookbuildingRequest param) { |
130 | - param.setBookbuildingDoctor("2100004880"); | |
131 | - param.setLastMenstrualPeriod(null);//todo | |
132 | - param.setHospitalId("2100001981"); | |
133 | - | |
134 | -// //1、使用JSONObject | |
135 | -// JSONObject json = JSONObject.fromObject(param); | |
136 | -// System.out.println(json); | |
137 | -// String str = "{\"birthday\":\"1999/10/2 0:00:00\",\"bookbuildingDate\":\"2019/6/9 22:44:28\",\"bookbuildingDoctor\":\"1000000185\",\"childExtAddrs\":[],\"childbirthAddr\":\"的规范高大上\",\"childbirthAreaId\":\"169\",\"childbirthCityId\":\"12\",\"childbirthProvinceId\":\"1\",\"childbirthStreetId\":\"2652\",\"couponCode\":\"\",\"couponType\":0,\"delFiles\":[],\"dueDate\":\"\",\"dueStatus\":0,\"expType\":0,\"expVip\":0,\"fileCode\":\"\",\"filePath\":null,\"fillDate\":\"\",\"fuckLastMens\":\"\",\"hdelFiles\":[],\"hospitalId\":\"216\",\"husbandAddressRegister\":\"\",\"husbandAreaRegisterId\":\"\",\"husbandBirth\":\"0001/1/1 0:00:00\",\"husbandCertificateNum\":\"\",\"husbandCertificateTypeId\":\"\",\"husbandCityRegisterId\":\"\",\"husbandCountryId\":\"\",\"husbandLevelTypeId\":\"\",\"husbandName\":\"\",\"husbandNationId\":\"\",\"husbandPhone\":\"\",\"husbandProfessionTypeId\":\"\",\"husbandProvinceRegisterId\":\"\",\"husbandStreetRegisterId\":\"\",\"husbandWorkUnit\":\"\",\"id\":\"\",\"lastMenstrualPeriod\":\"\",\"lastMenstrualPeriodBasis\":\"\",\"lastMenstrualPeriodBasisDate\":\"\",\"lastMenstrualPeriodBasisDoctorId\":\"\",\"lastMenstrualPeriodBasisDoctorName\":\"\",\"lastMenstrualPeriodBasisId\":\"\",\"lastMenstrualPeriodBasisOther\":\"\",\"mensEndDay\":\"\",\"mensStartDay\":\"\",\"mensStopEndDay\":\"\",\"mensStopStartDay\":\"\",\"mremark\":\"\",\"patientSerResults\":[],\"patientdId\":\"\",\"pid\":\"\",\"pregnantCensusAddr\":\"大范甘迪发\",\"pregnantCensusAreaId\":\"169\",\"pregnantCensusCityId\":\"12\",\"pregnantCensusProvinceId\":\"1\",\"pregnantCensusStreetId\":\"2652\",\"pregnantCensusTypeId\":\"非农业户口\",\"pregnantCertificateNum\":\"370784199910027828\",\"pregnantCertificateTypeId\":\"70ae1d93-2964-46bc-83fa-bec9ff605b1c\",\"pregnantCountryId\":\"0da4334f-49e7-4180-b690-5cea668f75e9\",\"pregnantLevelTypeId\":\"\",\"pregnantLiveAddr\":\"第三方十多个\",\"pregnantLiveAreaId\":\"169\",\"pregnantLiveCityId\":\"12\",\"pregnantLiveProvinceId\":\"1\",\"pregnantLiveStreetId\":\"2652\",\"pregnantLiveTypeId\":\"非本地居住一年以下\",\"pregnantName\":\"递四方速递\",\"pregnantNationId\":\"6bfbc869-f27b-4180-8fa6-c0a9b8e4b8df\",\"pregnantPhone\":\"15810205989\",\"pregnantProfessionTypeId\":\"6c685690-2dc7-403b-bf99-f1fd5359c114\",\"pregnantWorkUnit\":\"的观点\",\"reqHusband\":false,\"reqHusbandInt\":2,\"sendCareMan\":\"\",\"sendCoupon\":false,\"serInfos\":[],\"serviceStatus\":0,\"serviceType\":0,\"townOrgId\":\"\",\"userId\":0,\"vcCardNo\":\"5165165\",\"vipEndTime\":\"\"}\n"; | |
138 | -// //1、使用JSONObject | |
139 | -// JSONObject jsonObject=JSONObject.fromObject(str); | |
140 | -// SyncV2YunBookbuildingRequest stu=(SyncV2YunBookbuildingRequest)JSONObject.toBean(jsonObject, SyncV2YunBookbuildingRequest.class); | |
141 | - | |
142 | - | |
130 | + JSONObject json1 = JSONObject.fromObject(param); | |
131 | + System.out.println(json1); | |
132 | + //根据医生姓名获取医生id,默认id=2100004880 | |
133 | + String bookbuildingDoctorid = bookbuildingFacade.getBookbuildingDoctorName(param.getBookbuildingDoctor()); | |
134 | + param.setBookbuildingDoctor(bookbuildingDoctorid); | |
143 | 135 | if (param != null && !StringUtils.isEmpty(param.getId()) ) { |
144 | - return bookbuildingFacade.updatePregnantByIdV2(param.getId(), param, param.getUserId(), false); | |
136 | + return bookbuildingFacade.updatePregnantByIdV2(param.getId(), param, Integer.parseInt(param.getBookbuildingDoctor()), false); | |
145 | 137 | } |
146 | - | |
147 | 138 | return bookbuildingFacade.addPregnantBookbuildingV2(param, Integer.parseInt(param.getBookbuildingDoctor()), false); |
148 | 139 | } |
149 | - */ | |
140 | + | |
150 | 141 | |
151 | 142 | /** |
152 | 143 | * 将v2.0的历史数据保存到当前库中 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
00ee7cd
... | ... | @@ -9,9 +9,12 @@ |
9 | 9 | import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService; |
10 | 10 | import com.lyms.hospitalapi.v2.HisService; |
11 | 11 | import com.lyms.platform.beans.MsgRequest; |
12 | +import com.lyms.platform.biz.dal.IBasicConfigDao; | |
12 | 13 | import com.lyms.platform.biz.service.*; |
13 | 14 | import com.lyms.platform.common.base.PageInfo; |
14 | 15 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
16 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
17 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
15 | 18 | import com.lyms.platform.common.enums.*; |
16 | 19 | import com.lyms.platform.common.result.BaseListResponse; |
17 | 20 | import com.lyms.platform.common.result.BaseObjectResponse; |
... | ... | @@ -25,10 +28,7 @@ |
25 | 28 | import com.lyms.platform.operate.web.worker.CorrectDataWorker; |
26 | 29 | import com.lyms.platform.operate.web.worker.SyncV2HistoryWorkerx; |
27 | 30 | import com.lyms.platform.permission.dao.master.CouponMapper; |
28 | -import com.lyms.platform.permission.model.Organization; | |
29 | -import com.lyms.platform.permission.model.OrganizationQuery; | |
30 | -import com.lyms.platform.permission.model.PatientService; | |
31 | -import com.lyms.platform.permission.model.Users; | |
31 | +import com.lyms.platform.permission.model.*; | |
32 | 32 | import com.lyms.platform.permission.service.CouponService; |
33 | 33 | import com.lyms.platform.permission.service.OrganizationService; |
34 | 34 | import com.lyms.platform.permission.service.UsersService; |
... | ... | @@ -188,6 +188,9 @@ |
188 | 188 | @Autowired |
189 | 189 | private SaveByV2ThreadPoolFacade saveByV2ThreadPoolFacade; |
190 | 190 | |
191 | + @Autowired | |
192 | + private IBasicConfigDao basicConfigDao; | |
193 | + | |
191 | 194 | public static final String syncToV2Url = PropertiesUtils.getPropertyValue("sync_to_v2_url"); |
192 | 195 | |
193 | 196 | |
194 | 197 | |
195 | 198 | |
196 | 199 | |
... | ... | @@ -740,25 +743,34 @@ |
740 | 743 | |
741 | 744 | /* |
742 | 745 | 3.0同步2.0代码注释 |
746 | + */ | |
743 | 747 | try { |
744 | 748 | Thread syncThread = new Thread(new Runnable() { |
745 | 749 | @Override |
746 | 750 | public void run() { |
747 | 751 | RestTemplate restTemplate = new RestTemplate(); |
748 | - HttpHeaders headers = new HttpHeaders(); | |
749 | - headers.setContentType(MediaType.APPLICATION_JSON); | |
752 | + //get参数过多时异常 | |
753 | +// HttpHeaders headers = new HttpHeaders(); | |
754 | +// headers.setContentType(MediaType.APPLICATION_JSON); | |
755 | +// JSONObject jsonObject = getQueryParam(patients); | |
756 | +// Map<String, Object> map = new HashMap<>(); | |
757 | +// map.put("jsonObject", jsonObject); | |
758 | +// ResponseEntity<String> responseEntity = restTemplate.getForEntity(syncToV2Url +"/GetPatient.asmx/GetPatientInfo?data={jsonObject}", String.class, map); | |
759 | +// System.out.println(responseEntity); | |
760 | + | |
750 | 761 | JSONObject jsonObject = getQueryParam(patients); |
751 | - Map<String, Object> map = new HashMap<>(); | |
752 | - map.put("jsonObject", jsonObject); | |
753 | - ResponseEntity<String> responseEntity = restTemplate.getForEntity(syncToV2Url +"/GetPatient.asmx/GetPatientInfo?data={jsonObject}", String.class, map); | |
754 | - System.out.println(responseEntity); | |
762 | + String url=syncToV2Url +"/GetPatient.asmx/GetPatientInfo"; | |
763 | + JSONObject postData = new JSONObject(); | |
764 | + postData.put("data", jsonObject.toJSONString()); | |
765 | + JSONObject json = restTemplate.postForEntity(url, postData, JSONObject.class).getBody(); | |
766 | + //System.out.println(json); | |
755 | 767 | } |
756 | 768 | }); |
757 | 769 | syncThread.start(); |
758 | 770 | } catch (Exception e) { |
759 | 771 | e.printStackTrace(); |
760 | 772 | logger.error("建档数据同步到2.0系统失败", e); |
761 | - }*/ | |
773 | + } | |
762 | 774 | } |
763 | 775 | |
764 | 776 | /** |
765 | 777 | |
766 | 778 | |
767 | 779 | |
768 | 780 | |
769 | 781 | |
770 | 782 | |
771 | 783 | |
772 | 784 | |
... | ... | @@ -771,61 +783,64 @@ |
771 | 783 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
772 | 784 | JSONObject jsonObject = new JSONObject(64); |
773 | 785 | // TODO 2019/6/5 13:21 dongqing 数据组装 |
774 | - jsonObject.put("P_NAME", patients.getUsername());//姓名 | |
775 | - jsonObject.put("P_CARDTYPE", patients.getPcerteTypeId());//证件类别 | |
776 | - jsonObject.put("P_CARDNO", patients.getCardNo());//证件号码 | |
777 | - jsonObject.put("P_BIRTHDAY", sdf.format(patients.getBirth()));//出生日期 | |
778 | - jsonObject.put("P_COUNTRY", patients.getPcountryId());//国籍 | |
779 | - jsonObject.put("P_NATION", patients.getPnationId());//民族 | |
786 | + jsonObject.put("P_NAME", patients.getUsername()==null?"":patients.getUsername());//姓名 | |
787 | + jsonObject.put("P_CARDTYPE", patients.getPcerteTypeId()==null?"":patients.getPcerteTypeId());//证件类别 | |
788 | + jsonObject.put("P_CARDNO", patients.getCardNo()==null?"":patients.getCardNo());//证件号码 | |
789 | + jsonObject.put("P_BIRTHDAY", patients.getBirth()==null?"":sdf.format(patients.getBirth()));//出生日期 | |
790 | + jsonObject.put("P_COUNTRY", patients.getPcountryId()==null?"":pcountryIdSwitch(patients.getPcountryId()));//国籍 | |
791 | + jsonObject.put("P_NATION", patients.getPnationId()==null?"": queryParentConfigId(patients.getPnationId()));//民族 | |
780 | 792 | jsonObject.put("P_EDUCATIONLEVEL", "");//文化程度 |
781 | 793 | jsonObject.put("P_OCCUPATIONID", "");//职业 |
782 | - jsonObject.put("P_MOBILEPHONE", patients.getPhone());//联系电话 | |
783 | - jsonObject.put("P_UNITWORK", patients.getPworkUnit());//工作单位 | |
794 | + jsonObject.put("P_MOBILEPHONE", patients.getPhone()==null?"":patients.getPhone());//联系电话 | |
795 | + jsonObject.put("P_UNITWORK", patients.getPworkUnit()==null?"":patients.getPworkUnit());//工作单位 | |
784 | 796 | jsonObject.put("P_JIATINGNIANRENJUNSHOURU", "");//家庭年人均收入 |
785 | - jsonObject.put("P_RRPROVINCE", patients.getProvinceId());//户口——省 | |
786 | - jsonObject.put("P_RRCITY", patients.getCityId());//户口——市 | |
787 | - jsonObject.put("P_RRCOUNTY", patients.getAreaId());//户口——区县 | |
788 | - jsonObject.put("P_RRTOWNSHIP", "");//户口——乡镇 | |
789 | - jsonObject.put("P_RRSTREET", patients.getStreetId());//户口——街道 | |
790 | - jsonObject.put("P_ADDRESSPROVINCE", patients.getProvinceRegisterId());//省份 | |
791 | - jsonObject.put("P_ADDRESSCITY", patients.getCityRegisterId());//城市 | |
792 | - jsonObject.put("P_ADDRESSCOUNTY", patients.getAreaRegisterId());//县 | |
793 | - jsonObject.put("P_ADDRESSSTREET", patients.getStreetRegisterId());//街道 | |
794 | - jsonObject.put("P_POSTPARTUMPROVINCE", patients.getProvincePostRestId());//产后——省 | |
795 | - jsonObject.put("P_POSTPARTUMCITY", patients.getCityPostRestId());//产后——市 | |
796 | - jsonObject.put("P_POSTPARTUMCOUNTY", patients.getAreaPostRestId());//产后——区县 | |
797 | - jsonObject.put("P_POSTPARTUMTOWNSHIP", "");//产后——乡镇 | |
798 | - jsonObject.put("P_POSTPARTUMSTREET", patients.getStreetPostRestId());//产后——街道 | |
797 | + jsonObject.put("P_RRPROVINCE", patients.getProvinceId()==null?"":patients.getProvinceId());//户口——省 | |
798 | + jsonObject.put("P_RRCITY", patients.getCityId()==null?"":patients.getCityId());//户口——市 | |
799 | + jsonObject.put("P_RRCOUNTY", patients.getAreaId()==null?"":patients.getAreaId());//户口——区县 | |
800 | + jsonObject.put("P_RRTOWNSHIP", patients.getStreetId()==null?"":patients.getStreetId());//户口——乡镇 | |
801 | + jsonObject.put("P_RRSTREET", patients.getAddress()==null?"":patients.getAddress());//户口——街道 | |
802 | + jsonObject.put("P_ADDRESSPROVINCE", patients.getProvinceRegisterId()==null?"": patients.getProvinceRegisterId());//省份 | |
803 | + jsonObject.put("P_ADDRESSCITY", patients.getCityRegisterId()==null?"":patients.getCityRegisterId());//城市 | |
804 | + jsonObject.put("P_ADDRESSCOUNTY", patients.getAreaRegisterId()==null?"":patients.getAreaRegisterId());//县 | |
805 | + jsonObject.put("P_ADDRESSSTREET", patients.getAddressRegister()==null?"":patients.getAddressRegister());//街道 | |
806 | + jsonObject.put("P_POSTPARTUMPROVINCE", patients.getProvincePostRestId()==null?"":patients.getProvincePostRestId());//产后——省 | |
807 | + jsonObject.put("P_POSTPARTUMCITY", patients.getCityPostRestId()==null?"":patients.getCityPostRestId());//产后——市 | |
808 | + jsonObject.put("P_POSTPARTUMCOUNTY", patients.getAreaPostRestId()==null?"":patients.getAreaPostRestId());//产后——区县 | |
809 | + jsonObject.put("P_POSTPARTUMTOWNSHIP", patients.getStreetPostRestId()==null?"":patients.getStreetPostRestId());//产后——乡镇 | |
810 | + jsonObject.put("P_POSTPARTUMSTREET", patients.getAddressPostRest()==null?"":patients.getAddressPostRest());//产后——街道 | |
799 | 811 | jsonObject.put("P_ADDRESSVILLAGE", ""); |
800 | 812 | jsonObject.put("P_RRVILLAGE", ""); |
801 | 813 | jsonObject.put("P_POSTPARTUMVILLAGE", ""); |
802 | 814 | jsonObject.put("P_RESIDETYPE", ""); |
803 | 815 | jsonObject.put("P_ACCOUNTTYPE", ""); |
804 | - jsonObject.put("P_HUSBANDNAME", patients.getHusbandName());//丈夫姓名 | |
805 | - jsonObject.put("P_HUSBANDCARDTYPE", patients.getHcertificateTypeId());//丈夫证件类型 | |
806 | - jsonObject.put("P_HUSBANDCARDNO", patients.getHusbandBirth());//丈夫证件号码 | |
807 | - jsonObject.put("P_HUSBANDBIRTHDAY", sdf.format(patients.getHusbandBirth()));//丈夫出生日期 | |
816 | + jsonObject.put("P_HUSBANDNAME", patients.getHusbandName()==null?"":patients.getHusbandName());//丈夫姓名 | |
817 | + jsonObject.put("P_HUSBANDCARDTYPE", patients.getHcertificateTypeId()==null?"":patients.getHcertificateTypeId());//丈夫证件类型 | |
818 | + jsonObject.put("P_HUSBANDCARDNO", patients.getHusbandBirth()==null?"":patients.getHusbandBirth());//丈夫证件号码 | |
819 | + jsonObject.put("P_HUSBANDBIRTHDAY", patients.getHusbandBirth()==null?"":sdf.format(patients.getHusbandBirth()));//丈夫出生日期 | |
808 | 820 | jsonObject.put("P_HUSBANDEDUCATIONLEVEL",""); |
809 | - jsonObject.put("P_HOSPITALID", "2100001981"); | |
821 | + //晓东20190629确定9b8bfd02-05be-4064-b2a9-e0cce6a3f2e3替换2100001981 | |
822 | + jsonObject.put("P_HOSPITALID", "9b8bfd02-05be-4064-b2a9-e0cce6a3f2e3"); | |
810 | 823 | jsonObject.put("P_HUSBANDOCCUPATIONID",""); |
811 | - jsonObject.put("P_HUSBANDRRTOWNSHIP",""); | |
824 | + jsonObject.put("P_HUSBANDRRTOWNSHIP", patients.getHstreetRegisterId()==null?"":patients.getHstreetRegisterId());//丈夫户口所在地 街道 | |
812 | 825 | jsonObject.put("P_HUSBANDRRVILLAGE",""); |
813 | - jsonObject.put("P_LASTMENSTRUALPERIOD",""); | |
826 | + jsonObject.put("P_LASTMENSTRUALPERIOD",patients.getLastMenses()==null?"":sdf.format(patients.getLastMenses()));//末次月经 | |
814 | 827 | jsonObject.put("P_ISVIP",""); |
815 | 828 | jsonObject.put("P_SERVICETYPE",""); |
816 | - jsonObject.put("P_HUSBANDCOUNTRY", patients.getHcountryId());//丈夫国籍 | |
817 | - jsonObject.put("P_HUSBANDNATION", patients.getHnationId());//丈夫民族 | |
818 | - jsonObject.put("P_HUSBANDMOBILEPHONE", patients.getHusbandPhone());//丈夫联系电话 | |
819 | - jsonObject.put("P_HUSBANDUNITWORK", patients.getHworkUnit());//丈夫工作单位 | |
820 | - jsonObject.put("P_HUSBANDRRPROVINCE", patients.getHprovinceRegisterId());//丈夫户口所在地 省 | |
821 | - jsonObject.put("P_HUSBANDRRCITY", patients.getHcityRegisterId());//丈夫户口所在地 市 | |
822 | - jsonObject.put("P_HUSBANDRRCOUNTY", patients.getHareaRegisterId());//丈夫户口所在地 县 | |
823 | - jsonObject.put("P_HUSBANDRRSTREET", patients.getHstreetRegisterId());//丈夫户口所在地 街道 | |
824 | - jsonObject.put("P_CLINICNO", patients.getVcCardNo());//条码号 | |
825 | - jsonObject.put("P_DOCID", "2100004880"); | |
829 | + jsonObject.put("P_HUSBANDCOUNTRY", patients.getHcountryId()==null?"":pcountryIdSwitch(patients.getHcountryId()));//丈夫国籍 | |
830 | + jsonObject.put("P_HUSBANDNATION", patients.getHnationId()==null?"":queryParentConfigId(patients.getHnationId()));//丈夫民族 | |
831 | + jsonObject.put("P_HUSBANDMOBILEPHONE", patients.getHusbandPhone()==null?"":patients.getHusbandPhone());//丈夫联系电话 | |
832 | + jsonObject.put("P_HUSBANDUNITWORK", patients.getHworkUnit()==null?"":patients.getHworkUnit());//丈夫工作单位 | |
833 | + jsonObject.put("P_HUSBANDRRPROVINCE", patients.getHprovinceRegisterId()==null?"":patients.getHprovinceRegisterId());//丈夫户口所在地 省 | |
834 | + jsonObject.put("P_HUSBANDRRCITY", patients.getHcityRegisterId()==null?"":patients.getHcityRegisterId());//丈夫户口所在地 市 | |
835 | + jsonObject.put("P_HUSBANDRRCOUNTY", patients.getHareaRegisterId()==null?"":patients.getHareaRegisterId());//丈夫户口所在地 县 | |
836 | + jsonObject.put("P_HUSBANDRRSTREET", patients.getHaddressRegister()==null?"":patients.getHaddressRegister()); | |
837 | + jsonObject.put("P_CLINICNO", patients.getVcCardNo()==null?"":patients.getVcCardNo());//条码号 | |
838 | + | |
839 | + //建档医生 | |
840 | + jsonObject.put("P_DOCID", getBookbuildingDoctor(patients.getBookbuildingDoctor())); | |
826 | 841 | //让写死桃城区,董勤说最后定 |
827 | 842 | jsonObject.put("P_FILINGTIME", sdf.format(patients.getBookbuildingDate()));//建档时间 |
828 | - jsonObject.put("P_TOWNSHIP", "");//现居住乡镇晓东后来让加的 | |
843 | + jsonObject.put("P_TOWNSHIP", patients.getStreetRegisterId()==null?"":patients.getStreetRegisterId());//现居住乡镇 | |
829 | 844 | |
830 | 845 | if (patients.getReqHusband() != null) {//丈夫信息是否必须 |
831 | 846 | if (patients.getReqHusband()) { |
832 | 847 | |
... | ... | @@ -840,7 +855,81 @@ |
840 | 855 | return jsonObject; |
841 | 856 | } |
842 | 857 | |
858 | + private String getBookbuildingDoctor(String bookbuildingDoctor) { | |
859 | + String bookbuildingDoctorid = ""; | |
860 | + if (StringUtils.isNotEmpty(bookbuildingDoctor)) { | |
861 | + Users users = usersService.getUsers(Integer.parseInt(bookbuildingDoctor)); | |
862 | + if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
863 | + bookbuildingDoctorid = users.getName(); | |
864 | + } | |
865 | + return bookbuildingDoctorid; | |
866 | + } | |
867 | + return bookbuildingDoctorid; | |
868 | + } | |
869 | + | |
870 | + public String pcountryIdSwitch(String pcountryId){ | |
871 | + if("57cead66231a18a1aaa12b96".equals(pcountryId)){ | |
872 | + pcountryId = "0da4334f-49e7-4180-b690-5cea668f75e9"; | |
873 | + return pcountryId; | |
874 | + } | |
875 | + return pcountryId; | |
876 | + } | |
877 | + | |
843 | 878 | /** |
879 | + * 3.0建档实时同步2.0民族转换 | |
880 | + * @param id | |
881 | + * @return | |
882 | + */ | |
883 | + public String queryParentConfigId(String id) { | |
884 | + | |
885 | + List<BasicConfig> basicConfigsid = basicConfigDao.queryBasicConfig( | |
886 | + MongoCondition.newInstance("parentId", "4bc86dd6-2217-4a33-95f4-dc22ee70f2e3", MongoOper.IS). | |
887 | + and("yn", YnEnums.YES.getId(), MongoOper.IS). | |
888 | + and("id", id, MongoOper.IS).toMongoQuery() | |
889 | + ); | |
890 | + if(basicConfigsid!=null && basicConfigsid.size()!=0){ | |
891 | + String name = basicConfigsid.get(0).getName(); | |
892 | + List<BasicConfig> basicConfigs = basicConfigDao.queryBasicConfig( | |
893 | + MongoCondition.newInstance("parentId", "4bc86dd6-2217-4a33-95f4-dc22ee70f2e3", MongoOper.IS). | |
894 | + and("yn", YnEnums.NO.getId(), MongoOper.IS). | |
895 | + and("name", name, MongoOper.IS).toMongoQuery() | |
896 | + ); | |
897 | + if(basicConfigs.size()==0 || basicConfigs==null){ | |
898 | + return ""; | |
899 | + } | |
900 | + return basicConfigs.get(0).getId(); | |
901 | + }else { | |
902 | + return ""; | |
903 | + } | |
904 | + } | |
905 | + /** | |
906 | + * 2.0建档实时同步3.0民族转换 | |
907 | + * @param id | |
908 | + * @return | |
909 | + */ | |
910 | + public String queryParentConfig2ToId(String id) { | |
911 | + | |
912 | + List<BasicConfig> basicConfigsid = basicConfigDao.queryBasicConfig( | |
913 | + MongoCondition.newInstance("parentId", "4bc86dd6-2217-4a33-95f4-dc22ee70f2e3", MongoOper.IS). | |
914 | + and("yn", YnEnums.NO.getId(), MongoOper.IS). | |
915 | + and("id", id, MongoOper.IS).toMongoQuery() | |
916 | + ); | |
917 | + if(basicConfigsid!=null && basicConfigsid.size()!=0){ | |
918 | + String name = basicConfigsid.get(0).getName(); | |
919 | + List<BasicConfig> basicConfigs = basicConfigDao.queryBasicConfig( | |
920 | + MongoCondition.newInstance("parentId", "4bc86dd6-2217-4a33-95f4-dc22ee70f2e3", MongoOper.IS). | |
921 | + and("yn", YnEnums.YES.getId(), MongoOper.IS). | |
922 | + and("name", name, MongoOper.IS).toMongoQuery() | |
923 | + ); | |
924 | + if(basicConfigs.size()==0 || basicConfigs==null){ | |
925 | + return id; | |
926 | + } | |
927 | + return basicConfigs.get(0).getId(); | |
928 | + }else { | |
929 | + return id; | |
930 | + } | |
931 | + } | |
932 | + /** | |
844 | 933 | * 创建孕妇建档推送消息 |
845 | 934 | */ |
846 | 935 | private void createBuildMsg(Patients patient) { |
847 | 936 | |
848 | 937 | |
... | ... | @@ -2380,10 +2469,29 @@ |
2380 | 2469 | } else { |
2381 | 2470 | param.setReqHusband(null); |
2382 | 2471 | } |
2472 | + //2.0建档实时同步3.0民族转换(孕妇和丈夫) | |
2473 | + param.setPregnantNationId(queryParentConfig2ToId(param.getPregnantNationId())); | |
2474 | + param.setHusbandNationId(queryParentConfig2ToId(param.getHusbandNationId())); | |
2383 | 2475 | param.setTownOrgId("429663d7-acdb-7c90-e053-1164010a77c8"); |
2384 | - param.setBookbuildingDoctor("2100004880"); | |
2385 | - param.setHospitalId("2100001981"); | |
2476 | + param.setHospitalId("2100001981"); // 线上2100001981 test 2100001948 桃城区 | |
2386 | 2477 | return param; |
2478 | + } | |
2479 | + | |
2480 | + public String getBookbuildingDoctorName(String bookbuildingDoctor) { | |
2481 | + String bookbuildingDoctorName = "2100004880"; | |
2482 | + if (StringUtils.isNotEmpty(bookbuildingDoctor)) { | |
2483 | + UsersQuery uq = new UsersQuery(); | |
2484 | + uq.setName(bookbuildingDoctor); | |
2485 | + List<Users> users = usersService.queryUsers(uq); | |
2486 | + if(users.size() != 0){ | |
2487 | + Users users1 = users.get(0); | |
2488 | + if (users1 != null && users1.getYn() == YnEnums.YES.getId()) { | |
2489 | + bookbuildingDoctorName = users1.getId().toString(); | |
2490 | + } | |
2491 | + } | |
2492 | + return bookbuildingDoctorName; | |
2493 | + } | |
2494 | + return bookbuildingDoctorName; | |
2387 | 2495 | } |
2388 | 2496 | |
2389 | 2497 | public static Connection getConnection() { |