[fea]
[班车核销]
This commit is contained in:
yangyakun
2024-12-17 17:10:54 +08:00
parent a2fe4e1ccf
commit c2593a8766
5 changed files with 13 additions and 84 deletions

View File

@@ -82,7 +82,8 @@ data class WriteOffDetialMsg(
val phone: String?=null,// 手机号码
val ticketSize: Int?=null,// 票上几个人
val ticketName: String?=null,// 票的名称
val typeBiz: String?=null,//bus shuttle
val typeBiz: Int?=null,//
val shiftsId:Long?=null,// 班车 任务id
val pipe:String?=null,// 渠道ehsafety mogogosafety
val startStationId:Long?=null,// 开始站点名称
val tenantId:Long?=null// 租户id

View File

@@ -124,7 +124,7 @@ class WriteOffCacheRepository : IWriteOffRepository {
}
}
// 3、校验 bus和shuttle
if (LoginStatusManager.getBusInessType()!=Product.valueOf4Wx(it.typeBiz)) {
if (LoginStatusManager.getBusInessType()!=Product.valueOf(it.typeBiz)) {
throw DataException(1005,"车辆未登录、或没有任务")
}
// 4 二维码1分钟失效
@@ -163,25 +163,20 @@ class WriteOffCacheRepository : IWriteOffRepository {
if (start?.siteId?.toLong() == it.startStationId) {
siteId = it.startStationId
} else {
throw DataException(
6003,
"车票站点信息与当前车辆执行任务的站点信息不符合"
)
throw DataException(6003, "车票站点信息与当前车辆执行任务的站点信息不符合")
}
} else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
} else if(AppIdentityModeUtils.isScheduled(FunctionBuildConfig.appIdentityMode)){
val (start, _) = LineManager.getStations()
siteId = start?.siteId?.toLong() ?: 0
// 8、校验起始站点
val task = LineModel.currentTask
if(task==null){
throw DataException(6004, "车辆未执行任务")
}else{
if (task.taskStartTime!=it.bookingTime) {
throw DataException(
6005,
"车票站点信息与当前车辆执行任务信息不符合"
)
if (task.taskId!=it.shiftsId) {
throw DataException(6005, "车票站点信息与当前车辆执行任务信息不符合")
}
}
}
} else {
throw DataException(11000, "缺少orderNo")

View File

@@ -93,6 +93,7 @@ object TicketModel : StateChangeListener {
val pipe = params["pipe"]
val startStationId = params["startStationId"]
val tenantId = params["tenantId"]
val shiftsId = params["shiftsId"]
if(orderNo is String && uid is String){
var phoneNum = ""
@@ -112,7 +113,8 @@ object TicketModel : StateChangeListener {
phoneNum,
ticketSize?.toInt()?:0,
URLDecoder.decode(ticketName?:"","UTF-8"),
type,
type?.toInt()?:0,
shiftsId?.toLong()?:0,
pipe,
startStationId?.toLong()?:0,
tenantId?.toLong()?:0

View File

@@ -1,54 +0,0 @@
package com.mogo.och.unmanned.taxi.utils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import io.reactivex.exceptions.UndeliverableException
import io.reactivex.functions.Consumer
import io.reactivex.plugins.RxJavaPlugins
import java.io.IOException
object RxJavaUtils {
fun setErrorHandler(tag: String) {
//2022.1.28
// 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
// The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the excTeption has nowhere to go to begin with
RxJavaPlugins.setErrorHandler(Consumer { e ->
var e = e
if (e is UndeliverableException) {
e = (e.cause)!!
CallerLogger.d(tag, "UndeliverableException")
}
if ((e is IOException)) { //
// fine, irrelevant network problem or API that throws on cancellation
CallerLogger.d(tag, "IOException")
return@Consumer
}
if (e is InterruptedException) {
// fine, some blocking code was interrupted by a dispose call
CallerLogger.d(tag, "InterruptedException")
return@Consumer
}
if ((e is NullPointerException) || (e is IllegalArgumentException)) {
// that's likely a bug in the application
CallerLogger.d(
tag,
"NullPointerException or IllegalArgumentException"
)
Thread.currentThread().uncaughtExceptionHandler?.uncaughtException(
Thread.currentThread(),
e
)
return@Consumer
}
if (e is IllegalStateException) {
// that's a bug in RxJava or in a custom operator
CallerLogger.d(tag, "IllegalStateException")
Thread.currentThread().uncaughtExceptionHandler?.uncaughtException(
Thread.currentThread(),
e
)
return@Consumer
}
CallerLogger.d(tag, "Undeliverable exception")
})
}
}

View File

@@ -363,7 +363,7 @@ enum class Product(val code: Int) {
SCHEDULED(14);
companion object {
@JvmStatic
fun valueOf(code: Int): Product {
fun valueOf(code: Int?): Product {
for (value in values()) {
if (value.code == code) {
return value
@@ -371,21 +371,6 @@ enum class Product(val code: Int) {
}
return NONE
}
fun valueOf4Wx(name: String?): Product {
when (name) {
"shuttle" -> {
return SHUTTLE
}
"bus" -> {
return BUS
}
"commute" -> {
return SCHEDULED
}
else -> {}
}
return NONE
}
}
}