From b9c9b1265e35eeeefbc1c7abe82a68b43ce59e9f Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 25 八月 2026 11:19:07 +0800
Subject: [PATCH] 门诊数据查询空指针异常处理
---
smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
index 74c33b8..4488aed 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
@@ -51,6 +51,8 @@
@Autowired
private PatArchiveMapper patArchiveMapper;
+ @Autowired
+ private ServiceTaskmedicalMapper serviceTaskmedicalMapper;
/**
@@ -76,8 +78,8 @@
PatMedOuthospQueryReq patMedOuthospQueryReq = DtoConversionUtils.sourceToTarget(patMedOuthosp, PatMedOuthospQueryReq.class);
patMedOuthospQueryReq.setBeginAdmitdate(patMedOuthosp.getBeginTime());
patMedOuthospQueryReq.setEndAdmitdate(patMedOuthosp.getEndTime());
- if(!CollectionUtils.isEmpty(patMedOuthosp.getDeptcodes())) {
- String result = String.join(",", patMedOuthosp.getDeptcodes());
+ if (!CollectionUtils.isEmpty(patMedOuthosp.getDeptcodes())) {
+ String result = String.join(",", patMedOuthosp.getDeptcodes());
patMedOuthospQueryReq.setDeptcode(result);
}
@@ -85,7 +87,7 @@
if (patMedOuthosp.getPageNum() != null) {
for (PatMedOuthosp patMedOuthosp1 : patMedOuthospQueryResps) {
PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid());
- if (patArchive.getBirthdate() != null) {
+ if (ObjectUtils.isNotEmpty(patArchive) && patArchive.getBirthdate() != null) {
Map<String, String> map = calculateAge(patArchive.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now());
patArchive.setAge(ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null);
patArchive.setAgeUnit(map.get("ageUnit"));
@@ -309,7 +311,7 @@
PatMedOuthospQueryReq req = new PatMedOuthospQueryReq();
String deptcodes = CollectionUtils.isEmpty(patMedReq.getDeptcodeList()) ? null : String.join(",", patMedReq.getDeptcodeList());
req.setBeginAdmitdate(patMedReq.getStartDate());
- req.setEndAdmitdate(DateUtils.addDays(patMedReq.getEndDate(),1));
+ req.setEndAdmitdate(DateUtils.addDays(patMedReq.getEndDate(), 1));
req.setDeptcode(deptcodes);
req.setOrgid(patMedReq.getOrgid());
// req.setCampusid(patMedReq.getCampusid());
@@ -537,7 +539,7 @@
* @return
*/
@Override
- public Integer followUpAgainByPatMedOuthosp(PatMedOuthosp patMedOuthosp,Date adminDate, Integer visitTimeNum){
+ public Integer followUpAgainByPatMedOuthosp(PatMedOuthosp patMedOuthosp, Date adminDate, Integer visitTimeNum) {
int hoursToAdd = visitTimeNum * 24;
Calendar calendar = Calendar.getInstance();
calendar.setTime(adminDate);
@@ -555,7 +557,7 @@
serviceSubtaskEntity0.setDeptcode(deptcode);
serviceSubtaskEntity0.setSort(0);
List<ServiceSubtask> serviceSubtaskList0 = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskEntity0);
- if(!CollectionUtils.isEmpty(serviceSubtaskList0)){
+ if (!CollectionUtils.isEmpty(serviceSubtaskList0)) {
ServiceSubtask serviceSubtask0 = serviceSubtaskList0.get(0);
serviceSubtask0.setSendstate(6L);
serviceSubtask0.setUpdateTime(new Date());
@@ -570,7 +572,7 @@
serviceSubtask1.setVisitTime(newDate);
serviceSubtask1.setLongSendTime(newDate);
i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask1);
- }else {
+ } else {
//鏌ョ湅宸插畬鎴愮殑浠诲姟
// ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity();
// serviceSubtaskEntity0.setOrgid(patMedOuthosp.getOrgid());
--
Gitblit v1.9.3