医生个人信息
This commit is contained in:
parent
78425cbb6f
commit
93bdbf5934
|
@ -1,7 +1,6 @@
|
|||
package com.eningqu.aipen.logic.model.mine;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Bindable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
@ -9,183 +8,49 @@ import com.google.gson.annotations.SerializedName;
|
|||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Package:com.eningqu.aipen.logic.model.mine
|
||||
* Package:com.eningqu.aipen.logic.model.medical
|
||||
* Author:starr
|
||||
* Time:2023/11/17 19:39
|
||||
* Description:
|
||||
* Time:2024/2/4 16:04
|
||||
* Description: 医生个人信息实体
|
||||
*/
|
||||
@Keep
|
||||
public class DoctorBean extends BaseObservable implements Serializable {
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class DoctorBean implements Serializable {
|
||||
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("msg")
|
||||
public String msg;
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("code")
|
||||
public Integer code;
|
||||
@SerializedName("emrYsInfo")
|
||||
public EmrYsInfoDTO emrYsInfo;
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ys")
|
||||
public YsDTO ys;
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class EmrYsInfoDTO implements Serializable{
|
||||
@SerializedName("emrYsId")
|
||||
public Integer emrYsId;
|
||||
@SerializedName("emrYsName")
|
||||
public String emrYsName;
|
||||
@SerializedName("emrYsTitle")
|
||||
public String emrYsTitle;
|
||||
@SerializedName("emrYsSex")
|
||||
public String emrYsSex;
|
||||
@SerializedName("emrYsSection")
|
||||
public String emrYsSection;
|
||||
@SerializedName("emrYsPhone")
|
||||
public String emrYsPhone;
|
||||
@SerializedName("emrYsPwd")
|
||||
public String emrYsPwd;
|
||||
@SerializedName("emrYsBirth")
|
||||
public Object emrYsBirth;
|
||||
@SerializedName("emrYsCreate")
|
||||
public String emrYsCreate;
|
||||
@SerializedName("emrYsImg")
|
||||
public String emrYsImg;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public YsDTO getYs() {
|
||||
return ys;
|
||||
}
|
||||
|
||||
public void setYs(YsDTO ys) {
|
||||
this.ys = ys;
|
||||
notifyChange();
|
||||
|
||||
}
|
||||
|
||||
public static class YsDTO extends BaseObservable implements Serializable{
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysId")
|
||||
public Integer ysId;
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysName")
|
||||
public String ysName;
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysSex")
|
||||
public String ysSex;
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysKs")
|
||||
public String ysKs;
|
||||
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysPhone")
|
||||
public String ysPhone;
|
||||
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysPassword")
|
||||
public String ysPassword;
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysBirthDate")
|
||||
public String ysBirthDate;
|
||||
|
||||
|
||||
@Bindable
|
||||
@Keep
|
||||
@SerializedName("ysCreateDate")
|
||||
public String ysCreateDate;
|
||||
|
||||
public Integer getYsId() {
|
||||
return ysId;
|
||||
}
|
||||
|
||||
public void setYsId(Integer ysId) {
|
||||
this.ysId = ysId;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getYsName() {
|
||||
return ysName;
|
||||
}
|
||||
|
||||
public void setYsName(String ysName) {
|
||||
this.ysName = ysName;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getYsSex() {
|
||||
return ysSex;
|
||||
}
|
||||
|
||||
public void setYsSex(String ysSex) {
|
||||
this.ysSex = ysSex;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getYsKs() {
|
||||
return ysKs;
|
||||
}
|
||||
|
||||
public void setYsKs(String ysKs) {
|
||||
this.ysKs = ysKs;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getYsPhone() {
|
||||
return ysPhone;
|
||||
}
|
||||
|
||||
public void setYsPhone(String ysPhone) {
|
||||
this.ysPhone = ysPhone;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getYsPassword() {
|
||||
return ysPassword;
|
||||
}
|
||||
|
||||
public void setYsPassword(String ysPassword) {
|
||||
this.ysPassword = ysPassword;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getYsBirthDate() {
|
||||
return ysBirthDate;
|
||||
}
|
||||
|
||||
public void setYsBirthDate(String ysBirthDate) {
|
||||
this.ysBirthDate = ysBirthDate;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getYsCreateDate() {
|
||||
return ysCreateDate;
|
||||
}
|
||||
|
||||
public void setYsCreateDate(String ysCreateDate) {
|
||||
this.ysCreateDate = ysCreateDate;
|
||||
|
||||
notifyChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,9 +126,10 @@ public interface Apis {
|
|||
/**
|
||||
* 获取医生个人信息
|
||||
*/
|
||||
//http://8.130.124.187:8080/renren-fast/hospital/ys/info/4
|
||||
@GET("hospital/ys/info/{ysId}")
|
||||
Observable<DoctorBean> getDoctorInfoRx(@Path("ysId") Integer ysId);
|
||||
//http://localhost:8080/renren-fast/hospital/emrysinfo/info/8
|
||||
@GET("hospital/emrysinfo/info/{emrYsId}")
|
||||
Observable<DoctorBean> getDoctorInfo(@Path("emrYsId") Integer ysId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取今日挂号记录
|
||||
|
|
|
@ -68,7 +68,7 @@ public class WorkAdapter extends RecyclerView.Adapter<WorkAdapter.WorkViewHolder
|
|||
WriteActivity.startAction(v.getContext(), bundle);
|
||||
}
|
||||
});
|
||||
holder.binding.tvName.setText(bean.emrHzId);
|
||||
holder.binding.tvName.setText(bean.emrHzId+"");
|
||||
holder.binding.tvDate.setText(bean.emrGhTime.substring(0,11));
|
||||
holder.binding.tvTest.setOnClickListener((View.OnClickListener) v->{
|
||||
if(MyApplication.isConnect==1){
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.view.View;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.eningqu.aipen.demo.PenCtrlSdkManager;
|
||||
import com.eningqu.aipen.demo.databinding.FragmentMineBinding;
|
||||
import com.eningqu.aipen.logic.model.mine.DoctorBean;
|
||||
|
@ -17,6 +18,7 @@ import com.eningqu.aipen.logic.network.SchedulerTransformer;
|
|||
import com.eningqu.aipen.ui.base.BaseFragment;
|
||||
import com.eningqu.aipen.ui.base.TestActivity;
|
||||
import com.eningqu.aipen.ui.login.LoginActivity;
|
||||
import com.eningqu.aipen.utils.GlideUtils;
|
||||
import com.eningqu.aipen.utils.GlobalConfig;
|
||||
import com.eningqu.aipen.utils.SPUtil;
|
||||
import com.kongzue.dialogx.dialogs.PopTip;
|
||||
|
@ -29,7 +31,7 @@ import com.kongzue.dialogx.dialogs.PopTip;
|
|||
*/
|
||||
public class MineFragment extends BaseFragment<FragmentMineBinding> {
|
||||
|
||||
DoctorBean.YsDTO ysBean=new DoctorBean.YsDTO();
|
||||
DoctorBean.EmrYsInfoDTO ysBean = new DoctorBean.EmrYsInfoDTO();
|
||||
|
||||
public static MineFragment newInstance() {
|
||||
return new MineFragment();
|
||||
|
@ -57,14 +59,16 @@ public class MineFragment extends BaseFragment<FragmentMineBinding> {
|
|||
if (ysId == -1) {
|
||||
PopTip.tip("请先登录...");
|
||||
} else {
|
||||
BaseRetrofitUtils.getInstance().create(Apis.class).getDoctorInfoRx(ysId)
|
||||
BaseRetrofitUtils.getInstance().create(Apis.class).getDoctorInfo(ysId)
|
||||
.compose(new SchedulerTransformer<>())
|
||||
.compose(RxLifecycle.bindExLifecycle(this))
|
||||
.subscribe(doctorBean -> {
|
||||
//设置新的数据,自动刷新界面
|
||||
ysBean.setYsName(doctorBean.ys.ysName);
|
||||
ysBean.setYsKs(doctorBean.ys.ysKs);
|
||||
SPUtil.getInstance().putData(GlobalConfig.ysName, ysBean.ysName);
|
||||
mBinding.name.setText(doctorBean.emrYsInfo.emrYsSection);
|
||||
mBinding.nameTv.setText(doctorBean.emrYsInfo.emrYsName);
|
||||
GlideUtils.loadCircleImage(getContext(),doctorBean.emrYsInfo.emrYsImg,
|
||||
mBinding.headIv);
|
||||
SPUtil.getInstance().putData(GlobalConfig.ysName, doctorBean.emrYsInfo.emrYsName);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package com.eningqu.aipen.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.Image;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.eningqu.aipen.demo.R;
|
||||
|
||||
/**
|
||||
* Package:com.eningqu.aipen.utils
|
||||
* Author:starr
|
||||
* Time:2024/2/4 16:28
|
||||
* Description:
|
||||
*/
|
||||
public class GlideUtils {
|
||||
private static volatile GlideUtils mInstance;
|
||||
|
||||
private GlideUtils(){}
|
||||
private static RequestOptions options = new RequestOptions()
|
||||
.placeholder(R.drawable.pic_empty) //占位图
|
||||
.error(R.drawable.pic_empty) //错误图
|
||||
.skipMemoryCache(true); //禁用掉Glide的内存缓存功能
|
||||
|
||||
public static GlideUtils getInstance(){
|
||||
if(mInstance==null){
|
||||
synchronized (GlideUtils.class){
|
||||
if(mInstance==null){
|
||||
mInstance = new GlideUtils();
|
||||
}
|
||||
}
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
public static void loadImage(Context context, String url, ImageView iv){
|
||||
Glide.with(context).load(url).apply(options).into(iv);
|
||||
}
|
||||
|
||||
public static void loadCircleImage(Context context, String url, ImageView iv){
|
||||
RequestOptions requestOptions=options.centerCrop().circleCrop();
|
||||
Glide.with(context).load(url).apply(requestOptions).into(iv);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<variable
|
||||
name="ys"
|
||||
type="com.eningqu.aipen.logic.model.mine.DoctorBean.YsDTO" />
|
||||
type="com.eningqu.aipen.logic.model.mine.DoctorBean.EmrYsInfoDTO" />
|
||||
|
||||
</data>
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@={ys.ysName}"
|
||||
android:text="@={ys.emrYsName}"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/head_Iv" />
|
||||
|
@ -63,7 +63,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:text="@={ys.ysKs}"
|
||||
android:text="@={ys.emrYsSection}"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/nameTv" />
|
||||
|
|
|
@ -65,10 +65,9 @@
|
|||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="就诊时间"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_logo"
|
||||
app:layout_constraintHorizontal_bias="0.153"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_deal" />
|
||||
|
||||
|
@ -77,7 +76,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="12:00:00"
|
||||
android:visibility="invisible"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_time"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time" />
|
||||
|
||||
|
|
Loading…
Reference in New Issue