每日作业风险清单 完成

master
hwf453 2 years ago
parent 068f5d93a0
commit ee7978341e

@ -1125,6 +1125,10 @@
android:name=".ui.activity.ActivityFactoryWorkerInfo" android:name=".ui.activity.ActivityFactoryWorkerInfo"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" /> <!-- 厂内人员信息统计 --> android:windowSoftInputMode="adjustResize|stateHidden" /> <!-- 厂内人员信息统计 -->
<activity
android:name=".ui.activity.WorkRiskListActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" /> <!-- 作业风险清单 -->
<activity <activity
android:name=".ui.activity.ActivityFactoryWorkerInfoStatistics" android:name=".ui.activity.ActivityFactoryWorkerInfoStatistics"
android:screenOrientation="portrait" android:screenOrientation="portrait"

@ -507,6 +507,12 @@ public class Contans {
public final static String REGULAR_MAINTENANCE_STAFF_STATISTICS = "api/real_time_data/regular_maintenance_staff_statistics"; public final static String REGULAR_MAINTENANCE_STAFF_STATISTICS = "api/real_time_data/regular_maintenance_staff_statistics";
//厂内人员信息,每个常维队伍人数, 实时查询常维队伍人员明细 //厂内人员信息,每个常维队伍人数, 实时查询常维队伍人员明细
public final static String REGULAR_MAINTENANCE_STAFF = "api/real_time_data/regular_maintenance_staff"; public final static String REGULAR_MAINTENANCE_STAFF = "api/real_time_data/regular_maintenance_staff";
//查询每日作业风险清单
public final static String DAYLY_RISK_LIST = "v1/api/operation/risk/list";
//修改手机号或者密码 //修改手机号或者密码
public static String UPLOAD_PHONE_OR_PWD_URL="PubFile/Data/aboutme/UpdateUserPwd.ashx"; public static String UPLOAD_PHONE_OR_PWD_URL="PubFile/Data/aboutme/UpdateUserPwd.ashx";

@ -0,0 +1,35 @@
package com.rehome.zhdcoa.adapter;
import android.content.Context;
import androidx.annotation.NonNull;
import com.rehome.zhdcoa.R;
import com.rehome.zhdcoa.bean.ApplyListBean;
import com.rehome.zhdcoa.bean.WorkRiskLevelListBean;
import com.xuexiang.xui.adapter.recyclerview.BaseRecyclerAdapter;
import com.xuexiang.xui.adapter.recyclerview.RecyclerViewHolder;
import java.util.List;
public class WorkRiskLevelListAdapter extends CommonAdapter<WorkRiskLevelListBean.RowsBean> {
private final Context context;
private List<WorkRiskLevelListBean.RowsBean> datas;
public WorkRiskLevelListAdapter(Context context, List<WorkRiskLevelListBean.RowsBean> datas) {
super(context, R.layout.adapter_work_risk_level_list, datas);
this.context = context;
this.datas = datas;
}
@Override
protected void convert(ViewHolder viewHolder, WorkRiskLevelListBean.RowsBean item, int position) {
if (item != null) {
viewHolder.setText(R.id.tv_xh, String.valueOf(position+1));
viewHolder.setText(R.id.tv_paiHao, item.getCode());
viewHolder.setText(R.id.tv_content, item.getContent());
viewHolder.setText(R.id.tv_level, item.getLevel());
}
}
}

@ -0,0 +1,83 @@
package com.rehome.zhdcoa.bean;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
public class WorkRiskLevelListBean extends AIBaseBean{
//每日作业风险清单
private List<WorkRiskLevelListBean.RowsBean> data;
public List<WorkRiskLevelListBean.RowsBean> getData() {
return data;
}
public void setData(List<WorkRiskLevelListBean.RowsBean> data) {
this.data = data;
}
public static class RowsBean {
//工作票编号
private String code;
//工作票等级A、B、C1、C2、C3、低风险
private String level;
//工作内容
private String content;
//记录号
private int number;
//工作票ID
private String id;
//工作票状态
private String status;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
}

@ -0,0 +1,133 @@
package com.rehome.zhdcoa.ui.activity
import android.view.View
import com.rehome.zhdcoa.Contans
import com.rehome.zhdcoa.R
import com.rehome.zhdcoa.adapter.WorkRiskLevelListAdapter
import com.rehome.zhdcoa.base.BaseActivityOaToolbarViewBinding
import com.rehome.zhdcoa.bean.WorkRiskLevelListBean
import com.rehome.zhdcoa.databinding.ActivityWorkRiskListBinding
import com.rehome.zhdcoa.utils.AuthenticationLoginAIUtils
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.yolanda.nohttp.NoHttp
import com.yolanda.nohttp.RequestMethod
import com.yolanda.nohttp.rest.Response
import java.text.SimpleDateFormat
import java.util.Calendar
import javax.net.ssl.HostnameVerifier
/**
* Create By HuangWenFei
* 创建日期2024-04-02 14:34
* 描述每日作业风险清单
*/
class WorkRiskListActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskListBinding>() {
private lateinit var headView: View
private var datas: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private lateinit var mAdapter: WorkRiskLevelListAdapter
override fun getViewBinding() = ActivityWorkRiskListBinding.inflate(layoutInflater)
override fun getToolbar() = binding.toolbarView.toolbar
override fun initView() {
initToolbar("每日作业风险清单")
setLeftOnClickListener {
finish()
}
binding.lv.emptyView = binding.tvNodata
headView = View.inflate(this, R.layout.item_work_risk_list, null)
mAdapter = WorkRiskLevelListAdapter(this,datas);
//binding.lv.addHeaderView(headView, null, false)
binding.lv.adapter = mAdapter
//格式化日期的对象(转化成习惯的时间格式)
val sdFormat = SimpleDateFormat("yyyy.MM.dd")
//静态方法getInstance()使用默认时区和语言环境获得一个日历。
val calendar = Calendar.getInstance()
//输出当前系统时间;
binding.tvTime.text = sdFormat.format(calendar.time)
}
override fun initData() {
authenticationLoginAI()
}
private fun authenticationLoginAI() {
try {
//AI三维登录接口
val userName = Contans.SP.AI_ACCOUNT
//String strPrivateEncode=RSAAndroid.encryptByPrivateKeyForSpiltStr(Contans.SP.AI_PWD,RSAAndroid.privateRsaKeyLocal);
val strPublicDecode = RSAAndroid.decryptByPublicKeyForSpiltStr(
Contans.SP.AI_PWD_ENCODE,
RSAAndroid.publicRsaKeyLocal
)
AuthenticationLoginAIUtils.authenticationAILogin(
this, userName, strPublicDecode
) { _, token ->
if (token != null && token == "") {
showToast("AI三维平台登录失败")
} else {
getWorkRiskListData()
}
}
} catch (e: Exception) {
e.printStackTrace()
}
}
private fun getWorkRiskListData() {
val request = NoHttp.createStringRequest(
Contans.BASE_URL_AI_3D_SERVER + Contans.DAYLY_RISK_LIST,
RequestMethod.GET
)
if (Contans.BASE_URL_AI_3D_SERVER == Contans.BASE_URL_AI_3D_SERVER_EXTRANET) {
val socketFactory = NohttpUtils.getSSLSocketFactory(context)
if (socketFactory != null) {
request.sslSocketFactory = socketFactory
request.hostnameVerifier = HostnameVerifier { _, _ -> true }
}
}
NohttpUtils.getInstance()
.addNoProgress<String>(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,
WorkRiskLevelListBean::class.java
)
if (bean != null && bean.data != null) {
val workRiskLevelLists = bean.data
if (workRiskLevelLists != null && workRiskLevelLists.size > 0) {
binding.tvNodata.visibility = View.GONE
headView.visibility = View.VISIBLE
datas.clear()
datas.addAll(workRiskLevelLists)
mAdapter.notifyDataSetChanged()
} else {
binding.tvNodata.visibility = View.VISIBLE
}
}
}
override fun onFailed(what: Int, response: Response<String?>?) {
}
})
}
}

