liugl
2021-01-14 40f9ac00ec5e4d6363450d1c8e0b0937cc0b1de4
app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt
@@ -146,19 +146,20 @@
                if (bean.startTime <= 0L) {
                    if (NetUtils.isNetworkConnected(MyApplication.getInstance())){
                        CacheKey.saveLocalOrderBeanNull()
                        MyApplication.currentOrderId = ""
                        toast("调用正常结束,在异常订单中")
                        callEndOrder(contexts,bean.money)
                    }
                }else{
                    if (NetUtils.isNetworkConnected(MyApplication.getInstance())){
                        CacheKey.saveLocalOrderBeanNull()
                        MyApplication.currentOrderId = ""
                        val map = getMapByAny()
                        map["orderId"] = bean.orderId
                        map["orderType"] = bean.orderType
                        map["type"] = "1"
                        map["travelFee"] = bean.money
                        CacheKey.saveLocalOrderBeanNull()
                        toast("调用异常结束,在异常订单中 id==="+bean.orderId)
                        callNet(contexts, "api/order/confirmFees$", map,{
                            MyApplication.currentOrderId = ""
                            toast("上传异常订单成功")
                            EventBus.getDefault().post(BaseEvent(BaseEvent.ERROR_INFO))
                        }) {
@@ -167,11 +168,10 @@
                        }
                    }
                }
            }
        }
        private fun callStartOrder(contexts: Context, i: Int) {
         fun callStartOrder(contexts: Context, i: Int) {
            var map = getMapByAny()
            map["orderId"] = MyApplication.currentOrderId
            map["orderType"] = MyApplication.currentOrderType
@@ -203,9 +203,11 @@
                mapOrder["orderType"] = MyApplication.currentOrderType
                callNet(contexts, Api.queryOrderInfo, mapOrder) {
                    var orderBean = Gson().fromJson(it, OrderBean::class.java)
                    EventBus.getDefault().post(BaseEvent(BaseEvent.UPDATA_MAIN_CAR))
                    if (orderBean.data.orderState == 7){
                        EventBus.getDefault().post(BaseEvent(BaseEvent.SURE_MONEY))
                    }
                    MyApplication.currentOrderId = ""
                    if (orderBean.data.orderState == 2 ||orderBean.data.orderState == 3 || orderBean.data.orderState == 4 ){
                        Handler(Looper.getMainLooper()).postDelayed({
                            toast("发送网约")