public void handleMessage(Message msg) { if (!Thread.currentThread().isInterrupted()) { switch (msg.what) { case 1234: String str_content = ""; File file = new File(zw_path); if (file.exists()) { byte[] bytes = null; try { bytes = FileUtil.getBytesFromFile(file); } catch (IOException e) { e.printStackTrace(); } str_content = Base64.encodeToString(bytes, Base64.DEFAULT); getFlowFormElements.SaveArchiveData( Detail_xzfwsh_chakantabs_MainActivity.this, 3000, ArcStepID, infofile.WFID().get(), infofile.WFStepID().get(), infoFile.infoUsername().get(), infofile.infoUserType().get(), str_content); } break; default: break; } } }
private void getDatasFromInterface() { getFlowFormElements.getFlowFormElements( Detail_xzfwsh_chakantabs_MainActivity.this, 1, infofile.infoUsername().get(), infofile.infoUserType().get(), FlowID, WFID, Integer.valueOf(infoFile.CurNode().get()).intValue()); }
private void initFilePath() { File file = new File(zw_path); if (!file.exists()) { file.mkdir(); } SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒"); Date curDate = new Date(System.currentTimeMillis()); // 获取当前时间 String str = formatter.format(curDate); zw_path = zw_path + infoFile.infoUsername().get() + str + ".doc"; }
@Override public void onClick(View v) { switch (v.getId()) { case R.id.back: this.finish(); break; case R.id.ll1: DatePickDialog.showDateCheckDialog(this, tv_1, true); break; case R.id.btn_ty: Constants.shouwenOrfawen = 2000; Constants.passOrNot = 1; Constants.ShenHeYiJian = edt_shyj.getText().toString(); Constants.userName = cxry_username.toString(); Constants.userCode = cxry_usercode.toString(); getFlowFormElements.GetCheckNextStepInfo( this, 1000, FlowID, infofile.WFID().get(), 0, infofile.CurNode().get() + "", "1", 0, infofile.infoUsername().get()); break; case R.id.btn_bty: Constants.shouwenOrfawen = 2000; Constants.passOrNot = 0; Constants.ShenHeYiJian = edt_shyj.getText().toString(); Constants.userName = cxry_username.toString(); Constants.userCode = cxry_usercode.toString(); getFlowFormElements.GetCheckNextStepInfo( this, 1000, FlowID, infofile.WFID().get(), 0, infofile.CurNode().get() + "", "0", 0, infofile.infoUsername().get()); break; case R.id.btn_th: showInfo(); break; case R.id.btn_ckzw: if (hasDownZW) { IAppOfficeUtil.OpenOfficeFile(iAppOffice, zw_path); } else { getFlowFormElements.LoadArchiveData( Detail_xzfwsh_chakantabs_MainActivity.this, 2000, 0, ArcStepID, infofile.WFID().get(), infofile.WFStepID().get()); } // FileUtil.writeBase64StringToFile( // handleResult.getContent(), zw_path); // if (iAppOffice != null) { // IAppOfficeUtil.OpenOfficeFile(iAppOffice, zw_path); // } break; default: break; } }
private void InitTextView() { infoFile = new InfoFile_(this); zw_path = Environment.getExternalStorageDirectory() + "/OADownFile/" + infoFile.infoUsername().get() + "/"; tv_1 = (TextView) findViewById(R.id.tv_1); edt_tgbt = (EditText) findViewById(R.id.edt_tgbt); edt_shyj = (EditText) findViewById(R.id.edt_shyj); edt_tgbt.setEnabled(false); textView1 = (TextView) findViewById(R.id.tv_a); textView2 = (TextView) findViewById(R.id.tv_b); textView3 = (TextView) findViewById(R.id.tv_c); tv_llry = (TextView) findViewById(R.id.tv_llry); btn_ty = (Button) findViewById(R.id.btn_ty); btn_bty = (Button) findViewById(R.id.btn_bty); btn_th = (Button) findViewById(R.id.btn_th); btn_ckzw = (Button) findViewById(R.id.btn_ckzw); tv_gwbt = (TextView) findViewById(R.id.tv_gwbt); tv_gwbt.setText(infofile.Title().get()); ll_btn = (LinearLayout) findViewById(R.id.ll_btn); ll_checkpeople = (LinearLayout) findViewById(R.id.ll_checkpeople); ll_checkpeople1 = (LinearLayout) findViewById(R.id.ll_checkpeople1); ll_textup1 = (LinearLayout) findViewById(R.id.ll_textup1); btn_ty.setOnClickListener(this); btn_bty.setOnClickListener(this); btn_th.setOnClickListener(this); btn_ckzw.setOnClickListener(this); textView1.setOnClickListener(new txListener(0)); textView2.setOnClickListener(new txListener(1)); textView3.setOnClickListener(new txListener(2)); back = (ImageView) findViewById(R.id.back); back.setOnClickListener(this); tv_1.setText(endTime); edt_tgbt.setText(Title); if (statusOfShenhe.equals("1000")) { ll_textup1.setVisibility(View.VISIBLE); btn_ty.setVisibility(View.VISIBLE); btn_bty.setVisibility(View.VISIBLE); btn_th.setVisibility(View.VISIBLE); } else { ll_textup1.setVisibility(View.GONE); btn_ty.setVisibility(View.GONE); btn_bty.setVisibility(View.GONE); btn_th.setVisibility(View.GONE); } File file = new File(Environment.getExternalStorageDirectory() + "/OADownFile/"); if (!file.exists()) { file.mkdir(); } File file1 = new File(zw_path); if (!file1.exists()) { file1.mkdir(); } initFilePath(); iAppOffice = IAppOfficeUtil.getInstance(this); if (iAppOffice == null) { // btn_qczw.setClickable(false); Toast.makeText(this, "请正确安装wps应用!", Toast.LENGTH_SHORT).show(); } else { // btn_qczw.setClickable(true); } infofile.edit().ArcStepID().put(0).apply(); // 初始化公文ID }