This commit is contained in:
haomingming
2026-11-03 12:16:38 +08:00
parent 403ae65786
commit 24f53cce85
7 changed files with 240 additions and 111 deletions
@@ -378,115 +378,112 @@ public class LoginSetInfoActivity extends BaseActivity implements
} }
} }
// 获取审核状态值 // 获取审核状态值
Intent intent = getIntent(); Intent intent = getIntent();
// ( 1.待审核 2.审核中 3.需要补充修改资料 4.再次提交审核 5.拒绝 // ( 1.待审核 2.审核中 3.需要补充修改资料 4.再次提交审核 5.拒绝
// 6.已通过)//修改,0,1,3,4,5需要提交资料,6是通过,2其他不允许提交 // 6.已通过)//修改,0,1,3,4,5需要提交资料,6是通过,2其他不允许提交
state = intent.getIntExtra("state", SharePrefUtil.getInt(ct, "state", 0)); state = intent.getIntExtra("state", SharePrefUtil.getInt(ct, "state", 0));
String checkInfo = intent.getStringExtra("checkInfo"); String checkInfo = intent.getStringExtra("checkInfo");
if (TextUtils.isEmpty(checkInfo)) { if (TextUtils.isEmpty(checkInfo)) {
checkInfo = SharePrefUtil.getString(ct, "checkInfo", ""); checkInfo = SharePrefUtil.getString(ct, "checkInfo", "");
} }
userName = intent.getStringExtra("phone"); userName = intent.getStringExtra("phone");
LogUtil.i("审核信息==" + state); LogUtil.i("审核信息==" + state);
// 根据状态进行显示规则,与提示用户 applyStateUI(state, checkInfo);
if(11 == state||10 == state ||9 == state)//hcp登陆可编辑
{ // 向服务端同步最新审核状态(防止用户在已登录状态下后台已完成审核但本地 state 未更新)
tv_showCheckInfo.setVisibility(View.GONE); UIUtils.refreshDoctorStateIfNeeded(ct, new UIUtils.OnDoctorStateRefreshListener() {
tv_showCheckInfo.setText("请完善资料"); @Override
submit_myinfo.setVisibility(View.VISIBLE); public void onStateRefreshed(int newState, String newCheckInfo) {
setInfoClick(true); if (isFinishing() || newState <= 0 || newState == state) {
submit_myinfo.setVisibility(View.VISIBLE); return;
submit_myinfo.setEnabled(true); }
state = newState;
} applyStateUI(newState, newCheckInfo);
else if (0 == state || 1 == state) {// 0,3,5需要提交资料 }
tv_showCheckInfo.setVisibility(View.GONE); });
tv_showCheckInfo.setText("请完善资料");
submit_myinfo.setVisibility(View.VISIBLE); // showAlertTips(tv_showCheckInfo.getText().toString());
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE); // 下面是获取列表
submit_myinfo.setEnabled(true); // getList(hospitalListUrl);// 获取医院列表
// 根据不同用户名获取相应的资料 getList(officeListUrl);// 获取科室列表
String mobile = SharePrefUtil.getString(ct, getList(positionListUrl);// 获取职称列表
Constant.SP_IS_FIRST_NAME, Constant.mobile, "");// 登录的手机号 getList(diseaseUrl);// 获取专长
get(mobile);
// 取出定位的数据
} else if (3 == state || 4 == state || 5 == state) {// 3,5需要提交资料//7 lon = SharePrefUtil.getString(ct, Constant.LON, "116.3");
tv_showCheckInfo.setVisibility(View.VISIBLE); lat = SharePrefUtil.getString(ct, Constant.LAT, "39.9");
String text = "您的资料未通过审核,请修改完善后重新提交。"; String province = SharePrefUtil.getString(ct, Constant.PROVINCE, "北京市");
if (!TextUtils.isEmpty(checkInfo)) { String city = SharePrefUtil.getString(ct, Constant.CITY, "北京市");
text = checkInfo; String district = SharePrefUtil.getString(ct, Constant.DISTRICT, "东城区");
} LogUtil.i("lon=" + lon + "lat=" + lat + "province=" + province
tv_showCheckInfo.setText(text); + "city=" + city + "district=" + district);
showAlertTips(text); // 设置默认选中城市
setInfoClick(true); setSelectedCity(province, city, district);
submit_myinfo.setVisibility(View.VISIBLE); // 执行检出城市
submit_myinfo.setEnabled(true); new InitAreaTask().execute();
} else if (6 == state) {// 通过 }
tv_showCheckInfo.setVisibility(View.VISIBLE);
tv_showCheckInfo.setText("您的资料已经通过了审核,将会自动进入应用"); /**
setInfoClick(false); * 根据审核状态更新界面展示与可编辑状态
submit_myinfo.setVisibility(View.GONE); */
submit_myinfo.setEnabled(false); private void applyStateUI(int currentState, String checkInfo) {
ToastUtil.showToast("您的资料已经通过了审核,将会自动进入应用"); if (11 == currentState || 10 == currentState || 9 == currentState) {// hcp登陆可编辑
try { tv_showCheckInfo.setVisibility(View.GONE);
Thread.sleep(2000); tv_showCheckInfo.setText("请完善资料");
// 注册成功跳转 submit_myinfo.setVisibility(View.VISIBLE);
Intent i = new Intent(); setInfoClick(true);
// if(BigModule()) submit_myinfo.setVisibility(View.VISIBLE);
// { submit_myinfo.setEnabled(true);
// i.setClass(this, BigMainActivity.class); } else if (0 == currentState || 1 == currentState) {// 0,3,5需要提交资料
// tv_showCheckInfo.setVisibility(View.GONE);
// } tv_showCheckInfo.setText("请完善资料");
// else submit_myinfo.setVisibility(View.VISIBLE);
// { setInfoClick(true);
i.setClass(this, MainActivity.class); submit_myinfo.setVisibility(View.VISIBLE);
// } submit_myinfo.setEnabled(true);
i.putExtra("launcher_from", 1); // 根据不同用户名获取相应的资料
startActivity(i); String mobile = SharePrefUtil.getString(ct,
// 保存登陆 Constant.SP_IS_FIRST_NAME, Constant.mobile, "");// 登录的手机号
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true); get(mobile);
} catch (InterruptedException e) { } else if (3 == currentState || 4 == currentState || 5 == currentState) {// 3,5需要提交资料//7
e.printStackTrace(); tv_showCheckInfo.setVisibility(View.VISIBLE);
} String text = "您的资料未通过审核,请修改完善后重新提交。";
} else if (7 == state){//2018.12.21改,checkInfo = undefind继续追踪,暂不出现弹窗处理 if (!TextUtils.isEmpty(checkInfo)) {
setInfoClick(true); text = checkInfo;
submit_myinfo.setVisibility(View.VISIBLE); }
submit_myinfo.setEnabled(true); tv_showCheckInfo.setText(text);
}else { showAlertTips(text);
tv_showCheckInfo.setVisibility(View.VISIBLE); setInfoClick(true);
tv_showCheckInfo.setText("肝胆相照将尽快对您的资料进行审核,请耐心等待。"); submit_myinfo.setVisibility(View.VISIBLE);
setInfoClick(false); submit_myinfo.setEnabled(true);
submit_myinfo.setVisibility(View.GONE); } else if (6 == currentState) {// 通过
submit_myinfo.setEnabled(false); tv_showCheckInfo.setVisibility(View.VISIBLE);
} tv_showCheckInfo.setText("您的资料已经通过了审核,将会自动进入应用");
setInfoClick(false);
submit_myinfo.setVisibility(View.GONE);
submit_myinfo.setEnabled(false);
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true);
// showAlertTips(tv_showCheckInfo.getText().toString()); SharePrefUtil.saveInt(ct, "state", 6);
ToastUtil.showToast("您的资料已经通过了审核");
// 下面是获取列表 Intent i = new Intent(this, MainActivity.class);
// getList(hospitalListUrl);// 获取医院列表 i.putExtra("launcher_from", 1);
getList(officeListUrl);// 获取科室列表 i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
getList(positionListUrl);// 获取职称列表 startActivity(i);
getList(diseaseUrl);// 获取专长 finish();
} else if (7 == currentState) {// 2018.12.21改,checkInfo = undefind继续追踪,暂不出现弹窗处理
// 取出定位的数据 setInfoClick(true);
lon = SharePrefUtil.getString(ct, Constant.LON, "116.3"); submit_myinfo.setVisibility(View.VISIBLE);
lat = SharePrefUtil.getString(ct, Constant.LAT, "39.9"); submit_myinfo.setEnabled(true);
String province = SharePrefUtil.getString(ct, Constant.PROVINCE, "北京市"); } else {
String city = SharePrefUtil.getString(ct, Constant.CITY, "北京市"); tv_showCheckInfo.setVisibility(View.VISIBLE);
String district = SharePrefUtil.getString(ct, Constant.DISTRICT, "东城区"); tv_showCheckInfo.setText("肝胆相照将尽快对您的资料进行审核,请耐心等待。");
LogUtil.i("lon=" + lon + "lat=" + lat + "province=" + province setInfoClick(false);
+ "city=" + city + "district=" + district); submit_myinfo.setVisibility(View.GONE);
// 设置默认选中城市 submit_myinfo.setEnabled(false);
setSelectedCity(province, city, district); }
// 执行检出城市
new InitAreaTask().execute();
} }
/** /**
@@ -2141,6 +2141,7 @@ public class MainActivity extends BaseActivity implements
super.onResume(); super.onResume();
ShowMagazine(); ShowMagazine();
if (UIUtils.isLogined()) { if (UIUtils.isLogined()) {
UIUtils.refreshDoctorStateIfNeeded(this, null);
isMaiLanExpert(); isMaiLanExpert();
getIsAccount(); getIsAccount();
setPolvPlayViewerId(); setPolvPlayViewerId();
@@ -963,8 +963,11 @@ public class MyDetailInfoActivity extends BaseActivity implements
// SharePrefUtil.saveInt(ct, "cityId", cityId); // SharePrefUtil.saveInt(ct, "cityId", cityId);
// SharePrefUtil.saveInt(ct, "countyId", countyId); // SharePrefUtil.saveInt(ct, "countyId", countyId);
// SharePrefUtil.saveInt(ct, "provId", provId); // SharePrefUtil.saveInt(ct, "provId", provId);
SharePrefUtil.saveInt(ct, "sex", sex); SharePrefUtil.saveInt(ct, "sex", sex);
SharePrefUtil.saveString(ct, "isStar", isStar); SharePrefUtil.saveString(ct, "isStar", isStar);
if (data.state > 0) {
SharePrefUtil.saveInt(ct, "state", data.state);
}
LogUtil.i("data==" + data.toString()); LogUtil.i("data==" + data.toString());
@@ -32,8 +32,9 @@ public class ChangeMyInfoBean extends BaseBean {
public String certificate;//执业资格证 public String certificate;//执业资格证
public String certificateImg;//执业资格证图片 public String certificateImg;//执业资格证图片
public String qrcode;//二维码 public String qrcode;//二维码
public String isStar;//是否是肝胆名医 0否 1是 public String isStar;//是否是肝胆名医 0否 1是
public int state; public int state;
public String checkInfo;
@Override @Override
public String toString() { public String toString() {
return "InfoData [uuid=" + uuid + ", mobile=" + mobile return "InfoData [uuid=" + uuid + ", mobile=" + mobile
@@ -476,6 +476,14 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
super.onResume(); super.onResume();
initData(); initData();
if (UIUtils.isLogined()) { if (UIUtils.isLogined()) {
UIUtils.refreshDoctorStateIfNeeded(mActivity, new UIUtils.OnDoctorStateRefreshListener() {
@Override
public void onStateRefreshed(int state, String checkInfo) {
if (getActivity() != null && isAdded()) {
initData();
}
}
});
getMyData(); getMyData();
} }
getNewPatientList(); getNewPatientList();
@@ -410,6 +410,14 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
needreportPage("我的"); needreportPage("我的");
initData(); initData();
if (UIUtils.isLogined()) { if (UIUtils.isLogined()) {
UIUtils.refreshDoctorStateIfNeeded(mActivity, new UIUtils.OnDoctorStateRefreshListener() {
@Override
public void onStateRefreshed(int state, String checkInfo) {
if (getActivity() != null && isAdded()) {
initData();
}
}
});
getMyData(); getMyData();
} }
getNewPatientList(); getNewPatientList();
@@ -15,8 +15,15 @@ import java.util.List;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;
import cn.shangyu.gdxzExpert.activity.LoginNewActivity; import cn.shangyu.gdxzExpert.activity.LoginNewActivity;
import cn.shangyu.gdxzExpert.application.BaseApplication; import cn.shangyu.gdxzExpert.application.BaseApplication;
import cn.shangyu.gdxzExpert.bean.ChangeMyInfoBean;
import cn.shangyu.gdxzExpert.http.HttpHelper;
/** /**
* *
* UIUtils.java * UIUtils.java
@@ -192,6 +199,110 @@ public class UIUtils {
return isLogined() && SharePrefUtil.getInt(getContext(), "state", 0) == 6; return isLogined() && SharePrefUtil.getInt(getContext(), "state", 0) == 6;
} }
public interface OnDoctorStateRefreshListener {
void onStateRefreshed(int state, String checkInfo);
}
/**
* 将 getExpertByUuid 返回的专家详情及审核状态同步到本地 SharePrefUtil
*/
public static void syncExpertInfoToSp(Context context, ChangeMyInfoBean bean) {
if (bean == null || !"1".equals(bean.code) || bean.expert == null) {
return;
}
Context ctx = context != null ? context : getContext();
ChangeMyInfoBean.InfoData data = bean.expert;
if (data.state > 0) {
SharePrefUtil.saveInt(ctx, "state", data.state);
}
if (!StringUtil.isEmpty(data.checkInfo)) {
SharePrefUtil.saveString(ctx, "checkInfo", data.checkInfo);
}
if (!StringUtil.isEmpty(data.realName)) {
SharePrefUtil.saveString(ctx, Constant.realName, data.realName);
}
if (!StringUtil.isEmpty(data.photo)) {
SharePrefUtil.saveString(ctx, Constant.photo, data.photo);
}
if (!StringUtil.isEmpty(data.hospitalUuid)) {
SharePrefUtil.saveString(ctx, "hospitalUuid", data.hospitalUuid);
}
if (!StringUtil.isEmpty(data.hospitalName)) {
SharePrefUtil.saveString(ctx, "hospitalName", data.hospitalName);
}
if (!StringUtil.isEmpty(data.officeUuid)) {
SharePrefUtil.saveString(ctx, "officeUuid", data.officeUuid);
}
if (!StringUtil.isEmpty(data.officeName)) {
SharePrefUtil.saveString(ctx, "officeName", data.officeName);
}
if (!StringUtil.isEmpty(data.officePhone)) {
SharePrefUtil.saveString(ctx, "officePhone", data.officePhone);
}
if (!StringUtil.isEmpty(data.positionUuid)) {
SharePrefUtil.saveString(ctx, "positionUuid", data.positionUuid);
}
if (!StringUtil.isEmpty(data.positionName)) {
SharePrefUtil.saveString(ctx, "positionName", data.positionName);
}
if (!StringUtil.isEmpty(data.certificate)) {
SharePrefUtil.saveString(ctx, "certificate", data.certificate);
}
if (!StringUtil.isEmpty(data.certificateImg)) {
SharePrefUtil.saveString(ctx, "certificateImg", data.certificateImg);
}
if (!StringUtil.isEmpty(data.qrcode)) {
SharePrefUtil.saveString(ctx, "qrcode", data.qrcode);
}
if (!StringUtil.isEmpty(data.isStar)) {
SharePrefUtil.saveString(ctx, "isStar", data.isStar);
}
SharePrefUtil.saveInt(ctx, "sex", data.sex);
}
/**
* 当账号已登录但尚未认证通过(state != 6)时,静默向服务端拉取最新审核状态(state)并同步到本地
*/
public static void refreshDoctorStateIfNeeded(final Context context, final OnDoctorStateRefreshListener listener) {
if (!isLogined() || isDoctorVerified()) {
return;
}
final Context ctx = context != null ? context : getContext();
String uuid = SharePrefUtil.getString(ctx, Constant.uuid, "");
if (StringUtil.isEmpty(uuid)) {
return;
}
RequestParams params = new RequestParams();
params.addBodyParameter("uuid", uuid);
HttpHelper.loadData(HttpMethod.POST, Url.getExpertByUuid, params, new RequestCallBack<String>() {
@Override
public void onSuccess(ResponseInfo<String> info) {
if (info == null || StringUtil.isEmpty(info.result)) {
return;
}
try {
ChangeMyInfoBean bean = GsonTools.fromGsonToBean(info.result, ChangeMyInfoBean.class);
if (bean != null && "1".equals(bean.code) && bean.expert != null) {
SharePrefUtil.saveString(ctx, Url.getExpertByUuid, info.result);
syncExpertInfoToSp(ctx, bean);
if (listener != null) {
String checkInfo = !StringUtil.isEmpty(bean.expert.checkInfo)
? bean.expert.checkInfo
: SharePrefUtil.getString(ctx, "checkInfo", "");
listener.onStateRefreshed(bean.expert.state, checkInfo);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onFailure(HttpException arg0, String arg1) {
}
});
}
/** /**
* 校验是否已通过医师资质审核(state == 6) * 校验是否已通过医师资质审核(state == 6)
* - 未登录账号:跳 LoginNewActivity * - 未登录账号:跳 LoginNewActivity