出入库功能改版

This commit is contained in:
2025-10-28 19:22:31 +08:00
parent f4e7cab2d0
commit b22f42d92a
121 changed files with 8271 additions and 3141 deletions
@@ -0,0 +1,48 @@
package com.sw.inbound.model.bean
data class ReceiptGoodsInfo(
var goodsId: String? = "",
var goodsName: String? = "",
var procurementUnit: String? = "",
var procurementCount: Int? = 0,
var procurementPrice: Double? = 0.0,
var procurementAmount: Double? = 0.0,
var receiptCount: Int? = 0,
var goodsWeight: Int? = 0,
var goodsState: String? = "",
var isSelected: Boolean = false,
var isLocalGoods: Boolean = false
)
//data class DropdownInfo(
// var id: String,
// var name: String
//)
//data class RecognizeResult(
// var name: String? = null,
// var image: String? = null,
// var isSelected: Boolean = false
//)
//data class GoodsSearchInfo(
// var id: String? = null,
// var name: String? = null,
// var isSelected: Boolean = false
//)
data class OperateBean(
var obj: Any? = null,
var typeList: MutableList<OperateType> = mutableListOf(),
var isSelected: Boolean = false,
var isLocalGoods: Boolean = false,
var isReceiptPage: Boolean = true
)
data class OperateType(
var value: String = "",
var width: Int = 0,
var textColor: String = "#FF999999",
var isBoldFont: Boolean = false,
var isShowIcon: Boolean = false
)
@@ -21,7 +21,8 @@ data class GoodsAddParam(
/**
* 物品类型
*/
var goodType: Int? = null,
// var goodType: Int? = null,
var goodType: String? = null,
/**
* 存储方式
@@ -85,7 +86,7 @@ data class GoodsAddParam(
storageTypeStr = value
}
get() {
return GlobalData.storageTypeList.find { it.id == storageType }?.value ?: ""
return GlobalData.storageTypeList.find { it.id == storageType.toString() }?.value ?: ""
}
val netRateStr: String
@@ -99,7 +100,7 @@ data class GoodsAddParam(
val unitIdStr: String
get() {
return GlobalData.unitTypeList.find { it.id == unitId }?.value ?: ""
return GlobalData.unitTypeList.find { it.id == unitId.toString() }?.value ?: ""
}
val unitIdStrPlace: String
@@ -121,13 +122,13 @@ data class GoodsAddParam(
if (purchaseUnit == 0) {
return ""
}
return GlobalData.unitTypeList.find { it.id == purchaseUnit }?.value ?: ""
return GlobalData.unitTypeList.find { it.id == purchaseUnit.toString() }?.value ?: ""
}
fun hasNullField(): String? {
if (goodName == null || goodName!!.isEmpty())
return "请录入物品名称"
if (goodType == null || goodType == 0) {
if (goodType.isNullOrBlank() || goodType == "0") {
return "请选择物品类型"
}
if (storageType == null || storageType == 0) {
@@ -19,7 +19,7 @@ data class GoodsPurchaseUnitParam(
val unitIdStr: String
get() {
if (unitId == 0) return ""
return GlobalData.unitTypeList.find { it.id == unitId }?.value ?: ""
return GlobalData.unitTypeList.find { it.id == unitId.toString() }?.value ?: ""
}
val purchaseUnitStr: String
@@ -27,7 +27,7 @@ data class GoodsPurchaseUnitParam(
if (purchaseUnit == 0) {
return ""
}
return GlobalData.unitTypeList.find { it.id == purchaseUnit }?.value ?: ""
return GlobalData.unitTypeList.find { it.id == purchaseUnit.toString() }?.value ?: ""
}
fun hasNullField(): String? {
@@ -17,11 +17,11 @@ data class PurchaseWarehouseParam(
/**
* 物品id
*/
var goodsId: Int = 0,
var goodsId: String = "",
/**
* 库存单位
*/
var kcUnitId: Int = -1,
var kcUnitId: String? = "",
/**
* 入库数量
*/
@@ -45,11 +45,11 @@ data class PurchaseWarehouseParam(
/**
* (物品列表里 businessUnitId字段的值)
*/
var goodPurId: Int = -1,
var goodPurId: String?="",
/**
* 仓库id
*/
var warehouseId: Int = -1,
var warehouseId: String?="",
/**
* 采购库存转换关系
@@ -75,10 +75,10 @@ data class PurchaseWarehouseParam(
val warehouseNameStr: String
get() {
if (warehouseId == -1) {
if (warehouseId.isNullOrBlank()) {
return ""
}
return GlobalData.warehouseTypeList.find { it.id == warehouseId }?.value ?: ""
return GlobalData.warehouseTypeList.find { it.id == warehouseId.toString() }?.value ?: ""
// if (warehouseName == null) {
// return ""
// }
@@ -111,15 +111,15 @@ data class PurchaseWarehouseParam(
return goodsName!!
}
val unitDictTypeList: List<DictType>
get() {
return if (unitList == null) emptyList()
else {
unitList!!.filter { it.businessUnitId != null && it.purchaseUnitName != null }.map {
DictType(it.businessUnitId?.toInt() ?: 0, it.purchaseUnitName ?: "")
}
}
}
// val unitDictTypeList: List<DictType>
// get() {
// return if (unitList == null) emptyList()
// else {
// unitList!!.filter { it.businessUnitId != null && it.purchaseUnitName != null }.map {
// DictType(it.businessUnitId?.toInt() ?: 0, it.purchaseUnitName ?: "")
// }
// }
// }
val unitNameStr: String
get() {
@@ -152,12 +152,12 @@ data class PurchaseWarehouseParam(
}
fun hasNullField(): String? {
if (goodsId == null || goodsId == 0 || goodsName == null || goodsName!!.isEmpty())
if (goodsId.isNullOrBlank() || goodsName == null || goodsName!!.isEmpty())
return "请选择物品"
if (warehouseId == null || warehouseId == -1) {
if (warehouseId.isNullOrBlank()) {
return "请选择仓库"
}
if (goodPurId == null || goodPurId == -1) {
if (goodPurId.isNullOrBlank()) {
return "请选择采购单位"
}
if (goodsCount == null || goodsCount == 0.0) {
@@ -14,11 +14,11 @@ data class UploadInfo(
/**
* 收货单id
*/
var id: Int,
var id: String,
/**
* 供应商id
*/
var supplierId: Int? = null,
var supplierId: String? = null,
/**
*
* 物品信息 【全部收货使用】
@@ -77,7 +77,7 @@ private data class UploadGoodsInfo(
/**
* 采购单位id
*/
var purchaseUnitId: Int = 0,
var purchaseUnitId: String = "",
/**
* 收货数量
@@ -1,11 +1,24 @@
package com.sw.inbound.model.response
//data class ApiResponse<T>(
// val code: Int,
// val success: Boolean? = false,
// val message: String? = "",
// val result: T? = null,
// val timestamp: Long? = 0
//) {
// fun isSuccess(): Boolean = code == 200
//}
data class ApiResponse<T>(
val code: Int,
val success: Boolean? = false,
val message: String? = "",
val result: T? = null,
val timestamp: Long? = 0
val code: String,
val msg: String? = "",
val data: T? = null
) {
fun isSuccess(): Boolean = code == 200
fun isSuccess(): Boolean = code == "00000"
val result: T?
get() = data
val message: String?
get() = msg
}
@@ -8,6 +8,6 @@ import kotlinx.parcelize.Parcelize
*/
@Parcelize
data class DictType(
val id: Int,
val value: String
val id: String?=null,
val value: String?=null
) : Parcelable
@@ -16,11 +16,11 @@ data class GoodsInfo(
/**
* 数据id
*/
var id: Int? = 0,
var id: String? = "",
/**
* 物品Id
*/
var goodId: Int? = 0,
var goodId: String? = "",
/**
* 物品名称
*/
@@ -28,7 +28,7 @@ data class GoodsInfo(
/**
* 单价
*/
var recUnitPriceTaxIn: Float? = null,
var recUnitPriceTaxIn: Double? = null,
// 单价 界面显示
var recUnitPriceTaxInTemp: String = "",
@@ -36,7 +36,7 @@ data class GoodsInfo(
/**
* 新单价 部分收货需要
*/
var newRecUnitPriceTaxIn: Float? = null,
var newRecUnitPriceTaxIn: Double? = null,
var newRecUnitPriceTaxInTemp: String = "",
/**
@@ -47,22 +47,22 @@ data class GoodsInfo(
/**
* 采购单位id
*/
var purchaseUnitId: Int? = null,
var purchaseUnitId: String? = null,
/**
* 采购数量
*/
var receiveCount: Float? = null,
var receiveCount: Double? = null,
/**
* 金额
*/
var recPriceExItem: Float? = null,
var recPriceExItem: Double? = null,
// 金额 界面显示
var recPriceExItemTemp: String = "",
/**
* 仓库id
*/
var warehouseId: Int? = null,
var warehouseId: String? = null,
/**
* 仓库名称
*/
@@ -71,7 +71,7 @@ data class GoodsInfo(
/**
* 物品采购单位关系
*/
var goodsPurId: Int? = 0,
var goodsPurId: String? = "",
/**
* 采购库存转换值
*/
@@ -86,7 +86,7 @@ data class GoodsInfo(
var consumeValue: String? = "",
// 收货数量 收货入参
var receivedNum: Float? = null,
var receivedNum: Double? = null,
// 收货数量显示
var receivedNumTemp: String = "",
// 重量 收货入参
@@ -96,7 +96,12 @@ data class GoodsInfo(
var isAdjusted: Boolean = false,
// 选中物品的可选单位
var unitList: List<UnitVo> = emptyList<UnitVo>()
var unitList: List<UnitVo> = emptyList<UnitVo>(),
//--------------------------------------------------------
var isSelected: Boolean = false,
var isLocalGoods: Boolean = false,
var kcUnitId: String?=""
//--------------------------------------------------------
) : Parcelable, BaseBean() {
val goodNameStr: String
@@ -120,7 +125,7 @@ data class GoodsInfo(
val receivedNumCount: String
get() {
if (receivedNum == null || receivedNum == 0f)
if (receivedNum == null || receivedNum == 0.toDouble())
return "0"
return receivedNum?.toSafeString(unitName) ?: "0"
@@ -128,9 +133,9 @@ data class GoodsInfo(
val dualCountStr: String
get() {
return if (receivedNum != null && receivedNum != 0f && receiveCount != null && receiveCount != 0f) {
return if (receivedNum != null && receivedNum != 0.toDouble() && receiveCount != null && receiveCount != 0.toDouble()) {
"${receivedNum.toSafeString(unitName)}/${receiveCount.toSafeString(unitName)}"
} else if (receivedNum != null && receivedNum != 0f) {
} else if (receivedNum != null && receivedNum != 0.toDouble()) {
"${receivedNum.toSafeString(unitName)}/-"
} else {
receiveCountListStr
@@ -139,33 +144,33 @@ data class GoodsInfo(
val recUnitPriceTaxInStr: String
get() {
if (recUnitPriceTaxIn == 0f) return ""
if (recUnitPriceTaxIn == 0.toDouble()) return ""
return recUnitPriceTaxIn?.toFormattedString() ?: ""
}
val recUnitPriceTaxInListStr: String
get() {
if (recUnitPriceTaxIn == 0f) return "-"
if (recUnitPriceTaxIn == 0.toDouble()) return "-"
return recUnitPriceTaxIn?.toFormattedString() ?: "-"
}
val newRecUnitPriceTaxInListStr: String
get() {
if (newRecUnitPriceTaxIn == 0f) return "-"
if (newRecUnitPriceTaxIn == 0.toDouble()) return "-"
return newRecUnitPriceTaxIn?.toFormattedString() ?: "-"
}
val receiveCountStr: String
get() {
return when (receiveCount) {
0f -> ""
0.toDouble() -> ""
else -> receiveCount?.toSafeString(unitName) ?: ""
}
}
val receiveCountListStr: String
get() {
return when (receiveCount) {
0f -> "-"
0.toDouble() -> "-"
else -> receiveCount?.toSafeString(unitName) ?: "-"
}
}
@@ -173,14 +178,14 @@ data class GoodsInfo(
val recPriceExItemStr: String
get() {
return when (recPriceExItem) {
0f -> ""
0.toDouble() -> ""
else -> recPriceExItem?.toFormattedString() ?: ""
}
}
val recPriceExItemListStr: String
get() {
return when (recPriceExItem) {
0f -> "-"
0.toDouble() -> "-"
else -> recPriceExItem?.toFormattedString() ?: "-"
}
}
@@ -217,7 +222,7 @@ data class GoodsInfo(
purchaseUnitIdStr = value
}
get() {
return GlobalData.unitTypeList.find { it.id == purchaseUnitId }?.value ?: ""
return GlobalData.unitTypeList.find { it.id == purchaseUnitId.toString() }?.value ?: ""
}
val warehouseNameStr: String
@@ -229,16 +234,16 @@ data class GoodsInfo(
}
fun hasNullField(): String? {
if (warehouseId == null) {
if (warehouseId.isNullOrBlank()) {
return "请选择仓库"
}
if (receivedNum == null || receivedNum == 0f) {
if (receivedNum == null || receivedNum == 0.toDouble()) {
return "请输入收货数量或进行称重"
}
if (newRecUnitPriceTaxIn == null || newRecUnitPriceTaxIn == 0f) {
if (newRecUnitPriceTaxIn == null || newRecUnitPriceTaxIn == 0.toDouble()) {
return "请输入收货单价"
}
if (recPriceExItem == null || recPriceExItem == 0f) {
if (recPriceExItem == null || recPriceExItem == 0.toDouble()) {
return "请输入收货金额"
}
if (goodsWeight == null || goodsWeight!!.toFloat() <= 0) {
@@ -27,7 +27,7 @@ data class GoodsType(
* 物品id
*/
@SerializedName("id")
val id: Int? = 0,
val id: String? = "",
@SerializedName("idResult")
val idResult: String? = "",
@SerializedName("kidTypes")
@@ -37,7 +37,7 @@ data class GoodsType(
@SerializedName("pageSize")
val pageSize: String? = "",
@SerializedName("status")
val status: Int? = 0,
val status: Boolean? = false,
@SerializedName("superName")
val superName: String? = "",
@SerializedName("typeCode")
@@ -7,11 +7,11 @@ data class PurchaseInfo(
/**
* 单据id
*/
var id: Int = 0,
var id: String,
/**
* 供应商id
*/
var supplierId: Int = 0,
var supplierId: String,
/**
* 供应商名称
*/
@@ -31,13 +31,17 @@ data class SearchGoodsInfo(
) : Parcelable {
@Parcelize
data class Record(
@SerializedName("relativeUrl")
val relativeUrl: String? = "",
@SerializedName("goodsCode")
val goodsCode: String? = "",
@SerializedName("id")
val id: String? = "",
/**
* 物品id
*/
@SerializedName("goodsId")
val goodsId: Int? = 0,
val goodsId: String? = "",
/**
* 物品名称
*/
@@ -58,6 +62,7 @@ data class SearchGoodsInfo(
* 库存与克的转换值
*/
val consumeValue: String? = "",
val purchaseValue: String? = "",
@SerializedName("specification")
val specification: String? = "",
@@ -71,7 +76,8 @@ data class SearchGoodsInfo(
@SerializedName("unitVoList")
val unitVoList: List<UnitVo>? = listOf(),
@SerializedName("zjmCode")
val zjmCode: String? = ""
val zjmCode: String? = "",
var isSelected: Boolean = false
) : Parcelable {
val goodsNameStr: String
get() {
@@ -1,53 +1,62 @@
package com.sw.inbound.model.response
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize
//import android.os.Parcelable
//import com.google.gson.annotations.SerializedName
//import kotlinx.parcelize.Parcelize
/**
* 存储方式
*/
@Parcelize
data class StorageType(
@SerializedName("childList")
val childList: List<String?>? = listOf(),
@SerializedName("createTime")
val createTime: String? = "",
@SerializedName("createUserNo")
val createUserNo: String? = "",
@SerializedName("depth")
val depth: String? = "",
@SerializedName("description")
val description: String? = "",
@SerializedName("dictId")
val dictId: String? = "",
@SerializedName("eaId")
val eaId: Int? = 0,
@SerializedName("fid")
val fid: String? = "",
@SerializedName("id")
val id: Int? = 0,
@SerializedName("idc")
val idc: String? = "",
/**
* 名称
*/
@SerializedName("itemText")
val itemText: String? = "",
/**
* 对应值
*/
@SerializedName("itemValue")
val itemValue: String? = "",
@SerializedName("level")
val level: Int? = 0,
@SerializedName("sortOrder")
val sortOrder: Int? = 0,
@SerializedName("status")
val status: Int? = 0,
@SerializedName("updateTime")
val updateTime: String? = "",
@SerializedName("updateUserNo")
val updateUserNo: String? = ""
) : Parcelable
val id:String?=null,
val value:String?=null,
val text:String?=null,
val title:String?=null,
val label:String?=null,
)
//@Parcelize
//data class StorageType(
// @SerializedName("childList")
// val childList: List<String?>? = listOf(),
// @SerializedName("createTime")
// val createTime: String? = "",
// @SerializedName("createUserNo")
// val createUserNo: String? = "",
// @SerializedName("depth")
// val depth: String? = "",
// @SerializedName("description")
// val description: String? = "",
// @SerializedName("dictId")
// val dictId: String? = "",
// @SerializedName("eaId")
// val eaId: Int? = 0,
// @SerializedName("fid")
// val fid: String? = "",
// @SerializedName("id")
// val id: String? = "",
// @SerializedName("idc")
// val idc: String? = "",
// /**
// * 名称
// */
// @SerializedName("itemText")
// val itemText: String? = "",
// /**
// * 对应值
// */
// @SerializedName("itemValue")
// val itemValue: String? = "",
// @SerializedName("level")
// val level: Int? = 0,
// @SerializedName("sortOrder")
// val sortOrder: Int? = 0,
// @SerializedName("status")
// val status: Int? = 0,
// @SerializedName("updateTime")
// val updateTime: String? = "",
// @SerializedName("updateUserNo")
// val updateUserNo: String? = ""
//) : Parcelable
@@ -33,7 +33,7 @@ data class SupplierInfo(
* 订单id
*/
@SerializedName("id")
val id: Int = 0,
val id: String? = "",
@SerializedName("pageNum")
val pageNum: String? = "",
@SerializedName("pageSize")
@@ -100,7 +100,7 @@ data class SupplierInfo(
* 供应商id
*/
@SerializedName("supplierId")
val supplierId: Int = 0,
val supplierId: String ? = "",
/**
* 供应商
*/