master
hwf452 10 months ago
parent 5dd6a8371e
commit 3ae268fcaa

@ -76,8 +76,9 @@
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"

@ -164,7 +164,8 @@ public class MainActivity extends BaseActivity3 {
} else if (position == 3) {
startActivity(BlueTestInfoActivity.class);
} else if (position == 4) {
startActivity(QxgdActivity.class);
//startActivity(QxgdActivity.class);
startActivity(QxgdNewActivity.class);
}
});
}

@ -21,7 +21,7 @@ import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
/**
* date:2025/02/13 10:05:28
* date:2025/02/18 14:05:28
* author:HuangWenfei
* description:二维码扫描
*/

@ -1,21 +1,139 @@
package com.rehome.bhdxj.activity
import android.os.Bundle
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 com.rehome.bhdxj.base.BaseActivityOaToolbarViewBinding
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.RSAUtils
import com.rehome.bhdxj.utils.SPUtils
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 : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.activity_qxgd_new)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
class QxgdNewActivity : BaseActivityOaToolbarViewBinding<ActivityQxgdNewBinding>() {
private lateinit var queueNoHttp: RequestQueue
private lateinit var username: String
private lateinit var usernames: String
override fun getViewBinding() = ActivityQxgdNewBinding.inflate(layoutInflater)
override fun getToolbar()= binding.toolbarView.toolbar
override fun initView() {
initToolbar("缺陷工单提交", "提交") {
}
queueNoHttp = NoHttp.newRequestQueue(1)
val userIdTemp = SPUtils.get(this, Contans.USERID, "") as String
if (!TextUtils.isEmpty(userIdTemp)) {
username = RSAUtils.decryptBASE64StrLocal(userIdTemp);
}else{
username = ""
}
usernames = SPUtils.get(this, Contans.USERNAME, "") as String
}
override fun initData() {
//缺陷工单下拉数据
getZyDropDown();
}
private fun getZyDropDown() {
var param = HashMap<String,String>()
param["action"] = "QXGD_ZY_GET";
val json = GsonUtils.GsonString(param)
val url = Contans.MAXIMOIP + Contans.QX_GET_ZY_DROP
showLog(url)
val request = NoHttp.createStringRequest(url, RequestMethod.POST)
request.setDefineRequestBodyForJson(json)
queueNoHttp.add(12, request, object : OnResponseListener<String> {
override fun onStart(what: Int) {
}
override fun onSucceed(what: Int, response: Response<String>?) {
val result = response?.get()
showLog(result)
/**
* {"state": 1,"msg":"查询成功","data":[
* {"description":"保卫","value":"保卫"},
* {"description":"电气","value":"电气"},
* {"description":"辅助","value":"辅助"},
* {"description":"辅助维护","value":"辅助维护"},
* {"description":"锅炉","value":"锅炉"},
* {"description":"化验","value":"化验"},
* {"description":"环化","value":"环化"},
* {"description":"机组启停","value":"机组启停"},
* {"description":"金属","value":"金属"},
* {"description":"其他","value":"其他"},
* {"description":"汽机","value":"汽机"},
* {"description":"燃料","value":"燃料"},
* {"description":"燃料电仪","value":"燃料电仪"},
* {"description":"燃料机械","value":"燃料机械"},
* {"description":"热控","value":"热控"},
* {"description":"生产公用","value":"生产公用"},
* {"description":"生技","value":"生技"},
* {"description":"土建","value":"土建"},
* {"description":"消防","value":"消防"},
* {"description":"信息","value":"信息"},
* {"description":"运行","value":"运行"},
* {"description":"运行A值","value":"运行A值"},
* {"description":"运行B值","value":"运行B值"},
* {"description":"运行C值","value":"运行C值"},
* {"description":"运行D值","value":"运行D值"},
* {"description":"运行E值","value":"运行E值"},
* {"description":"综合服务","value":"综合服务"}]}
*/
//专业
// if(type=="zy"){
// val zyQxData = GsonUtils.GsonToBean(result, ZyQxData::class.java)
// if (zyQxData != null&&zyQxData.state == 1) {
// if (zyQxData.data != null&&zyQxData.data.size > 0) {
// showLog(zyQxData.data.size.toString())
// val zyList = DataSupport.findAll(Zy::class.java)
// if(zyList!=null&&zyList.size>0){
// showLog("zyList size > 0")
// showLog(GsonUtils.GsonString(zyList))
// showLog(zyList.size.toString())
// DataSupport.deleteAll(Zy::class.java)
// DataSupport.saveAll(zyQxData.data)
// }else{
// showLog("zyList size == 0")
// DataSupport.saveAll(zyQxData.data)
// }
// }
// }
// }
}
override fun onFailed(what: Int, response: Response<String>?) {
}
override fun onFinish(what: Int) {
}
})
}
}

