diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 60b1220..cbecd87 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -104,6 +104,21 @@
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
+
+
+
{
- ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_FU_BANG)
+ // TODO: 2025-11-21 旧版跳转,已改为新的列表页面
+ // ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_FU_BANG)
+ // .navigation()
+
+ // 新版板箱过磅列表页面
+ ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING)
.navigation()
}
//仓库
diff --git a/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcBoxWeighingStatisticsBean.kt b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcBoxWeighingStatisticsBean.kt
new file mode 100644
index 0000000..a4e4d95
--- /dev/null
+++ b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcBoxWeighingStatisticsBean.kt
@@ -0,0 +1,12 @@
+package com.lukouguoji.module_base.bean
+
+/**
+ * 国际出港板箱过磅-统计数据Bean
+ * 对应API: IntExpWeighting/pageQueryTotal
+ */
+class GjcBoxWeighingStatisticsBean {
+ var wbNumber: Int = 0 // 运单票数/总票数
+ var totalPc: Long = 0 // 总件数
+ var totalWeight: Double = 0.0 // 总重量
+ var cargoWeight: Double = 0.0 // 总货重
+}
diff --git a/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcUldUseBean.kt b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcUldUseBean.kt
new file mode 100644
index 0000000..102e640
--- /dev/null
+++ b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcUldUseBean.kt
@@ -0,0 +1,54 @@
+package com.lukouguoji.module_base.bean
+
+/**
+ * 国际出港板箱过磅-ULD使用记录Bean
+ * 对应API: IntExpWeighting/pageQuery
+ */
+class GjcUldUseBean {
+ var useId: Long = 0 // 使用id
+ var uld: String = "" // uld编号
+ var carId: String = "" // 板车号
+ var carWeight: Double = 0.0 // 板车重量
+ var cargoType: String = "" // 货物类型
+ var cargoWeight: Double = 0.0 // 货重
+ var netWeight: Double = 0.0 // 装机重量
+ var totalWeight: Double = 0.0 // 总重
+ var uldWeight: Double = 0.0 // uld重量
+ var volume: Double = 0.0 // 体积
+ var maxVolume: Double = 0.0 // uld最大容积
+ var maxWeight: Double = 0.0 // uld最大载重
+
+ var fdate: String = "" // 航班日期
+ var fno: String = "" // 航班号
+ var fdep: String = "" // 起始站
+ var fdest: String = "" // 目的港
+ var fClose: String = "" // 航班关闭时间
+
+ var wtId: String = "" // 过磅人ID
+ var wtUsername: String = "" // 过磅人
+ var wtDate: String = "" // 过磅时间
+
+ var ldId: String = "" // 组装人ID
+ var ldUserName: String = "" // 组装人
+ var ldDate: String = "" // 组装时间
+
+ var hoId: String = "" // 交接人ID
+ var hoUserName: String = "" // 交接人
+ var hoDate: String = "" // 交接时间
+
+ var boardType: String = "" // 板型
+ var uldCarrier: String = "" // uld所属航司
+ var uldFlag: String = "" // uld分类
+ var status: String = "" // uld状态:0:正常,1:故障
+ var dgrCode: String = "" // IMP代码
+ var height: String = "" // 高度
+ var passageway: String = "" // 通道号
+ var passagewayName: String = "" // 通道号(中文)
+ var piClose: String = "" // 探板/收口
+ var piCloseSize: String = "" // 探板尺寸(CM)
+ var location: String = "" // 位置
+ var pieces: String = "" // 件数
+ var remark: String = "" // 备注
+ var checkFlag: String = "" // 检查标记
+ var emptyUld: String = "" // 空ULD
+}
diff --git a/module_base/src/main/java/com/lukouguoji/module_base/common/Constant.kt b/module_base/src/main/java/com/lukouguoji/module_base/common/Constant.kt
index 408d6b6..d8c7ca7 100644
--- a/module_base/src/main/java/com/lukouguoji/module_base/common/Constant.kt
+++ b/module_base/src/main/java/com/lukouguoji/module_base/common/Constant.kt
@@ -127,6 +127,9 @@ interface Constant {
// ULD
const val ULD = 10001
+ // 航班号
+ const val FLIGHT_NO = 10005
+
// 运单
const val WAYBILL = 10002
diff --git a/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt b/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt
index 1917e1a..2af8c74 100644
--- a/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt
+++ b/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt
@@ -22,9 +22,11 @@ import com.lukouguoji.module_base.bean.GbCarOrUldBean
import com.lukouguoji.module_base.bean.GjcBoxAddInsertBean
import com.lukouguoji.module_base.bean.GjcBoxAssembleBean
import com.lukouguoji.module_base.bean.GjcBoxDetailsBean
+import com.lukouguoji.module_base.bean.GjcBoxWeighingStatisticsBean
import com.lukouguoji.module_base.bean.GjcGoodsAddBean
import com.lukouguoji.module_base.bean.GjcGoodsBean
import com.lukouguoji.module_base.bean.GjcGoodsDetailsBean
+import com.lukouguoji.module_base.bean.GjcUldUseBean
import com.lukouguoji.module_base.bean.GjcWaybillBean
import com.lukouguoji.module_base.bean.GjcWaybillDataBean
import com.lukouguoji.module_base.bean.GjjGoodsBean
@@ -409,6 +411,34 @@ interface Api {
@POST("IntExpCheckInCheck/pageQueryTotal")
suspend fun getGjcInspectionTotal(@Body data: RequestBody): BaseResultBean
+ /**
+ * 国际出港板箱过磅-分页搜索
+ * 接口路径: /IntExpWeighting/pageQuery
+ */
+ @POST("IntExpWeighting/pageQuery")
+ suspend fun getGjcBoxWeighingList(@Body data: RequestBody): BaseListBean
+
+ /**
+ * 国际出港板箱过磅-分页下的合计
+ * 接口路径: /IntExpWeighting/pageQueryTotal
+ */
+ @POST("IntExpWeighting/pageQueryTotal")
+ suspend fun getGjcBoxWeighingStatistics(@Body data: RequestBody): BaseResultBean
+
+ /**
+ * 国际出港板箱过磅-详情
+ * 接口路径: /IntExpWeighting/queryByUseId
+ */
+ @GET("IntExpWeighting/queryByUseId")
+ suspend fun getGjcBoxWeighingDetails(@Query("useId") useId: Long): BaseResultBean
+
+ /**
+ * 国际出港板箱过磅-提交过磅数据
+ * 接口路径: /IntExpWeighting/weight
+ */
+ @POST("IntExpWeighting/weight")
+ suspend fun submitGjcBoxWeighing(@Body data: RequestBody): BaseResultBean
+
///////////////////////////////////////////////////////////////////////////
// 国际进-电报解析
///////////////////////////////////////////////////////////////////////////
diff --git a/module_base/src/main/java/com/lukouguoji/module_base/router/ARouterConstants.kt b/module_base/src/main/java/com/lukouguoji/module_base/router/ARouterConstants.kt
index e50b58d..8eb7ba9 100644
--- a/module_base/src/main/java/com/lukouguoji/module_base/router/ARouterConstants.kt
+++ b/module_base/src/main/java/com/lukouguoji/module_base/router/ARouterConstants.kt
@@ -115,6 +115,9 @@ object ARouterConstants {
const val ACTIVITY_URL_GJC_START_RECEIVE = "/gjc/GjcStartReceiveActivity" //国际出港模块 开始收运
const val ACTIVITY_URL_GJC_FU_BANG = "/gjc/GjcFuBangActivity" //国际出港模块 复磅
+ const val ACTIVITY_URL_GJC_BOX_WEIGHING = "/gjc/GjcBoxWeighingActivity" //国际出港模块 板箱过磅
+ const val ACTIVITY_URL_GJC_BOX_WEIGHING_DETAILS = "/gjc/GjcBoxWeighingDetailsActivity" //国际出港模块 板箱过磅详情
+ const val ACTIVITY_URL_GJC_BOX_WEIGHING_ADD = "/gjc/GjcBoxWeighingAddActivity" //国际出港模块 添加过磅
const val ACTIVITY_URL_GJC_WARE_HOUSE = "/gjc/GjcWareHouseActivity" //国际出港模块 仓库
const val ACTIVITY_URL_GJC_WARE_HOUSE_INFO = "/gjc/GjcWareHouseInfoActivity" //国际出港模块 仓库详情
diff --git a/module_base/src/main/res/values/colors.xml b/module_base/src/main/res/values/colors.xml
index 5b9af5c..0cc22fa 100644
--- a/module_base/src/main/res/values/colors.xml
+++ b/module_base/src/main/res/values/colors.xml
@@ -30,7 +30,10 @@
#8A000000
#3CB5F3
#EA6BE1
+ #d9001b
+ #4CAF50
#5c6890
+ #F2F2F2
\ No newline at end of file
diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingActivity.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingActivity.kt
new file mode 100644
index 0000000..65165b9
--- /dev/null
+++ b/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingActivity.kt
@@ -0,0 +1,54 @@
+package com.lukouguoji.gjc.activity
+
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.lukouguoji.gjc.R
+import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingBinding
+import com.lukouguoji.gjc.viewModel.GjcBoxWeighingViewModel
+import com.lukouguoji.module_base.base.BaseBindingActivity
+import com.lukouguoji.module_base.common.ConstantEvent
+import com.lukouguoji.module_base.impl.FlowBus
+import com.lukouguoji.module_base.impl.observe
+import com.lukouguoji.module_base.ktx.getLifecycleOwner
+import com.lukouguoji.module_base.router.ARouterConstants
+
+/**
+ * 国际出港板箱过磅列表页
+ */
+@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING)
+class GjcBoxWeighingActivity :
+ BaseBindingActivity() {
+
+ override fun layoutId() = R.layout.activity_gjc_box_weighing
+
+ override fun viewModelClass() = GjcBoxWeighingViewModel::class.java
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ setBackArrow("板箱过磅")
+
+ binding.viewModel = viewModel
+
+ // 绑定分页逻辑
+ viewModel.pageModel
+ .bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
+
+ // 监听刷新事件
+ FlowBus.with(ConstantEvent.EVENT_REFRESH)
+ .observe(this) {
+ viewModel.refresh()
+ }
+
+ // 初始加载
+ viewModel.refresh()
+ }
+
+ companion object {
+ @JvmStatic
+ fun start(context: Context) {
+ val starter = Intent(context, GjcBoxWeighingActivity::class.java)
+ context.startActivity(starter)
+ }
+ }
+}
diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingAddActivity.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingAddActivity.kt
new file mode 100644
index 0000000..ece16df
--- /dev/null
+++ b/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingAddActivity.kt
@@ -0,0 +1,34 @@
+package com.lukouguoji.gjc.activity
+
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import com.lukouguoji.gjc.R
+import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingAddBinding
+import com.lukouguoji.gjc.viewModel.GjcBoxWeighingAddViewModel
+import com.lukouguoji.module_base.base.BaseBindingActivity
+
+/**
+ * 国际出港板箱过磅添加页面
+ */
+class GjcBoxWeighingAddActivity :
+ BaseBindingActivity() {
+
+ override fun layoutId() = R.layout.activity_gjc_box_weighing_add
+
+ override fun viewModelClass() = GjcBoxWeighingAddViewModel::class.java
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ setBackArrow("板箱过磅")
+ binding.viewModel = viewModel
+ viewModel.initOnCreated(this)
+ }
+
+ companion object {
+ @JvmStatic
+ fun startForAdd(context: Context) {
+ val starter = Intent(context, GjcBoxWeighingAddActivity::class.java)
+ context.startActivity(starter)
+ }
+ }
+}
diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingDetailsActivity.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingDetailsActivity.kt
new file mode 100644
index 0000000..7974ea8
--- /dev/null
+++ b/module_gjc/src/main/java/com/lukouguoji/gjc/activity/GjcBoxWeighingDetailsActivity.kt
@@ -0,0 +1,42 @@
+package com.lukouguoji.gjc.activity
+
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.lukouguoji.gjc.R
+import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingDetailsBinding
+import com.lukouguoji.gjc.viewModel.GjcBoxWeighingDetailsViewModel
+import com.lukouguoji.module_base.base.BaseBindingActivity
+import com.lukouguoji.module_base.common.Constant
+import com.lukouguoji.module_base.router.ARouterConstants
+
+/**
+ * 国际出港板箱过磅详情页
+ */
+@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING_DETAILS)
+class GjcBoxWeighingDetailsActivity :
+ BaseBindingActivity() {
+
+ override fun layoutId() = R.layout.activity_gjc_box_weighing_details
+
+ override fun viewModelClass() = GjcBoxWeighingDetailsViewModel::class.java
+
+ override fun initOnCreate(savedInstanceState: Bundle?) {
+ setBackArrow("板箱过磅详情")
+
+ binding.viewModel = viewModel
+
+ // 初始化数据(从Intent获取参数)
+ viewModel.initOnCreated(intent)
+ }
+
+ companion object {
+ @JvmStatic
+ fun start(context: Context, useId: Long) {
+ val starter = Intent(context, GjcBoxWeighingDetailsActivity::class.java)
+ .putExtra(Constant.Key.ID, useId)
+ context.startActivity(starter)
+ }
+ }
+}
diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/holder/GjcBoxWeighingViewHolder.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/holder/GjcBoxWeighingViewHolder.kt
new file mode 100644
index 0000000..fe95e8c
--- /dev/null
+++ b/module_gjc/src/main/java/com/lukouguoji/gjc/holder/GjcBoxWeighingViewHolder.kt
@@ -0,0 +1,24 @@
+package com.lukouguoji.gjc.holder
+
+import android.view.View
+import com.lukouguoji.gjc.activity.GjcBoxWeighingDetailsActivity
+import com.lukouguoji.gjc.databinding.ItemGjcBoxWeighingBinding
+import com.lukouguoji.module_base.base.BaseViewHolder
+import com.lukouguoji.module_base.bean.GjcUldUseBean
+
+/**
+ * 国际出港板箱过磅列表 ViewHolder
+ */
+class GjcBoxWeighingViewHolder(view: View) :
+ BaseViewHolder(view) {
+
+ override fun onBind(item: Any?, position: Int) {
+ val bean = getItemBean(item)!!
+ binding.bean = bean
+
+ // 整行点击跳转到详情页
+ binding.ll.setOnClickListener {
+ GjcBoxWeighingDetailsActivity.start(it.context, bean.useId)
+ }
+ }
+}
diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingAddViewModel.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingAddViewModel.kt
new file mode 100644
index 0000000..0b1f9be
--- /dev/null
+++ b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingAddViewModel.kt
@@ -0,0 +1,235 @@
+package com.lukouguoji.gjc.viewModel
+
+import android.app.Activity
+import android.content.Intent
+import android.view.View
+import androidx.lifecycle.LifecycleOwner
+import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.viewModelScope
+import com.lukouguoji.module_base.base.BaseViewModel
+import com.lukouguoji.module_base.bean.GjcUldUseBean
+import com.lukouguoji.module_base.common.Constant
+import com.lukouguoji.module_base.common.ConstantEvent
+import com.lukouguoji.module_base.http.net.DiBangWeightModel
+import com.lukouguoji.module_base.http.net.NetApply
+import com.lukouguoji.module_base.impl.FlowBus
+import com.lukouguoji.module_base.ktx.formatDate
+import com.lukouguoji.module_base.ktx.getActivity
+import com.lukouguoji.module_base.ktx.launchLoadingCollect
+import com.lukouguoji.module_base.ktx.noNull
+import com.lukouguoji.module_base.ktx.showToast
+import com.lukouguoji.module_base.ktx.toRequestBody
+import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
+import com.lukouguoji.module_base.model.ScanModel
+import com.lukouguoji.module_base.util.Common
+import com.lukouguoji.module_base.util.DictUtils
+import dev.utils.app.info.KeyValue
+import kotlinx.coroutines.launch
+import java.util.Calendar
+import java.util.Date
+
+/**
+ * 国际出港板箱过磅添加 ViewModel
+ */
+class GjcBoxWeighingAddViewModel : BaseViewModel() {
+
+ // 数据Bean
+ val dataBean = MutableLiveData(GjcUldUseBean())
+
+ // 地磅集成 - 暂时注释
+ // val diBangModel = DiBangWeightModel()
+ val channel = MutableLiveData("") // 通道号(用于控制地磅key)
+
+ // 计算字段显示
+ val totalWeight = MutableLiveData("0") // 总重(红色)
+ val netWeight = MutableLiveData("0") // 装机重(蓝色)
+ val cargoWeight = MutableLiveData("0") // 货重(绿色)
+
+ // 下拉选择数据源
+ val passagewayList = MutableLiveData>() // 通道号列表
+ val piCloseList = MutableLiveData>() // 探板收口列表
+
+ // 打印挂签
+ val printTag = MutableLiveData(false)
+
+ /**
+ * 初始化
+ */
+ fun initOnCreated(activity: Activity) {
+ // 监听地磅重量变化 - 暂时注释
+ // diBangModel.weight.observe(activity as LifecycleOwner) { weight ->
+ // val w = weight?.toDoubleOrNull() ?: 0.0
+ // totalWeight.value = w.toString()
+ // dataBean.value?.totalWeight = w
+ // // 实时计算装机重和货重
+ // calculateWeights()
+ // }
+
+ // 监听通道号变化,设置地磅的key - 暂时注释
+ // channel.observe(activity as LifecycleOwner) {
+ // diBangModel.key = it ?: ""
+ // }
+
+ // 加载下拉列表数据
+ loadPassagewayList()
+ loadPiCloseList()
+
+ // 初始化航班日期为今天
+ dataBean.value?.fdate = Date().formatDate()
+ }
+
+ /**
+ * 加载通道号列表
+ */
+ private fun loadPassagewayList() {
+ DictUtils.getChannelList {
+ passagewayList.value = it
+ }
+ }
+
+ /**
+ * 加载探板收口列表
+ */
+ private fun loadPiCloseList() {
+ // 探板收口选项(是/否)
+ piCloseList.value = listOf(
+ KeyValue("1", "是"),
+ KeyValue("0", "否")
+ )
+ }
+
+ /**
+ * 计算重量字段
+ * 装机重 = 总重 - 架子车自重
+ * 货重 = 装机重 - ULD自重
+ */
+ private fun calculateWeights() {
+ val total = totalWeight.value?.toDoubleOrNull() ?: 0.0
+ val carW = dataBean.value?.carWeight ?: 0.0
+ val uldW = dataBean.value?.uldWeight ?: 0.0
+
+ val net = total - carW
+ val cargo = net - uldW
+
+ netWeight.value = if (net > 0) net.toString() else "0"
+ cargoWeight.value = if (cargo > 0) cargo.toString() else "0"
+
+ dataBean.value?.netWeight = if (net > 0) net else 0.0
+ dataBean.value?.cargoWeight = if (cargo > 0) cargo else 0.0
+ }
+
+ /**
+ * 航班日期点击
+ */
+ fun flightDateClick(view: View) {
+ Common.onYearMonthDay(view.context.getActivity(), dataBean.value?.fdate) { year, month, day ->
+ val calendar = Calendar.getInstance()
+ calendar.set(year, month - 1, day)
+ val date = calendar.time.formatDate()
+ dataBean.value = dataBean.value?.apply { fdate = date }
+ }
+ }
+
+ /**
+ * ULD编号扫码
+ */
+ fun uldScanClick() {
+ ScanModel.startScan(getTopActivity(), Constant.RequestCode.ULD)
+ }
+
+ /**
+ * 架子车号扫码
+ */
+ fun carIdScanClick() {
+ ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
+ }
+
+ /**
+ * 重置按钮点击
+ */
+ fun resetClick() {
+ dataBean.value = GjcUldUseBean().apply {
+ fdate = Date().formatDate()
+ }
+ totalWeight.value = "0"
+ netWeight.value = "0"
+ cargoWeight.value = "0"
+ channel.value = ""
+ printTag.value = false
+ }
+
+ /**
+ * 确定按钮点击
+ */
+ fun confirmClick() {
+ val bean = dataBean.value ?: return
+
+ // 验证必填字段
+ if (bean.carId.verifyNullOrEmpty("请输入架子车号")) return
+ if (bean.uld.verifyNullOrEmpty("请输入ULD编号")) return
+
+ // 提交数据
+ val params = mapOf(
+ "carId" to bean.carId,
+ "passageway" to bean.passageway,
+ "uld" to bean.uld,
+ "dgrCode" to bean.dgrCode,
+ "boardType" to bean.boardType,
+ "height" to bean.height,
+ "piClose" to bean.piClose,
+ "piCloseSize" to bean.piCloseSize,
+ "carWeight" to bean.carWeight,
+ "uldWeight" to bean.uldWeight,
+ "fdate" to bean.fdate,
+ "fno" to bean.fno,
+ "fdest" to bean.fdest,
+ "remark" to bean.remark,
+ "totalWeight" to bean.totalWeight,
+ "netWeight" to bean.netWeight,
+ "cargoWeight" to bean.cargoWeight,
+ "printTag" to printTag.value
+ ).toRequestBody(removeEmptyOrNull = true)
+
+ launchLoadingCollect({
+ NetApply.api.submitGjcBoxWeighing(params)
+ }) {
+ onSuccess = { result ->
+ if (result.verifySuccess()) {
+ showToast("添加成功")
+ // 发送刷新事件
+ viewModelScope.launch {
+ FlowBus.with(ConstantEvent.EVENT_REFRESH).emit("refresh")
+ }
+ getTopActivity().finish()
+ } else {
+ showToast(result.msg.noNull("添加失败"))
+ }
+ }
+ }
+ }
+
+ /**
+ * 处理扫码结果
+ */
+ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+ if (resultCode == Activity.RESULT_OK && data != null) {
+ val content = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
+ when (requestCode) {
+ Constant.RequestCode.ULD -> {
+ dataBean.value = dataBean.value?.apply { uld = content }
+ }
+ Constant.RequestCode.CAR -> {
+ dataBean.value = dataBean.value?.apply { carId = content }
+ }
+ }
+ }
+ }
+
+ /**
+ * 清理资源
+ */
+ override fun onCleared() {
+ super.onCleared()
+ // diBangModel.cancelLooperGet() // 暂时注释
+ }
+}
diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingDetailsViewModel.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingDetailsViewModel.kt
new file mode 100644
index 0000000..bffa56e
--- /dev/null
+++ b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingDetailsViewModel.kt
@@ -0,0 +1,48 @@
+package com.lukouguoji.gjc.viewModel
+
+import android.content.Intent
+import androidx.lifecycle.MutableLiveData
+import com.lukouguoji.module_base.base.BaseViewModel
+import com.lukouguoji.module_base.bean.GjcUldUseBean
+import com.lukouguoji.module_base.common.Constant
+import com.lukouguoji.module_base.http.net.NetApply
+import com.lukouguoji.module_base.ktx.launchLoadingCollect
+import com.lukouguoji.module_base.ktx.showToast
+
+/**
+ * 国际出港板箱过磅详情 ViewModel
+ */
+class GjcBoxWeighingDetailsViewModel : BaseViewModel() {
+
+ // 主键ID(从Intent接收)
+ var useId: Long = 0
+
+ // 详情数据
+ val dataBean = MutableLiveData(GjcUldUseBean())
+
+ /**
+ * 初始化数据
+ */
+ fun initOnCreated(intent: Intent) {
+ useId = intent.getLongExtra(Constant.Key.ID, 0)
+ if (useId > 0) {
+ getData()
+ } else {
+ showToast("参数错误")
+ getTopActivity().finish()
+ }
+ }
+
+ /**
+ * 获取详情数据
+ */
+ private fun getData() {
+ launchLoadingCollect({
+ NetApply.api.getGjcBoxWeighingDetails(useId)
+ }) {
+ onSuccess = {
+ dataBean.value = it.data ?: GjcUldUseBean()
+ }
+ }
+ }
+}
diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingViewModel.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingViewModel.kt
new file mode 100644
index 0000000..d56379e
--- /dev/null
+++ b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcBoxWeighingViewModel.kt
@@ -0,0 +1,152 @@
+package com.lukouguoji.gjc.viewModel
+
+import android.app.Activity
+import android.content.Intent
+import androidx.lifecycle.MutableLiveData
+import com.lukouguoji.gjc.R
+import com.lukouguoji.gjc.holder.GjcBoxWeighingViewHolder
+import com.lukouguoji.module_base.base.BasePageViewModel
+import com.lukouguoji.module_base.common.Constant
+import com.lukouguoji.module_base.http.net.NetApply
+import com.lukouguoji.module_base.ktx.launchCollect
+import com.lukouguoji.module_base.ktx.launchLoadingCollect
+import com.lukouguoji.module_base.ktx.toRequestBody
+import com.lukouguoji.module_base.model.ScanModel
+
+/**
+ * 国际出港板箱过磅 ViewModel
+ */
+class GjcBoxWeighingViewModel : BasePageViewModel() {
+
+ // 搜索条件
+ val flightDate = MutableLiveData("") // 航班日期
+ val flightNo = MutableLiveData("") // 航班号
+ val dest = MutableLiveData("") // 目的站
+ val carId = MutableLiveData("") // 架子车号
+ val uld = MutableLiveData("") // ULD编号
+
+ // 适配器配置
+ val itemViewHolder = GjcBoxWeighingViewHolder::class.java
+ val itemLayoutId = R.layout.item_gjc_box_weighing
+
+ // 统计数据
+ val totalCount = MutableLiveData("0") // 合计票数
+ val totalPc = MutableLiveData("0") // 总件数
+ val totalWeight = MutableLiveData("0") // 总重量
+ val cargoWeight = MutableLiveData("0") // 总货重
+
+ ///////////////////////////////////////////////////////////////////////////
+ // 方法区
+ ///////////////////////////////////////////////////////////////////////////
+
+ /**
+ * 扫码输入航班号
+ */
+ fun flightNoScanClick() {
+ ScanModel.startScan(getTopActivity(), Constant.RequestCode.FLIGHT_NO)
+ }
+
+ /**
+ * 扫码输入架子车号
+ */
+ fun carIdScanClick() {
+ ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
+ }
+
+ /**
+ * 扫码输入ULD编号
+ */
+ fun uldScanClick() {
+ ScanModel.startScan(getTopActivity(), Constant.RequestCode.ULD)
+ }
+
+ /**
+ * 搜索按钮点击
+ */
+ fun searchClick() {
+ refresh()
+ }
+
+ /**
+ * 添加按钮点击
+ */
+ fun addClick() {
+ com.lukouguoji.gjc.activity.GjcBoxWeighingAddActivity.startForAdd(getTopActivity())
+ }
+
+ /**
+ * 挂签打印按钮点击
+ */
+ fun printClick() {
+ // TODO: 实现挂签打印功能
+ }
+
+ /**
+ * 获取列表数据
+ */
+ override fun getData() {
+ // 构建查询参数(列表接口)
+ val listParams = mapOf(
+ "pageNum" to pageModel.page,
+ "pageSize" to pageModel.limit,
+ "fdate" to flightDate.value!!.ifEmpty { null },
+ "fno" to flightNo.value!!.ifEmpty { null },
+ "fdest" to dest.value!!.ifEmpty { null },
+ "carId" to carId.value!!.ifEmpty { null },
+ "uld" to uld.value!!.ifEmpty { null },
+ ).toRequestBody()
+
+ // 构建查询参数(统计接口 - 使用相同的搜索条件)
+ val totalParams = mapOf(
+ "fdate" to flightDate.value!!.ifEmpty { null },
+ "fno" to flightNo.value!!.ifEmpty { null },
+ "fdest" to dest.value!!.ifEmpty { null },
+ "carId" to carId.value!!.ifEmpty { null },
+ "uld" to uld.value!!.ifEmpty { null },
+ ).toRequestBody()
+
+ // 获取列表数据(显示loading)
+ launchLoadingCollect({
+ NetApply.api.getGjcBoxWeighingList(listParams)
+ }) {
+ onSuccess = {
+ pageModel.handleListBean(it)
+ }
+ }
+
+ // 获取统计数据(后台调用,不显示loading)
+ launchCollect({
+ NetApply.api.getGjcBoxWeighingStatistics(totalParams)
+ }) {
+ onSuccess = { result ->
+ val data = result.data
+ totalCount.value = (data?.wbNumber ?: 0).toString()
+ totalPc.value = (data?.totalPc ?: 0).toString()
+ totalWeight.value = (data?.totalWeight ?: 0.0).toString()
+ cargoWeight.value = (data?.cargoWeight ?: 0.0).toString()
+ }
+ }
+ }
+
+ /**
+ * 处理扫码结果
+ */
+ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+ if (resultCode == Activity.RESULT_OK && data != null) {
+ when (requestCode) {
+ Constant.RequestCode.FLIGHT_NO -> {
+ flightNo.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
+ refresh()
+ }
+ Constant.RequestCode.CAR -> {
+ carId.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
+ refresh()
+ }
+ Constant.RequestCode.ULD -> {
+ uld.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
+ refresh()
+ }
+ }
+ }
+ }
+}
diff --git a/module_gjc/src/main/res/layout/activity_gjc_box_weighing.xml b/module_gjc/src/main/res/layout/activity_gjc_box_weighing.xml
new file mode 100644
index 0000000..d16d7f5
--- /dev/null
+++ b/module_gjc/src/main/res/layout/activity_gjc_box_weighing.xml
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/module_gjc/src/main/res/layout/activity_gjc_box_weighing_add.xml b/module_gjc/src/main/res/layout/activity_gjc_box_weighing_add.xml
new file mode 100644
index 0000000..7f29698
--- /dev/null
+++ b/module_gjc/src/main/res/layout/activity_gjc_box_weighing_add.xml
@@ -0,0 +1,396 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/module_gjc/src/main/res/layout/activity_gjc_box_weighing_details.xml b/module_gjc/src/main/res/layout/activity_gjc_box_weighing_details.xml
new file mode 100644
index 0000000..2b440a6
--- /dev/null
+++ b/module_gjc/src/main/res/layout/activity_gjc_box_weighing_details.xml
@@ -0,0 +1,265 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/module_gjc/src/main/res/layout/item_gjc_box_weighing.xml b/module_gjc/src/main/res/layout/item_gjc_box_weighing.xml
new file mode 100644
index 0000000..e685262
--- /dev/null
+++ b/module_gjc/src/main/res/layout/item_gjc_box_weighing.xml
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nohup.out b/nohup.out
new file mode 100644
index 0000000..ad0483a
--- /dev/null
+++ b/nohup.out
@@ -0,0 +1,11 @@
+/opt/homebrew/Cellar/scrcpy/3.3.3/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 171.0 MB/s (90164 bytes in 0.001s)
+[server] INFO: Device: [CENAVA] CENAVA A80ST (Android 10)
+[server] WARN: Audio disabled: it is not supported before Android 11
+WARN: Demuxer 'audio': stream explicitly disabled by the device
+2025-11-21 13:21:03.514 scrcpy[46548:5077376] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
+WARN: Device disconnected
+scrcpy 3.3.3
+INFO: ADB device found:
+INFO: --> (usb) 80STHZCHDLL4311422 device A80ST
+INFO: Renderer: metal
+INFO: Texture: 1280x800