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);
  • 相关阅读:
    关于Debian中virtualbox的问题
    aptget和aptitude的区别
    Archlinux安装笔记
    数组全排列的递归方法实现
    Debian卸载iceweasel
    一起学WP7 XNA游戏开发(八. 让3d model动起来)
    一起学windows phone7开发(二十五.Toolkit 增补)
    专业windows phone7开发网站上线
    《一起学Windows phone7开发》系列视频课程
    一起学WindowsPhone7开发(二十六. Advertising)
  • 原文地址:https://www.cnblogs.com/Jackie-zhang/p/8876186.html
Copyright © 2011-2022 走看看