This commit is contained in:
zxj
2025-07-08 15:40:39 +08:00
parent d2698ed60f
commit 4501b6d5fc
132 changed files with 8998 additions and 0 deletions
@@ -0,0 +1,143 @@
package com.sw.inbound.model.request
import com.sw.inbound.GlobalData
import com.sw.inbound.ext.toFormattedString
import java.math.BigDecimal
/**
* 添加物品参数
*/
data class GoodsAddParam(
/**
* 物品名称
*/
var goodName: String? = null,
/**
* 物品编号 服务自动生成
*/
var goodCode: String? = null,
/**
* 物品类型
*/
var goodType: Int? = null,
/**
* 存储方式
*/
var storageType: Int? = null,
/**
* 净材率
*/
var netRate: Float? = null,
/**
* 库存单位id
*/
var unitId: Int? = null,
/**
* 采购单位
*/
var purchaseUnit: Int = 0,
/**
* 单位转换值
*/
var purchaseValue: Float = 0F,
/**
* 采购单价
*/
var purchasePrice: BigDecimal? = null,
/**
* 图片url
*/
var relativeUrl: String? = null
) {
val goodNameSr: String
get() {
if (goodName == null)
return ""
return goodName!!
}
var goodsTypeStr: String
set(value) {
goodsTypeStr = value
}
get() {
return GlobalData.goodsTypeList.find { it.id == goodType }?.value ?: ""
}
var storageTypeStr: String
set(value) {
storageTypeStr = value
}
get() {
return GlobalData.storageTypeList.find { it.id == storageType }?.value ?: ""
}
val netRateStr: String
get() {
if (netRate == null || netRate == 0f) {
return ""
} else {
return netRate!!.toFormattedString()
}
}
val unitIdStr: String
get() {
return GlobalData.unitTypeList.find { it.id == unitId }?.value ?: ""
}
val purchasePriceStr: String
get() {
if (purchasePrice == null) {
return ""
}
return purchasePrice!!.toFormattedString()
}
val purchaseUnitStr: String
get() {
if (purchaseUnit == 0) {
return ""
}
return GlobalData.unitTypeList.find { it.id == purchaseUnit }?.value ?: ""
}
fun hasNullField(): String? {
if (goodName == null || goodName!!.isEmpty())
return "请录入物品名称"
if (goodType == null || goodType == 0) {
return "请选择物品类型"
}
if (storageType == null || storageType == 0) {
return "请选择存储方式"
}
if (netRate == null || netRate == 0f) {
return "请录入净材率"
}
if (unitId == null || unitId == 0) {
return "请选择库存单位"
}
if (purchaseUnit == null || purchaseUnit == 0) {
return "请选择采购单位"
}
if (purchaseValue == null || purchaseValue == 0f) {
return "请输入采购单位对应的库存数量"
}
if (purchasePrice == null || purchasePrice == BigDecimal(0)) {
return "请输入单价"
}
return null
}
}
@@ -0,0 +1,12 @@
package com.sw.inbound.model.request
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
@Parcelize
data class LoginParam(
val userName: String,
val password: String
) : Parcelable
@@ -0,0 +1,164 @@
package com.sw.inbound.model.request
import android.os.Parcelable
import com.sw.inbound.GlobalData
import com.sw.inbound.ext.toFormattedString
import com.sw.inbound.model.response.DictType
import com.sw.inbound.model.response.SearchGoodsInfo.Record.UnitVo
import kotlinx.parcelize.Parcelize
import java.math.BigDecimal
/**
* 自采购入库参数
*/
@Parcelize
data class PurchaseWarehouseParam(
/**
* 物品id
*/
var goodsId: Int = 0,
/**
* 库存单位
*/
var kcUnitId: Int = -1,
/**
* 入库数量
*/
var goodsCount: Double = 0.0,
/**
* 入库单价
*/
var goodsUnitPrice: Double = 0.0,
/**
* 入库金额
*/
var goodsPrice: Double = 0.0,
/**
* (物品列表里 businessUnitId字段的值)
*/
var goodPurId: Int = -1,
/**
* 仓库id
*/
var warehouseId: Int = -1,
/**
* 采购库存转换关系
*/
var buyToInventoryValue: String = "",
// 仓库名
// var warehouseName: String? = null,
// 重量 收货入参
var goodsWeight: BigDecimal? = null,
// 物品名称
var goodsName: String? = null,
// 单位名称
var unitName: String? = null,
// 搜索的物品单位列表
var unitList: List<UnitVo>? = null,
// 选中的采购单位
var selectUnitType: UnitVo? = null
) : Parcelable {
val warehouseNameStr: String
get() {
if (warehouseId == -1) {
return ""
}
return GlobalData.warehouseTypeList.find { it.id == warehouseId }?.value ?: ""
// if (warehouseName == null) {
// return ""
// }
// return warehouseName!!
}
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 {
"千克"
}
}
val goodsNameStr: String
get() {
if (goodsName == null) return "-"
return goodsName!!
}
val unitDictTypeList: List<DictType>
get() {
return if (unitList == null) emptyList()
else {
unitList!!.map {
DictType(it.businessUnitId!!.toInt(), it.purchaseUnitName!!)
}
}
}
val unitNameStr: String
get() {
if (unitName == null) return ""
return unitName!!
}
val goodsCountStr: String
get() {
if (goodsCount == null || goodsCount == 0.0) {
return ""
}
return goodsCount.toFormattedString()
}
val goodsUnitPriceStr: String
get() {
if (goodsUnitPrice == null || goodsUnitPrice == 0.0) {
return ""
}
return goodsUnitPrice.toFormattedString()
}
val goodsPriceStr: String
get() {
if (goodsPrice == null || goodsPrice == 0.0) {
return ""
}
return goodsPrice.toFormattedString()
}
fun hasNullField(): String? {
if (goodsId == null || goodsId == 0 || goodsName == null || goodsName!!.isEmpty())
return "请选择物品"
if (warehouseId == null || warehouseId == -1) {
return "请选择仓库"
}
if (goodPurId == null || goodPurId == -1) {
return "请选择采购单位"
}
if (goodsCount == null || goodsCount == 0.0) {
return "请输入采购数量"
}
if (goodsUnitPrice == null || goodsUnitPrice == 0.0) {
return "请输入采购单价"
}
if (goodsPrice == null || goodsPrice == 0.0) {
return "请输入采购金额"
}
return null
}
}
@@ -0,0 +1,90 @@
package com.sw.inbound.model.request
import android.os.Parcelable
import com.sw.inbound.model.response.BaseBean
import com.sw.inbound.model.response.GoodsInfo
import kotlinx.parcelize.Parcelize
import java.math.BigDecimal
/**
* 确认收货结构
*/
@Parcelize
data class UploadInfo(
/**
* 收货单id
*/
var id: Int,
/**
* 供应商id
*/
var supplierId: Int? = null,
/**
* 物品信息
*/
var receiveGoodsInfos: List<GoodsInfo>
) : Parcelable
/**
* 确认收货物品信息
*/
@Parcelize
private data class UploadGoodsInfo(
/**
* 物品Id
*/
var goodId: Int = 0,
/**
* 物品采购单位关系
*/
var goodsPurId: Int = 0,
/**
* 数量
*/
var receiveCount: Float = 0F,
/**
* 单价
*/
var recUnitPriceTaxIn: Float = 0f,
/**
* 金额
*/
var recPriceExItem: Float = 0f,
/**
* 仓库id
*/
var warehouseId: Int = 0,
/**
* 物品名称
*/
var goodName: String = "-",
/**
* 单位名称
*/
var unitName: String = "-",
/**
* 采购单位id
*/
var purchaseUnitId: Int = 0,
/**
* 收货数量
*/
var receivedNum: Float = 0f,
/**
* 物品重量
*/
var goodsWeight: BigDecimal = BigDecimal(0),
// 已调整
var isAdjusted: Boolean = false
) : Parcelable, BaseBean() {
}