feat: refs #6868 handleUser
This commit is contained in:
parent
0c1f054b7f
commit
2ee835bbb9
|
@ -4,75 +4,71 @@
|
|||
<uses-feature
|
||||
android:name="android.hardware.telephony"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<uses-permission android:name="android.permission.PREVENT_POWER_KEY" />
|
||||
<uses-permission android:name="android.permission.LAUNCH_APPS" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<!--
|
||||
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="com.zebra.provider.READ"/>-->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<!--<queries>
|
||||
<provider android:authorities="oem_info" />
|
||||
</queries>-->
|
||||
<application
|
||||
android:name=".MobileApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:name=".presentation.view.feature.articulo.fragment.ImageViewActivity"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".presentation.view.feature.restaurant.RestaurantActivity"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".presentation.view.feature.main.activity.MainActivity"
|
||||
android:configChanges="orientation"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".presentation.view.feature.delivery.activity.SignedActivity"
|
||||
android:configChanges="orientation"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".presentation.view.feature.login.activity.LoginActivity"
|
||||
android:configChanges="orientation"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<application
|
||||
android:name=".MobileApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity android:name=".presentation.view.feature.articulo.fragment.ImageViewActivity" android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".presentation.view.feature.main.activity.MainActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="true"/>
|
||||
<activity
|
||||
android:name=".presentation.view.feature.delivery.activity.SignedActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="true"/>
|
||||
<activity
|
||||
android:name=".presentation.view.feature.login.activity.LoginActivity"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -20,6 +20,7 @@ import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
|
|||
import es.verdnatura.domain.ConstAndValues.ENTRYID
|
||||
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONORIGINAL
|
||||
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONS
|
||||
import es.verdnatura.domain.ConstAndValues.ITEMPACKING
|
||||
import es.verdnatura.domain.ConstAndValues.NUMBEROFWAGONS
|
||||
import es.verdnatura.domain.ConstAndValues.PRINTERFK
|
||||
import es.verdnatura.domain.ConstAndValues.PRINTERFKDEFAULT
|
||||
|
@ -28,6 +29,7 @@ import es.verdnatura.domain.ConstAndValues.RESERVATIONMODE
|
|||
import es.verdnatura.domain.ConstAndValues.SECTORDESCRIP
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFK
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORISONRESERVATIONMODE
|
||||
import es.verdnatura.domain.ConstAndValues.SUPPLIERID
|
||||
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
|
||||
import es.verdnatura.domain.ConstAndValues.TRAINNAME
|
||||
|
@ -36,6 +38,7 @@ import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
|||
import es.verdnatura.domain.ConstAndValues.WORKFORMSELECTED
|
||||
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
|
||||
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
||||
import es.verdnatura.presentation.view.feature.login.model.WorkerData
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
@ -98,10 +101,90 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
|||
editDataStoreKey(
|
||||
NUMBEROFWAGONS, operator.numberOfWagons
|
||||
)
|
||||
|
||||
editDataStoreKey(
|
||||
RESERVATIONMODE, operator.isOnReservationMode
|
||||
ITEMPACKING,
|
||||
if (operator.itemPackingTypeFk != null) operator.itemPackingTypeFk.toString() else ""
|
||||
)
|
||||
|
||||
|
||||
editDataStoreKey(
|
||||
RESERVATIONMODE, operator.isOnReservationMode
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
//Tarea 6868
|
||||
suspend fun saveWorkerData(operator: WorkerData) {
|
||||
|
||||
editDataStoreKey(
|
||||
SECTORFK, if (operator.sector != null) {
|
||||
operator.sector.id
|
||||
} else {
|
||||
SECTORFKDEFAULT
|
||||
}
|
||||
)
|
||||
|
||||
if (operator.sector?.isOnReservationMode != null) {
|
||||
editDataStoreKey(
|
||||
SECTORISONRESERVATIONMODE,
|
||||
operator.sector.isOnReservationMode
|
||||
)
|
||||
} else {
|
||||
mobileApplication.dataStore.edit { preferences ->
|
||||
preferences.remove(stringPreferencesKey(SECTORISONRESERVATIONMODE))
|
||||
}
|
||||
}
|
||||
editDataStoreKey(
|
||||
WAREHOUSEFK, if (operator.sector != null) {
|
||||
operator.sector.warehouseFk
|
||||
} else {
|
||||
WAREHOUSEFKDEFAULT
|
||||
}
|
||||
)
|
||||
editDataStoreKey(
|
||||
SECTORDESCRIP, if (operator.sector != null) {
|
||||
operator.sector.description
|
||||
} else {
|
||||
mobileApplication.getString(R.string.Sinsector)
|
||||
}
|
||||
)
|
||||
|
||||
editDataStoreKey(
|
||||
PRINTERFK, if (operator.printer != null) {
|
||||
operator.printer.id
|
||||
} else {
|
||||
PRINTERFKDEFAULT
|
||||
}
|
||||
)
|
||||
editDataStoreKey(
|
||||
PRINTERNAME, if (operator.printer != null) {
|
||||
operator.printer.name
|
||||
} else {
|
||||
mobileApplication.getString(R.string.printerWithout)
|
||||
}
|
||||
)
|
||||
|
||||
editDataStoreKey(
|
||||
TRAINNAME, if (operator.train != null) {
|
||||
operator.train.name
|
||||
} else {
|
||||
""
|
||||
}
|
||||
)
|
||||
editDataStoreKey(
|
||||
NUMBEROFWAGONS, operator.numberOfWagons
|
||||
)
|
||||
editDataStoreKey(
|
||||
RESERVATIONMODE, operator.isOnReservationMode
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
suspend fun isPreferenceExists(key: String): Boolean {
|
||||
val preferencesKey = booleanPreferencesKey(key)
|
||||
val preferences = mobileApplication.dataStore.data.first()
|
||||
return preferences.contains(preferencesKey)
|
||||
}
|
||||
|
||||
inline fun <reified T> readDataStoreKey(key: String): T {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package es.verdnatura.presentation.view.feature.restaurant.model
|
||||
|
||||
data class UserMenu(
|
||||
val user: Int,
|
||||
val menu_id: Int,
|
||||
val menu: String,
|
||||
val name: String
|
||||
)
|
|
@ -9,9 +9,9 @@
|
|||
<string name="Pallet">Pallet</string>
|
||||
<string name="Ruta">Ruta</string>
|
||||
<string name="Cajas">Cajas</string>
|
||||
<string name="Nivel">Nivel:</string>
|
||||
<string name="Nivel">Niv:</string>
|
||||
<string name="de">de</string>
|
||||
<string name="Ticket">Ticket</string>
|
||||
<string name="Ticket">T:</string>
|
||||
<string name="Concepto">Concepto</string>
|
||||
<string name="SinServir">SinServir</string>
|
||||
<string name="Aparcado">Aparcado</string>
|
||||
|
@ -848,7 +848,7 @@
|
|||
<string name="errorRepeatedShelving">Carro ya introducido</string>
|
||||
<string name="errorGetData">errorGetData</string>
|
||||
<string name="errorSector">No tienes sector seleccionado. Ve a pantalla ajustes y selecciona uno</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada. Pregunta encargado por si se ha preparado dos veces.</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada.</string>
|
||||
<string name="errorUserId">No se podido obtener tu id. Vuelve a intentarlo</string>
|
||||
<string name="errorScanItem">Error al escanea el artículo. Inténtalo de nuevo</string>
|
||||
<string name="errorSignActivity">Vuelve a pulsar para intentar firmar</string>
|
||||
|
@ -868,6 +868,20 @@
|
|||
<string name="errorInputBuyFk">Revisa que el elemento escaneado sea un código de compra (buyFk)</string>
|
||||
<string name="expeditionPrepared">Expedición ya preparada</string>
|
||||
<string name="boxDuplicated">Caja duplicada</string>
|
||||
<string name="reviewNew">Revisar nuevo</string>
|
||||
<string name="preControlNew">Pre control nuevo</string>
|
||||
<string name="deleteSale">Borrar la línea</string>
|
||||
<string name="deleteSaleDescrip">Asegúrate de tener desmarcada la línea y devolver el producto a su carro</string>
|
||||
<string name="titleRestaurant">Comedor</string>
|
||||
<string name="resturantDescrip">Genera Qr para el comedor</string>
|
||||
<string name="lunch">Almuerzo</string>
|
||||
<string name="halfLunch">Medio Almuerzo</string>
|
||||
<string name="menu">Menú</string>
|
||||
<string name="halfMenu">Medio menú</string>
|
||||
<string name="selectMenu">Elige opción comedor</string>
|
||||
<string name="deleteExpedition">Borrar expedición</string>
|
||||
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
||||
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
<string name="Pallet">Pallet</string>
|
||||
<string name="Ruta">Route</string>
|
||||
<string name="Cajas">Cajas</string>
|
||||
<string name="Nivel">Nivel:</string>
|
||||
<string name="Nivel">Niv:</string>
|
||||
<string name="de">de</string>
|
||||
<string name="Ticket">Ticket</string>
|
||||
<string name="Ticket">T:</string>
|
||||
<string name="Concepto">Concepto</string>
|
||||
<string name="SinServir">SinServir</string>
|
||||
<string name="Aparcado">Aparcado</string>
|
||||
|
@ -848,7 +848,7 @@
|
|||
<string name="shelvingsLocate">Carros a ubicar</string>
|
||||
<string name="errorGetData">Fallo al intentar obtener datos. Avise a Informática</string>
|
||||
<string name="errorSector">No tienes sector seleccionado. Ve a pantalla ajustes y selecciona uno</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada. Pregunta encargado por si se ha preparado dos veces.</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada.</string>
|
||||
<string name="errorUserId">No se podido obtener tu id. Vuelve a intentarlo</string>
|
||||
<string name="errorScanItem">Error al escanea el artículo. Inténtalo de nuevo</string>
|
||||
<string name="errorSignActivity">Vuelve a pulsar para intentar firmar</string>
|
||||
|
@ -868,5 +868,19 @@
|
|||
<string name="errorInputBuyFk">Revisa que el elemento escaneado sea un código de compra (buyFk)</string>
|
||||
<string name="expeditionPrepared">Expedición ya preparada</string>
|
||||
<string name="boxDuplicated">Caja duplicada</string>
|
||||
<string name="reviewNew">Revisar nuevo</string>
|
||||
<string name="preControlNew">Pre control nuevo</string>
|
||||
<string name="deleteSale">Borrar la línea</string>
|
||||
<string name="deleteSaleDescrip">Asegúrate de tener desmarcada la línea y devolver el producto a su carro</string>
|
||||
<string name="titleRestaurant">Comedor</string>
|
||||
<string name="resturantDescrip">Genera Qr para el comedor</string>
|
||||
<string name="lunch">Almuerzo</string>
|
||||
<string name="halfLunch">Medio Almuerzo</string>
|
||||
<string name="menu">Menú</string>
|
||||
<string name="halfMenu">Medio Menú</string>
|
||||
<string name="selectMenu">Elige opción comedor</string>
|
||||
<string name="deleteExpedition">Borrar expedición</string>
|
||||
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
||||
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<string name="Cajas">Cajas</string>
|
||||
<string name="Nivel">Nivel:</string>
|
||||
<string name="de">de</string>
|
||||
<string name="Ticket">Ticket</string>
|
||||
<string name="Ticket">T:</string>
|
||||
<string name="Concepto">Concepto</string>
|
||||
<string name="SinServir">SinServir</string>
|
||||
<string name="Aparcado">Aparcado</string>
|
||||
|
@ -848,7 +848,7 @@
|
|||
<string name="shelvingsLocate">Carros a ubicar</string>
|
||||
<string name="errorGetData">Fallo al intentar obtener datos. Avise a Informática</string>
|
||||
<string name="errorSector">No tienes sector seleccionado. Ve a pantalla ajustes y selecciona uno</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada. Pregunta encargado por si se ha preparado dos veces.</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada.</string>
|
||||
<string name="errorUserId">No se podido obtener tu id. Vuelve a intentarlo</string>
|
||||
<string name="errorScanItem">Error al escanea el artículo. Inténtalo de nuevo</string>
|
||||
<string name="errorSignActivity">Vuelve a pulsar para intentar firmar</string>
|
||||
|
@ -868,6 +868,20 @@
|
|||
<string name="errorInputBuyFk">Revisa que el elemento escaneado sea un código de compra (buyFk)</string>
|
||||
<string name="expeditionPrepared">Expedición ya preparada</string>
|
||||
<string name="boxDuplicated">Caja duplicada</string>
|
||||
<string name="reviewNew">Revisar nuevo</string>
|
||||
<string name="preControlNew">Pre control nuevo</string>
|
||||
<string name="deleteSale">Borrar la línea</string>
|
||||
<string name="deleteSaleDescrip">Asegúrate de tener desmarcada la línea y devolver el producto a su carro</string>
|
||||
<string name="titleRestaurant">Comedor</string>
|
||||
<string name="resturantDescrip">Genera Qr para el comedor</string>
|
||||
<string name="lunch">Almuerzo</string>
|
||||
<string name="halfLunch">Medio Almuerzo</string>
|
||||
<string name="menu">Menú</string>
|
||||
<string name="halfMenu">Medio Menú</string>
|
||||
<string name="selectMenu">Elige opción comedor</string>
|
||||
<string name="deleteExpedition">Borrar expedición</string>
|
||||
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
||||
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
<string name="cmr">CMR</string>
|
||||
<string name="Ruta">Route</string>
|
||||
<string name="Cajas">Boxes</string>
|
||||
<string name="Nivel">Level:</string>
|
||||
<string name="Nivel">Lev:</string>
|
||||
<string name="de">of</string>
|
||||
<string name="Ticket">Ticket</string>
|
||||
<string name="Ticket">T:</string>
|
||||
<string name="tickets">Tickets:</string>
|
||||
<string name="showTickets">Tickets</string>
|
||||
<string name="Concepto">Concept</string>
|
||||
|
@ -850,7 +850,7 @@
|
|||
<string name="shelvingsLocate">Carros a ubicar</string>
|
||||
<string name="errorGetData">Fallo al intentar obtener datos. Avise a Informática</string>
|
||||
<string name="errorSector">No tienes sector seleccionado. Ve a pantalla ajustes y selecciona uno</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada. Pregunta encargado por si se ha preparado dos veces.</string>
|
||||
<string name="errorBoxPicking">La expedición ya ha sido revisada.</string>
|
||||
<string name="errorUserId">No se podido obtener tu id. Vuelve a intentarlo</string>
|
||||
<string name="errorScanItem">Error al escanea el artículo. Inténtalo de nuevo</string>
|
||||
<string name="errorSignActivity">Vuelve a pulsar para intentar firmar</string>
|
||||
|
@ -871,5 +871,19 @@
|
|||
<string name="errorInputBuyFk">Revisa que el elemento escaneado sea un código de compra (buyFk)</string>
|
||||
<string name="expeditionPrepared">Expedición ya preparada</string>
|
||||
<string name="boxDuplicated">Caja duplicada</string>
|
||||
<string name="reviewNew">Revisar nuevo</string>
|
||||
<string name="preControlNew">Pre control nuevo</string>
|
||||
<string name="deleteSale">Borrar la línea</string>
|
||||
<string name="deleteSaleDescrip">Asegúrate de tener desmarcada la línea y devolver el producto a su carro</string>
|
||||
<string name="titleRestaurant">Comedor</string>
|
||||
<string name="resturantDescrip">Genera Qr para el comedor</string>
|
||||
<string name="lunch">Almuerzo</string>
|
||||
<string name="halfLunch">Medio Almuerzo</string>
|
||||
<string name="menu">Menú</string>
|
||||
<string name="halfMenu">Medio menú</string>
|
||||
<string name="selectMenu">Elige opción comedor</string>
|
||||
<string name="deleteExpedition">Borrar expedición</string>
|
||||
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
||||
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue