|
|
@@ -0,0 +1,843 @@
|
|
|
+package eVVM.apk.ui.vaccination;
|
|
|
+
|
|
|
+import android.animation.Animator;
|
|
|
+import android.animation.ObjectAnimator;
|
|
|
+import android.annotation.SuppressLint;
|
|
|
+import android.app.Dialog;
|
|
|
+import android.content.Intent;
|
|
|
+import android.os.Build;
|
|
|
+import android.os.Handler;
|
|
|
+import android.os.Message;
|
|
|
+import android.support.annotation.RequiresApi;
|
|
|
+import android.text.SpannableString;
|
|
|
+import android.text.SpannableStringBuilder;
|
|
|
+import android.text.Spanned;
|
|
|
+import android.text.TextUtils;
|
|
|
+import android.text.method.LinkMovementMethod;
|
|
|
+import android.text.style.ClickableSpan;
|
|
|
+import android.text.style.SuperscriptSpan;
|
|
|
+import android.util.Log;
|
|
|
+import android.view.View;
|
|
|
+import android.view.animation.Animation;
|
|
|
+import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
+import android.widget.TextView;
|
|
|
+
|
|
|
+import com.hjq.base.BaseDialog;
|
|
|
+
|
|
|
+import org.json.JSONArray;
|
|
|
+import org.json.JSONException;
|
|
|
+
|
|
|
+import java.lang.ref.WeakReference;
|
|
|
+import java.text.DateFormat;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import butterknife.BindView;
|
|
|
+import butterknife.OnClick;
|
|
|
+import eVVM.apk.R;
|
|
|
+import eVVM.apk.helper.ActivityStackManager;
|
|
|
+import eVVM.apk.helper.MyClickListener;
|
|
|
+import eVVM.apk.helper.SPUtils;
|
|
|
+import eVVM.apk.helper.SoundPoolHelper;
|
|
|
+import eVVM.apk.mvp.MvpActivity;
|
|
|
+import eVVM.apk.ui.bean.ModelListBean;
|
|
|
+import eVVM.apk.ui.bean.VerificationCodeBean;
|
|
|
+import eVVM.apk.ui.bean.VnDetailBean;
|
|
|
+import eVVM.apk.ui.home.HomeActivity;
|
|
|
+import eVVM.apk.ui.report.vndetail.VnDetailContract;
|
|
|
+import eVVM.apk.ui.report.vndetail.VnDetailPresenter;
|
|
|
+import eVVM.apk.ui.webview.WebActivity;
|
|
|
+import eVVM.apk.widget.EvvmMsgDiago;
|
|
|
+import eVVM.apk.widget.ZoomView;
|
|
|
+
|
|
|
+public class VnReportDetailForDoctorActivity extends MvpActivity<VnDetailPresenter> implements VnDetailContract.View, MyClickListener.MyClickCallBack {
|
|
|
+
|
|
|
+
|
|
|
+ @BindView(R.id.vndetail_tv_vnname)
|
|
|
+ TextView vndetailTvVnname;
|
|
|
+ @BindView(R.id.vndetail_tv_vnsc)
|
|
|
+ TextView vndetailTvVnsc;
|
|
|
+ @BindView(R.id.vndetail_tv_vncreatdate)
|
|
|
+ TextView vndetailTvVncreatdate;
|
|
|
+ @BindView(R.id.vndetail_tv_vnvalid)
|
|
|
+ TextView vndetailTvVnvalid;
|
|
|
+ @BindView(R.id.renyuan_type)
|
|
|
+ TextView renyuanType;
|
|
|
+ @BindView(R.id.vndetail_tv_szname)
|
|
|
+ TextView vndetailTvSzname;
|
|
|
+ @BindView(R.id.vndetail_tv_szsex)
|
|
|
+ TextView vndetailTvSzsex;
|
|
|
+ @BindView(R.id.vndetail_tv_szbirthday)
|
|
|
+ TextView vndetailTvSzbirthday;
|
|
|
+ @BindView(R.id.vndetail_tv_szid)
|
|
|
+ TextView vndetailTvSzid;
|
|
|
+ @BindView(R.id.vndetail_tv_szguardian)
|
|
|
+ TextView vndetailTvSzguardian;
|
|
|
+ @BindView(R.id.shouzhongrenyuan)
|
|
|
+ LinearLayout shouzhongrenyuan;
|
|
|
+ @BindView(R.id.jiezhognrenyuan)
|
|
|
+ LinearLayout jiezhognrenyuan;
|
|
|
+ @BindView(R.id.vndetail_tv_szTelephone)
|
|
|
+ TextView vndetailTvSzTelephone;
|
|
|
+ private boolean isWarning = true;
|
|
|
+ private VnDetailBean.DataBean chipModel = null;
|
|
|
+ private SoundPoolHelper soundPoolHelper;
|
|
|
+
|
|
|
+ @BindView(R.id.vndetail_tv_typemsg)
|
|
|
+ TextView vndetailTvTypemsg;
|
|
|
+ @BindView(R.id.vndetail_tv_vncode)
|
|
|
+ TextView vndetailTvVncode;
|
|
|
+ @BindView(R.id.vndetail_tv_vndate)
|
|
|
+ TextView vndetailTvVndate;
|
|
|
+ @BindView(R.id.vndetail_tv_factoryName)
|
|
|
+ TextView vndetailTvFactoryName;
|
|
|
+ @BindView(R.id.vndetail_tv_gmpName)
|
|
|
+ TextView vndetailTvGmpName;
|
|
|
+ @BindView(R.id.vndetail_tv_gmpPath)
|
|
|
+ TextView vndetailTvGmpPath;
|
|
|
+ @BindView(R.id.vndetail_tv_hospitalName)
|
|
|
+ TextView vndetailTvHospitalName;
|
|
|
+ @BindView(R.id.vndetail_tv_doctorName)
|
|
|
+ TextView vndetailTvDoctorName;
|
|
|
+ @BindView(R.id.vndetail_tv_doctorTelephone)
|
|
|
+ TextView vndetailTvDoctorTelephone;
|
|
|
+ @BindView(R.id.vndetail_tv_chatImage)
|
|
|
+ ImageView vndetailTvChatImage;
|
|
|
+ @BindView(R.id.vndetail_tv_othervn1)
|
|
|
+ TextView vndetailTvOthervn1;
|
|
|
+ @BindView(R.id.vndetail_tv_othervn2)
|
|
|
+ TextView vndetailTvOthervn2;
|
|
|
+ @BindView(R.id.vndetail_tv_othervn3)
|
|
|
+ TextView vndetailTvOthervn3;
|
|
|
+ @BindView(R.id.vndetail_iv_tipsimg)
|
|
|
+ ImageView vndetailIvTipsimg;
|
|
|
+ @BindView(R.id.vndetail_tv_tips)
|
|
|
+ TextView vndetailTvTips;
|
|
|
+ @BindView(R.id.vndetail_tv_disclaimer)
|
|
|
+ TextView vndetailTvDisclaimer;
|
|
|
+ @BindView(R.id.zv_report)
|
|
|
+ ZoomView myzoomview;
|
|
|
+ @BindView(R.id.vndetail_tv_chatImage_title)
|
|
|
+ TextView vndetail_tv_chatImage_title;
|
|
|
+ @BindView(R.id.coverview)
|
|
|
+ TextView coverview;
|
|
|
+ @BindView(R.id.vndetail_tv_tt)
|
|
|
+ TextView vndetailTvTitle;
|
|
|
+ @BindView(R.id.vndetail_tv_title)
|
|
|
+ TextView vndetailTvtt;
|
|
|
+ private int status;
|
|
|
+
|
|
|
+ private List<TextView> textViews;
|
|
|
+ private List<TextView> yujingList;
|
|
|
+ private List<TextView> vntextviewList;
|
|
|
+ private List<TextView> zcList;
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected int getLayoutId() {
|
|
|
+ return R.layout.activity_vn_report_detail_for_doctor;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected int getTitleId() {
|
|
|
+ return R.id.tb_vndetail_title;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initView() {
|
|
|
+ myzoomview.setOnTouchListener(new MyClickListener(this));
|
|
|
+ soundPoolHelper = new SoundPoolHelper(4, SoundPoolHelper.TYPE_MUSIC)
|
|
|
+ .setRingtoneType(SoundPoolHelper.RING_TYPE_MUSIC)
|
|
|
+ .loadDefault(VnReportDetailForDoctorActivity.this)
|
|
|
+ .load(VnReportDetailForDoctorActivity.this, "rewarning", R.raw.rewarning)
|
|
|
+ .load(VnReportDetailForDoctorActivity.this, "renormal", R.raw.renormal);
|
|
|
+ //设置上标
|
|
|
+ SpannableStringBuilder spanBuilder = new SpannableStringBuilder(vndetailTvtt.getText());
|
|
|
+ spanBuilder.setSpan(new SuperscriptSpan(), 5, 6, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
+ vndetailTvtt.setText(spanBuilder);
|
|
|
+ textViews = new ArrayList<>();
|
|
|
+
|
|
|
+ //左边的
|
|
|
+ vntextviewList = new ArrayList<>();
|
|
|
+ vntextviewList.add(vndetailTvVnname);
|
|
|
+ vntextviewList.add(vndetailTvVnsc);
|
|
|
+ vntextviewList.add(vndetailTvFactoryName);
|
|
|
+ vntextviewList.add(vndetailTvGmpName);
|
|
|
+ vntextviewList.add(vndetailTvGmpPath);
|
|
|
+ vntextviewList.add(vndetailTvVncreatdate);
|
|
|
+ vntextviewList.add(vndetailTvVnvalid);
|
|
|
+
|
|
|
+ //不正常
|
|
|
+ yujingList = new ArrayList<>();
|
|
|
+ yujingList.add(vndetailTvHospitalName);
|
|
|
+ yujingList.add(vndetailTvDoctorName);
|
|
|
+ yujingList.add(vndetailTvDoctorTelephone);
|
|
|
+
|
|
|
+ //正常
|
|
|
+ zcList = new ArrayList<>();
|
|
|
+ zcList.add(vndetailTvSzname);
|
|
|
+ zcList.add(vndetailTvSzsex);
|
|
|
+ zcList.add(vndetailTvSzbirthday);
|
|
|
+ zcList.add(vndetailTvSzid);
|
|
|
+ zcList.add(vndetailTvSzguardian);
|
|
|
+ zcList.add(vndetailTvSzTelephone);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onLeftClick(View v) {
|
|
|
+ super.onLeftClick(v);
|
|
|
+ if (status == 6 || status == 7) {
|
|
|
+ startActivityFinish(HomeActivity.class);
|
|
|
+ ActivityStackManager.getInstance().finishAllActivities(HomeActivity.class);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick({R.id.next_btn_report, R.id.vndetail_bt_magnifier})
|
|
|
+ public void onViewClicked(View view) {
|
|
|
+ switch (view.getId()) {
|
|
|
+ case R.id.next_btn_report:
|
|
|
+
|
|
|
+ if (status == 4 || status == 8) {
|
|
|
+ startActivityFinish(ReadingActivity.class);
|
|
|
+ } else {
|
|
|
+ if (status == 6 || status == 7) {
|
|
|
+ startActivityFinish(HomeActivity.class);
|
|
|
+ ActivityStackManager.getInstance().finishAllActivities(HomeActivity.class);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case R.id.vndetail_bt_magnifier:
|
|
|
+ //放大
|
|
|
+ myzoomview.magnifier();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private static class WarningHandler extends Handler {
|
|
|
+ private WeakReference<VnReportDetailForDoctorActivity> wactivity;
|
|
|
+
|
|
|
+ public WarningHandler(VnReportDetailForDoctorActivity activity) {
|
|
|
+ wactivity = new WeakReference<VnReportDetailForDoctorActivity>(activity);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ super.handleMessage(msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private WarningHandler warninghandler = new WarningHandler(this);
|
|
|
+
|
|
|
+ private static class NormalHandler extends Handler {
|
|
|
+ private WeakReference<VnReportDetailForDoctorActivity> wactivity;
|
|
|
+
|
|
|
+ public NormalHandler(VnReportDetailForDoctorActivity activity) {
|
|
|
+ wactivity = new WeakReference<VnReportDetailForDoctorActivity>(activity);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ super.handleMessage(msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private NormalHandler normalhandler = new NormalHandler(this);
|
|
|
+
|
|
|
+
|
|
|
+ private static class PDFHandler extends Handler {
|
|
|
+ private WeakReference<VnReportDetailForDoctorActivity> wactivity;
|
|
|
+
|
|
|
+ public PDFHandler(VnReportDetailForDoctorActivity activity) {
|
|
|
+ wactivity = new WeakReference<VnReportDetailForDoctorActivity>(activity);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ super.handleMessage(msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private PDFHandler pdfhandler = new PDFHandler(this);
|
|
|
+
|
|
|
+
|
|
|
+ private Runnable warningRunnable = new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ //用户2秒没操作了
|
|
|
+ Log.e("DoctorVnReportActivity", "两秒未操作");
|
|
|
+ //startActivityFinish(ReadingActivity.class);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private Runnable normalRunnable = new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ //用户2秒没操作了
|
|
|
+ Log.e("DoctorVnReportActivity", "两秒未操作");
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private Runnable pdfRunnable = new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ getnormalOper();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ private int checki = 1;
|
|
|
+
|
|
|
+ @SuppressLint("WrongConstant")
|
|
|
+ @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
|
|
|
+ @Override
|
|
|
+ protected void initData() {
|
|
|
+ Intent in = getIntent();
|
|
|
+ chipModel = (VnDetailBean.DataBean) in.getSerializableExtra("dataBean");
|
|
|
+ //给页面赋值
|
|
|
+ setViewData(chipModel);
|
|
|
+ isWarning = in.getBooleanExtra("isWarning", true);
|
|
|
+
|
|
|
+ status = in.getIntExtra("status", 0);
|
|
|
+ textViews.clear();
|
|
|
+ if (status == 4) {
|
|
|
+ renyuanType.setText("接种人员");
|
|
|
+ shouzhongrenyuan.setVisibility(View.GONE);
|
|
|
+ jiezhognrenyuan.setVisibility(View.VISIBLE);
|
|
|
+ textViews.addAll(vntextviewList);
|
|
|
+ textViews.addAll(yujingList);
|
|
|
+ } else {
|
|
|
+ if (status == 6 || status == 7) {
|
|
|
+ renyuanType.setText("受种人员");
|
|
|
+ shouzhongrenyuan.setVisibility(View.VISIBLE);
|
|
|
+ jiezhognrenyuan.setVisibility(View.GONE);
|
|
|
+ textViews.addAll(vntextviewList);
|
|
|
+ textViews.addAll(zcList);
|
|
|
+ } else if (status == 8) {
|
|
|
+ renyuanType.setText("接种人员");
|
|
|
+ shouzhongrenyuan.setVisibility(View.GONE);
|
|
|
+ jiezhognrenyuan.setVisibility(View.VISIBLE);
|
|
|
+ textViews.addAll(vntextviewList);
|
|
|
+ textViews.addAll(yujingList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ textJump(textViews); //开始字符跳动
|
|
|
+
|
|
|
+ //设置验证信息
|
|
|
+ vndetailTvChatImage.setImageResource(R.mipmap.report_check_ico);
|
|
|
+ vndetailTvTypemsg.setText("疫苗企业验证通过");
|
|
|
+ //透明动画
|
|
|
+ ObjectAnimator animator = ObjectAnimator.ofFloat(vndetailTvChatImage, "alpha", 0.1f, 1f);
|
|
|
+ animator.setDuration(300); //一秒闪一次
|
|
|
+ animator.setRepeatCount(10); //总共闪十次
|
|
|
+ animator.setRepeatMode(Animation.REVERSE);
|
|
|
+ //为动画设置监听
|
|
|
+ animator.addListener(new Animator.AnimatorListener() {
|
|
|
+ @Override
|
|
|
+ public void onAnimationStart(Animator animation) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
|
|
+ @Override
|
|
|
+ public void onAnimationEnd(Animator animation) {
|
|
|
+ //动画结束
|
|
|
+ animation.resume();
|
|
|
+ /*AlphaAnimation alpha = new AlphaAnimation(0.1F, 1F);
|
|
|
+ alpha.setDuration(0);
|
|
|
+ alpha.setFillAfter(true);
|
|
|
+ vndetailTvChatImage.startAnimation(alpha);*/
|
|
|
+ setPageView(); //设置扫描到的信息
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onAnimationCancel(Animator animation) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onAnimationRepeat(Animator animation) {
|
|
|
+ //动画重复时 下方进行验证提示
|
|
|
+ //Log.e("onAnimationRepeat","onAnimationRepeat");
|
|
|
+ checki++;
|
|
|
+ setCheckText(checki);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ animator.start();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setCheckText(int checki) {
|
|
|
+ switch (checki) {
|
|
|
+ case 1:
|
|
|
+ vndetailTvTypemsg.setText("疫苗企业验证通过");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ vndetailTvTypemsg.setText("疫苗品种验证通过");
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ vndetailTvTypemsg.setText("疫苗规格验证通过");
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ vndetailTvTypemsg.setText("疫苗id验证通过");
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ vndetailTvTypemsg.setText("疫苗冷链验证通过");
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ vndetailTvTypemsg.setText("接种点验证通过");
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ vndetailTvTypemsg.setText("医生验证通过");
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ vndetailTvTypemsg.setText("受种者姓名验证通过");
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ vndetailTvTypemsg.setText("受种者年龄验证通过");
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ vndetailTvTypemsg.setText("受种者性别验证通过");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setPageView() {
|
|
|
+ if (status == 4 || status == 8) {
|
|
|
+ findViewById(R.id.btn_ll).setVisibility(View.VISIBLE);
|
|
|
+ vndetailTvTypemsg.setText("此疫苗需要进一步验证,请等待厂家复核");
|
|
|
+ //vndetailTvTypemsg.setTextColor(Color.RED);
|
|
|
+ vndetailTvChatImage.setImageResource(R.mipmap.report_warning_ico);
|
|
|
+ coverview.setText("提示:温度追溯结果显示,该疫苗冷链可能有超温现象,厂家已收到相关信息。请立即停止使用该疫苗,等待复核结果。");
|
|
|
+ //播放提示语
|
|
|
+ postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ soundPoolHelper.play("rewarning", false);
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+
|
|
|
+ getWarningOper();
|
|
|
+ } else {
|
|
|
+ if (status == 6 || status == 7) {
|
|
|
+ findViewById(R.id.btn_ll).setVisibility(View.VISIBLE);
|
|
|
+ vndetailTvTypemsg.setText(
|
|
|
+ "疫苗信息已验证通过,冷链信息未发现异常,请核对疫苗内外包装与本报告所载数据是否一致,并按\"三查七对\"的规定使用");
|
|
|
+ //vndetailTvTypemsg.setTextColor(Color.GREEN);
|
|
|
+ vndetailTvChatImage.setImageResource(R.mipmap.report_normal_ico);
|
|
|
+ /*vndetailTvChatImage.setVisibility(View.GONE);
|
|
|
+ vndetail_tv_chatImage_title.setVisibility(View.GONE);*/
|
|
|
+ coverview.setText("提示:注射疫苗后,请用注射专用创口贴或消毒棉球轻压针眼几分钟,至不出血。请勿揉搓接种部位。接种疫苗后休息30分钟再离开。");
|
|
|
+
|
|
|
+ pdfhandler.postDelayed(pdfRunnable, 1000 * 20);
|
|
|
+ normalhandler.postDelayed(normalRunnable, 1000 * 60);
|
|
|
+ }/* else if (status == 8) {
|
|
|
+ vndetailTvTypemsg.setText("此疫苗需要进一步验证,请等待厂家复核");
|
|
|
+ vndetailTvTypemsg.setTextColor(Color.RED);
|
|
|
+ vndetailTvChatImage.setImageResource(R.mipmap.report_warning_ico);
|
|
|
+ coverview.setText("提示:温度追溯结果显示,该疫苗冷链可能有超温现象,厂家已收到相关信息。请立即停止使用该疫苗,等待复核结果。");
|
|
|
+ postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ soundPoolHelper.play("rewarning", false);
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+ normalhandler.postDelayed(normalRunnable, 1000 * 60);
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getnormalOper() {
|
|
|
+ postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ soundPoolHelper.play("renormal", false);
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+ final BaseDialog normalDiago = new EvvmMsgDiago.Builder(this)
|
|
|
+ .setTitle("pdf报告已自动保存到你指定的路径,医生已做好“三查七对”,并按规定完成接种,是否推送给受种者(监护人)?") // 标题可以不用填写
|
|
|
+ .setConfirm("发送给家长")
|
|
|
+ .setCancel("取消") // 设置 null 表示不显示取消按钮
|
|
|
+ //.setAutoDismiss(false) // 设置点击按钮后不关闭对话框
|
|
|
+ .setListener(new EvvmMsgDiago.OnListener() {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onConfirm(Dialog dialog) {
|
|
|
+ String emailsOfInoculator = "";
|
|
|
+ try {
|
|
|
+ String str = (String) SPUtils.get("INOCULATOR_LIST", "");
|
|
|
+ if (!str.equals("")) {
|
|
|
+ JSONArray jsonArr = new JSONArray(str);
|
|
|
+ for (int i = 0; i < jsonArr.length(); i++) {
|
|
|
+ String arr[] = jsonArr.getString(i).split("▇");
|
|
|
+ if (!arr[3].trim().equals("")) {
|
|
|
+ emailsOfInoculator += arr[3] + ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (emailsOfInoculator.lastIndexOf(",") == emailsOfInoculator.length() - 1) {
|
|
|
+ emailsOfInoculator = emailsOfInoculator.substring(0, emailsOfInoculator.length() - 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (JSONException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ getPresenter().sendMailToInoculator(chipModel.getChipNumber(), emailsOfInoculator);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onCancel(Dialog dialog) {
|
|
|
+ //toast("取消了");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .addOnDismissListener(new BaseDialog.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss(BaseDialog dialog) {
|
|
|
+ //toast("asfad");
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .show();
|
|
|
+
|
|
|
+ postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (normalDiago.isShowing()) {
|
|
|
+ normalDiago.dismiss();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 30000);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getWarningOper() {
|
|
|
+ final BaseDialog warningDiago = new EvvmMsgDiago.Builder(this)
|
|
|
+ .setTitle("此疫苗需复核,请换支疫苗") // 标题可以不用填写
|
|
|
+ .setConfirm("")
|
|
|
+ .setCancel("") // 设置 null 表示不显示取消按钮
|
|
|
+ //.setAutoDismiss(false) // 设置点击按钮后不关闭对话框
|
|
|
+ .addOnDismissListener(new BaseDialog.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss(BaseDialog dialog) {
|
|
|
+ //toast("asfad");
|
|
|
+ //warninghandler.postDelayed(warningRunnable, 1000 * 10);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .show();
|
|
|
+ postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (warningDiago.isShowing()) {
|
|
|
+ warningDiago.dismiss();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 5000);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setViewData(final VnDetailBean.DataBean dataBean) {
|
|
|
+ vndetailTvTitle.setText(dataBean.getVaccineName() + "" + dataBean.getBatch());
|
|
|
+ vndetailTvSzname.setText(TextUtils.isEmpty(dataBean.getInoculatroUserName()) ? "N/A" : "" + dataBean.getInoculatroUserName());
|
|
|
+ vndetailTvSzsex.setText(TextUtils.isEmpty(dataBean.getInoculatroSex()) ? "N/A" : "" + dataBean.getInoculatroSex());
|
|
|
+ vndetailTvSzbirthday.setText(TextUtils.isEmpty(dataBean.getInoculatroBirthdate()) ? "N/A" : "" + dataBean.getInoculatroBirthdate());
|
|
|
+ vndetailTvSzid.setText(addZero(dataBean.getInoculatroId()));
|
|
|
+ vndetailTvSzguardian.setText("N/A");
|
|
|
+ vndetailTvSzTelephone.setText(TextUtils.isEmpty(dataBean.getInoculatroTelePhone()) ? "N/A" : "" + dataBean.getInoculatroTelePhone());
|
|
|
+
|
|
|
+ vndetailTvVnname.setText(TextUtils.isEmpty(dataBean.getVaccineName()) ? "N/A" : dataBean.getVaccineName() + "");
|
|
|
+ vndetailTvVnsc.setText(TextUtils.isEmpty(dataBean.getVaccineCategory()) ? "N/A" : dataBean.getVaccineCategory() + "");
|
|
|
+ vndetailTvVncreatdate.setText(TextUtils.isEmpty(dataBean.getBeginDate()) ? "N/A" : dataBean.getBeginDate() + "");
|
|
|
+ vndetailTvVnvalid.setText(TextUtils.isEmpty(dataBean.getVaccineExpiryDate()) ? "N/A" : dataBean.getVaccineExpiryDate());
|
|
|
+
|
|
|
+
|
|
|
+ //vndetailTvVncode.setText("evvm Code " + dataBean.getCode());
|
|
|
+ /* String codeStr = "";
|
|
|
+ for (int i = 0; i < dataBean.getCodeX().length(); i++) {
|
|
|
+ codeStr = codeStr + "*";
|
|
|
+ }*/
|
|
|
+ /* SpannableString spancode = new SpannableString("报告编号 " + dataBean.getCodeX());
|
|
|
+ spancode.setSpan(new ClickableSpan() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ //点击的响应事件
|
|
|
+ *//*if (dataBean.getCodeX() == null || TextUtils.isEmpty(dataBean.getCodeX())) {
|
|
|
+ toast("你没有授权,请进行注册");
|
|
|
+ } else {
|
|
|
+ gotoWebActivity(dataBean.getCodeX());
|
|
|
+ }*//*
|
|
|
+ }
|
|
|
+ }, 5, 5 + dataBean.getCodeX().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);*/
|
|
|
+ vndetailTvVncode.setText("报告编号 " + dataBean.getCodeX());
|
|
|
+ //vndetailTvVncode.setMovementMethod(LinkMovementMethod.getInstance());//开始响应点击事件
|
|
|
+
|
|
|
+ DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
+ vndetailTvVndate.setText(format1.format(new Date()));
|
|
|
+ vndetailTvFactoryName.setText("" + dataBean.getFactoryName());
|
|
|
+ vndetailTvHospitalName.setText("" + dataBean.getHospitalName());
|
|
|
+ vndetailTvDoctorName.setText("" + dataBean.getDoctorName());
|
|
|
+ vndetailTvDoctorTelephone.setText("" + dataBean.getDoctorTelephone());
|
|
|
+ vndetailTvChatImage.setScaleType(ImageView.ScaleType.CENTER);
|
|
|
+
|
|
|
+ /* SpannableString spanGmpPath = new SpannableString(TextUtils.isEmpty(dataBean.getGmpName()) ? "N/A" : dataBean.getGmpName());
|
|
|
+ spanGmpPath.setSpan(new ClickableSpan() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ //点击的响应事件
|
|
|
+ if (dataBean.getGmpPath() == null || TextUtils.isEmpty(dataBean.getGmpPath())) {
|
|
|
+ toast("暂时无法提供,需索取");
|
|
|
+ } else {
|
|
|
+ gotoWebActivity(dataBean.getGmpPath());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 0, spanGmpPath.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);*/
|
|
|
+ vndetailTvGmpName.setText(TextUtils.isEmpty(dataBean.getGmpName()) ? "N/A" : dataBean.getGmpName());
|
|
|
+ //vndetailTvGmpName.setMovementMethod(LinkMovementMethod.getInstance());//开始响应点击事件
|
|
|
+
|
|
|
+ SpannableString spanvndetailTvOthervn0 = new SpannableString("点击查看");
|
|
|
+ spanvndetailTvOthervn0.setSpan(new ClickableSpan() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ //点击的响应事件
|
|
|
+ if (dataBean.getBatchCertificate() == null || TextUtils.isEmpty(dataBean.getBatchCertificate())) {
|
|
|
+ toast("暂时无法提供,需索取");
|
|
|
+ } else {
|
|
|
+ gotoWebActivity(dataBean.getBatchCertificate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 0, spanvndetailTvOthervn0.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
+ vndetailTvGmpPath.setText(spanvndetailTvOthervn0);
|
|
|
+ vndetailTvGmpPath.setMovementMethod(LinkMovementMethod.getInstance());//开始响应点击事件
|
|
|
+
|
|
|
+ SpannableString spanvndetailTvOthervn1 = new SpannableString("点击查询");
|
|
|
+ spanvndetailTvOthervn1.setSpan(new ClickableSpan() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ //点击的响应事件
|
|
|
+ if (dataBean.getSameBatchOtherColdChain() == null || TextUtils.isEmpty(dataBean.getSameBatchOtherColdChain())) {
|
|
|
+ toast("暂时无法提供,需索取");
|
|
|
+ } else {
|
|
|
+ gotoWebActivity(dataBean.getSameBatchOtherColdChain());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 0, spanvndetailTvOthervn1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
+ vndetailTvOthervn1.setText(spanvndetailTvOthervn1);
|
|
|
+ vndetailTvOthervn1.setMovementMethod(LinkMovementMethod.getInstance());//开始响应点击事件
|
|
|
+
|
|
|
+
|
|
|
+ SpannableString spanvndetailTvOthervn2 = new SpannableString("点击查询");
|
|
|
+ spanvndetailTvOthervn2.setSpan(new ClickableSpan() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ //点击的响应事件
|
|
|
+ if (dataBean.getSameBatchOtherFlow() == null || TextUtils.isEmpty(dataBean.getSameBatchOtherFlow())) {
|
|
|
+ toast("暂时无法提供,需索取");
|
|
|
+ } else {
|
|
|
+ gotoWebActivity(dataBean.getSameBatchOtherFlow());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 0, spanvndetailTvOthervn2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
+ vndetailTvOthervn2.setText(spanvndetailTvOthervn2);
|
|
|
+ vndetailTvOthervn2.setMovementMethod(LinkMovementMethod.getInstance());//开始响应点击事件
|
|
|
+
|
|
|
+ SpannableString spanvndetailTvOthervn3 = new SpannableString("点击查询");
|
|
|
+ spanvndetailTvOthervn3.setSpan(new ClickableSpan() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ //点击的响应事件
|
|
|
+ if (dataBean.getSameFactoryOtherVaccines() == null || TextUtils.isEmpty(dataBean.getSameFactoryOtherVaccines())) {
|
|
|
+ toast("暂时无法提供,需索取");
|
|
|
+ } else {
|
|
|
+ gotoWebActivity(dataBean.getSameFactoryOtherVaccines());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 0, spanvndetailTvOthervn3.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
+ vndetailTvOthervn3.setText(spanvndetailTvOthervn3);
|
|
|
+ vndetailTvOthervn3.setMovementMethod(LinkMovementMethod.getInstance());//开始响应点击事件
|
|
|
+ }
|
|
|
+
|
|
|
+ private void gotoWebActivity(String path) {
|
|
|
+ if (isWarning) {
|
|
|
+ warninghandler.removeCallbacks(warningRunnable);
|
|
|
+ } else {
|
|
|
+ normalhandler.removeCallbacks(normalRunnable);
|
|
|
+ }
|
|
|
+ Intent in = new Intent(VnReportDetailForDoctorActivity.this, WebActivity.class);
|
|
|
+ in.putExtra("WebViewUrl", "" + path + "");
|
|
|
+ startActivity(in);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected VnDetailPresenter createPresenter() {
|
|
|
+ return new VnDetailPresenter();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getSendMailSuccess(VnDetailBean data) {
|
|
|
+ toast("邮件已发送");
|
|
|
+ //finish();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getmlistError(String msg) {
|
|
|
+ toast("邮件发送失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getmlistSuccess(ModelListBean data) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getToReviewError(String msg) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getToReviewSuccess(VerificationCodeBean data) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getDetailError(String msg) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getDetailSuccess(VnDetailBean data) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getSendMailError(String msg) {
|
|
|
+ toast(msg);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public String addZero(String msg) {
|
|
|
+ //Log.e("addZero1",""+msg + " "+msg.length());
|
|
|
+ if (TextUtils.isEmpty(msg)) {
|
|
|
+ return "N/A";
|
|
|
+ }
|
|
|
+ if (msg.length() >= 11) {
|
|
|
+ return msg;
|
|
|
+ } else {
|
|
|
+ String remsg = msg;
|
|
|
+ for (int i = 0; i < 11 - msg.length(); i++) {
|
|
|
+ remsg = "0" + remsg;
|
|
|
+ }
|
|
|
+ // Log.e("addZero",""+remsg + " "+remsg.length());
|
|
|
+ return remsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void i(String tag, String msg) { //信息太长,分段打印
|
|
|
+ //因为String的length是字符数量不是字节数量所以为了防止中文字符过多,
|
|
|
+ // 把4*1024的MAX字节打印长度改为2001字符数
|
|
|
+ int max_str_length = 2001 - tag.length();
|
|
|
+ //大于4000时
|
|
|
+ while (msg.length() > max_str_length) {
|
|
|
+ Log.i(tag, msg.substring(0, max_str_length));
|
|
|
+ msg = msg.substring(max_str_length);
|
|
|
+ }
|
|
|
+ //剩余部分
|
|
|
+ Log.i(tag, msg);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onPause() {
|
|
|
+ super.onPause();
|
|
|
+ if (isFinishing()) {
|
|
|
+ if (pdfhandler != null) {
|
|
|
+ pdfhandler.removeCallbacks(pdfRunnable);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onDestroy() {
|
|
|
+ super.onDestroy();
|
|
|
+
|
|
|
+ if (status == 6 || status == 7 || status == 8) {
|
|
|
+ SPUtils.remove("INOCULATOR_LIST");
|
|
|
+ }
|
|
|
+ // soundPoolHelper.release();
|
|
|
+ if (normalhandler != null) {
|
|
|
+ normalhandler.removeCallbacksAndMessages(null);
|
|
|
+ }
|
|
|
+ if (warninghandler != null) {
|
|
|
+ warninghandler.removeCallbacksAndMessages(null);
|
|
|
+ }
|
|
|
+ if (pdfhandler != null) {
|
|
|
+ pdfhandler.removeCallbacks(pdfRunnable);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onDown() {
|
|
|
+ Log.e("DoctorVnReportActivity", "down");
|
|
|
+ if (isWarning) {
|
|
|
+ if (warninghandler != null) {
|
|
|
+ warninghandler.removeCallbacks(warningRunnable);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (normalhandler != null) {
|
|
|
+ normalhandler.removeCallbacks(normalRunnable);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onUp() {
|
|
|
+ Log.e("DoctorVnReportActivity", "up");
|
|
|
+ if (isWarning) {
|
|
|
+ warninghandler.postDelayed(warningRunnable, 1000 * 60);
|
|
|
+ } else {
|
|
|
+ normalhandler.postDelayed(normalRunnable, 1000 * 60);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void oneClick() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void doubleClick() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void textJump(final List<TextView> tvList) {
|
|
|
+ new Thread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ for (int i = 0; i < tvList.size(); i++) {
|
|
|
+ try {
|
|
|
+ Thread.sleep(3000 / tvList.size());
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ final int finalI = i;
|
|
|
+ if (getActivity() != null) {
|
|
|
+ runOnUiThread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ tvList.get(finalI).setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ }
|
|
|
+}
|