Ejemplo n.º 1
0
  public void saveReportToWeb() {
    Login1 login1 = MyApplication.getInstance().getSession().getLoginResult();
    if (login1 == null || login1.response == null) {
      mToast.setText("当前没有医生登录,请先登录!");
      mToast.show();
      return;
    }

    Jmjbxx jmjbxx = (Jmjbxx) tnbBeanMap.get(Jmjbxx.class.getName());
    if (jmjbxx == null || jmjbxx.getResidentID().equals("")) {
      mToast.setText(R.string.toast_info_none_resident);
      mToast.show();
      return;
    }

    if (!getValue()) {
      return;
    }

    Bctnbglk26 bctnbglk26 = (Bctnbglk26) tnbBeanMap.get(Bctnbglk26.class.getName());
    if (bctnbglk26 == null || bctnbglk26.request == null) {
      mToast.setText("上传出错,请重试!");
      mToast.show();
      return;
    }
    bctnbglk26.request.dutyDoctor = new BeanID(Global.doctorID, Global.doctorName);
    List<IDto> beanList = new ArrayList<IDto>();
    beanList.add(bctnbglk26);
    BeanUtil.getInstance()
        .getBeanFromWeb(
            beanList,
            new OnResultFromWeb() {
              @Override
              public void onResult(List<IDto> listBean, boolean isSucc) {
                Bctnbglk26 responseBean = (Bctnbglk26) listBean.get(0);
                if (isSucc) {
                  if (responseBean.response == null) {
                    mToast.setText("网络异常");
                    mToast.show();
                  } else {
                    if (responseBean.response.errMsg != null
                        && responseBean.response.errMsg.length() > 0) {
                      mToast.setText(responseBean.response.errMsg);
                      mToast.show();
                      return;
                    } else {
                      mToast.setText("【糖尿病报卡】上传成功");
                      mToast.show();
                    }
                  }
                } else {
                  mToast.setText("网络请求失败");
                  mToast.show();
                }
              }
            });
  }
Ejemplo n.º 2
0
  private void changeHistoryHyperToWeb(
      final String gmsId,
      final String disSn,
      final String gmyId,
      final String gmyName,
      final String mFbsjDate,
      final String zlms,
      final String fbyyString,
      final int operType) {
    Dzjmjkgms dzjmjkgms = new Dzjmjkgms();
    dzjmjkgms.request = new Dzjmjkgms.Request();

    Login1 login1 = MyApplication.getInstance().getSession().getLoginResult();
    if (login1 == null || login1.response == null) {
      Toast.makeText(mContext, "当前没有医生登录,操作失败!", Toast.LENGTH_SHORT).show();
      return;
    }
    dzjmjkgms.request.userID = login1.response.userID;
    dzjmjkgms.request.residentID = mJmjbxx.getResidentID();
    dzjmjkgms.request.hyperTypeCD = gmsId;
    dzjmjkgms.request.hyperSn = disSn;
    dzjmjkgms.request.hyperOperType = operType;
    dzjmjkgms.request.hyperSource = new BeanID(gmyId, gmyName);
    dzjmjkgms.request.happenDate = mFbsjDate;
    dzjmjkgms.request.cureDes = zlms;
    dzjmjkgms.request.hyperReason = fbyyString;

    List<IDto> beanList = new ArrayList<IDto>();
    beanList.add(dzjmjkgms);
    BeanUtil.getInstance()
        .getBeanFromWeb(
            beanList,
            new BeanUtil.OnResultFromWeb() {
              @Override
              public void onResult(List<IDto> listBean, boolean isSucc) {
                if (isSucc && listBean != null) {
                  Dzjmjkgms responseDzjmjkgms = (Dzjmjkgms) listBean.get(0);
                  if (responseDzjmjkgms != null && responseDzjmjkgms.response != null) {
                    if (operType == 1) { // 新增
                      addItem(disSn, gmsId, gmyId, gmyName, mFbsjDate, zlms, fbyyString);
                    } else if (operType == 2) { // 修改
                      updateItem(
                          changePosition, gmsId, gmyId, gmyName, mFbsjDate, zlms, fbyyString);
                    } else if (operType == 3) { // 删除
                      removeItem(changePosition);
                    }
                  }
                }
              }
            });
  }
