[shuttle]
[ui修改]
This commit is contained in:
yangyakun
2024-08-28 17:45:43 +08:00
parent 75ff8ccd28
commit 684cec78a9
8 changed files with 34 additions and 32 deletions

View File

@@ -27,6 +27,9 @@ interface EventDataDao {
@Query("SELECT * FROM ${EventDataBean.evnetDataTable} WHERE update_status = ${EventDataBean.notUpdate} LIMIT 10 OFFSET 0")
fun queryEventByStatusWithPage():List<EventDataBean>?
@Query("SELECT count(1) FROM ${EventDataBean.evnetDataTable} WHERE update_status = ${EventDataBean.notUpdate}")
fun queryEventByStatusWithPageCount():Int
@Query("SELECT * FROM ${EventDataBean.evnetDataTable} WHERE update_status = ${EventDataBean.notUpdate} and event_save_time > :zeroTime GROUP by task_start_time")
fun queryWaitUploadInfo(zeroTime: Long = DateTimeUtil.getCurrentDateZero()): Observable<List<EventDataBean>?>

View File

@@ -104,6 +104,10 @@ object EventRepository {
return eventDataDao?.queryEventByStatusWithPage()
}
fun queryWaitUpdateEventCount():Int?{
return eventDataDao?.queryEventByStatusWithPageCount()
}
fun queryLastData(): EventDataBean? {
val queryLastDataByWaritData = eventDataDao?.queryLastDataByWaritData()
if(queryLastDataByWaritData.isNullOrEmpty()){

View File

@@ -69,6 +69,11 @@ object EventModel : EventRepository.EventCallback {
EventRepository.saveUpdateSuccess(waitUpdateEvent)
isUpdating.set(false)
createDefault.onNext(isUpdating.get())
val queryWaitUpdateEventCount = EventRepository.queryWaitUpdateEventCount()
if(queryWaitUpdateEventCount!=null&&queryWaitUpdateEventCount>0){
updateEvent()
return
}
BizLoopManager.postDelayed(loopUpdateInfo,2*60*1000)
}
@@ -76,14 +81,14 @@ object EventModel : EventRepository.EventCallback {
isUpdating.set(false)
createDefault.onNext(isUpdating.get())
OchChainLogManager.writeChainLogDb("上报event失败","$transformDb2Net ${Thread.currentThread().name}")
BizLoopManager.postDelayed(loopUpdateInfo,2*60*1000)
BizLoopManager.postDelayed(loopUpdateInfo,10*1000)
}
override fun onError() {
isUpdating.set(false)
createDefault.onNext(isUpdating.get())
OchChainLogManager.writeChainLogDb("上报event失败","$transformDb2Net ${Thread.currentThread().name}")
BizLoopManager.postDelayed(loopUpdateInfo,2*60*1000)
BizLoopManager.postDelayed(loopUpdateInfo,10*1000)
}
})

View File

@@ -713,11 +713,13 @@ object OrderModel {
// 登出
@JvmStatic
fun logout() {
if(EventModel.haveDataWaitSyn()){
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error))
return
ThreadUtils.getIoPool().execute {
if(EventModel.haveDataWaitSyn()){
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error))
return@execute
}
LoginStatusManager.loginOut()
}
LoginStatusManager.loginOut()
}
@JvmStatic

View File

@@ -43,23 +43,8 @@ class SwitchLineAdapter(
val currentPosition = holder.bindingAdapterPosition
val line = mData[currentPosition]
line.name?.let {
val lineName =if(it.length>10){
it.substring(0,10)+""
}else{
it
}
holder.lineName.text = lineName
}
val sb = StringBuilder()
if (line.endSiteName!=null&&line.endSiteName.length>10) {
sb.append(line.endSiteName.substring(0,5))
sb.append("")
sb.append(line.endSiteName.substring(line.endSiteName.length-5,line.endSiteName.length))
}else{
sb.append(line.endSiteName)
}
val string = mContext.getString(R.string.bus_line_goto_end, sb.toString())
holder.lineName.text = line.name
val string = mContext.getString(R.string.bus_line_goto_end, line.endSiteName)
holder.lineEndName.text = string
holder.rvLineTask.layoutManager = GridLayoutManager(mContext, 3)
val switchLineTaskAdapter = SwitchLineTaskAdapter(

View File

@@ -14,22 +14,18 @@ import com.mogo.och.common.module.wigets.WindowRelativeLayout
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.WaitUploadLine
import com.mogo.och.weaknet.ui.adapter.OpenItemAnimator
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.aciv_show_data
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.actvCurrentDate
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.clLayout
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.ivTaskRunningClose
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.no_order_data_view
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.rvDataLiet
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.tvManagerTitle
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.upload_btn_commit
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.upload_btn_commit_progress
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.upload_btn_commit_title
import me.jessyan.autosize.utils.AutoSizeUtils
/**
* @author XuXinChao
* @description BadCase录包管理页面
* @since: 2022/12/15
*/
class RunningTaskManagerView: WindowRelativeLayout, RunningTastViewModel.RunningTaskViewCallback {
@@ -115,10 +111,14 @@ class RunningTaskManagerView: WindowRelativeLayout, RunningTastViewModel.Running
mAdapter.setDataList(data)
if(data.isEmpty()){
rvDataLiet.visibility = GONE
tvManagerTitle.visibility = VISIBLE
no_order_data_view.visibility = VISIBLE
aciv_show_data.visibility = GONE
upload_btn_commit.visibility = GONE
}else{
rvDataLiet.visibility = VISIBLE
tvManagerTitle.visibility = GONE
no_order_data_view.visibility = GONE
aciv_show_data.visibility = VISIBLE
upload_btn_commit.visibility = VISIBLE
}
}

View File

@@ -30,6 +30,7 @@
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_show_data"
app:layout_constraintTop_toTopOf="@+id/tvManagerTitle"
app:layout_constraintBottom_toBottomOf="@+id/tvManagerTitle"
app:layout_constraintStart_toEndOf="@+id/tvManagerTitle"

View File

@@ -36,17 +36,19 @@
android:layout_marginStart="@dimen/dp_80"
android:layout_marginTop="@dimen/dp_34"
android:ellipsize="end"
android:maxLines="2"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_46"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@+id/actv_show_more"
tools:text="@string/bus_switch_line_name" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/switch_line_end_station"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_35"
android:singleLine="true"