Browse Source

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 năm trước cách đây
mục cha
commit
12f92b71f5

+ 18 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java

@ -42,6 +42,24 @@ public class BaseController {
		}
	}
	/**
	 * 獲取髮送請求用戶的uid
	 * @return
	 */
	public String getLastUid() {
		try {
			String userAgent = request.getHeader("userAgent");
			if(StringUtils.isEmpty(userAgent)){
				userAgent = request.getHeader("User-Agent");
			}
			JSONObject json = new JSONObject(userAgent);
			return json.getString("lastUid");
		} catch (Exception e) {
			return null;
		}
	}
	public String getOpenid() {
		try {
			String userAgent = request.getHeader("userAgent");

+ 13 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.patient.account;
import com.sun.org.apache.regexp.internal.RE;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.Patient;
@ -790,7 +791,13 @@ public class PatientController extends WeixinBaseController {
                return error(-1, "openid不能为空");
            }
            JSONObject result = patientInfoService.switchFamilyAccount(getUID(), family, openid);
            String lastUid = getLastUid();
            if(StringUtils.isEmpty(lastUid)){
                lastUid = getUID();
            }
            JSONObject result = patientInfoService.switchFamilyAccount(lastUid, family, openid);
            int status = result.getInt("status");
@ -800,6 +807,11 @@ public class PatientController extends WeixinBaseController {
                return error(-2, "家庭成员不存在该人");
            } else {
                JSONObject json = result.getJSONObject("data");
                if(StringUtils.isNotEmpty(lastUid)){
                    json.put("lastUid",lastUid);
                }
                return write(200, "切换账号成功", "data", json);
            }
        } catch (Exception e) {