zoukankan      html  css  js  c++  java
  • Runnable如何传参

    private class TimerUpdateTask implements Runnable{
            private boolean isUnion = false;
    
            public TimerUpdateTask(boolean isUnion){
                this.isUnion = isUnion ;
            }
    
            @Override
            public void run() {
                String printMsg = "";
                String mSerialNumber = out_trade_no;
                final String guideInfo = guideinfo;
                if (this.isUnion) {
                    UnionPayDialog.dismissUnionDialog();
                    PayResultDialog.showPayResultDialog(getContext(), true, mUnionPayResult.getOrderNum(), mUnionPayResult.getConfirmNum(), ALLPrize + "", "", "003136");
                    printMsg = PrintMsgAndDialogUtils.setPrintMsg(myApplication, 3, mCardNo, mPatientName, "门诊缴费",
                            "", patientInfo, ALLPrize + "",
                            mSerialNumber,choosedBean.get(0).getOrderID(),invoiceNo);
                    LogSaverUtils.saveTradePrintLog(mUnionPayResult.getConfirmNum(), printMsg + "
    " + guideInfo + "
    
    
    
    
    ");
                    LogSaverUtils.sendAndSaveUnionTradeLog(myApplication, getContext(), "1", mUnionPayResult, "门诊缴费", secondTrackData, field55, cardSN, patientInfo, mPatientID, mPatientName, TransMoneyUtils.transMoney(ALLPrize+""));
                } else {
                    QRCodePayDialog.dismissQRCodeDialog();
    //            PayResultDialog.showPayResultDialog(getContext(), true, transaction_id, out_trade_no, ALLPrize + "", "", "003136");
                    PayResultDialog.showPayResultDialog(getContext(), true, out_trade_no, out_trade_no, ALLPrize + "", "", "003136");
                    LogSaverUtils.saveQRTradeLog(out_trade_no, "支付成功,确认缴费成功" + LogSaverUtils.getQRSaveLog(out_trade_no, mPatientName, ALLPrize + ""));
                    printMsg = PrintMsgAndDialogUtils.setPrintMsg(myApplication, isWeixinPay ? 2 : 1, mCardNo,
                            mPatientName, "门诊缴费", "", patientInfo, ALLPrize + "",
                            mSerialNumber,choosedBean.get(0).getOrderID(),invoiceNo);
                    LogSaverUtils.saveTradePrintLog(out_trade_no, printMsg + "
    " + guideInfo + "
    
    
    
    
    "); QRCodePayDialog.dismissQRCodeDialog();
    //            PayResultDialog.showPayResultDialog(getContext(), true, transaction_id, out_trade_no, ALLPrize + "", "", "003136");
                    PayResultDialog.showPayResultDialog(getContext(), true, out_trade_no, out_trade_no, ALLPrize + "", "", "003136");
                    LogSaverUtils.saveQRTradeLog(out_trade_no, "支付成功,确认缴费成功" + LogSaverUtils.getQRSaveLog(out_trade_no, mPatientName, ALLPrize + ""));
                    printMsg = PrintMsgAndDialogUtils.setPrintMsg(myApplication, isWeixinPay ? 2 : 1, mCardNo,
                            mPatientName, "门诊缴费", "", patientInfo, ALLPrize + "",
                            mSerialNumber,choosedBean.get(0).getOrderID(),invoiceNo);
                    LogSaverUtils.saveTradePrintLog(out_trade_no, printMsg + "
    " + guideInfo + "
    
    
    
    
    ");
                }
                if (prescription.getResultInfo().size() > 0) {
                    mPrescriptionAdapter.removePosition(choosedBean.get(0));
                    info_dptnam.setText("-");
                    info_docname.setText("-");
                    info_money.setText("-");
                }
                final String finalPrintMsg = printMsg;
                PayResultDialog.setPrintClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        PayResultDialog.dismissPayResultDialog();
                        PrintMsgAndDialogUtils.showPrintDialog(getContext());
                        if (UrlConf.shouji) {
                            new Handler().postDelayed(new Runnable() {
                                @Override
                                public void run() {
                                    PrintMsgAndDialogUtils.printChangeFinishView();
                                }
                            }, 3000);
                        } else {
                            Bitmap qrBitmap = null;
                            try {
                                qrBitmap = QRCodeUtil.CreateOneDCode(mPatientID, 400, 200);
                            } catch (WriterException e) {
                                e.printStackTrace();
                            }
                            PrinterUtils.getInstances(getContext()).startPrint(finalPrintMsg, guideinfo + "",qrBitmap);
                            PrinterUtils.getInstances(getContext()).setPrintFinishListener(new PrintFinishListener() {
                                @Override
                                public void onPrintSuccess() {
                                    PrintMsgAndDialogUtils.printChangeFinishView();
                                }
    
                                @Override
                                public void onPrintFailed() {
    
                                }
                            });
                        }
                    }
                });
            }
        }
    timerUpdateHandler = new Handler();
    TimerUpdateTask timerUpdateTask = new TimerUpdateTask(isUnion);
    timerUpdateHandler.postDelayed(timerUpdateTask,5000);
  • 相关阅读:
    使用Jmeter进行http接口测试
    Jmeter分布式压测
    Jmeter进阶技能-数据库信息,传递参数
    解决Mac OS X 升级10.10(Yosemite)后ADT(Eclipse)无法找到真机
    bug list
    【adb工具包】Android的工具包log日志抓取
    【AI模型测试】运行过程中出错和解决方案:ImportError: cannot import name '_validate_lengths'
    【AI模型测试】anaconda linux 常用命令、安装源、清理缓存(转)
    【AI模型测试】skimage库安装(转)
    【Python学习】pip 常用命令及控制台怎么查看python 及pip 和已安装包版本号(转)
  • 原文地址:https://www.cnblogs.com/Jackie-zhang/p/8876186.html
Copyright © 2011-2022 走看看