drf
parent
5dd6a8371e
commit
3ae268fcaa
@ -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) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@ -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…
Reference in New Issue