feat: 国际出港查询

This commit is contained in:
2025-12-02 18:02:17 +08:00
parent 0c3c78b42e
commit be0541f522
14 changed files with 1253 additions and 8 deletions

View File

@@ -104,6 +104,12 @@
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<!-- 国际出港查询 -->
<activity
android:name="com.lukouguoji.gjc.activity.GjcQueryActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="userLandscape" />
<activity
android:name="com.lukouguoji.gjc.activity.GjcBoxWeighingActivity"
android:configChanges="orientation|keyboardHidden"

View File

@@ -656,13 +656,13 @@ class HomeFragment : Fragment() {
)
)
// list.add(
// RightMenu(
// Constant.AuthName.GjcQueryListActivity,
// R.mipmap.gjc_query_icon,
// "出港查询"
// )
// )
list.add(
RightMenu(
Constant.AuthName.GjcQueryListActivity,
R.mipmap.gjc_query_icon,
"出港查询"
)
)
// list.add(
// RightMenu(

View File

@@ -0,0 +1,203 @@
package com.lukouguoji.module_base.bean
import java.util.Date
/**
* 国际出港主单数据模型
* 对应接口:/IntExpSearch/pageQuery 返回的列表项
*/
data class GjcMaWb(
// ==================== 主键与基础信息 ====================
var maWbId: Long? = null, // 主单主键ID
var wbNo: String? = null, // 11位运单号
var prefix: String? = null, // 运单号前缀3位
var no: String? = null, // 运单号主体8位
var oldPrefix: String? = null, // 旧运单前缀
var oldNo: String? = null, // 旧运单号
// ==================== 航班信息 ====================
var fid: Long? = null, // 航班主键id
var fno: String? = null, // 航班号
var fdate: Date? = null, // 航班日期
var flight: String? = null, // 航班: 航班日期/航班号
var fclose: Date? = null, // 航班关闭时间
var scheduledTackOff: Date? = null, // 计划起飞时间
var scheduledArrival: Date? = null, // 预计到达时间
// ==================== 目的地信息 ====================
var dep: String? = null, // 始发站
var dest: String? = null, // 最终目的站
var dest1: String? = null, // 第一目的站
var dest2: String? = null, // 第二目的站
var range: String? = null, // 航程
// ==================== 代理与承运人 ====================
var agentCode: String? = null, // 代理人code
var agentName: String? = null, // 代理人名称
var customsLib: String? = null, // 代理人lib
var by0: String? = null, // 第一承运人
var by1: String? = null, // 第二承运人
var by2: String? = null, // 第三承运人
// ==================== 货物信息 ====================
var pc: Long? = null, // 预配件数
var weight: Double? = null, // 预配重量KG
var volume: Double? = null, // 预配体积CBM
var goods: String? = null, // 品名(英)
var goodsCn: String? = null, // 品名(中)
var packageType: String? = null, // 包装类型
var cargoType: String? = null, // 货物类型
var origin: String? = null, // 货源地
// ==================== 运抵信息 ====================
var arrivePc: Long? = null, // 运抵件数
var arriveWeight: Double? = null, // 运抵重量
var arriveVolume: Double? = null, // 运抵体积
var arriveFlag: String? = null, // 运抵状态0正常运抵1提前运抵
// ==================== 特码与收货人 ====================
var spCode: String? = null, // 特码
var subCode: String? = null, // 子码
var consignee: String? = null, // 收货人
var cneeTel: String? = null, // 收货人电话
// ==================== 运单类型 ====================
var awbType: String? = null, // 运单类型code
var awbName: String? = null, // 运单类型名称(中)
var businessType: String? = null, // 业务类型code
var businessName: String? = null, // 业务类型名称(中)
// ==================== 车辆信息 ====================
var carId: String? = null, // 平板车号
var carNumber: String? = null, // 车牌号
// ==================== 状态信息 ====================
var checkIn: String? = null, // 收运状态。0待收运1已收运2收运中
var declareStatus: String? = null, // 申报状态
var reviewStatus: String? = null, // 审核状态0未审核1通过2退回
var tranFlag: String? = null, // 转运标志
// ==================== 操作信息 ====================
var opDate: Date? = null, // 操作时间(入库时间)
var opId: String? = null, // 操作员id
var paperTime: Date? = null, // 单证时间
// ==================== 备注与其他 ====================
var remark: String? = null, // 备注
var ffmMemo: String? = null, // ffm备注
var mftMemo: String? = null, // mft备注
var unNumber: String? = null, // UN编号
var billsNo: String? = null, // 提单号
var recheckCount: Long? = null, // 复核次数
// ==================== 地区信息 ====================
var proName: String? = null, // 省份名称
var cityName: String? = null, // 城市名称
var areaName: String? = null, // 区域名称
// ==================== 关联数据统计 ====================
var haWbNumber: Int? = null, // 分单数
var storageUseNumber: Int? = null, // 库位使用数
// ==================== 活动标识 ====================
var activeId: Long? = null, // 有效值
// ==================== 关联列表(非数据库字段,用于展示) ====================
var haWbList: List<GjcHaWb>? = null, // 分单列表
var storageUseList: List<GjcStorageUse>? = null, // 库位使用列表
var attachList: List<ComAttach>? = null // 附件列表
)
/**
* 国际出港分单数据模型
*/
data class GjcHaWb(
var haWbId: Long? = null, // 主键ID
var fid: Long? = null, // 航班主键
var prefix: String? = null, // 前缀
var no: String? = null, // 编号
var hno: String? = null, // H编号
var pc: Long? = null, // PC数量
var weight: Double? = null, // 重量
var volume: Double? = null, // 体积
var hpc: Long? = null, // 分单数量
var hweight: Double? = null, // 分单重量
var hvolume: Double? = null, // 分单体积
var goods: String? = null, // 货物英文
var goodsCn: String? = null, // 货物中文
var billsNo: String? = null, // 提单号
var opDate: Date? = null, // 操作日期
var opId: String? = null, // 操作人ID
var remark: String? = null, // 备注
// 发货人信息
var consignorName: String? = null, // 发货人名称
var consignorCode: String? = null, // 发货人代码
var consignorAddress: String? = null, // 发货人地址
var consignorCountryCode: String? = null, // 发货人国家代码
var consignorComType: String? = null, // 发货人公司类型
var consignorPnum: String? = null, // 发货人电话号码
// 收货人信息
var consigneeName: String? = null, // 收货人名称
var consigneeCode: String? = null, // 收货人代码
var consigneeAddress: String? = null, // 收货人地址
var consigneeCountryCode: String? = null, // 收货人国家代码
var consigneeComType: String? = null, // 收货人公司类型
var consigneePnum: String? = null, // 收货人电话号码
// 特殊收货人信息
var speConsigneeName: String? = null, // 特殊收货人名称
var speConsigneeComType: String? = null, // 特殊收货人公司类型
var speConsigneePnum: String? = null, // 特殊收货人电话号码
// 申报状态
var mftStatus: String? = null, // 预配状态
var mftMsgId: String? = null, // 预配消息ID
var arrivalStatus: String? = null, // 运抵状态
var arrMsgId: String? = null, // 运抵消息ID
var tallyStatus: String? = null, // 理货状态
var tallyMsgId: String? = null, // 理货消息ID
var transferStatus: String? = null, // 传输状态
var tranMsgId: String? = null, // 传输消息ID
var cmdStatus: String? = null, // 命令状态
var response: String? = null, // 响应
// 最后状态
var lastMftStatus: String? = null, // 最后预配状态
var lastMftMsgId: String? = null, // 最后预配消息ID
var lastArrStatus: String? = null, // 最后运抵状态
var lastArrMsgId: String? = null, // 最后运抵消息ID
var lastTallyStatus: String? = null, // 最后理货状态
var lastTallyMsgId: String? = null, // 最后理货消息ID
// 费率计次
var mftSRate: Double? = null, // 预配申报费率
var mftSCount: Double? = null, // 预配申报计次
var mftDRate: Double? = null, // 预配删除费率
var mftDCount: Double? = null, // 预配删除计次
var arrivalSRate: Double? = null, // 运抵申报费率
var arrivalSCount: Double? = null, // 运抵申报计次
var arrivalDRate: Double? = null, // 运抵删除费率
var arrivalDCount: Double? = null, // 运抵删除计次
var tallySRate: Double? = null, // 出港理货申报费率
var tallySCount: Double? = null, // 出港理货申报计次
var tallyDRate: Double? = null, // 出港理货删除费率
var tallyDCount: Double? = null, // 出港理货删除计次
// 操作信息
var arrivalOpDate: Date? = null, // 运抵操作日期
var arrivalOpId: String? = null, // 运抵操作人ID
var tallyOpDate: Date? = null, // 理货操作日期
var tallyOpId: String? = null, // 理货操作人ID
var declareCount: Long? = null, // 申报次数
var activeId: Long? = null // 活动ID
)
/**
* 库位使用记录
*/
data class GjcStorageUse(
var id: Long? = null, // 主键
var maWbId: Long? = null, // 运单id
var prefix: String? = null, // 运单前缀
var no: String? = null, // 运单号
var storageCode: String? = null, // 库位号
var inDate: Date? = null, // 入库时间
var inId: String? = null, // 入库人
var outDate: Date? = null, // 出库时间
var outId: String? = null // 出库人
)

