出入库功能改版
This commit is contained in:
@@ -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 ? = "",
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user