@ -55,6 +55,7 @@ import com.rehome.zhdcoa.ui.activity.SisdtDataActivity;
import com.rehome.zhdcoa.ui.activity.TaskCountActivity; import com.rehome.zhdcoa.ui.activity.TaskCountActivity;
import com.rehome.zhdcoa.ui.activity.TaskDateActivity; import com.rehome.zhdcoa.ui.activity.TaskDateActivity;
import com.rehome.zhdcoa.ui.activity.TrainStudyActivity; import com.rehome.zhdcoa.ui.activity.TrainStudyActivity;
import com.rehome.zhdcoa.ui.activity.WorkRiskListActivity;
import com.rehome.zhdcoa.ui.activity.XfssqActivity; import com.rehome.zhdcoa.ui.activity.XfssqActivity;
import com.rehome.zhdcoa.ui.activity.XmjdActivity; import com.rehome.zhdcoa.ui.activity.XmjdActivity;
import com.rehome.zhdcoa.ui.activity.YjynMainActivity; import com.rehome.zhdcoa.ui.activity.YjynMainActivity;
@ -113,6 +114,14 @@ public class GridViewDialog extends Dialog {
TAG = tag; TAG = tag;
if(TAG.equals(TAG_AF)){
lp.width = (getScreenWidth(context)) * 4 / 5;
gv.setNumColumns(3);
}else{
lp.width = (getScreenWidth(context)) * 2 / 3;
gv.setNumColumns(2);
}
initDatas(); initDatas();
if (datas != null) { if (datas != null) {
@ -307,6 +316,9 @@ public class GridViewDialog extends Dialog {
}else if (position == 9) { }else if (position == 9) {
//当前厂内人员信息 //当前厂内人员信息
intent = new Intent(getContext(), ActivityFactoryWorkerInfo.class); intent = new Intent(getContext(), ActivityFactoryWorkerInfo.class);
}else if (position == 10) {
//作业风险清单
intent = new Intent(getContext(), WorkRiskListActivity.class);
} }
break; break;
} }
@ -428,7 +440,9 @@ public class GridViewDialog extends Dialog {
//datas.add(new GridItem("危化品入厂申请", R.drawable.dager_logo, getShowString("ZNAF_ZYQYLSJRRY"))); //datas.add(new GridItem("危化品入厂申请", R.drawable.dager_logo, getShowString("ZNAF_ZYQYLSJRRY")));
datas.add(new GridItem("应急预案", R.drawable.icon_yjya, getShowString("ZNAF_ZYQYLSJRRY"))); datas.add(new GridItem("应急预案", R.drawable.icon_yjya, getShowString("ZNAF_ZYQYLSJRRY")));
datas.add(new GridItem("厂内人员信息", R.drawable.icon13, getShowString("ZNAF_ZYQYLSJRRY"))); datas.add(new GridItem("厂内人员信息", R.drawable.icon13, getShowString("ZNAF_ZYQYLSJRRY")));
datas.add(new GridItem("作业风险清单", R.drawable.icon_travel, getShowString("ZNAF_ZYQYLSJRRY")));
break; break;
} }
} }
} }
//WorkRiskListActivity

