|
|
@@ -3,7 +3,6 @@ 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.material.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
|
|
|
@@ -11,6 +10,7 @@ import com.grkj.iscs_mc.model.vo.lock.LockInfoRespVO
|
|
|
import com.grkj.iscs_mc.model.vo.machinery.MachineryDetailRespVO
|
|
|
import com.grkj.iscs_mc.model.vo.machinery.MachineryPageRespVO
|
|
|
import com.grkj.iscs_mc.model.vo.material.MaterialDetailRespVO
|
|
|
+import com.grkj.iscs_mc.model.vo.material.MaterialListRespVO
|
|
|
import com.grkj.iscs_mc.model.vo.sop.SopInfoRespVO
|
|
|
import com.grkj.iscs_mc.model.vo.sop.SopPageRespVO
|
|
|
import com.grkj.iscs_mc.model.vo.ticket.LockPointUpdateReqVO
|
|
|
@@ -693,12 +693,12 @@ object NetApi {
|
|
|
/**
|
|
|
* 获取物资柜物品分类及分类下物资数量和列表
|
|
|
*/
|
|
|
- fun getMaterialList(cabinetId: Long, callBack: (MutableList<MaterialListRespVO>?) -> Unit) {
|
|
|
+ fun getMaterialList(cabinetCode: String, callBack: (MutableList<MaterialListRespVO>?) -> Unit) {
|
|
|
NetHttpManager.getInstance().doRequestNet(
|
|
|
UrlConsts.MATERIAL_LIST,
|
|
|
false,
|
|
|
mapOf(
|
|
|
- "cabinetId" to cabinetId
|
|
|
+ "cabinetCode" to cabinetCode
|
|
|
),
|
|
|
{ res, _, _ ->
|
|
|
res?.let {
|
|
|
@@ -743,4 +743,47 @@ object NetApi {
|
|
|
}, isGet = true, isAuth = true
|
|
|
)
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开物资柜
|
|
|
+ *
|
|
|
+ * @param openType 开门类型(0-物资领取归还 1-物资检查 2-物资更换)
|
|
|
+ */
|
|
|
+ fun openCabinet(cabinetCode: String, openType: Int, callBack: (Boolean) -> Unit) {
|
|
|
+ NetHttpManager.getInstance().doRequestNet(
|
|
|
+ UrlConsts.OPEN_CABINET,
|
|
|
+ false,
|
|
|
+ mapOf(
|
|
|
+ "cabinetCode" to cabinetCode,
|
|
|
+ "openType" to openType
|
|
|
+ ),
|
|
|
+ { res, _, _ ->
|
|
|
+ res?.let {
|
|
|
+ callBack.invoke(true)
|
|
|
+ } ?: run {
|
|
|
+ callBack.invoke(false)
|
|
|
+ }
|
|
|
+ }, isGet = false, isAuth = true
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关闭物资柜
|
|
|
+ */
|
|
|
+ fun closeCabinet(cabinetCode: String, callBack: (Boolean) -> Unit) {
|
|
|
+ NetHttpManager.getInstance().doRequestNet(
|
|
|
+ UrlConsts.CLOSE_CABINET,
|
|
|
+ false,
|
|
|
+ mapOf(
|
|
|
+ "cabinetCode" to cabinetCode
|
|
|
+ ),
|
|
|
+ { res, _, _ ->
|
|
|
+ res?.let {
|
|
|
+ callBack.invoke(true)
|
|
|
+ } ?: run {
|
|
|
+ callBack.invoke(false)
|
|
|
+ }
|
|
|
+ }, isGet = false, isAuth = true
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|