|
|
@@ -1,5 +1,6 @@
|
|
|
package cn.muchinfo.rma.view.base.tjmd
|
|
|
|
|
|
+import android.annotation.SuppressLint
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.global.data.*
|
|
|
@@ -104,7 +105,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
circleBuyContentDataList.postValue(getcircleContentDataListRightData(respData ?: arrayListOf()))
|
|
|
}
|
|
|
@@ -126,7 +127,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
circleDataByListed.postValue(respData?.get(0))
|
|
|
@@ -155,7 +156,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
}
|
|
|
put("deliverygoodsid",getDeliveryGoodsIDByWRStandardID(wrstandardid))
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
circleDataByListed.postValue(respData?.get(0))
|
|
|
@@ -181,7 +182,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
circleSellContentDataList.postValue(getcircleContentDataListRightData(respData ?: arrayListOf()))
|
|
|
}
|
|
|
@@ -240,35 +241,6 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
|
|
|
/**
|
|
|
* 持仓挂牌
|
|
|
- * @param LadingBillId Long
|
|
|
- * @param TradeDate String
|
|
|
- * @param SubNum Long
|
|
|
- * @param WRFactorTypeId Long
|
|
|
- * @param UserID Int
|
|
|
- * @param AccountID Long
|
|
|
- * @param IsSpecified Int
|
|
|
- * @param MatchAccIDs List<Long>
|
|
|
- * @param OrderQty Long
|
|
|
- * @param DeliveryGoodsID Int
|
|
|
- * @param WRPriceType Int
|
|
|
- * @param FixedPrice Double
|
|
|
- * @param WRTradeGoods WRGoodsInfo
|
|
|
- * @param PriceFactor Double
|
|
|
- * @param PriceMove Double
|
|
|
- * @param TimevalidType Int
|
|
|
- * @param FirstRatio Double
|
|
|
- * @param PerformanceTemplateID Long
|
|
|
- * @param BuyOrSell Int
|
|
|
- * @param PriceDisplayMode Int
|
|
|
- * @param CanBargain Int
|
|
|
- * @param Attachment1 String
|
|
|
- * @param Attachment2 String
|
|
|
- * @param Remark String
|
|
|
- * @param ApplyID Long
|
|
|
- * @param CanPart Int
|
|
|
- * @param HasWr Int
|
|
|
- * @param WRStandardID Int
|
|
|
- * @param isSuccess Function1<[@kotlin.ParameterName] Boolean, Unit>
|
|
|
*/
|
|
|
fun requeryWRListingOrderReq(
|
|
|
LadingBillId: Long = 0,//提单id(wrholdlb的LadingBillId字段),卖的时候填写
|
|
|
@@ -372,7 +344,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("deliverygoodsid", data.DeliveryGoodsID ?: "")
|
|
|
put("wrstandardid",data.WrFtWrstandard?.wrstandardid ?: "")
|
|
|
}
|
|
|
- MyApplication.getInstance()?.warehouseManager?.queryHoldLB(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.warehouseManager?.queryHoldLB(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
detailsWarehouseContentDataList.postValue(respData)
|
|
|
}
|
|
|
@@ -408,7 +380,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
//获取选择的仓库ID和选择的要素类型 是否全部选择
|
|
|
fun getSelectBooble() : Boolean{
|
|
|
var selectNum = 0
|
|
|
- var returnBooble = false
|
|
|
+ var returnBooble: Boolean
|
|
|
WrStandardFactoryItemDataList.value?.forEach {
|
|
|
it.itemlst?.forEach { data ->
|
|
|
if (data.isSelect == 1){
|
|
|
@@ -427,7 +399,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
val goodsInfoList1 = DataBase.getInstance().goodsInfoDao().all
|
|
|
goodsInfoList1?.forEach {
|
|
|
if (it?.goodsgroupid.toString() == goodsgroupid){
|
|
|
- newGoodsInfoList.add(SelectData(id = it?.goodsid.toString(),value = it?.goodsname.toString(),goodsCode = it.goodscode ?: ""))
|
|
|
+ newGoodsInfoList.add(SelectData(id = it?.goodsid.toString(),value = it?.goodsname.toString(),goodsCode = it.goodscode))
|
|
|
}
|
|
|
}
|
|
|
goodsInfoList.postValue(newGoodsInfoList)
|
|
|
@@ -509,7 +481,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
val params = mutableMapOf<String,String>().apply {
|
|
|
put("wrstandardid",wrstandardid)
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryWrStandardFactoryItem(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryWrStandardFactoryItem(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
WrStandardFactoryItemDataList.postValue(respData)
|
|
|
}
|
|
|
@@ -524,7 +496,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
val params = mutableMapOf<String,String>().apply {
|
|
|
put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryFtDeliveryGoods(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryFtDeliveryGoods(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
ftDeliveryGoodsDataList.postValue(respData)
|
|
|
}
|
|
|
@@ -598,7 +570,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
orderQuoteDataByListed.postValue(respData?.get(0))
|
|
|
@@ -630,7 +602,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
onePrcieDataList.postValue(respData)
|
|
|
}
|
|
|
@@ -656,7 +628,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
orderQuoteDataByListed.postValue(respData?.get(0))
|
|
|
@@ -688,7 +660,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
floatProceDataList.postValue(respData)
|
|
|
//说是不订阅行情,靠轮询10秒查
|
|
|
@@ -740,7 +712,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
yscircleBuyContentDataList.postValue(getyscircleContentDataListRightData(respData ?: arrayListOf()))
|
|
|
}
|
|
|
@@ -764,7 +736,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
circleDataByListed.postValue(respData?.get(0))
|
|
|
@@ -792,7 +764,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
circleDataByListed.postValue(respData?.get(0))
|
|
|
@@ -818,7 +790,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
}
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuoteMyq(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
yscircleSellContentDataList.postValue(getyscircleContentDataListRightData(respData ?: arrayListOf()))
|
|
|
}
|
|
|
@@ -869,7 +841,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
put("wrstandardid",wrstandardid)
|
|
|
put("dgitemname",dgitemname)
|
|
|
}
|
|
|
- MyApplication.getInstance()?.warehouseManager?.queryWrPosition(params = params){ isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.warehouseManager?.queryWrPosition(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData?.isNotEmpty() == true){
|
|
|
summaryWrPositionDataByDialog.postValue(respData.get(0))
|
|
|
@@ -913,7 +885,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
orderQuoteDataByListed.postValue(respData?.get(0))
|
|
|
@@ -947,7 +919,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
ysonePrcieDataList.postValue(respData)
|
|
|
}
|
|
|
@@ -976,7 +948,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
if (respData.isNullOrEmpty().not()){
|
|
|
orderQuoteDataByListed.postValue(respData?.get(0))
|
|
|
@@ -1011,7 +983,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, _ ->
|
|
|
if (isSuccess){
|
|
|
ysfloatProceDataList.postValue(respData)
|
|
|
}
|
|
|
@@ -1107,7 +1079,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
put("goodsCodes", goodsCodes)
|
|
|
}
|
|
|
- MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, _, error ->
|
|
|
if (isSuccess) {
|
|
|
callback(true, null)
|
|
|
} else {
|
|
|
@@ -1133,10 +1105,11 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
* @param tag String
|
|
|
* @param goodsInfoList List<GoodsInfo>
|
|
|
*/
|
|
|
+ @SuppressLint("DefaultLocale")
|
|
|
fun addSubscriptQuote(tag: String, goodsInfoList: List<GoodsInfo>) {
|
|
|
GlobalScope.launch {
|
|
|
MyApplication.getInstance()?.quoteManager?.addSubscriptQuote(
|
|
|
- tag = tag, goodsCodeSet = goodsInfoList.map { it.goodscode.toUpperCase() ?: "" }.toSet()
|
|
|
+ tag = tag, goodsCodeSet = goodsInfoList.map { it.goodscode.toUpperCase() }.toSet()
|
|
|
) { _, _ ->
|
|
|
|
|
|
}
|
|
|
@@ -1162,7 +1135,7 @@ class TjmdMarketViewModel : BaseViewModel(){
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
put("goodsCodes", goodsCodes)
|
|
|
}
|
|
|
- MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
|
|
|
+ MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, _ ->
|
|
|
if (isSuccess) {
|
|
|
if (respData?.isEmpty()?.not() == true) {
|
|
|
quoteDayData.postValue(respData[0])
|