|
|
|
|
@ -20,6 +20,7 @@ import com.rehome.zhdcoa.utils.GsonUtils
|
|
|
|
|
import com.rehome.zhdcoa.utils.HttpListener
|
|
|
|
|
import com.rehome.zhdcoa.utils.NohttpUtils
|
|
|
|
|
import com.rehome.zhdcoa.utils.RSAAndroid
|
|
|
|
|
import com.rehome.zhdcoa.weiget.LoadListView
|
|
|
|
|
import com.yolanda.nohttp.NoHttp
|
|
|
|
|
import com.yolanda.nohttp.RequestMethod
|
|
|
|
|
import com.yolanda.nohttp.rest.Response
|
|
|
|
|
@ -96,20 +97,21 @@ class DeviceAlarmInfoActivity : BaseActivityOaToolbarViewBinding<ActivityDeviceA
|
|
|
|
|
binding.lv.onItemClickListener = AdapterView.OnItemClickListener { _, _, position, _ ->
|
|
|
|
|
val item:DeviceAlarmListResultBean.DeviceWarning = datas[position]
|
|
|
|
|
showLog(GsonUtils.GsonString(item))
|
|
|
|
|
//点击进入应急预案执行状态
|
|
|
|
|
// val intent = Intent(context, YjyaActionActivity::class.java)
|
|
|
|
|
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
|
|
|
// intent.putExtra("YAID",item.id)
|
|
|
|
|
// startActivity(intent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
binding.btnQuery.setOnClickListener {
|
|
|
|
|
authenticationLoginDeviceAlermInfo()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// binding.lv.setOnItemClickListener { _, _, position, _ ->
|
|
|
|
|
// val item: WarehouseHuoJiaBean.RowsBean = warehouseHuoJiaList[position]
|
|
|
|
|
// val intent = Intent()
|
|
|
|
|
// intent.setClass(this, WztpblScDetailActivity::class.java)
|
|
|
|
|
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
|
|
|
// intent.putExtra("item",Gson().toJson(item))
|
|
|
|
|
// startActivity(intent)
|
|
|
|
|
// }
|
|
|
|
|
binding.lv.setInterface(LoadListView.ILoadListener {
|
|
|
|
|
getAlermListLoadMoreData()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -239,6 +241,7 @@ class DeviceAlarmInfoActivity : BaseActivityOaToolbarViewBinding<ActivityDeviceA
|
|
|
|
|
deviceAlarmInfoAdapter.notifyDataSetChanged()
|
|
|
|
|
binding.tvNodata.visibility = View.GONE
|
|
|
|
|
headView.visibility = View.VISIBLE
|
|
|
|
|
pageNo++
|
|
|
|
|
}else{
|
|
|
|
|
datas.clear()
|
|
|
|
|
deviceAlarmInfoAdapter.notifyDataSetChanged()
|
|
|
|
|
@ -253,6 +256,60 @@ class DeviceAlarmInfoActivity : BaseActivityOaToolbarViewBinding<ActivityDeviceA
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun getAlermListLoadMoreData() {
|
|
|
|
|
val request = NoHttp.createStringRequest(
|
|
|
|
|
Contans.IP + Contans.DeviceAlermInfoListUrl,
|
|
|
|
|
RequestMethod.GET
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
request.add("pageNo",pageNo)
|
|
|
|
|
request.add("pageSize",pageSize)
|
|
|
|
|
val zyTemp:String = binding.spZy.selectedItem.toString()
|
|
|
|
|
|
|
|
|
|
val zyIndex:Int = binding.spZy.selectedItemPosition
|
|
|
|
|
if(zyIndex!=0){
|
|
|
|
|
request.add("specialty",specialtyList[zyIndex])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showLog(zyTemp)
|
|
|
|
|
showLog(zyIndex.toString())
|
|
|
|
|
|
|
|
|
|
val keyword = binding.etKey.text.toString().trim()
|
|
|
|
|
if(!TextUtils.isEmpty(keyword)){
|
|
|
|
|
request.add("keyword",keyword)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NohttpUtils.getInstance().add(this, 0, request, object : HttpListener<String?> {
|
|
|
|
|
|
|
|
|
|
override fun onSucceed(what: Int, response: Response<String?>?) {
|
|
|
|
|
val result = response?.get()
|
|
|
|
|
showLog("----------------")
|
|
|
|
|
showLog(result)
|
|
|
|
|
val bean = GsonUtils.GsonToBean(
|
|
|
|
|
result,
|
|
|
|
|
DeviceAlarmListResultBean::class.java
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
showLog(GsonUtils.GsonString(bean))
|
|
|
|
|
if (bean != null && bean.code == 20000 && bean.isSuccess && bean.data != null && bean.data.dataList != null && bean.data.dataList.size>0) {
|
|
|
|
|
datas.addAll(bean.data.dataList)
|
|
|
|
|
deviceAlarmInfoAdapter.notifyDataSetChanged()
|
|
|
|
|
binding.tvNodata.visibility = View.GONE
|
|
|
|
|
headView.visibility = View.VISIBLE
|
|
|
|
|
pageNo++
|
|
|
|
|
binding.lv.loadComplete()
|
|
|
|
|
}else{
|
|
|
|
|
showToast("没有更多数据啦")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onFailed(what: Int, response: Response<String?>?) {
|
|
|
|
|
showToast("加载数据失败")
|
|
|
|
|
binding.lv.loadComplete()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun toWorkRiskListHuiBaoActivity(type:String){
|
|
|
|
|
//工作情况汇报
|
|
|
|
|
val intent = Intent(context, WorkRiskListHuiBaoActivity::class.java)
|
|
|
|
|
|