|
|
@@ -0,0 +1,1086 @@
|
|
|
+package com.zy.bvvm.ui.vaccination;
|
|
|
+
|
|
|
+import android.Manifest;
|
|
|
+import android.animation.Animator;
|
|
|
+import android.animation.ObjectAnimator;
|
|
|
+import android.annotation.SuppressLint;
|
|
|
+import android.app.Activity;
|
|
|
+import android.app.Dialog;
|
|
|
+import android.content.Context;
|
|
|
+import android.content.Intent;
|
|
|
+import android.content.res.Resources;
|
|
|
+import android.graphics.Bitmap;
|
|
|
+import android.graphics.BitmapFactory;
|
|
|
+import android.graphics.Canvas;
|
|
|
+import android.graphics.Color;
|
|
|
+import android.net.Uri;
|
|
|
+import android.os.Build;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.os.Environment;
|
|
|
+import android.os.Handler;
|
|
|
+import android.os.Message;
|
|
|
+import android.provider.MediaStore;
|
|
|
+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.DisplayMetrics;
|
|
|
+import android.util.Log;
|
|
|
+import android.view.View;
|
|
|
+import android.view.animation.Animation;
|
|
|
+import android.widget.Button;
|
|
|
+import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
+import android.widget.RelativeLayout;
|
|
|
+import android.widget.TextView;
|
|
|
+import android.widget.Toast;
|
|
|
+
|
|
|
+import com.github.dfqin.grantor.PermissionListener;
|
|
|
+import com.github.dfqin.grantor.PermissionsUtil;
|
|
|
+import com.hjq.base.BaseDialog;
|
|
|
+import com.zy.bvvm.R;
|
|
|
+import com.zy.bvvm.helper.MyClickListener;
|
|
|
+import com.zy.bvvm.helper.SPUtils;
|
|
|
+import com.zy.bvvm.helper.SoundPoolHelper;
|
|
|
+import com.zy.bvvm.mvp.MvpActivity;
|
|
|
+import com.zy.bvvm.ui.bean.ModelListBean;
|
|
|
+import com.zy.bvvm.ui.bean.VerificationCodeBean;
|
|
|
+import com.zy.bvvm.ui.bean.VnDetailBean;
|
|
|
+import com.zy.bvvm.ui.report.vndetail.VnDetailContract;
|
|
|
+import com.zy.bvvm.ui.report.vndetail.VnDetailPresenter;
|
|
|
+import com.zy.bvvm.ui.webview.WebActivity;
|
|
|
+import com.zy.bvvm.widget.EvvmMsgDiago;
|
|
|
+import com.zy.bvvm.widget.ZoomView;
|
|
|
+
|
|
|
+import org.json.JSONArray;
|
|
|
+import org.json.JSONException;
|
|
|
+
|
|
|
+import java.io.BufferedOutputStream;
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileOutputStream;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.OutputStream;
|
|
|
+import java.lang.ref.WeakReference;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import butterknife.BindView;
|
|
|
+import butterknife.ButterKnife;
|
|
|
+import butterknife.OnClick;
|
|
|
+import io.reactivex.annotations.NonNull;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 显示产品追溯报告
|
|
|
+ */
|
|
|
+public class VnReportDetailForDoctorActivity01 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;
|
|
|
+ @BindView(R.id.btn_download_bitmap)
|
|
|
+ Button btnDownloadBitmap;
|
|
|
+ @BindView(R.id.rl_all)
|
|
|
+ RelativeLayout rlAll;
|
|
|
+ //新添加id
|
|
|
+ /**
|
|
|
+ *接种部位
|
|
|
+ */
|
|
|
+ @BindView(R.id.vndetail_tv_vaccinationSite)
|
|
|
+ TextView vndetailTvVaccinationSite;
|
|
|
+ /**
|
|
|
+ * 药品批准文号
|
|
|
+ */
|
|
|
+ @BindView(R.id.vndetail_tv_approvalNumber)
|
|
|
+ TextView vndetailTvApprovalNumber;
|
|
|
+ /**
|
|
|
+ * 药品本位码
|
|
|
+ */
|
|
|
+ @BindView(R.id.vndetail_tv_standardCode)
|
|
|
+ TextView vndetailTvStandardCode;
|
|
|
+ /**
|
|
|
+ * 国家药品标识码
|
|
|
+ */
|
|
|
+ @BindView(R.id.vndetail_tv_identificationCode)
|
|
|
+ TextView vndetailTvIdentificationCode;
|
|
|
+ /**
|
|
|
+ * 规格
|
|
|
+ */
|
|
|
+ @BindView(R.id.vndetail_tv_specifications)
|
|
|
+ TextView ndetailTvSpecifications;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ static final String[] PERMISSION = new String[]{
|
|
|
+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
|
|
+ Manifest.permission.READ_EXTERNAL_STORAGE,
|
|
|
+ };
|
|
|
+
|
|
|
+ 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(VnReportDetailForDoctorActivity01.this)
|
|
|
+ .load(VnReportDetailForDoctorActivity01.this, "rewarning", R.raw.rewarning)
|
|
|
+ .load(VnReportDetailForDoctorActivity01.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) {
|
|
|
+ finish();
|
|
|
+// 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:
|
|
|
+ startActivityFinish(ReadingActivity.class);
|
|
|
+// 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onCreate(Bundle savedInstanceState) {
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
+ // TODO: add setContentView(...) invocation
|
|
|
+ ButterKnife.bind(this);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private static class WarningHandler extends Handler {
|
|
|
+ private WeakReference<VnReportDetailForDoctorActivity01> wactivity;
|
|
|
+
|
|
|
+ public WarningHandler(VnReportDetailForDoctorActivity01 activity) {
|
|
|
+ wactivity = new WeakReference<VnReportDetailForDoctorActivity01>(activity);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ super.handleMessage(msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private WarningHandler warninghandler = new WarningHandler(this);
|
|
|
+
|
|
|
+ private static class NormalHandler extends Handler {
|
|
|
+ private WeakReference<VnReportDetailForDoctorActivity01> wactivity;
|
|
|
+
|
|
|
+ public NormalHandler(VnReportDetailForDoctorActivity01 activity) {
|
|
|
+ wactivity = new WeakReference<VnReportDetailForDoctorActivity01>(activity);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ super.handleMessage(msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private NormalHandler normalhandler = new NormalHandler(this);
|
|
|
+
|
|
|
+
|
|
|
+ private static class PDFHandler extends Handler {
|
|
|
+ private WeakReference<VnReportDetailForDoctorActivity01> wactivity;
|
|
|
+
|
|
|
+ public PDFHandler(VnReportDetailForDoctorActivity01 activity) {
|
|
|
+ wactivity = new WeakReference<VnReportDetailForDoctorActivity01>(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() {
|
|
|
+ if (TextUtils.isEmpty((String) SPUtils.get("INOCULATOR_LIST", ""))) {
|
|
|
+ // toast("未获取到受种者信息");
|
|
|
+ } else {
|
|
|
+ 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);
|
|
|
+ vndetailTvChatImage.setImageResource(R.mipmap.report_normal_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++;
|
|
|
+ vndetailTvTypemsg.setText("产品信息已验证通过,冷链信息未发现异常,请核对产品外包装与本报告所载数据是否一致");
|
|
|
+ // 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);
|
|
|
+ }*/
|
|
|
+// }
|
|
|
+ //*******************************************************************
|
|
|
+ //下载处理
|
|
|
+ btnDownloadBitmap.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ requestCemera();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 权限处理
|
|
|
+ */
|
|
|
+ private void requestCemera() {
|
|
|
+ if (PermissionsUtil.hasPermission(VnReportDetailForDoctorActivity01.this, PERMISSION)) {
|
|
|
+ //有访问的权限
|
|
|
+ completeDown(rlAll);
|
|
|
+// ScreenshotUtil.saveScreenshotFromView(rl,MainActivity.this);
|
|
|
+ } else {
|
|
|
+ PermissionsUtil.requestPermission(VnReportDetailForDoctorActivity01.this, new PermissionListener() {
|
|
|
+ @Override
|
|
|
+ public void permissionGranted(@NonNull String[] permissions) {
|
|
|
+ //用户授予了访问的权限
|
|
|
+// ScreenshotUtil.saveScreenshotFromView(rl,MainActivity.this);
|
|
|
+ completeDown(rlAll);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void permissionDenied(@NonNull String[] permissions) {
|
|
|
+ //用户拒绝了访问的申请
|
|
|
+ }
|
|
|
+ }, PERMISSION);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void completeDown(View view) {
|
|
|
+ File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg");
|
|
|
+ //Bitmap bitmap = screenShot(MainActivity.this);
|
|
|
+ Bitmap bitmap = captureView(view);
|
|
|
+ try {
|
|
|
+ if (!file.exists())
|
|
|
+ file.createNewFile();
|
|
|
+ boolean ret = save(bitmap, file, Bitmap.CompressFormat.JPEG, true);
|
|
|
+ if (ret) {
|
|
|
+ //通知相册更新
|
|
|
+ MediaStore.Images.Media.insertImage(getContentResolver(), BitmapFactory.decodeFile(file.getAbsolutePath()), file.getName(), null);
|
|
|
+ Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
|
|
|
+ Uri uri = Uri.fromFile(file);
|
|
|
+ intent.setData(uri);
|
|
|
+ Toast.makeText(getApplicationContext(), "截图已保持至 " + file.getAbsolutePath(), Toast.LENGTH_SHORT).show();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存图片到文件File。
|
|
|
+ *
|
|
|
+ * @param src 源图片
|
|
|
+ * @param file 要保存到的文件
|
|
|
+ * @param format 格式
|
|
|
+ * @param recycle 是否回收
|
|
|
+ * @return true 成功 false 失败
|
|
|
+ */
|
|
|
+ public static boolean save(Bitmap src, File file, Bitmap.CompressFormat format, boolean recycle) {
|
|
|
+ if (isEmptyBitmap(src))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ OutputStream os;
|
|
|
+ boolean ret = false;
|
|
|
+ try {
|
|
|
+ os = new BufferedOutputStream(new FileOutputStream(file));
|
|
|
+ ret = src.compress(format, 100, os);
|
|
|
+ if (recycle && !src.isRecycled())
|
|
|
+ src.recycle();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前屏幕截图,不包含状态栏(Status Bar)。
|
|
|
+ *
|
|
|
+ * @param activity activity
|
|
|
+ * @return Bitmap
|
|
|
+ */
|
|
|
+ public static Bitmap screenShot(Activity activity) {
|
|
|
+ View view = activity.getWindow().getDecorView();
|
|
|
+ view.setDrawingCacheEnabled(true);
|
|
|
+ view.buildDrawingCache();
|
|
|
+ Bitmap bmp = view.getDrawingCache();
|
|
|
+ int statusBarHeight = getStatusBarHeight(activity);
|
|
|
+ int width = (int) getDeviceDisplaySize(activity)[0];
|
|
|
+ int height = (int) getDeviceDisplaySize(activity)[1];
|
|
|
+ Bitmap ret = Bitmap.createBitmap(bmp, 0, statusBarHeight, width, height - statusBarHeight);
|
|
|
+ view.destroyDrawingCache();
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Bitmap captureView(View view) {
|
|
|
+ // 根据View的宽高创建一个空的Bitmap
|
|
|
+ Bitmap bitmap = Bitmap.createBitmap(
|
|
|
+ view.getWidth(),
|
|
|
+ view.getHeight(),
|
|
|
+ Bitmap.Config.RGB_565);
|
|
|
+ // 利用该Bitmap创建一个空的Canvas
|
|
|
+ Canvas canvas = new Canvas(bitmap);
|
|
|
+ // 绘制背景(可选)
|
|
|
+ canvas.drawColor(Color.WHITE);
|
|
|
+ // 将view的内容绘制到我们指定的Canvas上
|
|
|
+ view.draw(canvas);
|
|
|
+ return bitmap;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static float[] getDeviceDisplaySize(Context context) {
|
|
|
+ Resources resources = context.getResources();
|
|
|
+ DisplayMetrics dm = resources.getDisplayMetrics();
|
|
|
+ int width = dm.widthPixels;
|
|
|
+ int height = dm.heightPixels;
|
|
|
+
|
|
|
+ float[] size = new float[2];
|
|
|
+ size[0] = width;
|
|
|
+ size[1] = height;
|
|
|
+
|
|
|
+ return size;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int getStatusBarHeight(Context context) {
|
|
|
+ int height = 0;
|
|
|
+ int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
|
|
+ if (resourceId > 0) {
|
|
|
+ height = context.getResources().getDimensionPixelSize(resourceId);
|
|
|
+ }
|
|
|
+
|
|
|
+ return height;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Bitmap对象是否为空。
|
|
|
+ */
|
|
|
+ public static boolean isEmptyBitmap(Bitmap src) {
|
|
|
+ return src == null || src.getWidth() == 0 || src.getHeight() == 0;
|
|
|
+ }
|
|
|
+ //*******************************************************************
|
|
|
+
|
|
|
+ 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) {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .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());
|
|
|
+ Log.i("awgawrgawg", "setViewData: " + dataBean.getVaccineName());
|
|
|
+ vndetailTvSzname.setText(TextUtils.isEmpty(dataBean.getInoculatroUserName()) ? "N/A" : "" + dataBean.getInoculatroUserName());
|
|
|
+ Log.i("awgawrgawg", "setViewData: " + dataBean.getBatch());
|
|
|
+ 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());
|
|
|
+ vndetailTvVncreatdate.setText(TextUtils.isEmpty(dataBean.getBeginDate()) ? "N/A" : dataBean.getBeginDate() + "");
|
|
|
+ //显示更改
|
|
|
+ vndetailTvVnname.setText(TextUtils.isEmpty(dataBean.getVaccineName()) ? "N/A" : dataBean.getVaccineName() + "");
|
|
|
+ vndetailTvVnvalid.setText(TextUtils.isEmpty(dataBean.getVaccineExpiryDate()) ? "N/A" : dataBean.getVaccineExpiryDate() + "个月");
|
|
|
+ vndetailTvVnsc.setText(dataBean.getVaccineCommonName());
|
|
|
+ vndetailTvFactoryName.setText("" + dataBean.getFactoryName());
|
|
|
+ vndetailTvVaccinationSite.setText(dataBean.getVaccinationSite());
|
|
|
+ ndetailTvSpecifications.setText(dataBean.getVaccineCategory());
|
|
|
+ vndetailTvApprovalNumber.setText(dataBean.getApprovalNumber());
|
|
|
+ vndetailTvStandardCode.setText(dataBean.getStandardCode());
|
|
|
+ vndetailTvIdentificationCode.setText( dataBean.getIdentificationCode());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //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());//开始响应点击事件
|
|
|
+// vndetailTvVndate.setText("报告日期:" + dataBean.getDatetime());
|
|
|
+// DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
+// vndetailTvVndate.setText("报告日期:"+format1.format(new Date()));
|
|
|
+ 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(VnReportDetailForDoctorActivity01.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();
|
|
|
+ }
|
|
|
+}
|