Commit fa5420a12d0a13274669a34f8ccd249c6dc846af
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
fa5420a
| ... | ... | @@ -136,8 +136,8 @@ |
| 136 | 136 | Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); |
| 137 | 137 | |
| 138 | 138 | patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); |
| 139 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
| 140 | 139 | patientsService.updatePatient(patients); |
| 140 | + patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
| 141 | 141 | //修改孕妇高危等级 |
| 142 | 142 | updateLastRisk(antExAddRequest.getParentId()); |
| 143 | 143 | |
| 144 | 144 | |
| ... | ... | @@ -160,12 +160,13 @@ |
| 160 | 160 | } |
| 161 | 161 | Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); |
| 162 | 162 | patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); |
| 163 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
| 163 | + | |
| 164 | 164 | model.setPid(patients.getPid()); |
| 165 | 165 | if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { |
| 166 | 166 | patients.setEnable("1"); |
| 167 | 167 | } |
| 168 | 168 | patientsService.updatePatient(patients); |
| 169 | + patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
| 169 | 170 | antenatalExaminationService.addOneBabyAnt(model); |
| 170 | 171 | |
| 171 | 172 | //修改最后一次检查时间 |
| 172 | 173 | |
| ... | ... | @@ -248,13 +249,14 @@ |
| 248 | 249 | |
| 249 | 250 | Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); |
| 250 | 251 | patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor()); |
| 251 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(excAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(excAddRequest.getNextCheckTime())); | |
| 252 | + | |
| 252 | 253 | if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { |
| 253 | 254 | patients.setEnable("1"); |
| 254 | 255 | } |
| 255 | 256 | //修改患者风险等级 |
| 256 | 257 | // updatePatientRiskLevel(antExChuModel, patients); |
| 257 | 258 | patientsService.updatePatient(patients); |
| 259 | + patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(excAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(excAddRequest.getNextCheckTime())); | |
| 258 | 260 | //修改本系统最后的高危 |
| 259 | 261 | updateLastRisk(patients.getId()); |
| 260 | 262 | //修改本院最后一次定义高危 |
| 261 | 263 | |
| ... | ... | @@ -292,10 +294,11 @@ |
| 292 | 294 | antExChuModel.setHospitalId(autoMatchFacade.getHospitalId(userId)); |
| 293 | 295 | antenatalExaminationService.addOneAntEx(antExChuModel); |
| 294 | 296 | //修改患者风险等级 |
| 295 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(excAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(excAddRequest.getNextCheckTime())); | |
| 297 | + | |
| 296 | 298 | patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor()); |
| 297 | 299 | // updatePatientRiskLevel(antExChuModel, patients); |
| 298 | 300 | patientsService.updatePatient(patients); |
| 301 | + patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(excAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(excAddRequest.getNextCheckTime())); | |
| 299 | 302 | updateLastRisk(patients.getId()); |
| 300 | 303 | |
| 301 | 304 | //修改本院最后一次定义高危 |
| ... | ... | @@ -1376,6 +1379,9 @@ |
| 1376 | 1379 | * @return |
| 1377 | 1380 | */ |
| 1378 | 1381 | public BaseResponse delOneAntEx(AntExQueryRequest antExQueryRequest, Integer userId) { |
| 1382 | + | |
| 1383 | + String parentId = ""; | |
| 1384 | + | |
| 1379 | 1385 | if ("1".equals(antExQueryRequest.getType())) { |
| 1380 | 1386 | AntenatalExaminationModel antEx = new AntenatalExaminationModel(); |
| 1381 | 1387 | antEx.setYn(YnEnums.NO.getId()); |
| ... | ... | @@ -1384,7 +1390,7 @@ |
| 1384 | 1390 | |
| 1385 | 1391 | AntenatalExaminationModel localAntModel = antenatalExaminationService.findOneById(antExQueryRequest.getId()); |
| 1386 | 1392 | |
| 1387 | - ; | |
| 1393 | + parentId =localAntModel.getParentId(); | |
| 1388 | 1394 | |
| 1389 | 1395 | /*AntExQuery antExQuery = new AntExQuery(); |
| 1390 | 1396 | antExQuery.setId(antExQueryRequest.getId()); |
| 1391 | 1397 | |
| ... | ... | @@ -1429,9 +1435,9 @@ |
| 1429 | 1435 | |
| 1430 | 1436 | AntExChuModel antExChuModel11 = antenatalExaminationService.findOne(antExQueryRequest.getId()); |
| 1431 | 1437 | |
| 1438 | + parentId = antExChuModel11.getParentId(); | |
| 1432 | 1439 | |
| 1433 | 1440 | |
| 1434 | - | |
| 1435 | 1441 | /*AntExChuQuery antExQuery = new AntExChuQuery(); |
| 1436 | 1442 | antExQuery.setId(antExQueryRequest.getId()); |
| 1437 | 1443 | antExQuery.setYn(YnEnums.YES.getId()); |
| ... | ... | @@ -1469,6 +1475,52 @@ |
| 1469 | 1475 | return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除"); |
| 1470 | 1476 | } |
| 1471 | 1477 | } |
| 1478 | + | |
| 1479 | + | |
| 1480 | + //删除复诊或者出诊的时候更新patient表的下次预约时间为最近的一次预约 | |
| 1481 | + if (StringUtils.isNotEmpty(parentId)) | |
| 1482 | + { | |
| 1483 | + PatientsQuery patientQuery = new PatientsQuery(); | |
| 1484 | + patientQuery.setYn(YnEnums.YES.getId()); | |
| 1485 | + patientQuery.setId(parentId); | |
| 1486 | + List<Patients> patientses = patientsService.queryPatient(patientQuery); | |
| 1487 | + if (CollectionUtils.isNotEmpty(patientses)) | |
| 1488 | + { | |
| 1489 | + for (Patients pat : patientses) { | |
| 1490 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 1491 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 1492 | + antExChuQuery.setHospitalId(pat.getHospitalId()); | |
| 1493 | + antExChuQuery.setParentId(pat.getId()); | |
| 1494 | + List<AntExChuModel> chus = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 1495 | + if (CollectionUtils.isNotEmpty(chus)) { | |
| 1496 | + Date nextTime = null; | |
| 1497 | + AntExChuModel chu = chus.get(0); | |
| 1498 | + if (chu != null) | |
| 1499 | + { | |
| 1500 | + nextTime = chu.getNextCheckTime(); | |
| 1501 | + | |
| 1502 | + AntExQuery antExQuery = new AntExQuery(); | |
| 1503 | + antExQuery.setParentId(pat.getId()); | |
| 1504 | + antExQuery.setYn(YnEnums.YES.getId()); | |
| 1505 | + antExQuery.setHospitalId(pat.getHospitalId()); | |
| 1506 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
| 1507 | + if (CollectionUtils.isNotEmpty(list)) | |
| 1508 | + { | |
| 1509 | + AntenatalExaminationModel ae = list.get(0); | |
| 1510 | + if (ae != null) | |
| 1511 | + { | |
| 1512 | + nextTime = ae.getNextCheckTime(); | |
| 1513 | + } | |
| 1514 | + } | |
| 1515 | + patientsService.updatePatientOneCol(pat.getId(), nextTime); | |
| 1516 | + | |
| 1517 | + } | |
| 1518 | + | |
| 1519 | + } | |
| 1520 | + } | |
| 1521 | + } | |
| 1522 | + } | |
| 1523 | + | |
| 1472 | 1524 | |
| 1473 | 1525 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 1474 | 1526 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CommonsHelper.java
View file @
fa5420a
| ... | ... | @@ -48,6 +48,31 @@ |
| 48 | 48 | return sb.toString(); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | + public static String getResidence(String provinceId, | |
| 52 | + String cityId, | |
| 53 | + String areaId, | |
| 54 | + String streetId, | |
| 55 | + String address, BasicConfigService basicConfigService) { | |
| 56 | + StringBuilder sb = new StringBuilder(); | |
| 57 | + if (StringUtils.isNotEmpty(provinceId)) { | |
| 58 | + sb.append(getName1(provinceId,basicConfigService)); | |
| 59 | + } | |
| 60 | + if (StringUtils.isNotEmpty(cityId)) { | |
| 61 | + sb.append(getName1(cityId,basicConfigService)); | |
| 62 | + } | |
| 63 | + if (StringUtils.isNotEmpty(areaId)) { | |
| 64 | + sb.append(getName1(areaId,basicConfigService)); | |
| 65 | + } | |
| 66 | + if (StringUtils.isNotEmpty(streetId)){ | |
| 67 | + sb.append(getName(streetId,basicConfigService)); | |
| 68 | + } | |
| 69 | + if (StringUtils.isNotEmpty(address)) { | |
| 70 | + sb.append(address); | |
| 71 | + } | |
| 72 | + return sb.toString(); | |
| 73 | + } | |
| 74 | + | |
| 75 | + | |
| 51 | 76 | private static String getName1(String id, BasicConfigService basicConfigService) { |
| 52 | 77 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); |
| 53 | 78 | if (basicConfig != null) { |