|
@@ -15,6 +15,7 @@ import com.xhly.corelib.utils.SharedPreferencesUtils
|
15
|
15
|
import com.xhly.corelib.utils.SystemUtil
|
16
|
16
|
import com.xhly.corelib.utils.toFormat
|
17
|
17
|
import com.xhly.manageapp.ManageApplication
|
|
18
|
+import com.xhly.manageapp.bean.PadLocationConst
|
18
|
19
|
import com.xhly.manageapp.bean.log.LogAppStartBean
|
19
|
20
|
import com.xhly.manageapp.bean.log.PadLocationBean
|
20
|
21
|
import com.xhly.manageapp.bean.user.UserBean
|
|
@@ -59,19 +60,20 @@ class TimingWorker(context: Context, workerParams: WorkerParameters) :
|
59
|
60
|
if (appInfo.size > 0) {
|
60
|
61
|
logService.postLogAppStartAdd(appInfo)
|
61
|
62
|
}
|
|
63
|
+/*
|
62
|
64
|
try {
|
63
|
|
- val location = SystemUtil.getLocation(applicationContext)
|
64
|
|
- if (location!=null){
|
65
|
|
- val padLocationBean=PadLocationBean()
|
66
|
|
- padLocationBean.lat=location.latitude
|
67
|
|
- padLocationBean.lon=location.longitude
|
|
65
|
+ val location = PadLocationConst.currentLocation
|
|
66
|
+ val lastLocation = PadLocationConst.lastLocation
|
|
67
|
+ if (location.lat!=null&&location.lon!=null&&(lastLocation.lon!=location.lon&&lastLocation.lat!=location.lat)){
|
|
68
|
+ lastLocation.lat=location.lat
|
|
69
|
+ lastLocation.lon=location.lon
|
68
|
70
|
ManageApplication.getDeviceInfo()?.let {
|
69
|
|
- padLocationBean.sn=it
|
|
71
|
+ location.sn=it
|
70
|
72
|
}
|
71
|
73
|
userBean?.let {
|
72
|
|
- padLocationBean.userid=it.userid
|
|
74
|
+ location.userid=it.userid
|
73
|
75
|
}
|
74
|
|
- logService.postPadLocation(padLocationBean)
|
|
76
|
+ logService.postPadLocation(location)
|
75
|
77
|
LogShow("真没有位置")
|
76
|
78
|
}else{
|
77
|
79
|
LogShow("没有位置")
|
|
@@ -79,6 +81,7 @@ class TimingWorker(context: Context, workerParams: WorkerParameters) :
|
79
|
81
|
}catch (e:Exception){
|
80
|
82
|
LogShow("没有位置问题"+e.toString())
|
81
|
83
|
}
|
|
84
|
+*/
|
82
|
85
|
//创建socket
|
83
|
86
|
userBean?.let {
|
84
|
87
|
ManageApplication.instance?.let {
|