diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java index 5a2ffcf..eced80b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java @@ -79,6 +79,16 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patients.getId()).and("hospitalId").is(hospitalId)), PatientWeight.class); } + // 绑定医生和患者的关系 + String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); + Map param = new HashMap<>(); + param.put("doctorName", couponMapper.findUserName(userId + "")); + param.put("patientId", patients.getId()); + param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); + param.put("foreignId", userId + ""); + String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8"); + System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); + /* if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) { return RespBuilder.buildErro(ResponseCode.PATIENT_WEIGHT_IS_EXIST); }*/ @@ -156,16 +166,16 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient patientWeightService2.add(patientWeight); - // 绑定医生和患者的关系 + /* // 绑定医生和患者的关系 String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); Map param = new HashMap<>(); param.put("doctorName", couponMapper.findUserName(userId + "")); param.put("patientId", patients.getId()); param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); param.put("foreignId", userId + ""); - String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8"); + String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8");*/ // String s = HttpClientUtil.doPost("http://localhost:9092/grWeContr/bindDoctorUser", param, "UTF-8"); - System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); +// System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); return RespBuilder.buildSuccess(patientWeight.getId()); } else { patientWeight.setOperaterId(userId.toString()); @@ -485,6 +495,17 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient return RespBuilder.buildSuccess("该体重未找到"); } String hospitalId = autoMatchFacade.getHospitalId(userId); + + // 绑定医生和患者的关系 + String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); + Map param = new HashMap<>(); + param.put("doctorName", couponMapper.findUserName(userId + "")); + param.put("patientId", patientWeight.getPatientId()); + param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); + param.put("foreignId", userId + ""); + String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8"); + System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); + if(StringUtils.isNotEmpty(beforeWeight)) { patientWeight.setBeforeWeight(beforeWeight); }