参数优化

This commit is contained in:
2025-08-18 14:17:58 +08:00
parent f8453c7d76
commit ca2041fe76
5 changed files with 9 additions and 4 deletions
@@ -73,7 +73,7 @@ class HomeActivity : BaseActivity() {
var shelfIndex = 0 var shelfIndex = 0
// public fun getRealWeight():Double = weightArray[shelfIndex]?:0.0 // public fun getRealWeight():Double = weightArray[shelfIndex]?:0.0
// 温度 // 温度
var showTemperatureC = "" var showTemperatureC = "0"
// 湿度 // 湿度
var showHumidity = "0" var showHumidity = "0"
} }
@@ -125,7 +125,8 @@ class ShelfActivity : BaseActivity() {
goodsName = list[clickIndex].goodsName, goodsName = list[clickIndex].goodsName,
weight = realWeight / 1000.0, weight = realWeight / 1000.0,
overdueDay = list[clickIndex].overdueDay, overdueDay = list[clickIndex].overdueDay,
createTime = if (shelfModel?.goodsId == currentGoodsId) null else DateTimeUtil.formatDateTime(dateTime = Date()) // createTime = if (shelfModel?.goodsId == currentGoodsId) null else DateTimeUtil.formatDateTime(dateTime = Date())
createTime = DateTimeUtil.formatDateTime(dateTime = Date())
) )
val intent = Intent().apply { val intent = Intent().apply {
putExtra(SHELF_MODEL, data) putExtra(SHELF_MODEL, data)
@@ -4,6 +4,8 @@ class ShelfBody {
var deviceId: String = "" var deviceId: String = ""
var canteenId: String = "" var canteenId: String = ""
var temperature: String? = null
var humidity: String = "0"
var goodsList: List<ShelfModel>? = null var goodsList: List<ShelfModel>? = null
} }
@@ -2,8 +2,8 @@ package com.shuwei.intelligent.shelves.net
object UrlConfig { object UrlConfig {
const val BASE_URL = "http://192.168.1.3:9002" // const val BASE_URL = "http://192.168.1.3:9002"
// const val BASE_URL = "https://yyjk.shuziweidao.com/gateway/" const val BASE_URL = "https://yyjk.shuziweidao.com/gateway/"
const val GET_ACCESS_TOKEN = "restaurant/equipment/stEquipment/getEquipmentToken" const val GET_ACCESS_TOKEN = "restaurant/equipment/stEquipment/getEquipmentToken"
const val GET_SHELF_LIST = "inventory/smartShelves/app/getShelvesListByDeviceId" const val GET_SHELF_LIST = "inventory/smartShelves/app/getShelvesListByDeviceId"
const val GET_GOODS_LIST = "inventory/smartShelves/app/getGoodsPageList" const val GET_GOODS_LIST = "inventory/smartShelves/app/getGoodsPageList"
@@ -45,6 +45,8 @@ class SyncTask(appContext: Context, workerParams: WorkerParameters) :
val body = ShelfBody().also { val body = ShelfBody().also {
it.deviceId = App.getInstance().deviceId it.deviceId = App.getInstance().deviceId
it.canteenId = App.getInstance().canteenId it.canteenId = App.getInstance().canteenId
it.temperature = HomeActivity.showTemperatureC
it.humidity = HomeActivity.showHumidity
it.goodsList = submitList it.goodsList = submitList
} }
val resp = apiService.saveShelfGoodsList(body) val resp = apiService.saveShelfGoodsList(body)