@ -0,0 +1,93 @@
<?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"
tools:context=".ui.activity.WorkRiskListActivity">
<include
android:id="@+id/toolbarView"
layout="@layout/layout_base" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:paddingTop="5dp"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="66px">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="每日作业风险清单" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text=""
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<include
android:id="@+id/item_head"
layout="@layout/item_work_risk_list"
android:layout_width="match_parent"
android:layout_marginStart="10px"
android:layout_marginEnd="10px"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="10px"
android:layout_marginEnd="10px"
android:layout_marginBottom="20dp"
android:layout_weight="1">
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#00000000"
android:dividerHeight="0px"/>
<TextView
android:id="@+id/tv_nodata"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/viewfinder_mask"
android:gravity="center"
android:text="暂无数据"/>
</FrameLayout>
</LinearLayout>

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:minHeight="61px"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px">
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_xh"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:gravity="center"
android:text="序号" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_paiHao"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.7"
android:gravity="center"
android:text="工作票号" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10px"
android:layout_weight="2"
android:text="工作内容" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_level"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:layout_marginLeft="10px"
android:layout_weight="0.7"
android:text="风险等级" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#524658" />
</LinearLayout>

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:minHeight="62px"
android:orientation="vertical">
<View
android:id="@+id/head"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#524658"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px">
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_xh"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:gravity="center"
android:text="序号" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_paiHao"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.7"
android:gravity="center"
android:text="工作票号" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_qymc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginLeft="10px"
android:layout_weight="2"
android:text="工作内容" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
<TextView
android:id="@+id/tv_djrw"
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
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#524658" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#524658" />
</LinearLayout>
Loading…
Cancel
Save