View File

@@ -0,0 +1,47 @@
package com.lukouguoji.module_base.bean
import java.util.Date
/**
* 国际出港查询参数封装类
* 对应接口:/IntExpSearch/pageQuery
*/
data class GjcMostMouldPage(
// ==================== 分页参数 ====================
var pageNum: Int? = null, // 页号
var pageSize: Int? = null, // 每页显示条数
// ==================== 基础搜索条件 ====================
var fdate: Date? = null, // 航班日期
var fno: String? = null, // 航班号
var agentCode: String? = null, // 代理人code
var outState: Int? = null, // 出库状态0未出库1:已出库)
var wbNo: String? = null, // 运单号11位
var no: String? = null, // 运单号
// ==================== 筛选条件 ====================
var spCode: String? = null, // 特码
var dest: String? = null, // 目的港
var awbType: String? = null, // 运单类型
var businessType: String? = null, // 业务类型
var goodsCn: String? = null, // 品名(中)
// ==================== 其他可选条件 ====================
var beginDate: Date? = null, // 航班开始时间
var endDate: Date? = null, // 航班结束时间
var by1: String? = null, // 承运人
var carId: String? = null, // 板车号
var dest1: String? = null, // 卸货站
var fdest: String? = null, // 目的站
var handoverState: Int? = null, // 交接状态0未交接1:已交接)
var isFclose: Boolean? = null, // 筛选航班是否关闭
var ldId: String? = null, // 组装人
var likeNo: String? = null, // 运单号(模糊查询)
var moveState: Int? = null, // 移库状态
var prefix: String? = null, // 运单号前缀
var uld: String? = null, // uld编号
// 分页辅助字段
var startIndex: Int? = null,
var endIndex: Int? = null
)

