瀏覽代碼

refactor(更新)
- 快捷入口的配置修改
- 异常上报时,源数据新增关联

周文健 10 月之前
父節點
當前提交
5e06a03ffb

+ 1 - 1
app/src/main/java/com/grkj/iscs/features/main/dialog/QuickEntranceConfigDialog.kt

@@ -46,7 +46,7 @@ class QuickEntranceConfigDialog(private val save: (String) -> Unit) :
             .toMutableList()
     private val quickEntranceList: MutableList<QuickEntranceMenuItemEntity>
         get() {
-            val quickEntryConfigJson = MMKVConstants.KEY_QUICK_ENTRY_CONFIG.getMMKVData("")
+            val quickEntryConfigJson = MainDomainData.userInfo?.quickEntranceConfig ?: ""
             val permissions = quickEntryConfigJson.split(",").filter { it.isNotBlank() }
                 .mapNotNull { runCatching { RoleFunctionalPermissionsEnum.valueOf(it) }.getOrNull() }
             return if (permissions.isEmpty()) {

+ 9 - 0
app/src/main/java/com/grkj/iscs/features/main/viewmodel/exception_manage/ExceptionViewModel.kt

@@ -3,6 +3,7 @@ package com.grkj.iscs.features.main.viewmodel.exception_manage
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.liveData
 import com.grkj.data.data.DictConstants
+import com.grkj.data.model.dos.IsExceptionSourceStandard
 import com.grkj.data.model.dos.IsExceptionStandard
 import com.grkj.data.model.res.CommonDictRes
 import com.grkj.data.model.vo.IsExceptionStandardVo
@@ -345,6 +346,14 @@ class ExceptionViewModel @Inject constructor(
             exceptionData.exceptionType = selectedExceptionType?.toInt() ?: 0
             exceptionData.exceptionDescription = selectedExceptionDescription
             exceptionData.processApplication = selectedProcessApplication
+            val exceptionId = exceptionRepository.reportException(exceptionData)
+            for (exceptionSource in selectedSourceData) {
+                val exceptionSourceData = IsExceptionSourceStandard()
+                exceptionSourceData.exceptionId = exceptionId
+                exceptionSourceData.sourceDataId = exceptionSource.sourceDataId
+                exceptionSourceData.sourceDataType = exceptionSource.sourceDataType
+                exceptionRepository.saveExceptionSourceData(exceptionSourceData)
+            }
             exceptionRepository.reportException(exceptionData)
             emit(true)
         }