|
@@ -40,7 +40,7 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
/**
|
|
/**
|
|
|
* 套保品种正常列表
|
|
* 套保品种正常列表
|
|
|
*/
|
|
*/
|
|
|
- val middleGoodsNormalList: MutableLiveData<List<MiddleGoodsData>> = MutableLiveData()
|
|
|
|
|
|
|
+ val middleGoodsNormalList: MutableLiveData<List<GoodsGroupData>> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 现货品种详情
|
|
* 现货品种详情
|
|
@@ -64,12 +64,12 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
val brandModelcacheList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
|
|
val brandModelcacheList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 新增现货品种时的型号列表数据
|
|
|
|
|
|
|
+ * 新增现货品种时的型号列表数据(三期为品类)
|
|
|
*/
|
|
*/
|
|
|
val spotModelList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
|
|
val spotModelList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 暂存的型号列表数据
|
|
|
|
|
|
|
+ * 暂存的型号列表数据(三期为品类)
|
|
|
*/
|
|
*/
|
|
|
val spotModelcacheList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
|
|
val spotModelcacheList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
|
|
|
|
|
|
|
@@ -102,19 +102,17 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
/**
|
|
/**
|
|
|
* 变更记录列表
|
|
* 变更记录列表
|
|
|
*/
|
|
*/
|
|
|
- val changeLogDataList : MutableLiveData<List<ChangeLogData>> = MutableLiveData()
|
|
|
|
|
|
|
+ val changeLogDataList: MutableLiveData<List<ChangeLogData>> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 期货品种信息列表展示
|
|
* 期货品种信息列表展示
|
|
|
*/
|
|
*/
|
|
|
- val showGgConvertConfigDataList : MutableLiveData<List<GGConvertConfigData>> = MutableLiveData()
|
|
|
|
|
|
|
+ val showGgConvertConfigDataList: MutableLiveData<List<GGConvertConfigData>> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 变更记录列表
|
|
* 变更记录列表
|
|
|
*/
|
|
*/
|
|
|
- val middleChangeLogDataList : MutableLiveData<List<MiddleGoodsChangeLogData>> = MutableLiveData()
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ val middleChangeLogDataList: MutableLiveData<List<MiddleGoodsChangeLogData>> = MutableLiveData()
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -178,7 +176,7 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
fun queryGGConvertConfig(goodsgroupid: String = "") {
|
|
fun queryGGConvertConfig(goodsgroupid: String = "") {
|
|
|
|
|
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
- if (goodsgroupid.isNotEmpty()){
|
|
|
|
|
|
|
+ if (goodsgroupid.isNotEmpty()) {
|
|
|
put("goodsgroupid", goodsgroupid)
|
|
put("goodsgroupid", goodsgroupid)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -197,18 +195,34 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 查询期货商品组(原套保品种)
|
|
|
|
|
+ * @param wrstandardid String
|
|
|
|
|
+ */
|
|
|
|
|
+ fun queryGoodsGroup() {
|
|
|
|
|
+ val params = mutableMapOf<String, String>().apply {
|
|
|
|
|
+ put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
|
|
+// put("deliverygoodsid", deliverygoodsid)
|
|
|
|
|
+ }
|
|
|
|
|
+ MyApplication.getInstance()?.futureManager?.queryGoodsGroup(params = params) { isSuccess, respData, _ ->
|
|
|
|
|
+ if (isSuccess) {
|
|
|
|
|
+ middleGoodsNormalList.postValue(respData)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 获取剩下可选择的套保品种
|
|
* 获取剩下可选择的套保品种
|
|
|
* @return List<MiddleGoodsData>
|
|
* @return List<MiddleGoodsData>
|
|
|
*/
|
|
*/
|
|
|
- fun getRemainingMiddleGoodsList() : List<MiddleGoodsData>{
|
|
|
|
|
|
|
+ fun getRemainingMiddleGoodsList(): List<GoodsGroupData> {
|
|
|
val allSelectDataList = middleGoodsNormalList.value//所有可选择套保品种
|
|
val allSelectDataList = middleGoodsNormalList.value//所有可选择套保品种
|
|
|
val middlegoodList = middlegoodList.value//列表数据已显示的套保品种
|
|
val middlegoodList = middlegoodList.value//列表数据已显示的套保品种
|
|
|
- val newSelectDataList = arrayListOf<MiddleGoodsData>()//剩下的可选择套保品种
|
|
|
|
|
|
|
+ val newSelectDataList = arrayListOf<GoodsGroupData>()//剩下的可选择套保品种
|
|
|
allSelectDataList?.forEach { data ->
|
|
allSelectDataList?.forEach { data ->
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- middlegoodList?.forEach {data ->
|
|
|
|
|
- allSelectDataList?.remove { it.middlegoodsid == data.middleGoodsId }
|
|
|
|
|
|
|
+ middlegoodList?.forEach { data ->
|
|
|
|
|
+ allSelectDataList?.remove { it.goodsgroupid == data.middleGoodsId }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return allSelectDataList ?: arrayListOf()
|
|
return allSelectDataList ?: arrayListOf()
|
|
@@ -219,34 +233,36 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
* type 1为添加,2为删除 ,3为更换资料
|
|
* type 1为添加,2为删除 ,3为更换资料
|
|
|
*/
|
|
*/
|
|
|
fun changeMiddleGoodsList(
|
|
fun changeMiddleGoodsList(
|
|
|
- type: String,
|
|
|
|
|
- id: String,
|
|
|
|
|
- middlegoodsId: String = "",
|
|
|
|
|
|
|
+ type: String,//类型
|
|
|
|
|
+ id: String,//列表的下标id
|
|
|
|
|
+ middlegoodsId: String = "",//套保id
|
|
|
ano: String = "",
|
|
ano: String = "",
|
|
|
enumdicname: String = "",
|
|
enumdicname: String = "",
|
|
|
|
|
+ enumdicnameid: String = "",
|
|
|
middleGoodsName: String = ""
|
|
middleGoodsName: String = ""
|
|
|
) {
|
|
) {
|
|
|
val oldDataCacheList = middlegoodCacheList.value?.toArrayList()
|
|
val oldDataCacheList = middlegoodCacheList.value?.toArrayList()
|
|
|
val oldDataList = middlegoodList.value?.toArrayList()
|
|
val oldDataList = middlegoodList.value?.toArrayList()
|
|
|
val newDataList = arrayListOf<SpotInfoData>()
|
|
val newDataList = arrayListOf<SpotInfoData>()
|
|
|
- if (type == "1") {
|
|
|
|
|
|
|
+ if (type == "1") {//增加一个套保品种
|
|
|
oldDataCacheList?.forEach {
|
|
oldDataCacheList?.forEach {
|
|
|
newDataList.add(it)
|
|
newDataList.add(it)
|
|
|
}
|
|
}
|
|
|
newDataList.add(SpotInfoData(id = id, value = ano, middleGoodsId = middlegoodsId))
|
|
newDataList.add(SpotInfoData(id = id, value = ano, middleGoodsId = middlegoodsId))
|
|
|
middlegoodList.postValue(newDataList)
|
|
middlegoodList.postValue(newDataList)
|
|
|
- } else if (type == "2") {
|
|
|
|
|
|
|
+ } else if (type == "2") {//删除相应的套保品种
|
|
|
oldDataCacheList?.forEach {
|
|
oldDataCacheList?.forEach {
|
|
|
if (id != it.id) {
|
|
if (id != it.id) {
|
|
|
newDataList.add(it.copy(id = oldDataCacheList.indexOf(it).plus(1).toString()))
|
|
newDataList.add(it.copy(id = oldDataCacheList.indexOf(it).plus(1).toString()))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
middlegoodList.postValue(newDataList)
|
|
middlegoodList.postValue(newDataList)
|
|
|
- } else if (type == "3") {
|
|
|
|
|
|
|
+ } else if (type == "3") {//更换资料
|
|
|
oldDataList?.forEach {
|
|
oldDataList?.forEach {
|
|
|
var newMiddlegoodsId = ""
|
|
var newMiddlegoodsId = ""
|
|
|
var newEnumdicname = ""
|
|
var newEnumdicname = ""
|
|
|
var newMiddleGoodsName = ""
|
|
var newMiddleGoodsName = ""
|
|
|
|
|
+ var newEnumdicnameid = ""
|
|
|
var newData: SpotInfoData
|
|
var newData: SpotInfoData
|
|
|
if (it.id == id) {
|
|
if (it.id == id) {
|
|
|
newMiddlegoodsId = if (middlegoodsId.isNullOrEmpty()) {
|
|
newMiddlegoodsId = if (middlegoodsId.isNullOrEmpty()) {
|
|
@@ -264,11 +280,17 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
} else {
|
|
} else {
|
|
|
enumdicname
|
|
enumdicname
|
|
|
}
|
|
}
|
|
|
|
|
+ newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
|
|
|
|
|
+ it.enumdicname
|
|
|
|
|
+ } else {
|
|
|
|
|
+ enumdicnameid
|
|
|
|
|
+ }
|
|
|
newData = it.copy(
|
|
newData = it.copy(
|
|
|
id = id,
|
|
id = id,
|
|
|
value = ano,
|
|
value = ano,
|
|
|
middleGoodsId = newMiddlegoodsId,
|
|
middleGoodsId = newMiddlegoodsId,
|
|
|
enumdicname = newEnumdicname,
|
|
enumdicname = newEnumdicname,
|
|
|
|
|
+ enumdicnameid = newEnumdicnameid,
|
|
|
middleGoodsName = newMiddleGoodsName
|
|
middleGoodsName = newMiddleGoodsName
|
|
|
)
|
|
)
|
|
|
newDataList.add(newData)
|
|
newDataList.add(newData)
|
|
@@ -277,13 +299,19 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
middlegoodCacheList.postValue(newDataList)
|
|
middlegoodCacheList.postValue(newDataList)
|
|
|
- }else if (type == "4") {//用于选择套保品种
|
|
|
|
|
|
|
+ } else if (type == "4") {//用于选择套保品种
|
|
|
oldDataList?.forEach {
|
|
oldDataList?.forEach {
|
|
|
var newMiddlegoodsId = ""
|
|
var newMiddlegoodsId = ""
|
|
|
var newEnumdicname = ""
|
|
var newEnumdicname = ""
|
|
|
var newMiddleGoodsName = ""
|
|
var newMiddleGoodsName = ""
|
|
|
|
|
+ var newEnumdicnameid = ""
|
|
|
var newData: SpotInfoData
|
|
var newData: SpotInfoData
|
|
|
if (it.id == id) {
|
|
if (it.id == id) {
|
|
|
|
|
+ newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
|
|
|
|
|
+ it.enumdicname
|
|
|
|
|
+ } else {
|
|
|
|
|
+ enumdicnameid
|
|
|
|
|
+ }
|
|
|
newMiddlegoodsId = if (middlegoodsId.isNullOrEmpty()) {
|
|
newMiddlegoodsId = if (middlegoodsId.isNullOrEmpty()) {
|
|
|
it.middleGoodsId
|
|
it.middleGoodsId
|
|
|
} else {
|
|
} else {
|
|
@@ -302,6 +330,7 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
newData = it.copy(
|
|
newData = it.copy(
|
|
|
id = id,
|
|
id = id,
|
|
|
value = ano,
|
|
value = ano,
|
|
|
|
|
+ enumdicnameid = newEnumdicnameid,
|
|
|
middleGoodsId = newMiddlegoodsId,
|
|
middleGoodsId = newMiddlegoodsId,
|
|
|
enumdicname = newEnumdicname,
|
|
enumdicname = newEnumdicname,
|
|
|
middleGoodsName = newMiddleGoodsName
|
|
middleGoodsName = newMiddleGoodsName
|
|
@@ -318,34 +347,116 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 现货品种型号列表数据刷新
|
|
|
|
|
|
|
+ * 品类列表
|
|
|
* type 1为添加,2为删除 ,3为更换资料
|
|
* type 1为添加,2为删除 ,3为更换资料
|
|
|
*/
|
|
*/
|
|
|
- fun changeSpotModelList(type: String, id: String, value: String) {
|
|
|
|
|
|
|
+ fun changeSpotModelList(
|
|
|
|
|
+ type: String,//类型
|
|
|
|
|
+ id: String,//列表下标id
|
|
|
|
|
+ value: String = "",//品类名称
|
|
|
|
|
+ enumdicname: String = "",//单位名称
|
|
|
|
|
+ enumdicnameid: String = "",//单位id
|
|
|
|
|
+ coefficientwarehouse: String = ""//标仓系数
|
|
|
|
|
+ ) {
|
|
|
val oldDatacacheList = spotModelcacheList.value?.toArrayList()
|
|
val oldDatacacheList = spotModelcacheList.value?.toArrayList()
|
|
|
val oldDataList = spotModelList.value?.toArrayList()
|
|
val oldDataList = spotModelList.value?.toArrayList()
|
|
|
val newDataList = arrayListOf<SpotInfoData>()
|
|
val newDataList = arrayListOf<SpotInfoData>()
|
|
|
- if (type == "1") {
|
|
|
|
|
|
|
+ if (type == "1") {//新增
|
|
|
oldDatacacheList?.forEach {
|
|
oldDatacacheList?.forEach {
|
|
|
newDataList.add(it)
|
|
newDataList.add(it)
|
|
|
}
|
|
}
|
|
|
newDataList.add(SpotInfoData(id = id))
|
|
newDataList.add(SpotInfoData(id = id))
|
|
|
spotModelList.postValue(newDataList)
|
|
spotModelList.postValue(newDataList)
|
|
|
- } else if (type == "2") {
|
|
|
|
|
|
|
+ } else if (type == "2") {//删除
|
|
|
oldDatacacheList?.forEach {
|
|
oldDatacacheList?.forEach {
|
|
|
if (id != it.id) {
|
|
if (id != it.id) {
|
|
|
newDataList.add(it.copy(id = oldDatacacheList.indexOf(it).plus(1).toString()))
|
|
newDataList.add(it.copy(id = oldDatacacheList.indexOf(it).plus(1).toString()))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
spotModelList.postValue(newDataList)
|
|
spotModelList.postValue(newDataList)
|
|
|
- } else if (type == "3") {
|
|
|
|
|
|
|
+ } else if (type == "3") {//更换资料
|
|
|
oldDataList?.forEach {
|
|
oldDataList?.forEach {
|
|
|
|
|
+ var newValue = ""
|
|
|
|
|
+ var newEnumdicnameid = ""
|
|
|
|
|
+ var newEnumdicname = ""
|
|
|
|
|
+ var newCoefficientwarehouse = ""
|
|
|
|
|
+ var newData: SpotInfoData
|
|
|
if (it.id == id) {
|
|
if (it.id == id) {
|
|
|
- newDataList.add(it.copy(value = value))
|
|
|
|
|
|
|
+ newValue = if (value.isNullOrEmpty()) {
|
|
|
|
|
+ it.value
|
|
|
|
|
+ } else {
|
|
|
|
|
+ value
|
|
|
|
|
+ }
|
|
|
|
|
+ newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
|
|
|
|
|
+ it.enumdicnameid
|
|
|
|
|
+ } else {
|
|
|
|
|
+ enumdicnameid
|
|
|
|
|
+ }
|
|
|
|
|
+ newEnumdicname = if (newEnumdicname.isNullOrEmpty()) {
|
|
|
|
|
+ it.enumdicname
|
|
|
|
|
+ } else {
|
|
|
|
|
+ enumdicname
|
|
|
|
|
+ }
|
|
|
|
|
+ newCoefficientwarehouse = if (coefficientwarehouse.isNullOrEmpty()) {
|
|
|
|
|
+ it.coefficientwarehouse
|
|
|
|
|
+ } else {
|
|
|
|
|
+ coefficientwarehouse
|
|
|
|
|
+ }
|
|
|
|
|
+ newData = it.copy(
|
|
|
|
|
+ id = id,
|
|
|
|
|
+ value = newValue,
|
|
|
|
|
+ enumdicname = newEnumdicname,
|
|
|
|
|
+ coefficientwarehouse = newCoefficientwarehouse,
|
|
|
|
|
+ enumdicnameid = newEnumdicnameid
|
|
|
|
|
+ )
|
|
|
|
|
+ newDataList.add(newData)
|
|
|
} else {
|
|
} else {
|
|
|
newDataList.add(it)
|
|
newDataList.add(it)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+// spotModelList.postValue(newDataList)
|
|
|
|
|
+ spotModelcacheList.postValue(newDataList)
|
|
|
|
|
+ }else if (type == "4") {//更换资料
|
|
|
|
|
+ oldDataList?.forEach {
|
|
|
|
|
+ var newValue = ""
|
|
|
|
|
+ var newEnumdicnameid = ""
|
|
|
|
|
+ var newEnumdicname = ""
|
|
|
|
|
+ var newCoefficientwarehouse = ""
|
|
|
|
|
+ var newData: SpotInfoData
|
|
|
|
|
+ if (it.id == id) {
|
|
|
|
|
+ newValue = if (value.isNullOrEmpty()) {
|
|
|
|
|
+ it.value
|
|
|
|
|
+ } else {
|
|
|
|
|
+ value
|
|
|
|
|
+ }
|
|
|
|
|
+ newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
|
|
|
|
|
+ it.enumdicnameid
|
|
|
|
|
+ } else {
|
|
|
|
|
+ enumdicnameid
|
|
|
|
|
+ }
|
|
|
|
|
+ newEnumdicname = if (enumdicname.isNullOrEmpty()) {
|
|
|
|
|
+ it.enumdicname
|
|
|
|
|
+ } else {
|
|
|
|
|
+ enumdicname
|
|
|
|
|
+ }
|
|
|
|
|
+ newCoefficientwarehouse = if (coefficientwarehouse.isNullOrEmpty()) {
|
|
|
|
|
+ it.coefficientwarehouse
|
|
|
|
|
+ } else {
|
|
|
|
|
+ coefficientwarehouse
|
|
|
|
|
+ }
|
|
|
|
|
+ newData = it.copy(
|
|
|
|
|
+ id = id,
|
|
|
|
|
+ value = newValue,
|
|
|
|
|
+ enumdicname = newEnumdicname,
|
|
|
|
|
+ coefficientwarehouse = newCoefficientwarehouse,
|
|
|
|
|
+ enumdicnameid = newEnumdicnameid
|
|
|
|
|
+ )
|
|
|
|
|
+ newDataList.add(newData)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ newDataList.add(it)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ spotModelList.postValue(newDataList)
|
|
|
spotModelcacheList.postValue(newDataList)
|
|
spotModelcacheList.postValue(newDataList)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -432,36 +543,36 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
*/
|
|
*/
|
|
|
fun resetMiddleGoodsDataList(index: Int, status: String) {
|
|
fun resetMiddleGoodsDataList(index: Int, status: String) {
|
|
|
val datanewlist = arrayListOf<MiddleGoodsData>()
|
|
val datanewlist = arrayListOf<MiddleGoodsData>()
|
|
|
- when (status) {
|
|
|
|
|
- "0" -> {
|
|
|
|
|
- middleGoodsDisableList.value?.forEach {
|
|
|
|
|
- if (index == middleGoodsDisableList.value?.indexOf(it)) {
|
|
|
|
|
- if (it.indexSelect == 0) {
|
|
|
|
|
- datanewlist.add(it.copy(indexSelect = 1))
|
|
|
|
|
- } else {
|
|
|
|
|
- datanewlist.add(it.copy(indexSelect = 0))
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- datanewlist.add(it)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- middleGoodsDisableList.postValue(datanewlist)
|
|
|
|
|
- }
|
|
|
|
|
- "1" -> {
|
|
|
|
|
- middleGoodsNormalList.value?.forEach {
|
|
|
|
|
- if (index == middleGoodsNormalList.value?.indexOf(it)) {
|
|
|
|
|
- if (it.indexSelect == 0) {
|
|
|
|
|
- datanewlist.add(it.copy(indexSelect = 1))
|
|
|
|
|
- } else {
|
|
|
|
|
- datanewlist.add(it.copy(indexSelect = 0))
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- datanewlist.add(it)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- middleGoodsNormalList.postValue(datanewlist)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// when (status) {
|
|
|
|
|
+// "0" -> {
|
|
|
|
|
+// middleGoodsDisableList.value?.forEach {
|
|
|
|
|
+// if (index == middleGoodsDisableList.value?.indexOf(it)) {
|
|
|
|
|
+// if (it.indexSelect == 0) {
|
|
|
|
|
+// datanewlist.add(it.copy(indexSelect = 1))
|
|
|
|
|
+// } else {
|
|
|
|
|
+// datanewlist.add(it.copy(indexSelect = 0))
|
|
|
|
|
+// }
|
|
|
|
|
+// } else {
|
|
|
|
|
+// datanewlist.add(it)
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// middleGoodsDisableList.postValue(datanewlist)
|
|
|
|
|
+// }
|
|
|
|
|
+// "1" -> {
|
|
|
|
|
+// middleGoodsNormalList.value?.forEach {
|
|
|
|
|
+// if (index == middleGoodsNormalList.value?.indexOf(it)) {
|
|
|
|
|
+// if (it.indexSelect == 0) {
|
|
|
|
|
+// datanewlist.add(it.copy(indexSelect = 1))
|
|
|
|
|
+// } else {
|
|
|
|
|
+// datanewlist.add(it.copy(indexSelect = 0))
|
|
|
|
|
+// }
|
|
|
|
|
+// } else {
|
|
|
|
|
+// datanewlist.add(it)
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// middleGoodsNormalList.postValue(datanewlist)
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -494,15 +605,15 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
* 查询现货品种详情
|
|
* 查询现货品种详情
|
|
|
* @param wrstandardid String
|
|
* @param wrstandardid String
|
|
|
*/
|
|
*/
|
|
|
- fun queryWrStandardDetails(wrstandardid: String) {
|
|
|
|
|
|
|
+ fun queryWrStandardDetails(deliverygoodsid: String) {
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
- put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
|
|
- put("wrstandardid", wrstandardid)
|
|
|
|
|
|
|
+ put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
|
|
+// put("deliverygoodsid", deliverygoodsid)
|
|
|
}
|
|
}
|
|
|
- MyApplication.getInstance()?.commodityManager?.queryWrStandardDetail(params = params) { isSuccess, respData, _ ->
|
|
|
|
|
|
|
+ MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, _ ->
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
|
- wrStandardDetails.postValue(respData?.get(0))
|
|
|
|
|
- initSpotGoodsActivity(respData?.get(0) ?: WrStandardDetail())
|
|
|
|
|
|
|
+// wrStandardDetails.postValue(respData?.get(0))
|
|
|
|
|
+// initSpotGoodsActivity(respData?.get(0) ?: WrStandardDetail())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -566,7 +677,7 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
if (status == "0") {
|
|
if (status == "0") {
|
|
|
middleGoodsDisableList.postValue(newList)
|
|
middleGoodsDisableList.postValue(newList)
|
|
|
} else if (status == "1") {
|
|
} else if (status == "1") {
|
|
|
- middleGoodsNormalList.postValue(newList)
|
|
|
|
|
|
|
+// middleGoodsNormalList.postValue(newList)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -757,7 +868,7 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
* @param unitid Long 单位ID(修改时有值)
|
|
* @param unitid Long 单位ID(修改时有值)
|
|
|
* @param type Int 类型 1 新增 2 修改
|
|
* @param type Int 类型 1 新增 2 修改
|
|
|
* @param remark String 备注
|
|
* @param remark String 备注
|
|
|
- * @param spotgoodsmodels List<SpotGoodsModelEx> SpotGoodsModelEx 现货商品型号数据
|
|
|
|
|
|
|
+ * @param spotgoodsmodels List<SpotGoodsModelEx> SpotGoodsModelEx 现货商品型号数据/品类
|
|
|
* @param spotgoodsbrands List<SpotGoodsBrandEx> SpotGoodsBrandEx 现货商品品牌数据
|
|
* @param spotgoodsbrands List<SpotGoodsBrandEx> SpotGoodsBrandEx 现货商品品牌数据
|
|
|
* @param wrsconvertdetails List<WRSConvertDetailEx> WRSConvertDetailEx 现货商品折算配置明细数据
|
|
* @param wrsconvertdetails List<WRSConvertDetailEx> WRSConvertDetailEx 现货商品折算配置明细数据
|
|
|
*/
|
|
*/
|
|
@@ -768,8 +879,8 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
unitid: Long = 0,
|
|
unitid: Long = 0,
|
|
|
type: Int = 0,
|
|
type: Int = 0,
|
|
|
remark: String = "",
|
|
remark: String = "",
|
|
|
- spotgoodsmodels: List<ManageServiceMI2.SpotGoodsModelEx> = arrayListOf(),
|
|
|
|
|
- spotgoodsbrands: List<ManageServiceMI2.SpotGoodsBrandEx> = arrayListOf(),
|
|
|
|
|
|
|
+ spotgoodsmodels: List<ManageServiceMI2.GLDWRStandardEx> = arrayListOf(),
|
|
|
|
|
+ spotgoodsbrands: List<ManageServiceMI2.GLDDGFactoryItemEx> = arrayListOf(),
|
|
|
wrsconvertdetails: List<ManageServiceMI2.WRSConvertDetailEx> = arrayListOf(),
|
|
wrsconvertdetails: List<ManageServiceMI2.WRSConvertDetailEx> = arrayListOf(),
|
|
|
isSuccess: (isCompleted: Boolean) -> Unit
|
|
isSuccess: (isCompleted: Boolean) -> Unit
|
|
|
) {
|
|
) {
|
|
@@ -818,7 +929,7 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
MyApplication.getInstance()?.commodityManager?.requestGoodsCancelReq(
|
|
MyApplication.getInstance()?.commodityManager?.requestGoodsCancelReq(
|
|
|
wrstandardid = wrstandardid,
|
|
wrstandardid = wrstandardid,
|
|
|
isvalid = isvalid
|
|
isvalid = isvalid
|
|
|
- ){ isCompleted, err ->
|
|
|
|
|
|
|
+ ) { isCompleted, err ->
|
|
|
if (isCompleted) {
|
|
if (isCompleted) {
|
|
|
loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
|
|
loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
|
|
|
isSuccess(true)
|
|
isSuccess(true)
|
|
@@ -839,13 +950,13 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
* 查询变更记录
|
|
* 查询变更记录
|
|
|
* @param RelatedId String
|
|
* @param RelatedId String
|
|
|
*/
|
|
*/
|
|
|
- fun queryChangeLog(RelatedId : String){
|
|
|
|
|
|
|
+ fun queryChangeLog(RelatedId: String) {
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
put("RelatedId", RelatedId)
|
|
put("RelatedId", RelatedId)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- MyApplication.getInstance()?.commonManager?.queryChangeLog(params = params){isSuccess, respData, error ->
|
|
|
|
|
- if (isSuccess){
|
|
|
|
|
|
|
+ MyApplication.getInstance()?.commonManager?.queryChangeLog(params = params) { isSuccess, respData, error ->
|
|
|
|
|
+ if (isSuccess) {
|
|
|
changeLogDataList.postValue(respData)
|
|
changeLogDataList.postValue(respData)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -855,15 +966,15 @@ class CommodityInformationViewModel : BaseViewModel() {
|
|
|
* 查询套保变更记录
|
|
* 查询套保变更记录
|
|
|
* @param RelatedId String
|
|
* @param RelatedId String
|
|
|
*/
|
|
*/
|
|
|
- fun queryMiddleGoodsChangeLog(middlegoodsid : String){
|
|
|
|
|
|
|
+ fun queryMiddleGoodsChangeLog(middlegoodsid: String) {
|
|
|
|
|
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
put("middlegoodsid", middlegoodsid)
|
|
put("middlegoodsid", middlegoodsid)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- MyApplication.getInstance()?.commonManager?.queryMiddleGoodsChangeLog(params = params){isSuccess, respData, error ->
|
|
|
|
|
- if (isSuccess){
|
|
|
|
|
|
|
+ MyApplication.getInstance()?.commonManager?.queryMiddleGoodsChangeLog(params = params) { isSuccess, respData, error ->
|
|
|
|
|
+ if (isSuccess) {
|
|
|
respData?.toArrayList()?.sortWith(Comparator { t1, t2 ->
|
|
respData?.toArrayList()?.sortWith(Comparator { t1, t2 ->
|
|
|
(TimeUtils.string2Millis(t2.updatetime) - TimeUtils.string2Millis(t1.updatetime)).toInt()
|
|
(TimeUtils.string2Millis(t2.updatetime) - TimeUtils.string2Millis(t1.updatetime)).toInt()
|
|
|
})
|
|
})
|