1.无上报的判断时间,改为动态时间,按用户所设的上报间隔的2倍计算时长
2.修改历史订单包括自动订阅订单
This commit is contained in:
4
.idea/deploymentTargetSelector.xml
generated
4
.idea/deploymentTargetSelector.xml
generated
@@ -4,10 +4,10 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
<DropdownSelection timestamp="2026-04-01T06:06:01.472811800Z">
|
<DropdownSelection timestamp="2026-04-20T07:03:55.586316Z">
|
||||||
<Target type="DEFAULT_BOOT">
|
<Target type="DEFAULT_BOOT">
|
||||||
<handle>
|
<handle>
|
||||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=3A040DLJH000R0" />
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=R5CT80BHT3Y" />
|
||||||
</handle>
|
</handle>
|
||||||
</Target>
|
</Target>
|
||||||
</DropdownSelection>
|
</DropdownSelection>
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ class MySubscriptionAdapter(
|
|||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
qMUIPopups.dismiss()
|
qMUIPopups.dismiss()
|
||||||
Intent(mContext, SubscriptionHistoryActivity::class.java).let {
|
Intent(mContext, SubscriptionHistoryActivity::class.java).let {
|
||||||
it.putExtra(ConstantString.DeviceId, item.deviceId)
|
it.putExtra(ConstantString.Id, item.subscriptionId)
|
||||||
mMySubscriptionActivity.startActivity(it)
|
mMySubscriptionActivity.startActivity(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1285,13 +1285,21 @@ interface INetworkService {
|
|||||||
@Query("userId") userId: String, @Query("deviceId") deviceId: String
|
@Query("userId") userId: String, @Query("deviceId") deviceId: String
|
||||||
): BaseResponse<MutableList<SubscriptionsOrderBean>>
|
): BaseResponse<MutableList<SubscriptionsOrderBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备充值得的历史记录(包括自动续订)
|
||||||
|
*/
|
||||||
|
@GET("order$SUBSCRIPTIONS_V3/subscriptions/historyIncludRenew")
|
||||||
|
suspend fun getHistoryIncludeRenew(
|
||||||
|
@Query("subscriptionId") subscriptionId: String
|
||||||
|
): BaseResponse<MutableList<SubscriptionsOrderBean>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交退款申请
|
* 提交退款申请
|
||||||
*/
|
*/
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("order$SUBSCRIPTIONS_V3/refund/commit")
|
@POST("order$SUBSCRIPTIONS_V3/refund/commit")
|
||||||
suspend fun commitRefund(
|
suspend fun commitRefund(
|
||||||
@Field("currency_code") currency_code: String,
|
@Field("currency_code") currencyCode: String,
|
||||||
@Field("orderNum") orderNum: String,
|
@Field("orderNum") orderNum: String,
|
||||||
@Field("chargeId") chargeId: String,
|
@Field("chargeId") chargeId: String,
|
||||||
@Field("amount") amount: Int,
|
@Field("amount") amount: Int,
|
||||||
|
|||||||
@@ -1173,11 +1173,18 @@ object NetworkApi : BaseNetworkApi<INetworkService>(INetworkService.BASE_URL) {
|
|||||||
service.getSubscriptionsHistory(userId, deviceId)
|
service.getSubscriptionsHistory(userId, deviceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备充值得的历史记录(包括自动续订)
|
||||||
|
*/
|
||||||
|
suspend fun getHistoryIncludeRenew(subscriptionId: String) = getResult {
|
||||||
|
service.getHistoryIncludeRenew(subscriptionId)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取设备充值得的历史记录
|
* 获取设备充值得的历史记录
|
||||||
*/
|
*/
|
||||||
suspend fun commitRefund(
|
suspend fun commitRefund(
|
||||||
currency_code: String,
|
currencyCode: String,
|
||||||
orderId: String,
|
orderId: String,
|
||||||
chargeId: String,
|
chargeId: String,
|
||||||
amount: Int,
|
amount: Int,
|
||||||
@@ -1189,7 +1196,7 @@ object NetworkApi : BaseNetworkApi<INetworkService>(INetworkService.BASE_URL) {
|
|||||||
payType: Int
|
payType: Int
|
||||||
) = getResult {
|
) = getResult {
|
||||||
service.commitRefund(
|
service.commitRefund(
|
||||||
currency_code,
|
currencyCode,
|
||||||
orderId,
|
orderId,
|
||||||
chargeId,
|
chargeId,
|
||||||
amount,
|
amount,
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ class LedLightActivityV0 : BaseActivity<ActivityLedLightBinding>(ActivityLedLigh
|
|||||||
setDisabledState(false)
|
setDisabledState(false)
|
||||||
} else {
|
} else {
|
||||||
//是否超时上报
|
//是否超时上报
|
||||||
val isTimeoutReport = Util.isTimeoutReport(updateTime)
|
val isTimeoutReport = Util.isTimeoutReport(updateTime,gnssInterval)
|
||||||
if (powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || powerSwitch == ConstantInt.Type3 || inWifiZone == ConstantInt.Type1 || isTimeoutReport) {
|
if (powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || powerSwitch == ConstantInt.Type3 || inWifiZone == ConstantInt.Type1 || isTimeoutReport) {
|
||||||
setDisabledState(true)
|
setDisabledState(true)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class SubscriptionHistoryActivity :
|
|||||||
|
|
||||||
private lateinit var mHistoryAdapter: SubscriptionHistoryAdapter
|
private lateinit var mHistoryAdapter: SubscriptionHistoryAdapter
|
||||||
private var mSubscriptionsOrderList = mutableListOf<SubscriptionsOrderBean>()
|
private var mSubscriptionsOrderList = mutableListOf<SubscriptionsOrderBean>()
|
||||||
private var mDeviceId = ""
|
private var subscriptionId = ""
|
||||||
private var mRefreshPackage = true
|
private var mRefreshPackage = true
|
||||||
|
|
||||||
override fun getTopBar() = mViewBinding.ilSubscriptionHistoryTopBar.titleTopBar
|
override fun getTopBar() = mViewBinding.ilSubscriptionHistoryTopBar.titleTopBar
|
||||||
@@ -41,7 +41,7 @@ class SubscriptionHistoryActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
intent?.extras?.apply {
|
intent?.extras?.apply {
|
||||||
mDeviceId = getString(ConstantString.DeviceId, "")
|
subscriptionId = getString(ConstantString.Id, "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class SubscriptionHistoryActivity :
|
|||||||
super.onResume()
|
super.onResume()
|
||||||
if (mRefreshPackage) {
|
if (mRefreshPackage) {
|
||||||
mRefreshPackage = false
|
mRefreshPackage = false
|
||||||
mSubscriptionViewModel.getSubscriptionsHistory(mDeviceId)
|
mSubscriptionViewModel.getHistoryIncludeRenew("sub_1TN3ccCUI9XSagUNmhpfpRk4")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -537,9 +537,7 @@ class RouteV3Fragment : BaseFragment<FragmentRouteV3Binding>(FragmentRouteV3Bind
|
|||||||
vsbMapRouteLineV3.visibility = View.VISIBLE
|
vsbMapRouteLineV3.visibility = View.VISIBLE
|
||||||
ivMapRouteLineV3LastBtn.visibility = View.VISIBLE
|
ivMapRouteLineV3LastBtn.visibility = View.VISIBLE
|
||||||
ivMapRouteLineV3NextBtn.visibility = View.VISIBLE
|
ivMapRouteLineV3NextBtn.visibility = View.VISIBLE
|
||||||
LogUtil.e("显示")
|
|
||||||
} else {
|
} else {
|
||||||
LogUtil.e("隐藏")
|
|
||||||
vsbMapRouteLineV3.visibility = View.GONE
|
vsbMapRouteLineV3.visibility = View.GONE
|
||||||
ivMapRouteLineV3LastBtn.visibility = View.GONE
|
ivMapRouteLineV3LastBtn.visibility = View.GONE
|
||||||
ivMapRouteLineV3NextBtn.visibility = View.GONE
|
ivMapRouteLineV3NextBtn.visibility = View.GONE
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ class HomeTrackFragment :
|
|||||||
}
|
}
|
||||||
|
|
||||||
//是否超时上报
|
//是否超时上报
|
||||||
val isTimeoutReport = Util.isTimeoutReport(updateTime)
|
val isTimeoutReport = Util.isTimeoutReport(updateTime,gnssInterval)
|
||||||
mTrackStateList[0].let {
|
mTrackStateList[0].let {
|
||||||
it.menuValue =
|
it.menuValue =
|
||||||
if (isTimeoutReport || lteSignal == ConstantInt.NoSignal || powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2) {
|
if (isTimeoutReport || lteSignal == ConstantInt.NoSignal || powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2) {
|
||||||
@@ -773,7 +773,7 @@ class HomeTrackFragment :
|
|||||||
private fun setLedControlState(mapDeviceBean: MapDeviceBean) {
|
private fun setLedControlState(mapDeviceBean: MapDeviceBean) {
|
||||||
mapDeviceBean.apply {
|
mapDeviceBean.apply {
|
||||||
//是否超时上报
|
//是否超时上报
|
||||||
val isTimeoutReport = Util.isTimeoutReport(updateTime)
|
// val isTimeoutReport = Util.isTimeoutReport(updateTime,gnssInterval)
|
||||||
mTrackStateList[5].let {
|
mTrackStateList[5].let {
|
||||||
if (deviceType == ConstantInt.Type1) {
|
if (deviceType == ConstantInt.Type1) {
|
||||||
it.imageId = R.drawable.icon_light_svg
|
it.imageId = R.drawable.icon_light_svg
|
||||||
|
|||||||
@@ -747,8 +747,9 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
|||||||
mapDeviceBean.apply {
|
mapDeviceBean.apply {
|
||||||
val share = MMKVUtil.getInt(MMKVKey.Shared)
|
val share = MMKVUtil.getInt(MMKVKey.Shared)
|
||||||
//分钟后无上报、没有lte信号或在wifi中隐藏直播按钮
|
//分钟后无上报、没有lte信号或在wifi中隐藏直播按钮
|
||||||
isCanLive =
|
isCanLive = !(Util.isTimeoutReport(
|
||||||
!(Util.isTimeoutReport(updateTime) || powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || powerSwitch == ConstantInt.Type3 || inWifiZone == ConstantInt.Type1)
|
updateTime, gnssInterval
|
||||||
|
) || powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || powerSwitch == ConstantInt.Type3 || inWifiZone == ConstantInt.Type1)
|
||||||
mViewBinding.homeMapLiveBtn.visibility =
|
mViewBinding.homeMapLiveBtn.visibility =
|
||||||
if (share != ConstantInt.NoShare || deviceType == ConstantInt.Type1) {
|
if (share != ConstantInt.NoShare || deviceType == ConstantInt.Type1) {
|
||||||
View.GONE
|
View.GONE
|
||||||
@@ -777,7 +778,7 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收添加信用卡返回结果
|
* 接收直播页面宠物弹窗操作
|
||||||
*/
|
*/
|
||||||
private val mActivityResultLauncher =
|
private val mActivityResultLauncher =
|
||||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||||
|
|||||||
@@ -797,14 +797,14 @@ class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是超时上报了
|
* 是否是超时上报了,按用户所设的上报间隔的2倍计算时长
|
||||||
*
|
*
|
||||||
* @param updateTime 10位时间戳
|
* @param updateTime 10位时间戳
|
||||||
*/
|
*/
|
||||||
fun isTimeoutReport(updateTime: Long): Boolean {
|
fun isTimeoutReport(updateTime: Long, gnssInterval: Int): Boolean {
|
||||||
val now = System.currentTimeMillis() / 1000
|
val now = System.currentTimeMillis() / 1000
|
||||||
val updateMin = (now - updateTime) / 60
|
val updateSecond = now - updateTime
|
||||||
return updateMin > ConstantInt.ReportTimeOutTime
|
return updateSecond > gnssInterval * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@@ -834,7 +834,7 @@ class Util {
|
|||||||
var isControl: Boolean
|
var isControl: Boolean
|
||||||
mapDeviceBean.apply {
|
mapDeviceBean.apply {
|
||||||
//是否超时上报
|
//是否超时上报
|
||||||
val isTimeoutReport = isTimeoutReport(updateTime)
|
val isTimeoutReport = isTimeoutReport(updateTime, gnssInterval)
|
||||||
isControl = if (powerSwitch == ConstantInt.Type3) false
|
isControl = if (powerSwitch == ConstantInt.Type3) false
|
||||||
else if (SRBleUtil.instance.isMacConnect(mac)) true
|
else if (SRBleUtil.instance.isMacConnect(mac)) true
|
||||||
else if (powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || inWifiZone == ConstantInt.Type1 || isTimeoutReport) false
|
else if (powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || inWifiZone == ConstantInt.Type1 || isTimeoutReport) false
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class MapViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//网络无信号/ 分钟后无上报所有绿点取消显示
|
//网络无信号/ 分钟后无上报所有绿点取消显示
|
||||||
else if (lteSignal <= ConstantInt.NoSignal || Util.isTimeoutReport(updateTime)) {
|
else if (lteSignal <= ConstantInt.NoSignal || Util.isTimeoutReport(updateTime,gnssInterval)) {
|
||||||
// setNoState(context, deviceStateList)
|
// setNoState(context, deviceStateList)
|
||||||
|
|
||||||
//警告状态
|
//警告状态
|
||||||
@@ -307,7 +307,7 @@ class MapViewModel : ViewModel() {
|
|||||||
) {
|
) {
|
||||||
mapDeviceBean.let {
|
mapDeviceBean.let {
|
||||||
//是否超时上报
|
//是否超时上报
|
||||||
val isTimeoutReport = Util.isTimeoutReport(it.updateTime)
|
val isTimeoutReport = Util.isTimeoutReport(it.updateTime,it.gnssInterval)
|
||||||
deviceStateList[0].apply {
|
deviceStateList[0].apply {
|
||||||
menuType = ConstantInt.Open
|
menuType = ConstantInt.Open
|
||||||
val lteValue =
|
val lteValue =
|
||||||
|
|||||||
@@ -61,6 +61,13 @@ class SubscriptionManageViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getHistoryIncludeRenew(subscriptionId: String) {
|
||||||
|
viewModelScope.launch {
|
||||||
|
val result = NetworkApi.getHistoryIncludeRenew(subscriptionId)
|
||||||
|
mSubscriptionsHistoryLiveData.value = result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun commitRefund(
|
fun commitRefund(
|
||||||
orderId: String,
|
orderId: String,
|
||||||
chargeId: String,
|
chargeId: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user