刘韬 5 years ago
parent
commit
db24be2c3f

+ 2 - 3
PacsOnline_Wechat_Doctor/src/main/java/com/zskk/controller/WxaUserApiController.java

@@ -66,7 +66,6 @@ public class WxaUserApiController extends WxaController {
 				apiResult.getStr("openid"));
 		if (doctorsWechatfind == null) {
 			DoctorsWechat doctorsWechat = new DoctorsWechat();
-			doctorsWechat.setDoctorId("");
 			doctorsWechat.setWxaOpenid(apiResult.getStr("openid"));
 			if (!StrKit.isBlank(apiResult.getStr("unionid"))) {
 				doctorsWechat.setUnionid(apiResult.getStr("unionid"));
@@ -82,8 +81,8 @@ public class WxaUserApiController extends WxaController {
 		accessTokenCache.set("wxa:session:" + sessionId, apiResult.getJson());
 		LoginBean loginBean = new LoginBean();
 		loginBean.setSessionId(sessionId);
-		if (!doctorsWechatfind.getDoctorId().equals("") || doctorsWechatfind.getDoctorId() != null) {
-			Doctors doctors = Doctors.dao.findById(doctorsWechatfind.getDoctorId());
+		Doctors doctors = Doctors.dao.findById(doctorsWechatfind.getDoctorId());
+		if (doctors != null) {
 			doctors.setPassword("");
 			DoctorBean doctorBean = JSON.parseObject(doctors.toJson(), DoctorBean.class);
 			Institution institution = Institution.dao.findById(doctorBean.getInstitution_id());