diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
index 1bda3b4..9b714d0 100644
--- a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
@@ -49,7 +49,7 @@
binding.checkPersonView.text = rowsModel.inspectionUser
//列表上部统计
- binding.countView.text = rowsModel.inspectionUser
+ binding.countView.text = rowsModel.alarmCount
checkHistoryViewModel = ViewModelProvider(this)[CheckHistoryViewModel::class.java]
checkHistoryViewModel.getCheckHistoryDetailById(this, rowsModel.id)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
index 1bda3b4..9b714d0 100644
--- a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
@@ -49,7 +49,7 @@
binding.checkPersonView.text = rowsModel.inspectionUser
//列表上部统计
- binding.countView.text = rowsModel.inspectionUser
+ binding.countView.text = rowsModel.alarmCount
checkHistoryViewModel = ViewModelProvider(this)[CheckHistoryViewModel::class.java]
checkHistoryViewModel.getCheckHistoryDetailById(this, rowsModel.id)
diff --git a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
new file mode 100644
index 0000000..db1201d
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
@@ -0,0 +1,70 @@
+package com.casic.br.app.view
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.adapter.TopViewPagerAdapter
+import com.casic.br.app.databinding.ActivityCheckManifestByTargetBinding
+import com.casic.br.app.fragment.TargetCheckManifestFragment
+import com.casic.br.app.vm.ConfigViewModel
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+import com.pengxh.kt.lite.base.KotlinBaseActivity
+import com.pengxh.kt.lite.utils.Constant
+
+class CheckManifestByTargetActivity : KotlinBaseActivity() {
+
+ private val kTag = "CheckManifestByTargetActivity"
+ private val gson by lazy { Gson() }
+ private lateinit var configViewModel: ConfigViewModel
+ private var fragmentPages = ArrayList()
+
+ override fun initEvent() {
+ binding.confirmButton.setOnClickListener { finish() }
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ val args = intent.getStringArrayListExtra(Constant.INTENT_PARAM) as ArrayList
+
+ val detectedScene = args[0]
+ //场景需要转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(this, "securityScene")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == detectedScene) {
+ val targetSet = gson.fromJson>(
+ args[1], object : TypeToken>() {}.type
+ )
+ val subPageTitles = ArrayList()
+ targetSet.forEach { target ->
+ subPageTitles.add("${target}检查清单")
+ fragmentPages.add(TargetCheckManifestFragment(dic.value, target))
+ }
+
+ val topViewPagerAdapter = TopViewPagerAdapter(
+ supportFragmentManager, subPageTitles.toTypedArray(), fragmentPages
+ )
+ binding.viewPager.offscreenPageLimit = fragmentPages.size
+ binding.viewPager.adapter = topViewPagerAdapter
+ binding.tabLayout.setupWithViewPager(binding.viewPager)
+ return@observe
+ }
+ }
+ }
+ }
+ }
+
+ override fun initViewBinding(): ActivityCheckManifestByTargetBinding {
+ return ActivityCheckManifestByTargetBinding.inflate(layoutInflater)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
index 1bda3b4..9b714d0 100644
--- a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
@@ -49,7 +49,7 @@
binding.checkPersonView.text = rowsModel.inspectionUser
//列表上部统计
- binding.countView.text = rowsModel.inspectionUser
+ binding.countView.text = rowsModel.alarmCount
checkHistoryViewModel = ViewModelProvider(this)[CheckHistoryViewModel::class.java]
checkHistoryViewModel.getCheckHistoryDetailById(this, rowsModel.id)
diff --git a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
new file mode 100644
index 0000000..db1201d
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
@@ -0,0 +1,70 @@
+package com.casic.br.app.view
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.adapter.TopViewPagerAdapter
+import com.casic.br.app.databinding.ActivityCheckManifestByTargetBinding
+import com.casic.br.app.fragment.TargetCheckManifestFragment
+import com.casic.br.app.vm.ConfigViewModel
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+import com.pengxh.kt.lite.base.KotlinBaseActivity
+import com.pengxh.kt.lite.utils.Constant
+
+class CheckManifestByTargetActivity : KotlinBaseActivity() {
+
+ private val kTag = "CheckManifestByTargetActivity"
+ private val gson by lazy { Gson() }
+ private lateinit var configViewModel: ConfigViewModel
+ private var fragmentPages = ArrayList()
+
+ override fun initEvent() {
+ binding.confirmButton.setOnClickListener { finish() }
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ val args = intent.getStringArrayListExtra(Constant.INTENT_PARAM) as ArrayList
+
+ val detectedScene = args[0]
+ //场景需要转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(this, "securityScene")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == detectedScene) {
+ val targetSet = gson.fromJson>(
+ args[1], object : TypeToken>() {}.type
+ )
+ val subPageTitles = ArrayList()
+ targetSet.forEach { target ->
+ subPageTitles.add("${target}检查清单")
+ fragmentPages.add(TargetCheckManifestFragment(dic.value, target))
+ }
+
+ val topViewPagerAdapter = TopViewPagerAdapter(
+ supportFragmentManager, subPageTitles.toTypedArray(), fragmentPages
+ )
+ binding.viewPager.offscreenPageLimit = fragmentPages.size
+ binding.viewPager.adapter = topViewPagerAdapter
+ binding.tabLayout.setupWithViewPager(binding.viewPager)
+ return@observe
+ }
+ }
+ }
+ }
+ }
+
+ override fun initViewBinding(): ActivityCheckManifestByTargetBinding {
+ return ActivityCheckManifestByTargetBinding.inflate(layoutInflater)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
index f24dd7c..6a50417 100644
--- a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
@@ -76,6 +76,7 @@
ThreadPoolExecutor.AbortPolicy()
)
private val locationManager by lazy { LocationManager(this) }
+ private val targetSet by lazy { HashSet() }
private lateinit var cameraExecutor: ExecutorService
private lateinit var cameraProviderFuture: ListenableFuture
private lateinit var imageCapture: ImageCapture
@@ -159,6 +160,9 @@
binding.detectView.updateTargetPosition(null)
} else {
binding.detectView.updateTargetPosition(it.result)
+ it.result.forEach { result ->
+ targetSet.add(result.label)
+ }
}
}
isDetectingTarget = false
@@ -307,7 +311,14 @@
}
binding.tipsButton.setOnClickListener {
-
+ if (targetSet.isEmpty()) {
+ "未识别到任何目标,无法查看检查清单".show(this)
+ return@setOnClickListener
+ }
+ //根据识别出来的结果显示清单
+ navigatePageTo(
+ arrayListOf(detectedScene, targetSet.toJson())
+ )
}
binding.addButton.setOnClickListener {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
index 1bda3b4..9b714d0 100644
--- a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
@@ -49,7 +49,7 @@
binding.checkPersonView.text = rowsModel.inspectionUser
//列表上部统计
- binding.countView.text = rowsModel.inspectionUser
+ binding.countView.text = rowsModel.alarmCount
checkHistoryViewModel = ViewModelProvider(this)[CheckHistoryViewModel::class.java]
checkHistoryViewModel.getCheckHistoryDetailById(this, rowsModel.id)
diff --git a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
new file mode 100644
index 0000000..db1201d
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
@@ -0,0 +1,70 @@
+package com.casic.br.app.view
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.adapter.TopViewPagerAdapter
+import com.casic.br.app.databinding.ActivityCheckManifestByTargetBinding
+import com.casic.br.app.fragment.TargetCheckManifestFragment
+import com.casic.br.app.vm.ConfigViewModel
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+import com.pengxh.kt.lite.base.KotlinBaseActivity
+import com.pengxh.kt.lite.utils.Constant
+
+class CheckManifestByTargetActivity : KotlinBaseActivity() {
+
+ private val kTag = "CheckManifestByTargetActivity"
+ private val gson by lazy { Gson() }
+ private lateinit var configViewModel: ConfigViewModel
+ private var fragmentPages = ArrayList()
+
+ override fun initEvent() {
+ binding.confirmButton.setOnClickListener { finish() }
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ val args = intent.getStringArrayListExtra(Constant.INTENT_PARAM) as ArrayList
+
+ val detectedScene = args[0]
+ //场景需要转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(this, "securityScene")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == detectedScene) {
+ val targetSet = gson.fromJson>(
+ args[1], object : TypeToken>() {}.type
+ )
+ val subPageTitles = ArrayList()
+ targetSet.forEach { target ->
+ subPageTitles.add("${target}检查清单")
+ fragmentPages.add(TargetCheckManifestFragment(dic.value, target))
+ }
+
+ val topViewPagerAdapter = TopViewPagerAdapter(
+ supportFragmentManager, subPageTitles.toTypedArray(), fragmentPages
+ )
+ binding.viewPager.offscreenPageLimit = fragmentPages.size
+ binding.viewPager.adapter = topViewPagerAdapter
+ binding.tabLayout.setupWithViewPager(binding.viewPager)
+ return@observe
+ }
+ }
+ }
+ }
+ }
+
+ override fun initViewBinding(): ActivityCheckManifestByTargetBinding {
+ return ActivityCheckManifestByTargetBinding.inflate(layoutInflater)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
index f24dd7c..6a50417 100644
--- a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
@@ -76,6 +76,7 @@
ThreadPoolExecutor.AbortPolicy()
)
private val locationManager by lazy { LocationManager(this) }
+ private val targetSet by lazy { HashSet() }
private lateinit var cameraExecutor: ExecutorService
private lateinit var cameraProviderFuture: ListenableFuture
private lateinit var imageCapture: ImageCapture
@@ -159,6 +160,9 @@
binding.detectView.updateTargetPosition(null)
} else {
binding.detectView.updateTargetPosition(it.result)
+ it.result.forEach { result ->
+ targetSet.add(result.label)
+ }
}
}
isDetectingTarget = false
@@ -307,7 +311,14 @@
}
binding.tipsButton.setOnClickListener {
-
+ if (targetSet.isEmpty()) {
+ "未识别到任何目标,无法查看检查清单".show(this)
+ return@setOnClickListener
+ }
+ //根据识别出来的结果显示清单
+ navigatePageTo(
+ arrayListOf(detectedScene, targetSet.toJson())
+ )
}
binding.addButton.setOnClickListener {
diff --git a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
index e17e84c..bf8c056 100644
--- a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
+++ b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
@@ -6,6 +6,8 @@
import com.casic.br.app.extensions.getResponseMessage
import com.casic.br.app.model.CheckManifestDetailModel
import com.casic.br.app.model.CheckManifestModel
+import com.casic.br.app.model.SceneCheckManifestModel
+import com.casic.br.app.model.TargetCheckManifestModel
import com.casic.br.app.retrofit.RetrofitServiceManager
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
@@ -19,6 +21,8 @@
private val gson by lazy { Gson() }
val manifestResult = MutableLiveData()
val manifestDetailResult = MutableLiveData()
+ val sceneManifestResult = MutableLiveData()
+ val targetManifestResult = MutableLiveData()
fun getCheckManifestByPage(
context: Context, keywords: String, type: String, scene: String, offset: Int
@@ -63,4 +67,47 @@
loadState.value = LoadState.Fail
it.localizedMessage?.show(context)
})
+
+ fun getCheckManifestByScene(context: Context, scene: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, "")
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ sceneManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ }, {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
+
+ fun getCheckManifestByTarget(context: Context, scene: String, target: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, target)
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ targetManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ },
+ {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
index 1bda3b4..9b714d0 100644
--- a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
@@ -49,7 +49,7 @@
binding.checkPersonView.text = rowsModel.inspectionUser
//列表上部统计
- binding.countView.text = rowsModel.inspectionUser
+ binding.countView.text = rowsModel.alarmCount
checkHistoryViewModel = ViewModelProvider(this)[CheckHistoryViewModel::class.java]
checkHistoryViewModel.getCheckHistoryDetailById(this, rowsModel.id)
diff --git a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
new file mode 100644
index 0000000..db1201d
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
@@ -0,0 +1,70 @@
+package com.casic.br.app.view
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.adapter.TopViewPagerAdapter
+import com.casic.br.app.databinding.ActivityCheckManifestByTargetBinding
+import com.casic.br.app.fragment.TargetCheckManifestFragment
+import com.casic.br.app.vm.ConfigViewModel
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+import com.pengxh.kt.lite.base.KotlinBaseActivity
+import com.pengxh.kt.lite.utils.Constant
+
+class CheckManifestByTargetActivity : KotlinBaseActivity() {
+
+ private val kTag = "CheckManifestByTargetActivity"
+ private val gson by lazy { Gson() }
+ private lateinit var configViewModel: ConfigViewModel
+ private var fragmentPages = ArrayList()
+
+ override fun initEvent() {
+ binding.confirmButton.setOnClickListener { finish() }
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ val args = intent.getStringArrayListExtra(Constant.INTENT_PARAM) as ArrayList
+
+ val detectedScene = args[0]
+ //场景需要转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(this, "securityScene")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == detectedScene) {
+ val targetSet = gson.fromJson>(
+ args[1], object : TypeToken>() {}.type
+ )
+ val subPageTitles = ArrayList()
+ targetSet.forEach { target ->
+ subPageTitles.add("${target}检查清单")
+ fragmentPages.add(TargetCheckManifestFragment(dic.value, target))
+ }
+
+ val topViewPagerAdapter = TopViewPagerAdapter(
+ supportFragmentManager, subPageTitles.toTypedArray(), fragmentPages
+ )
+ binding.viewPager.offscreenPageLimit = fragmentPages.size
+ binding.viewPager.adapter = topViewPagerAdapter
+ binding.tabLayout.setupWithViewPager(binding.viewPager)
+ return@observe
+ }
+ }
+ }
+ }
+ }
+
+ override fun initViewBinding(): ActivityCheckManifestByTargetBinding {
+ return ActivityCheckManifestByTargetBinding.inflate(layoutInflater)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
index f24dd7c..6a50417 100644
--- a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
@@ -76,6 +76,7 @@
ThreadPoolExecutor.AbortPolicy()
)
private val locationManager by lazy { LocationManager(this) }
+ private val targetSet by lazy { HashSet() }
private lateinit var cameraExecutor: ExecutorService
private lateinit var cameraProviderFuture: ListenableFuture
private lateinit var imageCapture: ImageCapture
@@ -159,6 +160,9 @@
binding.detectView.updateTargetPosition(null)
} else {
binding.detectView.updateTargetPosition(it.result)
+ it.result.forEach { result ->
+ targetSet.add(result.label)
+ }
}
}
isDetectingTarget = false
@@ -307,7 +311,14 @@
}
binding.tipsButton.setOnClickListener {
-
+ if (targetSet.isEmpty()) {
+ "未识别到任何目标,无法查看检查清单".show(this)
+ return@setOnClickListener
+ }
+ //根据识别出来的结果显示清单
+ navigatePageTo(
+ arrayListOf(detectedScene, targetSet.toJson())
+ )
}
binding.addButton.setOnClickListener {
diff --git a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
index e17e84c..bf8c056 100644
--- a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
+++ b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
@@ -6,6 +6,8 @@
import com.casic.br.app.extensions.getResponseMessage
import com.casic.br.app.model.CheckManifestDetailModel
import com.casic.br.app.model.CheckManifestModel
+import com.casic.br.app.model.SceneCheckManifestModel
+import com.casic.br.app.model.TargetCheckManifestModel
import com.casic.br.app.retrofit.RetrofitServiceManager
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
@@ -19,6 +21,8 @@
private val gson by lazy { Gson() }
val manifestResult = MutableLiveData()
val manifestDetailResult = MutableLiveData()
+ val sceneManifestResult = MutableLiveData()
+ val targetManifestResult = MutableLiveData()
fun getCheckManifestByPage(
context: Context, keywords: String, type: String, scene: String, offset: Int
@@ -63,4 +67,47 @@
loadState.value = LoadState.Fail
it.localizedMessage?.show(context)
})
+
+ fun getCheckManifestByScene(context: Context, scene: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, "")
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ sceneManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ }, {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
+
+ fun getCheckManifestByTarget(context: Context, scene: String, target: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, target)
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ targetManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ },
+ {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_check_manifest_by_target.xml b/app/src/main/res/layout/activity_check_manifest_by_target.xml
new file mode 100644
index 0000000..8c86fef
--- /dev/null
+++ b/app/src/main/res/layout/activity_check_manifest_by_target.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
index 1bda3b4..9b714d0 100644
--- a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
@@ -49,7 +49,7 @@
binding.checkPersonView.text = rowsModel.inspectionUser
//列表上部统计
- binding.countView.text = rowsModel.inspectionUser
+ binding.countView.text = rowsModel.alarmCount
checkHistoryViewModel = ViewModelProvider(this)[CheckHistoryViewModel::class.java]
checkHistoryViewModel.getCheckHistoryDetailById(this, rowsModel.id)
diff --git a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
new file mode 100644
index 0000000..db1201d
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
@@ -0,0 +1,70 @@
+package com.casic.br.app.view
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.adapter.TopViewPagerAdapter
+import com.casic.br.app.databinding.ActivityCheckManifestByTargetBinding
+import com.casic.br.app.fragment.TargetCheckManifestFragment
+import com.casic.br.app.vm.ConfigViewModel
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+import com.pengxh.kt.lite.base.KotlinBaseActivity
+import com.pengxh.kt.lite.utils.Constant
+
+class CheckManifestByTargetActivity : KotlinBaseActivity() {
+
+ private val kTag = "CheckManifestByTargetActivity"
+ private val gson by lazy { Gson() }
+ private lateinit var configViewModel: ConfigViewModel
+ private var fragmentPages = ArrayList()
+
+ override fun initEvent() {
+ binding.confirmButton.setOnClickListener { finish() }
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ val args = intent.getStringArrayListExtra(Constant.INTENT_PARAM) as ArrayList
+
+ val detectedScene = args[0]
+ //场景需要转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(this, "securityScene")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == detectedScene) {
+ val targetSet = gson.fromJson>(
+ args[1], object : TypeToken>() {}.type
+ )
+ val subPageTitles = ArrayList()
+ targetSet.forEach { target ->
+ subPageTitles.add("${target}检查清单")
+ fragmentPages.add(TargetCheckManifestFragment(dic.value, target))
+ }
+
+ val topViewPagerAdapter = TopViewPagerAdapter(
+ supportFragmentManager, subPageTitles.toTypedArray(), fragmentPages
+ )
+ binding.viewPager.offscreenPageLimit = fragmentPages.size
+ binding.viewPager.adapter = topViewPagerAdapter
+ binding.tabLayout.setupWithViewPager(binding.viewPager)
+ return@observe
+ }
+ }
+ }
+ }
+ }
+
+ override fun initViewBinding(): ActivityCheckManifestByTargetBinding {
+ return ActivityCheckManifestByTargetBinding.inflate(layoutInflater)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
index f24dd7c..6a50417 100644
--- a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
@@ -76,6 +76,7 @@
ThreadPoolExecutor.AbortPolicy()
)
private val locationManager by lazy { LocationManager(this) }
+ private val targetSet by lazy { HashSet() }
private lateinit var cameraExecutor: ExecutorService
private lateinit var cameraProviderFuture: ListenableFuture
private lateinit var imageCapture: ImageCapture
@@ -159,6 +160,9 @@
binding.detectView.updateTargetPosition(null)
} else {
binding.detectView.updateTargetPosition(it.result)
+ it.result.forEach { result ->
+ targetSet.add(result.label)
+ }
}
}
isDetectingTarget = false
@@ -307,7 +311,14 @@
}
binding.tipsButton.setOnClickListener {
-
+ if (targetSet.isEmpty()) {
+ "未识别到任何目标,无法查看检查清单".show(this)
+ return@setOnClickListener
+ }
+ //根据识别出来的结果显示清单
+ navigatePageTo(
+ arrayListOf(detectedScene, targetSet.toJson())
+ )
}
binding.addButton.setOnClickListener {
diff --git a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
index e17e84c..bf8c056 100644
--- a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
+++ b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
@@ -6,6 +6,8 @@
import com.casic.br.app.extensions.getResponseMessage
import com.casic.br.app.model.CheckManifestDetailModel
import com.casic.br.app.model.CheckManifestModel
+import com.casic.br.app.model.SceneCheckManifestModel
+import com.casic.br.app.model.TargetCheckManifestModel
import com.casic.br.app.retrofit.RetrofitServiceManager
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
@@ -19,6 +21,8 @@
private val gson by lazy { Gson() }
val manifestResult = MutableLiveData()
val manifestDetailResult = MutableLiveData()
+ val sceneManifestResult = MutableLiveData()
+ val targetManifestResult = MutableLiveData()
fun getCheckManifestByPage(
context: Context, keywords: String, type: String, scene: String, offset: Int
@@ -63,4 +67,47 @@
loadState.value = LoadState.Fail
it.localizedMessage?.show(context)
})
+
+ fun getCheckManifestByScene(context: Context, scene: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, "")
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ sceneManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ }, {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
+
+ fun getCheckManifestByTarget(context: Context, scene: String, target: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, target)
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ targetManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ },
+ {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_check_manifest_by_target.xml b/app/src/main/res/layout/activity_check_manifest_by_target.xml
new file mode 100644
index 0000000..8c86fef
--- /dev/null
+++ b/app/src/main/res/layout/activity_check_manifest_by_target.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_target_check_manifest.xml b/app/src/main/res/layout/fragment_target_check_manifest.xml
new file mode 100644
index 0000000..6ca97b9
--- /dev/null
+++ b/app/src/main/res/layout/fragment_target_check_manifest.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a2bc167..0950ef9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,6 +63,9 @@
android:name=".view.CheckManifestBySceneActivity"
android:theme="@style/ActivityOnDialogStyle" />
+
()
- it.data.rows.forEach { row ->
+ it.data.forEach { row ->
mainClassSet.add(row.typeName)
}
val typeNameAdapter = object : NormalRecyclerAdapter(
@@ -74,10 +72,10 @@
}
}
- private fun initSubRecyclerView(parent: CheckManifestModel, selectedType: String) {
+ private fun initSubRecyclerView(parent: SceneCheckManifestModel, selectedType: String) {
//根据大类查询隐患内容
val contentSet = HashSet()
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.typeName == selectedType) {
contentSet.add(row.checkItem)
}
@@ -90,7 +88,7 @@
.setText(R.id.troubleNameView, item)
.setOnClickListener(R.id.showImageView) {
//显示行业标准
- for (row in parent.data.rows) {
+ for (row in parent.data) {
if (row.checkItem == item) {
CheckStandardSheet.Builder()
.setContext(requireContext())
diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
new file mode 100644
index 0000000..b6867ae
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt
@@ -0,0 +1,87 @@
+package com.casic.br.app.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.R
+import com.casic.br.app.databinding.FragmentTargetCheckManifestBinding
+import com.casic.br.app.model.TargetCheckManifestModel
+import com.casic.br.app.vm.CheckManifestViewModel
+import com.casic.br.app.vm.ConfigViewModel
+import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter
+import com.pengxh.kt.lite.adapter.ViewHolder
+import com.pengxh.kt.lite.base.KotlinBaseFragment
+import com.pengxh.kt.lite.extensions.show
+
+class TargetCheckManifestFragment(
+ private val scene: String, private val target: String
+) : KotlinBaseFragment() {
+
+ private val kTag = "CheckManifestFragment"
+ private lateinit var configViewModel: ConfigViewModel
+ private lateinit var checkManifestViewModel: CheckManifestViewModel
+
+ override fun initEvent() {
+
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ //target转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(requireContext(), "inspectionObject")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == target) {
+ checkManifestViewModel.getCheckManifestByTarget(
+ requireContext(), scene, dic.value
+ )
+ return@observe
+ }
+ }
+ }
+ }
+
+ checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java]
+ checkManifestViewModel.targetManifestResult.observe(this) {
+ if (it.code == 200) {
+ val contentAdapter =
+ object : NormalRecyclerAdapter(
+ R.layout.item_hidden_trouble_l_3, it.data
+ ) {
+ override fun convertView(
+ viewHolder: ViewHolder, position: Int,
+ item: TargetCheckManifestModel.DataModel
+ ) {
+ viewHolder.setText(R.id.troubleIndexView, "${position + 1}、")
+ .setText(R.id.troubleNameView, item.checkStandard)
+ .setOnClickListener(R.id.showImageView) {
+ //显示行业标准
+// CheckStandardSheet.Builder()
+// .setContext(requireContext())
+// .setSheetValue(item.basisList)
+// .build().show()
+ "未实现".show(requireContext())
+ }
+ }
+ }
+ binding.recyclerView.adapter = contentAdapter
+ }
+ }
+ }
+
+ override fun initViewBinding(
+ inflater: LayoutInflater, container: ViewGroup?
+ ): FragmentTargetCheckManifestBinding {
+ return FragmentTargetCheckManifestBinding.inflate(inflater, container, false)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
new file mode 100644
index 0000000..75acbef
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/SceneCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class SceneCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
new file mode 100644
index 0000000..1f4a839
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/model/TargetCheckManifestModel.java
@@ -0,0 +1,208 @@
+package com.casic.br.app.model;
+
+import java.util.List;
+
+public class TargetCheckManifestModel {
+
+ private int code;
+ private List data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataModel {
+ private List> basisList;
+ private String checkItem;
+ private String checkMethod;
+ private String checkObject;
+ private String checkObjectName;
+ private String checkStandard;
+ private String createTime;
+ private String createUserId;
+ private String createUserName;
+ private String id;
+ private String remark;
+ private String scene;
+ private String sceneName;
+ private String type;
+ private String typeName;
+ private String updateTime;
+ private String updateUserId;
+ private String updateUserName;
+
+ public List> getBasisList() {
+ return basisList;
+ }
+
+ public void setBasisList(List> basisList) {
+ this.basisList = basisList;
+ }
+
+ public String getCheckItem() {
+ return checkItem;
+ }
+
+ public void setCheckItem(String checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public String getCheckMethod() {
+ return checkMethod;
+ }
+
+ public void setCheckMethod(String checkMethod) {
+ this.checkMethod = checkMethod;
+ }
+
+ public String getCheckObject() {
+ return checkObject;
+ }
+
+ public void setCheckObject(String checkObject) {
+ this.checkObject = checkObject;
+ }
+
+ public String getCheckObjectName() {
+ return checkObjectName;
+ }
+
+ public void setCheckObjectName(String checkObjectName) {
+ this.checkObjectName = checkObjectName;
+ }
+
+ public String getCheckStandard() {
+ return checkStandard;
+ }
+
+ public void setCheckStandard(String checkStandard) {
+ this.checkStandard = checkStandard;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(String createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public String getCreateUserName() {
+ return createUserName;
+ }
+
+ public void setCreateUserName(String createUserName) {
+ this.createUserName = createUserName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getScene() {
+ return scene;
+ }
+
+ public void setScene(String scene) {
+ this.scene = scene;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public String getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(String updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(String updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public String getUpdateUserName() {
+ return updateUserName;
+ }
+
+ public void setUpdateUserName(String updateUserName) {
+ this.updateUserName = updateUserName;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
index 925ef91..34bf9b7 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitService.kt
@@ -119,7 +119,7 @@
): String
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
@GET("/check-menu/listPage")
suspend fun getCheckManifestByPage(
@@ -132,6 +132,18 @@
): String
/**
+ * 获取检查清单-不分页
+ */
+ @GET("/check-menu/list")
+ suspend fun getCheckManifest(
+ @Header("token") token: String,
+ @Query("keyword") keyword: String,
+ @Query("type") type: String,
+ @Query("scene") scene: String,
+ @Query("checkObject") checkObject: String
+ ): String
+
+ /**
* 获取检查清单详情
*/
@GET("/check-menu/detail")
diff --git a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
index fd274fb..ec93acb 100644
--- a/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
+++ b/app/src/main/java/com/casic/br/app/retrofit/RetrofitServiceManager.kt
@@ -170,17 +170,26 @@
}
/**
- * 获取检查清单
+ * 获取检查清单-分页
*/
suspend fun getCheckManifestByPage(
- keywords: String, type: String, scene: String, offset: Int
+ keyword: String, type: String, scene: String, offset: Int
): String {
return api.getCheckManifestByPage(
- AuthenticationHelper.token, keywords, type, scene, offset, LocaleConstant.PAGE_LIMIT
+ AuthenticationHelper.token, keyword, type, scene, offset, LocaleConstant.PAGE_LIMIT
)
}
/**
+ * 获取检查清单-不分页
+ */
+ suspend fun getCheckManifest(
+ keyword: String, type: String, scene: String, checkObject: String
+ ): String {
+ return api.getCheckManifest(AuthenticationHelper.token, keyword, type, scene, checkObject)
+ }
+
+ /**
* 获取检查清单详情
*/
suspend fun getCheckManifestDetailById(id: String): String {
diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
index 3b49732..ecd425a 100644
--- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt
@@ -57,5 +57,5 @@
const val DEFAULT_SERVER_CONFIG = "defaultServerConfig"
const val SERVER_BASE_URL = "http://111.198.10.15:22003"
const val AI_SERVER_CONFIG = "aiServerConfig"
- const val AI_BASE_URL = "http://192.168.186.127:5000"
+ const val AI_BASE_URL = "http://192.168.14.127:5000"
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
index 1bda3b4..9b714d0 100644
--- a/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/CheckHistoryDetailActivity.kt
@@ -49,7 +49,7 @@
binding.checkPersonView.text = rowsModel.inspectionUser
//列表上部统计
- binding.countView.text = rowsModel.inspectionUser
+ binding.countView.text = rowsModel.alarmCount
checkHistoryViewModel = ViewModelProvider(this)[CheckHistoryViewModel::class.java]
checkHistoryViewModel.getCheckHistoryDetailById(this, rowsModel.id)
diff --git a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
new file mode 100644
index 0000000..db1201d
--- /dev/null
+++ b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt
@@ -0,0 +1,70 @@
+package com.casic.br.app.view
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.ViewModelProvider
+import com.casic.br.app.adapter.TopViewPagerAdapter
+import com.casic.br.app.databinding.ActivityCheckManifestByTargetBinding
+import com.casic.br.app.fragment.TargetCheckManifestFragment
+import com.casic.br.app.vm.ConfigViewModel
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+import com.pengxh.kt.lite.base.KotlinBaseActivity
+import com.pengxh.kt.lite.utils.Constant
+
+class CheckManifestByTargetActivity : KotlinBaseActivity() {
+
+ private val kTag = "CheckManifestByTargetActivity"
+ private val gson by lazy { Gson() }
+ private lateinit var configViewModel: ConfigViewModel
+ private var fragmentPages = ArrayList()
+
+ override fun initEvent() {
+ binding.confirmButton.setOnClickListener { finish() }
+ }
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ val args = intent.getStringArrayListExtra(Constant.INTENT_PARAM) as ArrayList
+
+ val detectedScene = args[0]
+ //场景需要转为字典值
+ configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java]
+ configViewModel.getDictionaryByCode(this, "securityScene")
+ configViewModel.dictionary.observe(this) {
+ if (it.code == 200) {
+ for (dic in it.data) {
+ if (dic.name == detectedScene) {
+ val targetSet = gson.fromJson>(
+ args[1], object : TypeToken>() {}.type
+ )
+ val subPageTitles = ArrayList()
+ targetSet.forEach { target ->
+ subPageTitles.add("${target}检查清单")
+ fragmentPages.add(TargetCheckManifestFragment(dic.value, target))
+ }
+
+ val topViewPagerAdapter = TopViewPagerAdapter(
+ supportFragmentManager, subPageTitles.toTypedArray(), fragmentPages
+ )
+ binding.viewPager.offscreenPageLimit = fragmentPages.size
+ binding.viewPager.adapter = topViewPagerAdapter
+ binding.tabLayout.setupWithViewPager(binding.viewPager)
+ return@observe
+ }
+ }
+ }
+ }
+ }
+
+ override fun initViewBinding(): ActivityCheckManifestByTargetBinding {
+ return ActivityCheckManifestByTargetBinding.inflate(layoutInflater)
+ }
+
+ override fun observeRequestState() {
+
+ }
+
+ override fun setupTopBarLayout() {
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
index f24dd7c..6a50417 100644
--- a/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
+++ b/app/src/main/java/com/casic/br/app/view/StartCheckActivity.kt
@@ -76,6 +76,7 @@
ThreadPoolExecutor.AbortPolicy()
)
private val locationManager by lazy { LocationManager(this) }
+ private val targetSet by lazy { HashSet() }
private lateinit var cameraExecutor: ExecutorService
private lateinit var cameraProviderFuture: ListenableFuture
private lateinit var imageCapture: ImageCapture
@@ -159,6 +160,9 @@
binding.detectView.updateTargetPosition(null)
} else {
binding.detectView.updateTargetPosition(it.result)
+ it.result.forEach { result ->
+ targetSet.add(result.label)
+ }
}
}
isDetectingTarget = false
@@ -307,7 +311,14 @@
}
binding.tipsButton.setOnClickListener {
-
+ if (targetSet.isEmpty()) {
+ "未识别到任何目标,无法查看检查清单".show(this)
+ return@setOnClickListener
+ }
+ //根据识别出来的结果显示清单
+ navigatePageTo(
+ arrayListOf(detectedScene, targetSet.toJson())
+ )
}
binding.addButton.setOnClickListener {
diff --git a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
index e17e84c..bf8c056 100644
--- a/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
+++ b/app/src/main/java/com/casic/br/app/vm/CheckManifestViewModel.kt
@@ -6,6 +6,8 @@
import com.casic.br.app.extensions.getResponseMessage
import com.casic.br.app.model.CheckManifestDetailModel
import com.casic.br.app.model.CheckManifestModel
+import com.casic.br.app.model.SceneCheckManifestModel
+import com.casic.br.app.model.TargetCheckManifestModel
import com.casic.br.app.retrofit.RetrofitServiceManager
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
@@ -19,6 +21,8 @@
private val gson by lazy { Gson() }
val manifestResult = MutableLiveData()
val manifestDetailResult = MutableLiveData()
+ val sceneManifestResult = MutableLiveData()
+ val targetManifestResult = MutableLiveData()
fun getCheckManifestByPage(
context: Context, keywords: String, type: String, scene: String, offset: Int
@@ -63,4 +67,47 @@
loadState.value = LoadState.Fail
it.localizedMessage?.show(context)
})
+
+ fun getCheckManifestByScene(context: Context, scene: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, "")
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ sceneManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ }, {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
+
+ fun getCheckManifestByTarget(context: Context, scene: String, target: String) = launch({
+ loadState.value = LoadState.Loading
+ val response = RetrofitServiceManager.getCheckManifest("", "", scene, target)
+ when (response.getResponseCode()) {
+ 200 -> {
+ loadState.value = LoadState.Success
+ targetManifestResult.value = gson.fromJson(
+ response, object : TypeToken() {}.type
+ )
+ }
+
+ else -> {
+ loadState.value = LoadState.Fail
+ response.getResponseMessage().show(context)
+ }
+ }
+ },
+ {
+ loadState.value = LoadState.Fail
+ it.localizedMessage?.show(context)
+ })
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_check_manifest_by_target.xml b/app/src/main/res/layout/activity_check_manifest_by_target.xml
new file mode 100644
index 0000000..8c86fef
--- /dev/null
+++ b/app/src/main/res/layout/activity_check_manifest_by_target.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_target_check_manifest.xml b/app/src/main/res/layout/fragment_target_check_manifest.xml
new file mode 100644
index 0000000..6ca97b9
--- /dev/null
+++ b/app/src/main/res/layout/fragment_target_check_manifest.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/sheet_check_standard.xml b/app/src/main/res/layout/sheet_check_standard.xml
index e9eecbd..404de38 100644
--- a/app/src/main/res/layout/sheet_check_standard.xml
+++ b/app/src/main/res/layout/sheet_check_standard.xml
@@ -11,7 +11,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/lib_dp_5"
android:background="@drawable/sheet_bg_white_layout"
- android:padding="@dimen/dp_7"
+ android:padding="@dimen/dp_15"
android:textColor="@color/themeColor" />