View File

@@ -0,0 +1,48 @@
package com.lukouguoji.module_base.bean
import java.util.ArrayList
/**
* 分页响应容器 (适配MyBatis-Plus的PageInfo结构)
* 用于适配接口返回的PageInfo<T>结构
*/
class PageInfo<T> {
// 当前页号
var pageNum: Int = 1
// 每页显示条数
var pageSize: Int = 10
// 数据总量
var total: Long = 0
// 页面总量
var pages: Int = 1
// 数据列表
var list: ArrayList<T>? = null
// 是否有下一页
var hasNextPage: Boolean = false
// 是否有上一页
var hasPreviousPage: Boolean = false
// 是否是第一页
var isFirstPage: Boolean = true
// 是否是最后一页
var isLastPage: Boolean = false
/**
* 转换为项目使用的BaseListBean
* 这是核心方法用于适配项目中的PageModel
*/
fun toBaseListBean(): BaseListBean<T> {
return BaseListBean<T>().apply {
this.pages = this@PageInfo.pages
this.total = this@PageInfo.total.toInt()
this.list = this@PageInfo.list
}
}
}

View File

@@ -35,6 +35,8 @@ import com.lukouguoji.module_base.bean.GjcWaybillDataBean
import com.lukouguoji.module_base.bean.GjcWeighingBean
import com.lukouguoji.module_base.bean.GjcWeighingRecordBean
import com.lukouguoji.module_base.bean.GjcWeighingStatisticsBean
import com.lukouguoji.module_base.bean.GjcMaWb
import com.lukouguoji.module_base.bean.PageInfo
import com.lukouguoji.module_base.bean.GjjGoodsBean
import com.lukouguoji.module_base.bean.GjjGoodsDetailsBean
import com.lukouguoji.module_base.bean.GjjGoodsTypeBean
@@ -417,6 +419,20 @@ interface Api {
@POST("IntExpCheckInCheck/pageQueryTotal")
suspend fun getGjcInspectionTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
/**
* 国际出港查询-分页查询
* 接口路径: /IntExpSearch/pageQuery
*/
@POST("IntExpSearch/pageQuery")
suspend fun getGjcQueryList(@Body data: RequestBody): BaseResultBean<PageInfo<GjcMaWb>>
/**
* 国际出港查询-分页合计统计
* 接口路径: /IntExpSearch/pageQueryTotal
*/
@POST("IntExpSearch/pageQueryTotal")
suspend fun getGjcQueryTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
/**
* 国际出港板箱过磅-分页搜索
* 接口路径: /IntExpWeighting/pageQuery

View File

@@ -0,0 +1,48 @@
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.ActivityGjcQueryBinding
import com.lukouguoji.gjc.viewModel.GjcQueryViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants
/**
* 国际出港查询列表页
*/
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_QUERY_LIST)
class GjcQueryActivity :
BaseBindingActivity<ActivityGjcQueryBinding, GjcQueryViewModel>() {
override fun layoutId() = R.layout.activity_gjc_query
override fun viewModelClass() = GjcQueryViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港查询")
binding.viewModel = viewModel
// 绑定分页逻辑
viewModel.pageModel
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
// 初始化代理列表
viewModel.initAgentList()
// 初始加载
viewModel.refresh()
}
companion object {
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GjcQueryActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -30,7 +30,7 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout
import java.text.SimpleDateFormat
import java.util.*
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_QUERY_LIST)
//@Route(path = ARouterConstants.ACTIVITY_URL_GJC_QUERY_LIST)
class GjcQueryListActivity : BaseActivity(), View.OnClickListener {
private val currentTitleName = "国际出港查询"

View File

@@ -0,0 +1,83 @@
package com.lukouguoji.gjc.dialog
import android.content.Context
import android.view.View
import android.widget.TextView
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.DialogGjcQueryFilterBinding
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lxj.xpopup.XPopup
import dev.utils.app.ScreenUtils
import dev.utils.app.info.KeyValue
/**
* 国际出港查询筛选抽屉
*/
class GjcQueryFilterDialogModel(
val spCode: MutableLiveData<String>, // 特码
val dest: MutableLiveData<String>, // 目的港
val awbType: MutableLiveData<String>, // 运单类型
val businessType: MutableLiveData<String>, // 业务类型
val goodsCn: MutableLiveData<String>, // 品名(中)
private val onConfirm: () -> Unit
) : BaseDialogModel<DialogGjcQueryFilterBinding>(DIALOG_TYPE_DRAWER) {
// 运单类型列表
val awbTypeList = MutableLiveData(
listOf(
KeyValue("全部", ""),
KeyValue("主单", "1"),
KeyValue("分单", "2")
)
)
// 业务类型列表
val businessTypeList = MutableLiveData(
listOf(
KeyValue("全部", ""),
KeyValue("普货", "1"),
KeyValue("特货", "2")
)
)
override fun layoutId() = R.layout.dialog_gjc_query_filter
override fun onBuild(builder: XPopup.Builder) {
super.onBuild(builder)
// 设置抽屉宽度为屏幕宽度的1/3
builder.maxWidth((ScreenUtils.getScreenWidth() / 3.0).toInt())
}
override fun onDialogCreated(context: Context) {
binding.model = this
binding.lifecycleOwner = context as? androidx.lifecycle.LifecycleOwner
// 设置标题
binding.root.findViewById<TextView>(R.id.title_name)?.text = "筛选条件"
// 返回按钮
binding.root.findViewById<View>(R.id.tool_back)?.setOnClickListener {
dismiss()
}
}
/**
* 重置筛选条件
*/
fun onResetClick() {
spCode.value = ""
dest.value = ""
awbType.value = ""
businessType.value = ""
goodsCn.value = ""
}
/**
* 确认筛选
*/
fun onConfirmClick() {
dismiss()
onConfirm()
}
}

View File

@@ -0,0 +1,27 @@
package com.lukouguoji.gjc.holder
import android.view.View
import com.lukouguoji.gjc.databinding.ItemGjcQueryBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjcMaWb
/**
* 国际出港查询列表ViewHolder
*/
class GjcQueryViewHolder(view: View) :
BaseViewHolder<GjcMaWb, ItemGjcQueryBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item)!!
binding.bean = bean
// 立即更新UI避免闪烁
binding.executePendingBindings()
// 整行点击事件(暂时不跳转详情页)
// binding.ll.setOnClickListener {
// // 后续可添加详情页跳转
// // GjcQueryDetailsActivity.start(it.context, bean.maWbId)
// }
}
}

