初始代码提交

This commit is contained in:
2026-01-14 10:36:27 +08:00
parent 600aa4dbb0
commit 196cacfe5a
268 changed files with 22545 additions and 2 deletions
@@ -0,0 +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: String,
val msg: String? = "",
val data: T? = null
) {
fun isSuccess(): Boolean = ("00000" == code)
val result: T?
get() = data
val message: String?
get() = msg
}
@@ -0,0 +1,5 @@
package com.sw.inbound.model.response
open class BaseBean() {
}
@@ -0,0 +1,13 @@
package com.sw.inbound.model.response
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 字典类型 如仓库列表 物品类型 存储方式等
*/
@Parcelize
data class DictType(
val id: String?=null,
val value: String?=null
) : Parcelable
@@ -0,0 +1,72 @@
package com.sw.inbound.model.response
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize
@Parcelize
data class EquipmentInfo(
@SerializedName("appPackageLocalUrl")
val appPackageLocalUrl: String? = "",
@SerializedName("appPackageUrl")
val appPackageUrl: String? = "",
@SerializedName("arcsoftActiveKey")
val arcsoftActiveKey: String? = "",
@SerializedName("arcsoftAppId")
val arcsoftAppId: String? = "",
@SerializedName("arcsoftSdkKey")
val arcsoftSdkKey: String? = "",
@SerializedName("arrayCross")
val arrayCross: Int? = 0,
@SerializedName("arrayMode")
val arrayMode: String? = "",
@SerializedName("arrayVertical")
val arrayVertical: Int? = 0,
@SerializedName("canteenId")
val canteenId: String? = "",
@SerializedName("canteenName")
val canteenName: String? = "",
@SerializedName("clientServerIp")
val clientServerIp: String? = "",
@SerializedName("createBy")
val createBy: String? = "",
@SerializedName("createTime")
val createTime: String? = "",
@SerializedName("customerName")
val customerName: String? = "",
@SerializedName("equipmentCode")
val equipmentCode: String? = "",
@SerializedName("equipmentName")
val equipmentName: String? = "",
@SerializedName("equipmentName_dictText")
val equipmentNameDictText: String? = "",
@SerializedName("id")
val id: String? = "",
@SerializedName("isSync")
val isSync: Int? = 0,
@SerializedName("mqName")
val mqName: String? = "",
@SerializedName("mqPassword")
val mqPassword: String? = "",
@SerializedName("orgCode")
val orgCode: String? = "",
@SerializedName("owningTrack")
val owningTrack: Int? = 0,
@SerializedName("owningTrackOrder")
val owningTrackOrder: Int? = 0,
@SerializedName("screenHtml")
val screenHtml: String? = "",
@SerializedName("serviceRequestAddress")
val serviceRequestAddress: String? = "",
@SerializedName("status")
val status: Int? = 0,
@SerializedName("sysOrgCode")
val sysOrgCode: String? = "",
@SerializedName("updateBy")
val updateBy: String? = "",
@SerializedName("updateTime")
val updateTime: String? = "",
@SerializedName("zhstServerIp")
val zhstServerIp: String? = ""
) : Parcelable
@@ -0,0 +1,267 @@
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.ext.toSafeString
import com.sw.inbound.model.response.SearchGoodsInfo.Record.UnitVo
import kotlinx.parcelize.Parcelize
import java.math.BigDecimal
/**
* 物品信息
*/
@Parcelize
data class GoodsInfo(
/**
* 数据id
*/
var id: String? = "",
/**
* 物品Id
*/
var goodId: String? = "",
/**
* 物品名称
*/
var goodName: String? = null,
/**
* 单价
*/
var recUnitPriceTaxIn: Double? = null,
var recUnitPriceTaxInBak: Double? = null,
// 单价 界面显示
var recUnitPriceTaxInTemp: String = "",
/**
* 新单价 部分收货需要
*/
var newRecUnitPriceTaxIn: Double? = null,
var newRecUnitPriceTaxInTemp: String = "",
/**
* 单位名称
*/
var unitName: String? = null,
var unitNameBak: String? = null,
/**
* 采购单位id
*/
var purchaseUnitId: String? = null,
/**
* 采购数量
*/
var receiveCount: Double? = null,
/**
* 金额
*/
var recPriceExItem: Double? = null,
// 金额 界面显示
var recPriceExItemTemp: String = "",
/**
* 仓库id
*/
var warehouseId: String? = null,
/**
* 仓库名称
*/
var warehouseName: String? = null,
/**
* 物品采购单位关系
*/
var goodsPurId: String? = "",
/**
* 采购库存转换值
*/
var purchaseValue: Int? = 0,
/**
* 库存单位
*/
var kcUnitName: String? = "",
/**
* 消耗转换值
*/
var consumeValue: String? = "",
// 收货数量 收货入参
var receivedNum: Double? = null,
var receivedNumBak: Double? = null,
var receiveCountAll: Double? = null,
// 收货数量显示
var receivedNumTemp: String = "",
// 重量 收货入参
var goodsWeight: BigDecimal? = null,
// 已调整
var isAdjusted: Boolean = false,
// 选中物品的可选单位
var unitList: List<UnitVo> = emptyList<UnitVo>(),
//--------------------------------------------------------
var isSelected: Boolean = false,
var isLocalGoods: Boolean = false,
var kcUnitId: String?="",
var recPriceInItem:Double?=null,
var goodsCount:Double?=null,
var goodsUnitPrice:Double?=null,
var goodsPrice:Double?=null,
var unitHint:String?="",
var buyToInventoryValue:String?="",
//--------------------------------------------------------
) : Parcelable, BaseBean() {
val goodNameStr: String
get() {
if (goodName == null) return "-"
return goodName!!
}
val receivedNumStr: String
get() {
if (receivedNum == null)
return ""
return receivedNum?.toFormattedString() ?: ""
}
val receivedNumListStr: String
get() {
if (receivedNum == null)
return "-"
return receivedNum?.toSafeString(unitName) ?: "-"
}
val receivedNumCount: String
get() {
if (receivedNum == null || receivedNum == 0.toDouble())
return "0"
return receivedNum?.toSafeString(unitName) ?: "0"
}
val dualCountStr: String
get() {
return if (receivedNum != null && receivedNum != 0.toDouble() && receiveCount != null && receiveCount != 0.toDouble()) {
"${receivedNum.toSafeString(unitName)}/${receiveCount.toSafeString(unitName)}"
} else if (receivedNum != null && receivedNum != 0.toDouble()) {
"${receivedNum.toSafeString(unitName)}/-"
} else {
receiveCountListStr
}
}
val recUnitPriceTaxInStr: String
get() {
if (recUnitPriceTaxIn == 0.toDouble()) return ""
return recUnitPriceTaxIn?.toFormattedString() ?: ""
}
val recUnitPriceTaxInListStr: String
get() {
if (recUnitPriceTaxIn == 0.toDouble()) return "-"
return recUnitPriceTaxIn?.toFormattedString() ?: "-"
}
val newRecUnitPriceTaxInListStr: String
get() {
if (newRecUnitPriceTaxIn == 0.toDouble()) return "-"
return newRecUnitPriceTaxIn?.toFormattedString() ?: "-"
}
val receiveCountStr: String
get() {
return when (receiveCount) {
0.toDouble() -> ""
else -> receiveCount?.toSafeString(unitName) ?: ""
}
}
val receiveCountListStr: String
get() {
return when (receiveCount) {
0.toDouble() -> "-"
else -> receiveCount?.toSafeString(unitName) ?: "-"
}
}
val recPriceExItemStr: String
get() {
return when (recPriceExItem) {
0.toDouble() -> ""
else -> recPriceExItem?.toFormattedString() ?: ""
}
}
val recPriceExItemListStr: String
get() {
return when (recPriceExItem) {
0.toDouble() -> "-"
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() < 1) {
return goodsWeight!!.multiply(BigDecimal(1000)).toString()
}
return goodsWeight?.toFormattedString() ?: ""
}
val goodsWeightUnitStr: String
get() {
return if (goodsWeight == null || goodsWeight!!.toInt() < 1) {
""
} else {
"千克"
}
}
var purchaseUnitIdStr: String
set(value) {
purchaseUnitIdStr = value
}
get() {
return GlobalData.unitTypeList.find { it.id == purchaseUnitId.toString() }?.value ?: ""
}
val warehouseNameStr: String
get() {
if (warehouseName == null) {
return ""
}
return warehouseName!!
}
fun hasNullField(): String? {
if (warehouseId.isNullOrBlank()) {
return "请选择仓库"
}
if (receivedNum == null || receivedNum == 0.toDouble()) {
return "请输入收货数量或进行称重"
}
if (newRecUnitPriceTaxIn == null || newRecUnitPriceTaxIn == 0.toDouble()) {
return "请输入收货单价"
}
if (recPriceExItem == null || recPriceExItem == 0.toDouble()) {
return "请输入收货金额"
}
if (goodsWeight == null || goodsWeight!!.toFloat() <= 0) {
return "请放入要称重的物品"
}
return null
}
}
@@ -0,0 +1,55 @@
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: String? = "",
@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: Boolean? = false,
@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,36 @@
package com.sw.inbound.model.response
/**
* 采购详情
*/
data class PurchaseInfo(
/**
* 单据id
*/
var id: String,
/**
* 供应商id
*/
var supplierId: String,
/**
* 供应商名称
*/
var supplierName: String? = "",
/**
* 采购单号
*/
var purCode: String? = "",
/**
* 收货单号
*/
var receiveCode: String? = "",
/**
* 物品信息
*/
var receiveGoodsInfoList: List<GoodsInfo> = emptyList<GoodsInfo>(),
// 自用
var warehouseName: String = "选择仓库"
) : BaseBean() {
}
@@ -0,0 +1,5 @@
package com.sw.inbound.model.response
data class RecGoodsName(
var nameList: List<String>
)
@@ -0,0 +1,149 @@
package com.sw.inbound.model.response
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import com.sw.inbound.utils.ext.roundedDecimalPlace
import com.sw.inbound.utils.removeTrailingZeros
import kotlinx.parcelize.IgnoredOnParcel
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("relativeUrl")
val relativeUrl: String? = "",
@SerializedName("goodsCode")
val goodsCode: String? = "",
@SerializedName("id")
val id: String? = "",
/**
* 物品id
*/
// @SerializedName("goodsId")
// val goodsId: String? = "",
/**
* 物品名称
*/
@SerializedName("goodsName")
val goodsName: String? = "",
/**
* 库存单位id
*/
@SerializedName("kcUnitId")
val kcUnitId: Int? = 0,
/**
* 库存单位名称
*/
@SerializedName("kcUnitName")
val kcUnitName: String? = "",
/**
* 库存与克的转换值
*/
val consumeValue: String? = "",
val purchaseValue: 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? = "",
var isSelected: Boolean = false,
var score: Int = 0
) : 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: Double? = 0.0,
) : Parcelable {
/**
* 购买单位数值
*/
fun getPurchaseUnitValue(value: Int): String {
val defZero = 0.toDouble()
val num = when (purchaseUnitName) {
"千克", "公斤" -> 2
"" -> 1
else -> 0
}
if (purchaseValue == null || purchaseValue == defZero || consumeValue.isNullOrBlank()) {
return ""
}
var consumeValueDouble: Double
try {
consumeValueDouble = consumeValue.toDouble()
} catch (e: Exception) {
e.printStackTrace()
return ""
}
val count = (value / purchaseValue / consumeValueDouble).roundedDecimalPlace(num)
return count.removeTrailingZeros()
}
}
}
}
@@ -0,0 +1,62 @@
package com.sw.inbound.model.response
//import android.os.Parcelable
//import com.google.gson.annotations.SerializedName
//import kotlinx.parcelize.Parcelize
/**
* 存储方式
*/
data class StorageType(
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
@@ -0,0 +1,119 @@
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: String? = "",
@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: String ? = "",
/**
* 供应商
*/
@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,52 @@
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