init: init proj
This commit is contained in:
33
module_base/src/main/debug/AndroidManifest.xml
Normal file
33
module_base/src/main/debug/AndroidManifest.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.lukouguoji.module_base">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/logot"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/logot"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Aerologic">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- 屏幕适配 -->
|
||||
<meta-data
|
||||
android:name="design_width_in_dp"
|
||||
android:value="1152" />
|
||||
<meta-data
|
||||
android:name="design_height_in_dp"
|
||||
android:value="720" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.lukouguoji.module_base
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
object ActivityCollector {
|
||||
|
||||
private val activities = ArrayList<Activity>()
|
||||
|
||||
fun addActivity(activity: Activity) {
|
||||
activities.add(activity)
|
||||
}
|
||||
|
||||
fun removeActivity(activity: Activity) {
|
||||
activities.remove(activity)
|
||||
}
|
||||
|
||||
fun getLastActivity(): Activity? = if (activities.size > 0) activities[activities.size - 1] else null
|
||||
|
||||
|
||||
fun finishAll() {
|
||||
for (activity in activities) {
|
||||
if (!activity.isFinishing) {
|
||||
activity.finish()
|
||||
}
|
||||
}
|
||||
activities.clear()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
package com.lukouguoji.module_base
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Resources
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.IBinder
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import android.view.MenuItem
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.wega.library.loadingDialog.LoadingDialog
|
||||
import com.yanzhenjie.permission.AndPermission
|
||||
import com.yanzhenjie.permission.runtime.Permission
|
||||
import com.yzq.zxinglibrary.android.CaptureActivity
|
||||
import com.yzq.zxinglibrary.bean.ZxingConfig
|
||||
import com.yzq.zxinglibrary.common.Constant
|
||||
import dev.utils.app.HandlerUtils
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import me.jessyan.autosize.AutoSizeCompat
|
||||
import me.jessyan.autosize.internal.CustomAdapt
|
||||
import java.util.Timer
|
||||
import java.util.TimerTask
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
|
||||
open class BaseActivity : AppCompatActivity(), CoroutineScope {
|
||||
private val job = Job()
|
||||
override val coroutineContext: CoroutineContext
|
||||
get() = Dispatchers.Main + job
|
||||
|
||||
private lateinit var loadingDialog: LoadingDialog
|
||||
|
||||
//加载框超时处理
|
||||
private var timer: Timer? = null
|
||||
private var timerTask: TimerTask? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
setContentView(R.layout.activity_base)
|
||||
Log.d("BaseActivity", javaClass.simpleName)
|
||||
ActivityCollector.addActivity(this)
|
||||
ARouter.getInstance().inject(this); /////////必须要写这行,自动注入解析
|
||||
loadingDialog = LoadingDialog(this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
job.cancel()
|
||||
ActivityCollector.removeActivity(this)
|
||||
loadingDialog.cancel()
|
||||
timer?.cancel()
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置左上角back按钮
|
||||
*/
|
||||
open fun setBackArrow(title: String) {
|
||||
val toolbar: Toolbar = findViewById(R.id.toolbar)
|
||||
setSupportActionBar(toolbar)
|
||||
// 给左上角图标的左边加上一个返回的图标 。对应ActionBar.DISPLAY_HOME_AS_UP
|
||||
supportActionBar!!.setDisplayHomeAsUpEnabled(false)
|
||||
//设置actionBar的标题是否显示,对应ActionBar.DISPLAY_SHOW_TITLE。
|
||||
supportActionBar!!.setDisplayShowTitleEnabled(false)
|
||||
val titleName: TextView = findViewById(R.id.title_name)
|
||||
titleName.text = title
|
||||
val tool_back: View = findViewById(R.id.tool_back)
|
||||
tool_back.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
setResult(RESULT_OK)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 点击左上角的返回按钮,结束本Activity
|
||||
* home就是左上角的小箭头,在toolbar上
|
||||
*
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
if (item.itemId == android.R.id.home) {
|
||||
finish()
|
||||
return true
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
finish()
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码功能
|
||||
*/
|
||||
fun scanCode(requestCode: Int) {
|
||||
AndPermission.with(this)
|
||||
.runtime()
|
||||
.permission(Permission.CAMERA, Permission.READ_EXTERNAL_STORAGE)
|
||||
.onGranted { data: List<String?>? ->
|
||||
val intent = Intent(this, CaptureActivity::class.java)
|
||||
/*ZxingConfig是配置类
|
||||
*可以设置是否显示底部布局,闪光灯,相册,
|
||||
* 是否播放提示音 震动
|
||||
* 设置扫描框颜色等
|
||||
* 也可以不传这个参数
|
||||
* */
|
||||
val config = ZxingConfig()
|
||||
// config.setPlayBeep(false);//是否播放扫描声音 默认为true
|
||||
// config.setShake(false);//是否震动 默认为true
|
||||
// config.setDecodeBarCode(false);//是否扫描条形码 默认为true
|
||||
// config.setReactColor(R.color.colorAccent);//设置扫描框四个角的颜色 默认为白色
|
||||
// config.setFrameLineColor(R.color.colorAccent);//设置扫描框边框颜色 默认无色
|
||||
// config.setScanLineColor(R.color.colorAccent);//设置扫描线的颜色 默认白色
|
||||
config.isFullScreenScan = false //是否全屏扫描 默认为true 设为false则只会在扫描框中扫描
|
||||
intent.putExtra(Constant.INTENT_ZXING_CONFIG, config)
|
||||
startActivityForResult(intent, requestCode)
|
||||
}
|
||||
.onDenied { data: List<String?>? ->
|
||||
val packageURI = Uri.parse("package:$packageName")
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, packageURI)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
startActivity(intent)
|
||||
Toast.makeText(this, "没有权限无法扫描呦", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
.start()
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始加载
|
||||
*/
|
||||
fun loading() {
|
||||
loadingDialog.loading()
|
||||
loadingTimerStart()
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束加载
|
||||
*/
|
||||
fun loadingCancel() {
|
||||
loadingDialog.cancel()
|
||||
loadingTimerStop()
|
||||
}
|
||||
|
||||
/**
|
||||
* loading定时任务启动
|
||||
*/
|
||||
private fun loadingTimerStart() {
|
||||
loadingTimerStop()
|
||||
|
||||
timer = Timer()
|
||||
timerTask = object : TimerTask() {
|
||||
override fun run() {
|
||||
loadingDialog.loadFail()
|
||||
}
|
||||
}
|
||||
timer?.schedule(timerTask, 30 * 1000)//30秒后执行
|
||||
}
|
||||
|
||||
/**
|
||||
* loading定时任务启动
|
||||
*/
|
||||
private fun loadingTimerStop() {
|
||||
timer?.let {
|
||||
it.cancel()
|
||||
it.purge()
|
||||
timer = null
|
||||
}
|
||||
timerTask?.let {
|
||||
it.cancel()
|
||||
timerTask = null
|
||||
}
|
||||
}
|
||||
|
||||
//region 点击隐藏键盘
|
||||
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
||||
if (ev.action == MotionEvent.ACTION_DOWN) {
|
||||
val view = currentFocus
|
||||
if (isHideInput(view, ev)) {
|
||||
HideSoftInput(view!!.windowToken)
|
||||
view.clearFocus()
|
||||
}
|
||||
}
|
||||
return super.dispatchTouchEvent(ev)
|
||||
}
|
||||
|
||||
// 判定是否需要隐藏
|
||||
fun isHideInput(v: View?, ev: MotionEvent): Boolean {
|
||||
if (v != null && v is EditText) {
|
||||
val l = intArrayOf(0, 0)
|
||||
v.getLocationInWindow(l)
|
||||
val left = l[0]
|
||||
val top = l[1]
|
||||
val bottom = top + v.getHeight()
|
||||
val right = (left
|
||||
+ v.getWidth())
|
||||
return !(ev.x > left && ev.x < right && ev.y > top && ev.y < bottom)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 隐藏软键盘
|
||||
fun HideSoftInput(token: IBinder?) {
|
||||
if (token != null) {
|
||||
val manager: InputMethodManager =
|
||||
getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
manager.hideSoftInputFromWindow(token, InputMethodManager.HIDE_NOT_ALWAYS)
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
protected val FONT_NOT_SCALE: Float = 1f
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
if (newConfig.fontScale != FONT_NOT_SCALE) {
|
||||
getResources();
|
||||
}
|
||||
}
|
||||
|
||||
override fun getResources(): Resources? {
|
||||
//规避可能的空指针异常
|
||||
val res: Resources = super.getResources() ?: return null
|
||||
//强制字体大小不随系统改变而改变
|
||||
if (res.configuration.fontScale != FONT_NOT_SCALE) {
|
||||
val newConfig = Configuration()
|
||||
newConfig.setToDefaults()
|
||||
res.updateConfiguration(newConfig, res.displayMetrics)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
createConfigurationContext(newConfig)
|
||||
} else {
|
||||
res.updateConfiguration(newConfig, res.displayMetrics)
|
||||
}
|
||||
}
|
||||
HandlerUtils.postRunnable {
|
||||
if (this is CustomAdapt) {
|
||||
AutoSizeCompat.autoConvertDensity(res, sizeInDp, isBaseOnWidth)
|
||||
} else {
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(res)
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lukouguoji.module_base
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
open class BaseFragment : Fragment() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
|
||||
return inflater.inflate(R.layout.fragment_base, container, false)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
package com.lukouguoji.module_base
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import android.widget.Spinner
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.coroutineScope
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.module_base.adapter.bindAdapter
|
||||
import com.lukouguoji.module_base.adapter.bindOnSelected
|
||||
import com.lukouguoji.module_base.adapter.setEnable
|
||||
import com.lukouguoji.module_base.adapter.setOnFocusChangeListener
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
|
||||
import com.lukouguoji.module_base.interfaces.IOnFocusChangeListener
|
||||
import com.lukouguoji.module_base.interfaces.IOnSpinnerSelected
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.logw
|
||||
import com.lukouguoji.module_base.ktx.setTextAllCaps
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.service.viewModel.LoginViewModel
|
||||
import com.lukouguoji.module_base.update.UpdateDialog
|
||||
import com.lukouguoji.module_base.update.UploadUtil
|
||||
import com.young.security.BCryptPasswordEncoder
|
||||
import dev.utils.app.AppUtils
|
||||
import dev.utils.app.ScreenUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.app.share.SPUtils
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import me.jessyan.autosize.internal.CustomAdapt
|
||||
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_LOGIN)
|
||||
class LoginActivity : BaseActivity(),
|
||||
CustomAdapt {
|
||||
|
||||
private lateinit var user: EditText
|
||||
private lateinit var pass: EditText
|
||||
private lateinit var loginButton: TextView
|
||||
private lateinit var viewModel: LoginViewModel
|
||||
|
||||
private lateinit var tvPda: TextView
|
||||
private lateinit var tvTip: TextView
|
||||
private lateinit var spinner: Spinner
|
||||
private lateinit var spinnerUrl: Spinner
|
||||
private var updateDialog : UpdateDialog?=null
|
||||
|
||||
private fun initView() {
|
||||
user = findViewById(R.id.inputUser)
|
||||
pass = findViewById(R.id.inputPass)
|
||||
loginButton = findViewById(R.id.loginButton)
|
||||
tvPda = findViewById(R.id.tv_pda)
|
||||
tvTip = findViewById(R.id.tv_tip)
|
||||
spinner = findViewById(R.id.spinner)
|
||||
spinnerUrl = findViewById(R.id.spinner_url)
|
||||
|
||||
setTextAllCaps(user, true)
|
||||
|
||||
setOnFocusChangeListener(user, object : IOnFocusChangeListener {
|
||||
override fun onFocusChange(hasFocus: Boolean) {
|
||||
if (!hasFocus) {
|
||||
if (user.text.isNotEmpty()) {
|
||||
viewModel.getUserRole(user.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
viewModel.userRoleBean.observe(this) {
|
||||
loge("获取")
|
||||
if (it == null) {
|
||||
tvTip.visibility = View.VISIBLE
|
||||
return@observe
|
||||
}
|
||||
tvTip.visibility = View.GONE
|
||||
loge("用户角色信息监听 ${it.roleTerm}")
|
||||
|
||||
viewModel.roleTerm = it.roleTerm
|
||||
|
||||
if (it.roleTerm == "0") {
|
||||
bindAdapter(
|
||||
spinner,
|
||||
listOf(KeyValue(it.getUserRoleName(), it.userRole))
|
||||
)
|
||||
setEnable(spinner, false)
|
||||
viewModel.userRole = it.userRole
|
||||
} else {
|
||||
bindAdapter(spinner, viewModel.dictList.value, "请选择角色")
|
||||
setEnable(spinner, true)
|
||||
viewModel.dictList.value?.indexOfFirst { b -> b.value == it.userRole }
|
||||
?.let { index ->
|
||||
spinner.setSelection(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
bindOnSelected(spinner, object : IOnSpinnerSelected {
|
||||
override fun onSelected(position: Int) {
|
||||
if (viewModel.userRoleBean.value?.roleTerm != "0") {
|
||||
viewModel.userRole = viewModel.dictList.value?.getOrNull(position)?.value ?: ""
|
||||
loge("角色选中事件 ${viewModel.userRole}")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
bindAdapter(spinnerUrl, viewModel.urlList)
|
||||
val recordUrl = SharedPreferenceUtil.getString(Constant.Share.ipAddress)
|
||||
if (recordUrl.isNotEmpty()) {
|
||||
val index = viewModel.urlList.indexOfFirst { it.value == recordUrl }
|
||||
if (index >= 0) {
|
||||
spinnerUrl.setSelection(index)
|
||||
}
|
||||
}
|
||||
|
||||
bindOnSelected(spinnerUrl, object : IOnSpinnerSelected {
|
||||
override fun onSelected(position: Int) {
|
||||
viewModel.setBaseUrl(position)
|
||||
checkAppUpdate()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_login)
|
||||
|
||||
checkAppUpdate()
|
||||
|
||||
|
||||
viewModel = ViewModelProvider(this).get(LoginViewModel::class.java)
|
||||
viewModel.onCreated(this)
|
||||
initView()
|
||||
|
||||
viewModel.loginLiveData.observe(this) {
|
||||
if (it == 1) {
|
||||
val screenWidth = ScreenUtils.getScreenWidth()
|
||||
val screenHeight = ScreenUtils.getScreenHeight()
|
||||
// 判断是否是平板
|
||||
// 平板是1280*800 pda是720*1280
|
||||
if (screenWidth.coerceAtLeast(screenHeight).toFloat() / screenWidth.coerceAtMost(
|
||||
screenHeight
|
||||
).toFloat() == 1280f / 800f
|
||||
) {
|
||||
SPUtils.getPreference(this).put(Constant.Share.IS_PDA, false)
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MAIN)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.navigation()
|
||||
} else {
|
||||
SPUtils.getPreference(this).put(Constant.Share.IS_PDA, true)
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_PDA_ENTER)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
} else if (it == 2) {
|
||||
Toast.makeText(this, "用户名密码错误!", Toast.LENGTH_LONG).show()
|
||||
} else {
|
||||
Toast.makeText(this, "网络错误!", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
loginButton.setOnClickListener {
|
||||
// ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MAIN)
|
||||
// .withFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK).navigation()
|
||||
|
||||
val encoder = BCryptPasswordEncoder()
|
||||
val hashPassword = encoder.encode(pass.text.toString())
|
||||
viewModel.login(user.text.toString(), hashPassword)
|
||||
}
|
||||
|
||||
tvPda.setOnClickListener {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_PDA_ENTER)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
bindAdapter(spinner, viewModel.roleList, "请选择角色", R.layout.item_spinner_list_18sp)
|
||||
setEnable(spinner, false)
|
||||
}
|
||||
|
||||
|
||||
private fun checkIsNeedLoginWithToken(){
|
||||
val token = SharedPreferenceUtil.getString(Constant.Share.token)
|
||||
if (token != "") {
|
||||
val isPda = SPUtils.getPreference(this).getBoolean(Constant.Share.IS_PDA, false)
|
||||
logw("自动登录")
|
||||
if (isPda) {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_PDA_ENTER)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.navigation()
|
||||
} else {
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_MAIN)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.navigation()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkAppUpdate(){
|
||||
val uploadUtil = UploadUtil()
|
||||
uploadUtil?.init(this)
|
||||
val versionCode = AppUtils.getAppVersionCode().toInt()
|
||||
lifecycle.coroutineScope.launch(Dispatchers.IO) {
|
||||
logw("checkAppUpdate: versionCode =$versionCode")
|
||||
uploadUtil?.getAppUpdate(versionCode){
|
||||
lifecycle.coroutineScope.launch {
|
||||
if(it==null){
|
||||
checkIsNeedLoginWithToken()
|
||||
}else{
|
||||
updateDialog = UpdateDialog(this@LoginActivity,it, uploadUtil)
|
||||
updateDialog?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
updateDialog?.dismiss()
|
||||
}
|
||||
|
||||
override fun isBaseOnWidth() = true
|
||||
|
||||
override fun getSizeInDp(): Float {
|
||||
return if (ScreenUtils.isPortrait()) {
|
||||
400f
|
||||
} else {
|
||||
1152f
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.lukouguoji.module_base
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.lukouguoji.module_base
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.cretin.www.cretinautoupdatelibrary.model.TypeConfig
|
||||
import com.cretin.www.cretinautoupdatelibrary.model.UpdateConfig
|
||||
import com.cretin.www.cretinautoupdatelibrary.utils.AppUpdateUtils
|
||||
import com.cretin.www.cretinautoupdatelibrary.utils.SSLUtils.TrustAllHostnameVerifier
|
||||
import com.lukouguoji.module_base.handler.MyCrashHandler
|
||||
import com.lukouguoji.module_base.util.OkHttp3Connection
|
||||
import com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
import com.scwang.smart.refresh.header.ClassicsHeader
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
import dev.DevUtils
|
||||
import me.jessyan.autosize.AutoSizeConfig
|
||||
import me.jessyan.autosize.onAdaptListener
|
||||
import okhttp3.OkHttpClient
|
||||
import timber.log.Timber
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
class MyApplication : Application() {
|
||||
|
||||
//ARouter debug开关:true-open;false-close
|
||||
private val isDebugARouter = true
|
||||
|
||||
companion object {
|
||||
lateinit var context: Context
|
||||
fun startLogin() {
|
||||
val intent = Intent(context, LoginActivity::class.java) //LOGIN为注册表里添加
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
context = applicationContext
|
||||
//错误采集
|
||||
Thread.setDefaultUncaughtExceptionHandler(MyCrashHandler())
|
||||
// 1.必须在init之前调用
|
||||
if (isDebugARouter) {
|
||||
// These two lines must be written before init, otherwise these configurations will be invalid in the init process
|
||||
ARouter.openLog(); // Print log
|
||||
ARouter.openDebug(); // Turn on debugging mode (If you are running in InstantRun mode, you must turn on debug mode! Online version needs to be closed, otherwise there is a security risk)
|
||||
}
|
||||
// 2.初始化
|
||||
ARouter.init(this) // As early as possible, it is recommended to initialize in the Application
|
||||
|
||||
// initAppUpdateUtils()
|
||||
|
||||
// 全局设置刷新头尾布局
|
||||
SmartRefreshLayout.setDefaultRefreshHeaderCreator { context, _ ->
|
||||
return@setDefaultRefreshHeaderCreator ClassicsHeader(context)
|
||||
}
|
||||
SmartRefreshLayout.setDefaultRefreshFooterCreator { context, _ ->
|
||||
return@setDefaultRefreshFooterCreator ClassicsFooter(context)
|
||||
}
|
||||
|
||||
Timber.plant(Timber.DebugTree())
|
||||
DevUtils.init(this)
|
||||
initAutoSizeConfig()
|
||||
}
|
||||
|
||||
private fun initAutoSizeConfig(){
|
||||
AutoSizeConfig.getInstance().setOnAdaptListener(object : onAdaptListener {
|
||||
override fun onAdaptBefore(target: Any, activity: Activity) {
|
||||
//使用以下代码, 可以解决横竖屏切换时的屏幕适配问题
|
||||
//首先设置最新的屏幕尺寸,ScreenUtils.getScreenSize(activity) 的参数一定要不要传 Application !!!
|
||||
AutoSizeConfig.getInstance()
|
||||
.setScreenWidth(activity.resources.displayMetrics.widthPixels)
|
||||
AutoSizeConfig.getInstance()
|
||||
.setScreenHeight(activity.resources.displayMetrics.heightPixels)
|
||||
//根据屏幕方向,设置设计尺寸
|
||||
if (activity.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
//设置横屏设计尺寸
|
||||
AutoSizeConfig.getInstance()
|
||||
.setDesignWidthInDp(1152)
|
||||
.setDesignHeightInDp(720)
|
||||
} else {
|
||||
if(activity.javaClass.simpleName.startsWith("PictureSelectorSupporterActivity")){
|
||||
AutoSizeConfig.getInstance()
|
||||
.setDesignWidthInDp(360)
|
||||
.setDesignHeightInDp(480)
|
||||
}else{
|
||||
//设置竖屏设计尺寸
|
||||
AutoSizeConfig.getInstance()
|
||||
.setDesignWidthInDp(720)
|
||||
.setDesignHeightInDp(1280)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAdaptAfter(target: Any, activity: Activity) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化app更新工具
|
||||
*/
|
||||
private fun initAppUpdateUtils() {
|
||||
//如果你想使用okhttp作为下载的载体,那么你需要自己依赖okhttp,更新库不强制依赖okhttp!可以使用如下代码创建一个OkHttpClient 并在UpdateConfig中配置setCustomDownloadConnectionCreator start
|
||||
val builder = OkHttpClient.Builder()
|
||||
builder.connectTimeout(30000, TimeUnit.SECONDS)
|
||||
.readTimeout(30000, TimeUnit.SECONDS)
|
||||
.writeTimeout(30000, TimeUnit.SECONDS) //如果你需要信任所有的证书,可解决根证书不被信任导致无法下载的问题 start
|
||||
.hostnameVerifier(TrustAllHostnameVerifier()) //如果你需要信任所有的证书,可解决根证书不被信任导致无法下载的问题 end
|
||||
.retryOnConnectionFailure(true)
|
||||
//如果你想使用okhttp作为下载的载体,那么你需要自己依赖okhttp,更新库不强制依赖okhttp!可以使用如下代码创建一个OkHttpClient 并在UpdateConfig中配置setCustomDownloadConnectionCreator end
|
||||
|
||||
//更新库配置
|
||||
val updateConfig = UpdateConfig()
|
||||
// .setBaseUrl("")
|
||||
.setDebug(true) //是否是Debug模式
|
||||
.setDataSourceType(TypeConfig.DATA_SOURCE_TYPE_MODEL) //设置获取更新信息的方式
|
||||
.setShowNotification(true)//配置更新的过程中是否在通知栏显示进度
|
||||
.setNotificationIconRes(R.mipmap.ic_launcher)//配置通知栏显示的图标
|
||||
.setShowNotification(true) //配置更新的过程中是否在通知栏显示进度
|
||||
.setUiThemeType(TypeConfig.UI_THEME_L) //配置UI的样式,一种有12种样式可供选择
|
||||
.setRequestHeaders(null) //当dataSourceType为DATA_SOURCE_TYPE_URL时,设置请求的请求头
|
||||
.setRequestParams(null) //当dataSourceType为DATA_SOURCE_TYPE_URL时,设置请求的请求参数
|
||||
.setAutoDownloadBackground(false) //是否需要后台静默下载,如果设置为true,则调用checkUpdate方法之后会直接下载安装,不会弹出更新页面。当你选择UI样式为TypeConfig.UI_THEME_CUSTOM,静默安装失效,您需要在自定义的Activity中自主实现静默下载,使用这种方式的时候建议setShowNotification(false),这样基本上用户就会对下载无感知了
|
||||
.setNeedFileMD5Check(false) //是否需要进行文件的MD5检验,如果开启需要提供文件本身正确的MD5校验码,DEMO中提供了获取文件MD5检验码的工具页面,也提供了加密工具类Md5Utils
|
||||
.setCustomDownloadConnectionCreator(OkHttp3Connection.Creator(builder)) //如果你想使用okhttp作为下载的载体,可以使用如下代码创建一个OkHttpClient,并使用demo中提供的OkHttp3Connection构建一个ConnectionCreator传入,在这里可以配置信任所有的证书,可解决根证书不被信任导致无法下载apk的问题
|
||||
//初始化
|
||||
AppUpdateUtils.init(this, updateConfig)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.lukouguoji.module_base.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.widget.ImageView
|
||||
import androidx.databinding.BindingAdapter
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop
|
||||
import com.bumptech.glide.load.resource.bitmap.GranularRoundedCorners
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.base.CommonAdapter
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.util.SizeUtils
|
||||
|
||||
/**
|
||||
* @author:孟凡华
|
||||
* @date:2022/11/11
|
||||
* @desc:dataBinding适配器
|
||||
*/
|
||||
/**
|
||||
* 加载图片
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
@BindingAdapter(
|
||||
// 图片地址
|
||||
"loadImage",
|
||||
// 错误图片
|
||||
"loadError",
|
||||
// 占位图
|
||||
"loadPlaceholder",
|
||||
// 宽度
|
||||
"loadWidth",
|
||||
// 高度
|
||||
"loadHeight",
|
||||
// 是否缓存
|
||||
"loadCache",
|
||||
// 加载圆形图片
|
||||
"loadCircle",
|
||||
// 圆角
|
||||
"loadRadius",
|
||||
/**
|
||||
* 下述圆角参数优先级高于 loadRadius 和 loadCircle,
|
||||
* 并且设置了单个圆角参数后,就会生效,未设置的参数默认为0
|
||||
*/
|
||||
//左上角圆角
|
||||
"loadRadiusTopLeft",
|
||||
// 右上角圆角
|
||||
"loadRadiusTopRight",
|
||||
// 左下角圆角
|
||||
"loadRadiusBottomLeft",
|
||||
// 右下角圆角
|
||||
"loadRadiusBottomRight",
|
||||
requireAll = false
|
||||
)
|
||||
fun loadImage(
|
||||
imageView: ImageView,
|
||||
source: Any? = null,
|
||||
error: Any? = null,
|
||||
placeholder: Any? = null,
|
||||
width: Int? = 0,
|
||||
height: Int? = 0,
|
||||
cacheEnable: Boolean? = true,
|
||||
circle: Boolean? = false,
|
||||
radius: Any? = null,
|
||||
radiusTopLeft: Any? = null,
|
||||
radiusTopRight: Any? = null,
|
||||
radiusBottomLeft: Any? = null,
|
||||
radiusBottomRight: Any? = null
|
||||
) {
|
||||
// 获取当前的Activity
|
||||
val activity: Activity? = when (imageView.context) {
|
||||
is Activity -> {
|
||||
imageView.context as Activity
|
||||
}
|
||||
|
||||
is Fragment -> {
|
||||
(imageView.context as Fragment).requireActivity()
|
||||
}
|
||||
|
||||
else -> {
|
||||
null
|
||||
}
|
||||
}
|
||||
// 如果当前的Activity已经销毁,就不加载图片
|
||||
if (activity?.isDestroyed != false) {
|
||||
return
|
||||
}
|
||||
// 根据定义的 cacheEnable 参数来决定是否缓存
|
||||
val diskCacheStrategy =
|
||||
if (cacheEnable == true)
|
||||
DiskCacheStrategy.AUTOMATIC else DiskCacheStrategy.NONE
|
||||
// 设置编码格式,在Android 11(R)上面使用高清无损压缩格式 WEBP_LOSSLESS ,
|
||||
// Android 11 以下使用PNG格式,PNG格式时会忽略设置的 quality 参数。
|
||||
val encodeFormat =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
||||
Bitmap.CompressFormat.WEBP_LOSSLESS else Bitmap.CompressFormat.PNG
|
||||
|
||||
// 加载原图
|
||||
val requestOptions = RequestOptions()
|
||||
.override(
|
||||
com.bumptech.glide.request.target.Target.SIZE_ORIGINAL,
|
||||
com.bumptech.glide.request.target.Target.SIZE_ORIGINAL
|
||||
)
|
||||
|
||||
// 设置图片加载
|
||||
val load = Glide.with(imageView)
|
||||
.setDefaultRequestOptions(requestOptions)
|
||||
.load(source)
|
||||
.diskCacheStrategy(diskCacheStrategy)
|
||||
.encodeFormat(encodeFormat)
|
||||
|
||||
// 设置错误图片
|
||||
error?.let {
|
||||
load.error(error)
|
||||
}
|
||||
|
||||
// 设置占位图
|
||||
placeholder?.let {
|
||||
if (it is Drawable) {
|
||||
load.placeholder(it)
|
||||
}
|
||||
if (it is Int) {
|
||||
load.placeholder(it)
|
||||
}
|
||||
}
|
||||
|
||||
// 设置宽高
|
||||
if ((width ?: 0) > 0 && (height ?: 0) > 0)
|
||||
load.override(width!!, height!!)
|
||||
|
||||
// 判定是否设置了四个圆角
|
||||
if (radiusTopLeft != null || radiusTopRight != null || radiusBottomLeft != null || radiusBottomRight != null) {
|
||||
load.transform(
|
||||
CenterCrop(),
|
||||
GranularRoundedCorners(
|
||||
getSize(radiusTopLeft).toFloat(),
|
||||
getSize(radiusTopRight).toFloat(),
|
||||
getSize(radiusBottomRight).toFloat(),
|
||||
getSize(radiusBottomLeft).toFloat(),
|
||||
)
|
||||
)
|
||||
} else if (radius != null) {
|
||||
load.transform(CenterCrop(), RoundedCorners(getSize(radius)))
|
||||
} else if (circle == true) {
|
||||
// 设置圆形图片
|
||||
load.circleCrop()
|
||||
}
|
||||
|
||||
// 设置图片到控件
|
||||
load.into(imageView)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通用adapter
|
||||
*/
|
||||
@BindingAdapter("viewHolder", "itemLayoutId")
|
||||
fun setCommonAdapter(
|
||||
rv: RecyclerView,
|
||||
holderClass: Class<out BaseViewHolder<*, out ViewDataBinding>>,
|
||||
itemLayoutId: Int
|
||||
) {
|
||||
val customAdapter = CommonAdapter(rv.context, itemLayoutId, holderClass)
|
||||
rv.adapter = customAdapter
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取尺寸
|
||||
* 这里只支持dp
|
||||
* [SizeUtils] 是尺寸工具类,可以在代码库中获取
|
||||
*/
|
||||
private fun getSize(size: Any?): Int {
|
||||
return try {
|
||||
SizeUtils.dp2px(size.toString().toFloat())
|
||||
} catch (e: Exception) {
|
||||
0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.lukouguoji.module_base.adapter
|
||||
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.view.View
|
||||
import androidx.databinding.BindingAdapter
|
||||
import com.lukouguoji.module_base.util.ShapeUtils
|
||||
import com.lukouguoji.module_base.util.SizeUtils
|
||||
|
||||
/**
|
||||
* @author:孟凡华
|
||||
* @date:2022/12/13
|
||||
* @desc:shape工具类
|
||||
* 用于在布局文件中,快捷设置:背景色、圆角、边框、虚线
|
||||
*/
|
||||
|
||||
/**
|
||||
* 设置shape
|
||||
*/
|
||||
@BindingAdapter(
|
||||
// 圆角(dp)
|
||||
"shape_radius",
|
||||
// 背景色 (支持ID/颜色值字符串)
|
||||
// 设置渐变色后,背景色无效
|
||||
"shape_bg_color",
|
||||
// 边框宽度
|
||||
"shape_border_width",
|
||||
// 边框颜色 (支持ID/颜色值字符串)
|
||||
"shape_border_color",
|
||||
// 虚线宽度
|
||||
"shape_dash_width",
|
||||
// 虚线空格宽度
|
||||
"shape_dash_gap",
|
||||
// 渐变开始颜色 (支持ID/颜色值字符串)
|
||||
"shape_gradient_start_color",
|
||||
// 渐变结束颜色 (支持ID/颜色值字符串)
|
||||
"shape_gradient_end_color",
|
||||
/**
|
||||
* 渐变方向
|
||||
* 0: 左->右
|
||||
* 90: 下->上
|
||||
* 只能为45的倍数
|
||||
* 默认 270
|
||||
*/
|
||||
"shape_gradient_angle",
|
||||
requireAll = false
|
||||
)
|
||||
fun setShape(
|
||||
view: View,
|
||||
radius: Any? = null,
|
||||
bgColor: Any? = null,
|
||||
borderWidth: Any? = null,
|
||||
borderColor: Any? = null,
|
||||
dashWidth: Any? = null,
|
||||
dashGap: Any? = null,
|
||||
gradientStartColor: Any? = null,
|
||||
gradientEndColor: Any? = null,
|
||||
gradientAngle: Int? = null
|
||||
) {
|
||||
val shapeUtils = createShapeUtils(view)
|
||||
//圆角
|
||||
radius?.let {
|
||||
shapeUtils.setCornerRadius(getSize(it).toFloat())
|
||||
}
|
||||
//背景色
|
||||
bgColor?.let {
|
||||
shapeUtils.setColor(getColor(it))
|
||||
}
|
||||
//边框
|
||||
borderWidth?.let {
|
||||
borderColor?.let { color ->
|
||||
//虚线信息为空,则为实线
|
||||
if (dashWidth == null || dashGap == null) {
|
||||
shapeUtils.setStroke(getSize(it), getColor(color))
|
||||
} else {
|
||||
shapeUtils.setStroke(
|
||||
getSize(it),
|
||||
getColor(color),
|
||||
getSize(dashWidth).toFloat(),
|
||||
getSize(dashGap).toFloat()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
//渐变
|
||||
gradientStartColor?.let { startColor ->
|
||||
gradientEndColor?.let { endColor ->
|
||||
shapeUtils.setColors(intArrayOf(getColor(startColor), getColor(endColor)))
|
||||
}
|
||||
}
|
||||
//渐变角度
|
||||
gradientAngle?.let { angle ->
|
||||
shapeUtils.setOrientation(angle)
|
||||
}
|
||||
shapeUtils.setDrawable(view)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置圆角
|
||||
* 这里只设置圆角,不设置背景色,边框等
|
||||
* 并且,不可以与上面方法中的"shape_radius"同时使用
|
||||
*
|
||||
* 根据设置逻辑,left,right,top,bottom四个会相互冲突,只能设置其中一个,并且只生效最后一个(是代码处理逻辑的最后一个,不是xml中的最后一个)
|
||||
*
|
||||
* 如果设置了top_left,top_right,bottom_left,bottom_right,则会忽略left,right,top,bottom
|
||||
*
|
||||
* top_left,top_right,bottom_left,bottom_right 设置某一个,都判定为设置了四个,其余未设置的,默认为0
|
||||
*/
|
||||
@BindingAdapter(
|
||||
// 左侧圆角
|
||||
"shape_radius_left",
|
||||
// 上侧圆角
|
||||
"shape_radius_top",
|
||||
// 右侧圆角
|
||||
"shape_radius_right",
|
||||
// 下侧圆角
|
||||
"shape_radius_bottom",
|
||||
// 左上圆角
|
||||
"shape_radius_top_left",
|
||||
// 右上圆角
|
||||
"shape_radius_top_right",
|
||||
// 左下圆角
|
||||
"shape_radius_bottom_left",
|
||||
// 右下圆角
|
||||
"shape_radius_bottom_right",
|
||||
requireAll = false
|
||||
)
|
||||
fun setShapeRadius(
|
||||
view: View,
|
||||
radiusLeft: Any? = null,
|
||||
radiusTop: Any? = null,
|
||||
radiusRight: Any? = null,
|
||||
radiusBottom: Any? = null,
|
||||
radiusTopLeft: Any? = null,
|
||||
radiusTopRight: Any? = null,
|
||||
radiusBottomLeft: Any? = null,
|
||||
radiusBottomRight: Any? = null
|
||||
) {
|
||||
val shapeUtils = createShapeUtils(view)
|
||||
// 判定是否设置了四个圆角
|
||||
if (radiusTopLeft != null || radiusTopRight != null || radiusBottomLeft != null || radiusBottomRight != null) {
|
||||
shapeUtils.setCornerRadius(
|
||||
getSize(radiusTopLeft).toFloat(),
|
||||
getSize(radiusTopRight).toFloat(),
|
||||
getSize(radiusBottomRight).toFloat(),
|
||||
getSize(radiusBottomLeft).toFloat(),
|
||||
)
|
||||
} else {
|
||||
// 判定是否设置了左侧圆角
|
||||
if (radiusLeft != null) {
|
||||
shapeUtils.setCornerRadiusLeft(getSize(radiusLeft).toFloat())
|
||||
}
|
||||
// 判定是否设置了上侧圆角
|
||||
if (radiusTop != null) {
|
||||
shapeUtils.setCornerRadiusTop(getSize(radiusTop).toFloat())
|
||||
}
|
||||
// 判定是否设置了右侧圆角
|
||||
if (radiusRight != null) {
|
||||
shapeUtils.setCornerRadiusRight(getSize(radiusRight).toFloat())
|
||||
}
|
||||
// 判定是否设置了下侧圆角
|
||||
if (radiusBottom != null) {
|
||||
shapeUtils.setCornerRadiusBottom(getSize(radiusBottom).toFloat())
|
||||
}
|
||||
}
|
||||
shapeUtils.setDrawable(view)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建shape工具
|
||||
* [ShapeUtils] 是Shape工具类,可以在代码库中获取
|
||||
*/
|
||||
private fun createShapeUtils(view: View): ShapeUtils {
|
||||
return if (view.background is GradientDrawable) {
|
||||
ShapeUtils.newShape(view.background as GradientDrawable)
|
||||
} else {
|
||||
ShapeUtils.newShape()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取颜色
|
||||
*/
|
||||
private fun getColor(color: Any): Int {
|
||||
return if (color is Int) {
|
||||
color
|
||||
} else {
|
||||
Color.parseColor(color.toString())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取尺寸
|
||||
* 这里只支持dp
|
||||
* [SizeUtils] 是尺寸工具类,可以在代码库中获取
|
||||
*/
|
||||
private fun getSize(size: Any?): Int {
|
||||
return try {
|
||||
SizeUtils.dp2px(size.toString().toFloat())
|
||||
} catch (e: Exception) {
|
||||
0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.lukouguoji.module_base.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Spinner
|
||||
import android.widget.TextView
|
||||
import androidx.databinding.BindingAdapter
|
||||
import com.lukouguoji.module_base.R
|
||||
import com.lukouguoji.module_base.interfaces.IOnSpinnerSelected
|
||||
import dev.utils.app.info.KeyValue
|
||||
import dev.utils.common.ReflectUtils
|
||||
|
||||
class SpinnerHintAdapter<T>(context: Context, resource: Int, objects: List<T>) :
|
||||
ArrayAdapter<T>(context, resource, objects) {
|
||||
|
||||
override fun getCount(): Int {
|
||||
val count = super.getCount()
|
||||
return if (count == 0) 0 else count - 1
|
||||
}
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
val view = super.getView(position, convertView, parent)
|
||||
(view as TextView).setTextColor(
|
||||
if (position == count) {
|
||||
context.resources.getColor(R.color.text_gray_l)
|
||||
} else {
|
||||
context.resources.getColor(R.color.text_normal)
|
||||
}
|
||||
)
|
||||
return view
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("items", "hint", "itemId", requireAll = false)
|
||||
fun bindAdapter(
|
||||
spinner: Spinner,
|
||||
items: List<KeyValue>?,
|
||||
hint: String? = null,
|
||||
itemId: Int? = null
|
||||
) {
|
||||
val layoutId = itemId ?: R.layout.item_spinner_list
|
||||
if (items == null && hint.isNullOrEmpty()) {
|
||||
return
|
||||
}
|
||||
val list = items?.map { it.key } ?: listOf()
|
||||
if (hint.isNullOrEmpty()) {
|
||||
val adapter = ArrayAdapter(spinner.context, layoutId, list)
|
||||
spinner.adapter = adapter
|
||||
} else {
|
||||
val containHintList = list + hint
|
||||
val adapter = SpinnerHintAdapter(spinner.context, layoutId, containHintList)
|
||||
spinner.adapter = adapter
|
||||
spinner.setSelection(list.size)
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("setEnable")
|
||||
fun setEnable(view: View, enabled: Boolean) {
|
||||
view.isEnabled = enabled
|
||||
}
|
||||
|
||||
@BindingAdapter("selectedItem")
|
||||
fun setSelectedItem(spinner: Spinner, item: String) {
|
||||
spinner.adapter?.let {
|
||||
val list = ReflectUtils.reflect(it).field("mObjects").get() as List<String>
|
||||
val index = list.indexOf(item)
|
||||
if (index >= 0) {
|
||||
spinner.setSelection(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("onSelected")
|
||||
fun bindOnSelected(spinner: Spinner, selectedListener: IOnSpinnerSelected) {
|
||||
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(
|
||||
parent: AdapterView<*>?,
|
||||
view: View?,
|
||||
position: Int,
|
||||
id: Long
|
||||
) {
|
||||
selectedListener.onSelected(position)
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.lukouguoji.module_base.adapter
|
||||
|
||||
import android.view.Gravity
|
||||
import android.widget.TextView
|
||||
import androidx.databinding.BindingAdapter
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import dev.utils.app.ViewUtils
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
// "\u3000"
|
||||
private const val FullSpace = "\u3000"
|
||||
private const val HalfSpace = "\u0020"
|
||||
private const val QuarterSpace = "\u202F"
|
||||
|
||||
@BindingAdapter("completeSpace", "isFill", requireAll = false)
|
||||
fun completeSpace(tv: TextView, count: Int, isFill: Boolean = true) {
|
||||
val s = StringBuilder()
|
||||
(1..count).forEach { _ ->
|
||||
s.append("一")
|
||||
}
|
||||
val measureText = tv.paint.measureText(s.toString())
|
||||
ViewUtils.setWidth(tv, measureText.roundToInt())
|
||||
|
||||
if (isFill) {
|
||||
val text = tv.text.toString()
|
||||
val length = text.length
|
||||
|
||||
if (length in 2 until count) {
|
||||
val sb = StringBuilder()
|
||||
// 计算需要补充的空格数量
|
||||
val cs = (count - text.length)
|
||||
// 无法被整除,则添加在最后
|
||||
val zc = (cs * 4) % (length - 1)
|
||||
if (zc != 0) {
|
||||
sb.append(text)
|
||||
for (i in 0 until cs) {
|
||||
sb.append(FullSpace)
|
||||
}
|
||||
} else {
|
||||
val spaceValue = (cs * 4) / (length - 1)
|
||||
when (spaceValue) {
|
||||
4 -> {
|
||||
text.forEachIndexed { index, c ->
|
||||
if (index > 0) {
|
||||
sb.append(FullSpace)
|
||||
}
|
||||
sb.append(c)
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
if (spaceValue > 4 && spaceValue % 4 == 0) {
|
||||
val spaceCount = spaceValue / 4
|
||||
text.forEachIndexed { index, c ->
|
||||
if (index > 0) {
|
||||
for (i in 0 until spaceCount) {
|
||||
sb.append(FullSpace)
|
||||
}
|
||||
}
|
||||
sb.append(c)
|
||||
}
|
||||
} else {
|
||||
sb.append(text)
|
||||
for (i in 0 until cs) {
|
||||
sb.append(FullSpace)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tv.text = sb
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("completeLetterSpace")
|
||||
fun completeLetterSpace(tv: TextView, count: Int) {
|
||||
val s = StringBuilder()
|
||||
(1..count).forEach { _ ->
|
||||
s.append("A")
|
||||
}
|
||||
val measureText = tv.paint.measureText(s.toString())
|
||||
ViewUtils.setWidth(tv, measureText.roundToInt())
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.lukouguoji.module_base.adapter
|
||||
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import androidx.databinding.BindingAdapter
|
||||
import com.lukouguoji.module_base.interfaces.IOnFocusChangeListener
|
||||
|
||||
@BindingAdapter("visible")
|
||||
fun visible(view: View, visible: Any?) {
|
||||
if (visible == null) {
|
||||
view.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
when (visible) {
|
||||
is Boolean ->
|
||||
view.visibility = if (visible) View.VISIBLE else View.GONE
|
||||
|
||||
is Int ->
|
||||
view.visibility = if (visible == 0) View.GONE else View.VISIBLE
|
||||
|
||||
is String ->
|
||||
view.visibility = if (visible.isEmpty()) View.GONE else View.VISIBLE
|
||||
|
||||
else -> {
|
||||
view.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("setFocusChangedListener")
|
||||
fun setOnFocusChangeListener(et: EditText, listener: IOnFocusChangeListener) {
|
||||
et.onFocusChangeListener = View.OnFocusChangeListener { v, hasFocus ->
|
||||
listener.onFocusChange(hasFocus)
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("setFocusLoseListener")
|
||||
fun setOnFocusLoseListener(et: EditText, listener: () -> Unit) {
|
||||
et.setOnFocusChangeListener { v, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
listener.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
abstract class BaseBindingActivity<T : ViewDataBinding, VM : ViewModel> : BaseActivity() {
|
||||
|
||||
//视图绑定器
|
||||
protected var binding: T by Delegates.notNull()
|
||||
|
||||
//ViewModel
|
||||
protected val viewModel: VM by lazy {
|
||||
ViewModelProvider(this).get(viewModelClass())
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
//dataBinding初始化
|
||||
binding = DataBindingUtil.setContentView(this, layoutId())
|
||||
binding.lifecycleOwner = this
|
||||
|
||||
initOnCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (viewModel is BaseViewModel) {
|
||||
(viewModel as BaseViewModel).onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 布局ID
|
||||
*/
|
||||
abstract fun layoutId(): Int
|
||||
|
||||
/**
|
||||
* ViewModel类
|
||||
*/
|
||||
abstract fun viewModelClass(): Class<VM>
|
||||
|
||||
/**
|
||||
* 初始化Activity内容
|
||||
*/
|
||||
abstract fun initOnCreate(savedInstanceState: Bundle?)
|
||||
|
||||
fun requireActivity() = this
|
||||
fun requireContext() = this
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.get
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
abstract class BaseBindingFragment<T : ViewDataBinding, VM : ViewModel> : Fragment() {
|
||||
|
||||
protected var binding: T by Delegates.notNull()
|
||||
|
||||
protected val viewModel: VM by lazy {
|
||||
ViewModelProvider(this).get(viewModelClass())
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
binding = DataBindingUtil.inflate(inflater, layoutId(), container, false)
|
||||
|
||||
binding.lifecycleOwner = this
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initOnViewCreated()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fragment布局ID
|
||||
*/
|
||||
abstract fun layoutId(): Int
|
||||
|
||||
/**
|
||||
* ViewModel类
|
||||
*/
|
||||
abstract fun viewModelClass(): Class<VM>
|
||||
|
||||
/**
|
||||
* 初始化Fragment内容
|
||||
*/
|
||||
abstract fun initOnViewCreated()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import com.lukouguoji.module_base.interfaces.IGetData
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lxj.xpopup.XPopup
|
||||
import com.lxj.xpopup.core.AttachPopupView
|
||||
import com.lxj.xpopup.core.BasePopupView
|
||||
import com.lxj.xpopup.core.BottomPopupView
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import com.lxj.xpopup.core.DrawerPopupView
|
||||
import com.lxj.xpopup.core.FullScreenDialog
|
||||
import com.lxj.xpopup.impl.FullScreenPopupView
|
||||
import dev.DevUtils
|
||||
import dev.utils.common.ReflectUtils
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
/**
|
||||
* @author:孟凡华
|
||||
* @date:2022/8/24
|
||||
* @desc:
|
||||
*/
|
||||
abstract class BaseDialogModel<T : ViewDataBinding>(
|
||||
private val dialogType: Int = DIALOG_TYPE_BOTTOM,
|
||||
) : IGetData {
|
||||
|
||||
//布局
|
||||
protected var binding: T by Delegates.notNull()
|
||||
|
||||
//弹窗
|
||||
protected var dialog: BasePopupView? = null
|
||||
|
||||
//消失监听
|
||||
private var dismissListener: DialogInterface.OnDismissListener? = null
|
||||
|
||||
/**
|
||||
* 设置关闭监听
|
||||
*/
|
||||
fun setOnDismissListener(listener: DialogInterface.OnDismissListener) {
|
||||
dismissListener = listener
|
||||
}
|
||||
|
||||
//展示弹窗
|
||||
open fun show(context: Context = DevUtils.getTopActivity()) {
|
||||
if (dialog == null) {
|
||||
createDialog(context)
|
||||
}
|
||||
getData()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据并展示弹窗
|
||||
* 弹窗系统在布局高度需要延时请求的数据填充确定时,会出现高度异常的情况
|
||||
* 该方法旨在开发者在延时请求的数据获取到后,再自己处理弹窗的展示逻辑,可以有效避免高度异常的问题
|
||||
* 如果高度固定,则不需要处理
|
||||
*/
|
||||
override fun getData() {
|
||||
dialog?.show()
|
||||
}
|
||||
|
||||
//关闭弹窗
|
||||
open fun dismiss() {
|
||||
dialog?.dismiss()
|
||||
}
|
||||
|
||||
/**
|
||||
* 当弹窗关闭处理
|
||||
*/
|
||||
open fun onDismiss(d: DialogInterface?) {
|
||||
dismissListener?.onDismiss(d)
|
||||
}
|
||||
|
||||
//创建弹窗
|
||||
private fun createDialog(context: Context) {
|
||||
// 创建弹窗View
|
||||
val basePopupView = when (dialogType) {
|
||||
// 底部弹窗
|
||||
DIALOG_TYPE_BOTTOM -> {
|
||||
createBottomPopupView(context)
|
||||
}
|
||||
// 中间弹窗
|
||||
DIALOG_TYPE_CENTER -> {
|
||||
createCenterPopupView(context)
|
||||
}
|
||||
// 抽屉弹窗
|
||||
DIALOG_TYPE_DRAWER -> {
|
||||
createDrawerPopupView(context)
|
||||
}
|
||||
// 绑定弹窗
|
||||
DIALOG_TYPE_ATTACH -> {
|
||||
createAttachPopupView(context)
|
||||
}
|
||||
// 全屏
|
||||
DIALOG_TYPE_FULL -> {
|
||||
createFullPopupView(context)
|
||||
}
|
||||
// 其他(默认底部弹窗)
|
||||
else -> {
|
||||
createBottomPopupView(context)
|
||||
}
|
||||
}
|
||||
|
||||
// 构建弹窗
|
||||
val builder = XPopup.Builder(context)
|
||||
// 构建中
|
||||
onBuild(builder)
|
||||
// 创建弹窗
|
||||
dialog = builder.asCustom(basePopupView)
|
||||
|
||||
// 弹窗创建完成
|
||||
onDialogCreated(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建中间弹窗视图
|
||||
*/
|
||||
private fun createCenterPopupView(context: Context): BasePopupView {
|
||||
val basePop = object : CenterPopupView(context) {
|
||||
override fun addInnerContent() {
|
||||
binding = DataBindingUtil.inflate<T>(
|
||||
LayoutInflater.from(context),
|
||||
layoutId(),
|
||||
centerPopupContainer,
|
||||
false
|
||||
)
|
||||
binding.lifecycleOwner = context.getLifecycleOwner()
|
||||
contentView = binding.root
|
||||
val params = contentView.layoutParams as LayoutParams
|
||||
params.gravity = Gravity.CENTER
|
||||
centerPopupContainer.addView(contentView, params)
|
||||
}
|
||||
|
||||
override fun getImplLayoutId(): Int {
|
||||
return layoutId()
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
this@BaseDialogModel.onDismiss(null)
|
||||
}
|
||||
}
|
||||
ReflectUtils.reflect(basePop)
|
||||
.method("addInnerContent")
|
||||
|
||||
return basePop
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建底部弹窗视图
|
||||
*/
|
||||
private fun createBottomPopupView(context: Context): BasePopupView {
|
||||
val basePop: BottomPopupView = object : BottomPopupView(context) {
|
||||
override fun addInnerContent() {
|
||||
binding = DataBindingUtil.inflate<T>(
|
||||
LayoutInflater.from(context),
|
||||
layoutId(),
|
||||
bottomPopupContainer,
|
||||
false
|
||||
)
|
||||
binding.lifecycleOwner = context.getLifecycleOwner()
|
||||
bottomPopupContainer.addView(binding.root)
|
||||
}
|
||||
|
||||
override fun getImplLayoutId(): Int {
|
||||
return layoutId()
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
this@BaseDialogModel.onDismiss(null)
|
||||
}
|
||||
}
|
||||
ReflectUtils.reflect(basePop)
|
||||
.method("addInnerContent")
|
||||
return basePop
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建drawer
|
||||
*/
|
||||
private fun createDrawerPopupView(context: Context): BasePopupView {
|
||||
val basePop = object : DrawerPopupView(context) {
|
||||
override fun addInnerContent() {
|
||||
binding = DataBindingUtil.inflate<T>(
|
||||
LayoutInflater.from(context),
|
||||
layoutId(),
|
||||
drawerContentContainer,
|
||||
false
|
||||
)
|
||||
binding.lifecycleOwner = context.getLifecycleOwner()
|
||||
drawerContentContainer.addView(binding.root)
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = layoutId()
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
this@BaseDialogModel.onDismiss(null)
|
||||
}
|
||||
}
|
||||
ReflectUtils.reflect(basePop)
|
||||
.method("addInnerContent")
|
||||
|
||||
return basePop
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建Attach
|
||||
*/
|
||||
private fun createAttachPopupView(context: Context): BasePopupView {
|
||||
val basePop = object : AttachPopupView(context) {
|
||||
override fun addInnerContent() {
|
||||
binding = DataBindingUtil.inflate<T>(
|
||||
LayoutInflater.from(context),
|
||||
layoutId(),
|
||||
attachPopupContainer,
|
||||
false
|
||||
)
|
||||
binding.lifecycleOwner = context.getLifecycleOwner()
|
||||
attachPopupContainer.addView(binding.root)
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = layoutId()
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
this@BaseDialogModel.onDismiss(null)
|
||||
}
|
||||
}
|
||||
ReflectUtils.reflect(basePop)
|
||||
.method("addInnerContent")
|
||||
|
||||
return basePop
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建Attach
|
||||
*/
|
||||
private fun createFullPopupView(context: Context): BasePopupView {
|
||||
val basePop = object : FullScreenPopupView(context) {
|
||||
override fun addInnerContent() {
|
||||
binding = DataBindingUtil.inflate<T>(
|
||||
LayoutInflater.from(context),
|
||||
layoutId(),
|
||||
fullPopupContainer,
|
||||
false
|
||||
)
|
||||
binding.lifecycleOwner = context.getLifecycleOwner()
|
||||
fullPopupContainer.addView(binding.root)
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = layoutId()
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
this@BaseDialogModel.onDismiss(null)
|
||||
}
|
||||
}
|
||||
ReflectUtils.reflect(basePop)
|
||||
.method("addInnerContent")
|
||||
|
||||
return basePop
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建时处理
|
||||
*/
|
||||
open fun onBuild(builder: XPopup.Builder) {
|
||||
}
|
||||
|
||||
//弹窗布局ID
|
||||
abstract fun layoutId(): Int
|
||||
|
||||
//dialog创建后
|
||||
abstract fun onDialogCreated(context: Context)
|
||||
|
||||
/**
|
||||
* 是否展示中
|
||||
*/
|
||||
fun isShowing() = dialog?.isShow ?: false
|
||||
|
||||
fun release() {
|
||||
dismiss()
|
||||
dialog = null
|
||||
dismissListener = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
//底部弹窗
|
||||
const val DIALOG_TYPE_BOTTOM = 0
|
||||
|
||||
//居中弹窗
|
||||
const val DIALOG_TYPE_CENTER = 1
|
||||
|
||||
//抽屉 弹窗
|
||||
const val DIALOG_TYPE_DRAWER = 2
|
||||
|
||||
//attach弹窗
|
||||
const val DIALOG_TYPE_ATTACH = 3
|
||||
|
||||
//全屏
|
||||
const val DIALOG_TYPE_FULL = 4
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.lukouguoji.module_base.interfaces.IGetData
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import com.lukouguoji.module_base.model.PageModel
|
||||
|
||||
abstract class BasePageViewModel : BaseViewModel(), IGetData,IOnItemClickListener {
|
||||
|
||||
|
||||
val pageModel = PageModel()
|
||||
|
||||
fun refresh() {
|
||||
pageModel.refresh()
|
||||
getData()
|
||||
}
|
||||
|
||||
fun loadMore() {
|
||||
pageModel.loadMore()
|
||||
getData()
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
abstract class BaseViewHolder<T, B : ViewDataBinding>(itemView: View) :
|
||||
RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
//数据视图绑定器
|
||||
var binding: B by Delegates.notNull()
|
||||
|
||||
// 点击事件
|
||||
var clickListener: IOnItemClickListener? = null
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
open fun initOnCreate() {
|
||||
binding = DataBindingUtil.bind(itemView)!!
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定数据
|
||||
*/
|
||||
abstract fun onBind(item: Any?, position: Int)
|
||||
|
||||
fun getItemBean(item: Any?): T? {
|
||||
return try {
|
||||
item as T
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取RecyclerView
|
||||
*/
|
||||
fun getRecyclerView(): RecyclerView? {
|
||||
var v: View = itemView
|
||||
var rv: RecyclerView? = null
|
||||
while (rv == null && v.parent != null) {
|
||||
val parent = v.parent as ViewGroup
|
||||
if (parent is RecyclerView) {
|
||||
rv = parent
|
||||
}
|
||||
v = parent
|
||||
}
|
||||
return rv
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上下文对象
|
||||
*/
|
||||
fun requireContext(): Context = itemView.context
|
||||
|
||||
/**
|
||||
* 通知条目点击事件
|
||||
*/
|
||||
fun notifyItemClick(position: Int, view: View) {
|
||||
view.setOnClickListener {
|
||||
clickListener?.onItemClick(bindingAdapterPosition, view.id)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.lukouguoji.module_base.interfaces.ILoading
|
||||
import com.lukouguoji.module_base.model.LoadingModel
|
||||
import dev.DevUtils
|
||||
|
||||
abstract class BaseViewModel : ViewModel(), ILoading {
|
||||
|
||||
//加载弹窗
|
||||
protected var loadingModel: LoadingModel? = null
|
||||
|
||||
open fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示加载弹窗
|
||||
*/
|
||||
override fun showLoading() {
|
||||
if (loadingModel == null) {
|
||||
createLoading(getTopActivity())
|
||||
}
|
||||
loadingModel?.showLoading()
|
||||
}
|
||||
|
||||
override fun dismissLoading() {
|
||||
loadingModel?.dismissLoading()
|
||||
}
|
||||
|
||||
fun getTopActivity() = DevUtils.getTopActivity()
|
||||
|
||||
fun createLoading(context: Context = DevUtils.getTopActivity()) {
|
||||
loadingModel = LoadingModel(context)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class CommonAdapter(
|
||||
val context: Context,
|
||||
private val layoutId: Int,
|
||||
private val viewHolderClass: Class<out BaseViewHolder<*, out ViewDataBinding>>
|
||||
) : RecyclerView.Adapter<BaseViewHolder<*, out ViewDataBinding>>(), IOnItemClickListener {
|
||||
|
||||
private var inflater: LayoutInflater by Delegates.notNull()
|
||||
|
||||
// 列表数据
|
||||
var items: ArrayList<Any> = arrayListOf()
|
||||
|
||||
init {
|
||||
inflater = LayoutInflater.from(context)
|
||||
}
|
||||
|
||||
//条目点击监听列表
|
||||
private val _itemClickListenerList = arrayListOf<IOnItemClickListener>()
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*/
|
||||
fun refresh(list: List<out Any>?) {
|
||||
items.clear()
|
||||
items.addAll(list ?: emptyList())
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
fun loadMore(list: List<out Any>?) {
|
||||
list?.let {
|
||||
val size = items.size
|
||||
items.addAll(list)
|
||||
notifyItemRangeInserted(size, list.size)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
fun addItem(item: Any?) {
|
||||
item?.let {
|
||||
items.add(item)
|
||||
notifyItemInserted(items.size - 1)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
fun removeItem(position: Int) {
|
||||
if (items.size > position) {
|
||||
items.removeAt(position)
|
||||
notifyItemRemoved(position)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = items.size
|
||||
|
||||
/**
|
||||
* 获取列表数据
|
||||
*/
|
||||
fun getItem(position: Int) = if (items.size > position) items[position] else null
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): BaseViewHolder<*, out ViewDataBinding> {
|
||||
val inflate = inflater.inflate(layoutId, parent, false)
|
||||
val holder = viewHolderClass.getConstructor(View::class.java).newInstance(inflate)
|
||||
holder.initOnCreate()
|
||||
holder.clickListener = this
|
||||
return holder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: BaseViewHolder<*, out ViewDataBinding>, position: Int) {
|
||||
holder.onBind(getItem(position), position)
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加点击事件监听
|
||||
*/
|
||||
fun addOnItemClickListener(listener: IOnItemClickListener) {
|
||||
_itemClickListenerList.add(listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除点击事件监听
|
||||
*/
|
||||
fun removeOnItemClickListener(listener: IOnItemClickListener) {
|
||||
_itemClickListenerList.remove(listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* 条目点击事件触发
|
||||
*/
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
_itemClickListenerList.forEach { it.onItemClick(position, type) }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lukouguoji.module_base.base
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
|
||||
/**
|
||||
* @author:孟凡华
|
||||
* @date:2021/12/7 23:57
|
||||
*/
|
||||
class CustomVP2Adapter(
|
||||
val data: List<Fragment>,
|
||||
fragmentManager: FragmentManager,
|
||||
lifecycle: Lifecycle
|
||||
) :
|
||||
FragmentStateAdapter(fragmentManager, lifecycle) {
|
||||
override fun getItemCount(): Int {
|
||||
return data.size
|
||||
}
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return data[position]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.BR
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class AccidentVisaBean : BaseObservable(), ICheck {
|
||||
|
||||
// 事故经过
|
||||
@Bindable
|
||||
var accidentdes: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.accidentdes)
|
||||
}
|
||||
|
||||
// 事故经过
|
||||
@Bindable
|
||||
var annex: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.annex)
|
||||
}
|
||||
|
||||
// 所附证件
|
||||
@Bindable
|
||||
var conclusion: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.conclusion)
|
||||
}
|
||||
|
||||
// 收货人名称及住址
|
||||
@Bindable
|
||||
var consignee: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.consignee)
|
||||
}
|
||||
|
||||
// 声明价值
|
||||
@Bindable
|
||||
var declareamount: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.declareamount)
|
||||
}
|
||||
|
||||
// 发运站
|
||||
@Bindable
|
||||
var dep: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dep)
|
||||
}
|
||||
|
||||
// 到达站
|
||||
@Bindable
|
||||
var dest: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dest)
|
||||
}
|
||||
|
||||
// 飞行组成员
|
||||
@Bindable
|
||||
var fltcrew: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fltcrew)
|
||||
}
|
||||
|
||||
// 航班号
|
||||
@Bindable
|
||||
var fno: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fno)
|
||||
}
|
||||
|
||||
// ID
|
||||
var id: String = "" // 0
|
||||
|
||||
// 货单号
|
||||
@Bindable
|
||||
var mawbno: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mawbno)
|
||||
}
|
||||
|
||||
// 姓名
|
||||
@Bindable
|
||||
var name: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.name)
|
||||
}
|
||||
|
||||
// 开具日期
|
||||
@Bindable
|
||||
var opDate: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.opDate)
|
||||
}
|
||||
|
||||
// 填表人
|
||||
@Bindable
|
||||
var opid: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.opid)
|
||||
}
|
||||
|
||||
// 保障情况
|
||||
@Bindable
|
||||
var packing: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.packing)
|
||||
}
|
||||
|
||||
// 件数
|
||||
@Bindable
|
||||
var pc: String = "" // 0
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.pc)
|
||||
}
|
||||
|
||||
// 图片地址
|
||||
var pic: String = ""
|
||||
var originalPic: String = ""
|
||||
|
||||
// 图片数量
|
||||
var picnumber: String = ""
|
||||
|
||||
// 飞机号
|
||||
@Bindable
|
||||
var registeration: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.registeration)
|
||||
}
|
||||
|
||||
// 托运人名称及住址
|
||||
@Bindable
|
||||
var shipper: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.shipper)
|
||||
}
|
||||
|
||||
// 职别
|
||||
@Bindable
|
||||
var title: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.title)
|
||||
}
|
||||
|
||||
// 重量
|
||||
@Bindable
|
||||
var weight: String = ""// 0
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.weight)
|
||||
}
|
||||
|
||||
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class ActionBean(
|
||||
val title: String,
|
||||
val icon: Int,
|
||||
val key: String = ""
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
data class AirportBean(
|
||||
var airportCode: String = "", // 三字码
|
||||
var nameCn: String = "", // 中文名称
|
||||
var nameEn: String = "", // 英文名称
|
||||
var nameFull: String = "", // 全名
|
||||
var intFlag: String = "", // 数字标志
|
||||
var dataSwitch: String = "", // 日期转换
|
||||
var SITA: String = "", // SITA
|
||||
var areaCode: String = "", // 区域编码
|
||||
var countryCode: String = "", // 国家编码
|
||||
var mid: String = "", //
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
data class AppUpdateResponse<T>(
|
||||
val status:String ="",
|
||||
val msg:String ="",
|
||||
val success:Boolean = false,
|
||||
val data:T? = null,
|
||||
)
|
||||
|
||||
data class AppUpdateResponseInfo(
|
||||
val versionNo:String ="",
|
||||
val versionCode:Int,
|
||||
val isMandatory:Int = 0,
|
||||
val updateNotes:String,
|
||||
val downloadAddress:String,
|
||||
)
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* @author:孟凡华
|
||||
* @date:2022/2/8 14:21
|
||||
*/
|
||||
class BaseListBean<T> {
|
||||
|
||||
// 页面总量
|
||||
var pages = 1
|
||||
|
||||
// 数据总量
|
||||
var total = 0
|
||||
|
||||
//总件数
|
||||
var totalPc = 0
|
||||
|
||||
//总重量
|
||||
var totalWeight = 0.0
|
||||
|
||||
//总复磅重量
|
||||
var totalCCargoWeight = 0
|
||||
|
||||
// 已交接板车数量
|
||||
var totalCar = 0
|
||||
|
||||
//数据列表
|
||||
var list: ArrayList<T>? = null
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
open class BaseResultBean<T> {
|
||||
|
||||
var msg: String? = null
|
||||
|
||||
var status: String = ""
|
||||
|
||||
var data: T? = null
|
||||
|
||||
fun verifySuccess(): Boolean {
|
||||
return status == "1"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
data class BoxDetailsForCarIdBean(
|
||||
var carid: String? = null,
|
||||
var carweight: String? = null,
|
||||
var gjcLoading: List<GjcLoadingBean>? = null,
|
||||
var locId: String? = null,
|
||||
var totalWeight: String? = null
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class CarBarBean {
|
||||
var count: String = ""
|
||||
var position: String = ""
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.BR
|
||||
|
||||
class CarBean : BaseObservable() {
|
||||
|
||||
// 是否异常
|
||||
@Bindable
|
||||
var breakdown = false
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.breakdown)
|
||||
}
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
|
||||
/**
|
||||
* 平板车或集装器 数据类
|
||||
*/
|
||||
class CarOrUldBean(
|
||||
var airport: String? = "",
|
||||
var buyDate: String? = "",
|
||||
var carId: String? = "",
|
||||
var carWeight: String? = "",
|
||||
var carrier: String? = "",
|
||||
var maxVolume: String? = "",
|
||||
var maxWeight: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var producers: String? = "",
|
||||
var remark: String? = "",
|
||||
var signWeight: String? = "",
|
||||
var status: String? = "",
|
||||
var uld: String? = "",
|
||||
var uldFlag: String? = "",
|
||||
var uldType: String? = "",
|
||||
var uldWeight: String? = ""
|
||||
) {
|
||||
|
||||
/**
|
||||
* 用于合并数据
|
||||
*/
|
||||
fun createForMerge(bean: CarOrUldBean): CarOrUldBean {
|
||||
loge("传入的 bean : ${bean.toJson()}")
|
||||
loge("当前的 bean : ${this.toJson()}")
|
||||
val carOrUldBean = CarOrUldBean()
|
||||
carOrUldBean.airport = bean.airport.noNull(airport.noNull())
|
||||
carOrUldBean.buyDate = bean.buyDate.noNull(buyDate.noNull())
|
||||
carOrUldBean.carId = bean.carId.noNull(carId.noNull())
|
||||
carOrUldBean.carWeight = bean.carWeight.noNull(carWeight.noNull())
|
||||
carOrUldBean.carrier = bean.carrier.noNull(carrier.noNull())
|
||||
carOrUldBean.maxVolume = bean.maxVolume.noNull(maxVolume.noNull())
|
||||
carOrUldBean.maxWeight = bean.maxWeight.noNull(maxWeight.noNull())
|
||||
carOrUldBean.organizationCode = bean.organizationCode.noNull(organizationCode.noNull())
|
||||
carOrUldBean.producers = bean.producers.noNull(producers.noNull())
|
||||
carOrUldBean.remark = bean.remark.noNull(remark.noNull())
|
||||
carOrUldBean.signWeight = bean.signWeight.noNull(signWeight.noNull())
|
||||
carOrUldBean.status = bean.status.noNull(status.noNull())
|
||||
carOrUldBean.uld = bean.uld.noNull(uld.noNull())
|
||||
carOrUldBean.uldFlag = bean.uldFlag.noNull(uldFlag.noNull())
|
||||
carOrUldBean.uldType = bean.uldType.noNull(uldType.noNull())
|
||||
carOrUldBean.uldWeight = bean.uldWeight.noNull(uldWeight.noNull())
|
||||
loge("合并后的 bean : ${carOrUldBean.toJson()}")
|
||||
return carOrUldBean
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class DiBangChannelBean(
|
||||
var name: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var systemGroup: String? = "",
|
||||
var value: String? = ""
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
data class DictIdValueBean(
|
||||
var code: String = "", // USERROLE
|
||||
var id: String = "", // 1
|
||||
var key: String = "", // 0
|
||||
var value: String = "" // 计重员
|
||||
) {
|
||||
fun toKeyValue() = KeyValue(value, key)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
class DictListBean(
|
||||
var `data`: List<DictBean>? = listOf(),
|
||||
var msg: String? = "",
|
||||
var status: String? = ""
|
||||
)
|
||||
|
||||
class DictBean(
|
||||
var code: String? = "",
|
||||
var name: String? = ""
|
||||
) {
|
||||
fun toKeyValue(): KeyValue {
|
||||
return KeyValue(name, code)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import android.graphics.Color
|
||||
import android.icu.util.Calendar
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.R
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import dev.DevUtils
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class DocumentHandoverBean(
|
||||
|
||||
): ICheck {
|
||||
// 实际到达时间
|
||||
var actualArrival: String = ""
|
||||
|
||||
// 实际起飞时间
|
||||
var actualTakeOff: String = ""
|
||||
|
||||
// 机型
|
||||
var aircraftCode: String = ""
|
||||
|
||||
// 地区类型名称
|
||||
var countryName: String = ""
|
||||
|
||||
// 航班类型- 0:国内 1:国际
|
||||
var countryType: String = ""
|
||||
|
||||
// 延误原因
|
||||
var delayFreeText: String = ""
|
||||
|
||||
// 司机
|
||||
var driver: String = ""
|
||||
|
||||
// 预计到达时间 HH:mm 格式
|
||||
var estimatedArrival: String = ""
|
||||
|
||||
// 预计起飞时间
|
||||
var estimatedTakeOff: String = ""
|
||||
|
||||
// 航班关闭时间
|
||||
var fclose: String = ""
|
||||
var fdate: String = ""
|
||||
|
||||
// 始发港
|
||||
var fdep: String = ""
|
||||
|
||||
// 目的港
|
||||
var fdest: String = ""
|
||||
|
||||
// 主键
|
||||
var fid: String = ""
|
||||
|
||||
var id: String = ""
|
||||
|
||||
// 单证类型:1业务袋、2特货通知单(字典表)
|
||||
var fileType: String = ""
|
||||
|
||||
val fileTypeName: String
|
||||
get() {
|
||||
return when (fileType) {
|
||||
"1" -> "业务袋"
|
||||
"2" -> "特货通知单"
|
||||
"3" -> "业务袋、特货通知单"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
// 航班状态(0:正常;1:登机;2:登机结束;3:起飞;4:到达;5:取消;6:备降;7:删除发布;8:延误;9:未知)
|
||||
var flightStatus: String = ""
|
||||
|
||||
val flightStatusName: String
|
||||
get() {
|
||||
return when (flightStatus) {
|
||||
"0" -> "正常"
|
||||
"1" -> "登机"
|
||||
"2" -> "登机结束"
|
||||
"3" -> "起飞"
|
||||
"4" -> "到达"
|
||||
"5" -> "取消"
|
||||
"6" -> "备降"
|
||||
"7" -> "删除发布"
|
||||
"8" -> "延误"
|
||||
"9" -> "未知"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
// 航班号
|
||||
var fno: String = ""
|
||||
|
||||
// 航班进出港标志 I:进港 E:出港
|
||||
var ieFlag: String = ""
|
||||
|
||||
// 经停港(可多个用’’分隔)
|
||||
var jtz: String = ""
|
||||
|
||||
// 航班截载时间
|
||||
var mclose: String = ""
|
||||
|
||||
// 组织代码
|
||||
var organizationCode: String = ""
|
||||
|
||||
// 飞行状态
|
||||
var portCode: String = ""
|
||||
|
||||
// 运单前缀
|
||||
var prefix: String = ""
|
||||
|
||||
// 航程
|
||||
var range: String = ""
|
||||
|
||||
// 注册号
|
||||
var registration: String = ""
|
||||
|
||||
// 计划到达时间
|
||||
var scheduledArrival: String = ""
|
||||
|
||||
// 计划起飞时间
|
||||
var scheduledTackOff: String = ""
|
||||
|
||||
// 航班服务种类(0:客机;1:货机;2:卡车)
|
||||
var serviceType: String = ""
|
||||
|
||||
// 机位
|
||||
var standId: String = ""
|
||||
|
||||
// 进出港状态
|
||||
var status: String = ""
|
||||
|
||||
// 预计到达时间
|
||||
var arrivalDate: String = ""
|
||||
|
||||
// 航空公司
|
||||
var nameCN: String = ""
|
||||
|
||||
// 交接人
|
||||
var handoverPerson: String = ""
|
||||
|
||||
// 交接时间
|
||||
var handoverTime: String = ""
|
||||
|
||||
// 复核人
|
||||
var reviewer: String = ""
|
||||
|
||||
// 复核时间
|
||||
var reviewDate: String = ""
|
||||
|
||||
//货物类型:0“国际货”,1“活体鲜活”,2“贵重物品”,3“其他特货”
|
||||
var cargoType: String = ""
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
fun beArrival(): Boolean {
|
||||
return "1" == status
|
||||
}
|
||||
|
||||
// I:进港 E:出港
|
||||
fun getIEFlagName():String{
|
||||
return when(ieFlag){
|
||||
"E" -> "国内出港"
|
||||
"I" -> "国内进港"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
// I:进港 E:出港
|
||||
val ieFlagTextColor: Int
|
||||
get() = DevUtils.getTopActivity().resources.getColor(
|
||||
when(ieFlag){
|
||||
"E" -> R.color.text_blue
|
||||
"I" -> R.color.text_pink
|
||||
else -> R.color.text_gray
|
||||
}
|
||||
)
|
||||
|
||||
fun getHangCheng(): String {
|
||||
if (fdep == null || fdep == "") {
|
||||
return ""
|
||||
}
|
||||
return "${fdep ?: ""}-${fdest ?: ""}"
|
||||
}
|
||||
|
||||
fun getCountryTypeName(): String {
|
||||
return when (countryType) {
|
||||
"0" -> "国内"
|
||||
"1" -> "国际"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
fun getTimeDesc(): String {
|
||||
val datetime = if (beArrival()) scheduledArrival else scheduledTackOff
|
||||
if (datetime.isEmpty()) {
|
||||
return ""
|
||||
}
|
||||
return DateUtils.formatDate(DateUtils.parseDate(datetime), "HH:mm")
|
||||
}
|
||||
|
||||
fun showAddOne(): Boolean {
|
||||
val datetime = if (beArrival()) scheduledArrival else scheduledTackOff
|
||||
if (datetime.isEmpty() || fdate.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
val calendar = DateUtils.getCalendar(DateUtils.parseDate(datetime))
|
||||
val current = DateUtils.getCalendar(DateUtils.parseDate(fdate, "yyyy-MM-dd"))
|
||||
if (calendar.get(Calendar.YEAR) > current.get(Calendar.YEAR)) {
|
||||
return true
|
||||
}
|
||||
return calendar.get(Calendar.DAY_OF_YEAR) > current.get(Calendar.DAY_OF_YEAR)
|
||||
}
|
||||
|
||||
fun getCargoTypeName(): String {
|
||||
return when (cargoType) {
|
||||
"0" -> "国际货"
|
||||
"1" -> "活体鲜活"
|
||||
"2" -> "贵重物品"
|
||||
"3" -> "其他特货"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class DriverBean {
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.cache.ImageCacheModel
|
||||
import com.lukouguoji.module_base.http.net.Api
|
||||
import com.lukouguoji.module_base.util.HandlerUtils
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
|
||||
class FileBean(
|
||||
// 本地地址
|
||||
var path: String = "",
|
||||
// 缩略图地址
|
||||
var url: String = "",
|
||||
// 原图地址
|
||||
var originalPic: String = ""
|
||||
) {
|
||||
|
||||
val canDelete = ObservableBoolean(false)
|
||||
|
||||
fun download(callBack: (file: File) -> Unit) {
|
||||
if (isOnlineResource()) {
|
||||
GlobalScope.launch {
|
||||
ImageCacheModel.saveFile(path, onSuccess = {
|
||||
HandlerUtils.postRunnable {
|
||||
path = it.path
|
||||
callBack(it)
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
callBack(File(path))
|
||||
}
|
||||
}
|
||||
|
||||
fun isOnlineResource() = path.contains(Api.BASE_URL)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.BR
|
||||
|
||||
class FlatcarBean : BaseObservable() {
|
||||
|
||||
// 购买日期
|
||||
@Bindable
|
||||
var buyDate: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.buyDate)
|
||||
}
|
||||
|
||||
// 平板车号
|
||||
@Bindable
|
||||
var carId: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carId)
|
||||
}
|
||||
|
||||
// 自重
|
||||
@Bindable
|
||||
var carWeight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carWeight)
|
||||
}
|
||||
|
||||
// 最大载重
|
||||
@Bindable
|
||||
var maxWeight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.maxWeight)
|
||||
}
|
||||
|
||||
// 组织机构代码
|
||||
@Bindable
|
||||
var organizationCode: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.organizationCode)
|
||||
}
|
||||
|
||||
// 生产商
|
||||
@Bindable
|
||||
var producers: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.producers)
|
||||
}
|
||||
|
||||
// 备注
|
||||
@Bindable
|
||||
var remark: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.remark)
|
||||
}
|
||||
|
||||
// 标重
|
||||
@Bindable
|
||||
var signWeight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.signWeight)
|
||||
}
|
||||
|
||||
// 状态 0:正常 1:故障
|
||||
@Bindable
|
||||
var status: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.status)
|
||||
}
|
||||
|
||||
// 位置
|
||||
@Bindable
|
||||
var position: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.position)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var positionName: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.positionName)
|
||||
}
|
||||
|
||||
|
||||
fun getStatusName() = when (status) {
|
||||
"0" -> "正常"
|
||||
"1" -> "故障"
|
||||
else -> ""
|
||||
}
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
//是否需要新增
|
||||
var addFalg = true
|
||||
//卸机id
|
||||
var xieJiId : String = ""
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import android.icu.util.Calendar
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class FlightBean : ICheck {
|
||||
|
||||
// 实际到达时间
|
||||
var actualArrival: String = ""
|
||||
|
||||
// 实际起飞时间
|
||||
var actualTakeOff: String = ""
|
||||
|
||||
|
||||
// 实际起飞时间-时分
|
||||
val actualTakeOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
actualTakeOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(actualTakeOff)
|
||||
}
|
||||
|
||||
|
||||
// 机型
|
||||
var aircraftCode: String = ""
|
||||
|
||||
// 地区类型名称
|
||||
var countryName: String = ""
|
||||
|
||||
// 航班类型- 0:国内 1:国际
|
||||
var countryType: String = ""
|
||||
|
||||
// 延误原因
|
||||
var delayFreeText: String = ""
|
||||
|
||||
// 司机
|
||||
var driver: String = ""
|
||||
|
||||
// 预计到达时间 HH:mm 格式
|
||||
var estimatedArrival: String = ""
|
||||
|
||||
// 预计起飞时间
|
||||
var estimatedTakeOff: String = ""
|
||||
|
||||
// 航班关闭时间
|
||||
var fclose: String = ""
|
||||
var fdate: String = ""
|
||||
|
||||
// 始发港
|
||||
var fdep: String = ""
|
||||
|
||||
// 目的港
|
||||
var fdest: String = ""
|
||||
|
||||
// 主键
|
||||
var fid: String = ""
|
||||
|
||||
var id: String = ""
|
||||
|
||||
// 单证类型:1业务袋、2特货通知单(字典表)
|
||||
var fileType: String = ""
|
||||
|
||||
val fileTypeName: String
|
||||
get() {
|
||||
return when (fileType) {
|
||||
"1" -> "业务袋"
|
||||
"2" -> "特货通知单"
|
||||
"3" -> "业务袋、特货通知单"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
// 单证类型:1业务袋、2特货通知单(字典表)
|
||||
var cmFlag: String = ""
|
||||
|
||||
val cmFlagName: String
|
||||
get() {
|
||||
return when (cmFlag) {
|
||||
"0" -> "有货邮"
|
||||
"1" -> "无货邮"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
// 航班状态(0:正常;1:登机;2:登机结束;3:起飞;4:到达;5:取消;6:备降;7:删除发布;8:延误;9:未知)
|
||||
var flightStatus: String = ""
|
||||
|
||||
val flightStatusName: String
|
||||
get() {
|
||||
return when (flightStatus) {
|
||||
"0" -> "正常"
|
||||
"1" -> "登机"
|
||||
"2" -> "登机结束"
|
||||
"3" -> "起飞"
|
||||
"4" -> "到达"
|
||||
"5" -> "取消"
|
||||
"6" -> "备降"
|
||||
"7" -> "删除发布"
|
||||
"8" -> "延误"
|
||||
"9" -> "未知"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
// 航班号
|
||||
var fno: String = ""
|
||||
|
||||
// 航班进出港标志 I:进港 E:出港
|
||||
var ieFlag: String = ""
|
||||
|
||||
// 经停港(可多个用’’分隔)
|
||||
var jtz: String = ""
|
||||
|
||||
// 航班截载时间
|
||||
var mclose: String = ""
|
||||
|
||||
// 组织代码
|
||||
var organizationCode: String = ""
|
||||
|
||||
// 飞行状态
|
||||
var portCode: String = ""
|
||||
|
||||
// 运单前缀
|
||||
var prefix: String = ""
|
||||
|
||||
// 航程
|
||||
var range: String = ""
|
||||
|
||||
// 注册号
|
||||
var registration: String = ""
|
||||
|
||||
// 计划到达时间
|
||||
var scheduledArrival: String = ""
|
||||
|
||||
// 计划起飞时间
|
||||
var scheduledTackOff: String = ""
|
||||
|
||||
// 计划起飞时间-时分
|
||||
val scheduledTackOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
scheduledTackOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(scheduledTackOff)
|
||||
}
|
||||
|
||||
// 航班服务种类(0:客机;1:货机;2:卡车)
|
||||
var serviceType: String = ""
|
||||
|
||||
// 机位
|
||||
var standId: String = ""
|
||||
|
||||
// 进出港状态
|
||||
var status: String = ""
|
||||
|
||||
// 预计到达时间
|
||||
var arrivalDate: String = ""
|
||||
|
||||
// 航空公司
|
||||
var nameCN: String = ""
|
||||
|
||||
// 交接人
|
||||
var handoverPerson: String = ""
|
||||
|
||||
// 交接时间
|
||||
var handoverTime: String = ""
|
||||
|
||||
//货物类型:0“国际货”,1“活体鲜活”,2“贵重物品”,3“其他特货”
|
||||
var cargoType: String = ""
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
fun beArrival(): Boolean {
|
||||
return "1" == status
|
||||
}
|
||||
|
||||
fun getHangCheng(): String {
|
||||
if (fdep == null || fdep == "") {
|
||||
return ""
|
||||
}
|
||||
return "${fdep ?: ""}-${fdest ?: ""}"
|
||||
}
|
||||
|
||||
fun getCountryTypeName(): String {
|
||||
return when (countryType) {
|
||||
"0" -> "国内"
|
||||
"1" -> "国际"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
fun getTimeDesc(): String {
|
||||
val datetime = if (beArrival()) scheduledArrival else scheduledTackOff
|
||||
if (datetime.isEmpty()) {
|
||||
return ""
|
||||
}
|
||||
return DateUtils.formatDate(DateUtils.parseDate(datetime), "HH:mm")
|
||||
}
|
||||
|
||||
fun showAddOne(): Boolean {
|
||||
val datetime = if (beArrival()) scheduledArrival else scheduledTackOff
|
||||
if (datetime.isEmpty() || fdate.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
val calendar = DateUtils.getCalendar(DateUtils.parseDate(datetime))
|
||||
val current = DateUtils.getCalendar(DateUtils.parseDate(fdate, "yyyy-MM-dd"))
|
||||
if (calendar.get(Calendar.YEAR) > current.get(Calendar.YEAR)) {
|
||||
return true
|
||||
}
|
||||
return calendar.get(Calendar.DAY_OF_YEAR) > current.get(Calendar.DAY_OF_YEAR)
|
||||
}
|
||||
|
||||
fun getCargoTypeName(): String {
|
||||
return when (cargoType) {
|
||||
"0" -> "国际货"
|
||||
"1" -> "活体鲜活"
|
||||
"2" -> "贵重物品"
|
||||
"3" -> "其他特货"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class FlightFilterBean : ICheck {
|
||||
|
||||
// 实际到达时间
|
||||
var filterName: String = ""
|
||||
|
||||
// 实际起飞时间
|
||||
var filterContent: String = ""
|
||||
|
||||
// 机型
|
||||
var opId: String = ""
|
||||
|
||||
// 预计到达时间 HH:mm 格式
|
||||
var opDate: String = ""
|
||||
|
||||
|
||||
override fun getCheckObservable(): ObservableBoolean {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
|
||||
/**
|
||||
* 平板车或集装器 数据类
|
||||
*/
|
||||
class GbCarOrUldBean(
|
||||
var `data`: Data? = Data(),
|
||||
var type: String? = ""
|
||||
) {
|
||||
|
||||
class Data(
|
||||
var carid: String? = "",
|
||||
var carweight: String? = "",
|
||||
var gjcLoading: List<GjcLoading?>? = listOf(),
|
||||
var locId: String? = "",
|
||||
var totalWeight: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var uld: String? = "",
|
||||
var uldWeight: String? = "",
|
||||
var maxWeight: String? = "",
|
||||
var maxVolume: String? = "",
|
||||
var uldType: String? = "",
|
||||
var uldFlag: String? = "",
|
||||
var carrier: String? = "",
|
||||
var airport: String? = "",
|
||||
) {
|
||||
|
||||
fun getGjcLoadingBean(): GjcLoading {
|
||||
return gjcLoading?.firstOrNull() ?: GjcLoading()
|
||||
}
|
||||
|
||||
fun createForMerge(bean: Data): Data {
|
||||
val data = Data()
|
||||
data.carid = bean.carid.noNull(carid.noNull())
|
||||
data.carweight = bean.carweight.noNull(carweight.noNull())
|
||||
if (bean.gjcLoading != null) {
|
||||
data.gjcLoading = bean.gjcLoading
|
||||
}
|
||||
data.locId = bean.locId.noNull(locId.noNull())
|
||||
data.totalWeight = bean.totalWeight.noNull(totalWeight.noNull())
|
||||
data.organizationCode = bean.organizationCode.noNull(organizationCode.noNull())
|
||||
data.uld = bean.uld.noNull(uld.noNull())
|
||||
data.uldWeight = bean.uldWeight.noNull(uldWeight.noNull())
|
||||
data.maxWeight = bean.maxWeight.noNull(maxWeight.noNull())
|
||||
data.maxVolume = bean.maxVolume.noNull(maxVolume.noNull())
|
||||
data.uldType = bean.uldType.noNull(uldType.noNull())
|
||||
data.uldFlag = bean.uldFlag.noNull(uldFlag.noNull())
|
||||
data.carrier = bean.carrier.noNull(carrier.noNull())
|
||||
data.airport = bean.airport.noNull(airport.noNull())
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
class GjcLoading(
|
||||
var agentCode: Any? = Any(),
|
||||
var boardtype: String? = "",
|
||||
var cargotype: String? = "",
|
||||
var cargoName: String? = "",
|
||||
var cargoweight: String? = "",
|
||||
var carid: String? = "",
|
||||
var carrier: String? = "",
|
||||
var cflag: String? = "",
|
||||
var dest: String? = "",
|
||||
var emptyuld: String? = "",
|
||||
var fclose: String? = "",
|
||||
var fdate: String? = "",
|
||||
var fid: String? = "",
|
||||
var fno: String? = "",
|
||||
var locId: String? = "",
|
||||
var location: String? = "",
|
||||
var mailpc: String? = "",
|
||||
var mailvolume: String? = "",
|
||||
var mailweight: String? = "",
|
||||
var mawbNo: Any? = Any(),
|
||||
var maxvolume: String? = "",
|
||||
var maxweight: String? = "",
|
||||
var movID: Any? = Any(),
|
||||
var netweight: String? = "",
|
||||
var no: Any? = Any(),
|
||||
var opdate: String? = "",
|
||||
var opid: String? = "",
|
||||
var opname: String? = "",
|
||||
var organizationcode: String? = "",
|
||||
var pc: String? = "",
|
||||
var prefix: Any? = Any(),
|
||||
var priority: String? = "",
|
||||
var remark: String? = "",
|
||||
var reviewDate: Any? = Any(),
|
||||
var reviewWeight: Any? = Any(),
|
||||
var reviewer: Any? = Any(),
|
||||
var spCode: Any? = Any(),
|
||||
var uld: String? = "",
|
||||
var uldflag: String? = "",
|
||||
var uldweight: String? = "",
|
||||
var volume: String? = ""
|
||||
)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjcBoxAddInsertBean(
|
||||
var agentCode: Any? = Any(),
|
||||
var boardtype: Any? = Any(),
|
||||
var cargotype: String? = "",
|
||||
var cargoweight: String? = "",
|
||||
var carid: String? = "",
|
||||
var carrier: Any? = Any(),
|
||||
var cflag: String? = "",
|
||||
var dest: Any? = Any(),
|
||||
var emptyuld: Any? = Any(),
|
||||
var fclose: Any? = Any(),
|
||||
var fdate: Any? = Any(),
|
||||
var fid: String? = "",
|
||||
var fno: Any? = Any(),
|
||||
var location: Any? = Any(),
|
||||
var locId: String? = "",
|
||||
var mailpc: String? = "",
|
||||
var mailvolume: String? = "",
|
||||
var mailweight: String? = "",
|
||||
var mawbNo: Any? = Any(),
|
||||
var maxvolume: String? = "",
|
||||
var maxweight: String? = "",
|
||||
var movID: Any? = Any(),
|
||||
var netweight: String? = "",
|
||||
var no: Any? = Any(),
|
||||
var opdate: String? = "",
|
||||
var opid: String? = "",
|
||||
var opname: String? = "",
|
||||
var organizationcode: String? = "",
|
||||
var pc: String? = "",
|
||||
var prefix: Any? = Any(),
|
||||
var priority: String? = "",
|
||||
var remark: Any? = Any(),
|
||||
var reviewDate: Any? = Any(),
|
||||
var reviewWeight: Any? = Any(),
|
||||
var reviewer: Any? = Any(),
|
||||
var spCode: Any? = Any(),
|
||||
var uld: String? = "",
|
||||
var uldflag: String? = "",
|
||||
var uldweight: String? = "",
|
||||
var volume: String? = ""
|
||||
)
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.ObservableArrayList
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import dev.utils.common.NumberUtils
|
||||
|
||||
class GjcBoxAddListBean(
|
||||
// 运单信息
|
||||
var waybillBean: GjcWaybillBean = GjcWaybillBean()
|
||||
) : BaseObservable() {
|
||||
|
||||
val show = ObservableBoolean(false)
|
||||
|
||||
// 件号列表
|
||||
var jianList: ObservableArrayList<JianBean> = ObservableArrayList<JianBean>()
|
||||
|
||||
// 件号表ID
|
||||
var pcID = ""
|
||||
|
||||
}
|
||||
|
||||
class JianBean(
|
||||
val code: String,
|
||||
val value: String,
|
||||
) {
|
||||
val checked: ObservableBoolean = ObservableBoolean(false)
|
||||
|
||||
companion object {
|
||||
fun create(value: String): JianBean {
|
||||
return JianBean(getCode(value), value)
|
||||
}
|
||||
|
||||
fun getCode(code: String): String {
|
||||
val replace = code.replace("-", "")
|
||||
return if (NumberUtils.isNumber(code) && code.length == 5) {
|
||||
code.toInt().toString()
|
||||
} else if (replace.length < 5) {
|
||||
code
|
||||
} else {
|
||||
replace.substring(replace.length-5)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import com.lukouguoji.module_base.ktx.limit
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
|
||||
class GcjBoxAddReqBean(
|
||||
// 装载id
|
||||
var locId: String = "",
|
||||
// 总件数
|
||||
var pc: Int = 0,
|
||||
// 总重量
|
||||
var totalWeight: String = "",
|
||||
var gjcLoading: GjcBoxAddLoadingReqBean? = null,
|
||||
var warehousePclistDTOList: List<GjcBoxAddWarehousePclistDTOListReqBean>? = null,
|
||||
) {
|
||||
|
||||
fun setGjcBoxAddList(list: List<GjcBoxAddListBean>, uldWeight: String) {
|
||||
// 全部是邮件
|
||||
var allMail = true
|
||||
// 总重量
|
||||
var totalWeight = 0.0
|
||||
var mailWeight = 0.0
|
||||
// 总体积
|
||||
var totalVolume = 0.0
|
||||
var mailVolume = 0.0
|
||||
// 总件数
|
||||
var totalPc = 0
|
||||
var mailpc = 0
|
||||
list.forEach {
|
||||
if (allMail && !it.waybillBean.isMail()) {
|
||||
allMail = false
|
||||
}
|
||||
val count = if (it.jianList.isEmpty()) it.waybillBean.pc.noNull("0")
|
||||
.toInt() else it.jianList.size
|
||||
totalWeight += (it.waybillBean.weight.noNull("0.0").toDouble())
|
||||
totalVolume += (it.waybillBean.volume.noNull("0.0").toDouble())
|
||||
totalPc += count
|
||||
if (it.waybillBean.isMail()) {
|
||||
mailWeight += it.waybillBean.weight.noNull("0.0").toDouble()
|
||||
mailVolume += it.waybillBean.volume.noNull("0.0").toDouble()
|
||||
mailpc += count
|
||||
}
|
||||
}
|
||||
|
||||
pc = totalPc
|
||||
this.totalWeight = totalWeight.limit()
|
||||
gjcLoading = GjcBoxAddLoadingReqBean(
|
||||
cargotype = if (allMail) "1" else "0",
|
||||
cargoweight = totalWeight.limit(),
|
||||
locId = locId,
|
||||
mailpc = mailpc,
|
||||
mailvolume = mailVolume.limit(),
|
||||
mailweight = mailWeight.limit(),
|
||||
netweight = (totalWeight + uldWeight.toDouble()).limit(),
|
||||
pc = totalPc.toString(),
|
||||
volume = totalVolume.limit(),
|
||||
)
|
||||
|
||||
warehousePclistDTOList = list.map {
|
||||
GjcBoxAddWarehousePclistDTOListReqBean(
|
||||
whid = it.waybillBean.whid.noNull(),
|
||||
prefix = it.waybillBean.prefix.noNull(),
|
||||
pc = it.jianList.size.toString(),
|
||||
pclist = GjcBoxAddPcListReqBean(
|
||||
list = it.jianList.joinToString(",") { jianBean ->
|
||||
jianBean.value
|
||||
},
|
||||
locId = locId,
|
||||
no = it.waybillBean.no.noNull(),
|
||||
pcID = it.pcID.noNull(),
|
||||
prefix = it.waybillBean.prefix.noNull(),
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class GjcBoxAddLoadingReqBean(
|
||||
// 仓库列表记录前缀都为000 为M 其他状况为C
|
||||
var cargotype: String = "C",
|
||||
// 仅累加仓库货物货重 必填
|
||||
var cargoweight: String = "",
|
||||
// 装载id
|
||||
var locId: String = "",
|
||||
// 货邮混装时,邮件件数(C类型时有效) 必填 累加仓库货物类型为邮件的件数
|
||||
var mailpc: Int = 0,
|
||||
// 货邮混装时,邮件体积(C类型时有效) 必填 累加仓库货物类型为邮件的体积
|
||||
var mailvolume: String = "",
|
||||
// 货邮混装时,邮件重量(C类型时有效) 必填 累加仓库货物类型为邮件的重量
|
||||
var mailweight: String = "",
|
||||
// 净重量 货总重+ULD重 必填
|
||||
var netweight: String = "",
|
||||
// 累加仓库货物的件数
|
||||
var pc: String = "",
|
||||
// 优先级 默认0
|
||||
var priority: String = "0",
|
||||
// 累加仓库货物的体积
|
||||
var volume: String = "",
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
class GjcBoxAddWarehousePclistDTOListReqBean(
|
||||
// 必填仓库id
|
||||
var whid: String = "",
|
||||
// 主提运单前缀(承运人运单三字码) 为000时表示该货物类型是邮件
|
||||
var prefix: String = "",
|
||||
// 件数
|
||||
var pc: String = "",
|
||||
// 件号对象
|
||||
var pclist: GjcBoxAddPcListReqBean? = null,
|
||||
)
|
||||
|
||||
class GjcBoxAddPcListReqBean(
|
||||
// 物品件号列表 以‘,’(英文逗号)分割 必填
|
||||
var list: String = "",
|
||||
// 装载id 必填
|
||||
var locId: String = "",
|
||||
// 运单号
|
||||
var no: String = "",
|
||||
// 件号表id 新增时不用传,修改时必填
|
||||
var pcID: String = "",
|
||||
// 前缀
|
||||
var prefix: String = "",
|
||||
)
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
|
||||
data class GjcBoxAssembleBean(
|
||||
var boardtype: String? = null,
|
||||
var cargotype: String? = null,
|
||||
var cargoweight: String? = null,
|
||||
var carid: String? = null,
|
||||
var carrier: String? = null,
|
||||
var cflag: String? = null,
|
||||
var dest: String? = null,
|
||||
var emptyuld: String? = null,
|
||||
var fclose: String? = null,
|
||||
var fdate: String? = null,
|
||||
var fid: String? = null,
|
||||
var fno: String? = null,
|
||||
var location: String? = null,
|
||||
var locId: String? = null,
|
||||
var mailpc: String? = null,
|
||||
var mailvolume: String? = null,
|
||||
var mailweight: String? = null,
|
||||
var maxvolume: String? = null,
|
||||
var maxweight: String? = null,
|
||||
var movID: String? = null,
|
||||
var netweight: String? = null,
|
||||
var opdate: String? = null,
|
||||
var opid: String? = null,
|
||||
var opname: String? = null,
|
||||
var organizationcode: String? = null,
|
||||
var pc: String? = null,
|
||||
var priority: String? = null,
|
||||
var remark: String? = null,
|
||||
var reviewDate: String? = null,
|
||||
var reviewWeight: String? = null,
|
||||
var reviewer: String? = null,
|
||||
var uld: String? = null,
|
||||
var uldflag: String? = null,
|
||||
var uldweight: String? = null,
|
||||
var volume: String? = null,
|
||||
var mcloseStatus: String? = null,
|
||||
) {
|
||||
|
||||
fun getCflagName(): String {
|
||||
return DictUtils.reWeightStatusList.firstOrNull { it.value == cflag.toString() }?.key ?: ""
|
||||
}
|
||||
|
||||
fun getMcloseStatusName(): String {
|
||||
return DictUtils.cutStatusList.firstOrNull { it.value == mcloseStatus.toString() }?.key ?: ""
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.lukouguoji.module_base.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GjcBoxAssembleListBean {
|
||||
|
||||
private List<GjcBoxAssembleBean> gjcLoading;
|
||||
private int locId;
|
||||
private String carid;
|
||||
private Object carweight;
|
||||
private Object totalWeight;
|
||||
private Object totalweight;
|
||||
|
||||
public List<GjcBoxAssembleBean> getGjcLoading() {
|
||||
return gjcLoading;
|
||||
}
|
||||
|
||||
public void setGjcLoading(List<GjcBoxAssembleBean> gjcLoading) {
|
||||
this.gjcLoading = gjcLoading;
|
||||
}
|
||||
|
||||
public int getLocId() {
|
||||
return locId;
|
||||
}
|
||||
|
||||
public void setLocId(int locId) {
|
||||
this.locId = locId;
|
||||
}
|
||||
|
||||
public String getCarid() {
|
||||
return carid;
|
||||
}
|
||||
|
||||
public void setCarid(String carid) {
|
||||
this.carid = carid;
|
||||
}
|
||||
|
||||
public Object getCarweight() {
|
||||
return carweight;
|
||||
}
|
||||
|
||||
public void setCarweight(Object carweight) {
|
||||
this.carweight = carweight;
|
||||
}
|
||||
|
||||
public Object getTotalWeight() {
|
||||
return totalWeight;
|
||||
}
|
||||
|
||||
public void setTotalWeight(Object totalWeight) {
|
||||
this.totalWeight = totalWeight;
|
||||
}
|
||||
|
||||
public Object getTotalweight() {
|
||||
return totalweight;
|
||||
}
|
||||
|
||||
public void setTotalweight(Object totalweight) {
|
||||
this.totalweight = totalweight;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
|
||||
data class GjcBoxDetailsBean(
|
||||
var eqmUld: ULDBean? = null,
|
||||
var flatCar: FlatcarBean? = null,
|
||||
var gjcLoading: GjcLoadingBean? = null,
|
||||
var isAdd: String? = null,
|
||||
var pc: String? = null,
|
||||
var totalWeight: String? = null,
|
||||
var warehousePclistDTOList: List<WarehousePclistDTO>? = null
|
||||
)
|
||||
|
||||
|
||||
data class GjcLoadingBean(
|
||||
var agentCode: String? = null,
|
||||
var boardtype: String? = null,
|
||||
var cargotype: String? = null,
|
||||
var cargoweight: String? = null,
|
||||
var carid: String? = null,
|
||||
var carrier: String? = null,
|
||||
var cflag: String? = null,
|
||||
var dest: String? = null,
|
||||
var emptyuld: String? = null,
|
||||
var fclose: String? = null,
|
||||
var fdate: String? = null,
|
||||
var fid: String? = null,
|
||||
var fno: String? = null,
|
||||
var locId: String? = null,
|
||||
var location: String? = null,
|
||||
var mailpc: String? = null,
|
||||
var mailvolume: String? = null,
|
||||
var mailweight: String? = null,
|
||||
var mawbNo: String? = null,
|
||||
var maxvolume: String? = null,
|
||||
var maxweight: String? = null,
|
||||
var movID: String? = null,
|
||||
var netweight: String? = null,
|
||||
var no: String? = null,
|
||||
var opdate: String? = null,
|
||||
var opid: String? = null,
|
||||
var opname: String? = null,
|
||||
var organizationcode: String? = null,
|
||||
var pc: String? = null,
|
||||
var prefix: String? = null,
|
||||
var priority: String? = null,
|
||||
var remark: String? = null,
|
||||
var reviewDate: String? = null,
|
||||
var reviewWeight: String? = null,
|
||||
var reviewer: String? = null,
|
||||
var spCode: String? = null,
|
||||
var uld: String? = null,
|
||||
var uldflag: String? = null,
|
||||
var uldweight: String? = null,
|
||||
var volume: Double? = null
|
||||
)
|
||||
|
||||
data class WarehousePclistDTO(
|
||||
var agent: String? = null,
|
||||
var businesstype: String? = null,
|
||||
var by1: String? = null,
|
||||
var by2: String? = null,
|
||||
var code: String? = null,
|
||||
var createdAt: String? = null,
|
||||
var createdBy: String? = null,
|
||||
var deleted: String? = null,
|
||||
var dep: String? = null,
|
||||
var desc: String? = null,
|
||||
var dest: String? = null,
|
||||
var dest1: String? = null,
|
||||
var dest2: String? = null,
|
||||
var exno: String? = null,
|
||||
var extraJson: String? = null,
|
||||
var fclose: String? = null,
|
||||
var fdate: String? = null,
|
||||
var fid: String? = null,
|
||||
var fno: String? = null,
|
||||
var goods: String? = null,
|
||||
var id: String? = null,
|
||||
var locId: String? = null,
|
||||
var location: String? = null,
|
||||
var locflag: String? = null,
|
||||
var name: String? = null,
|
||||
var no: String? = null,
|
||||
var opdate: String? = null,
|
||||
var opid: String? = null,
|
||||
var opname: String? = null,
|
||||
var organizationCode: String? = null,
|
||||
var pc: String? = null,
|
||||
var prefix: String? = null,
|
||||
var spcode: String? = null,
|
||||
var subcode: String? = null,
|
||||
var updatedAt: String? = null,
|
||||
var updatedBy: String? = null,
|
||||
var version: String? = null,
|
||||
var volume: Double? = null,
|
||||
var vouchernumber: String? = null,
|
||||
var weight: String? = null,
|
||||
var whid: String? = null,
|
||||
var pclist: PcListBean? = PcListBean(),
|
||||
) {
|
||||
fun toGjcWaybillBean(): GjcWaybillBean {
|
||||
return NetApply.gson.fromJson(
|
||||
NetApply.gson.toJson(this),
|
||||
GjcWaybillBean::class.java
|
||||
)
|
||||
}
|
||||
|
||||
fun toGjcBoxAddListBean(): GjcBoxAddListBean {
|
||||
val bean = GjcBoxAddListBean(toGjcWaybillBean())
|
||||
pclist?.let {
|
||||
bean.pcID = it.pcID.noNull()
|
||||
if (!it.list.isNullOrEmpty()) {
|
||||
it.list?.split(",")?.forEach { k ->
|
||||
bean.jianList.add(JianBean(k.toInt().toString(), k))
|
||||
}
|
||||
}
|
||||
}
|
||||
return bean
|
||||
}
|
||||
}
|
||||
|
||||
class PcListBean(
|
||||
var list: String? = "",
|
||||
var locId: Any? = Any(),
|
||||
var no: Any? = Any(),
|
||||
var organizationcode: Any? = Any(),
|
||||
var pcID: String? = "",
|
||||
var prefix: Any? = Any()
|
||||
)
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
data class GjcBoxUnloadDataBean(
|
||||
var flight: Flight? = null,
|
||||
// 装载信息
|
||||
var gjcLoading: List<GjcLoading?>? = null,
|
||||
var totalWeight: Int? = null,
|
||||
// 已装载
|
||||
var uldLoading: List<GjcWaybillBean>? = null,
|
||||
// 待装载
|
||||
var uldUnLoading: List<GjcWaybillBean>? = null
|
||||
)
|
||||
|
||||
data class Flight(
|
||||
var actualArrival: String? = null,
|
||||
var actualStandEnd: String? = null,
|
||||
var actualStandStart: String? = null,
|
||||
var actualTakeOff: String? = null,
|
||||
var aircraftCode: String? = null,
|
||||
var aircraftTerminalId: String? = null,
|
||||
var changeAirport: String? = null,
|
||||
var checkTime: String? = null,
|
||||
var countryType: String? = null,
|
||||
var delayCode: String? = null,
|
||||
var delayFreeText: String? = null,
|
||||
var diversionAirport: String? = null,
|
||||
var estimatedArrival: String? = null,
|
||||
var estimatedTakeOff: String? = null,
|
||||
var fclose: String? = null,
|
||||
var fdate: String? = null,
|
||||
var fdep: String? = null,
|
||||
var fdest: String? = null,
|
||||
var fid: Int? = null,
|
||||
var flightStatus: String? = null,
|
||||
var flightTerminalId: String? = null,
|
||||
var fno: String? = null,
|
||||
var isMasterFlight: String? = null,
|
||||
var jtz: String? = null,
|
||||
var linkFDate: String? = null,
|
||||
var linkFno: String? = null,
|
||||
var mclose: String? = null,
|
||||
var noAbout: String? = null,
|
||||
var organizationCode: String? = null,
|
||||
var outbound: String? = null,
|
||||
var registeration: String? = null,
|
||||
var runwayId: String? = null,
|
||||
var schStandEnd: String? = null,
|
||||
var schStandStart: String? = null,
|
||||
var scheduledArrival: String? = null,
|
||||
var scheduledTackOff: String? = null,
|
||||
var serviceType: String? = null,
|
||||
var standId: String? = null,
|
||||
var tallyEnd: String? = null,
|
||||
var tallyStart: String? = null
|
||||
)
|
||||
|
||||
data class GjcLoading(
|
||||
var boardtype: String? = null,
|
||||
var cargotype: Int? = null,
|
||||
var cargoweight: Int? = null,
|
||||
var carid: String? = null,
|
||||
var carrier: String? = null,
|
||||
var cflag: Int? = null,
|
||||
var dest: String? = null,
|
||||
var emptyuld: String? = null,
|
||||
var fclose: String? = null,
|
||||
var fdate: String? = null,
|
||||
var fid: Int? = null,
|
||||
var fno: String? = null,
|
||||
var location: String? = null,
|
||||
var locid: Int? = null,
|
||||
var mailpc: Int? = null,
|
||||
var mailvolume: Int? = null,
|
||||
var mailweight: Int? = null,
|
||||
var maxvolume: Int? = null,
|
||||
var maxweight: Int? = null,
|
||||
var movID: String? = null,
|
||||
var netweight: Int? = null,
|
||||
var opdate: String? = null,
|
||||
var opid: String? = null,
|
||||
var opname: String? = null,
|
||||
var organizationcode: String? = null,
|
||||
var pc: Int? = null,
|
||||
var priority: String? = null,
|
||||
var remark: String? = null,
|
||||
var reviewDate: String? = null,
|
||||
var reviewWeight: Int? = null,
|
||||
var reviewer: String? = null,
|
||||
var uld: String? = null,
|
||||
var uldflag: String? = null,
|
||||
var uldweight: Int? = null,
|
||||
var volume: Int? = null
|
||||
)
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
|
||||
class GjcGoodsAddBean(
|
||||
var agentCode: String? = null,
|
||||
var boardtype: String? = null,
|
||||
var cargotype: String? = null,
|
||||
var cargoweight: String? = null,
|
||||
var carid: String? = null,
|
||||
var carrier: String? = null,
|
||||
var cflag: String? = null,
|
||||
var dest: String? = null,
|
||||
var emptyuld: String? = null,
|
||||
var fclose: String? = null,
|
||||
var fdate: String? = null,
|
||||
var fid: String? = null,
|
||||
var fno: String? = null,
|
||||
var locId: String? = null,
|
||||
var location: String? = null,
|
||||
var mailpc: String? = null,
|
||||
var mailvolume: String? = null,
|
||||
var mailweight: String? = null,
|
||||
var mawbNo: String? = null,
|
||||
var maxvolume: String? = null,
|
||||
var maxweight: String? = null,
|
||||
var movID: String? = null,
|
||||
var netweight: String? = null,
|
||||
var no: String? = null,
|
||||
var opdate: String? = null,
|
||||
var opid: String? = null,
|
||||
var opname: String? = null,
|
||||
var organizationcode: String? = null,
|
||||
var pc: String? = null,
|
||||
var prefix: String? = null,
|
||||
var priority: String? = null,
|
||||
var remark: String? = null,
|
||||
var reviewDate: String? = null,
|
||||
var reviewWeight: String? = null,
|
||||
var reviewer: String? = null,
|
||||
var size: String? = null,
|
||||
var spCode: String? = null,
|
||||
var totalWeight: String? = null,
|
||||
var uld: String? = null,
|
||||
var uldflag: String? = null,
|
||||
var uldweight: String? = null,
|
||||
var volume: String? = null,
|
||||
var warehouseList: List<Warehouse>? = null
|
||||
) {
|
||||
|
||||
val show = ObservableBoolean(false)
|
||||
}
|
||||
|
||||
data class Warehouse(
|
||||
var agent: String? = null,
|
||||
var businesstype: String? = null,
|
||||
var by1: String? = null,
|
||||
var by2: String? = null,
|
||||
var code: String? = null,
|
||||
var createdAt: String? = null,
|
||||
var createdBy: String? = null,
|
||||
var deleted: String? = null,
|
||||
var dep: String? = null,
|
||||
var desc: String? = null,
|
||||
var dest: String? = null,
|
||||
var dest1: String? = null,
|
||||
var dest2: String? = null,
|
||||
var exno: String? = null,
|
||||
var extraJson: String? = null,
|
||||
var fclose: String? = null,
|
||||
var fdate: String? = null,
|
||||
var fid: String? = null,
|
||||
var fno: String? = null,
|
||||
var goods: String? = null,
|
||||
var id: String? = null,
|
||||
var locId: String? = null,
|
||||
var location: String? = null,
|
||||
var locflag: String? = null,
|
||||
var name: String? = null,
|
||||
var no: String? = null,
|
||||
var opdate: String? = null,
|
||||
var opid: String? = null,
|
||||
var opname: String? = null,
|
||||
var organizationCode: String? = null,
|
||||
var pc: String? = null,
|
||||
var prefix: String? = null,
|
||||
var spcode: String? = null,
|
||||
var subcode: String? = null,
|
||||
var updatedAt: String? = null,
|
||||
var updatedBy: String? = null,
|
||||
var version: String? = null,
|
||||
var volume: Double? = null,
|
||||
var vouchernumber: String? = null,
|
||||
var weight: String? = null,
|
||||
var whid: String? = null
|
||||
){
|
||||
fun getWaybillCode() = "$prefix$no"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjcGoodsBean(
|
||||
// 平板车号
|
||||
var carid: String? = "",
|
||||
// 出库人
|
||||
var checkout: String? = "",
|
||||
// 航班日期
|
||||
var fdate: String? = "",
|
||||
// 航班
|
||||
var fno: String? = "",
|
||||
// 交接时间
|
||||
var handtime: String? = "",
|
||||
// 交接状态 0:未交接 1:已交接
|
||||
var isCheck: String? = "",
|
||||
// GjcLoading表的id
|
||||
var locid: String? = "",
|
||||
// 交接单号
|
||||
var movID: String? = "",
|
||||
// 组织机构代码
|
||||
var organizationcode: String? = "",
|
||||
// 总件数
|
||||
var pc: String? = "",
|
||||
// 接收人
|
||||
var `receiver`: String? = "",
|
||||
// 签名图片
|
||||
var sign: String? = "",
|
||||
// 集装器号
|
||||
var uld: String? = "",
|
||||
// 总体积
|
||||
var volume: String? = "",
|
||||
// 总重量
|
||||
var weight: String? = ""
|
||||
)
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjcGoodsDetailsBean(
|
||||
// 出库人
|
||||
var checkout: String? = "",
|
||||
// 交接时间
|
||||
var handtime: String? = "",
|
||||
// 清单列表
|
||||
var loadingHandoverList: List<LoadingHandover>? = listOf(),
|
||||
// 交接单号
|
||||
var movID: String? = "",
|
||||
// 接收人
|
||||
var `receiver`: String? = "",
|
||||
// 签名
|
||||
var sign: String? = "",
|
||||
// 交接状态 0:未交接 1:已交接
|
||||
var isCheck: Int = 0,
|
||||
)
|
||||
|
||||
class LoadingHandover(
|
||||
var cargoweight: String? = "",
|
||||
var carid: String? = "",
|
||||
var dest: String? = "",
|
||||
var fdate: String? = "",
|
||||
var fno: String? = "",
|
||||
var locId: String? = "",
|
||||
var pc: String? = "",
|
||||
var uld: String? = "",
|
||||
var wbNo: String? = "",
|
||||
var weight: String? = ""
|
||||
)
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjcGoodsManifestBean {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GjcUnLoadListBean : ICheck {
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
|
||||
class GjcWaybillBean(
|
||||
// 代理人代码
|
||||
var agent: String? = null,
|
||||
// 业务类型
|
||||
var businesstype: String? = null,
|
||||
var businessType: String? = null,
|
||||
// 第一承运人
|
||||
var by1: String? = null,
|
||||
// 第二承运人
|
||||
var by2: String? = null,
|
||||
// 运单号
|
||||
var code: String? = null,
|
||||
var createdAt: String? = null,
|
||||
var createdBy: String? = null,
|
||||
var deleted: Boolean? = null,
|
||||
// 始发港
|
||||
var dep: String? = null,
|
||||
var desc: String? = null,
|
||||
// 目的港
|
||||
var dest: String? = null,
|
||||
// 第一目的站
|
||||
var dest1: String? = null,
|
||||
// 第二目的站
|
||||
var dest2: String? = null,
|
||||
// (预留)主提运单号扩展码(Default ‘0’)
|
||||
var exno: String? = null,
|
||||
var extraJson: String? = null,
|
||||
// 航班关闭时间(或退库时间)
|
||||
var fclose: String? = null,
|
||||
// 航班日期
|
||||
var fdate: String? = null,
|
||||
// 航班ID
|
||||
var fid: String? = null,
|
||||
// 航班号
|
||||
var fno: String? = null,
|
||||
// 品名
|
||||
var goods: String? = null,
|
||||
var id: String? = null,
|
||||
// 货位(库位or板箱号or平板号,RET为退库)
|
||||
var location: String? = null,
|
||||
// 货位标识(0:平板号;1:板箱;2:库位)
|
||||
var locflag: String? = null,
|
||||
// 平板车/ULD对应过磅记录的ID号(Default 0)
|
||||
var locId: String? = null,
|
||||
// 名称
|
||||
var name: String? = null,
|
||||
// 主提运单号
|
||||
var no: String? = null,
|
||||
// 操作时间
|
||||
var opdate: String? = null,
|
||||
// 操作人代码
|
||||
var opid: String? = null,
|
||||
// 操作人姓名
|
||||
var opname: String? = null,
|
||||
// 操作时间
|
||||
var organizationCode: String? = null,
|
||||
// 件数
|
||||
var pc: String? = null,
|
||||
// 主提运单前缀(承运人运单三字码)
|
||||
var prefix: String? = null,
|
||||
// 特码
|
||||
var spcode: String? = null,
|
||||
var spCode: String? = null,
|
||||
// 子码
|
||||
var subcode: String? = null,
|
||||
var updatedAt: String? = null,
|
||||
var updatedBy: String? = null,
|
||||
var version: String? = null,
|
||||
// 体积
|
||||
var volume: String? = null,
|
||||
// 货物操作凭证号
|
||||
var vouchernumber: String? = null,
|
||||
// (毛)重量
|
||||
var weight: String? = null,
|
||||
// 流水号(SEQ_StringImport.Nextval)
|
||||
var whid: String? = null
|
||||
) : ICheck {
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
// 运单号
|
||||
fun getWaybillCode() = prefix.noNull() + no.noNull()
|
||||
|
||||
// 是否是邮件
|
||||
fun isMail() = prefix == "000"
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjcWaybillDataBean(
|
||||
var maWb: WbBean? = WbBean(),
|
||||
var whList: List<GjcWaybillBean>? = listOf()
|
||||
)
|
||||
|
||||
class WbBean(
|
||||
var agent: String? = "",
|
||||
var arrivePc: Any? = Any(),
|
||||
var arriveVolume: Any? = Any(),
|
||||
var arriveWeight: Any? = Any(),
|
||||
var awbType: String? = "",
|
||||
var billsNo: Any? = Any(),
|
||||
var businessType: String? = "",
|
||||
var by0: Any? = Any(),
|
||||
var by1: String? = "",
|
||||
var by2: Any? = Any(),
|
||||
var cargoType: Any? = Any(),
|
||||
var checkIn: Any? = Any(),
|
||||
var cneeTel: Any? = Any(),
|
||||
var consignee: Any? = Any(),
|
||||
var dep: Any? = Any(),
|
||||
var dest: String? = "",
|
||||
var dest1: Any? = Any(),
|
||||
var dest2: Any? = Any(),
|
||||
var exno: Any? = Any(),
|
||||
var fclose: Any? = Any(),
|
||||
var fdate: Any? = Any(),
|
||||
var ffmMemo: Any? = Any(),
|
||||
var flight: String? = "",
|
||||
var fno: Any? = Any(),
|
||||
var goods: String? = "",
|
||||
var goodsCn: String? = "",
|
||||
var grossWeight: Int? = 0,
|
||||
var maWbId: Int? = 0,
|
||||
var mftMemo: Any? = Any(),
|
||||
var no: String? = "",
|
||||
var oldNo: Any? = Any(),
|
||||
var oldPrefix: Any? = Any(),
|
||||
var opDate: Any? = Any(),
|
||||
var opId: Any? = Any(),
|
||||
var organizationCode: Any? = Any(),
|
||||
var origin: Any? = Any(),
|
||||
var packageType: String? = "",
|
||||
var paperTime: Any? = Any(),
|
||||
var pc: Int? = 0,
|
||||
var prefix: String? = "",
|
||||
var range: String? = "",
|
||||
var recheckCount: Any? = Any(),
|
||||
var remark: Any? = Any(),
|
||||
var spCode: String? = "",
|
||||
var subCode: Any? = Any(),
|
||||
var tranFlag: Any? = Any(),
|
||||
var volume: Any? = Any(),
|
||||
var wbNo: String? = ""
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GjjGoodsAddBean : ICheck {
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
|
||||
class GjjGoodsBean(
|
||||
var agent: String? = "",
|
||||
var checkout: String? = "",
|
||||
var handtime: String? = "",
|
||||
var handtimeEnd: String? = "",
|
||||
var handtimeStart: String? = "",
|
||||
// 交接状态 0:未交接 1:已交接
|
||||
var isCheck: Int = 0,
|
||||
var movID: String? = "",
|
||||
var organizationcode: String? = "",
|
||||
var outMan: String? = "",
|
||||
var pc: String? = "",
|
||||
var revMan: String? = "",
|
||||
var sign: String? = "",
|
||||
var weight: String? = "",
|
||||
var whidList: String? = ""
|
||||
) {
|
||||
|
||||
// 展示逻辑
|
||||
val show = ObservableBoolean(false)
|
||||
|
||||
// 选中事件
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjjGoodsDetailsBean(
|
||||
var checkout: String? = "",
|
||||
var gjjWarehouseList: List<GjjWarehouse>? = listOf(),
|
||||
var handtime: String? = "",
|
||||
var isCheck: Int? = 0,
|
||||
var movID: String? = "",
|
||||
var `receiver`: String? = "",
|
||||
var sign: String? = ""
|
||||
)
|
||||
|
||||
class GjjWarehouse(
|
||||
var agent: String? = "",
|
||||
var awbType: String? = "",
|
||||
var billsNo: String? = "",
|
||||
var businessType: String? = "",
|
||||
var carrier: String? = "",
|
||||
var cashWeight: String? = "",
|
||||
var chargeFlag: String? = "",
|
||||
var days: String? = "",
|
||||
var dep: String? = "",
|
||||
var dest: String? = "",
|
||||
var exNo: String? = "",
|
||||
var fdate: String? = "",
|
||||
var fdateEnd: String? = "",
|
||||
var fdateStart: String? = "",
|
||||
var fdest: String? = "",
|
||||
var fid: String? = "",
|
||||
var flight: String? = "",
|
||||
var fno: String? = "",
|
||||
var gdate: String? = "",
|
||||
var goods: String? = "",
|
||||
var goodsCn: String? = "",
|
||||
var locFlag: String? = "",
|
||||
var location: String? = "",
|
||||
var movID: String? = "",
|
||||
var no: String? = "",
|
||||
var opDate: String? = "",
|
||||
var opId: String? = "",
|
||||
var opName: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var origin: String? = "",
|
||||
var pc: Int? = 0,
|
||||
var pickupTime: String? = "",
|
||||
var prefix: String? = "",
|
||||
var ref: String? = "",
|
||||
var spCode: String? = "",
|
||||
var subCode: String? = "",
|
||||
var volume: String? = "",
|
||||
var wbNo: String? = "",
|
||||
var weight: String? = "",
|
||||
var whid: String? = ""
|
||||
) {
|
||||
|
||||
fun getWaybillCode() = "${prefix}${no}"
|
||||
|
||||
fun getFlightDesc() = "${fdate}/${fno}"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjjGoodsTypeBean (
|
||||
var cargoName: String = "",
|
||||
var cargoType: String = ""
|
||||
){
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
|
||||
class GjjHandoverRecordBean(
|
||||
// 代理人代码
|
||||
var agent: String? = "",
|
||||
// 代理人
|
||||
var agentName: String? = "",
|
||||
// 提运单类型
|
||||
var awbType: String? = "",
|
||||
//
|
||||
var awbpc: String? = "",
|
||||
// 业务类型
|
||||
var businessType: String? = "",
|
||||
var cargoType: String? = "",
|
||||
var cashWeight: String? = "",
|
||||
var cneeCode: String? = "",
|
||||
var cneeId: String? = "",
|
||||
var cneeTel: String? = "",
|
||||
var code: String? = "",
|
||||
var consignee: String? = "",
|
||||
var createdAt: String? = "",
|
||||
var createdBy: String? = "",
|
||||
var dep: String? = "",
|
||||
var desc: String? = "",
|
||||
var dest: String? = "",
|
||||
var edep: String? = "",
|
||||
var edest1: String? = "",
|
||||
var edest2: String? = "",
|
||||
var efDate: String? = "",
|
||||
var efNo: String? = "",
|
||||
var exno: String? = "",
|
||||
var extra: String? = "",
|
||||
var fdate: String? = "",
|
||||
var fdep: String? = "",
|
||||
var fdest: String? = "",
|
||||
var fid: String? = "",
|
||||
var fno: String? = "",
|
||||
var goods: String? = "",
|
||||
var goodsCn: String? = "",
|
||||
var hno: String? = "",
|
||||
var id: String? = "",
|
||||
var isEdiAwb: String? = "",
|
||||
var istally: String? = "",
|
||||
var locFlag: String? = "",
|
||||
var locFlagMft: String? = "",
|
||||
var location: String? = "",
|
||||
var locationMft: String? = "",
|
||||
var mfId: String? = "",
|
||||
var mobiletally: String? = "",
|
||||
var name: String? = "",
|
||||
var no: String? = "",
|
||||
var opDate: String? = "",
|
||||
var opId: String? = "",
|
||||
var opname: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var origin: String? = "",
|
||||
var packageType: String? = "",
|
||||
var packagecode: String? = "",
|
||||
var pc: String? = "",
|
||||
var planpc: String? = "",
|
||||
var planvolume: String? = "",
|
||||
var planweight: String? = "",
|
||||
var prefix: String? = "",
|
||||
var ref: String? = "",
|
||||
var remark: String? = "",
|
||||
var spCode: String? = "",
|
||||
var splitFlag: String? = "",
|
||||
var subCode: String? = "",
|
||||
var tallydate: String? = "",
|
||||
var tallyid: String? = "",
|
||||
var tallyname: String? = "",
|
||||
var updatedAt: String? = "",
|
||||
var updatedBy: String? = "",
|
||||
var volume: Double? = 0.0,
|
||||
var wbNo: String? = "",
|
||||
var weight: String? = "",
|
||||
var whslocation: String? = "",
|
||||
var pcID: String? = "",
|
||||
) {
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
// 运单号
|
||||
fun getWaybillCode() = prefix.noNull() + no.noNull()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GjjManifestBean(
|
||||
var agent: String = "",
|
||||
var agentName: String? = "",
|
||||
var awbType: String = "",
|
||||
var awbpc: Int = 0,
|
||||
var businessType: String? = "",
|
||||
var cargoType: String? = "",
|
||||
var cashWeight: String? = "",
|
||||
var cneeCode: String? = "",
|
||||
var cneeId: String? = "",
|
||||
var cneeTel: String? = "",
|
||||
var code: String? = "",
|
||||
var consignee: String? = "",
|
||||
var createdAt: String? = "",
|
||||
var createdBy: String? = "",
|
||||
var dep: String? = "",
|
||||
var desc: String? = "",
|
||||
var dest: String = "",
|
||||
var edep: String? = "",
|
||||
var edest1: String? = "",
|
||||
var edest2: String? = "",
|
||||
var efDate: String? = "",
|
||||
var efNo: String? = "",
|
||||
var exno: String = "",
|
||||
var extra: String? = "",
|
||||
var fdate: String? = "",
|
||||
var fdep: String? = "",
|
||||
var fdest: String? = "",
|
||||
var fid: Int = 0,
|
||||
var fno: String? = "",
|
||||
var goods: String = "",
|
||||
var goodsCn: String? = "",
|
||||
var hno: String? = "",
|
||||
var id: String? = "",
|
||||
var isEdiAwb: String? = "",
|
||||
var istally: String? = "",
|
||||
var locFlag: String? = "",
|
||||
var locFlagMft: String? = "",
|
||||
var location: String? = "",
|
||||
var locationMft: String? = "",
|
||||
var mfId: String = "",
|
||||
var mobiletally: String? = "",
|
||||
var name: String? = "",
|
||||
var no: String = "",
|
||||
var opDate: String? = "",
|
||||
var opId: String? = "",
|
||||
var opname: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var origin: String = "",
|
||||
var packagecode: String? = "",
|
||||
var pc: Int = 0,
|
||||
var planpc: String? = "",
|
||||
var planvolume: String? = "",
|
||||
var planweight: String? = "",
|
||||
var prefix: String = "",
|
||||
var ref: String = "",
|
||||
var remark: String? = "",
|
||||
var spCode: String = "",
|
||||
var splitFlag: String? = "",
|
||||
var subCode: String? = "",
|
||||
var tallydate: String? = "",
|
||||
var tallyid: String? = "",
|
||||
var tallyname: String? = "",
|
||||
var updatedAt: String? = "",
|
||||
var updatedBy: String? = "",
|
||||
var volume: String = "",
|
||||
var wbNo: String = "",
|
||||
var weight: String = "",
|
||||
var storageTime: String = "",
|
||||
var whslocation: String? = ""
|
||||
) : BaseObservable(), ICheck {
|
||||
|
||||
// 展示逻辑
|
||||
val show = ObservableBoolean(false)
|
||||
|
||||
// 选中事件
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
// 获取运单号
|
||||
fun getWaybillCode() = "$prefix$no"
|
||||
|
||||
// 获取ULD描述
|
||||
fun getUldDesc() = "$dep-$dest"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjjManifestDetailsBean {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GjjPackTypeBean(
|
||||
var customsCode: String = "",
|
||||
var packageName: String = ""
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableArrayList
|
||||
import androidx.databinding.ObservableBoolean
|
||||
|
||||
class GjjTallyAddBean(
|
||||
var handoverRecordBean: GjjHandoverRecordBean
|
||||
) {
|
||||
|
||||
val show = ObservableBoolean(false)
|
||||
|
||||
// 件号列表
|
||||
var jianList: ObservableArrayList<JianBean> = ObservableArrayList<JianBean>()
|
||||
|
||||
fun addJian(code: String) {
|
||||
if (jianList.find { b -> b.code == JianBean.getCode(code) } == null) {
|
||||
jianList.add(JianBean.create(code))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.alibaba.fastjson.annotation.JSONField
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GjjTallyBean(
|
||||
// 代理人
|
||||
var agent: String? = "",
|
||||
// 业务类型
|
||||
var businessType: String? = "",
|
||||
// 目的港
|
||||
var dest: String? = "",
|
||||
// 航班日期
|
||||
var fdate: String? = "",
|
||||
// 航班流水号
|
||||
var fid: String? = "",
|
||||
// 航班号
|
||||
var fno: String? = "",
|
||||
// 货物品名
|
||||
var goods: String? = "",
|
||||
// 舱单流水号
|
||||
var mfId: String? = "",
|
||||
// 主提运单号
|
||||
var no: String? = "",
|
||||
// 始发港
|
||||
var origin: String? = "",
|
||||
// 件数
|
||||
var pc: String? = "",
|
||||
// 主键
|
||||
var pcID: String? = "",
|
||||
// 主提运单前缀(承运人运单三字码)
|
||||
var prefix: String? = "",
|
||||
// 舱单发放标识(0:未理货;1:已理货)
|
||||
var ref: String? = "",
|
||||
// 特种货物代码
|
||||
var spCode: String? = "",
|
||||
// 运单号
|
||||
var wbNo: String? = "",
|
||||
// 重量
|
||||
var weight: String? = "",
|
||||
) : BaseObservable(), ICheck {
|
||||
|
||||
// 是否选中
|
||||
@JSONField(serialize = false)
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
@JSONField(serialize = false)
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
// 获取运单号
|
||||
fun getWaybillNo() = "$prefix$no"
|
||||
|
||||
// 是否可以理货
|
||||
fun canTally() = ref == "0"
|
||||
|
||||
/**
|
||||
* 获取理货状态
|
||||
*/
|
||||
fun getTallyStatus(): String {
|
||||
return when (ref) {
|
||||
"0" -> "未理货"
|
||||
"1" -> "已理货"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期+航班号
|
||||
*/
|
||||
fun getDateFlightNo(): String {
|
||||
return "$fdate/$fno"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableArrayList
|
||||
|
||||
class GjjTallyDetailsBean(
|
||||
var carID: String? = "",
|
||||
var isBatch: String? = "",
|
||||
var list: String? = "",
|
||||
var mfId: String? = "",
|
||||
var no: String? = "",
|
||||
var organizationcode: String? = "",
|
||||
var pc: String? = "",
|
||||
var pcID: String? = "",
|
||||
var prefix: String? = "",
|
||||
var weight: String? = ""
|
||||
) {
|
||||
|
||||
// 件号列表
|
||||
var jianList: ObservableArrayList<JianBean> = ObservableArrayList<JianBean>()
|
||||
|
||||
fun initJianList() {
|
||||
jianList.clear()
|
||||
if (list.isNullOrEmpty()) {
|
||||
return
|
||||
}
|
||||
val listArr = list!!.split(",")
|
||||
listArr.forEach {
|
||||
addJian(it)
|
||||
}
|
||||
}
|
||||
|
||||
fun addJian(code: String) {
|
||||
if (code.isEmpty() || code.toInt() <= 0) {
|
||||
return
|
||||
}
|
||||
val codeIntStr = code.toInt().toString()
|
||||
if (jianList.find { b -> b.code == codeIntStr } == null) {
|
||||
jianList.add(JianBean(codeIntStr, code))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.alibaba.fastjson.annotation.JSONField
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GjjTallyRecordBean(
|
||||
var agent: String? = "",
|
||||
var awbType: String? = "",
|
||||
var billsNo: String? = "",
|
||||
var businessType: String? = "",
|
||||
var carrier: String? = "",
|
||||
var cashWeight: String? = "",
|
||||
var chargeFlag: String? = "",
|
||||
var days: String? = "",
|
||||
var dep: String? = "",
|
||||
var dest: String? = "",
|
||||
var exNo: String? = "",
|
||||
var fdate: String? = "",
|
||||
var fdateEnd: String? = "",
|
||||
var fdateStart: String? = "",
|
||||
var fdest: String? = "",
|
||||
var fid: String? = "",
|
||||
var flight: String? = "",
|
||||
var fno: String? = "",
|
||||
var gdate: String? = "",
|
||||
var goods: String? = "",
|
||||
var goodsCn: String? = "",
|
||||
var locFlag: String? = "",
|
||||
var location: String? = "",
|
||||
var movID: String? = "",
|
||||
var no: String? = "",
|
||||
var opDate: String? = "",
|
||||
var opId: String? = "",
|
||||
var opName: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var origin: String? = "",
|
||||
var pc: Int? = 0,
|
||||
var pickupTime: String? = "",
|
||||
var prefix: String? = "",
|
||||
var ref: String? = "",
|
||||
var spCode: String? = "",
|
||||
var subCode: String? = "",
|
||||
var volume: String? = "",
|
||||
var wbNo: String? = "",
|
||||
var weight: String? = "",
|
||||
var whid: String? = ""
|
||||
) : ICheck {
|
||||
|
||||
// 是否选中
|
||||
@JSONField(serialize = false)
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
@JSONField(serialize = false)
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
fun getFlightDesc() = "$fdate/$fno"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GncAssembleAddBean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
|
||||
data class GncAssembleListBean(
|
||||
/**
|
||||
* 有效性
|
||||
*/
|
||||
val activited: String = "",
|
||||
|
||||
/**
|
||||
* 分配状态 0:未分配,1:已分配
|
||||
*/
|
||||
val allocationStatus: String = "",
|
||||
|
||||
/**
|
||||
* 板型
|
||||
*/
|
||||
val boardType: String = "",
|
||||
|
||||
/**
|
||||
* 货物类型(C-货物,M-邮件,X-空板箱)
|
||||
*/
|
||||
val cargoType: String = "",
|
||||
|
||||
/**
|
||||
* 货重-必填
|
||||
*/
|
||||
val cargoWeight: String = "",
|
||||
|
||||
/**
|
||||
* 平板车号-必填
|
||||
*/
|
||||
val carId: String = "",
|
||||
|
||||
/**
|
||||
* 承运人
|
||||
*/
|
||||
val carrier: String = "",
|
||||
|
||||
/**
|
||||
* 平板车自重量-必填
|
||||
*/
|
||||
val carWeight: String = "",
|
||||
|
||||
/**
|
||||
* 板车状态-0未复磅、1已复磅
|
||||
*/
|
||||
val checkFlag: String = "",
|
||||
|
||||
/**
|
||||
* 复磅操作时间
|
||||
*/
|
||||
val copDate: String = "",
|
||||
|
||||
/**
|
||||
* 复磅人
|
||||
*/
|
||||
val copId: String = "",
|
||||
|
||||
/**
|
||||
* 转运司机
|
||||
*/
|
||||
val driver: String = "",
|
||||
|
||||
/**
|
||||
* 预计起飞时间
|
||||
*/
|
||||
val estimatedTakeOff: String = "",
|
||||
|
||||
/**
|
||||
* 航班关闭时间
|
||||
*/
|
||||
val fclose: String = "",
|
||||
|
||||
/**
|
||||
* 航班日期
|
||||
*/
|
||||
val fdate: String = "",
|
||||
|
||||
/**
|
||||
* 起始站
|
||||
*/
|
||||
val fdep: String = "",
|
||||
|
||||
/**
|
||||
* 目的站
|
||||
*/
|
||||
val fdest: String = "",
|
||||
|
||||
/**
|
||||
* 航班
|
||||
*/
|
||||
val flight: String = "",
|
||||
|
||||
/**
|
||||
* 航班号
|
||||
*/
|
||||
val fno: String = "",
|
||||
|
||||
/**
|
||||
* 装机单备注
|
||||
*/
|
||||
val ldRemark: String = "",
|
||||
|
||||
/**
|
||||
* 舱位
|
||||
*/
|
||||
val location: String = "",
|
||||
|
||||
/**
|
||||
* 货邮混装时邮件重量
|
||||
*/
|
||||
val mailWeight: String = "",
|
||||
|
||||
/**
|
||||
* 最大载重-必填
|
||||
*/
|
||||
val maxWeight: String = "",
|
||||
|
||||
/**
|
||||
* 净重(装机重量)-必填
|
||||
*/
|
||||
val netWeight: String = "",
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
val opDate: String = "",
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
val opId: String = "",
|
||||
|
||||
/**
|
||||
* 操作人--中文
|
||||
*/
|
||||
val username: String = "",
|
||||
|
||||
/**
|
||||
* 件数-必填
|
||||
*/
|
||||
val pc: String = "",
|
||||
|
||||
/**
|
||||
* 装载优先级
|
||||
*/
|
||||
val priority: String = "",
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
val remark: String = "",
|
||||
|
||||
/**
|
||||
* 机位
|
||||
*/
|
||||
val standId: String = "",
|
||||
|
||||
/**
|
||||
* 存放区域
|
||||
*/
|
||||
val storageArea: String = "",
|
||||
|
||||
/**
|
||||
* 总重-必填
|
||||
*/
|
||||
val totalWeight: String = "",
|
||||
|
||||
val transDate: String = "",
|
||||
val transId: String = "",
|
||||
|
||||
/**
|
||||
* 运输状态 字典表code = TRANSSTATUS
|
||||
*/
|
||||
val transStatus: String = "",
|
||||
|
||||
/**
|
||||
* 运输类型 字典表code = TRANSTYPE
|
||||
*/
|
||||
val transType: String = "",
|
||||
|
||||
/**
|
||||
* ULD编号
|
||||
*/
|
||||
val uld: String = "",
|
||||
|
||||
/**
|
||||
* ULD自重
|
||||
*/
|
||||
val uldWeight: String = "",
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
val useId: String = "",
|
||||
|
||||
/**
|
||||
* 体积-必填
|
||||
*/
|
||||
val volume: String = "",
|
||||
|
||||
/**
|
||||
* 仓库记录列表
|
||||
*/
|
||||
val warehouseList: List<WaybillBean>? = null
|
||||
) {
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
val showMore = ObservableBoolean(false)
|
||||
|
||||
// 获取复磅名称
|
||||
fun getFuBangStatusName(): String {
|
||||
return DictUtils.reWeightStatusList.find { it.value == checkFlag }?.key.noNull()
|
||||
}
|
||||
|
||||
// 获取截载状态
|
||||
fun getJieZaiStatusName(): String {
|
||||
return DictUtils.cutStatusList.find { it.value == activited }?.key.noNull()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.BR
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GncCunFangBean : ICheck {
|
||||
var activited: String = "" // 0
|
||||
var allocationStatus: String = "" // 0
|
||||
var boardType: String = "" // null
|
||||
var carId: String = "" // 304
|
||||
var carWeight: String = "" // null
|
||||
var cargoType: String = "" // M
|
||||
var cargoWeight: String = "" // 350
|
||||
var carrier: String = "" // MU
|
||||
|
||||
// 板车状态-0未复磅、1已复磅
|
||||
var checkFlag: String = "" // null
|
||||
val checkFlagName: String
|
||||
get() {
|
||||
return when (checkFlag) {
|
||||
"0" -> "未复磅"
|
||||
"1" -> "已复磅"
|
||||
"2" -> "二次复磅"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
var copDate: String = "" // null
|
||||
var copId: String = "" // null
|
||||
var driver: String = "" // null
|
||||
var estimatedTakeOff: String = "" // null
|
||||
val estimatedTakeOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
estimatedTakeOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(estimatedTakeOff)
|
||||
}
|
||||
// 计划起飞时间
|
||||
var scheduledTackOff: String = ""
|
||||
|
||||
val scheduledTackOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
scheduledTackOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(scheduledTackOff)
|
||||
}
|
||||
var fclose: String = "" // 0001-01-01 00:00:00
|
||||
var fdate: String = "" // 2024-06-19
|
||||
var fdep: String = "" // null
|
||||
var fdest: String = "" // PEK
|
||||
var flight: String = "" // null
|
||||
var fno: String = "" // MU2023
|
||||
var ldRemark: String = "" // null
|
||||
var location: String = "" // null
|
||||
var mailWeight: String = "" // null
|
||||
var maxWeight: String = "" // null
|
||||
var mcn: String = "" // null
|
||||
var netWeight: String = "" // null
|
||||
var opDate: String = "" // null
|
||||
var opId: String = "" // null
|
||||
var pc: String = "" // null
|
||||
var priority: String = "" // 1
|
||||
var remark: String = "" // null
|
||||
var spCode: String = "" // null
|
||||
var spCodeStatus: String = "" // null
|
||||
var standId: String = "" // null
|
||||
var storageArea: String = "" // null
|
||||
var tcn: String = "" // null
|
||||
var totalWeight: String = "" // null
|
||||
var transDate: String = "" // null
|
||||
var transDep: String = "" // null
|
||||
var transDest: String = "" // null
|
||||
var transFlag: String = "" // null
|
||||
var transId: String = "" // null
|
||||
var transStatus: String = "" // null
|
||||
var transType: String = "" // null
|
||||
var uld: String = "" // null
|
||||
var uldWeight: String = "" // null
|
||||
var useId: String = "" // 764700
|
||||
var username: String = "" // null
|
||||
var volume: String = "" // null
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
/**
|
||||
* 校验起飞时间是否明天
|
||||
*/
|
||||
fun verifyTakeOffNextDay(): Boolean {
|
||||
if (fdate.isEmpty() || estimatedTakeOff.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
val calendarFDate = DateUtils.getCalendar(fdate, DevFinal.TIME.yyyyMMdd_HYPHEN)
|
||||
val calendarTakeOff =
|
||||
DateUtils.getCalendar(estimatedTakeOff, DevFinal.TIME.yyyyMMddHHmmss_HYPHEN)
|
||||
return DateUtils.getDay(calendarTakeOff) > DateUtils.getDay(calendarFDate)
|
||||
}
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GncDistributionBean : ICheck {
|
||||
// 0:出港,1:进港
|
||||
var status: String = ""
|
||||
|
||||
// 截载状态 0未截载、1已截载
|
||||
var activited: String = "" // 0
|
||||
|
||||
// 分配状态 0:未分配,1:已分配
|
||||
var allocationStatus: String = "" // 0
|
||||
|
||||
var allocationDate: String = ""
|
||||
|
||||
val allocationStatusName: String
|
||||
get() {
|
||||
return when (allocationStatus) {
|
||||
"0" -> "未分配"
|
||||
"1" -> "已分配"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
// 板型
|
||||
var boardType: String = "" // null
|
||||
|
||||
// 平板车号-必填
|
||||
var carId: String = "" // 012
|
||||
|
||||
// 平板车自重量-必填
|
||||
var carWeight: String = "" // null
|
||||
|
||||
// 货物类型(C-货物,M-邮件,X-空板箱)
|
||||
var cargoType: String = "" // null
|
||||
|
||||
// 货重-必填
|
||||
var cargoWeight: String = "" // 300
|
||||
|
||||
// 承运人
|
||||
var carrier: String = "" // MU
|
||||
|
||||
// 板车状态-0未复磅、1已复磅
|
||||
var checkFlag: String = "" // null
|
||||
|
||||
val checkFlagName: String
|
||||
get() {
|
||||
return when (checkFlag) {
|
||||
"0" -> "未复磅"
|
||||
"1" -> "已复磅"
|
||||
"2" -> "二次复磅"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
// 复磅操作时间
|
||||
var copDate: String = "" // null
|
||||
|
||||
// 复磅人
|
||||
var copId: String = "" // null
|
||||
|
||||
// 转运司机
|
||||
var driver: String = "" // null
|
||||
|
||||
// 初始被分配司机
|
||||
var allocationDriver: String = "" // null
|
||||
|
||||
// 预计起飞时间
|
||||
var estimatedTakeOff: String = "" // null
|
||||
|
||||
val estimatedTakeOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
estimatedTakeOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(estimatedTakeOff)
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验起飞时间是否明天
|
||||
*/
|
||||
fun verifyTakeOffNextDay(): Boolean {
|
||||
if (fdate.isEmpty() || estimatedTakeOff.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
val calendarFDate = DateUtils.getCalendar(fdate, DevFinal.TIME.yyyyMMdd_HYPHEN)
|
||||
val calendarTakeOff =
|
||||
DateUtils.getCalendar(estimatedTakeOff, DevFinal.TIME.yyyyMMddHHmmss_HYPHEN)
|
||||
return DateUtils.getDay(calendarTakeOff) > DateUtils.getDay(calendarFDate)
|
||||
}
|
||||
// 预计起飞时间
|
||||
var scheduledTackOff: String = "" // null
|
||||
|
||||
val scheduledTackOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
scheduledTackOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(scheduledTackOff)
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验起飞时间是否明天
|
||||
*/
|
||||
fun verifyscheduledTackOffNextDay(): Boolean {
|
||||
if (fdate.isEmpty() || estimatedTakeOff.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
val calendarFDate = DateUtils.getCalendar(fdate, DevFinal.TIME.yyyyMMdd_HYPHEN)
|
||||
val calendarTakeOff =
|
||||
DateUtils.getCalendar(estimatedTakeOff, DevFinal.TIME.yyyyMMddHHmmss_HYPHEN)
|
||||
return DateUtils.getDay(calendarTakeOff) > DateUtils.getDay(calendarFDate)
|
||||
}
|
||||
|
||||
// 航班关闭时间
|
||||
var fclose: String = "" // 0001-01-01 00:00:00
|
||||
|
||||
// 航班日期
|
||||
var fdate: String = "" // 2024-04-11
|
||||
|
||||
// 起始站
|
||||
var fdep: String = "" // null
|
||||
|
||||
// 目的站
|
||||
var fdest: String = "" // PEK
|
||||
|
||||
// 航班
|
||||
var flight: String = "" // null
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$fdate/$fno"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
// 航班号
|
||||
var fno: String = "" // MU2023
|
||||
|
||||
|
||||
var mftFno: String = "" // MU2023
|
||||
get() {
|
||||
if (activited != "1") {
|
||||
field = ""
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
var mftFdate: String = ""
|
||||
get() {
|
||||
if (activited != "1") {
|
||||
field = ""
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
var mftFid: String = ""
|
||||
|
||||
val compareMftFlight: Boolean
|
||||
get () {
|
||||
return fno == mftFno && fdate == mftFdate
|
||||
}
|
||||
|
||||
|
||||
// 装机单备注
|
||||
var ldRemark: String = "" // null
|
||||
|
||||
// 舱位
|
||||
var location: String = "" // null
|
||||
|
||||
// 货邮混装时邮件重量
|
||||
var mailWeight: String = "" // null
|
||||
|
||||
// 最大载重-必填
|
||||
var maxWeight: String = "" // null
|
||||
|
||||
// 邮件票数
|
||||
var mcn: String = "" // null
|
||||
|
||||
// 净重(装机重量)-必填
|
||||
var netWeight: String = "" // null
|
||||
|
||||
// 操作时间
|
||||
var opDate: String = "" // null
|
||||
|
||||
// 操作人
|
||||
var opId: String = "" // null
|
||||
|
||||
// 件数-必填
|
||||
var pc: String = "" // null
|
||||
|
||||
// 装载优先级
|
||||
var priority: String = "" // 0
|
||||
// 优先配送 0正常、1优先
|
||||
var locPriority: String = "" // 0
|
||||
|
||||
// 备注
|
||||
var remark: String = "" // null
|
||||
|
||||
// 机位
|
||||
var standId: String = "" // null
|
||||
|
||||
// 存放区域
|
||||
var storageArea: String = "" // null
|
||||
|
||||
// 普货和邮件票数总计
|
||||
var tcn: String = "" // null
|
||||
|
||||
// 总重-必填
|
||||
var totalWeight: String = "" // null
|
||||
var transDate: String = "" // null
|
||||
var transId: String = "" // null
|
||||
|
||||
// 运输状态 字典表code = TRANSSTATUS(0待运输、1开始运输、2完成运输)
|
||||
var transStatus: String = "" // null
|
||||
|
||||
// 运输类型 字典表code = TRANSTYPE()
|
||||
var transType: String = "" // null
|
||||
var uld: String = "" // null
|
||||
var uldWeight: String = "" // null
|
||||
var useId: String = "" // 764681
|
||||
|
||||
// 中文名
|
||||
var username: String = "" // null
|
||||
|
||||
// 体积-必填
|
||||
var volume: String = "" // null
|
||||
|
||||
// 特码
|
||||
var spCode: String = "" // null
|
||||
// 0普货、1特货
|
||||
var spCodeStatus: String = "" // null
|
||||
|
||||
// 加货标识
|
||||
var addCargoFlag: String = ""
|
||||
|
||||
val addCargoFlagName: String
|
||||
get() {
|
||||
return when (addCargoFlag) {
|
||||
"1" -> "待加货"
|
||||
"2" -> "完成加货"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
// 完成加货时间
|
||||
var addCargoDate: String = ""
|
||||
|
||||
// 完成加货人
|
||||
var addCargoId: String = ""
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,451 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import com.lukouguoji.module_base.BR
|
||||
import com.lukouguoji.module_base.ktx.limit
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GncFuBangBean : BaseObservable() {
|
||||
// 有效性
|
||||
@Bindable
|
||||
var activited: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.activited)
|
||||
}
|
||||
|
||||
// 分配状态 0:未分配,1:已分配
|
||||
@Bindable
|
||||
var allocationStatus: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.allocationStatus)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var boardType: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.boardType)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var carId: String = "" // 166
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carId)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var carWeight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carWeight)
|
||||
computeWeight()
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var cargoType: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cargoType)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var cargoWeight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cargoWeight)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var ccargoWeight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.ccargoWeight)
|
||||
}
|
||||
|
||||
// 复磅总重
|
||||
var ctotalWeight: String = ""
|
||||
|
||||
@Bindable
|
||||
var carrier: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carrier)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var checkFlag: String = "" //
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.checkFlag)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var mftFlag: String = "" //
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mftFlag)
|
||||
}
|
||||
|
||||
val checkFlagName: String
|
||||
get() {
|
||||
return when (checkFlag) {
|
||||
"0" -> "未复磅"
|
||||
"1" -> "已复磅"
|
||||
"2" -> "二次复磅"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
@Bindable
|
||||
var mftFno: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mftFno)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var mftFdate: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mftFdate)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var mftFid: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mftFid)
|
||||
}
|
||||
|
||||
val compareMftFlight: Boolean
|
||||
get () {
|
||||
return fno == mftFno && fdate == mftFdate
|
||||
}
|
||||
|
||||
val mftFlight: String
|
||||
get() {
|
||||
if (mftFdate != "" && mftFno != "" && activited == "1") {
|
||||
val (year, mon, day) = mftFdate.split("-")
|
||||
return "${year}${mon}${day}/${mftFno}"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var copDate: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.copDate)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var copId: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.copId)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var driver: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.driver)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var estimatedTakeOff: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.estimatedTakeOff)
|
||||
}
|
||||
|
||||
|
||||
@Bindable
|
||||
var scheduledTackOff: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.scheduledTackOff)
|
||||
}
|
||||
|
||||
val scheduledTackOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
scheduledTackOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(scheduledTackOff)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var fclose: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fclose)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var fdate: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fdate)
|
||||
}
|
||||
|
||||
// 货物目的站
|
||||
var dest: String = ""
|
||||
|
||||
@Bindable
|
||||
var fdep: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fdep)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var fdest: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fdest)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var flight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.flight)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var fno: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fno)
|
||||
}
|
||||
|
||||
val scheduleFlight: String
|
||||
get() {
|
||||
val (year, mon, day) = fdate.split("-")
|
||||
return "${year}${mon}${day}/${fno}"
|
||||
}
|
||||
|
||||
|
||||
@Bindable
|
||||
var ldRemark: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.ldRemark)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var location: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.location)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var mailWeight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mailWeight)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var maxWeight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.maxWeight)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var netWeight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.netWeight)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var opDate: String = "" // 2024-06-13 10:51:43
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.opDate)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var opId: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.opId)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var pc: String = "" // 6000
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.pc)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var priority: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.priority)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var remark: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.remark)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var standId: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.standId)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var storageArea: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.storageArea)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var totalWeight: String = "" // 1770
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.totalWeight)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var transDate: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.transDate)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var transId: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.transId)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var transStatus: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.transStatus)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var transType: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.transType)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var uld: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.uld)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var uldWeight: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.uldWeight)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var useId: String = "" // 764653
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.useId)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var volume: String = "" // 0.36
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.volume)
|
||||
}
|
||||
|
||||
/**
|
||||
* 偏差
|
||||
*/
|
||||
@Bindable
|
||||
var deviation: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.deviation)
|
||||
}
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
computeWeight()
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前净重
|
||||
*/
|
||||
@Bindable
|
||||
var currentWeight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.currentWeight)
|
||||
}
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
computeWeight()
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
/**
|
||||
* 地磅重量
|
||||
*/
|
||||
@Bindable
|
||||
var weighbridgeWeight: String = "0"
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.weighbridgeWeight)
|
||||
computeWeight()
|
||||
}
|
||||
|
||||
var username: String = ""
|
||||
|
||||
/**
|
||||
* 计算重量
|
||||
*/
|
||||
fun computeWeight() {
|
||||
// 地磅称重
|
||||
val ww = weighbridgeWeight.toFloatOrNull() ?: 0f
|
||||
// 平板车自重
|
||||
val carW = carWeight.toFloatOrNull() ?: 0f
|
||||
// 净重
|
||||
val netW = netWeight.toFloatOrNull() ?: 0f
|
||||
|
||||
if (netW == 0f) {
|
||||
currentWeight = ""
|
||||
deviation = ""
|
||||
return
|
||||
}
|
||||
|
||||
currentWeight = (ww - carW).toString()
|
||||
|
||||
deviation = (((ww - carW) / netW - 1) * 100f).limit(1) + "%"
|
||||
|
||||
ctotalWeight = weighbridgeWeight
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GncQueryBean : ICheck {
|
||||
var activeId: String = "" // null
|
||||
var agentCode: String = "" // LH
|
||||
var awbType: String = "" // null
|
||||
var billsNo: String = "" // null
|
||||
var businessType: String = "" // null
|
||||
var by0: String = "" // null
|
||||
var by1: String = "" // null
|
||||
var by2: String = "" // null
|
||||
var carNo: String = "" // null
|
||||
var cargoType: String = "" // null
|
||||
var carrier: String = "" // null
|
||||
var checkIn: String = "" // null
|
||||
var cneeCode: String = "" // null
|
||||
var cneeId: String = "" // null
|
||||
var cneeTel: String = "" // null
|
||||
var consignee: String = "" // null
|
||||
var dep: String = "" // HFE
|
||||
var dest: String = "" // NKG
|
||||
var dest1: String = "" // NKG
|
||||
var dest2: String = "" // null
|
||||
var dgrDetail: String = "" // null
|
||||
var dgrLocation: String = "" // null
|
||||
var estimatedTakeOff: String = "" // null
|
||||
var fclose: String = "" // null
|
||||
var fdate: String = "" // 2024-06-20
|
||||
var flight: String = "" // 20240620/CZ2022
|
||||
var fno: String = "" // CZ2022
|
||||
var goods: String = "" // 黄金
|
||||
var lable: String = "" // null
|
||||
var mawbId: String = "" // 764704
|
||||
var no: String = "" // 22222760
|
||||
var oldNo: String = "" // null
|
||||
var oldPrefix: String = "" // null
|
||||
var opDate: String = "" // 2024-06-20 10:50:12
|
||||
var opId: String = "" // null
|
||||
var origin: String = "" // null
|
||||
var packageType: String = "" // null
|
||||
var paperTime: String = "" // null
|
||||
var pc: String = "" // 150
|
||||
var prefix: String = "" // 784
|
||||
var range: String = "" // HFE-NKG
|
||||
var remark: String = "" // null
|
||||
var scheduledArrival: String = "" // null
|
||||
var spCode: String = "" // null
|
||||
var subCode: String = "" // null
|
||||
var uld: String = "" // null
|
||||
var uldWeight: String = "" // null
|
||||
var unNumber: String = "" // null
|
||||
var volDetail: String = "" // null
|
||||
var volume: String = "" // null
|
||||
var wbNo: String = "" // 78422222760
|
||||
var weight: String = "" // 500
|
||||
// 出库时间
|
||||
var departTime: String = "" // null
|
||||
// 入库时间
|
||||
var storageTime: String = "" // 2024-06-21 15:24:27
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GncQueryDetailsBean {
|
||||
var maWb: GncQueryBean = GncQueryBean()
|
||||
var whList: List<WhBean> = listOf()
|
||||
|
||||
class WhBean {
|
||||
var activeId: String = "" // null
|
||||
var agentCode: String = "" // null
|
||||
var awbType: String = "" // null
|
||||
var billsNo: String = "" // null
|
||||
var businessType: String = "" // null
|
||||
var by1: String = "" // null
|
||||
var by2: String = "" // null
|
||||
var carrier: String = "" // null
|
||||
var chargeFlag: String = "" // null
|
||||
var days: String = "" // null
|
||||
var dep: String = "" // null
|
||||
var dest: String = "" // null
|
||||
var dest1: String = "" // null
|
||||
var dest2: String = "" // null
|
||||
var dgrDetail: String = "" // 2.1项易燃气体
|
||||
var dgrLocation: String = "" // 危险品存放区
|
||||
var fclose: String = "" // null
|
||||
var fdate: String = "" // null
|
||||
var flight: String = ""
|
||||
var fno: String = "" // null
|
||||
var gdate: String = "" // null
|
||||
var goods: String = "" // null
|
||||
var locFlag: String = "" // 2
|
||||
var locStatus: String = "" // null
|
||||
var location: String = "" // null
|
||||
var no: String = "" // 22222830
|
||||
var opDate: String = "" // 2024-06-21 17:44:59
|
||||
var opId: String = "" // ADMIN
|
||||
var packageType: String = "" // null
|
||||
var pc: String = "" // 50
|
||||
var prefix: String = "" // 781
|
||||
var range: String = "" // null
|
||||
var spCode: String = "" // null
|
||||
var splitFlag: String = "" // 0
|
||||
var subCode: String = "" // null
|
||||
var username: String = "" // null
|
||||
var volume: String = "" // 2.73
|
||||
var wbNo: String = "" // null
|
||||
var weight: String = "" // 600
|
||||
var whId: String = "" // 764748
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,494 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.BR
|
||||
import com.lukouguoji.module_base.ktx.limit
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GncShouYunBean : BaseObservable() {
|
||||
// 有效性
|
||||
@Bindable
|
||||
var activeId: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.activeId)
|
||||
}
|
||||
|
||||
// 有效性
|
||||
@Bindable
|
||||
var whId: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.whId)
|
||||
}
|
||||
|
||||
// 代理
|
||||
@Bindable
|
||||
var agentCode: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.agentCode)
|
||||
}
|
||||
|
||||
// 运单类型
|
||||
@Bindable
|
||||
var awbType: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.awbType)
|
||||
}
|
||||
|
||||
// 账单号
|
||||
@Bindable
|
||||
var billsNo: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.billsNo)
|
||||
}
|
||||
|
||||
// 业务类型
|
||||
@Bindable
|
||||
var businessType: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.businessType)
|
||||
}
|
||||
|
||||
// 承运人
|
||||
@Bindable
|
||||
var by0: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.by0)
|
||||
}
|
||||
|
||||
// 第一承运人
|
||||
@Bindable
|
||||
var by1: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.by1)
|
||||
}
|
||||
|
||||
// 第二承运人
|
||||
@Bindable
|
||||
var by2: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.by2)
|
||||
}
|
||||
|
||||
// 板车编号
|
||||
@Bindable
|
||||
var carNo: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carNo)
|
||||
}
|
||||
|
||||
// 货物类型
|
||||
@Bindable
|
||||
var cargoType: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cargoType)
|
||||
}
|
||||
|
||||
// 承运人
|
||||
@Bindable
|
||||
var carrier: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carrier)
|
||||
}
|
||||
|
||||
// 入库标识 0:未入库,1:入库结束
|
||||
@Bindable
|
||||
var checkIn: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.checkIn)
|
||||
}
|
||||
|
||||
// 收货人代码
|
||||
@Bindable
|
||||
var cneeCode: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cneeCode)
|
||||
}
|
||||
|
||||
// 收货人身份证号
|
||||
@Bindable
|
||||
var cneeId: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cneeId)
|
||||
}
|
||||
|
||||
// 收货人电话
|
||||
@Bindable
|
||||
var cneeTel: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cneeTel)
|
||||
}
|
||||
|
||||
// 收货人
|
||||
@Bindable
|
||||
var consignee: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.consignee)
|
||||
}
|
||||
|
||||
// 出发站
|
||||
@Bindable
|
||||
var dep: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dep)
|
||||
}
|
||||
|
||||
// 目的港
|
||||
@Bindable
|
||||
var dest: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dest)
|
||||
}
|
||||
|
||||
// 第一目的港
|
||||
@Bindable
|
||||
var dest1: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dest1)
|
||||
}
|
||||
|
||||
// 第2目的港
|
||||
@Bindable
|
||||
var dest2: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dest2)
|
||||
}
|
||||
|
||||
// 危险品库
|
||||
@Bindable
|
||||
var dgrLocation: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dgrLocation)
|
||||
}
|
||||
|
||||
// 危险品描述
|
||||
@Bindable
|
||||
var dgrDetail: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dgrDetail)
|
||||
}
|
||||
|
||||
// 预计起飞时间
|
||||
@Bindable
|
||||
var scheduledTackOff: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.scheduledTackOff)
|
||||
}
|
||||
|
||||
val scheduledTackOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
scheduledTackOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(scheduledTackOff)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验起飞时间是否明天
|
||||
*/
|
||||
fun verifyTakeOffNextDay(): Boolean {
|
||||
if (fdate.isEmpty() || scheduledTackOff.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
val calendarFDate = DateUtils.getCalendar(fdate, DevFinal.TIME.yyyyMMdd_HYPHEN)
|
||||
val calendarTakeOff =
|
||||
DateUtils.getCalendar(scheduledTackOff, DevFinal.TIME.yyyyMMddHHmmss_HYPHEN)
|
||||
return DateUtils.getDay(calendarTakeOff) > DateUtils.getDay(calendarFDate)
|
||||
}
|
||||
|
||||
// 截载时间
|
||||
@Bindable
|
||||
var fclose: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fclose)
|
||||
}
|
||||
|
||||
// 航班日期
|
||||
@Bindable
|
||||
var fdate: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fdate)
|
||||
}
|
||||
|
||||
// 航班信息
|
||||
@Bindable
|
||||
var flight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.flight)
|
||||
}
|
||||
|
||||
// 航班号
|
||||
@Bindable
|
||||
var fno: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fno)
|
||||
}
|
||||
|
||||
// 品名
|
||||
@Bindable
|
||||
var goods: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.goods)
|
||||
}
|
||||
|
||||
// 标签
|
||||
@Bindable
|
||||
var lable: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.lable)
|
||||
}
|
||||
|
||||
// ID
|
||||
@Bindable
|
||||
var mawbId: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mawbId)
|
||||
}
|
||||
|
||||
// 运单号
|
||||
@Bindable
|
||||
var no: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.no)
|
||||
}
|
||||
|
||||
// 原运单号
|
||||
@Bindable
|
||||
var oldNo: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.oldNo)
|
||||
}
|
||||
|
||||
// 原运单号前缀
|
||||
@Bindable
|
||||
var oldPrefix: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.oldPrefix)
|
||||
}
|
||||
|
||||
// 操作日期
|
||||
@Bindable
|
||||
var opDate: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.opDate)
|
||||
}
|
||||
|
||||
// 操作人代码
|
||||
@Bindable
|
||||
var opId: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.opId)
|
||||
}
|
||||
|
||||
// 始发站
|
||||
@Bindable
|
||||
var origin: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.origin)
|
||||
}
|
||||
|
||||
// 包装类型
|
||||
@Bindable
|
||||
var packageType: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.packageType)
|
||||
}
|
||||
|
||||
// 接单时间
|
||||
@Bindable
|
||||
var paperTime: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.paperTime)
|
||||
}
|
||||
|
||||
// 件数
|
||||
@Bindable
|
||||
var pc: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.pc)
|
||||
}
|
||||
|
||||
// 预配件数
|
||||
var apc: String = ""
|
||||
|
||||
// 运单前缀
|
||||
@Bindable
|
||||
var prefix: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.prefix)
|
||||
}
|
||||
|
||||
// 完整航程: NJ-PK-SHY or NJ-PK
|
||||
@Bindable
|
||||
var range: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.range)
|
||||
}
|
||||
|
||||
// 备注
|
||||
@Bindable
|
||||
var remark: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.remark)
|
||||
}
|
||||
|
||||
// 预计到达时间
|
||||
@Bindable
|
||||
var scheduledArrival: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.scheduledArrival)
|
||||
}
|
||||
|
||||
// 特码
|
||||
@Bindable
|
||||
var spCode: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.spCode)
|
||||
}
|
||||
|
||||
// 子码
|
||||
@Bindable
|
||||
var subCode: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.subCode)
|
||||
}
|
||||
|
||||
// ULD编号
|
||||
@Bindable
|
||||
var uld: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.uld)
|
||||
}
|
||||
|
||||
// ULD自重
|
||||
@Bindable
|
||||
var uldWeight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.uldWeight)
|
||||
}
|
||||
|
||||
// UN编号
|
||||
@Bindable
|
||||
var unNumber: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.unNumber)
|
||||
}
|
||||
|
||||
// 体积明细
|
||||
@Bindable
|
||||
var volDetail: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.volDetail)
|
||||
}
|
||||
|
||||
// 体积
|
||||
@Bindable
|
||||
var volume: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.volume)
|
||||
}
|
||||
|
||||
// 运单号
|
||||
@Bindable
|
||||
var wbNo: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.wbNo)
|
||||
}
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$prefix$no"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
// 重量
|
||||
@Bindable
|
||||
var weight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.weight)
|
||||
volume = ((field.toFloatOrNull() ?: 0f) / 220f).limit(2)
|
||||
}
|
||||
|
||||
// 平板车重量
|
||||
@Bindable
|
||||
var carWeight: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.carWeight)
|
||||
}
|
||||
|
||||
var location: String = ""
|
||||
|
||||
var username: String = ""
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
var aircraftCode: String = ""
|
||||
|
||||
fun getRangeFirst(): String {
|
||||
return range.split("-").firstOrNull() ?: ""
|
||||
}
|
||||
|
||||
fun getRangeSecond(): String {
|
||||
return range.split("-").getOrNull(1) ?: ""
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GncStashBean : ICheck {
|
||||
var activeId: String = "" // null
|
||||
var agentCode: String = "" // LH
|
||||
var awbType: String = "" // null
|
||||
var billsNo: String = "" // null
|
||||
var businessType: String = "" // null
|
||||
var by1: String = "" // null
|
||||
var by2: String = "" // null
|
||||
var carrier: String = "" // null
|
||||
var chargeFlag: String = "" // null
|
||||
var days: String = "" // null
|
||||
var dep: String = "" // null
|
||||
var dest: String = "" // null
|
||||
var dest1: String = "" // null
|
||||
var dest2: String = "" // null
|
||||
var dgrLocation: String = "" // null
|
||||
var fclose: String = "" // null
|
||||
var fdate: String = "" // null
|
||||
var flight: String = "" // null
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$fdate/$fno"
|
||||
}
|
||||
return field
|
||||
}
|
||||
var fno: String = "" // CZ2022
|
||||
var gdate: String = "" // null
|
||||
var goods: String = "" // 黄金
|
||||
var locFlag: String = "" // null
|
||||
var locStatus: String = "" // 1
|
||||
var location: String = "" // 166
|
||||
var no: String = "" // 22222760
|
||||
var opDate: String = "" // 2024-06-20 10:50:12
|
||||
var opId: String = "" // ADMIN
|
||||
var packageType: String = "" // null
|
||||
var pc: String = "" // 150
|
||||
var prefix: String = "" // 784
|
||||
var range: String = "" // null
|
||||
var spCode: String = "" // CCF
|
||||
var splitFlag: String = "" // null
|
||||
var subCode: String = "" // null
|
||||
var username: String = "" // 超级用户
|
||||
var volume: String = "" // null
|
||||
var wbNo: String = "" // 78422222760
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$prefix$no"
|
||||
}
|
||||
return field
|
||||
}
|
||||
var weight: String = "" // 500
|
||||
var whId: String = "" // 764706
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
/**
|
||||
* GncWarehouse
|
||||
*/
|
||||
data class GncWarehouse(
|
||||
/**
|
||||
* 有效性
|
||||
*/
|
||||
val activeId: Long? = null,
|
||||
|
||||
/**
|
||||
* 代理
|
||||
*/
|
||||
val agentCode: String? = null,
|
||||
|
||||
/**
|
||||
* 运单类型
|
||||
*/
|
||||
val awbType: String? = null,
|
||||
|
||||
/**
|
||||
* 账单号(或免费、销账备注)
|
||||
*/
|
||||
val billsNo: String? = null,
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
val businessType: String? = null,
|
||||
|
||||
/**
|
||||
* 第1承运人
|
||||
*/
|
||||
val by1: String? = null,
|
||||
|
||||
/**
|
||||
* 第2承运人
|
||||
*/
|
||||
val by2: String? = null,
|
||||
|
||||
/**
|
||||
* 收费标识
|
||||
*/
|
||||
val chargeFlag: String? = null,
|
||||
|
||||
/**
|
||||
* 入库天数
|
||||
*/
|
||||
val days: Long? = null,
|
||||
|
||||
/**
|
||||
* 出发站
|
||||
*/
|
||||
val dep: String? = null,
|
||||
|
||||
/**
|
||||
* 目的站
|
||||
*/
|
||||
val dest: String? = null,
|
||||
|
||||
/**
|
||||
* 第1目的站
|
||||
*/
|
||||
val dest1: String? = null,
|
||||
|
||||
/**
|
||||
* 第2目的站
|
||||
*/
|
||||
val dest2: String? = null,
|
||||
|
||||
/**
|
||||
* 危险品库
|
||||
*/
|
||||
val dgrLocation: String? = null,
|
||||
|
||||
/**
|
||||
* 航班关闭时间
|
||||
*/
|
||||
val fclose: String? = null,
|
||||
|
||||
/**
|
||||
* 航班日期
|
||||
*/
|
||||
val fdate: String? = null,
|
||||
|
||||
/**
|
||||
* 航班
|
||||
*/
|
||||
val flight: String? = null,
|
||||
|
||||
/**
|
||||
* 航班号
|
||||
*/
|
||||
val fno: String? = null,
|
||||
|
||||
/**
|
||||
* 按入库时间分组
|
||||
*/
|
||||
val gdate: String? = null,
|
||||
|
||||
/**
|
||||
* 品名
|
||||
*/
|
||||
val goods: String? = null,
|
||||
|
||||
/**
|
||||
* 货位(库位or板箱号or平板号,RET为退库)
|
||||
*/
|
||||
val location: String? = null,
|
||||
|
||||
/**
|
||||
* 货位标识(0:库位;1:板箱;2:平板)
|
||||
*/
|
||||
val locFlag: String? = null,
|
||||
|
||||
/**
|
||||
* 是否上舱单
|
||||
*/
|
||||
val locStatus: String? = null,
|
||||
|
||||
/**
|
||||
* 运单号
|
||||
*/
|
||||
val no: String? = null,
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
val opDate: String? = null,
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
val opId: String? = null,
|
||||
|
||||
/**
|
||||
* 包装类型
|
||||
*/
|
||||
val packageType: String? = null,
|
||||
|
||||
/**
|
||||
* 件数
|
||||
*/
|
||||
val pc: String? = null,
|
||||
|
||||
/**
|
||||
* 运单号前缀
|
||||
*/
|
||||
val prefix: String? = null,
|
||||
|
||||
/**
|
||||
* 航程
|
||||
*/
|
||||
val range: String? = null,
|
||||
|
||||
/**
|
||||
* 特码
|
||||
*/
|
||||
val spCode: String? = null,
|
||||
|
||||
/**
|
||||
* 分批标识
|
||||
*/
|
||||
val splitFlag: String? = null,
|
||||
|
||||
/**
|
||||
* 子特码
|
||||
*/
|
||||
val subCode: String? = null,
|
||||
|
||||
/**
|
||||
* 体积
|
||||
*/
|
||||
val volume: String? = null,
|
||||
|
||||
/**
|
||||
* 运单号
|
||||
*/
|
||||
val wbNo: String? = null,
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
val weight: String? = null,
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
val whId: String? = null
|
||||
) {
|
||||
|
||||
fun getWaybill(): String {
|
||||
return "$prefix$no"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.BR
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GnjManifestBean : BaseObservable(), ICheck {
|
||||
|
||||
// 是否有效
|
||||
@Bindable
|
||||
var activeId: String = "" // 0
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.activeId)
|
||||
}
|
||||
|
||||
// 代理人代码
|
||||
@Bindable
|
||||
var agentCode: String = "" // LH
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.agentCode)
|
||||
}
|
||||
|
||||
// 提运单类型
|
||||
@Bindable
|
||||
var awbType: String = "" // 国内进港
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.awbType)
|
||||
}
|
||||
|
||||
// 业务类型
|
||||
@Bindable
|
||||
var businessType: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.businessType)
|
||||
}
|
||||
|
||||
// 货物类型代码
|
||||
@Bindable
|
||||
var cargoType: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cargoType)
|
||||
}
|
||||
var cashWeight: String = "" // 3
|
||||
|
||||
// 收货人代码
|
||||
@Bindable
|
||||
var cneeCode: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cneeCode)
|
||||
}
|
||||
|
||||
// 收货人身份证
|
||||
@Bindable
|
||||
var cneeId: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cneeId)
|
||||
}
|
||||
|
||||
// 收货人电话
|
||||
@Bindable
|
||||
var cneeTel: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.cneeTel)
|
||||
}
|
||||
|
||||
// 确认日期
|
||||
@Bindable
|
||||
var confirmDate: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.confirmDate)
|
||||
}
|
||||
|
||||
// 确认人ID
|
||||
@Bindable
|
||||
var confirmId: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.confirmId)
|
||||
}
|
||||
|
||||
// 收货人
|
||||
@Bindable
|
||||
var consignee: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.consignee)
|
||||
}
|
||||
|
||||
// 目的港-货物
|
||||
@Bindable
|
||||
var dest: String = "" // HFE
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dest)
|
||||
}
|
||||
|
||||
// 危险品描述
|
||||
@Bindable
|
||||
var dgrDetail: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dgrDetail)
|
||||
}
|
||||
|
||||
// 危险品库
|
||||
@Bindable
|
||||
var dgrLocation: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.dgrLocation)
|
||||
}
|
||||
var efNo: String = "" // null
|
||||
|
||||
@Bindable
|
||||
var fdep: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fdep)
|
||||
}
|
||||
|
||||
@Bindable
|
||||
var fdest: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fdest)
|
||||
}
|
||||
|
||||
// 航班流水号
|
||||
@Bindable
|
||||
var fid: String = "" // 264750
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.fid)
|
||||
}
|
||||
|
||||
// 货物品名
|
||||
@Bindable
|
||||
var goods: String = "" // 测试
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.goods)
|
||||
}
|
||||
|
||||
// 货位类型(0:散仓;1:ULD)
|
||||
@Bindable
|
||||
var locFlag: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.locFlag)
|
||||
}
|
||||
|
||||
//
|
||||
var locFlagMft: String = "" // null
|
||||
|
||||
// 货物货位
|
||||
@Bindable
|
||||
var location: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.location)
|
||||
}
|
||||
var locationMft: String = "" // null
|
||||
|
||||
// 流水号
|
||||
// 主键ID
|
||||
@Bindable
|
||||
var mfId: String = "" // 996281
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.mfId)
|
||||
}
|
||||
|
||||
// 主提运单号
|
||||
@Bindable
|
||||
var no: String = "" // 22222782
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.no)
|
||||
}
|
||||
var opDate: String = "" // null
|
||||
var opId: String = "" // null
|
||||
|
||||
// 始发港-货物
|
||||
@Bindable
|
||||
var origin: String = "" // PEK
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.origin)
|
||||
}
|
||||
|
||||
// 包装类型代码
|
||||
@Bindable
|
||||
var packageType: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.packageType)
|
||||
}
|
||||
|
||||
// 实到件数
|
||||
@Bindable
|
||||
var pc: String = "" // 5
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.pc)
|
||||
}
|
||||
|
||||
// 主提运单前缀(承运人运单三字码)
|
||||
@Bindable
|
||||
var prefix: String = "" // 781
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.prefix)
|
||||
}
|
||||
|
||||
// 舱单发放标识(0:未发放;1:已发放)
|
||||
@Bindable
|
||||
var ref: String = "" // 0
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.ref)
|
||||
}
|
||||
var refDate: String = "" // null
|
||||
|
||||
// 运单备注信息
|
||||
@Bindable
|
||||
var remark: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.remark)
|
||||
}
|
||||
|
||||
// 特种货物代码
|
||||
@Bindable
|
||||
var spCode: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.spCode)
|
||||
}
|
||||
|
||||
// 分批标识
|
||||
@Bindable
|
||||
var splitFlag: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.splitFlag)
|
||||
}
|
||||
|
||||
// 特种货物子代码
|
||||
@Bindable
|
||||
var subCode: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.subCode)
|
||||
}
|
||||
|
||||
// 提运单总件数
|
||||
@Bindable
|
||||
var totalPc: String = "" // 5
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.totalPc)
|
||||
}
|
||||
var tranDate: String = "" // null
|
||||
|
||||
// Un编号
|
||||
@Bindable
|
||||
var unNumber: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.unNumber)
|
||||
}
|
||||
|
||||
// 实到体积
|
||||
@Bindable
|
||||
var volume: Double = 0.0 // 0.01
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.volume)
|
||||
}
|
||||
|
||||
// 主运单号
|
||||
@Bindable
|
||||
var wbNo: String = "" // 78122222782
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.wbNo)
|
||||
}
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$prefix$no"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
// 实到重量
|
||||
@Bindable
|
||||
var weight: String = "" // 3
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GnjOutStashBean : ICheck {
|
||||
// 代理
|
||||
var agentCode: String = "" // LH
|
||||
|
||||
// 运单总件数
|
||||
var awbPc: String = "" // 200
|
||||
|
||||
// 提取标识
|
||||
var chargeFlag: String = "" // null
|
||||
|
||||
// 提取人
|
||||
var chargeId: String = "" // null
|
||||
|
||||
// 提取时间
|
||||
var chargeTime: String = "" // 2024-04-18 15:32:13
|
||||
|
||||
// 收费模式
|
||||
var chgMode: String = "" // null
|
||||
|
||||
// 证件号码
|
||||
var dlvId: String = "" // null
|
||||
|
||||
// 证件类型
|
||||
var dlvIdType: String = "" // null
|
||||
|
||||
// 提货人
|
||||
var dlvName: String = "" // null
|
||||
|
||||
// 联系号码
|
||||
var dlvPhone: String = "" // null
|
||||
|
||||
// 出库时间
|
||||
var dlvTime: String = "" // null
|
||||
|
||||
// 航班日期
|
||||
var fdate: String = "" // 2024-04-18
|
||||
|
||||
// 航班
|
||||
var flight: String = "" // 2024-04-18/MU2023
|
||||
|
||||
// 航班号
|
||||
var fno: String = "" // MU2023
|
||||
|
||||
// 货物名称
|
||||
var goods: String = "" // 茶叶
|
||||
|
||||
// ID
|
||||
var id: String = "" // 996262
|
||||
|
||||
// 货位类型(0:散仓;1:ULD)
|
||||
var locFlag: String = "" // null
|
||||
|
||||
// 货物货位
|
||||
var location: String = "" // null
|
||||
|
||||
// 主提运单号
|
||||
var no: String = "" // 22222675
|
||||
|
||||
// 始发港
|
||||
var origin: String = "" // null
|
||||
|
||||
// 实到件数
|
||||
var pc: String = "" // 200
|
||||
|
||||
// 出库标识 0:未出库,1已出库
|
||||
var pickFlag: String = "" // null
|
||||
|
||||
// 提货单号
|
||||
var pkId: String = "" // M000996261
|
||||
|
||||
// 主提运单前缀(承运人运单三字码)
|
||||
var prefix: String = "" // 781
|
||||
|
||||
// 发票号
|
||||
var receiptNo: String = "" // null
|
||||
|
||||
// 出库人
|
||||
var refId: String = "" // null
|
||||
|
||||
// 特种货物代码
|
||||
var spCode: String = "" // XHB
|
||||
var wbNo: String = "" // 78122222675
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$prefix$no"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
// 实到重量
|
||||
var weight: String = "" // 200
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GnjQueryBean {
|
||||
var activeId: String = "" // null
|
||||
var agentCode: String = "" // LH
|
||||
var awbType: String = "" // 国内进港
|
||||
var businessType: String = "" // 普通货物运输
|
||||
var by1: String = "" // MU
|
||||
var cargoType: String = "" // null
|
||||
var cashWeight: String = "" // null
|
||||
var chargeFlag: String = "" // null
|
||||
var cneeCode: String = "" // null
|
||||
var cneeId: String = "" // null
|
||||
var cneeTel: String = "" // null
|
||||
var consignee: String = "" // null
|
||||
var dep: String = "" // null
|
||||
var dest: String = "" // HFE
|
||||
var dgrDetail: String = "" // null
|
||||
var dgrLocation: String = "" // null
|
||||
var fdate: String = "" // null
|
||||
var fdep: String = "" // null
|
||||
var fdest: String = "" // null
|
||||
var flight: String = ""
|
||||
var fno: String = "" // null
|
||||
var goods: String = "" // 分批货1
|
||||
var mawbId: String = "" // 996360
|
||||
var no: String = "" // 22222981
|
||||
var opDate: String = "" // 2024-06-27 15:24:31
|
||||
var opId: String = "" // null
|
||||
var origin: String = "" // PEK
|
||||
var packageType: String = "" // null
|
||||
var pc: String = "" // 500
|
||||
|
||||
// 出库标识 0:未出库,1已出库
|
||||
var pickFlag: String = "" // null
|
||||
|
||||
var prefix: String = "" // 781
|
||||
var range: String = "" // PEK-HFE
|
||||
var remark: String = "" // null
|
||||
var spCode: String = "" // null
|
||||
var subCode: String = "" // null
|
||||
var unNumber: String = "" // null
|
||||
var volume: String = "" // null
|
||||
var weight: String = "" // 700
|
||||
|
||||
var wbNo: String = "" // 78122222826
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$prefix$no"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
fun getPickFlagName() = when (pickFlag) {
|
||||
"0" -> "未提取"
|
||||
"1" -> "已提取"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class GnjQueryDetailsBean {
|
||||
|
||||
val whList: List<Wh> = emptyList()
|
||||
|
||||
val maWb: GnjQueryBean = GnjQueryBean()
|
||||
|
||||
class Wh {
|
||||
var activeId: String = "" // null
|
||||
var agentCode: String = "" // null
|
||||
var awbType: String = "" // null
|
||||
var billsNo: String = "" // null
|
||||
var businessType: String = "" // null
|
||||
var by1: String = "" // null
|
||||
var cashWeight: String = "" // null
|
||||
var chargeFlag: String = "" // null
|
||||
var chargeTime: String = "" // null
|
||||
var days: String = "" // null
|
||||
var dest: String = "" // null
|
||||
var dgrDetail: String = "" // null
|
||||
var dgrLocation: String = "" // null
|
||||
var fdate: String = "" // 2024-06-27
|
||||
var fdep: String = "" // PEK
|
||||
var fdest: String = "" // HFE
|
||||
var flight: String = "" // 20240627/MU2023
|
||||
var fno: String = "" // MU2023
|
||||
var gdate: String = "" // null
|
||||
var giveOutDate: String = "" // null
|
||||
var goods: String = "" // null
|
||||
var locFlag: String = "" // null
|
||||
var location: String = "" // null
|
||||
var no: String = "" // 22222981
|
||||
var opDate: String = "" // 2024-06-27 15:24:32
|
||||
var opId: String = "" // ADMIN
|
||||
var origin: String = "" // PEK
|
||||
var packageType: String = "" // null
|
||||
var pc: String = "" // 200
|
||||
var prefix: String = "" // 781
|
||||
var ref: String = "" // null
|
||||
var spCode: String = "" // null
|
||||
var splitFlag: String = "" // null
|
||||
var subCode: String = "" // null
|
||||
var unNumber: String = "" // null
|
||||
var volume: String = "" // 1.36
|
||||
var wbNo: String = "" // null
|
||||
var weight: String = "" // 300
|
||||
var whId: String = "" // 996361
|
||||
|
||||
var carrier: String = "" //
|
||||
|
||||
var range: String = ""
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$fdep-$fdest"
|
||||
}
|
||||
return field
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class GnjStashBean(
|
||||
// 有效性
|
||||
var activeId: String = "", // null
|
||||
// 代理
|
||||
var agentCode: String = "", // LH
|
||||
// 运单类型
|
||||
var awbType: String = "", // null
|
||||
// 账单号(或免费、销账备注)
|
||||
var billsNo: String = "", // null
|
||||
// 业务类型
|
||||
var businessType: String = "", // null
|
||||
// 第一承运人
|
||||
var by1: String = "", // null
|
||||
// 第二承运人
|
||||
var by2: String = "", // null
|
||||
// 收费标识
|
||||
var chargeFlag: String = "", // null
|
||||
// 入库天数
|
||||
var days: String = "", // null
|
||||
// 目的站
|
||||
var dest: String = "", // null
|
||||
// 第1目的站
|
||||
var dest1: String = "", // null
|
||||
// 第2目的站
|
||||
var dest2: String = "", // null
|
||||
// 危险品库
|
||||
var dgrLocation: String = "", // null
|
||||
// 航班关闭时间
|
||||
var fclose: String = "", // null
|
||||
// 航班日期
|
||||
var fdate: String = "", // null
|
||||
// 航班
|
||||
var flight: String = "", // null
|
||||
// 航班号
|
||||
var fno: String = "", // null
|
||||
// 按入库时间分组
|
||||
var gdate: String = "", // null
|
||||
// 品名
|
||||
var goods: String = "", // 老虎
|
||||
// 货位标识(0:库位;1:板箱;2:平板)
|
||||
var locFlag: String = "", // null
|
||||
// 是否上舱单
|
||||
var locStatus: String = "", // 0
|
||||
// 货位(库位or板箱号or平板号,RET为退库)
|
||||
var location: String = "", // null
|
||||
// 运单号
|
||||
var no: String = "", // 22223051
|
||||
// 操作时间
|
||||
var opDate: String = "", // 2024-04-16 13:24:06
|
||||
// 操作人
|
||||
var opId: String = "", // null
|
||||
// 包装类型
|
||||
var packageType: String = "", // null
|
||||
// 件数
|
||||
var pc: String = "", // 400
|
||||
// 运单号前缀
|
||||
var prefix: String = "", // 781
|
||||
// 航程
|
||||
var range: String = "", // null
|
||||
// 特码
|
||||
var spCode: String = "", // AVI
|
||||
// 分批标识
|
||||
var splitFlag: String = "", // null
|
||||
// 子特码
|
||||
var subCode: String = "", // null
|
||||
// 体积
|
||||
var volume: String = "", // null
|
||||
// 重量
|
||||
var weight: String = "", // 600
|
||||
// Id
|
||||
var whId: String = "", // 764583
|
||||
// 始发港
|
||||
var origin: String = "", // 764583
|
||||
// 上一航程
|
||||
var fdep: String = "", // 764583
|
||||
) : ICheck {
|
||||
|
||||
// 运单号
|
||||
var wbNo: String = "" // 78122223051
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$prefix$no"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.R
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.DevUtils
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GnjUnloadListBean(
|
||||
var activeId: String = "", // null
|
||||
// 平板车号
|
||||
var carId: String = "", // 166
|
||||
// 司机
|
||||
var driver: String = "", // null
|
||||
// 预计到达
|
||||
var estimatedArrival: String = "", // null
|
||||
// 航班日期
|
||||
var fdate: String = "", // 2024-04-12
|
||||
// 起始站
|
||||
var fdep: String = "", // HFE
|
||||
// 目的站
|
||||
var fdest: String = "", // PEK
|
||||
// 航班ID
|
||||
var fid: String = "", // 264699
|
||||
// 航班号
|
||||
var fno: String = "", // MU2000
|
||||
// ID
|
||||
var id: String = "", // 4
|
||||
// 确认时间
|
||||
var opDate: String = "", // 2024-05-25 01:50:28
|
||||
// 确认人
|
||||
var opId: String = "", // ADMIN
|
||||
// 运输状态
|
||||
var transStatus: String = "", // 0
|
||||
// 转运类型
|
||||
var transType: String = "",// 3
|
||||
//货物类型:0“国际货”,1“活体鲜活”,2“贵重物品”,3“其他特货”
|
||||
var cargoType: String = "", // 3
|
||||
|
||||
// 货物类型中文
|
||||
var cargoTypeName: String = "",
|
||||
|
||||
//转运目的地
|
||||
var transDest: String = "",
|
||||
|
||||
var transDestName: String = "",
|
||||
|
||||
// 班车数量
|
||||
var carNum: String = "",
|
||||
|
||||
// 交接仓管
|
||||
var whsOpName: String = "",
|
||||
|
||||
// 交接时间
|
||||
var whsOpDate: String = "",
|
||||
|
||||
// 单证类型名称
|
||||
var fileTypeName: String = "",
|
||||
|
||||
// 转运类型名称
|
||||
var transTypeName: String = "",
|
||||
// 运输状态名称
|
||||
var transStatusName: String = ""
|
||||
) : ICheck {
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
fun checkedClick(){
|
||||
|
||||
if (checked.get()){
|
||||
checked.set(false)
|
||||
}else{
|
||||
checked.set(true)
|
||||
}
|
||||
// 通知选中状态变化
|
||||
onCheckedChangeListener?.onCheckedChanged(this, checked.get())
|
||||
}
|
||||
|
||||
// 选中状态变化监听器
|
||||
var onCheckedChangeListener: OnCheckedChangeListener? = null
|
||||
|
||||
interface OnCheckedChangeListener {
|
||||
fun onCheckedChanged(bean: GnjUnloadListBean, isChecked: Boolean)
|
||||
}
|
||||
|
||||
val transStatusColor: Int
|
||||
get() {
|
||||
return DevUtils.getTopActivity().resources.getColor(
|
||||
when (transStatus) {
|
||||
"0" -> R.color.blue
|
||||
"1" -> R.color.green
|
||||
"2" -> R.color.red
|
||||
else -> R.color.blue
|
||||
}
|
||||
)
|
||||
}
|
||||
fun getFlightDesc() = "$fdate/$fno"
|
||||
|
||||
fun getFlightSplit() : String {
|
||||
if (fdate != "" && fno != "") {
|
||||
val (year, mon, day) = fdate.split("-")
|
||||
return "${year}${mon}${day}/${fno}"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// 获取航程
|
||||
fun getVoyage() = "$fdep-$fdest"
|
||||
|
||||
|
||||
val estimatedArrivalHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
estimatedArrival,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(estimatedArrival)
|
||||
}
|
||||
|
||||
/*fun getCargoTypeName(): String {
|
||||
return when (cargoType) {
|
||||
"0" -> "国际货"
|
||||
"1" -> "活体鲜活"
|
||||
"2" -> "贵重物品"
|
||||
"3" -> "其他特货"
|
||||
else -> ""
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import androidx.databinding.ObservableField
|
||||
import com.lukouguoji.module_base.R
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import dev.DevUtils
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
class GoodsTransportBean : ICheck {
|
||||
var activited: String = "" // null
|
||||
var allocationStatus: String = "" // null
|
||||
var boardType: String = "" // null
|
||||
var carId: String = "" // 012
|
||||
var carWeight: String = "" // null
|
||||
var cargoType: String = "" // null
|
||||
var cargoTypeName: String = "" //货物类型名称
|
||||
var cargoWeight: String = "" // null
|
||||
var carrier: String = "" // null
|
||||
var checkFlag: String = "" // null
|
||||
var copDate: String = "" // null
|
||||
var copId: String = "" // null
|
||||
var driver: String = "" // null
|
||||
var estimatedTakeOff: String = "" // 2024-06-25 21:00:00
|
||||
val estimatedTakeOffTime: String
|
||||
get() {
|
||||
return estimatedTakeOff.split(" ").lastOrNull().noNull()
|
||||
}
|
||||
val estimatedTakeOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
estimatedTakeOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(estimatedTakeOff)
|
||||
}
|
||||
//计划起飞
|
||||
var scheduledTackOff: String = "" // 2024-06-25 21:00:00
|
||||
val scheduledTackOffTime: String
|
||||
get() {
|
||||
return scheduledTackOff.split(" ").lastOrNull().noNull()
|
||||
}
|
||||
val scheduledTackOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
scheduledTackOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(scheduledTackOff)
|
||||
}
|
||||
var frontStationTime: String = "" // 前方站时间
|
||||
|
||||
var fclose: String = "" // null
|
||||
var fdate: String = "" // 2024-06-25
|
||||
|
||||
val fDateNoYear: String
|
||||
get() {
|
||||
var (year, mon, day) = fdate.split("-")
|
||||
return "$year$mon$day"
|
||||
}
|
||||
var fdep: String = "" // PEK
|
||||
var fdest: String = "" // HFE
|
||||
var flight: String = "" // null
|
||||
var fno: String = "" // MU2266
|
||||
var ldRemark: String = "" // null
|
||||
var locPriority: String = "" // null
|
||||
var location: String = "" // null
|
||||
var mailWeight: String = "" // null
|
||||
var maxWeight: String = "" // null
|
||||
var mcn: String = "" // null
|
||||
var netWeight: String = "" // null
|
||||
var opDate: String = "" // null
|
||||
var opId: String = "" // null
|
||||
var pc: String = "" // null
|
||||
var priority: String = "" // null
|
||||
var remark: String = "" // null
|
||||
var spCode: String = "" // null
|
||||
var spCodeStatus: String = "" // null
|
||||
var standId: String = "" // null
|
||||
|
||||
// 0出港、1进港(转运页面判断)
|
||||
var status: String = "" // 1
|
||||
var storageArea: String = "" // null
|
||||
// 存放区域属性是否展示-----250326该字段改为前方站时间是否显示
|
||||
var storageAreaVisible: Boolean = false
|
||||
var tcn: String = "" // null
|
||||
var totalWeight: String = "" // null
|
||||
var transDate: String = "" // null
|
||||
|
||||
// 转运起始站(1:出港库区,2:进港库区,3:转运区,4:出港机坪,5:进港机坪)
|
||||
var transDep: String = "" // 5
|
||||
|
||||
// 转运目的站(1:出港库区,2:进港库区,3:转运区,4:出港机坪)
|
||||
var transDest: String = "" // 3
|
||||
|
||||
// 转运标识(0:正常,1:退回,2:机坪流转)
|
||||
var transFlag: String = "" // 0
|
||||
var transId: String = "" // null
|
||||
|
||||
// 运输状态 字典表code = TRANSSTATUS(0待运输、1开始运输、2完成运输)
|
||||
var transStatus: String = "" // 0
|
||||
|
||||
val transStatusName: String = ""
|
||||
val transStatusColor: Int
|
||||
get() {
|
||||
return DevUtils.getTopActivity().resources.getColor(
|
||||
when (transStatus) {
|
||||
"0" -> R.color.blue
|
||||
"1" -> R.color.green
|
||||
"2" -> R.color.red
|
||||
else -> R.color.blue
|
||||
}
|
||||
)
|
||||
}
|
||||
var transType: String = "" // 3
|
||||
var uld: String = "" // null
|
||||
var uldWeight: String = "" // null
|
||||
var useId: String = "" // 34
|
||||
var username: String = "" // null
|
||||
var volume: String = "" // null
|
||||
|
||||
// 结束状态 0 未结束、1已结束
|
||||
var endFlag: String = "" // null
|
||||
|
||||
var range: String = "" // null
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$fdep-$fdest"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
// 选中状态
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
|
||||
/**
|
||||
* 是否能退回
|
||||
*/
|
||||
fun canReturn(): Boolean {
|
||||
return (transStatus == "2" && transType == "2") || (transStatus == "0" && transType == "3")
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 加货标识
|
||||
var addCargoFlag: String = ""
|
||||
|
||||
val addCargoFlagName: String
|
||||
get() {
|
||||
return when (addCargoFlag) {
|
||||
"1" -> "待加货"
|
||||
"2" -> "完成加货"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
// 完成加货时间
|
||||
var addCargoDate: String = ""
|
||||
|
||||
// 完成加货人
|
||||
var addCargoId: String = ""
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class JianDataBean(
|
||||
var list: String? = "",
|
||||
var locId: Int? = 0,
|
||||
// 运单后缀
|
||||
var no: String? = "",
|
||||
var organizationcode: String? = "",
|
||||
var pcID: Int? = 0,
|
||||
var prefix: String? = ""
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
data class LogBean(
|
||||
var content: String = "", // 修改事故签证: {}
|
||||
var key: String = "", // danhao
|
||||
var logId: Int = 0, // 3804047
|
||||
var logType: String = "", // 0
|
||||
var opId: String = "", // ADMIN
|
||||
var opTime: String = "" // 2024-05-28 15:11:12
|
||||
)
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.BR
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class MessageBean : BaseObservable(), ICheck {
|
||||
var id: String = ""
|
||||
|
||||
// 消息内容
|
||||
var content: String = ""
|
||||
|
||||
// 创建时间
|
||||
var createtime: String = ""
|
||||
|
||||
// 角色
|
||||
var role: String = ""
|
||||
|
||||
// 状态 0:未处理、1:已处理
|
||||
@Bindable
|
||||
var state: String = ""
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.state)
|
||||
}
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class MoveStashBean : ICheck {
|
||||
var activeId: String = "" // null
|
||||
var agentCode: String = "" // HFEXB
|
||||
var awbType: String = "" // 国际进港(国内中转)
|
||||
var businessType: String = "" // null
|
||||
var by1: String = "" // null
|
||||
var cargoType: String = "" // null
|
||||
var cashWeight: String = "" // null
|
||||
var chargeFlag: String = "" // null
|
||||
var cneeCode: String = "" // null
|
||||
var cneeId: String = "" // null
|
||||
var cneeTel: String = "" // null
|
||||
var consignee: String = "" // null
|
||||
var dep: String = "" // null
|
||||
var dest: String = "" // HFE
|
||||
var dgrDetail: String = "" // null
|
||||
var dgrLocation: String = "" // null
|
||||
var fdate: String = "" // 2024-07-11
|
||||
var fdep: String = "" // null
|
||||
var fdest: String = "" // null
|
||||
var flight: String = "" // 20240711/MU7766
|
||||
var fno: String = "" // MU7766
|
||||
var goods: String = "" // 国际货
|
||||
var mawbId: String = "" // 996422
|
||||
var no: String = "" // 44445074
|
||||
var opDate: String = "" // null
|
||||
var opId: String = "" // null
|
||||
var origin: String = "" // LAX
|
||||
var packageType: String = "" // null
|
||||
var pc: String = "" // 5
|
||||
var pickFlag: String = "" // null
|
||||
var prefix: String = "" // 781
|
||||
var range: String = "" // null
|
||||
var remark: String = "" // null
|
||||
var spCode: String = "" // null
|
||||
var subCode: String = "" // null
|
||||
var unNumber: String = "" // null
|
||||
var volume: String = "" // null
|
||||
var wbNo: String = "" // 78144445074
|
||||
var weight: String = "" // 6
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable(): ObservableBoolean {
|
||||
return checked
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
data class PackageBean(
|
||||
var id: Long = 0L, //
|
||||
var name: String = "", // 名称
|
||||
var description: String = "", //
|
||||
var fitDom: String = "", //
|
||||
var fitInt: String = "", //
|
||||
var gbCode: String = "", //
|
||||
var customCode: String = "", //
|
||||
var insCode: String = "", //
|
||||
) {
|
||||
fun toKeyValue(): KeyValue {
|
||||
return KeyValue(name, name)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.alibaba.fastjson.annotation.JSONField
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class PacketParseBean(
|
||||
// 流水号
|
||||
var id: String? = "",
|
||||
// 接口类型
|
||||
var interfaceType: String? = "",
|
||||
// 检索关键字
|
||||
var key: String? = "",
|
||||
// 报文类型
|
||||
var msgType: String? = "",
|
||||
// 企业组织机构代码
|
||||
var organizationCode: String? = "",
|
||||
// 接收时间
|
||||
var receiveTime: String? = "",
|
||||
// 接收地址
|
||||
var receiverAddress: String? = "",
|
||||
// 接收状态描述
|
||||
var response: String? = "",
|
||||
// 发送地址
|
||||
var sendAddress: String? = "",
|
||||
// 接收状态
|
||||
var status: String? = "",
|
||||
// 电报内容
|
||||
var text: String? = ""
|
||||
) : ICheck {
|
||||
|
||||
@JSONField(serialize = false)
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
@JSONField(serialize = false)
|
||||
override fun getCheckObservable(): ObservableBoolean {
|
||||
return checked
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class PrinterNum : BaseObservable(){
|
||||
var num: Int = 1 //打印次数
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
/**
|
||||
* 运单信息-收运
|
||||
*/
|
||||
class SYWaybillBean(
|
||||
var actualTakeOff: String? = "",
|
||||
var agent: String? = "",
|
||||
var agentCode: String? = "",
|
||||
var arrivePc: String? = "",
|
||||
var arriveVolume: String? = "",
|
||||
var arriveWeight: String? = "",
|
||||
var awbType: String? = "",
|
||||
var billsNo: String? = "",
|
||||
var businessType: String? = "",
|
||||
var businesstype: String? = "",
|
||||
var by0: String? = "",
|
||||
var by1: String? = "",
|
||||
var by2: String? = "",
|
||||
var cargoType: String? = "",
|
||||
var checkIn: String? = "",
|
||||
var cneeTel: String? = "",
|
||||
var consignee: String? = "",
|
||||
var dep: String? = "",
|
||||
var activeId: String? = "",
|
||||
var dest: String? = "",
|
||||
var dest1: String? = "",
|
||||
var dest2: String? = "",
|
||||
var exno: String? = "",
|
||||
var fclose: String? = "",
|
||||
var fdate: String? = "",
|
||||
var ffmMemo: String? = "",
|
||||
var flight: String? = "",
|
||||
var fno: String? = "",
|
||||
var goods: String? = "",
|
||||
var goodsCn: String? = "",
|
||||
var grossWeight: String? = "",
|
||||
var maWbId: String? = "",
|
||||
var mftMemo: String? = "",
|
||||
var no: String? = "",
|
||||
var oldNo: String? = "",
|
||||
var oldPrefix: String? = "",
|
||||
var opDate: String? = "",
|
||||
var opId: String? = "",
|
||||
var organizationCode: String? = "",
|
||||
var origin: String? = "",
|
||||
var packageType: String? = "",
|
||||
var paperTime: String? = "",
|
||||
var pc: String? = "",
|
||||
var pclist: String? = "",
|
||||
var prefix: String? = "",
|
||||
var range: String? = "",
|
||||
var recheckCount: String? = "",
|
||||
var remark: String? = "",
|
||||
var spCode: String? = "",
|
||||
var spcode: String? = "",
|
||||
var subCode: String? = "",
|
||||
var tranFlag: String? = "",
|
||||
var volume: String? = "",
|
||||
var wbNo: String? = ""
|
||||
)
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.BaseObservable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.BR
|
||||
import com.lukouguoji.module_base.ktx.limit
|
||||
|
||||
class ShouYunSyncBean : BaseObservable() {
|
||||
var activeId: String = "" // null
|
||||
var agentCode: String = "" // HFEXB
|
||||
var awbType: String = "" // null
|
||||
var billsNo: String = "" // null
|
||||
var businessType: String = "" // null
|
||||
var by1: String = "" // null
|
||||
var by2: String = "" // null
|
||||
var carrier: String = "" // null
|
||||
var chargeFlag: String = "" // null
|
||||
var days: String = "" // null
|
||||
var dep: String = "" // null
|
||||
var dest: String = "" // PEK
|
||||
var dest1: String = "" // null
|
||||
var dest2: String = "" // null
|
||||
var dgrDetail: String = "" // null
|
||||
var dgrLocation: String = "" // null
|
||||
var fclose: String = "" // null
|
||||
var fdate: String = "" // 2024-07-16
|
||||
var flight: String = "" // null
|
||||
var fno: String = "" // MU2023
|
||||
var gdate: String = "" // null
|
||||
var goods: String = "" // 手机
|
||||
var locFlag: String = "" // null
|
||||
var locStatus: String = "" // 0
|
||||
var location: String = "" // 486
|
||||
var mawbmFdate: String = "" // null
|
||||
var mawbmFno: String = "" // null
|
||||
var no: String = "" // 44444680
|
||||
var opDate: String = "" // 2024-07-16 17:37:09
|
||||
var opId: String = "" // WD
|
||||
var packageType: String = "" // null
|
||||
|
||||
@Bindable
|
||||
var pc: String = "" // 9
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.pc)
|
||||
}
|
||||
|
||||
var pcLiveData: MutableLiveData<String> = MutableLiveData("0")
|
||||
var weightLiveData: MutableLiveData<String> = MutableLiveData("0")
|
||||
|
||||
var prefix: String = "" // 781
|
||||
var range: String = "" // null
|
||||
var spCode: String = "" // NOR
|
||||
var splitFlag: String = "" // null
|
||||
var subCode: String = "" // null
|
||||
var username: String = "" // 吴迪
|
||||
|
||||
@Bindable
|
||||
var volume: String = "" // null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.volume)
|
||||
}
|
||||
var wbNo: String = "" // 78144444680
|
||||
|
||||
@Bindable
|
||||
var weight: String = "" // 20
|
||||
set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.weight)
|
||||
volume = ((field.toFloatOrNull() ?: 0f) / 220f).limit(2)
|
||||
}
|
||||
var whId: String = "" // 765111
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
|
||||
class SimpleCheckBean :ICheck {
|
||||
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
class SimpleResultBean {
|
||||
|
||||
var read: String = ""
|
||||
|
||||
var unread: String = ""
|
||||
|
||||
|
||||
var totalPc: String = ""
|
||||
|
||||
var totalWeight: String = ""
|
||||
|
||||
var total: String = ""
|
||||
var pc: String = ""
|
||||
var weight: String = ""
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.toJson
|
||||
|
||||
|
||||
class SocketEventBean {
|
||||
|
||||
var content: String = "" // 航班240625/MU2266卸机完成时间从机坪转运区到进港库区环节完成运输时间超过90分钟,该航班对应的板车:012,请尽快处理!
|
||||
var createtime: String = "" // 1719921741358
|
||||
var role: String = "" // 4,6,7
|
||||
var state: String = "" // 0
|
||||
var id: String = "" // 0
|
||||
|
||||
fun toMessageBean(): MessageBean {
|
||||
return NetApply.gson.fromJson(toJson(false), MessageBean::class.java)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
data class TelegramBean(
|
||||
// 发送次数
|
||||
var count: String = "", // null
|
||||
// 电报号
|
||||
var flowNo: String = "", // null
|
||||
// 流向:接收0、发送1
|
||||
var flow: String = "", // null
|
||||
var id: String = "", // 991998
|
||||
// 接口类型
|
||||
var interfaceType: String = "", // SITA
|
||||
// 报文发送编号
|
||||
var msgId: String = "", // null
|
||||
// 报文等级(SITA-急报:QU,平报:QD)
|
||||
var msgLevel: String = "", // null
|
||||
// 报文类型
|
||||
var msgType: String = "", // FSU
|
||||
// 报文回执
|
||||
var receipt: String = "", // null
|
||||
// 接收地址
|
||||
var receiveAddress: String = "", // CANFCCZ
|
||||
// 发送地址
|
||||
var sendAddress: String = "", // HFEFI8X
|
||||
// 发送时间
|
||||
var sendTime: String = "", // null
|
||||
// 签发标志
|
||||
var signFlag: String = "", // null
|
||||
// 签发人
|
||||
var signName: String = "", // null
|
||||
// 签发时间
|
||||
var signTime: String = "", // null
|
||||
// 发送状态(W:等待发送;E:已发送,等待回执; S:发送成功;F:发送失败)
|
||||
var status: String = "", // S
|
||||
// 报文内容
|
||||
var teleContent: String = "", // FSU/12784-54058955CANHFE/T112K1020.0DLV/17JUN1836/HFE/T112K1020.0/SFS
|
||||
// 发送时间/接收时间
|
||||
var time: String = "", // 2022-06-17 18:36:44
|
||||
// 接收人或单位
|
||||
var toName: String = "" ,// null
|
||||
// 关键字
|
||||
var key: String = "" ,// null
|
||||
// 异常原因
|
||||
var errorMsg: String = "" ,// null
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.lukouguoji.module_base.bean;
|
||||
|
||||
public class TestBean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.R
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import com.lukouguoji.module_base.util.DictUtils.transportTypeList
|
||||
import dev.DevUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
/**
|
||||
* 转运日志
|
||||
*/
|
||||
class TransportLogBean : ICheck {
|
||||
var id: Long = 0
|
||||
var carId: String = "" // 012
|
||||
var driver: String = "" // null
|
||||
var opId: String = "" // null
|
||||
var opDate: String = "" // 2024-06-25 21:00:00
|
||||
val opDateTime: String
|
||||
get() {
|
||||
return opDate.split(" ").lastOrNull().noNull()
|
||||
}
|
||||
|
||||
|
||||
var fdate: String = "" // 2024-06-25
|
||||
|
||||
val fDateNoYear: String
|
||||
get() {
|
||||
var (year, mon, day) = fdate.split("-")
|
||||
return "$year$mon$day"
|
||||
}
|
||||
var fdep: String = "" // PEK
|
||||
var fdest: String = "" // HFE
|
||||
var flight: String = "" // null
|
||||
var fno: String = "" // MU2266
|
||||
|
||||
|
||||
// 0出港、1进港(转运页面判断)
|
||||
var status: String = "" // 1
|
||||
var transDate: String = "" // null
|
||||
|
||||
// 转运起始站(1:出港库区,2:进港库区,3:转运区,4:出港机坪,5:进港机坪)
|
||||
var transDep: String = "" // 5
|
||||
|
||||
// 转运目的站(1:出港库区,2:进港库区,3:转运区,4:出港机坪)
|
||||
var transDest: String = "" // 3
|
||||
|
||||
|
||||
// 运输状态 字典表code = TRANSSTATUS(0待运输、1开始运输、2完成运输)
|
||||
var transStatus: String = "" // 0
|
||||
|
||||
var transStatusName: String = ""
|
||||
// get() {
|
||||
// return when (transStatus) {
|
||||
// "0" -> "未运输"
|
||||
// "1" -> "开始运输"
|
||||
// "2" -> "完成运输"
|
||||
// else -> ""
|
||||
// }
|
||||
// }
|
||||
val transStatusColor: Int
|
||||
get() {
|
||||
return DevUtils.getTopActivity().resources.getColor(
|
||||
when (transStatus) {
|
||||
"0" -> R.color.blue
|
||||
"1" -> R.color.green
|
||||
"2" -> R.color.red
|
||||
else -> R.color.blue
|
||||
}
|
||||
)
|
||||
}
|
||||
var transType: String = "" // 运输类型 字典表code = TRANSTYPE()
|
||||
var transTypeName: String = "" // 运输类型 字典表code = TRANSTYPE()
|
||||
|
||||
var useId: String = "" // 平板记录ID
|
||||
var standId: String = "" // 机位
|
||||
|
||||
|
||||
var range: String = "" // null
|
||||
get() {
|
||||
if (field.isEmpty()) {
|
||||
field = "$fdep-$fdest"
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
|
||||
// 选中状态
|
||||
val checked = ObservableBoolean(false)
|
||||
|
||||
|
||||
|
||||
override fun getCheckObservable() = checked
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
|
||||
data class ULDBean(
|
||||
var airport: String = "",
|
||||
var carrier: String = "",
|
||||
// 最大体积
|
||||
var maxVolume: String = "",
|
||||
// 最大载量
|
||||
var maxWeight: String = "",
|
||||
// 自重
|
||||
var uldWeight: String = "",
|
||||
var organizationCode: String = "",
|
||||
var uld: String = "",
|
||||
var uldFlag: String = "",
|
||||
var uldType: String = "",
|
||||
){
|
||||
val checked = ObservableBoolean(false)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user