version 23.26Beta_5339

This commit is contained in:
Sergio De la torre 2023-06-26 10:40:20 +02:00
parent 607f946e0a
commit 6aa041a872
7 changed files with 50 additions and 35 deletions

6
.idea/kotlinc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.8.0" />
</component>
</project>

View File

@ -82,14 +82,14 @@
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #4678">
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="version 23.24.1Beta">
<change beforePath="$PROJECT_DIR$/.idea/deploymentTargetDropDown.xml" beforeDir="false" />
<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/domain/ApiSalixUtils.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.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" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -100,7 +100,7 @@
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[21114523025303]" />
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[G65TY9DQN7X4BIE6]" />
<component name="ExportToHTMLSettings">
<option name="OPEN_IN_BROWSER" value="true" />
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
@ -197,7 +197,7 @@
</option>
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="4021-gestion_embalajes" />
<entry key="$PROJECT_DIR$" value="dev-5613_no_guardar_user" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />

View File

@ -2,6 +2,7 @@ package es.verdnatura.domain
import android.content.Context
import androidx.preference.PreferenceManager
import com.google.gson.GsonBuilder
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
@ -35,7 +36,7 @@ class ApiSalixUtils {
.client(salixClient)
.baseUrl(getBaseUrlLocal(context = context))
.addConverterFactory(
GsonConverterFactory.create()
GsonConverterFactory.create(GsonBuilder().serializeNulls().create() )
).build()
//d("VERDNATURA::","El server Salix es "+getBaseUrlLocal(context = context))

View File

@ -3,15 +3,14 @@ package es.verdnatura.domain
import es.verdnatura.presentation.common.itemBarCodeSalix
import es.verdnatura.presentation.common.itemPackingTypeSalix
import es.verdnatura.presentation.common.packingSiteSalix
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
import es.verdnatura.presentation.view.feature.login.model.Operator
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
import es.verdnatura.presentation.view.feature.login.model.OperatorUpdate
import es.verdnatura.presentation.view.feature.login.model.SalixGrupo
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
@ -195,10 +194,10 @@ interface SalixService {
Call<Any>
@PUT("Operators/udpate")
@PATCH("Operators/{id}")
fun update_operator(
@Body params: Any,
@Query("where[workerFk]") workerFk:Int
@Path("id") id: Number,
@Body params: Any
):
Call<Void>

View File

@ -416,12 +416,7 @@ class AjustesFragment :
editor.apply()
viewModel.ajustesitem.get(2).selected = it.name
/* viewModel.worker_updatePrinterSalix(
it.id!!, getDataInt(USERFK)
)*/
viewModel.worker_updatePrinter(
it.id!!
)
viewModel.worker_updateOperatorSalix("printer",getDataInt(USERFK),getDataInt(SECTORFK),it.id!!)
ajustesAdapter!!.notifyDataSetChanged()
ajustesAdapter
@ -488,9 +483,9 @@ class AjustesFragment :
viewModel.ajustesitem.get(0).sectorFk = it.id
viewModel.ajustesitem.get(0).warehouse = it.warehouseFk
viewModel.ajustesitem.get(0).selected = it.description
viewModel.worker_updateSector(
it.id
)
viewModel.worker_updateOperatorSalix("sector",getDataInt(USERFK),it.id,null)
ajustesAdapter!!.notifyDataSetChanged()
return@forEach

View File

@ -15,11 +15,16 @@ import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemNumber
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.*
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
import es.verdnatura.presentation.view.feature.ajustes.model.PrintersList
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.SectorListVO
import es.verdnatura.presentation.view.feature.ajustes.model.Train
import es.verdnatura.presentation.view.feature.ajustes.model.TrainList
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingTypeList
import es.verdnatura.presentation.view.feature.login.model.OperatorPrinter
import es.verdnatura.presentation.view.feature.login.model.OperatorUpdate
import es.verdnatura.presentation.view.feature.login.model.Operator
import retrofit2.Response
@ -478,17 +483,31 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun worker_updatePrinterSalix(printerFk: Int, workerFk : Int) {
fun worker_updateOperatorSalix(entity: String, workerFk: Int, sectorFk: Int?, labelerFk: Int?) {
ProgressLoading(VISIBLE)
salix.update_operator(OperatorPrinter(printerFk), workerFk)
salix.update_operator(id = workerFk, Operator(sectorFk, labelerFk))
.enqueue(object : SilexCallback<Void>(context) {
override fun onError(t: Throwable) {
ProgressLoading(GONE)
_actionUpdate.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
throw t
}
override fun onSuccess(response: Response<Void>) {
ProgressLoading(GONE)
if (entity == "sector") {
_actionUpdate.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
)
}
super.onSuccess(response)
}

View File

@ -21,6 +21,7 @@ class SalixGrupo(
val message: String = ""
)
class OperatorSalix(
val workerFk: Int = 0,
val sectorFk: Int = 0,
@ -37,16 +38,10 @@ class OperatorList(
var list: List<OperatorSalix> = listOf()
)
class OperatorSector(
val sectorFk: Int
)
class Operator(
val sectorFk: Int?,
val labelerFk: Int?
class OperatorPrinter(
val labelerFk: Int
)
class OperatorUpdate(
val update: String
)
class versionApp(