Forráskód Böngészése

修复医生头像和简介为空时报错的bug

lighter 4 éve
szülő
commit
36aeab901f

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>wxservice-server</artifactId>
-    <version>4.5</version>
+    <version>4.6</version>
     <name>wxservice-server</name>
     <description>server for wxservice-web</description>
 

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/dao/AppointmentDao.java

@@ -49,6 +49,6 @@ public interface AppointmentDao {
     void updateWxBindSocialNo(@Param("patientId") String patientId,
                                @Param("socialNo") String socialNo);
 
-    @Select("select portrait as code,introduction as name from a_employee_mi where code=#{code}")
+    @Select("select isnull(portrait,'') as code,isnull(introduction,'') as name from a_employee_mi where code=#{code}")
     PureCodeName selectPortraitAndIntroduction(@Param("code") String code);
 }

+ 4 - 2
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -125,8 +125,10 @@ public class AppointmentService {
         }
         for (Map<String, Object> map : data.getData()) {
             PureCodeName info = dao.selectPortraitAndIntroduction(map.get("doctorCode").toString());
-            map.put("portrait", info.getCode());
-            map.put("introduction", info.getName());
+            if (null != info) {
+                map.put("portrait", info.getCode());
+                map.put("introduction", info.getName());
+            }
         }
         return ResultVoUtil.success(data.getData());
     }