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.bean.StatusInfo2
import com.rehome.scbaxj.contans.Contans import com.rehome.scbaxj.contans.Contans
import com.rehome.scbaxj.databinding.FragmentScxsjhBinding 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.MeasureDialog
import com.rehome.scbaxj.weight.WaitDialog import com.rehome.scbaxj.weight.WaitDialog
import com.rehome.scbaxj.weight.toastviewbymyself import com.rehome.scbaxj.weight.toastviewbymyself
@ -294,28 +297,51 @@ class ScxsjhFragment(var type: String) : BaseFragmentViewBinding<FragmentScxsjhB
val measureDialog = val measureDialog =
MeasureDialog(context, "你确定要删除?", object : MeasureDialog.AuditDialogListener { MeasureDialog(context, "你确定要删除?", object : MeasureDialog.AuditDialogListener {
override fun confirm() { override fun confirm() {
for (i in dbxjjh.indices) { dbxjjh.removeIf { item: Xjjh ->
if (dbxjjh[i].isChecked) { if (item.isChecked) {
DataSupport.deleteAll( DataSupport.deleteAll(
XSJJHXZDataBean::class.java, XSJJHXZDataBean::class.java,
"zxid = ? and username = ?", "zxid = ? and username = ?",
dbxjjh[i].zxid, item.zxid,
username username
) )
DataSupport.deleteAll( DataSupport.deleteAll(
XSJJHDataBean::class.java, XSJJHDataBean::class.java,
"zxid = ? and username = ?", "zxid = ? and username = ?",
dbxjjh[i].zxid, item.zxid,
username username
) )
DataSupport.deleteAll( DataSupport.deleteAll(
Xjjh::class.java, Xjjh::class.java,
"zxid = ? and username = ?", "zxid = ? and username = ?",
dbxjjh[i].zxid, item.zxid,
username 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() initData()

Loading…
Cancel
Save