搜索菜品入库改为自动拍照保存,取消手动拍照操作;增加向量数据库相关日志

This commit is contained in:
mazengfei
2026-03-03 15:39:11 +08:00
parent b034e9371f
commit 9a5258ad34
10 changed files with 157 additions and 95 deletions
@@ -47,6 +47,7 @@ import com.sw.inbound.utils.BitmapCropper
import com.sw.inbound.utils.CameraUtils
import com.sw.inbound.utils.DateTimeUtils
import com.sw.inbound.utils.ImageUtil
import com.sw.inbound.utils.LogSaveUtil
import com.sw.inbound.utils.PreciseDelayHandler
import com.sw.inbound.utils.ext.dp
import com.sw.inbound.utils.ext.gone
@@ -229,7 +230,7 @@ abstract class GoodsListActivity : ComponentActivity() {
private var lastWeight = 0
private fun recognizeWeight(weight: Int) {
Timber.tag(TAG).d("recognizeWeight,lastWeight=$lastWeight,weight=$weight")
logInfo("recognizeWeight,lastWeight=$lastWeight,weight=$weight")
//if (this.lastWeight - weight >= 0) {
// this.lastWeight = weight
// //从秤上取物品中
@@ -265,8 +266,7 @@ abstract class GoodsListActivity : ComponentActivity() {
// Timber.tag(TAG).d("recognizeWeight, checkResult=true")
// return
// }
Timber.tag(TAG)
.d("recognizeWeight,recognizeFoodisShowRecognizeDialog=$isShowRecognizeDialog")
logInfo("recognizeWeight,recognizeFoodisShowRecognizeDialog=$isShowRecognizeDialog")
//两次相差5克内视作重量未变,不进行重新识别
if (abs(lastWeight - weight) > 5) {
recognizeFood()
@@ -650,8 +650,7 @@ abstract class GoodsListActivity : ComponentActivity() {
supplierId = supplierId,
receiveGoodsInfos = goodsList
)
Timber.tag("SelfProcurementActivity")
.d("receiptSubmit确认收货提交数据:${uploadInfo.toJsonString()}")
logInfo("receiptSubmit确认收货提交数据:${uploadInfo.toJsonString()}")
showWaitingDialog2("加载中")
receiptViewModel.confirmReceipt(uploadInfo) { success ->
hideWaitingDialog()
@@ -690,8 +689,7 @@ abstract class GoodsListActivity : ComponentActivity() {
buyToInventoryValue = it.buyToInventoryValue ?: ""
)
}
Timber.tag("SelfProcurementActivity")
.d("selfProcurementSubmit自采入库提交数据:${submitData.toJsonString()}")
logInfo("selfProcurementSubmit自采入库提交数据:${submitData.toJsonString()}")
showWaitingDialog2("加载中")
receiptViewModel.addToWarehouse(submitData) { success ->
hideWaitingDialog()
@@ -796,4 +794,10 @@ abstract class GoodsListActivity : ComponentActivity() {
tvTip?.text = tip
}
}
private fun logInfo(msg:String) {
Timber.tag(TAG).d(msg)
LogSaveUtil.saveLogFile(msg)
}
}
@@ -64,6 +64,10 @@ class PurchaseOrderActivity : ComponentActivity() {
putExtra(GoodsListActivity.IS_RECEIPT_PAGE, false)
}
}
}
override fun onResume() {
super.onResume()
Loading.show(this)
viewModel.getOrderListNew(pageNum = 1, pageSize = 100) { suppliers ->
runOnUiThread {
@@ -82,6 +86,7 @@ class PurchaseOrderActivity : ComponentActivity() {
binding.layoutEmptyView.visible()
return
}
list.clear()
list.addAll(suppliers)
adapter.notifyDataSetChanged()
binding.rvOrderList.visible()