|
|
@@ -1587,8 +1587,11 @@ object BusinessManager {
|
|
|
data.taskCode?.toLong()!!,
|
|
|
keyNfc!!,
|
|
|
MyApplication.instance!!.serialNo()
|
|
|
- ) { isSuccess ->
|
|
|
- if (!isSuccess) {
|
|
|
+ ) { isSuccess, msg ->
|
|
|
+ if (!isSuccess && msg != MyApplication.instance?.applicationContext!!.getString(
|
|
|
+ R.string.ticket_lost
|
|
|
+ )
|
|
|
+ ) {
|
|
|
SPUtils.saveUpdateKeyReturn(
|
|
|
MyApplication.instance!!,
|
|
|
UpdateKeyReturnBO(data.taskCode?.toLong()!!, keyNfc!!)
|
|
|
@@ -1624,8 +1627,15 @@ object BusinessManager {
|
|
|
*/
|
|
|
fun handleVirtualKeyReturn(taskCode: Long, keyNfc: String, done: () -> Unit) {
|
|
|
// 上报钥匙归还
|
|
|
- NetApi.updateKeyReturn(taskCode, keyNfc, MyApplication.instance!!.serialNo()) { isSuccess ->
|
|
|
- if (!isSuccess) {
|
|
|
+ NetApi.updateKeyReturn(
|
|
|
+ taskCode,
|
|
|
+ keyNfc,
|
|
|
+ MyApplication.instance!!.serialNo()
|
|
|
+ ) { isSuccess, msg ->
|
|
|
+ if (!isSuccess && msg != MyApplication.instance?.applicationContext!!.getString(
|
|
|
+ R.string.ticket_lost
|
|
|
+ )
|
|
|
+ ) {
|
|
|
SPUtils.saveUpdateKeyReturn(
|
|
|
MyApplication.instance!!,
|
|
|
UpdateKeyReturnBO(taskCode, keyNfc)
|
|
|
@@ -1931,9 +1941,12 @@ object BusinessManager {
|
|
|
itemsToRemove.forEach { itData ->
|
|
|
NetApi.updateKeyReturn(
|
|
|
itData.ticketId, itData.keyNfc, context.serialNo()
|
|
|
- ) { isSuccess ->
|
|
|
+ ) { isSuccess, msg ->
|
|
|
count++
|
|
|
- if (isSuccess) {
|
|
|
+ if (isSuccess || msg == MyApplication.instance?.applicationContext!!.getString(
|
|
|
+ R.string.ticket_lost
|
|
|
+ )
|
|
|
+ ) {
|
|
|
returnList.remove(itData)
|
|
|
getBleBeanByRfid(itData.keyNfc)?.bleDevice?.let {
|
|
|
switchReadyMode(it)
|