[2.14.0]避免Bag列表出现重复key的bag包
This commit is contained in:
@@ -280,6 +280,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
clBagHaveDataLayout.visibility = View.VISIBLE
|
||||
clBagNoDataLayout.visibility = View.GONE
|
||||
if(bagManager.bagsInfoRespCount>0){
|
||||
bagManagerEntity.bagsInfoResp.clear()
|
||||
for(bagInfo in bagManager.bagsInfoRespList){
|
||||
bagInfo?.let {
|
||||
it.timestamp?.let { time ->
|
||||
@@ -291,6 +292,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
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)
|
||||
@@ -299,7 +301,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
|
||||
val month = time.substring(4,6)
|
||||
val day = time.substring(6,8)
|
||||
val time = "${month}月${day}日"
|
||||
val timeStr = "${month}月${day}日"
|
||||
var containTime = false
|
||||
for(bag in bagManagerEntity.bagsInfoResp){
|
||||
if(bag.timeStr == time){
|
||||
@@ -308,13 +310,21 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
}
|
||||
if(!containTime || bagManagerEntity.bagsInfoResp.size ==0){
|
||||
//增加时间的
|
||||
val bagInfoEntity = BagInfoEntity()
|
||||
bagInfoEntity.itemType = 1
|
||||
bagInfoEntity.timeStr = time
|
||||
val bagInfoTimeEntity = BagInfoEntity()
|
||||
bagInfoTimeEntity.itemType = 1
|
||||
bagInfoTimeEntity.timeStr = timeStr
|
||||
bagInfoTimeEntity.timestamp = time.substring(0,8)
|
||||
bagManagerEntity.bagsInfoResp.add(bagInfoTimeEntity)
|
||||
}
|
||||
var containKey = false
|
||||
for(bagInfoContain in bagManagerEntity.bagsInfoResp){
|
||||
if(bagInfoContain.key == bagInfoEntity.key){
|
||||
containKey = true
|
||||
}
|
||||
}
|
||||
if(!containKey){
|
||||
bagManagerEntity.bagsInfoResp.add(bagInfoEntity)
|
||||
}
|
||||
|
||||
bagManagerEntity.bagsInfoResp.add(bagInfoEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user