@ -5,11 +5,14 @@ import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.ApplicationInfo
import android.nfc.NdefMessage
import android.nfc.NfcAdapter
import android.nfc.tech.*
import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.widget.Toast
import androidx.viewbinding.ViewBinding
@ -239,6 +242,20 @@ abstract class BaseActivityOaToolbarViewBinding<T : ViewBinding> : AutoLayoutAct
mToolbar.setTvTitleText(title)
}
fun initToolbar(
title: String,
rightText: String,
listenerRightClick: View.OnClickListener
) {
mToolbar.setTvTitleText(title)
mToolbar.setTvRightText(rightText)
mToolbar.setIvLeftIcon(R.mipmap.ac_back_icon)
mToolbar.setIvLeftOnClickListener {
finish()
}
mToolbar.setTvRightOnClickListener(listenerRightClick)
}
fun initToolbar(
title: String,
rightText: String,
@ -256,4 +273,26 @@ abstract class BaseActivityOaToolbarViewBinding<T : ViewBinding> : AutoLayoutAct
mToolbar.setIvLeftOnClickListener(listener)
mToolbar.setIvLeftIcon(R.mipmap.ac_back_icon)
}
open fun showLog(logText: String?) {
if (isApkInDebug(context)) {
if (TextUtils.isEmpty(logText)) {
Log.i("app", "logText is null")
} else {
Log.i("app", logText!!)
}
}
}
/**
* 判断当前应用是否是debug状态
*/
fun isApkInDebug(context: Context): Boolean {
try {
val info = context.applicationInfo
return (info.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0
} catch (e: Exception) {
return false
}
}
}

@ -5,9 +5,11 @@ 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 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 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 IP = "http://192.168.2.116:3028/";
@ -21,6 +23,10 @@ public class Contans {
public static String YXCB_ZY_NAME = "";//运行抄表专业名字
public final static String LASTLOGINDATE = "LASTLOGINDATE";
//缺陷工单专业下拉
public static String QX_GET_ZY_DROP = "QXGD/QXGD_JCSJ.ashx";
//-----------------------点检--------------------------//
public static String DJJHLIST = "DJGL/DJGL_GWDJ.ashx";//prame BZMC = 测试班组
public static String DJJHDLB = "DJGL/DJGL_GWDJ.ashx";// prame jhid=20161013141937;

@ -1,10 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main_qx"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true"
tools:context=".activity.QxgdNewActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
<include
android:id="@+id/toolbarView"
layout="@layout/layout_base" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_fxr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="发现人"
app:isShowTextView="true"
app:must="true"
app:tv_title="发现人" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_fxsj"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="发现时间"
app:isShowTextView="true"
app:must="true"
app:tv_title="发现时间" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_fxrbm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="发现人部门"
app:isShowTextView="true"
app:must="true"
app:tv_title="发现人部门" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_jz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="机组"
app:isShowTextView="true"
app:must="true"
app:tv_title="机组" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_zy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="专业"
app:isShowTextView="true"
app:must="true"
app:tv_title="专业" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_qxlx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="缺陷类型"
app:isShowTextView="true"
app:must="true"
app:tv_title="缺陷类型" />
<com.rehome.bhdxj.weight.InputLayout
android:id="@+id/il_qxdj"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintText="缺陷等级"
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_contentTextSize="14sp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_height="100dp"
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>
</RelativeLayout>
</ScrollView>
</LinearLayout>
Loading…
Cancel
Save