Commit 0f0a9c5180e13f2baf664592b0b241a41a105acb
1 parent
25c60313e8
Exists in
master
and in
6 other branches
体重管理修改接口 加上同步修改体重数据的逻辑
Showing 1 changed file with 24 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
0f0a9c5
| ... | ... | @@ -79,6 +79,16 @@ |
| 79 | 79 | pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patients.getId()).and("hospitalId").is(hospitalId)), PatientWeight.class); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + // 绑定医生和患者的关系 | |
| 83 | + String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); | |
| 84 | + Map<String, String> param = new HashMap<>(); | |
| 85 | + param.put("doctorName", couponMapper.findUserName(userId + "")); | |
| 86 | + param.put("patientId", patients.getId()); | |
| 87 | + param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); | |
| 88 | + param.put("foreignId", userId + ""); | |
| 89 | + String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8"); | |
| 90 | + System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); | |
| 91 | + | |
| 82 | 92 | /* if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) { |
| 83 | 93 | return RespBuilder.buildErro(ResponseCode.PATIENT_WEIGHT_IS_EXIST); |
| 84 | 94 | }*/ |
| 85 | 95 | |
| 86 | 96 | |
| ... | ... | @@ -156,16 +166,16 @@ |
| 156 | 166 | |
| 157 | 167 | patientWeightService2.add(patientWeight); |
| 158 | 168 | |
| 159 | - // 绑定医生和患者的关系 | |
| 169 | + /* // 绑定医生和患者的关系 | |
| 160 | 170 | String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); |
| 161 | 171 | Map<String, String> param = new HashMap<>(); |
| 162 | 172 | param.put("doctorName", couponMapper.findUserName(userId + "")); |
| 163 | 173 | param.put("patientId", patients.getId()); |
| 164 | 174 | param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); |
| 165 | 175 | param.put("foreignId", userId + ""); |
| 166 | - String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8"); | |
| 176 | + String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8");*/ | |
| 167 | 177 | // String s = HttpClientUtil.doPost("http://localhost:9092/grWeContr/bindDoctorUser", param, "UTF-8"); |
| 168 | - System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); | |
| 178 | +// System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); | |
| 169 | 179 | return RespBuilder.buildSuccess(patientWeight.getId()); |
| 170 | 180 | } else { |
| 171 | 181 | patientWeight.setOperaterId(userId.toString()); |
| ... | ... | @@ -485,6 +495,17 @@ |
| 485 | 495 | return RespBuilder.buildSuccess("该体重未找到"); |
| 486 | 496 | } |
| 487 | 497 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 498 | + | |
| 499 | + // 绑定医生和患者的关系 | |
| 500 | + String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); | |
| 501 | + Map<String, String> param = new HashMap<>(); | |
| 502 | + param.put("doctorName", couponMapper.findUserName(userId + "")); | |
| 503 | + param.put("patientId", patientWeight.getPatientId()); | |
| 504 | + param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); | |
| 505 | + param.put("foreignId", userId + ""); | |
| 506 | + String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8"); | |
| 507 | + System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); | |
| 508 | + | |
| 488 | 509 | if(StringUtils.isNotEmpty(beforeWeight)) { |
| 489 | 510 | patientWeight.setBeforeWeight(beforeWeight); |
| 490 | 511 | } |