View File

@@ -0,0 +1,186 @@
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.dialog.GjcQueryFilterDialogModel
import com.lukouguoji.gjc.holder.GjcQueryViewHolder
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.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel
import dev.utils.app.info.KeyValue
/**
* 国际出港查询ViewModel
*/
class GjcQueryViewModel : BasePageViewModel() {
// ==================== 搜索条件 ====================
val flightDateStart = MutableLiveData("") // 航班日期起
val flightDateEnd = MutableLiveData("") // 航班日期止
val agentId = MutableLiveData("") // 代理ID
val outStatus = MutableLiveData("") // 出库状态
val waybillNo = MutableLiveData("") // 运单号
// ==================== 下拉列表 ====================
// 代理下拉列表从API获取
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
// 出库状态下拉列表
val outStatusList = MutableLiveData(
listOf(
KeyValue("全部", ""),
KeyValue("未出库", "0"),
KeyValue("已出库", "1")
)
)
// ==================== 适配器配置 ====================
val itemViewHolder = GjcQueryViewHolder::class.java
val itemLayoutId = R.layout.item_gjc_query
// ==================== 统计数据 ====================
val totalCount = MutableLiveData("0") // 合计票数
val totalPc = MutableLiveData("0") // 总件数
val totalWeight = MutableLiveData("0") // 总重量
// ==================== 筛选条件(预留)====================
val spCode = MutableLiveData("") // 特码
val dest = MutableLiveData("") // 目的港
val awbType = MutableLiveData("") // 运单类型
val businessType = MutableLiveData("") // 业务类型
val goodsCn = MutableLiveData("") // 品名(中)
///////////////////////////////////////////////////////////////////////////
// 方法区
///////////////////////////////////////////////////////////////////////////
/**
* 扫码输入运单号
*/
fun waybillScanClick() {
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
}
/**
* 搜索按钮点击
*/
fun searchClick() {
refresh()
}
/**
* 筛选按钮点击
*/
fun filterClick() {
val filterDialog = GjcQueryFilterDialogModel(
spCode = spCode,
dest = dest,
awbType = awbType,
businessType = businessType,
goodsCn = goodsCn,
onConfirm = { refresh() }
)
filterDialog.show()
}
/**
* 获取列表数据
* 核心方法调用API获取数据并转换PageInfo为BaseListBean
*/
override fun getData() {
// 构建查询参数(列表接口)
val listParams = mapOf(
"pageNum" to pageModel.page,
"pageSize" to pageModel.limit,
"fdateStart" to flightDateStart.value!!.ifEmpty { null },
"fdateEnd" to flightDateEnd.value!!.ifEmpty { null },
"agentCode" to agentId.value!!.ifEmpty { null },
"outState" to outStatus.value!!.ifEmpty { null },
"wbNo" to waybillNo.value!!.ifEmpty { null },
// 筛选条件(暂未使用)
"spCode" to spCode.value!!.ifEmpty { null },
"dest" to dest.value!!.ifEmpty { null },
"awbType" to awbType.value!!.ifEmpty { null },
"businessType" to businessType.value!!.ifEmpty { null },
"goodsCn" to goodsCn.value!!.ifEmpty { null }
).toRequestBody()
// 构建查询参数(统计接口 - 使用相同的搜索条件)
val totalParams = mapOf(
"fdateStart" to flightDateStart.value!!.ifEmpty { null },
"fdateEnd" to flightDateEnd.value!!.ifEmpty { null },
"agentCode" to agentId.value!!.ifEmpty { null },
"outState" to outStatus.value!!.ifEmpty { null },
"wbNo" to waybillNo.value!!.ifEmpty { null },
// 筛选条件
"spCode" to spCode.value!!.ifEmpty { null },
"dest" to dest.value!!.ifEmpty { null },
"awbType" to awbType.value!!.ifEmpty { null },
"businessType" to businessType.value!!.ifEmpty { null },
"goodsCn" to goodsCn.value!!.ifEmpty { null }
).toRequestBody()
// 获取列表数据显示loading
launchLoadingCollect({
NetApply.api.getGjcQueryList(listParams)
}) {
onSuccess = { result ->
val pageInfo = result.data
if (pageInfo != null) {
// ⚠️ 核心使用toBaseListBean()转换PageInfo为BaseListBean
pageModel.handleListBean(pageInfo.toBaseListBean())
}
}
}
// 获取统计数据后台调用不显示loading
launchCollect({
NetApply.api.getGjcQueryTotal(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()
}
}
}
/**
* 处理扫码结果
*/
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {
when (requestCode) {
Constant.RequestCode.WAYBILL -> {
waybillNo.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
refresh()
}
}
}
}
/**
* 初始化代理下拉列表从API获取
*/
fun initAgentList() {
launchCollect({
NetApply.api.getIntExpAgentList()
}) {
onSuccess = { result ->
val list = mutableListOf(KeyValue("全部", ""))
result.data?.forEach {
list.add(KeyValue(it.name ?: "", it.code ?: ""))
}
agentList.value = list
}
}
}
}

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
<variable
name="viewModel"
type="com.lukouguoji.gjc.viewModel.GjcQueryViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical">
<!-- 状态栏 -->
<com.lukouguoji.module_base.ui.weight.StatusView
android:layout_width="wrap_content"
android:layout_height="0dp" />
<!-- 标题栏 -->
<include layout="@layout/title_tool_bar" />
<!-- 搜索区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<!-- 航班日期起 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择开始日期"}'
icon="@{@drawable/img_date}"
type="@{SearchLayoutType.DATE}"
value="@={viewModel.flightDateStart}" />
<!-- 航班日期止 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择结束日期"}'
icon="@{@drawable/img_date}"
type="@{SearchLayoutType.DATE}"
value="@={viewModel.flightDateEnd}" />
<!-- 代理人 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择代理"}'
list="@{viewModel.agentList}"
type="@{SearchLayoutType.SPINNER}"
value="@={viewModel.agentId}" />
<!-- 出库状态 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择出库状态"}'
list="@{viewModel.outStatusList}"
type="@{SearchLayoutType.SPINNER}"
value="@={viewModel.outStatus}" />
<!-- 运单号 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入运单号"}'
icon="@{@drawable/img_scan}"
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.waybillNo}" />
<!-- 搜索和筛选按钮 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<!-- 搜索按钮 -->
<ImageView
style="@style/iv_search_action"
android:onClick="@{()-> viewModel.searchClick()}"
android:src="@drawable/img_search" />
<!-- 筛选按钮 -->
<ImageView
style="@style/iv_search_action"
android:onClick="@{()-> viewModel.filterClick()}"
android:src="@drawable/img_filter" />
</LinearLayout>
</LinearLayout>
<!-- 列表区域 -->
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gjc_query" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<!-- 底部统计信息 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<!-- 统计信息 -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{`合计:` + viewModel.totalCount + `票`}'
android:textColor="@color/text_normal"
android:textSize="16sp"
android:textStyle="bold"
tools:text="合计3票" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text='@{`总件数:` + viewModel.totalPc}'
android:textColor="@color/text_normal"
android:textSize="16sp"
android:textStyle="bold"
tools:text="总件数100" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text='@{`总重量:` + viewModel.totalWeight}'
android:textColor="@color/text_normal"
android:textSize="16sp"
android:textStyle="bold"
tools:text="总重量100" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
<variable
name="model"
type="com.lukouguoji.gjc.dialog.GjcQueryFilterDialogModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<!-- 标题栏 -->
<include layout="@layout/title_tool_bar" />
<!-- 筛选条件区域 -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- 特码 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
hint='@{"请输入特码"}'
type="@{SearchLayoutType.INPUT}"
value="@={model.spCode}" />
<!-- 目的港 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
hint='@{"请输入目的港"}'
type="@{SearchLayoutType.INPUT}"
value="@={model.dest}" />
<!-- 运单类型 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
hint='@{"请选择运单类型"}'
list="@{model.awbTypeList}"
type="@{SearchLayoutType.SPINNER}"
value="@={model.awbType}" />
<!-- 业务类型 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
hint='@{"请选择业务类型"}'
list="@{model.businessTypeList}"
type="@{SearchLayoutType.SPINNER}"
value="@={model.businessType}" />
<!-- 品名(中) -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
hint='@{"请输入品名"}'
type="@{SearchLayoutType.INPUT}"
value="@={model.goodsCn}" />
</LinearLayout>
</ScrollView>
<!-- 底部按钮区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="15dp">
<!-- 重置按钮 -->
<TextView
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:background="@drawable/bg_gray_radius_4"
android:gravity="center"
android:onClick="@{()-> model.onResetClick()}"
android:text="重置"
android:textColor="@color/text_normal"
android:textSize="16sp" />
<!-- 确认按钮 -->
<TextView
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:background="@drawable/bg_primary_radius_4"
android:gravity="center"
android:onClick="@{()-> model.onConfirmClick()}"
android:text="确认"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,280 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/apk/res/android">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.GjcMaWb" />
</data>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp"
android:background="@drawable/bg_item"
android:orientation="horizontal"
android:padding="10dp">
<!-- 左侧图标 -->
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@drawable/img_plane" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<!-- 第一行数据:运单号、航班、件数、重量 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- 运单号 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="运单号:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.wbNo}"
android:textColor="@color/colorPrimary"
tools:text="78109081212" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 航班 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="航班:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.flight}"
tools:text="20240513/MU2026" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 件数 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="件数:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{String.valueOf(bean.pc)}'
tools:text="10" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 重量 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="重量:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{String.valueOf(bean.weight)}'
tools:text="200" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 第二行数据:代理人、特码、目的港、运单类型 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<!-- 代理人 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="代理人:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.agentName ?? bean.agentCode}'
tools:text="SF" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 特码 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="特码:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.spCode}"
tools:text="NOR" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 目的港 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="目的港:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.dest}"
tools:text="PEK" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 运单类型 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="运单类型:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.awbName ?? bean.awbType}'
tools:text="国际出港(直航)" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 第三行数据:入库时间、离港时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<!-- 入库时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="入库时间:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.opDate != null ? bean.opDate.toString() : ""}'
tools:text="2024-05-13 17:10:22" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 离港时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="离港时间:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.fclose != null ? bean.fclose.toString() : ""}'
tools:text="2024-05-13 17:10:22" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
<!-- 右侧箭头 -->
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/img_pda_right"
android:layout_marginLeft="10dp" />
</androidx.appcompat.widget.LinearLayoutCompat>
</layout>