1.1.0发布
parent
f8d3120283
commit
2f9fa55238
@ -0,0 +1,47 @@
|
||||
package com.rehome.dywoa.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.rehome.dywoa.base.BaseViewBindingAdapter
|
||||
import com.rehome.dywoa.bean.DefectWorkOrderInfo
|
||||
import com.rehome.dywoa.databinding.AdapterKksSearchGongDanBinding
|
||||
|
||||
class KksSearchGongDanAdapter(var context: Context,
|
||||
var data: MutableList<DefectWorkOrderInfo.Row>) : BaseViewBindingAdapter<AdapterKksSearchGongDanBinding>(context) {
|
||||
override fun getCount(): Int {
|
||||
return data.count()
|
||||
}
|
||||
|
||||
override fun getItem(position: Int): Any {
|
||||
return data[position]
|
||||
}
|
||||
|
||||
override fun getItemId(position: Int): Long {
|
||||
return position.toLong()
|
||||
}
|
||||
|
||||
override fun getBinding(
|
||||
inflater: LayoutInflater,
|
||||
parent: ViewGroup?
|
||||
) = AdapterKksSearchGongDanBinding.inflate(inflater, parent, false)
|
||||
override fun handleData(position: Int, binding: AdapterKksSearchGongDanBinding) {
|
||||
val item: DefectWorkOrderInfo.Row = data[position]
|
||||
binding.tvGongdanDesc.text = item.workOrderDesc
|
||||
|
||||
binding.tvKksCode.text = item.kksCode
|
||||
binding.tvGongdanCode.text = item.workOrderCode
|
||||
|
||||
binding.tvGzqx.text = item.symptomsDesc
|
||||
binding.tvQxyy.text = item.reason
|
||||
|
||||
binding.tvZy.text = item.speciality
|
||||
binding.tvBgr.text = item.reporter
|
||||
|
||||
binding.tvBgsj.text = item.bgrqortDate
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
@ -0,0 +1,101 @@
|
||||
package com.rehome.dywoa.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DefectWorkOrderInfo extends BaseListBean {
|
||||
|
||||
private List<Row> Rows;
|
||||
|
||||
public List<Row> getRows() {
|
||||
return Rows;
|
||||
}
|
||||
|
||||
public void setRows(List<Row> rows) {
|
||||
Rows = rows;
|
||||
}
|
||||
|
||||
public static class Row {
|
||||
private String id;
|
||||
private String kksCode;
|
||||
private String workOrderCode;
|
||||
private String workOrderDesc;
|
||||
private String symptomsDesc;
|
||||
private String reason;
|
||||
private String speciality;
|
||||
private String reporter;
|
||||
private String bgrqortDate;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getKksCode() {
|
||||
return kksCode;
|
||||
}
|
||||
|
||||
public void setKksCode(String kksCode) {
|
||||
this.kksCode = kksCode;
|
||||
}
|
||||
|
||||
public String getWorkOrderCode() {
|
||||
return workOrderCode;
|
||||
}
|
||||
|
||||
public void setWorkOrderCode(String workOrderCode) {
|
||||
this.workOrderCode = workOrderCode;
|
||||
}
|
||||
|
||||
public String getWorkOrderDesc() {
|
||||
return workOrderDesc;
|
||||
}
|
||||
|
||||
public void setWorkOrderDesc(String workOrderDesc) {
|
||||
this.workOrderDesc = workOrderDesc;
|
||||
}
|
||||
|
||||
public String getSymptomsDesc() {
|
||||
return symptomsDesc;
|
||||
}
|
||||
|
||||
public void setSymptomsDesc(String symptomsDesc) {
|
||||
this.symptomsDesc = symptomsDesc;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getSpeciality() {
|
||||
return speciality;
|
||||
}
|
||||
|
||||
public void setSpeciality(String speciality) {
|
||||
this.speciality = speciality;
|
||||
}
|
||||
|
||||
public String getReporter() {
|
||||
return reporter;
|
||||
}
|
||||
|
||||
public void setReporter(String reporter) {
|
||||
this.reporter = reporter;
|
||||
}
|
||||
|
||||
public String getBgrqortDate() {
|
||||
return bgrqortDate;
|
||||
}
|
||||
|
||||
public void setBgrqortDate(String bgrqortDate) {
|
||||
this.bgrqortDate = bgrqortDate;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
package com.rehome.dywoa.ui.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.rehome.dywoa.Contans
|
||||
import com.rehome.dywoa.R
|
||||
import com.rehome.dywoa.adapter.HistoryDjAdapter
|
||||
import com.rehome.dywoa.adapter.KksSearchGongDanAdapter
|
||||
import com.rehome.dywoa.base.BaseActivityOaToolbarViewBinding
|
||||
import com.rehome.dywoa.bean.DefectWorkOrderInfo
|
||||
import com.rehome.dywoa.bean.HistoryDjBean
|
||||
import com.rehome.dywoa.databinding.ActivityKksSearchGongDanBinding
|
||||
import com.rehome.dywoa.utils.GsonUtils
|
||||
import com.rehome.dywoa.utils.HttpListener
|
||||
import com.rehome.dywoa.utils.NoProgresshttpUtils
|
||||
import com.rehome.dywoa.utils.NohttpUtils
|
||||
import com.rehome.dywoa.weiget.OAToolbar
|
||||
import com.yolanda.nohttp.NoHttp
|
||||
import com.yolanda.nohttp.RequestMethod
|
||||
import com.yolanda.nohttp.rest.Response
|
||||
|
||||
class KksSearchGongDanActivity : BaseActivityOaToolbarViewBinding<ActivityKksSearchGongDanBinding>() {
|
||||
|
||||
private lateinit var adapter: KksSearchGongDanAdapter
|
||||
private var datas: MutableList<DefectWorkOrderInfo.Row> = mutableListOf()
|
||||
private var kks:String? = null
|
||||
|
||||
override fun getViewBinding() = ActivityKksSearchGongDanBinding.inflate(layoutInflater)
|
||||
|
||||
override fun getToolbar() = binding.toolbarView.toolbar
|
||||
|
||||
override fun initView() {
|
||||
initToolbar("工单消缺", "") {
|
||||
|
||||
}
|
||||
|
||||
adapter = KksSearchGongDanAdapter(context, datas)
|
||||
binding.lv.adapter = adapter
|
||||
|
||||
binding.tvNodata.visibility= View.VISIBLE
|
||||
binding.lv.visibility= View.GONE
|
||||
|
||||
kks = intent.getStringExtra("kks")
|
||||
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
if(kks!=null){
|
||||
//检查服务器连接状态
|
||||
checkServerConnectStatus()
|
||||
}else{
|
||||
showToast("kks码不能为空")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//检查服务器连接状态
|
||||
private fun checkServerConnectStatus() {
|
||||
var param = HashMap<String,String>()
|
||||
param["login"] = "dywoa";
|
||||
val json = GsonUtils.GsonString(param)
|
||||
val url = Contans.IP + Contans.check_server_connect
|
||||
Log.i("app",url)
|
||||
Log.i("app",json)
|
||||
val request = NoHttp.createStringRequest(
|
||||
url,
|
||||
RequestMethod.POST
|
||||
)
|
||||
request.setDefineRequestBodyForJson(json)
|
||||
NoProgresshttpUtils.getInstance().add(this, 0, request, object : HttpListener<String?> {
|
||||
override fun onSucceed(what: Int, response: Response<String?>?) {
|
||||
val result = response?.get()
|
||||
if (result != null) {
|
||||
showLog("-----onSucceed----")
|
||||
showLog(result)
|
||||
if(result == "1"){
|
||||
showLog("connect server success")
|
||||
//获取数据
|
||||
getListData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailed(what: Int, response: Response<String?>?) {
|
||||
showLog("connect server onFailed")
|
||||
showToast("无法连接到服务器,请检查网络环境")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun getListData() {
|
||||
|
||||
|
||||
var param = HashMap<String,String>()
|
||||
param["txm"] = kks!!
|
||||
val json = GsonUtils.GsonString(param)
|
||||
|
||||
val url: String = Contans.IP + Contans.KKS_SEARCH_GDXQ
|
||||
val request = NoHttp.createStringRequest(url, RequestMethod.POST)
|
||||
request.setDefineRequestBodyForJson(json)
|
||||
NohttpUtils.getInstance().add(this, 0, request, object : HttpListener<String> {
|
||||
override fun onSucceed(what: Int, response: Response<String>?) {
|
||||
if (response != null) {
|
||||
val result = response.get()
|
||||
showLog(result)
|
||||
val bean = GsonUtils.GsonToBean(result, DefectWorkOrderInfo::class.java)
|
||||
if (bean != null && bean.total != 0) {
|
||||
if (bean.rows != null && bean.rows.size>0) {
|
||||
datas.clear()
|
||||
datas.addAll(bean.rows)
|
||||
adapter.notifyDataSetChanged()
|
||||
binding.tvNodata.visibility= View.GONE
|
||||
binding.lv.visibility=View.VISIBLE
|
||||
}else {
|
||||
datas.clear()
|
||||
adapter.notifyDataSetChanged()
|
||||
binding.tvNodata.visibility= View.VISIBLE
|
||||
binding.lv.visibility=View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailed(what: Int, response: Response<String>?) {
|
||||
|
||||
}
|
||||
|
||||
}, true, true, "正在加载数据...")
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="#cccccc"
|
||||
tools:context=".ui.activity.KksSearchGongDanActivity">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbarView"
|
||||
android:visibility="visible"
|
||||
layout="@layout/layout_base" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/lv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
android:divider="#00000000"
|
||||
android:dividerHeight="10dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nodata"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="暂无数据" />
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,215 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="工单描述:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gongdan_desc"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="缺陷原因及处理:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_qxyy"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="kks编码:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_kks_code"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="漏检点数:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gongdan_code"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="故障现象:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gzqx"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="报告时间:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bgsj"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="0dp"
|
||||
android:textSize="12sp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="专业:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_zy"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="报告人:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bgr"
|
||||
style="@style/dagerDetailRightStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in New Issue