init
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
data class ApiResponse<T>(
|
||||
val code: Int,
|
||||
val success: Boolean? = false,
|
||||
val msg: String? = "",
|
||||
val data: T? = null
|
||||
) {
|
||||
fun isSuccess(): Boolean = code == 200
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
open class BaseBean() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
import android.os.Parcelable
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class DictType(
|
||||
val id: Int,
|
||||
val value: String
|
||||
) : Parcelable
|
||||
@@ -0,0 +1,181 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.sw.inbound.GlobalData
|
||||
import com.sw.inbound.ext.toFormattedString
|
||||
import com.sw.inbound.model.response.SearchGoodsInfo.Record.UnitVo
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.math.BigDecimal
|
||||
|
||||
/**
|
||||
* 物品信息
|
||||
*/
|
||||
@Parcelize
|
||||
data class GoodsInfo(
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
var id: Int? = 0,
|
||||
/**
|
||||
* 物品Id
|
||||
*/
|
||||
var goodId: Int? = 0,
|
||||
/**
|
||||
* 物品名称
|
||||
*/
|
||||
var goodName: String? = null,
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
var recUnitPriceTaxIn: Float? = null,
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
var unitName: String? = null,
|
||||
|
||||
/**
|
||||
* 采购单位id
|
||||
*/
|
||||
var purchaseUnitId: Int? = null,
|
||||
/**
|
||||
* 采购数量
|
||||
*/
|
||||
var receiveCount: Float? = null,
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
var recPriceExItem: Float? = null,
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
var warehouseId: Int? = null,
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
var warehouseName: String? = null,
|
||||
|
||||
/**
|
||||
* 物品采购单位关系
|
||||
*/
|
||||
var goodsPurId: Int? = 0,
|
||||
/**
|
||||
* 采购库存转换值
|
||||
*/
|
||||
var purchaseValue: Int? = 0,
|
||||
/**
|
||||
* 库存单位
|
||||
*/
|
||||
var kcUnitName: String? = "",
|
||||
/**
|
||||
* 消耗转换值
|
||||
*/
|
||||
var consumeValue: String? = "",
|
||||
|
||||
// 收货数量 收货入参
|
||||
var receivedNum: Float? = null,
|
||||
// 重量 收货入参
|
||||
var goodsWeight: BigDecimal? = null,
|
||||
|
||||
// 已调整
|
||||
var isAdjusted: Boolean = false,
|
||||
|
||||
var unitList: List<UnitVo> = emptyList<UnitVo>()
|
||||
) : Parcelable, BaseBean() {
|
||||
|
||||
val unitDictTypeList: List<DictType>
|
||||
get() {
|
||||
return unitList.map {
|
||||
DictType(it.businessUnitId!!.toInt(), it.purchaseUnitName!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val goodNameStr: String
|
||||
get() {
|
||||
if (goodName == null) return "-"
|
||||
return goodName!!
|
||||
}
|
||||
val receivedNumStr: String
|
||||
get() {
|
||||
if (receivedNum == null)
|
||||
return ""
|
||||
return receivedNum?.toFormattedString() ?: ""
|
||||
}
|
||||
|
||||
val recUnitPriceTaxInStr: String
|
||||
get() {
|
||||
if (recUnitPriceTaxIn == 0f) return ""
|
||||
return recUnitPriceTaxIn?.toFormattedString() ?: ""
|
||||
}
|
||||
|
||||
var receiveCountStr: String
|
||||
set(value) {
|
||||
// receiveCount = value.toSafeFloat()
|
||||
receiveCountStr = value
|
||||
}
|
||||
get() {
|
||||
return when (receiveCount) {
|
||||
0f -> ""
|
||||
else -> receiveCount?.toFormattedString() ?: ""
|
||||
}
|
||||
}
|
||||
|
||||
val recPriceExItemStr: String
|
||||
get() {
|
||||
return when (recPriceExItem) {
|
||||
0f -> ""
|
||||
else -> recPriceExItem?.toFormattedString() ?: ""
|
||||
}
|
||||
}
|
||||
|
||||
val unitNameStr: String
|
||||
get() {
|
||||
if (unitName == null) return "-"
|
||||
return unitName!!
|
||||
}
|
||||
|
||||
val goodsWeightStr: String
|
||||
get() {
|
||||
if (goodsWeight == null) return ""
|
||||
|
||||
// 小于10 kg 显示 g
|
||||
if (goodsWeight!!.toInt() < 10) {
|
||||
return goodsWeight!!.multiply(BigDecimal(1000)).toString()
|
||||
}
|
||||
return goodsWeight?.toFormattedString() ?: ""
|
||||
}
|
||||
|
||||
val goodsWeightUnitStr: String
|
||||
get() {
|
||||
return if (goodsWeight == null || goodsWeight!!.toInt() < 10) {
|
||||
"克"
|
||||
} else {
|
||||
"千克"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var purchaseUnitIdStr: String
|
||||
set(value) {
|
||||
purchaseUnitIdStr = value
|
||||
}
|
||||
get() {
|
||||
return GlobalData.unitTypeList.find { it.id == purchaseUnitId }?.value ?: ""
|
||||
}
|
||||
|
||||
val warehouseNameStr: String
|
||||
get() {
|
||||
if (warehouseName == null) {
|
||||
return ""
|
||||
}
|
||||
return warehouseName!!
|
||||
}
|
||||
|
||||
fun hasNull(): Boolean {
|
||||
return goodName == null || warehouseId == null ||
|
||||
purchaseUnitId == null || recUnitPriceTaxIn == null
|
||||
|| receiveCount == null || recPriceExItem == null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class GoodsType(
|
||||
@SerializedName("allType")
|
||||
val allType: List<AllType?>? = listOf()
|
||||
) : Parcelable {
|
||||
@Parcelize
|
||||
data class AllType(
|
||||
@SerializedName("createTime")
|
||||
val createTime: String? = "",
|
||||
@SerializedName("createUserNo")
|
||||
val createUserNo: String? = "",
|
||||
@SerializedName("eaId")
|
||||
val eaId: Int? = 0,
|
||||
@SerializedName("ftype")
|
||||
val ftype: String? = "",
|
||||
/**
|
||||
* 物品id
|
||||
*/
|
||||
@SerializedName("id")
|
||||
val id: Int? = 0,
|
||||
@SerializedName("idResult")
|
||||
val idResult: String? = "",
|
||||
@SerializedName("kidTypes")
|
||||
val kidTypes: List<String?>? = listOf(),
|
||||
@SerializedName("pageNum")
|
||||
val pageNum: String? = "",
|
||||
@SerializedName("pageSize")
|
||||
val pageSize: String? = "",
|
||||
@SerializedName("status")
|
||||
val status: Int? = 0,
|
||||
@SerializedName("superName")
|
||||
val superName: String? = "",
|
||||
@SerializedName("typeCode")
|
||||
val typeCode: String? = "",
|
||||
/**
|
||||
* 物品类型
|
||||
*/
|
||||
@SerializedName("typeName")
|
||||
val typeName: String? = "",
|
||||
@SerializedName("updateTime")
|
||||
val updateTime: String? = "",
|
||||
@SerializedName("updateUserNo")
|
||||
val updateUserNo: String? = ""
|
||||
) : Parcelable
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
data class PurchaseInfo(
|
||||
/**
|
||||
* 单据id
|
||||
*/
|
||||
var id: Int = 0,
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
var supplierId: Int = 0,
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
var supplierName: String = "",
|
||||
/**
|
||||
* 采购单号
|
||||
*/
|
||||
var purCode: String = "",
|
||||
/**
|
||||
* 收货单号
|
||||
*/
|
||||
var receiveCode: String = "",
|
||||
|
||||
/**
|
||||
* 物品信息
|
||||
*/
|
||||
var receiveGoodsInfoList: List<GoodsInfo> = emptyList<GoodsInfo>()
|
||||
) : BaseBean() {
|
||||
// 自用
|
||||
var warehouseName: String = "选择仓库"
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class SearchGoodsInfo(
|
||||
@SerializedName("current")
|
||||
val current: Int? = 0,
|
||||
@SerializedName("hitCount")
|
||||
val hitCount: Boolean? = false,
|
||||
@SerializedName("optimizeCountSql")
|
||||
val optimizeCountSql: Boolean? = false,
|
||||
@SerializedName("orders")
|
||||
val orders: List<String?>? = listOf(),
|
||||
@SerializedName("pages")
|
||||
val pages: Int? = 0,
|
||||
@SerializedName("records")
|
||||
val records: List<Record>? = listOf(),
|
||||
@SerializedName("searchCount")
|
||||
val searchCount: Boolean? = false,
|
||||
@SerializedName("size")
|
||||
val size: Int? = 0,
|
||||
@SerializedName("total")
|
||||
val total: Int? = 0
|
||||
) : Parcelable {
|
||||
@Parcelize
|
||||
data class Record(
|
||||
@SerializedName("goodsCode")
|
||||
val goodsCode: String? = "",
|
||||
/**
|
||||
* 物品id
|
||||
*/
|
||||
@SerializedName("goodsId")
|
||||
val goodsId: Int? = 0,
|
||||
/**
|
||||
* 物品名称
|
||||
*/
|
||||
@SerializedName("goodsName")
|
||||
val goodsName: String? = "",
|
||||
/**
|
||||
* 库存单位id
|
||||
*/
|
||||
@SerializedName("kcUnitId")
|
||||
val kcUnitId: Int? = 0,
|
||||
/**
|
||||
* 库存单位名称
|
||||
*/
|
||||
@SerializedName("kcUnitName")
|
||||
val kcUnitName: String? = "",
|
||||
@SerializedName("specification")
|
||||
val specification: String? = "",
|
||||
@SerializedName("typeId")
|
||||
val typeId: Int? = 0,
|
||||
@SerializedName("typeName")
|
||||
val typeName: String? = "",
|
||||
/**
|
||||
* 采购单位列表
|
||||
*/
|
||||
@SerializedName("unitVoList")
|
||||
val unitVoList: List<UnitVo>? = listOf(),
|
||||
@SerializedName("zjmCode")
|
||||
val zjmCode: String? = ""
|
||||
) : Parcelable {
|
||||
val goodsNameStr: String
|
||||
get() {
|
||||
if (goodsName == null) return ""
|
||||
return goodsName
|
||||
}
|
||||
|
||||
|
||||
@Parcelize
|
||||
data class UnitVo(
|
||||
/**
|
||||
* 单位关系id
|
||||
*/
|
||||
@SerializedName("businessUnitId")
|
||||
val businessUnitId: String? = "",
|
||||
/**
|
||||
* 转换值
|
||||
*/
|
||||
@SerializedName("buyToInventoryValue")
|
||||
val buyToInventoryValue: String? = "",
|
||||
@SerializedName("isDefault")
|
||||
val isDefault: Int? = 0,
|
||||
/**
|
||||
* 采购单位名称
|
||||
*/
|
||||
@SerializedName("purchaseUnitName")
|
||||
val purchaseUnitName: String? = "",
|
||||
@SerializedName("value")
|
||||
val value: String? = "",
|
||||
/**
|
||||
* 采购库存转换值
|
||||
*/
|
||||
val consumeValue: String? = "",
|
||||
/**
|
||||
* 消耗转换值
|
||||
*/
|
||||
val purchaseValue: Int? = 0,
|
||||
) : Parcelable
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
|
||||
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
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class SupplierInfo(
|
||||
@SerializedName("createTime")
|
||||
val createTime: String? = "",
|
||||
@SerializedName("createUserNo")
|
||||
val createUserNo: String? = "",
|
||||
@SerializedName("dateStart")
|
||||
val dateStart: String? = "",
|
||||
@SerializedName("dateStop")
|
||||
val dateStop: String? = "",
|
||||
@SerializedName("eaId")
|
||||
val eaId: Int? = 0,
|
||||
@SerializedName("eaIds")
|
||||
val eaIds: String? = "",
|
||||
@SerializedName("giftAll")
|
||||
val giftAll: Double? = 0.0,
|
||||
/**
|
||||
* 物品项
|
||||
*/
|
||||
@SerializedName("goodCount")
|
||||
val goodCount: Int = 0,
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@SerializedName("id")
|
||||
val id: Int = 0,
|
||||
@SerializedName("pageNum")
|
||||
val pageNum: String? = "",
|
||||
@SerializedName("pageSize")
|
||||
val pageSize: String? = "",
|
||||
@SerializedName("purCode")
|
||||
val purCode: String? = "",
|
||||
@SerializedName("purDateStart")
|
||||
val purDateStart: String? = "",
|
||||
@SerializedName("purDateStop")
|
||||
val purDateStop: String? = "",
|
||||
/**
|
||||
* 采购日期
|
||||
*/
|
||||
@SerializedName("purchaseDate")
|
||||
val purchaseDate: String? = "",
|
||||
@SerializedName("purchaseDates")
|
||||
val purchaseDates: String? = "",
|
||||
@SerializedName("receiveAddress")
|
||||
val receiveAddress: String? = "",
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
@SerializedName("receiveCode")
|
||||
val receiveCode: String? = "",
|
||||
@SerializedName("receiveCountAll")
|
||||
val receiveCountAll: Double? = 0.0,
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
@SerializedName("receiveDate")
|
||||
val receiveDate: String? = "",
|
||||
@SerializedName("receiveDates")
|
||||
val receiveDates: String? = "",
|
||||
@SerializedName("receiveGoodsInfos")
|
||||
val receiveGoodsInfos: String? = "",
|
||||
@SerializedName("receiveLogs")
|
||||
val receiveLogs: String? = "",
|
||||
@SerializedName("receivePhone")
|
||||
val receivePhone: String? = "",
|
||||
@SerializedName("receivePriceEx")
|
||||
val receivePriceEx: Double? = 0.0,
|
||||
@SerializedName("receivePriceIn")
|
||||
val receivePriceIn: Double? = 0.0,
|
||||
@SerializedName("receiveRemark")
|
||||
val receiveRemark: String? = "",
|
||||
/**
|
||||
* 收货状态1收货关闭/2收货完成/3待收货 /4部分收货
|
||||
*/
|
||||
@SerializedName("receiveStatus")
|
||||
val receiveStatus: Int? = 0,
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
@SerializedName("receiveUser")
|
||||
val receiveUser: String = "",
|
||||
@SerializedName("receivedNum")
|
||||
val receivedNum: String? = "",
|
||||
@SerializedName("restId")
|
||||
val restId: String? = "",
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
@SerializedName("supplierId")
|
||||
val supplierId: Int = 0,
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@SerializedName("supplierName")
|
||||
val supplierName: String = "",
|
||||
@SerializedName("taxRateAll")
|
||||
val taxRateAll: Double? = 0.0,
|
||||
@SerializedName("updateTime")
|
||||
val updateTime: String? = "",
|
||||
@SerializedName("updateUserNo")
|
||||
val updateUserNo: String? = "",
|
||||
@SerializedName("userName")
|
||||
val userName: String? = "",
|
||||
@SerializedName("warehouseId")
|
||||
val warehouseId: String? = ""
|
||||
) : Parcelable
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
/**
|
||||
* 供应商列表返回
|
||||
*/
|
||||
@Parcelize
|
||||
data class SupplierResponse(
|
||||
@SerializedName("current")
|
||||
val current: Int? = 0,
|
||||
@SerializedName("hitCount")
|
||||
val hitCount: Boolean? = false,
|
||||
@SerializedName("optimizeCountSql")
|
||||
val optimizeCountSql: Boolean? = false,
|
||||
@SerializedName("orders")
|
||||
val orders: List<SupplierInfo?>? = listOf(),
|
||||
@SerializedName("pages")
|
||||
val pages: Int? = 0,
|
||||
/**
|
||||
* 供应商列表
|
||||
*/
|
||||
@SerializedName("records")
|
||||
val records: List<SupplierInfo?>? = listOf(),
|
||||
@SerializedName("searchCount")
|
||||
val searchCount: Boolean? = false,
|
||||
@SerializedName("size")
|
||||
val size: Int? = 0,
|
||||
@SerializedName("total")
|
||||
val total: Int? = 0
|
||||
) : Parcelable
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class User(
|
||||
@SerializedName("eaCode")
|
||||
val eaCode: String? = null,
|
||||
@SerializedName("eaId")
|
||||
val eaId: String? = null,
|
||||
@SerializedName("eaIdList")
|
||||
val eaIdList: String? = null,
|
||||
@SerializedName("eaIdListName")
|
||||
val eaIdListName: String? = null,
|
||||
@SerializedName("eaLogoUrl")
|
||||
val eaLogoUrl: String? = null,
|
||||
@SerializedName("eaName")
|
||||
val eaName: String? = null,
|
||||
@SerializedName("errorCode")
|
||||
val errorCode: String? = null,
|
||||
@SerializedName("errorMsg")
|
||||
val errorMsg: String? = null,
|
||||
@SerializedName("id")
|
||||
val id: Int? = 0,
|
||||
@SerializedName("loginIp")
|
||||
val loginIp: String? = null,
|
||||
@SerializedName("name")
|
||||
val name: String? = "",
|
||||
@SerializedName("phone")
|
||||
val phone: String? = "",
|
||||
@SerializedName("token")
|
||||
val token: String? = "",
|
||||
@SerializedName("userCode")
|
||||
val userCode: String? = null,
|
||||
@SerializedName("userName")
|
||||
val userName: String? = ""
|
||||
) : Parcelable
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user