Commit 392ea8d9c63c102b82e7be10a22970194d4d4658
1 parent
02cd529359
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 35 additions and 19 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/SyncHsPatientService.java
View file @
392ea8d
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 | |
49 | 49 | |
50 | 50 | int pageStart = 1; |
51 | - int pageEnd = 100; | |
51 | + int pageEnd = 200; | |
52 | 52 | |
53 | 53 | |
54 | 54 | do { |
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | " mp.*, p_birthday, p_name, vc.VC_CARDNO from MOMMY_PATIENT mp " + |
58 | 58 | " left join Plat_Patient pp on mp.p_platpatientid = pp.p_id left join (select max(VC_OPERTIME) as OPERTIME, " + |
59 | 59 | " VC_CARDNO, VC_PATIENTNO from MOMMY_VISITCARD group by VC_CARDNO, VC_PATIENTNO) vc " + |
60 | - " on vc.VC_PATIENTNO = mp.P_NO order by mp.P_FILINGTIME asc) temp where ROWNUM <="+pageEnd+") pat where pat.rowno >= "+pageStart; | |
60 | + " on vc.VC_PATIENTNO = mp.P_NO order by mp.P_FILINGTIME desc) temp where ROWNUM <="+pageEnd+") pat where pat.rowno >= "+pageStart; | |
61 | 61 | System.out.println(sql); |
62 | 62 | List<Map<String, Object>> list = JDBCUtil.getOracleListDataBySql(sql); |
63 | 63 | if (!CollectionUtils.isNotEmpty(list)) |
64 | 64 | |
... | ... | @@ -82,12 +82,12 @@ |
82 | 82 | List<Map<String, Object>> tempList = list.subList(i, end); |
83 | 83 | commonThreadPool.execute(new PatientWorker(countDownLatch,tempList, mongoTemplate)); |
84 | 84 | } |
85 | - pageStart += 100; | |
86 | - pageEnd += 100; | |
85 | + pageStart += 200; | |
86 | + pageEnd += 200; | |
87 | 87 | |
88 | 88 | try { |
89 | 89 | countDownLatch.await(20, TimeUnit.SECONDS); |
90 | - Thread.sleep(10000); | |
90 | + Thread.sleep(5000); | |
91 | 91 | } catch (InterruptedException e) { |
92 | 92 | } |
93 | 93 | }while (true); |
94 | 94 | |
... | ... | @@ -520,16 +520,8 @@ |
520 | 520 | patients.setType(type); //患者类型 |
521 | 521 | |
522 | 522 | PersonModel dbPerson = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(HsDataUtil.getString(map.get("P_CARDNO"))).and("yn").is(1).and("type").ne(2)), PersonModel.class); |
523 | - if (dbPerson != null && type != dbPerson.getType()) | |
523 | + if (dbPerson == null) | |
524 | 524 | { |
525 | - dbPerson.setType(type); | |
526 | - Query query = Query.query(Criteria.where("id").is(dbPerson.getId())); | |
527 | - Update update = MongoConvertHelper | |
528 | - .convertToNativeUpdate(ReflectionUtils.getUpdateField(dbPerson)); | |
529 | - mongoTemplate.updateFirst(query, update, PersonModel.class); | |
530 | - } | |
531 | - else | |
532 | - { | |
533 | 525 | PersonModel person = new PersonModel(); |
534 | 526 | person.setId(String.valueOf(map.get("PID"))); |
535 | 527 | person.setType(type); |
... | ... | @@ -544,6 +536,7 @@ |
544 | 536 | mongoTemplate.save(person); |
545 | 537 | dbPerson = person; |
546 | 538 | } |
539 | + | |
547 | 540 | |
548 | 541 | patients.setPid(dbPerson.getId()); |
549 | 542 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
392ea8d
... | ... | @@ -1186,6 +1186,28 @@ |
1186 | 1186 | bloodPressureService.update(bloodPressure); |
1187 | 1187 | } |
1188 | 1188 | |
1189 | + //初诊自动填写血压 | |
1190 | + List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(p.getPid()).and("yn").is(YnEnums.YES.getId())), AntExChuModel.class); | |
1191 | + if (CollectionUtils.isNotEmpty(antExChuModels)) { | |
1192 | + for (AntExChuModel model : antExChuModels) { | |
1193 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(DateUtil.getyyyy_MM_dd(model.getCheckTime())) && | |
1194 | + DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCheckTime()))) { | |
1195 | + try { | |
1196 | + Map map = new HashMap(); | |
1197 | + map.put("szy", bloodPressure.getSzy()); | |
1198 | + map.put("ssy", bloodPressure.getSsy()); | |
1199 | + model.setBp(JsonUtil.obj2JsonString(map)); | |
1200 | + antenatalExaminationService.updateAntExChu(model, model.getId()); | |
1201 | + break; | |
1202 | + } catch (Exception e) { | |
1203 | + | |
1204 | + } | |
1205 | + | |
1206 | + } | |
1207 | + } | |
1208 | + } | |
1209 | + | |
1210 | + | |
1189 | 1211 | //复诊自动获取血压 |
1190 | 1212 | AntExQuery antExQuery = new AntExQuery(); |
1191 | 1213 | antExQuery.setYn(YnEnums.YES.getId()); |
1192 | 1214 | |
1193 | 1215 | |
1194 | 1216 | |
... | ... | @@ -1196,15 +1218,16 @@ |
1196 | 1218 | antExQuery.setEnd(DateUtil.parseYMDHMS(date + " 23:59:59")); |
1197 | 1219 | List<AntenatalExaminationModel> antenatalExaminationModels = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); |
1198 | 1220 | if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) { |
1199 | - AntenatalExaminationModel examinationModel = antenatalExaminationModels.get(0); | |
1200 | - Map map = new HashMap(); | |
1201 | - map.put("szy", bloodPressure.getSzy()); | |
1202 | - map.put("ssy", bloodPressure.getSsy()); | |
1203 | 1221 | try { |
1222 | + AntenatalExaminationModel examinationModel = antenatalExaminationModels.get(0); | |
1223 | + Map map = new HashMap(); | |
1224 | + map.put("szy", bloodPressure.getSzy()); | |
1225 | + map.put("ssy", bloodPressure.getSsy()); | |
1204 | 1226 | examinationModel.setBp(JsonUtil.obj2JsonString(map)); |
1227 | + antenatalExaminationService.updateOneAnt(examinationModel, examinationModel.getId()); | |
1205 | 1228 | } catch (Exception e) { |
1206 | 1229 | } |
1207 | - antenatalExaminationService.updateOneAnt(examinationModel, examinationModel.getId()); | |
1230 | + | |
1208 | 1231 | } |
1209 | 1232 | |
1210 | 1233 |