feat issues refs #7636

This commit is contained in:
Sergio De la torre 2024-07-04 07:34:09 +02:00
parent caf220442a
commit d1a3c5fde4
5 changed files with 73 additions and 49 deletions

View File

@ -312,22 +312,13 @@
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="feat issues refs #7636">
<change afterPath="$PROJECT_DIR$/.idea/appInsightsSettings.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/deploymentTargetDropDown.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/deploymentTargetSelector.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/other.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/studiobot.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/kotlinc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/kotlinc.xml" afterDir="false" />
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="feat itemToBarCode refs #7614">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/beta/release/output-metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/app/beta/release/output-metadata.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragmentNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragmentNew.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/MobileApplication.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/MobileApplication.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/model/LoginItemVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/model/LoginItemVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
</list>
<list id="7b98f93d-6980-4bf1-8e61-c7afd10e56f2" name="Change_category" comment="Change_category" />
<option name="SHOW_DIALOG" value="false" />
@ -342,7 +333,7 @@
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[DeviceId(pluginId=PhysicalDevice, isTemplate=false, identifier=serial=21114523025303)]" />
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[C:\Users\sergiodt\.android\avd\Pixel_7a_API_30.avd]" />
<component name="ExportToHTMLSettings">
<option name="OPEN_IN_BROWSER" value="true" />
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
@ -498,6 +489,7 @@
&quot;ApkExportedModule&quot;: &quot;Gestor_Almacén.app&quot;,
&quot;ExportApk.ApkPathForGestor_Almacén.app&quot;: &quot;C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app&quot;,
&quot;Gradle.vn-warehouseManager [clean].executor&quot;: &quot;Run&quot;,
&quot;Gradle.vn-warehouseManager.executor&quot;: &quot;Run&quot;,
&quot;KotlinFunctionFindUsagesOptions.isSearchForTextOccurrences&quot;: &quot;true&quot;,
&quot;PROJECT_TRUSTED_KEY&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
@ -524,7 +516,7 @@
&quot;project.structure.proportion&quot;: &quot;0.17&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
&quot;run.code.analysis.last.selected.profile&quot;: &quot;pProject Default&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.editor&quot;
&quot;settings.editor.selected.configurable&quot;: &quot;reference.settingsdialog.project.gradle&quot;
},
&quot;keyToStringList&quot;: {
&quot;ExportApk.BuildVariants&quot;: [
@ -556,11 +548,11 @@
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\raw" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\java\es\verdnatura\domain\userCases" />
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable" />
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable-v24" />
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\raw" />
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\assets" />
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\font" />
</key>
<key name="MoveKotlinTopLevelDeclarationsDialog.RECENTS_KEY">
<recent name="es.verdnatura.presentation.view.feature.claim.fragment.ubication" />
@ -608,6 +600,7 @@
<option name="MODE" value="default_activity" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
@ -716,11 +709,8 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="Gradle.vn-warehouseManager" />
<item itemvalue="Gradle.vn-warehouseManager [clean]" />
<item itemvalue="Gradle.vn-warehouseManager" />
<item itemvalue="Gradle.vn-warehouseManager" />
<item itemvalue="Gradle.vn-warehouseManager" />
<item itemvalue="Gradle.vn-warehouseManager" />
</list>
</recent_temporary>
</component>
@ -1080,7 +1070,7 @@
<option name="project" value="LOCAL" />
<updated>1709725795643</updated>
</task>
<option name="localTasksCounter" value="290" />
<option name="localTasksCounter" value="298" />
<servers />
</component>
<component name="Vcs.Log.History.Properties">
@ -1161,7 +1151,7 @@
<entry key="text">
<value>
<list>
<option value="4979" />
<option value="userCase" />
</list>
</value>
</entry>
@ -1204,8 +1194,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="refs #6413 feat:refactor ubicador" />
<MESSAGE value="refs #6413 feat:refactor Ubicador" />
<MESSAGE value="refs #6531 feat:last tickets" />
<MESSAGE value="version 24.8beta" />
<MESSAGE value="modify gitIgnore" />
@ -1221,15 +1209,17 @@
<MESSAGE value="Change_category" />
<MESSAGE value="refs #6530 feat:refactorOnBackPressed" />
<MESSAGE value="feat changeCategory #refs 4979" />
<MESSAGE value="feat ticketQr #refs 6602" />
<MESSAGE value="feat refactor Ubicador #refs 6413" />
<MESSAGE value="feat notesDelivery #refs 6921" />
<MESSAGE value="feat roadMap #refs 7195" />
<MESSAGE value="feat lilium" />
<MESSAGE value="feat bugs" />
<MESSAGE value="feat reservas #refs 6861" />
<MESSAGE value="feat roadMap #refs 7195" />
<MESSAGE value="feat ticketQr #refs 6602" />
<MESSAGE value="feat itemShelvingLog #refs 7597" />
<MESSAGE value="feat issues refs #7636" />
<option name="LAST_COMMIT_MESSAGE" value="feat issues refs #7636" />
<MESSAGE value="feat itemToBarCode refs #7614" />
<option name="LAST_COMMIT_MESSAGE" value="feat itemToBarCode refs #7614" />
</component>
<component name="XDebuggerManager">
<pin-to-top-manager>

View File

@ -27,6 +27,7 @@ class MobileApplication : Application(), InteceptorListener {
private var mainActivityListener: MainActivityListener? = null
private var loginListener: LoginListener? = null
private var signListener: SignListener? = null
private var isActivityLoginRunning = false
fun setMainListener(listener: MainActivityListener) {
mainActivityListener = listener
@ -40,7 +41,7 @@ class MobileApplication : Application(), InteceptorListener {
signListener = listener
}
// lateinit var silex: VerdnaturaService
// lateinit var silex: VerdnaturaService
lateinit var salix: SalixService
var userId: Int? = null
var userName: String? = null
@ -77,6 +78,34 @@ class MobileApplication : Application(), InteceptorListener {
val restClient = RestClient(this, this)
salix = restClient.salixClient
/* registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
}
override fun onActivityStarted(activity: Activity) {
}
override fun onActivityResumed(activity: Activity) {
isActivityLoginRunning = activity.javaClass == LoginActivity::class.java
}
override fun onActivityPaused(activity: Activity) {
if (activity.javaClass == LoginActivity::class.java) {
isActivityLoginRunning = false
}
}
override fun onActivityStopped(activity: Activity) {
}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
}
override fun onActivityDestroyed(activity: Activity) {
isActivityLoginRunning = false
}
})*/
}
fun playSoundIsOK(bool: Boolean) {
@ -120,7 +149,7 @@ class MobileApplication : Application(), InteceptorListener {
val settings = this.resources.configuration
return settings.locales.get(0).language
}
fun clearApplicationData() {
fun clearApplicationData() {
try {
val cacheDir = this.cacheDir
val appDir = File(cacheDir.parent ?: return)

View File

@ -19,16 +19,17 @@ import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.DeviceLogSalix
import es.verdnatura.presentation.view.feature.login.model.AccessConfigSalix
import es.verdnatura.presentation.view.feature.login.model.AccessConfigSalixList
import es.verdnatura.presentation.view.feature.login.model.DataUserSalix
import es.verdnatura.presentation.view.feature.login.model.LoginApp
import es.verdnatura.presentation.view.feature.login.model.LoginAppData
import es.verdnatura.presentation.view.feature.login.model.LoginDevice
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
import es.verdnatura.presentation.view.feature.login.model.OperatorAdd
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
import es.verdnatura.presentation.view.feature.login.model.RenewToken
import es.verdnatura.presentation.view.feature.login.model.VersionApp
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalix
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalixList
import es.verdnatura.presentation.view.feature.paletizador.model.ItemsExpeditionDynamics
import kotlinx.coroutines.runBlocking
import retrofit2.Response
@ -66,12 +67,12 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
val workerOperator: LiveData<OperatorSalix>
get() = _workerOperator
private val _accessConfigSalixList by lazy { MutableLiveData<accessConfigSalixList>() }
private val _accessConfigSalixList by lazy { MutableLiveData<AccessConfigSalixList>() }
private val _renewTokenResponse by lazy { MutableLiveData<RenewToken>() }
val renewTokenResponse: LiveData<RenewToken>
get() = _renewTokenResponse
val loadAccessConfigSalixList: LiveData<Event<accessConfigSalixList>> =
val loadAccessConfigSalixList: LiveData<Event<AccessConfigSalixList>> =
_accessConfigSalixList.map { Event(it) }
fun loginSalix(user: String, password: String) {
@ -275,7 +276,7 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
fun operator_add(workerFk: Int? = null) {
//Tarea 6276
salix.operatorAdd(hashMapOf("workerFk" to workerFk))
salix.operatorAdd(OperatorAdd(workerFk!!,false))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
@ -335,36 +336,36 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
) {
salix.getAccessTokenConfigs()
.enqueue(object : SalixCallback<List<accessConfigSalix>>(context) {
.enqueue(object : SalixCallback<List<AccessConfigSalix>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<accessConfigSalix> = ArrayList()
val listError: ArrayList<AccessConfigSalix> = ArrayList()
listError.add(
accessConfigSalix(
AccessConfigSalix(
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), t.message!!
)
)
)
_accessConfigSalixList.value = accessConfigSalixList(listError)
_accessConfigSalixList.value = AccessConfigSalixList(listError)
}
override fun onSuccess(response: Response<List<accessConfigSalix>>) {
override fun onSuccess(response: Response<List<AccessConfigSalix>>) {
if (response.body() != null) {
_accessConfigSalixList.value = response.body()?.let {
accessConfigSalixList(it)
AccessConfigSalixList(it)
}
} else {
val listError: ArrayList<accessConfigSalix> = ArrayList()
val listError: ArrayList<AccessConfigSalix> = ArrayList()
listError.add(
accessConfigSalix(
AccessConfigSalix(
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), response.message()
)
)
)
_accessConfigSalixList.value = accessConfigSalixList(listError)
_accessConfigSalixList.value = AccessConfigSalixList(listError)
}

View File

@ -90,7 +90,7 @@ data class Sector(
data class Printer(val id: Int, val name: String)
data class Train(val id: Int, val name: String)
class accessConfigSalix(
class AccessConfigSalix(
val id: Number = 0,
val renewPeriod: Long = 0,
val renewInterval: Long = 0,
@ -102,8 +102,8 @@ class OperatorList(
var list: List<OperatorSalix> = listOf()
)
class accessConfigSalixList(
var list: List<accessConfigSalix> = listOf()
class AccessConfigSalixList(
var list: List<AccessConfigSalix> = listOf()
)
class Operator(
@ -111,6 +111,10 @@ class Operator(
val labelerFk: Int?
)
data class OperatorAdd(
var workerFk:Int,
var isOnReservationMode:Boolean
)
class VersionApp(
val appname: String = "",

View File

@ -437,7 +437,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
)
)
if (userId == 19591) {
if (userId == 19591 || userId == 9) {
_pasillerositem.add(
PasillerosItemVO(
6,
@ -539,7 +539,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
fun inititializeDefaultPrevia() {
if (isOnReservationMode || userId == 19591){
if (isOnReservationMode){
// if (userId == 19591 || userId == 18404 || userId == 9) {
_pasillerositem.add(
PasillerosItemVO(