工作票列表增加工号

master
wenfei 7 months ago
parent 4afeaef7bc
commit 87e67bc10b

@ -7,14 +7,14 @@ plugins {
android { android {
namespace 'com.rehome.zhdcoa' namespace 'com.rehome.zhdcoa'
compileSdk 35 compileSdk 36
defaultConfig { defaultConfig {
applicationId "com.rehome.zhdcoa" applicationId "com.rehome.zhdcoa"
minSdk 24 minSdk 24
targetSdk 35 targetSdk 36
versionCode 22 versionCode 23
versionName "2.3.8" versionName "2.3.9"
multiDexEnabled true multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//authorities //authorities

@ -1,6 +1,7 @@
package com.rehome.zhdcoa.adapter; package com.rehome.zhdcoa.adapter;
import android.content.Context; import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -34,6 +35,9 @@ public class WorkTickerSelectListAdapter extends BaseViewBindingAdapter<AdapterW
binding.tvPaiHao.setText(item.getCode()); binding.tvPaiHao.setText(item.getCode());
binding.tvContent.setText(item.getContent()); binding.tvContent.setText(item.getContent());
binding.tvLevel.setText(item.getLevel()); binding.tvLevel.setText(item.getLevel());
if(!TextUtils.isEmpty(item.getMajor())){
binding.tvZy.setText(item.getMajor());
}
binding.cb.setChecked(item.isChecked()); binding.cb.setChecked(item.isChecked());
binding.cb.setOnClickListener(new View.OnClickListener() { binding.cb.setOnClickListener(new View.OnClickListener() {
@Override @Override

@ -31,6 +31,10 @@ public class WorkRiskLevelListBean extends AIBaseBean{
private Integer id; private Integer id;
//工作票状态 //工作票状态
private String status; private String status;
//专业
private String major;
//设置工作票人工号
private String jobNo;
private List<HazardListBean> hazardList; private List<HazardListBean> hazardList;
private boolean checked;//0:未选中,1:已选中 private boolean checked;//0:未选中,1:已选中
@ -97,5 +101,21 @@ public class WorkRiskLevelListBean extends AIBaseBean{
public void setChecked(boolean checked) { public void setChecked(boolean checked) {
this.checked = checked; this.checked = checked;
} }
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public String getJobNo() {
return jobNo;
}
public void setJobNo(String jobNo) {
this.jobNo = jobNo;
}
} }
} }

@ -174,8 +174,8 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
if (isApkInDebug(context)) { if (isApkInDebug(context)) {
// 管理员 // 管理员
binding.etUsername.setText("ZHPS_Admin") // binding.etUsername.setText("ZHPS_Admin")
binding.etPassword.setText("Rehome.zhps@996") // binding.etPassword.setText("Rehome.zhps@996")
//公司内网215管理员 //公司内网215管理员
// binding.etUsername.setText("ZHPS_Admin") // binding.etUsername.setText("ZHPS_Admin")

@ -3,6 +3,7 @@ package com.rehome.zhdcoa.ui.activity
import android.content.Intent import android.content.Intent
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.TextView
import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import com.rehome.zhdcoa.Contans import com.rehome.zhdcoa.Contans
@ -10,6 +11,8 @@ import com.rehome.zhdcoa.R
import com.rehome.zhdcoa.adapter.WorkRiskLevelListAdapter import com.rehome.zhdcoa.adapter.WorkRiskLevelListAdapter
import com.rehome.zhdcoa.base.BaseActivityOaToolbarViewBinding import com.rehome.zhdcoa.base.BaseActivityOaToolbarViewBinding
import com.rehome.zhdcoa.bean.WorkRiskLevelListBean import com.rehome.zhdcoa.bean.WorkRiskLevelListBean
import com.rehome.zhdcoa.completionUtil.ReplaceSpan
import com.rehome.zhdcoa.completionUtil.ReplaceSpan.OnClickListener
import com.rehome.zhdcoa.databinding.ActivityWorkRiskListBinding import com.rehome.zhdcoa.databinding.ActivityWorkRiskListBinding
import com.rehome.zhdcoa.utils.AuthenticationLoginAIUtils import com.rehome.zhdcoa.utils.AuthenticationLoginAIUtils
import com.rehome.zhdcoa.utils.GsonUtils import com.rehome.zhdcoa.utils.GsonUtils
@ -43,6 +46,7 @@ class WorkRiskListActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskLi
private var dataC2: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf() private var dataC2: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var dataC3: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf() private var dataC3: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var dataLowRisk: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf() private var dataLowRisk: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var isNetworkNormal = false
private lateinit var launcherResultQRCode: ActivityResultLauncher<Intent> private lateinit var launcherResultQRCode: ActivityResultLauncher<Intent>
@ -54,11 +58,15 @@ class WorkRiskListActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskLi
initToolbar("每日作业风险清单", "工作票") { initToolbar("每日作业风险清单", "工作票") {
//进入风险提示页面 WorkTickerSelectListActivity if(isNetworkNormal){
val intent = Intent(context, WorkTickerSelectListActivity::class.java) //进入风险提示页面 WorkTickerSelectListActivity
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP) val intent = Intent(context, WorkTickerSelectListActivity::class.java)
intent.putExtra("selectList", GsonUtils.GsonString(selectList)) intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
startActivity(intent) intent.putExtra("selectList", GsonUtils.GsonString(selectList))
startActivity(intent)
}else{
showToast("列表数据加载失败,请检查网络环境或重新加载列表数据")
}
} }
launcherResultQRCode = createQRCodeActivityResultLauncher() launcherResultQRCode = createQRCodeActivityResultLauncher()
@ -103,19 +111,7 @@ class WorkRiskListActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskLi
//binding.lv.addHeaderView(headView, null, false) //binding.lv.addHeaderView(headView, null, false)
binding.lv.adapter = mAdapter binding.lv.adapter = mAdapter
// binding.lv.onItemClickListener = binding.llRefresh.setOnClickListener { authenticationLoginAI() }
// AdapterView.OnItemClickListener { _: AdapterView<*>?, _: View?, position: Int, _: Long ->
// val item = datas[position]
// if(item.hazardList!=null&&item.hazardList.size>0){
// //进入风险提示页面
// val intent = Intent(context, WorkRiskListTipActivity::class.java)
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
// intent.putExtra("hazardList", GsonUtils.GsonString(item.hazardList))
// startActivity(intent)
// }else{
// showToast("无清单提示数据")
// }
// }
//格式化日期的对象(转化成习惯的时间格式) //格式化日期的对象(转化成习惯的时间格式)
val sdFormat = SimpleDateFormat("yyyy.MM.dd") val sdFormat = SimpleDateFormat("yyyy.MM.dd")
@ -168,6 +164,7 @@ class WorkRiskListActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskLi
) { _, token -> ) { _, token ->
if (token != null && token == "") { if (token != null && token == "") {
showToast("AI三维平台登录失败") showToast("AI三维平台登录失败")
isNetworkNormal = false
} else { } else {
getWorkRiskListData() getWorkRiskListData()
} }
@ -204,6 +201,7 @@ class WorkRiskListActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskLi
WorkRiskLevelListBean::class.java WorkRiskLevelListBean::class.java
) )
if (bean != null && bean.data != null) { if (bean != null && bean.data != null) {
isNetworkNormal = true
val workRiskLevelLists = bean.data val workRiskLevelLists = bean.data
if (workRiskLevelLists != null && workRiskLevelLists.size > 0) { if (workRiskLevelLists != null && workRiskLevelLists.size > 0) {
binding.tvNodata.visibility = View.GONE binding.tvNodata.visibility = View.GONE
@ -253,11 +251,13 @@ class WorkRiskListActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskLi
} else { } else {
binding.tvNodata.visibility = View.VISIBLE binding.tvNodata.visibility = View.VISIBLE
} }
}else{
isNetworkNormal = false
} }
} }
override fun onFailed(what: Int, response: Response<String?>?) { override fun onFailed(what: Int, response: Response<String?>?) {
isNetworkNormal = false
} }
}) })
} }

@ -298,15 +298,43 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
android:orientation="vertical"> android:orientation="horizontal">
<TextView <LinearLayout
android:id="@+id/tv_report" android:layout_width="0dp"
android:layout_width="match_parent" android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:orientation="vertical">
<TextView
android:id="@+id/tv_report"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/white"
android:gravity="center"
android:textSize="16sp"
android:text="查看报告"/>
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:textColor="@color/white" android:background="#524658" />
android:gravity="center" <LinearLayout
android:textSize="18sp" android:id="@+id/ll_refresh"
android:text="查看报告"/> android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:orientation="vertical">
<TextView
android:id="@+id/tv_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/white"
android:gravity="center"
android:textSize="16sp"
android:text="重新加载列表数据"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

@ -83,6 +83,20 @@
android:layout_weight="0.7" android:layout_weight="0.7"
android:text="风险等级" /> android:text="风险等级" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_zy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginLeft="10px"
android:layout_weight="0.7"
android:text="专业" />
<View <View
android:layout_width="1dp" android:layout_width="1dp"

Loading…
Cancel
Save