diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdfyHisService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdfyHisService.java index de5a6de..02116cb 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdfyHisService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdfyHisService.java @@ -78,39 +78,37 @@ public class CdfyHisService { * @return */ public String getIdByVcCardNo(String vcCardNo){ + String id = null; + String url = "http://10.0.200.2:9090/his/getCdFyIdByVcCardNo?vcCardNo="+vcCardNo; + DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager()); + try { + HttpPost httpPost = new HttpPost(url); + /*StringEntity se = new StringEntity(vcCardNo,"UTF-8"); + se.setContentType("text/json"); + httpPost.setEntity(se);*/ + //执行post请求 + HttpResponse respon = client.execute(httpPost); + if(respon != null && respon.getStatusLine().getStatusCode() == 200){ + String result= EntityUtils.toString(respon.getEntity()); + System.out.print(result); + // 生成 JSON 对象 + JSONObject obj = JSONObject.parseObject(result); + if(obj!=null){ + id = obj.getString("id"); + } + return id == null ? vcCardNo : id; + }else{ + System.out.println("传输失败!"); + } + }catch (Exception e){ + ExceptionUtils.catchException(e,"承德就诊卡号获取病人id异常"); + return vcCardNo; + } + finally { + client.close(); + } - return "1233"; -// String id = null; -// String url = "http://10.0.200.2:9090/his/getCdFyIdByVcCardNo?vcCardNo="+vcCardNo; -// DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager()); -// try { -// HttpPost httpPost = new HttpPost(url); -// /*StringEntity se = new StringEntity(vcCardNo,"UTF-8"); -// se.setContentType("text/json"); -// httpPost.setEntity(se);*/ -// //执行post请求 -// HttpResponse respon = client.execute(httpPost); -// if(respon != null && respon.getStatusLine().getStatusCode() == 200){ -// String result= EntityUtils.toString(respon.getEntity()); -// System.out.print(result); -// // 生成 JSON 对象 -// JSONObject obj = JSONObject.parseObject(result); -// if(obj!=null){ -// id = obj.getString("id"); -// } -// return id == null ? vcCardNo : id; -// }else{ -// System.out.println("传输失败!"); -// } -// }catch (Exception e){ -// ExceptionUtils.catchException(e,"承德就诊卡号获取病人id异常"); -// return vcCardNo; -// } -// finally { -// client.close(); -// } -// -// return vcCardNo; + return vcCardNo; } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java index b9e9ec3..6e29915 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java @@ -267,7 +267,7 @@ public class BookbuildingFacade { //承德市妇幼通过就诊卡号查询到病人id保存下来 - if ("2100001636".equals(patient.getHospitalId()) && StringUtils.isNotEmpty(yunRequest.getVcCardNo())) + if ("2100001291".equals(patient.getHospitalId()) && StringUtils.isNotEmpty(yunRequest.getVcCardNo())) { patient.setBlNum(cdfyHisService.getIdByVcCardNo(yunRequest.getVcCardNo())); } @@ -937,7 +937,7 @@ public class BookbuildingFacade { patientsQuery.setVcCardNos(dzfyHisService.getDzVcCardNos(bookbuildingQueryRequest.getVcCardNo())); } //承德通过就诊卡号查询查询到病人id 然后用病人id和就诊卡号查询建档记录 - else if ("2100001636".equals(hospitalId)) + else if ("2100001291".equals(hospitalId)) { String blNum = cdfyHisService.getIdByVcCardNo(bookbuildingQueryRequest.getVcCardNo()); patientsQuery.setBlNum(blNum); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java index 046b626..c5663ca 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java @@ -105,17 +105,17 @@ public class PostReviewFacade { } } postReviewModel.setOperator(userId); - Patients patients1 = patientsService.findOnePatientById(postReviewRequest.getParentId()); + Patients patients = patientsService.findOnePatientById(postReviewRequest.getParentId()); //产后复查时添加追访记录 - addTrackDownInfo(userId, patients1, postReviewModel); + addTrackDownInfo(userId, patients, postReviewModel); autoCreatedPatient(postReviewRequest, hospital, groupId); if (StringUtils.isEmpty(postReviewRequest.getId())) { postReviewModel.setYn(YnEnums.YES.getId()); postReviewModel.setHospitalId(hospital); - Patients patients = patientsService.findOnePatientById(postReviewRequest.getParentId()); +// Patients patients = patientsService.findOnePatientById(postReviewRequest.getParentId()); patients.setLastCheckEmployeeId(postReviewModel.getProdDoctor()); patientsService.updatePatient(patients); @@ -132,32 +132,7 @@ public class PostReviewFacade { } - //修改非主档案 同时修改主档案的产后复查次数增加 - if (StringUtils.isNotEmpty(patients1.getPid())) { - PatientsQuery patientsQuery1 = new PatientsQuery(); - patientsQuery1.setYn(YnEnums.YES.getId()); - patientsQuery1.setPid(patients1.getPid()); - - List pats = patientsService.queryPatient(patientsQuery1); - if (null != patients1.getPostViewTimes()) { - Patients patients2 = new Patients(); - patients2.setPostViewTimes(patients1.getPostViewTimes() + 1); - for (Patients pat : pats) { - patients2.setId(pat.getId()); - patientsService.updatePatient(patients2); - } - - } else { - Patients patients2 = new Patients(); - patients2.setPostViewTimes(1); - for (Patients pat : pats) { - patients2.setId(pat.getId()); - patientsService.updatePatient(patients2); - } - - } - } // if (null != patients1.getPostViewTimes()) { // Patients patients2 = new Patients(); @@ -183,9 +158,35 @@ public class PostReviewFacade { } syncMaster(patients.getId()); + //修改非主档案 同时修改主档案的产后复查次数增加 + if (StringUtils.isNotEmpty(patients.getPid())) { + PatientsQuery patientsQuery1 = new PatientsQuery(); + patientsQuery1.setYn(YnEnums.YES.getId()); + patientsQuery1.setPid(patients.getPid()); + + List pats = patientsService.queryPatient(patientsQuery1); + + if (null != patients.getPostViewTimes()) { + Patients patients2 = new Patients(); + patients2.setPostViewTimes(patients.getPostViewTimes() + 1); + for (Patients pat : pats) { + patients2.setId(pat.getId()); + patientsService.updatePatient(patients2); + } + + } else { + Patients patients2 = new Patients(); + patients2.setPostViewTimes(1); + for (Patients pat : pats) { + patients2.setId(pat.getId()); + patientsService.updatePatient(patients2); + } + + } + } + } else { - Patients patients = patientsService.findOnePatientById(postReviewRequest.getParentId()); if (StringUtils.isNotEmpty(postReviewRequest.getDueDate())) { patients.setFmDate(DateUtil.parseYMD(postReviewRequest.getDueDate())); patients.setType(3); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java index 90c3838..6cb6afa 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java @@ -155,11 +155,12 @@ public class QuanChanPatientWorker implements Callable> { withList = postReviewService.findWithList(postReviewQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); if (CollectionUtils.isNotEmpty(withList)) { //本院产后复查次数不为空 - if (null != patients.getPostViewTimes()) { - chanResult.setcHTimes(patients.getPostViewTimes()); - } else { - chanResult.setcHTimes(withList.size()); - } + chanResult.setcHTimes(withList.size()); +// if (null != patients.getPostViewTimes()) { +// chanResult.setcHTimes(patients.getPostViewTimes()); +// } else { +// chanResult.setcHTimes(withList.size()); +// } } } stopWatch.stop();