• 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);
  • 相关阅读:
    Web--10月8日随笔
    Web--10月9日随笔
    Web-9月12日笔记
    jfinal处理完html提交过来的数据,将处理信息返回给html页面。html根据返回值进行相应的处理
    python爬取网页的通用代码框架
    解决:AttributeError: module 'requests' has no attribute 'post'”
    在python学习时间过程中,你会不断发现需要解决的问题,更多需要连接未知,这时候到哪里去查阅资料呢?
    为了应对异常情况,提供最原始的python第三方库的安装方法:手动安装。往往是Windows用户需要用到这种方法。
    根据需要查找需要的第三方pyhton库
    python小练习:使用循环和函数实现一个摇骰子小游戏。游戏规则如下:游戏开始,首先玩家选择Big or Small(押大小),选择完成后开始摇三个骰子,计算总值,11<=总值<=18为“大”,3<=总值<=10为“小”。然后告诉玩家猜对或者是猜错的结果。
  • 原文地址:https://www.cnblogs.com/Jackie-zhang/p/8876186.html
Copyright © 2020-2023  润新知