Selaa lähdekoodia

修复空指针

xiaochan 3 kuukautta sitten
vanhempi
commit
f37ffb89d5

+ 1 - 1
src/main/java/thyyxxk/webserver/api/forpowersi/DrgDipController.java

@@ -239,7 +239,7 @@ public class DrgDipController {
                 item.setAge(String.valueOf(IdCardUtil.getAgeByIdCard(item.getIdCard())));
             }
             item.setVisitDept(deptCache.get(item.getVisitDeptId()).getName());
-            item.setTbDoctor(userCache.get(item.getTbDoctorId()).getName());
+            item.setTbDoctor(userCache.getEmployeeName(item.getTbDoctorId()));
             item.setHospDischDept(deptCache.get(item.getHospDischDeptId()).getName());
         });
         return DrgDipResponseFactory.success(list);

+ 5 - 0
src/main/java/thyyxxk/webserver/service/hutoolcache/CountryCache.java

@@ -37,6 +37,11 @@ public class CountryCache implements HutoolCacheInterface<CountryCache.Country>
 
     @Override
     public Country get(String key) {
+
+        if (key == null) {
+            return new Country();
+        }
+
         Country country = cache.get(key);
         if (country == null) {
             country = dbInfo(key);

+ 3 - 0
src/main/java/thyyxxk/webserver/service/hutoolcache/DeptCache.java

@@ -41,6 +41,9 @@ public class DeptCache implements HutoolCacheInterface<DeptCache.Dept> {
 
     @Override
     public Dept get(String key) {
+        if (key == null) {
+            return new Dept();
+        }
         Dept dept = cache.get(key);
         if (dept == null) {
             dept = dbInfo(key);

+ 3 - 0
src/main/java/thyyxxk/webserver/service/hutoolcache/NationCache.java

@@ -37,6 +37,9 @@ public class NationCache implements HutoolCacheInterface<NationCache.Nation> {
 
     @Override
     public Nation get(String key) {
+        if (key == null) {
+            return new Nation();
+        }
         Nation nation = cache.get(key);
         if (nation == null) {
             nation = dbInfo(key);

+ 3 - 0
src/main/java/thyyxxk/webserver/service/hutoolcache/OccupationCache.java

@@ -36,6 +36,9 @@ public class OccupationCache implements HutoolCacheInterface<OccupationCache.Occ
 
     @Override
     public Occupation get(String key) {
+        if (key == null) {
+            return new Occupation();
+        }
         Occupation occupation = cache.get(key);
         if (occupation == null) {
             occupation = dbInfo(key);

+ 5 - 0
src/main/java/thyyxxk/webserver/service/hutoolcache/RelativeCache.java

@@ -37,6 +37,11 @@ public class RelativeCache implements HutoolCacheInterface<RelativeCache.Relativ
 
     @Override
     public Relative get(String key) {
+
+        if (key == null) {
+            return new Relative();
+        }
+
         Relative relative = cache.get(key);
         if (relative == null) {
             relative = dbInfo(key);

+ 8 - 1
src/main/java/thyyxxk/webserver/service/hutoolcache/UserCache.java

@@ -28,6 +28,9 @@ public class UserCache implements HutoolCacheInterface<UserInfo> {
 
     @Override
     public UserInfo get(String key) {
+        if (key == null) {
+            return new UserInfo();
+        }
         UserInfo userInfo = cache.get(key);
         if (userInfo == null) {
             userInfo = dbInfo(key);
@@ -37,9 +40,13 @@ public class UserCache implements HutoolCacheInterface<UserInfo> {
     }
 
     public String getEmployeeName(String userId) {
+        if (userId == null) {
+            return "";
+        }
+
         UserInfo userInfo = get(userId);
         if (userInfo == null) {
-            return null;
+            return "";
         }
         return userInfo.getName();
     }

+ 5 - 0
src/main/java/thyyxxk/webserver/service/hutoolcache/ZyBillItemCache.java

@@ -35,6 +35,11 @@ public class ZyBillItemCache implements HutoolCacheInterface<ZyBillItemCache.ZyB
 
     @Override
     public ZyBillItem get(String key) {
+
+        if (key == null) {
+            return new ZyBillItem();
+        }
+
         ZyBillItem value = cache.get(key);
         if (null == value) {
             value = dbInfo(key);

+ 2 - 2
src/main/java/thyyxxk/webserver/service/inpatient/PatientService.java

@@ -218,7 +218,7 @@ public class PatientService {
      */
     private void setExpenseInformation(@NotNull Patient data) {
         data.setMedTypeName(MedType.getName(data.getMedType()));
-        data.setDutyNurseName(userCache.get(data.getDutyNurse()).getName());
+        data.setDutyNurseName(userCache.getEmployeeName(data.getDutyNurse()));
 
         HuanZheFeiYong feiYongZhanBi = yiZhuLuRuDao.feiYongXinXi(data.getInpatientNo(), data.getAdmissTimes(), data.getLedgerSn());
         if (feiYongZhanBi != null) {
@@ -423,7 +423,7 @@ public class PatientService {
         }
         if (null != age && (age < 16 || age > 60)) {
             if (patient.getName().equals(patient.getContactName()) ||
-                    patient.getContactRelation().equals("0")) {
+                patient.getContactRelation().equals("0")) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "16岁以下或60岁以上的患者,联系人不能填写本人。");
             }
         }

+ 5 - 5
src/main/java/thyyxxk/webserver/service/inpatient/casefrontsheet/CaseFrontSheetAnalyzeService.java

@@ -78,7 +78,7 @@ public class CaseFrontSheetAnalyzeService {
                     if (item.getSignStaff().equals("NONE")) {
                         dismissCount.setSignStaffName("未签收");
                     } else {
-                        dismissCount.setSignStaffName(userCache.get(item.getSignStaff()).getName());
+                        dismissCount.setSignStaffName(userCache.getEmployeeName(item.getSignStaff()));
                     }
                     dismissCount.setDismissCount(item.getDismissCount());
                     map.put(item.getSignStaff(), dismissCount);
@@ -104,7 +104,7 @@ public class CaseFrontSheetAnalyzeService {
                     item.setZkWard(null);
                 }
                 String staffName = StringUtil.isBlank(item.getSignStaff()) ?
-                        "未签收" : userCache.get(item.getSignStaff()).getName();
+                        "未签收" : userCache.getEmployeeName(item.getSignStaff());
                 item.setSignStaff(staffName);
                 item.setBlfx(FilterUtil.translateCaseClass(item.getBlfx()));
                 item.setFdcrb(FilterUtil.translateStatutoryEpidemic(item.getFdcrb()));
@@ -119,9 +119,9 @@ public class CaseFrontSheetAnalyzeService {
                 item.setBlfx(FilterUtil.translateCaseClass(item.getBlfx()));
                 item.setAdmissDept(deptCache.get(item.getAdmissDept()).getName());
                 item.setZkWard(deptCache.get(item.getZkWard()).getName());
-                item.setKzr(userCache.get(item.getKzr()).getName());
-                item.setZzys(userCache.get(item.getZzys()).getName());
-                item.setZyys(userCache.get(item.getZyys()).getName());
+                item.setKzr(userCache.getEmployeeName(item.getKzr()));
+                item.setZzys(userCache.getEmployeeName(item.getZzys()));
+                item.setZyys(userCache.getEmployeeName(item.getZyys()));
                 item.setFdcrb(FilterUtil.translateStatutoryEpidemic(item.getFdcrb()));
             }
         }

+ 1 - 1
src/main/java/thyyxxk/webserver/service/medicaladvice/nursing/NursingManagementService.java

@@ -640,7 +640,7 @@ public class NursingManagementService {
                     temp.setInputTime(yzTemperature.getInputTime());
                     temp.setInpatientNo(yzTemperature.getInpatientNo());
                     temp.setAdmissTimes(yzTemperature.getAdmissTimes());
-                    temp.setWard(userCache.get(code).getDeptCode());
+                    temp.setWard( userCache.get(code).getDeptCode());
                     temp.setRecDate(yzTemperature.getRecDate());
                     temp.setRecTime(yzTemperature.getRecTime());
                 }