应急预案完成

master
admin 1 year ago
parent 6d620ed42d
commit 08347a810c

@ -77,7 +77,9 @@
tools:ignore="GoogleAppIndexingWarning" tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup" tools:replace="android:allowBackup"
tools:targetApi="s"> tools:targetApi="s">
<activity
android:name=".ui.activity.YjyaActionActivity"
android:exported="false" />
<activity <activity
android:name=".ui.activity.LoginActivity" android:name=".ui.activity.LoginActivity"
android:exported="true" android:exported="true"
@ -293,7 +295,7 @@
android:name=".ui.activity.YjyaActivity" android:name=".ui.activity.YjyaActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false" android:exported="false"
android:launchMode="singleInstance" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.KksSearchGongDanActivity" android:name=".ui.activity.KksSearchGongDanActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"

@ -3,25 +3,25 @@ package com.rehome.dywoa;
public class Contans { public class Contans {
// public static String IP = "http://192.168.2.115:8601/"; public static String IP = "http://192.168.2.115:8601/";
// public static String IP_INTRANET = "http://192.168.2.115:8601/"; public static String IP_INTRANET = "http://192.168.2.115:8601/";
// public static String IP_EXTRANET = "http://192.168.2.115:8601/"; public static String IP_EXTRANET = "http://192.168.2.115:8601/";
// public static String SIS_TOKEN_IP = "https://sis.dywzhny.com.cn/"; public static String SIS_TOKEN_IP = "https://sis.dywzhny.com.cn/";
// public static String BI_TOKEN_IP = "https://bi.dywzhny.com.cn/"; public static String BI_TOKEN_IP = "https://bi.dywzhny.com.cn/";
//APP登录接口厂内服务器IP //APP登录接口厂内服务器IP
public static String IP = "https://app.dywzhny.com.cn/"; // public static String IP = "https://app.dywzhny.com.cn/";
//app内网 // //app内网
public static String IP_INTRANET = "https://app.dywzhny.com.cn/"; // public static String IP_INTRANET = "https://app.dywzhny.com.cn/";
//app外网 // //app外网
public static String IP_EXTRANET = "https://app.dywzhny.com.cn/"; // public static String IP_EXTRANET = "https://app.dywzhny.com.cn/";
//SIS系统厂内IP // //SIS系统厂内IP
public static String SIS_TOKEN_IP = "https://sis.dywzhny.com.cn/"; // public static String SIS_TOKEN_IP = "https://sis.dywzhny.com.cn/";
//BI // //BI
public static String BI_TOKEN_IP = "https://bi.dywzhny.com.cn/"; // public static String BI_TOKEN_IP = "https://bi.dywzhny.com.cn/";
@ -60,6 +60,10 @@ public class Contans {
//获取应急预案 //获取应急预案
public static final String YJYA_GET_LIST_TJ = "api/emergency/getPlan"; public static final String YJYA_GET_LIST_TJ = "api/emergency/getPlan";
//获取应急预案执行状态列表
public static final String YJYA_GET_ACTION_LIST = "api/emergency/getExecutionList";
//执行应急预案
public static final String YJYA_ACTION_URL = "api/emergency/updateExecutionToIdAndUser";
public static String YHPC = "AJH/AJH_YHPCSC.ashx";//隐患排查 public static String YHPC = "AJH/AJH_YHPCSC.ashx";//隐患排查

@ -0,0 +1,5 @@
package com.rehome.dywoa.Listener;
public interface OnActionClickListener {
void onActionClick(int position);
}

@ -0,0 +1,57 @@
package com.rehome.dywoa.adapter
import android.content.Context
import android.content.Intent
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.ViewGroup
import com.rehome.dywoa.Listener.OnActionClickListener
import com.rehome.dywoa.base.BaseViewBindingAdapter
import com.rehome.dywoa.bean.YjyaActionBean
import com.rehome.dywoa.databinding.AdapterYjyaActionListBinding
import com.rehome.dywoa.ui.activity.RunLogBaseActivity
class YjyaActionListAdapter(var context: Context,
var data: MutableList<YjyaActionBean.Row>,var mOnClickListener: OnActionClickListener
) : BaseViewBindingAdapter<AdapterYjyaActionListBinding>(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?
) = AdapterYjyaActionListBinding.inflate(inflater, parent, false)
override fun handleData(position: Int, binding: AdapterYjyaActionListBinding) {
val item: YjyaActionBean.Row = data[position]
binding.tvTitle.text = item.title
binding.tvYjlx.text = item.type
binding.tvYjbz.text = item.yjbz
binding.tvWorkContent.text = item.workContent
if(!TextUtils.isEmpty(item.zxzt)){
if("0" == item.zxzt){
binding.tvZxzt.text = "未执行"
}
if("1" == item.zxzt){
binding.tvZxzt.text = "已执行"
}
}
binding.tvStatus.setOnClickListener {
mOnClickListener.onActionClick(position)
}
}
}

@ -0,0 +1,73 @@
package com.rehome.dywoa.bean;
import java.util.List;
public class YjyaActionBean 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 zxid;
private String title;
private String type;
private String yjbz;
private String workContent;
private String zxzt;
public String getZxid() {
return zxid;
}
public void setZxid(String zxid) {
this.zxid = zxid;
}
public String getZxzt() {
return zxzt;
}
public void setZxzt(String zxzt) {
this.zxzt = zxzt;
}
public String getWorkContent() {
return workContent;
}
public void setWorkContent(String workContent) {
this.workContent = workContent;
}
public String getYjbz() {
return yjbz;
}
public void setYjbz(String yjbz) {
this.yjbz = yjbz;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
}

@ -199,22 +199,28 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
if (isApkInDebug(context)) { if (isApkInDebug(context)) {
//测试 //测试
// binding.etUsername.setText("371522") binding.etUsername.setText("371522")
// binding.etPassword.setText("A000000a.") binding.etPassword.setText("A000000a.")
//ceshi1 //ceshi1
// binding.etUsername.setText("ceshi1") // binding.etUsername.setText("ceshi1")
// binding.etPassword.setText("A000000a.") // binding.etPassword.setText("A000000a.")
//瑞洪 RH00002/王总 RH00002/chao工 RH00003/范红波
// binding.etUsername.setText("CY00005") // binding.etUsername.setText("RH00002")
// binding.etPassword.setText("A000000a.")
// binding.etUsername.setText("RH00002")
// binding.etPassword.setText("A000000a.") // binding.etPassword.setText("A000000a.")
// binding.etUsername.setText("TD00003") //重仪
// binding.etUsername.setText("CY00005")
// binding.etPassword.setText("A000000a.") // binding.etPassword.setText("A000000a.")
// binding.etUsername.setText("371543") // binding.etUsername.setText("371543")
// binding.etPassword.setText("Dyw@2024") // binding.etPassword.setText("Dyw@2024")

@ -0,0 +1,174 @@
package com.rehome.dywoa.ui.activity
import android.content.Intent
import android.util.Log
import android.view.View
import android.widget.AdapterView
import com.rehome.dywoa.App
import com.rehome.dywoa.Contans
import com.rehome.dywoa.adapter.YjyaActionListAdapter
import com.rehome.dywoa.base.BaseActivityOaToolbarViewBinding
import com.rehome.dywoa.bean.StatusInfo
import com.rehome.dywoa.bean.YjyaActionBean
import com.rehome.dywoa.databinding.ActivityYjyaActionBinding
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.yolanda.nohttp.NoHttp
import com.yolanda.nohttp.RequestMethod
import com.yolanda.nohttp.rest.Response
class YjyaActionActivity : BaseActivityOaToolbarViewBinding<ActivityYjyaActionBinding>() {
private lateinit var adapter: YjyaActionListAdapter
private var datas: MutableList<YjyaActionBean.Row> = mutableListOf()
private lateinit var username: String
override fun getViewBinding() = ActivityYjyaActionBinding.inflate(layoutInflater)
override fun getToolbar() = binding.toolbarView.toolbar
override fun initView() {
initToolbar("应急预案执行状态", "") {
}
username = App.getInstance().userInfo.manid
adapter = YjyaActionListAdapter(context, datas
) { position ->
var item = datas[position]
getActionTrigger(item)
}
binding.lv.adapter = adapter
binding.tvNodata.visibility= View.VISIBLE
binding.lv.visibility= View.GONE
}
override fun initData() {
//检查服务器连接状态
checkServerConnectStatus()
}
//检查服务器连接状态
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("无法连接到服务器,请检查网络环境")
}
})
}
private fun getListData() {
var yaid = intent.getStringExtra("YAID");
if(yaid==null){
showLog("预案id不能为空")
return
}
var param = HashMap<String,String>()
param["GH"] = username
param["YAID"] = yaid
val json = GsonUtils.GsonString(param)
val url: String = Contans.IP + Contans.YJYA_GET_ACTION_LIST
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, YjyaActionBean::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, "正在加载数据...")
}
private fun getActionTrigger(item:YjyaActionBean.Row) {
var param = HashMap<String,String>()
param["ZXID"] = item.zxid
param["YHID"] = username
val json = GsonUtils.GsonString(param)
val url: String = Contans.IP + Contans.YJYA_ACTION_URL
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, StatusInfo::class.java)
if (bean != null) {
if (bean.state == 1) {
showToast("执行成功")
//检查服务器连接状态
checkServerConnectStatus()
}
if (bean.state == 2) {
showToast("执行失败")
}
}
}
}
override fun onFailed(what: Int, response: Response<String>?) {
}
}, true, true, "正在加载数据...")
}
}

