瀏覽代碼

添加获取物资柜物品分类及分类下物资数量和列表接口;调整部分常量

Frankensteinly 8 月之前
父節點
當前提交
e787fb8a03

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -13,6 +13,7 @@
         android:fullBackupContent="@xml/backup_rules"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
+        android:networkSecurityConfig="@xml/common_network_config"
         android:roundIcon="@mipmap/ic_launcher_round"
         android:supportsRtl="true"
         android:theme="@style/Theme.ISCS_MC"

+ 1 - 1
app/src/main/java/com/grkj/iscs_mc/model/Constants.kt

@@ -1,7 +1,7 @@
 package com.grkj.iscs_mc.model
 
 object Constants {
-    const val DEVICE_TYPE = 1 // 1.机柜 2.物料柜 3.手提柜 4.混合柜
+    const val DEVICE_TYPE = 2 // 1.机柜 2.物料柜 3.手提柜 4.混合柜
     const val DEVICE_TYPE_NORMAL = "Android_Normal"     // 机柜
     const val DEVICE_TYPE_MATERIAL = "Android_Material" // 物资柜
     const val DEVICE_TYPE_PORTABLE = "Android_Portable" // 手提柜

+ 9 - 0
app/src/main/java/com/grkj/iscs_mc/model/UrlConsts.kt

@@ -196,4 +196,13 @@ object UrlConsts {
      * 获取用户信息
      */
     const val GET_USER_INFO = "/getInfo"
+
+
+    /********************************物资柜********************************/
+
+    /**
+     * 获取物资柜物品分类及分类下物资数量和列表
+     */
+    const val MATERIAL_LIST = "/iscs/hardware/material-api/selectMaterialsByCabinetId"
+
 }

+ 65 - 0
app/src/main/java/com/grkj/iscs_mc/model/vo/MaterialListRespVO.kt

@@ -0,0 +1,65 @@
+package com.grkj.iscs_mc.model.vo
+
+data class MaterialListRespVO(
+    val materialsTypeId: Long?,
+
+    val materialsTypeName: String?,
+
+    val number: Int?,
+
+    val materials: List<MaterialsPageVO>?
+) {
+    data class MaterialsPageVO(
+        val materialsId: Long?,
+
+        val materialsCode: String?,
+
+        val materialsName: String?,
+
+        val materialsTypeId: Long?,
+
+        val materialsTypeName: String?,
+
+        val workareaId: Long?,
+
+        val materialsCabinetId: Long?,
+
+        val cabinetName: String?,
+
+        val serviceLife: String?,
+
+        val availableLife: String?,
+
+        val serviceTimes: Long?,
+
+        val availableTimes: Long?,
+
+        val startTime: String?,
+
+        val delFlag: String?,
+
+        val loanState: String?,
+
+        val materialsRfid: String?,
+
+        val supplier: String?,
+
+        val expirationDate: String?,
+
+        val materialsTypeIcon: String?,
+
+        val materialsTypePicture: String?,
+
+        val properties: String?,
+
+        val propertiesValueId: String?,
+
+        val propertiesValue: String?,
+
+        val propertiesPropertyId: String?,
+
+        val propertiesProperty: String?,
+
+        val status: String?
+    )
+}

+ 1 - 1
app/src/main/java/com/grkj/iscs_mc/util/FileUtil.kt

@@ -13,7 +13,7 @@ import java.io.InputStreamReader
 
 object FileUtil {
 
-    private const val ROOT_APP = "iscs"
+    private const val ROOT_APP = "iscs_mc"
     val DOWNLOAD_DIR = "${separator}download"
     val LOG_DIR = "${separator}log"
 

+ 21 - 0
app/src/main/java/com/grkj/iscs_mc/util/NetApi.kt

@@ -3,6 +3,7 @@ package com.grkj.iscs_mc.util
 import com.grkj.iscs_mc.MyApplication
 import com.grkj.iscs_mc.model.Token
 import com.grkj.iscs_mc.model.UrlConsts
+import com.grkj.iscs_mc.model.vo.MaterialListRespVO
 import com.grkj.iscs_mc.model.vo.card.CardInfoRespVO
 import com.grkj.iscs_mc.model.vo.dept.DeptListRespVO
 import com.grkj.iscs_mc.model.vo.key.KeyInfoRespVO
@@ -686,4 +687,24 @@ object NetApi {
             }, isGet = true, isAuth = true
         )
     }
+
+    /********************************物资柜********************************/
+
+    /**
+     * 获取物资柜物品分类及分类下物资数量和列表
+     */
+    fun getMaterialList(cabinetId: Long, callBack: (MutableList<MaterialListRespVO>?) -> Unit) {
+        NetHttpManager.getInstance().doRequestNet(
+            UrlConsts.MATERIAL_LIST,
+            false,
+            mapOf(
+                "cabinetId" to cabinetId
+            ),
+            { res, _, _ ->
+                res?.let {
+                    callBack.invoke(getRefBean(it))
+                }
+            }, isGet = true, isAuth= true
+        )
+    }
 }

+ 7 - 0
app/src/main/java/com/grkj/iscs_mc/view/presenter/MaterialFetchReturnPresenter.kt

@@ -1,7 +1,14 @@
 package com.grkj.iscs_mc.view.presenter
 
+import com.grkj.iscs_mc.util.NetApi
 import com.grkj.iscs_mc.view.base.BasePresenter
 import com.grkj.iscs_mc.view.iview.IMaterialFetchReturnView
 
 class MaterialFetchReturnPresenter : BasePresenter<IMaterialFetchReturnView>() {
+
+    fun getMaterialList() {
+        NetApi.getMaterialList(1) {
+            println("haha : $it")
+        }
+    }
 }

+ 4 - 0
app/src/main/res/xml/common_network_config.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+    <base-config cleartextTrafficPermitted="true" />
+</network-security-config>