Ejemplo n.º 3
0
  public void getReportFromWeb() {
    Login1 login1 = MyApplication.getInstance().getSession().getLoginResult();
    if (login1 == null || login1.response == null) {
      mToast.setText("当前没有医生登录,请先登录!");
      mToast.show();
      return;
    }
    Jmjbxx mJmjbxx = (Jmjbxx) tnbBeanMap.get(Jmjbxx.class.getName());
    if (mJmjbxx == null || mJmjbxx.getResidentID() == null || mJmjbxx.getResidentID().equals("")) {
      mToast.setText(R.string.toast_info_none_resident);
      mToast.show();
      return;
    }
    Ddtnbglkxxxx25 ddtnbglkxxxx25 = new Ddtnbglkxxxx25();
    ddtnbglkxxxx25.request = new Ddtnbglkxxxx25.Request();
    ddtnbglkxxxx25.request.employeeNo = login1.response.employeeNo;
    ddtnbglkxxxx25.request.residentID = mJmjbxx.getResidentID();

    List<IDto> beanList = new ArrayList<IDto>();
    beanList.add(ddtnbglkxxxx25);
    BeanUtil.getInstance()
        .getBeanFromWeb(
            beanList,
            new BeanUtil.OnResultFromWeb() {
              @Override
              public void onResult(List<IDto> listBean, boolean isSucc) {
                if (isSucc) {
                  Ddtnbglkxxxx25 responseDdtnbglkxxxx25 = (Ddtnbglkxxxx25) listBean.get(0);
                  if (responseDdtnbglkxxxx25 == null
                      || responseDdtnbglkxxxx25.response == null
                      || responseDdtnbglkxxxx25.response.errMsg.length() > 0) {
                    mToast.setText("获取糖尿病报卡出错,请返回重试");
                    mToast.show();
                    return;
                  } else {
                    if (StringUtil.isEmptyString(
                        responseDdtnbglkxxxx25.response.paperNum)) { // 返回的符合的记录不存在
                      // 没有数据
                    } else {
                      tnbBeanMap.put(Ddtnbglkxxxx25.class.getName(), responseDdtnbglkxxxx25);
                    }
                    setValue();
                  }
                }
              }
            });
  }
Ejemplo n.º 4
0
  public void getReportFromWeb() {
    Login1 login1 = MyApplication.getInstance().getSession().getLoginResult();
    if (login1 == null || login1.response == null) {
      mToast.setText("当前没有医生登录,请先登录!");
      mToast.show();
      return;
    }
    Jmjbxx mJmjbxx = (Jmjbxx) nzzBeanMap.get(Jmjbxx.class.getName());
    if (mJmjbxx == null || mJmjbxx.getResidentID() == null || mJmjbxx.getResidentID().equals("")) {
      mToast.setText(R.string.toast_info_none_resident);
      mToast.show();
      return;
    }
    List<String> beanClassList = new ArrayList<String>();
    beanClassList.add("HFS02 得到脑卒中管理卡详细信息");

    GlobalUtil.getInstance()
        .setSupplement(
            new Supplement() {
              @Override
              public void protocolToValueSupplement(XmlTag arg0, String arg1) {
                Jmjbxx mJmjbxx = (Jmjbxx) nzzBeanMap.get(Jmjbxx.class.getName());

                // OrgCode
                XmlTag xmlTag = GlobalUtil.getInstance().findFirstXmlTag(arg0, "Request");
                xmlTag.setAttr("OrgCode", Global.orgCode);
                // UserID
                XmlTag reqSubTag = GlobalUtil.getInstance().findFirstXmlTag(xmlTag, "UserID");
                String userID =
                    MyApplication.getInstance().getSession().getLoginResult().response.userID;
                reqSubTag.setValue(userID);

                // ResidentID
                if (mJmjbxx != null) {
                  reqSubTag = GlobalUtil.getInstance().findFirstXmlTag(xmlTag, "ResidentID");
                  reqSubTag.setValue(mJmjbxx.getResidentID());
                }
              }
            });
    BeanUtil.getInstance()
        .saveBeanToWeb2(
            beanClassList,
            new OnResultFromWeb2() {

              @Override
              public void onResult(List<String> listBean, boolean isSucc) {
                if (isSucc) {
                  String errorMsg = listBean.get(0);
                  if (errorMsg.length() > 0) {
                    mToast.setText(errorMsg);
                    mToast.show();
                    mSfglYcfsReportPage01.setValueByJmjbxx(Global.jmjbxx);
                    return;
                  } else {
                    mToast.setText("【脑卒中报卡】获取成功");
                    mToast.show();
                    setValue();
                  }
                } else {
                  mToast.setText("网络请求失败");
                  mToast.show();
                  mSfglYcfsReportPage01.setValueByJmjbxx(Global.jmjbxx);
                }
              }
            });
  }