refs #4815 serial
This commit is contained in:
parent
9947d32036
commit
e89d58afee
|
@ -117,7 +117,7 @@ class LoginFragment(var imageUri: Uri?) :
|
|||
directory.mkdirs()
|
||||
}
|
||||
try {
|
||||
val filename = "serie.txt"
|
||||
val filename = "serial.txt"
|
||||
val file = File(directory, filename)
|
||||
//saveData("SERIALNUMBER", file.readText())
|
||||
mobileApplication.serialNumber = file.readText()
|
||||
|
|
|
@ -179,18 +179,6 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun worker_getId() {
|
||||
silex.worker_getId().enqueue(object : SilexCallback<Int>(context) {
|
||||
override fun onSuccess(response: Response<Int>) {
|
||||
val prefs = app.getPrefsEditor()
|
||||
response.body()?.let { prefs.putInt("userFk", it) }
|
||||
prefs.commit()
|
||||
app.userId = response.body()?.let { it }
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun getCurrentUserData() {
|
||||
salix.getCurrentUserData().enqueue(object : SilexCallback<DataUserSalix>(context) {
|
||||
override fun onSuccess(response: Response<DataUserSalix>) {
|
||||
|
@ -215,7 +203,20 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
|
||||
}
|
||||
fun deviceLog_addSalix(
|
||||
app: String, versionApp: String, android_id: String,userFk:Int, serialnumber:String
|
||||
) {
|
||||
|
||||
//Tarea 4815
|
||||
salix.deviceLogInsert(DeviceLogSalix(android_id = android_id,userFk=userFk,nameApp= app,versionApp= versionApp,serialNumber = serialnumber))
|
||||
.enqueue(object : SilexCallback<Void>(context) {
|
||||
|
||||
override fun onSuccess(response: Response<Void>) {
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
fun checkVersion(nameApp: String) {
|
||||
silex.getVersion(nameApp)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.main.activity
|
||||
|
||||
|
||||
//Tarea #4815
|
||||
|
||||
import NetworkUtils
|
||||
import PhotosFragment
|
||||
import android.content.SharedPreferences
|
||||
|
@ -36,6 +34,7 @@ import es.verdnatura.presentation.view.feature.category.ChangeCategoryFragment
|
|||
import es.verdnatura.presentation.view.feature.claim.fragment.ClaimFragment
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPicker
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPickerNew
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPreChecker
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionShowTicketFragment
|
||||
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorFragment
|
||||
|
@ -77,7 +76,9 @@ import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationC
|
|||
import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationFragment
|
||||
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragmentNew
|
||||
import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketFragment
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.shelvingparking.fragment.ShelvingParkingFragment
|
||||
import es.verdnatura.presentation.view.feature.ticket.fragment.TicketAdvanceFragment
|
||||
|
@ -99,7 +100,7 @@ import java.util.concurrent.TimeUnit
|
|||
|
||||
class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickListener,
|
||||
OnTruckClickListener, OnPalletClickListener, OnComprobarPalletViewClickListener,
|
||||
OnCollectionSelectedListener {
|
||||
OnCollectionSelectedListener, OnCollectionTicketSelectedListener {
|
||||
|
||||
private var lastBottomMenuItemSelected: ItemMenuVO? = null
|
||||
private lateinit var customDialog: CustomDialogMainActivity
|
||||
|
@ -679,6 +680,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(ControlVehiculoFragment.newInstance(""))
|
||||
}
|
||||
|
||||
"Sacador Test" -> {
|
||||
addFragmentOnTop(SacadorFragmentNew.newInstance("PREPARED"))
|
||||
|
||||
}
|
||||
|
||||
getString(R.string.titleWebViewer) -> {
|
||||
// el entryPoint de WebFragment se le pasa un JSON del tipo {"entryPoint":"itemScanned","web":"www.google.com}
|
||||
addFragmentOnTop(WebFragment.newInstance(entryPoint))
|
||||
|
@ -1018,6 +1024,12 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
}
|
||||
|
||||
override fun onCollectionSelected(collection: CollectionTicket, type: String) {
|
||||
|
||||
addFragmentOnTop(CollectionFragmentPickerNew.newInstance(collection, type))
|
||||
|
||||
}
|
||||
|
||||
override fun onCollectionSelected(collection: CollectionVO, type: String) {
|
||||
|
||||
when (type) {
|
||||
|
@ -1162,25 +1174,24 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
/*Tarea 4815*/
|
||||
/* override fun onUserInteraction() {
|
||||
override fun onUserInteraction() {
|
||||
super.onUserInteraction()
|
||||
|
||||
if ((System.currentTimeMillis() / 1000 / 3600) - myTimeUserInteraction > 4) {
|
||||
myTimeUserInteraction = System.currentTimeMillis() / 1000
|
||||
|
||||
myTimeUserInteraction = System.currentTimeMillis() / 1000 /3600
|
||||
val loginViewModel = LoginViewModel(application as MobileApplication)
|
||||
loginViewModel.deviceLog_add(
|
||||
getString(R.string.logAppName),
|
||||
(application as MobileApplication).versionName,
|
||||
if ((application as MobileApplication).serialNumber == "") {
|
||||
(application as MobileApplication).androidId
|
||||
} else {
|
||||
(application as MobileApplication).serialNumber
|
||||
}
|
||||
)
|
||||
loginViewModel.deviceLog_addSalix(
|
||||
app = getString(R.string.logAppName),
|
||||
versionApp = (application as MobileApplication).versionName,
|
||||
android_id = (application as MobileApplication).androidId,
|
||||
serialnumber = (application as MobileApplication).serialNumber,
|
||||
userFk = (application as MobileApplication).userId!!
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
//Tarea 5613
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Hola Mundo">
|
||||
</TextView>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue