Skip to content

Commit

Permalink
2.9.0.00
Browse files Browse the repository at this point in the history
refactor-Upgrade minSdk from 21 to 23
refactor-条码展示用的字段改为displayBarcode
  • Loading branch information
wxw-9527 committed May 21, 2024
1 parent 0fee620 commit 35d99ec
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
compileSdk 34
defaultConfig {
applicationId "com.rouxinpai.demo"
minSdk 21
minSdk 23
targetSdk 34
versionCode 10000
versionName "1.0.0.00"
Expand Down
2 changes: 1 addition & 1 deletion arms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {
namespace 'com.rouxinpai.arms'
compileSdk 34
defaultConfig {
minSdk 21
minSdk 23
targetSdk 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ data class BarcodeInfoVO(
val contextId: String,
val batchCode: String,
val barcode: String,
val displayBarcode: String?,
val uniqueIdent: String,
val barTypeEnum: BarTypeEnum,
val snList: List<String>,
val extendData: String?,
val barContextDataMap: Map<String, String>,
val bomVO: BomVO?,
) {
Expand All @@ -38,10 +38,10 @@ data class BarcodeInfoVO(
contextId = dto.contextId,
batchCode = dto.batchCode,
barcode = dto.barCode,
displayBarcode = dto.extendData ?: dto.barCode,
uniqueIdent = dto.uniqueIdent,
barTypeEnum = BarTypeEnum.getBarTypeEnum(dto.barType),
snList = snList,
extendData = dto.extendData,
barContextDataMap = map,
bomVO = dto.bomList?.firstOrNull()?.let { BomVO.fromDto(it) },
).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity(), IView, OnRe
}
}

override fun onNewIntent(intent: Intent?) {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
if (intent != null) {
onParseData(intent)
}
onParseData(intent)
}

// 处理双击退出程序的回调
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ abstract class BaseMvpActivity<VB : ViewBinding, V : IView, P : IPresenter<V>> :
}
}

override fun onNewIntent(intent: Intent?) {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
onParseNfcIntent(intent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class PrintActivity : BaseMvpActivity<PrintActivityBinding, PrintContract.View,
// TODO: 其他类型条码待实现
}
// 条码
binding.tvBarcode.text = barcodeInfo.extendData ?: barcodeInfo.barcode
binding.tvBarcode.text = barcodeInfo.displayBarcode
// 状态
binding.tvStatus.setText(if (item.printSuccess) R.string.print__printed else R.string.print__unprinted)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class PrintPresenter @Inject constructor() :
addProperty(it, barcodeInfo.barContextDataMap[it])
}
addProperty("barCode", barcodeInfo.barcode)
addProperty("sn", barcodeInfo.extendData ?: barcodeInfo.barcode)
addProperty("sn", barcodeInfo.displayBarcode)
addProperty("materialCode", material.code) // 物料编码
addProperty("materialName", material.name) // 物料名称
addProperty("materialUnit", material.unit) // 物料单位
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class SelectBarcodeActivity :
}
if (missCopiesBarcode != null) {
showWarningTip(
getString(R.string.select_barcode__miss_copies, missCopiesBarcode.barcode)
getString(R.string.select_barcode__miss_copies, missCopiesBarcode.displayBarcode)
)
return
}
Expand Down Expand Up @@ -293,7 +293,7 @@ class SelectBarcodeActivity :
item: BarcodeVO,
) {
// 条码
binding.cbBarcode.text = item.extendData ?: item.barcode
binding.cbBarcode.text = item.displayBarcode
binding.cbBarcode.isChecked = item.isChecked
// 打印份数
with(binding.stepperCopies) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SelectBarcodePresenter @Inject constructor() : BasePresenter<SelectBarcode
.filter { dto -> dto.barType in materialBarTypeSet } // 过滤物料条码
.forEach { dto ->
val key = Pair(dto.materialInfo.materialCode, dto.supplierVO?.supplierCode)
val barcodeVo = BarcodeVO(dto.barCode, dto.extendData)
val barcodeVo = BarcodeVO.fromDto(dto)
val materialVo = materialMap.getOrPut(key) {
// 如果Map中不存在,则创建新的MaterialVO并加入到Map和List中
MaterialVO.fromDto(dto).also { materialVoList.add(it) }
Expand Down
17 changes: 16 additions & 1 deletion arms/src/main/java/com/rouxinpai/arms/print/model/BarcodeVO.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
package com.rouxinpai.arms.print.model

import com.rouxinpai.arms.barcode.model.BarcodeInfoDTO

/**
* author : Saxxhw
* email : [email protected]
* time : 2024/4/1 10:33
* desc :
*/
data class BarcodeVO(val barcode: String, val extendData: String?) {
data class BarcodeVO(val barcode: String, val displayBarcode: String?) {

companion object {

/**
*
*/
fun fromDto(dto: BarcodeInfoDTO): BarcodeVO {
return BarcodeVO(
barcode = dto.barCode,
displayBarcode = dto.extendData ?: dto.barCode
)
}
}

// 是否选中
var isChecked: Boolean = false
Expand Down

0 comments on commit 35d99ec

Please sign in to comment.