8.7
liugl
2020-08-07 664834b83a4c50cac039bbfa49f5164ca9bf8e3c
app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt
@@ -12,9 +12,7 @@
import com.okgoincar.netUtls.Api
import com.okgoincar.netUtls.callNet
import com.okgoincar.netUtls.getMapByAny
import com.okgoincar.slab.util.DialogUtil
import com.okgoincar.utils.Cache.CacheKey
import io.netty.util.NetUtil
import org.greenrobot.eventbus.EventBus
import java.lang.Exception
@@ -38,13 +36,6 @@
                        var price = intent.getDoubleExtra("price", 0.0) //计价器价格,单位为元
                        var mileage = intent.getDoubleExtra("mileage", 0.0) //里程,单位为km
                        callOver(contexts!!, price)
                    }
                    "android.net.conn.CONNECTIVITY_SUCCESS", "android.net.conn.CONNECTIVITY_FAILURE", "android.net.conn.CONNECTIVITY_CHANGE" -> {
                        toast("收到网络变化")
                        if (NetUtils.isNetworkConnected(MyApplication.getInstance())) {
                            callErrorOrder(contexts!!)
                        }
                    }
                }
            }
@@ -105,7 +96,7 @@
                } else {
                    val bean = CacheKey.getLocalOrderBean()
                    bean?.let {
                        if (bean.money >= 0.0) {
                        if (bean.money > 0.0) {
                            return@callOver
                        }
                        bean.endTime = System.currentTimeMillis()
@@ -120,12 +111,13 @@
        /***
         * 上传异常订单
         */
        private fun callErrorOrder(contexts: Context) {
        fun callErrorOrder(contexts: Context) {
            var bean = CacheKey.getLocalOrderBean()
            bean?.let {
                if (bean.money <= 0.0) {
                    return@let
                }
                CacheKey.saveLocalOrderBeanNull()
                val map = getMapByAny()
                map["orderId"] = bean.orderId
                map["orderType"] = bean.orderType
@@ -136,7 +128,6 @@
                    EventBus.getDefault().post(BaseEvent(BaseEvent.ERROR_INFO))
                }
            }
        }
        private fun callStartOrder(contexts: Context, i: Int) {