@ -1,8 +1,10 @@
package com.rehome.dywoa.ui.activity package com.rehome.dywoa.ui.activity
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.widget.AdapterView
import androidx.activity.enableEdgeToEdge import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
@ -48,10 +50,24 @@ class YjyaActivity : BaseActivityOaToolbarViewBinding<ActivityYjyaBinding>() {
binding.tvNodata.visibility= View.VISIBLE binding.tvNodata.visibility= View.VISIBLE
binding.lv.visibility= View.GONE binding.lv.visibility= View.GONE
binding.lv.onItemClickListener =
AdapterView.OnItemClickListener { parent: AdapterView<*>?, view: View?, position: Int, id: Long ->
val item = datas[position]
//点击进入应急预案执行状态
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)
}
} }
override fun initData() { override fun initData() {
}
override fun onResume() {
super.onResume()
//检查服务器连接状态 //检查服务器连接状态
checkServerConnectStatus() checkServerConnectStatus()
} }
@ -93,8 +109,8 @@ class YjyaActivity : BaseActivityOaToolbarViewBinding<ActivityYjyaBinding>() {
fun getListData() { fun getListData() {
var param = HashMap<String,String>() var param = HashMap<String,String>()
//param["GH"] = username param["GH"] = username
param["GH"] = "sysadmin" //param["GH"] = "sysadmin"
val json = GsonUtils.GsonString(param) val json = GsonUtils.GsonString(param)
val url: String = Contans.IP + Contans.YJYA_GET_LIST_TJ val url: String = Contans.IP + Contans.YJYA_GET_LIST_TJ

@ -208,7 +208,7 @@ public class HomeFragment extends BaseFragment {
startActivity(intentJiZhu); startActivity(intentJiZhu);
break; break;
case 3: case 3:
if((firstDeparment!=null&&firstDeparment.equals("运行部"))||(firstDeparment!=null&&firstDeparment.equals("承包商"))||(username!=null&&username.equals("371522"))||(username!=null&&username.equals("ceshi1"))){ if((firstDeparment!=null&&firstDeparment.equals("运行部"))||(firstDeparment!=null&&firstDeparment.equals("承包商"))||(username!=null&&username.equals("371522"))||(username!=null&&username.equals("ceshi1"))||(username!=null&&username.equals("RH00001"))){
Intent intentXj= new Intent(mActivity, XscbglActivity.class); Intent intentXj= new Intent(mActivity, XscbglActivity.class);
intentXj.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intentXj.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intentXj); startActivity(intentXj);
@ -225,7 +225,7 @@ public class HomeFragment extends BaseFragment {
break; break;
case 5: case 5:
//运行日志 //运行日志
if((firstDeparment!=null&&firstDeparment.equals("运行部"))||(username!=null&&username.equals("371522"))){ if((firstDeparment!=null&&firstDeparment.equals("运行部"))||(username!=null&&username.equals("371522"))||(username!=null&&username.equals("RH00001"))){
Intent intentLog = new Intent(mActivity, RunLogListActivity.class);//RunLogListActivity RunLogBaseActivity Intent intentLog = new Intent(mActivity, RunLogListActivity.class);//RunLogListActivity RunLogBaseActivity
intentLog.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intentLog.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intentLog); startActivity(intentLog);

@ -5,6 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:background="#ffffff"
tools:context=".ui.activity.YjyaActivity"> tools:context=".ui.activity.YjyaActivity">
<include <include

@ -0,0 +1,36 @@
<?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.YjyaActionActivity">>
<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:divider="@color/gray"
android:dividerHeight="1dp" />
<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,224 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10px"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="标题:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="应急预案类型:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_yjlx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="应急班组:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_yjbz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="工作内容:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_work_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="执行人:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_factoryInCharge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="执行状态:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_zxzt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/green"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="录入人:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_requestPersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:minHeight="60px">
<TextView
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_margin="5px"
android:gravity="center"
android:text="录入时间:"
android:textSize="30px" />
<TextView
android:id="@+id/tv_applyTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:gravity="center|left"
android:minHeight="50px"
android:textSize="30px" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="7">
<TextView
android:id="@+id/tv_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:background="@drawable/btn_selector"
android:gravity="center"
android:padding="15px"
android:text="执行"
android:textColor="@color/textstatus1" />
</LinearLayout>
</LinearLayout>

@ -11,6 +11,7 @@
<color name="app_status_bar">#F0F5FB</color> <color name="app_status_bar">#F0F5FB</color>
<color name="green">#2dd52a</color>
<color name="colorPrimary">#138CF2</color> <color name="colorPrimary">#138CF2</color>
<color name="colorPrimaryDark">#138CF2</color> <color name="colorPrimaryDark">#138CF2</color>
<color name="colorAccent">#FF4081</color> <color name="colorAccent">#FF4081</color>

Loading…
Cancel
Save