[2.14.0]fix录包工具Bag列表显示问题

This commit is contained in:
xuxinchao
2023-02-19 22:32:40 +08:00
parent 09e88c13f6
commit 37c93969ea
3 changed files with 48 additions and 21 deletions

View File

@@ -281,30 +281,40 @@ class BadCaseManagerView @JvmOverloads constructor(
clBagNoDataLayout.visibility = View.GONE
if(bagManager.bagsInfoRespCount>0){
bagManagerEntity.bagsInfoResp.clear()
val originBagInfoList = ArrayList<BagInfoEntity>()
for(bagInfo in bagManager.bagsInfoRespList){
bagInfo?.let {
it.timestamp?.let { time ->
val descriptionEntity = BagDescriptionEntity(it.description.description,it.description.hasAudio,it.description.audioUrl,it.description.reportBI)
val bagInfoEntity = BagInfoEntity()
bagInfoEntity.key = it.key
bagInfoEntity.totalSize = it.totalSize
bagInfoEntity.timestamp = it.timestamp
bagInfoEntity.bagPath = it.bagPath
bagInfoEntity.mergeStat = it.mergeStat
bagInfoEntity.uploadStat = it.uploadStat
bagInfoEntity.itemType = 0
bagInfoEntity.description = descriptionEntity
for(subBag in it.subBagsList){
val subBagEntity = SubBagEntity(subBag.key,subBag.host,subBag.size)
bagInfoEntity.subBags.add(subBagEntity)
}
val descriptionEntity = BagDescriptionEntity(it.description.description,it.description.hasAudio,it.description.audioUrl,it.description.reportBI)
val bagInfoEntity = BagInfoEntity()
bagInfoEntity.key = it.key
bagInfoEntity.totalSize = it.totalSize
bagInfoEntity.timestamp = it.timestamp
bagInfoEntity.bagPath = it.bagPath
bagInfoEntity.mergeStat = it.mergeStat
bagInfoEntity.uploadStat = it.uploadStat
bagInfoEntity.itemType = 0
bagInfoEntity.description = descriptionEntity
for(subBag in it.subBagsList){
val subBagEntity = SubBagEntity(subBag.key,subBag.host,subBag.size)
bagInfoEntity.subBags.add(subBagEntity)
}
originBagInfoList.add(bagInfoEntity)
//对数组按照时间顺序进行倒序排序
originBagInfoList.sortWith(Comparator { o1, o2 ->
o2.timestamp.compareTo(o1.timestamp)
})
}
}
for(originBagInfo in originBagInfoList){
originBagInfo.let {
it.timestamp.let { time ->
val month = time.substring(4,6)
val day = time.substring(6,8)
val timeStr = "${month}${day}"
var containTime = false
for(bag in bagManagerEntity.bagsInfoResp){
if(bag.timeStr == time){
if(bag.timeStr == timeStr){
containTime = true
}
}
@@ -318,16 +328,17 @@ class BadCaseManagerView @JvmOverloads constructor(
}
var containKey = false
for(bagInfoContain in bagManagerEntity.bagsInfoResp){
if(bagInfoContain.key == bagInfoEntity.key){
if(bagInfoContain.key == it.key){
containKey = true
}
}
if(!containKey){
bagManagerEntity.bagsInfoResp.add(bagInfoEntity)
bagManagerEntity.bagsInfoResp.add(it)
}
}
}
}
//更新List
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
}
@@ -362,6 +373,22 @@ class BadCaseManagerView @JvmOverloads constructor(
bagUploadDialog?.uploadCompleted()
tvCancelSelect.performClick()
}
when (bagManager.uploadCosResp.stat) {
0 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶成功")
}
2 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶copy过程失败,原因:${bagManager.uploadCosResp.message}")
}
3 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶合并过程失败,原因:${bagManager.uploadCosResp.message}")
}
4 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶上传过程失败,原因:${bagManager.uploadCosResp.message}")
}
}
}
//删除Bag
else if(bagManager.reqType == 4){

View File

@@ -29,11 +29,11 @@
android:layout_marginEnd="30dp"
android:background="@null"
android:drawableEnd="@drawable/icon_bag_edit"
android:drawablePadding="@dimen/dp_10"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end"
android:maxLength="9"
/>
<TextView