for 循环bug修复

master
hwf452 2 years ago
parent fa47910870
commit 7856149f05

@ -26,7 +26,10 @@ import com.rehome.scbaxj.bean.ScxjjhBean
import com.rehome.scbaxj.bean.StatusInfo2
import com.rehome.scbaxj.contans.Contans
import com.rehome.scbaxj.databinding.FragmentScxsjhBinding
import com.rehome.scbaxj.utils.*
import com.rehome.scbaxj.utils.GsonUtils
import com.rehome.scbaxj.utils.NetworkUtil
import com.rehome.scbaxj.utils.SPUtils
import com.rehome.scbaxj.utils.UiUtlis
import com.rehome.scbaxj.weight.MeasureDialog
import com.rehome.scbaxj.weight.WaitDialog
import com.rehome.scbaxj.weight.toastviewbymyself
@ -294,28 +297,51 @@ class ScxsjhFragment(var type: String) : BaseFragmentViewBinding<FragmentScxsjhB
val measureDialog =
MeasureDialog(context, "你确定要删除?", object : MeasureDialog.AuditDialogListener {
override fun confirm() {
for (i in dbxjjh.indices) {
if (dbxjjh[i].isChecked) {
dbxjjh.removeIf { item: Xjjh ->
if (item.isChecked) {
DataSupport.deleteAll(
XSJJHXZDataBean::class.java,
"zxid = ? and username = ?",
dbxjjh[i].zxid,
item.zxid,
username
)
DataSupport.deleteAll(
XSJJHDataBean::class.java,
"zxid = ? and username = ?",
dbxjjh[i].zxid,
item.zxid,
username
)
DataSupport.deleteAll(
Xjjh::class.java,
"zxid = ? and username = ?",
dbxjjh[i].zxid,
item.zxid,
username
)
}
}
item.isChecked
}
// for (i in dbxjjh.indices) {
// if (dbxjjh[i].isChecked) {
// DataSupport.deleteAll(
// XSJJHXZDataBean::class.java,
// "zxid = ? and username = ?",
// dbxjjh[i].zxid,
// username
// )
// DataSupport.deleteAll(
// XSJJHDataBean::class.java,
// "zxid = ? and username = ?",
// dbxjjh[i].zxid,
// username
// )
// DataSupport.deleteAll(
// Xjjh::class.java,
// "zxid = ? and username = ?",
// dbxjjh[i].zxid,
// username
// )
// }
// }
//刷新页面
initData()

Loading…
Cancel
Save