feat: refs #7572 refactorUploadFront
This commit is contained in:
parent
6f155fbe36
commit
f96d809afe
|
@ -18,6 +18,7 @@ import com.esafirm.imagepicker.features.registerImagePicker
|
||||||
import com.esafirm.imagepicker.model.Image
|
import com.esafirm.imagepicker.model.Image
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentPackagingObsBinding
|
import es.verdnatura.databinding.FragmentPackagingObsBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.COMPANYFK
|
||||||
import es.verdnatura.domain.ConstAndValues.ENTRYID
|
import es.verdnatura.domain.ConstAndValues.ENTRYID
|
||||||
import es.verdnatura.domain.ConstAndValues.ENTRYNUMBERIMAGES
|
import es.verdnatura.domain.ConstAndValues.ENTRYNUMBERIMAGES
|
||||||
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONORIGINAL
|
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONORIGINAL
|
||||||
|
@ -60,6 +61,7 @@ class ObservFragment(
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
private var layoutManager: LinearLayoutManager? = null
|
private var layoutManager: LinearLayoutManager? = null
|
||||||
private lateinit var customDialogList: CustomDialogList
|
private lateinit var customDialogList: CustomDialogList
|
||||||
|
private var dmsType: Int? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = ObservFragment(entryPoint)
|
fun newInstance(entryPoint: String) = ObservFragment(entryPoint)
|
||||||
|
@ -79,6 +81,7 @@ class ObservFragment(
|
||||||
setEvents()
|
setEvents()
|
||||||
setObservations()
|
setObservations()
|
||||||
loadImages()
|
loadImages()
|
||||||
|
viewModel.getTypeDMS()
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,8 +247,8 @@ class ObservFragment(
|
||||||
warehouseId = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
warehouseId = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
WAREHOUSEFK
|
WAREHOUSEFK
|
||||||
),
|
),
|
||||||
companyId = 442,
|
companyId = mobileApplication.dataStoreApp.readDataStoreKey<Int>(COMPANYFK),
|
||||||
dmsTypeId = 27,
|
dmsTypeId = dmsType!!,
|
||||||
reference = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
reference = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
ENTRYID
|
ENTRYID
|
||||||
).toString(),
|
).toString(),
|
||||||
|
@ -266,6 +269,18 @@ class ObservFragment(
|
||||||
openSummary()
|
openSummary()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dmsTypeId.observe(viewLifecycleOwner) {
|
||||||
|
if (it.id == 0) {
|
||||||
|
ma.messageWithSound(
|
||||||
|
message = getString(R.string.errorDMS),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
dmsType = it.id
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,13 +293,14 @@ class ObservFragment(
|
||||||
val drawable = getDrawableFromImageUri(requireContext(), (item as Image).uri)
|
val drawable = getDrawableFromImageUri(requireContext(), (item as Image).uri)
|
||||||
val bitmap = drawable!!.toBitmap()
|
val bitmap = drawable!!.toBitmap()
|
||||||
|
|
||||||
|
|
||||||
viewModel.entryUploadPhotoSalix(
|
viewModel.entryUploadPhotoSalix(
|
||||||
idEntry = mobileApplication.dataStoreApp.readDataStoreKey<Int>(ENTRYID),
|
idEntry = mobileApplication.dataStoreApp.readDataStoreKey<Int>(ENTRYID),
|
||||||
warehouseId = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
warehouseId = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
WAREHOUSEFK
|
WAREHOUSEFK
|
||||||
),
|
),
|
||||||
companyId = 442,
|
companyId = mobileApplication.dataStoreApp.readDataStoreKey<Int>(COMPANYFK),
|
||||||
dmsTypeId = 27,
|
dmsTypeId = dmsType!!,
|
||||||
reference = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
reference = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
ENTRYID
|
ENTRYID
|
||||||
).toString(),
|
).toString(),
|
||||||
|
@ -294,7 +310,6 @@ class ObservFragment(
|
||||||
hasFile = false,
|
hasFile = false,
|
||||||
urlImage = saveBitmapAsTempFile(requireContext(), bitmap)
|
urlImage = saveBitmapAsTempFile(requireContext(), bitmap)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, object : OnImageTrashClickListener {
|
}, object : OnImageTrashClickListener {
|
||||||
|
|
|
@ -49,8 +49,15 @@ class PackagingCountFragment(
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
viewModel.getItemsPackaging(
|
viewModel.getItemsPackaging(
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SUPPLIERID),
|
mobileApplication.dataStoreApp.readDataStoreKey<Int>(SUPPLIERID),
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(ENTRYID)
|
mobileApplication.dataStoreApp.readDataStoreKey<Int>(ENTRYID)
|
||||||
|
)
|
||||||
|
println(
|
||||||
|
"EntryId ${mobileApplication.dataStoreApp.readDataStoreKey<Int>(ENTRYID)} \n SupplierId ${
|
||||||
|
mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
|
SUPPLIERID
|
||||||
|
)
|
||||||
|
}"
|
||||||
)
|
)
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
|
@ -106,8 +113,8 @@ class PackagingCountFragment(
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
|
|
||||||
viewModel.getItemsPackaging(
|
viewModel.getItemsPackaging(
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SUPPLIERID),
|
mobileApplication.dataStoreApp.readDataStoreKey<Int>(SUPPLIERID),
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(ENTRYID)
|
mobileApplication.dataStoreApp.readDataStoreKey<Int>(ENTRYID)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@ class PackagingSummaryFragment(
|
||||||
|
|
||||||
|
|
||||||
viewModel.getItemsPackaging(
|
viewModel.getItemsPackaging(
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SUPPLIERID),
|
mobileApplication.dataStoreApp.readDataStoreKey<Int>(SUPPLIERID),
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(ENTRYID)
|
mobileApplication.dataStoreApp.readDataStoreKey<Int>(ENTRYID)
|
||||||
)
|
)
|
||||||
|
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
|
|
|
@ -921,6 +921,8 @@
|
||||||
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="reserve">Reserva</string>
|
<string name="reserve">Reserva</string>
|
||||||
|
<string name="shelvingItems">No hay artículos en el carro para cambiar su matrícula</string>
|
||||||
|
<string name="errorDMS">No se puede obterner el tipo DMS. Póngase en contacto con dpto Informática</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -921,5 +921,7 @@
|
||||||
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="reserve">Reserva</string>
|
<string name="reserve">Reserva</string>
|
||||||
|
<string name="shelvingItems">No hay artículos en el carro para cambiar su matrícula</string>
|
||||||
|
<string name="errorDMS">No se puede obterner el tipo DMS. Póngase en contacto con dpto Informática</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -921,5 +921,7 @@
|
||||||
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="reserve">Reserva</string>
|
<string name="reserve">Reserva</string>
|
||||||
|
<string name="shelvingItems">No hay artículos en el carro para cambiar su matrícula</string>
|
||||||
|
<string name="errorDMS">No se puede obterner el tipo DMS. Póngase en contacto con dpto Informática</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -925,5 +925,7 @@
|
||||||
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
|
||||||
<string name="reserve">Reserva</string>
|
<string name="reserve">Reserva</string>
|
||||||
|
<string name="shelvingItems">No hay artículos en el carro para cambiar su matrícula</string>
|
||||||
|
<string name="errorDMS">No se puede obterner el tipo DMS. Póngase en contacto con dpto Informática</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue