|
|
@@ -8,6 +8,7 @@ import com.grkj.iscs.model.vo.FileStreamReqParam
|
|
|
import com.grkj.iscs.model.vo.card.CardInfoRespVO
|
|
|
import com.grkj.iscs.model.vo.characteristic.CharacteristicPageRespVO
|
|
|
import com.grkj.iscs.model.vo.dept.DeptListRespVO
|
|
|
+import com.grkj.iscs.model.vo.dict.CommonDictRespVO
|
|
|
import com.grkj.iscs.model.vo.finger.LoginFingerprintRespVO
|
|
|
import com.grkj.iscs.model.vo.key.KeyInfoRespVO
|
|
|
import com.grkj.iscs.model.vo.lock.LockInfoRespVO
|
|
|
@@ -32,6 +33,10 @@ import com.grkj.iscs.model.vo.user.RoleListRespVO
|
|
|
import com.grkj.iscs.model.vo.user.UserInfoRespVO
|
|
|
import com.grkj.iscs.model.vo.user.UserListRespVO
|
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
|
+import java.text.SimpleDateFormat
|
|
|
+import java.time.LocalDateTime
|
|
|
+import java.util.Calendar
|
|
|
+import java.util.Locale
|
|
|
|
|
|
/**
|
|
|
* 网络请求
|
|
|
@@ -897,4 +902,59 @@ object NetApi {
|
|
|
}, isGet = true, isAuth = true
|
|
|
)
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增异常记录
|
|
|
+ *
|
|
|
+ * @param exceptionCategory 异常种类(0-锁控柜 1-物资柜)
|
|
|
+ */
|
|
|
+ fun insertException(
|
|
|
+ exceptionCategory: String,
|
|
|
+ exceptionDescription: String?,
|
|
|
+ exceptionLevel: String,
|
|
|
+ exceptionType: String,
|
|
|
+ raiser: Long,
|
|
|
+ sourceName: String,
|
|
|
+ callBack: (Boolean) -> Unit
|
|
|
+ ) {
|
|
|
+ val map = mutableMapOf(
|
|
|
+ "exceptionCategory" to exceptionCategory,
|
|
|
+ "exceptionLevel" to exceptionLevel,
|
|
|
+ "exceptionType" to exceptionType,
|
|
|
+ "raiser" to raiser,
|
|
|
+ "sourceName" to sourceName,
|
|
|
+ "raiseTime" to SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).format(Calendar.getInstance().time)
|
|
|
+ )
|
|
|
+ exceptionDescription?.let {
|
|
|
+ map["exceptionDescription"] = it
|
|
|
+ }
|
|
|
+ NetHttpManager.getInstance().doRequestNet(
|
|
|
+ UrlConsts.INSERT_EXCEPTION,
|
|
|
+ false,
|
|
|
+ map,
|
|
|
+ { res, _, _ ->
|
|
|
+ res?.let {
|
|
|
+ callBack.invoke(true)
|
|
|
+ } ?: run {
|
|
|
+ callBack.invoke(false)
|
|
|
+ }
|
|
|
+ }, isGet = false, isAuth = true
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询字典
|
|
|
+ */
|
|
|
+ fun getDictData(url: String, callBack: (MutableList<CommonDictRespVO>?) -> Unit) {
|
|
|
+ NetHttpManager.getInstance().doRequestNet(
|
|
|
+ url,
|
|
|
+ false,
|
|
|
+ mapOf<String, String>(),
|
|
|
+ { res, _, _ ->
|
|
|
+ res?.let {
|
|
|
+ callBack.invoke(getRefBean(it))
|
|
|
+ }
|
|
|
+ }, isGet = true, isAuth = true
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|