Commit 73c7aa8fa03ec9511ede4372a5e60bc04006deea

Authored by liquanyu
1 parent 7ca0481431

体重

Showing 1 changed file with 17 additions and 13 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 73c7aa8
... ... @@ -153,19 +153,23 @@
153 153 patientWeight.setPatientId(patients.getId());
154 154 pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patients.getId()).and("hospitalId").is(hospitalId)), PatientWeight.class);
155 155 }
156   - DoctorUserMap doctorUserMap = new DoctorUserMap(patientWeight.getPatientId(), couponMapper.findUserName(userId + ""), couponMapper.findHospitalNameById(hospitalId), userId + "");
157   - doctorUserMapService.add(doctorUserMap);
158   -
159   - if (patients != null && !hospitalId.equals(patients.getHospitalId())) {// 隐藏建档
160   - patients.setId(null);
161   - patients.setHospitalId(hospitalId);
162   - patients.setEnable("2");
163   - patients.setShortCode("M");
164   - patients.setSource(patientWeight.getPatientId());
165   - patients.setCreated(new Date());
166   - patients.setModified(new Date());
167   - patientsService.addPatient(patients);
168   - patientWeight.setPatientId(patients.getId());
  156 + if (patients != null) {// 隐藏建档
  157 + if (patients.getSource() != null)
  158 + {
  159 + patients = mongoTemplate.findOne(Query.query(Criteria.where("source").is(patients.getId()).and("hospitalId").is(hospitalId).and("enable").is("2")), Patients.class);
  160 + }
  161 + if (!hospitalId.equals(patients.getHospitalId()))
  162 + {
  163 + patients.setId(null);
  164 + patients.setHospitalId(hospitalId);
  165 + patients.setEnable("2");
  166 + patients.setShortCode("M");
  167 + patients.setSource(patientWeight.getPatientId());
  168 + patients.setCreated(new Date());
  169 + patients.setModified(new Date());
  170 + patientsService.addPatient(patients);
  171 + patientWeight.setPatientId(patients.getId());
  172 + }
169 173 }
170 174  
171 175 Map<String, String> dayWeights = new LinkedHashMap<>();