|
@@ -25,6 +25,7 @@ import com.doverfuelingsolutions.issp.view.MainActivity
|
|
|
import com.doverfuelingsolutions.issp.view.adapter.ChooseListAdapter
|
|
|
import com.doverfuelingsolutions.issp.view.adapter.OrderListAdapter
|
|
|
import com.doverfuelingsolutions.issp.view.fragment.callback.RefreshOrder
|
|
|
+import com.doverfuelingsolutions.issp.view.util.ClickUtils
|
|
|
import com.scwang.smart.refresh.header.ClassicsHeader
|
|
|
import com.wayne.www.waynelib.fdc.message.DeviceClass
|
|
|
import com.wayne.www.waynelib.util.log.DFSLog
|
|
@@ -112,6 +113,7 @@ class FragmentOrderList private constructor() : FragmentBasic(),RefreshOrder {
|
|
|
// }
|
|
|
|
|
|
private fun selectOrder(dc: DeviceClass, type: Int, position: Int) {
|
|
|
+ if (ClickUtils.isFastClick()) return
|
|
|
lifecycleScope.launchWhenStarted {
|
|
|
when {
|
|
|
dc.releaseTokenElement == null || dc.releaseTokenAttribute == null -> {
|
|
@@ -236,24 +238,24 @@ class FragmentOrderList private constructor() : FragmentBasic(),RefreshOrder {
|
|
|
DFSLog.w("barcodeId:$barcodeId")
|
|
|
}
|
|
|
|
|
|
- // 获取云订单(本地需要缓存,避免重复生成订单)
|
|
|
- var posTrx: PosTrx? = SPUtil.findWayneOrder(dc)
|
|
|
- if (posTrx == null) {
|
|
|
- val resultReportPayment = SystemApi.generateOrder(dc, posItemUniqueId)
|
|
|
- if (resultReportPayment.success && resultReportPayment.data != null && !resultReportPayment.data.id.isNullOrEmpty()) {
|
|
|
- posTrx = resultReportPayment.data
|
|
|
- SPUtil.addWayneOrder(dc, posTrx)
|
|
|
- } else {
|
|
|
- dialog.dismiss()
|
|
|
- (requireActivity() as MainActivity).fragmentRouter.resumeFragmentToolbarTimer()
|
|
|
- DFSToastUtil.fail(StringUtil.get(R.string.fail_behave_reason, StringUtil.get(R.string.make_cloud_order), resultReportPayment.message))
|
|
|
- }
|
|
|
+ // 获取云订单(本地需要缓存,避免重复生成订单),2025-07 ,从接口处理,不需要再缓存
|
|
|
+// var posTrx: PosTrx? = SPUtil.findWayneOrder(dc)
|
|
|
+// if (posTrx == null) {
|
|
|
+//
|
|
|
+// }
|
|
|
+ var posTrx:PosTrx? = null
|
|
|
+ val resultReportPayment = SystemApi.generateOrder(dc, posItemUniqueId)
|
|
|
+ if (resultReportPayment.success && resultReportPayment.data != null && !resultReportPayment.data.id.isNullOrEmpty()) {
|
|
|
+ posTrx = resultReportPayment.data
|
|
|
+ } else {
|
|
|
+ dialog.dismiss()
|
|
|
+ (requireActivity() as MainActivity).fragmentRouter.resumeFragmentToolbarTimer()
|
|
|
+ DFSToastUtil.fail(StringUtil.get(R.string.fail_behave_reason, StringUtil.get(R.string.make_cloud_order), resultReportPayment.message))
|
|
|
}
|
|
|
|
|
|
// 锁定订单
|
|
|
if (posTrx == null) return@launchWhenStarted
|
|
|
val resultLock = FusionManager.lockOrder(dc, true)
|
|
|
- dialog.dismiss()
|
|
|
(requireActivity() as MainActivity).fragmentRouter.resumeFragmentToolbarTimer()
|
|
|
if (resultLock.success) {
|
|
|
dc.state = "Locked"
|
|
@@ -262,6 +264,7 @@ class FragmentOrderList private constructor() : FragmentBasic(),RefreshOrder {
|
|
|
} else {
|
|
|
DFSToastUtil.fail(StringUtil.get(R.string.fail_behave_reason, StringUtil.get(R.string.lock_order), resultLock.message))
|
|
|
}
|
|
|
+ dialog.dismiss()
|
|
|
}
|
|
|
} else {
|
|
|
dialog.dismiss()
|