新增 选择位置 页面

master
hwf452 9 months ago
parent 9bdd1f6acc
commit 2747e0673e

@ -76,9 +76,8 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".activity.QxgdNewActivity"
android:exported="false" />
<activity
android:name=".activity.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
@ -222,6 +221,14 @@
android:name=".activity.QxgdActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".activity.QxgdNewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".activity.QxgdSearchAddressActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".activity.NfcinfoActivity"
android:configChanges="keyboardHidden|orientation|screenSize"

@ -157,9 +157,11 @@ public class QxgdActivity extends BaseActivity3 {
@Override
public void onSuccess(Call<JzBean> call, Response<JzBean> response) {
JzBean bean1 = response.body();
showLog(GsonUtils.GsonString(bean1));
if (bean1 != null) {
JzDatas.clear();
JzDatas.addAll(bean1.getResult());
showLog(GsonUtils.GsonString(JzDatas));
initJZdatas();
}

@ -1,35 +1,51 @@
package com.rehome.bhdxj.activity
import android.os.Bundle
import android.content.Intent
import android.text.TextUtils
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.rehome.bhdxj.R
import android.view.View
import com.rehome.bhdxj.base.BaseActivityOaToolbarViewBinding
import com.rehome.bhdxj.bean.ZyNewBean
import com.rehome.bhdxj.contans.Contans
import com.rehome.bhdxj.databinding.ActivityQxgdNewBinding
import com.rehome.bhdxj.utils.GsonUtils
import com.rehome.bhdxj.utils.OAToolbar
import com.rehome.bhdxj.utils.HttpListener
import com.rehome.bhdxj.utils.NohttpUtils
import com.rehome.bhdxj.utils.RSAUtils
import com.rehome.bhdxj.utils.SPUtils
import com.rehome.bhdxj.weight.ListDialog
import com.yolanda.nohttp.NoHttp
import com.yolanda.nohttp.RequestMethod
import com.yolanda.nohttp.rest.OnResponseListener
import com.yolanda.nohttp.rest.RequestQueue
import com.yolanda.nohttp.rest.Response
import org.litepal.crud.DataSupport
class QxgdNewActivity : BaseActivityOaToolbarViewBinding<ActivityQxgdNewBinding>() {
private lateinit var queueNoHttp: RequestQueue
private lateinit var username: String
private lateinit var usernames: String
private val jzList: MutableList<ZyNewBean.DataBean> = mutableListOf()
private val zyList: MutableList<ZyNewBean.DataBean> = mutableListOf()
private val gzlxList: MutableList<ZyNewBean.DataBean> = mutableListOf()
private val gdjbList: MutableList<ZyNewBean.DataBean> = mutableListOf()
// private val zyList: MutableList<ZyNewBean.DataBean> = mutableListOf()
// private val zyList: MutableList<ZyNewBean.DataBean> = mutableListOf()
private val jzDialogDatas: MutableList<String> = mutableListOf()
private val zyDialogDatas: MutableList<String> = mutableListOf()
private val gzlxDialogDatas: MutableList<String> = mutableListOf()
private val gdjbDialogDatas: MutableList<String> = mutableListOf()
private var jzValue: String? = null
private var zyValue: kotlin.String? = null
private var lxvalue: kotlin.String? = null
private var qxdjValue: kotlin.String? = null
override fun getViewBinding() = ActivityQxgdNewBinding.inflate(layoutInflater)
override fun getToolbar()= binding.toolbarView.toolbar
override fun getToolbar() = binding.toolbarView.toolbar
override fun initView() {
initToolbar("缺陷工单提交", "提交") {
@ -44,19 +60,118 @@ class QxgdNewActivity : BaseActivityOaToolbarViewBinding<ActivityQxgdNewBinding>
username = ""
}
usernames = SPUtils.get(this, Contans.USERNAME, "") as String
if(!TextUtils.isEmpty(usernames)){
binding.ilFxr.content = usernames
}
binding.etQxms.setContentTextSize(54)
binding.ilJz.setOnClickListener(View.OnClickListener { v: View? ->
val dialog = ListDialog(
context, jzDialogDatas
) { _: String?, position: Int ->
jzValue = jzList[position].value
binding.ilJz.content = jzList[position].description
}
dialog.show()
})
binding.ilZy.setOnClickListener(View.OnClickListener { v: View? ->
val dialog = ListDialog(
context, zyDialogDatas
) { _: String?, position: Int ->
zyValue = zyList[position].value
binding.ilZy.content = zyList[position].description
}
dialog.show()
})
binding.ilQxlx.setOnClickListener(View.OnClickListener { v: View? ->
val dialog = ListDialog(
context, gzlxDialogDatas
) { _: String?, position: Int ->
lxvalue = gzlxList[position].value
binding.ilQxlx.content = gzlxList[position].description
}
dialog.show()
})
binding.ilQxdj.setOnClickListener(View.OnClickListener { v: View? ->
val dialog = ListDialog(
context, gdjbDialogDatas
) { _: String?, position: Int ->
qxdjValue = gdjbList[position].value
binding.ilQxdj.content = gdjbList[position].description
}
dialog.show()
})
binding.ilWz.setOnClickListener(View.OnClickListener { v: View? ->
val intent = Intent(context, QxgdSearchAddressActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
startActivity(intent)
})
}
override fun initData() {
//缺陷工单下拉数据
getZyDropDown();
//检查网络连接
checkConnectServer()
}
private fun initJZdatas() {
jzDialogDatas.clear()
for (bean in jzList) {
jzDialogDatas.add(bean.description)
}
}
private fun initZYdatas() {
zyDialogDatas.clear()
for (bean in zyList) {
zyDialogDatas.add(bean.description)
}
}
private fun initLXdatas() {
gzlxDialogDatas.clear()
for (bean in gzlxList) {
gzlxDialogDatas.add(bean.description)
}
}
private fun initQXDJdatas() {
gdjbDialogDatas.clear()
for (bean in gdjbList) {
gdjbDialogDatas.add(bean.description)
}
}
private fun getZyDropDown() {
private fun getDropDown(type:String) {
var param = HashMap<String,String>()
if(type=="jz"){
//机组
param["action"] = "QXGD_JZ_GET";
}else if(type=="zy"){
//专业
param["action"] = "QXGD_ZY_GET";
}else if(type=="gdjb"){
//工单级别
param["action"] = "QXGD_QXDJ_GET";
}else if(type=="gzlx"){
//工作类型
param["action"] = "QXGD_GZLX_GET";
}else if(type=="gzlb"){
//故障类别
param["action"] = "QXGD_GZLB_GET";
}else if(type=="gzxx"){
//故障现象
param["action"] = "QXGD_GZXX_GET";
}
val json = GsonUtils.GsonString(param)
@ -73,6 +188,45 @@ class QxgdNewActivity : BaseActivityOaToolbarViewBinding<ActivityQxgdNewBinding>
override fun onSucceed(what: Int, response: Response<String>?) {
val result = response?.get()
showLog(result)
val bean = GsonUtils.GsonToBean(
result,
ZyNewBean::class.java
)
if (bean != null && bean.state == 1 && bean.data != null&& bean.data.size>0) {
if(type=="jz"){
//机组
showLog("机组")
jzList.clear()
jzList.addAll(bean.data)
initJZdatas()
}else if(type=="zy"){
//专业
showLog("专业")
zyList.clear()
zyList.addAll(bean.data)
initZYdatas()
}else if(type=="gdjb"){
//工单级别
showLog("工单级别")
gdjbList.clear()
gdjbList.addAll(bean.data)
initQXDJdatas()
}else if(type=="gzlx"){
//工作类型
showLog("工作类型")
gzlxList.clear()
gzlxList.addAll(bean.data)
initLXdatas()
}else if(type=="gzlb"){
//故障类别
showLog("故障类别")
}else if(type=="gzxx"){
//故障现象
showLog("故障现象")
}
}
/**
* {"state": 1,"msg":"查询成功","data":[
* {"description":"保卫","value":"保卫"},
@ -136,4 +290,114 @@ class QxgdNewActivity : BaseActivityOaToolbarViewBinding<ActivityQxgdNewBinding>
})
}
private fun checkConnectServer() {
var param = HashMap<String,String>()
val json = GsonUtils.GsonString(param)
val url = Contans.MAXIMOIP + Contans.check_server_connect
showLog(url)
showLog(json)
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?>?) {
val result = response?.get()
if (result != null) {
showLog("-----checkConnectServer onSucceed----")
showLog(result)
if(result == "1"){
showLog("connect server success")
//缺陷工单下拉数据
//机组
getDropDown("jz")
//专业
getDropDown("zy")
//工单级别
getDropDown("gdjb")
//工作类型
getDropDown("gzlx")
}else{
showToast("无法连接到服务器,请检查网络环境")
}
}
}
override fun onFailed(what: Int, response: Response<String?>?) {
showLog("connect server onFailed")
showToast("无法连接到服务器,请检查网络环境")
}
}, true, true, "连接服务器...")
}
private fun checkConnectServerGzlb() {
var param = HashMap<String,String>()
val json = GsonUtils.GsonString(param)
val url = Contans.MAXIMOIP + Contans.check_server_connect
showLog(url)
showLog(json)
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?>?) {
val result = response?.get()
if (result != null) {
showLog("-----checkConnectServer onSucceed----")
showLog(result)
if(result == "1"){
showLog("connect server success")
//缺陷工单下拉数据
//故障类别
getDropDown("gzlb")
}else{
showToast("无法连接到服务器,请检查网络环境")
}
}
}
override fun onFailed(what: Int, response: Response<String?>?) {
showLog("connect server onFailed")
showToast("无法连接到服务器,请检查网络环境")
}
}, true, true, "连接服务器...")
}
private fun checkConnectServerGzxx() {
var param = HashMap<String,String>()
val json = GsonUtils.GsonString(param)
val url = Contans.MAXIMOIP + Contans.check_server_connect
showLog(url)
showLog(json)
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?>?) {
val result = response?.get()
if (result != null) {
showLog("-----checkConnectServer onSucceed----")
showLog(result)
if(result == "1"){
showLog("connect server success")
//缺陷工单下拉数据
//故障现象
getDropDown("gzxx")
}else{
showToast("无法连接到服务器,请检查网络环境")
}
}
}
override fun onFailed(what: Int, response: Response<String?>?) {
showLog("connect server onFailed")
showToast("无法连接到服务器,请检查网络环境")
}
}, true, true, "连接服务器...")
}
}

@ -0,0 +1,28 @@
package com.rehome.bhdxj.activity
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.rehome.bhdxj.R
import com.rehome.bhdxj.base.BaseActivityOaToolbarViewBinding
import com.rehome.bhdxj.databinding.ActivityQxgdSearchAddressBinding
import com.rehome.bhdxj.utils.OAToolbar
class QxgdSearchAddressActivity : BaseActivityOaToolbarViewBinding<ActivityQxgdSearchAddressBinding>() {
override fun getViewBinding() = ActivityQxgdSearchAddressBinding.inflate(layoutInflater)
override fun getToolbar() = binding.toolbarView.toolbar
override fun initView() {
initToolbar("选择位置", "") {
}
}
override fun initData() {
}
}

@ -0,0 +1,57 @@
package com.rehome.bhdxj.bean;
import android.os.Parcelable;
import java.util.List;
public class ZyNewBean {
private int state;
private String msg;
private List<DataBean> data;
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
private String description;
private String value;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}

@ -6,12 +6,13 @@ public class Contans {
public static String LOGIN = "AppLogin/GetData.aspx";
public static String CHECK_UPDATA_APK = "ApkUpdate/GetData.aspx";
// public static String IP = "http://10.46.0.164:8002/";
//public static String MAXIMOIP = "http://10.46.0.152:7001/";
// public static String MAXIMOIP = "http://10.46.0.15:7001/";
public static String IP = "http://10.46.0.164:8003/";
public static String MAXIMOIP = "http://10.46.0.164:8003/";
// public static String MAXIMOIP = "http://10.46.0.152:7001/";
// public static String IP = "http://192.168.2.116:3028/";
@ -26,6 +27,8 @@ public class Contans {
//缺陷工单专业下拉
public static String QX_GET_ZY_DROP = "QXGD/QXGD_JCSJ.ashx";
//连接服务器测试看客户端是否能连接到服务器如果能就响应个1
public static final String check_server_connect = "WL/WLPD.ashx";
//-----------------------点检--------------------------//
public static String DJJHLIST = "DJGL/DJGL_GWDJ.ashx";//prame BZMC = 测试班组

@ -43,6 +43,7 @@ public class ListDialog extends Dialog {
Window window = getWindow();
WindowManager.LayoutParams lp = window.getAttributes();
lp.width = (getScreenWidth(context)) * 2 / 3;
lp.height = (getScreenHigh(context)) * 2 / 3;
window.setGravity(Gravity.CENTER);
this.datas = datas;
@ -99,6 +100,13 @@ public class ListDialog extends Dialog {
Display display = manager.getDefaultDisplay();
return display.getWidth();
}
//获取屏幕宽度
public static int getScreenHigh(Context context) {
WindowManager manager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();
return display.getHeight();
}
public interface ListDialogListener {
void selectText(String text, int position);

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 点击背景 -->
<item android:state_pressed="true">
<shape>
<corners android:radius="2dp" />
<solid android:color="#111176e8" />
<stroke android:width="1dp" android:color="#1176e8" />
</shape>
</item>
<!-- 默认背景 -->
<item>
<shape>
<corners android:radius="2dp" />
<solid android:color="#00000000" />
<stroke android:width="1px" android:color="#881176e8" />
</shape>
</item>
</selector>

@ -40,86 +40,85 @@
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_fxsj"
android:id="@+id/il_jz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="发现时间"
app:hintText="选择机组"
app:isShowTextView="true"
app:must="true"
app:tv_title="发现时间" />
app:tv_title="机组" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_fxrbm"
android:id="@+id/il_zy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="发现人部门"
app:hintText="选择专业"
app:isShowTextView="true"
app:must="true"
app:tv_title="发现人部门" />
app:tv_title="专业" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_jz"
android:id="@+id/il_qxlx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="机组"
app:hintText="选择工作类型"
app:isShowTextView="true"
app:must="true"
app:tv_title="机组" />
app:tv_title="工作类型" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_zy"
android:id="@+id/il_qxdj"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="专业"
app:hintText="选择工单级别"
app:isShowTextView="true"
app:must="true"
app:tv_title="专业" />
app:tv_title="工单级别" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_qxlx"
android:id="@+id/il_wz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="缺陷类型"
app:hintText="选择位置"
app:isShowTextView="true"
app:must="true"
app:tv_title="缺陷类型" />
app:tv_title="位置" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_qxdj"
android:id="@+id/il_sb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="缺陷等级"
app:isShowTextView="true"
app:must="true"
app:tv_title="缺陷等级" />
app:tv_title="设备" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_gzlb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isShowTextView="true"
app:must="true"
app:tv_title="故障类别" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_gzxx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isShowTextView="true"
app:must="true"
app:tv_title="故障现象" />
<com.xuexiang.xui.widget.edittext.MultiLineEditText
android:id="@+id/et_qxms"
android:layout_width="match_parent"
app:mlet_maxCount="200"
app:mlet_contentViewHeight="60dp"
app:mlet_maxCount="300"
app:mlet_contentViewHeight="110dp"
app:mlet_contentTextSize="14sp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_height="100dp"
app:mlet_hintText="缺陷描述:"
android:layout_height="150dp"
app:mlet_hintText="请输入缺陷描述"
android:padding="5dp" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_fzbm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="工单安排(负责部门)"
app:isShowTextView="true"
app:must="true"
app:tv_title="负责部门" />
</LinearLayout>

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main_qx"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".activity.QxgdSearchAddressActivity">
<include
android:id="@+id/toolbarView"
layout="@layout/layout_base" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<EditText
android:id="@+id/et_hgtm"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:padding="10dp"
style="@style/editTextThemePanDian"
android:hint="请输入查询位置" />
<TextView
android:id="@+id/tv_sys"
style="@style/smallButtonTheme"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:gravity="center"
android:layout_marginStart="10dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/px_20"
android:text="查询"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -26,10 +26,15 @@
android:background="@color/gray" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical">
<com.rehome.bhdxj.weight.AutoListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@color/gray"
android:dividerHeight="1px" />
</ScrollView>
</com.zhy.autolayout.AutoLinearLayout>

@ -62,7 +62,7 @@
<!-- 扫一扫 -->
<style name="smallButtonTheme">
<item name="android:background">@drawable/pressed_bg_blue88</item>
<item name="android:background">@color/colorPrimaryDark</item>
<item name="android:padding">3dp</item>
<item name="android:textColor">#ffffff</item>
</style>
@ -109,4 +109,11 @@
<item name="android:drawablePadding">8dp</item>
</style>
<style name="editTextThemePanDian">
<item name="android:background">@drawable/bg_edittext_search_device</item>
<item name="android:textColor">#bb000000</item>
<item name="android:textSize">18sp</item>
<item name="android:textStyle">bold</item>
</style>
</resources>

Loading…
Cancel
Save