|
|
@@ -89,7 +89,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
}
|
|
|
|
|
|
//买大厅
|
|
|
- private val buyHallUI by lazy { BuyHallUI(this, viewModel, type ?: "", pricetype ?: "", orderQuoteData) }
|
|
|
+ private val buyHallUI by lazy {
|
|
|
+ BuyHallUI(
|
|
|
+ this,
|
|
|
+ viewModel,
|
|
|
+ type ?: "",
|
|
|
+ pricetype ?: "",
|
|
|
+ orderQuoteData
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
//viewpager的适配器
|
|
|
private var newPagerAdapter: PagerAdapter? = null
|
|
|
@@ -137,8 +145,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
|
|
|
//通用的消息更新通知
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
- fun onMessageEvent(messageEvent : MessageEvent) {
|
|
|
- if (messageEvent.messageType == EventConstent.FID_MoneyChangedNtf){//资金账号变化通知
|
|
|
+ fun onMessageEvent(messageEvent: MessageEvent) {
|
|
|
+ if (messageEvent.messageType == EventConstent.FID_MoneyChangedNtf) {//资金账号变化通知
|
|
|
viewModel.getTaAccounts()
|
|
|
}
|
|
|
}
|
|
|
@@ -166,8 +174,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
}
|
|
|
|
|
|
//判断是否打开挂牌dialog,是的话就打开
|
|
|
- fun openDialogByListed(){
|
|
|
- if (isOpenListedDialog == "1"){
|
|
|
+ fun openDialogByListed() {
|
|
|
+ if (isOpenListedDialog == "1") {
|
|
|
if (pricetype == "1") {//一口价
|
|
|
this@BusinessHallActivity.OneListedDialog(
|
|
|
this@BusinessHallActivity,
|
|
|
@@ -194,9 +202,16 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
verticalLayout {
|
|
|
createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
|
|
|
initMenuData()
|
|
|
- viewModel.queryWrAverageTradePrice(type = type ?: "",wrfactortypeid = orderQuoteData.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryWrAverageTradePrice(
|
|
|
+ type = type ?: "",
|
|
|
+ wrfactortypeid = orderQuoteData.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
viewModel.orderQuoteData.postValue(orderQuoteData)
|
|
|
- viewModel.queryQuoteDay(tag = thisTag,goodsCodes = orderQuoteData.goodscode ?: "",isShowLoading = false)
|
|
|
+ viewModel.queryQuoteDay(
|
|
|
+ tag = thisTag,
|
|
|
+ goodsCodes = orderQuoteData.goodscode ?: "",
|
|
|
+ isShowLoading = false
|
|
|
+ )
|
|
|
viewModel.resetAccountData()
|
|
|
viewModel.querydetailsWarehouseWrPosition(orderQuoteData)
|
|
|
background = resources.getDrawable(R.color.white)
|
|
|
@@ -272,8 +287,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
onThrottleFirstClick {
|
|
|
val intent = Intent()
|
|
|
intent.putExtra("data", orderQuoteData)
|
|
|
- intent.putExtra("type",type)
|
|
|
- intent.putExtra("goodsId",orderQuoteData.goodsid)
|
|
|
+ intent.putExtra("type", type)
|
|
|
+ intent.putExtra("goodsId", orderQuoteData.goodsid)
|
|
|
intent.setClass(context, BusinessHallDetailsActivity::class.java)
|
|
|
ActivityUtils.startActivity(intent)
|
|
|
}
|
|
|
@@ -324,7 +339,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = NumberUtils.roundNum(it?.sellprice, 2)
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -345,7 +360,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = NumberUtils.roundNum(it?.buyprice, 2)
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -370,7 +385,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = it?.sellqty
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -393,7 +408,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = it?.buyqty
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -466,7 +481,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = NumberUtils.roundNum(it?.sellpricemove, 2)
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -487,7 +502,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = NumberUtils.roundNum(it?.buypricemove, 2)
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -533,7 +548,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = it?.sellqty
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -556,7 +571,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- viewModel.orderQuoteData.bindOptional(context){
|
|
|
+ viewModel.orderQuoteData.bindOptional(context) {
|
|
|
text = it?.buyqty
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -676,7 +691,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
creatFinancingDialog(
|
|
|
type = type ?: "",
|
|
|
pricetype = pricetype ?: "",
|
|
|
- buyOrSelldata = viewModel.selectData.value ?: OrderQuoteDetailData(),
|
|
|
+ buyOrSelldata = viewModel.selectData.value
|
|
|
+ ?: OrderQuoteDetailData(),
|
|
|
data = viewModel.orderQuoteData.value ?: OrderQuoteData()
|
|
|
)
|
|
|
}
|
|
|
@@ -706,13 +722,14 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
.markerRadius(2f)
|
|
|
.markerSymbol(AAChartSymbolType.Circle)
|
|
|
.markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)
|
|
|
- .colorsTheme(arrayOf("#FF9A2A","#F39730"))
|
|
|
+ .colorsTheme(arrayOf("#FF9A2A", "#F39730"))
|
|
|
.scrollablePlotArea(
|
|
|
AAScrollablePlotArea()
|
|
|
.minWidth(300)
|
|
|
- .scrollPositionX(1f))
|
|
|
+ .scrollPositionX(1f)
|
|
|
+ )
|
|
|
|
|
|
- viewModel.wrAverageTradePriceDataList.bindOptional(context){
|
|
|
+ viewModel.wrAverageTradePriceDataList.bindOptional(context) {
|
|
|
val list = it
|
|
|
val totalexposureelement = AASeriesElement()
|
|
|
.lineWidth(2f)
|
|
|
@@ -762,7 +779,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
lateinit var one_seekbar: SeekBar
|
|
|
|
|
|
/** 最大可摘数量 **/
|
|
|
- val maxpickNumber : MutableLiveData<Double> = MutableLiveData()
|
|
|
+ val maxpickNumber: MutableLiveData<Double> = MutableLiveData()
|
|
|
|
|
|
var marginValue = 0.0//履约保证金比例
|
|
|
|
|
|
@@ -860,7 +877,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
textView {
|
|
|
text = "请选择现货仓单"
|
|
|
selectSpotDetailsData.bindOptional(context) {
|
|
|
- maxpickNumber.postValue(Math.min(it?.enableqty?.toDouble()?:0.0,buySelldata?.orderqty?.toDouble() ?: 0.0))
|
|
|
+ maxpickNumber.postValue(
|
|
|
+ Math.min(
|
|
|
+ it?.enableqty?.toDouble() ?: 0.0,
|
|
|
+ buySelldata?.orderqty?.toDouble() ?: 0.0
|
|
|
+ )
|
|
|
+ )
|
|
|
text = it?.ladingbillid + "(" + it?.enableqty + it?.enumdicname + ")"
|
|
|
}
|
|
|
textSizeAuto = 34
|
|
|
@@ -952,7 +974,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "(" + data.minivalue +data.enumdicname +"起)"
|
|
|
+ text = "(" + data.minivalue + data.enumdicname + "起)"
|
|
|
textSizeAuto = 29
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -1039,7 +1061,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- maxpickNumber.bindOptional(context){
|
|
|
+ maxpickNumber.bindOptional(context) {
|
|
|
text = it.toString() + data.enumdicname
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -1128,7 +1150,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 1
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
} else {//卖单所以是摘买
|
|
|
@@ -1148,7 +1178,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 1
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
}
|
|
|
@@ -1171,7 +1209,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 0
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
} else {//卖单所以是摘买
|
|
|
@@ -1191,7 +1237,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 0
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
}
|
|
|
@@ -1255,19 +1309,19 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
lateinit var float_delisting_amount: TextView
|
|
|
|
|
|
/** 最大可摘数量 **/
|
|
|
- val maxpickNumber : MutableLiveData<Double> = MutableLiveData()
|
|
|
+ val maxpickNumber: MutableLiveData<Double> = MutableLiveData()
|
|
|
|
|
|
/*** 一口价摘牌金额 **/
|
|
|
lateinit var one_seekbar: SeekBar
|
|
|
|
|
|
//估算总额
|
|
|
- lateinit var float_total_amount : TextView
|
|
|
+ lateinit var float_total_amount: TextView
|
|
|
|
|
|
//估算总价
|
|
|
- lateinit var float_total_price : TextView
|
|
|
+ lateinit var float_total_price: TextView
|
|
|
|
|
|
//浮动价挂牌金额
|
|
|
- val listed_price : MutableLiveData<Double> = MutableLiveData()
|
|
|
+ val listed_price: MutableLiveData<Double> = MutableLiveData()
|
|
|
|
|
|
var marginValue = 0.0//履约保证金比例
|
|
|
|
|
|
@@ -1299,9 +1353,11 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
backgroundColor = Color.parseColor("#5f000000")
|
|
|
viewModel.quoteDayData.postValue(viewModel.quoteDayData.value)//重新对行情盘面进行赋值以触发计算估算总价
|
|
|
verticalLayout {
|
|
|
- viewModel.quoteDayData.bindOptional(context){
|
|
|
+ viewModel.quoteDayData.bindOptional(context) {
|
|
|
//行情下发计算挂牌金额 = (基差价格+期货合约价)
|
|
|
- listed_price.postValue(buySelldata.pricemove.toString().toDouble().plus(it?.getPrice() ?: 0.0))
|
|
|
+ listed_price.postValue(
|
|
|
+ buySelldata.pricemove.toString().toDouble().plus(it?.getPrice() ?: 0.0)
|
|
|
+ )
|
|
|
}
|
|
|
backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
|
|
|
linearLayout {
|
|
|
@@ -1371,7 +1427,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
textView {
|
|
|
text = "请选择现货仓单"
|
|
|
selectSpotDetailsData.bindOptional(context) {
|
|
|
- maxpickNumber.postValue(Math.min(it?.enableqty?.toDouble() ?: 0.0,buySelldata.orderqty?.toDouble() ?: 0.0))
|
|
|
+ maxpickNumber.postValue(
|
|
|
+ Math.min(
|
|
|
+ it?.enableqty?.toDouble() ?: 0.0,
|
|
|
+ buySelldata.orderqty?.toDouble() ?: 0.0
|
|
|
+ )
|
|
|
+ )
|
|
|
text = it?.ladingbillid + "(" + it?.enableqty + it?.enumdicname + ")"
|
|
|
}
|
|
|
textSizeAuto = 34
|
|
|
@@ -1463,7 +1524,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "(" + data.minivalue +data.enumdicname +"起)"
|
|
|
+ text = "(" + data.minivalue + data.enumdicname + "起)"
|
|
|
textSizeAuto = 29
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -1478,7 +1539,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
numberEditText {
|
|
|
text = "1"
|
|
|
listednumberEdittext = this
|
|
|
- maxpickNumber.bindOptional(context){
|
|
|
+ maxpickNumber.bindOptional(context) {
|
|
|
max = it ?: 1.0
|
|
|
}
|
|
|
setOnTextChangeListener { view, value ->
|
|
|
@@ -1537,7 +1598,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
emptyView()
|
|
|
|
|
|
textView {
|
|
|
- maxpickNumber.bindOptional(context){
|
|
|
+ maxpickNumber.bindOptional(context) {
|
|
|
text = it.toString() + data.enumdicname
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
@@ -1568,11 +1629,13 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
textView {
|
|
|
text = "--"
|
|
|
listed_price.bindOptional(context) {
|
|
|
- if (it != 0.0 && marginValue != 0.0){
|
|
|
- val maxNumberByMoney = viewModel.usedAccountData.value?.canUserAmount?.div(it ?: 1.0)?.div(marginValue)
|
|
|
- if (maxNumberByMoney ?: 0.0 > buySelldata.orderqty?.toDouble() ?: 0.0){
|
|
|
+ if (it != 0.0 && marginValue != 0.0) {
|
|
|
+ val maxNumberByMoney =
|
|
|
+ viewModel.usedAccountData.value?.canUserAmount?.div(it ?: 1.0)
|
|
|
+ ?.div(marginValue)
|
|
|
+ if (maxNumberByMoney ?: 0.0 > buySelldata.orderqty?.toDouble() ?: 0.0) {
|
|
|
maxpickNumber.postValue(buySelldata.orderqty?.toDouble())
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
maxpickNumber.postValue(maxNumberByMoney?.toDouble())
|
|
|
}
|
|
|
}
|
|
|
@@ -1624,7 +1687,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
|
|
|
textView {
|
|
|
viewModel.usedAccountData.bindOptional(context) {
|
|
|
- text = "可用资金 " + NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
|
|
|
+ text = "可用资金 " + NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
@@ -1673,7 +1736,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 1
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
} else {//卖单所以是摘买
|
|
|
@@ -1692,7 +1763,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 1
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
}
|
|
|
@@ -1714,7 +1793,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 0
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
} else {//卖单所以是摘买
|
|
|
@@ -1733,7 +1820,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
DeliveryMonth = data.deliverymonth ?: "",
|
|
|
HasWr = 0
|
|
|
) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
dialog.dismiss()
|
|
|
}
|
|
|
}
|
|
|
@@ -1789,6 +1884,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
val dialog1 by lazy {
|
|
|
SelectFincningDialog(this@BusinessHallActivity, viewModel, data)
|
|
|
}
|
|
|
+
|
|
|
/** 摘牌数量 **/
|
|
|
lateinit var onePriceInputNumberEdittext: MangeNumberEditText2
|
|
|
|
|
|
@@ -1802,7 +1898,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
lateinit var performance_bond_amount: TextView
|
|
|
|
|
|
/** 最大可摘数量 **/
|
|
|
- val maxpickNumber : MutableLiveData<Double> = MutableLiveData()
|
|
|
+ val maxpickNumber: MutableLiveData<Double> = MutableLiveData()
|
|
|
|
|
|
lateinit var one_seekbar: SeekBar
|
|
|
|
|
|
@@ -1812,468 +1908,534 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
|
|
|
maxpickNumber.postValue(buyOrSelldata.orderqty?.toDouble())
|
|
|
verticalLayout {
|
|
|
backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
|
|
|
- linearLayout {
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- onThrottleFirstClick {
|
|
|
- creatAccountDataSheetDialog(
|
|
|
- "请选择资金账号",
|
|
|
- GlobalDataCollection.instance?.accountDataList ?: arrayListOf()
|
|
|
- ) {
|
|
|
- selectAccountData.postValue(this)
|
|
|
- viewModel.resetAccountDataBySelect(this)
|
|
|
- }
|
|
|
- }
|
|
|
- linearLayout {
|
|
|
- textView {
|
|
|
- text = "交易账户"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
|
- textView {
|
|
|
- selectAccountData.bindOptional(context) {
|
|
|
- text = it?.accountid.toString() + " " + it?.accountname
|
|
|
- }
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
-
|
|
|
- emptyView()
|
|
|
-
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.rma_more
|
|
|
- }.lparams(autoSize(36), autoSize(36))
|
|
|
-
|
|
|
- }.lparams(matchParent, autoSize(172))
|
|
|
-
|
|
|
- itemView()
|
|
|
-
|
|
|
- linearLayout {
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- linearLayout {
|
|
|
- textView {
|
|
|
- text = "挂牌方"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(autoSize(250), wrapContent)
|
|
|
-
|
|
|
- textView {
|
|
|
- text = buyOrSelldata.username
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
-
|
|
|
- itemView()
|
|
|
-
|
|
|
- linearLayout {
|
|
|
- visibility = if (type == "1") {
|
|
|
- View.VISIBLE
|
|
|
- } else {
|
|
|
- View.GONE
|
|
|
- }
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- linearLayout {
|
|
|
- textView {
|
|
|
- text = "挂牌价格"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(autoSize(250), wrapContent)
|
|
|
-
|
|
|
- textView {
|
|
|
- text = buyOrSelldata.fixedprice
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
+ frameLayout {
|
|
|
+ scrollView {
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ onThrottleFirstClick {
|
|
|
+ creatAccountDataSheetDialog(
|
|
|
+ "请选择资金账号",
|
|
|
+ GlobalDataCollection.instance?.accountDataList
|
|
|
+ ?: arrayListOf()
|
|
|
+ ) {
|
|
|
+ selectAccountData.postValue(this)
|
|
|
+ viewModel.resetAccountDataBySelect(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "交易账户"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
|
- linearLayout {
|
|
|
- visibility = if (pricetype == "2") {
|
|
|
- View.VISIBLE
|
|
|
- } else {
|
|
|
- View.GONE
|
|
|
- }
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- linearLayout {
|
|
|
- textView {
|
|
|
- text = "基差"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(autoSize(250), wrapContent)
|
|
|
+ textView {
|
|
|
+ selectAccountData.bindOptional(context) {
|
|
|
+ text = it?.accountid.toString() + " " + it?.accountname
|
|
|
+ }
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
|
- textView {
|
|
|
- text = buyOrSelldata.pricemove
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.buy_hall_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
+ emptyView()
|
|
|
|
|
|
- itemView()
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36))
|
|
|
|
|
|
- linearLayout {
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- linearLayout {
|
|
|
- textView {
|
|
|
- text = "挂牌数量"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(autoSize(250), wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(172))
|
|
|
|
|
|
- textView {
|
|
|
- text = buyOrSelldata.orderqty
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
+ itemView()
|
|
|
|
|
|
- itemView()
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌方"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
|
- linearLayout {
|
|
|
- verticalLayout {
|
|
|
- textView {
|
|
|
- text = "摘牌数量"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- topMargin = autoSize(36)
|
|
|
- }
|
|
|
+ textView {
|
|
|
+ text = buyOrSelldata.username
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
|
- textView {
|
|
|
- text = "(" + data.minivalue +data.enumdicname +"起)"
|
|
|
- textSizeAuto = 29
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- topMargin = autoSize(20)
|
|
|
- }
|
|
|
- }.lparams(autoSize(250), autoSize(290))
|
|
|
+ itemView()
|
|
|
|
|
|
- verticalLayout {
|
|
|
- linearLayout {
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- numberEditText {
|
|
|
- text = "1"
|
|
|
- maxpickNumber.bindOptional(context){
|
|
|
- max = it ?: 1.0
|
|
|
+ linearLayout {
|
|
|
+ visibility = if (type == "1") {
|
|
|
+ View.VISIBLE
|
|
|
+ } else {
|
|
|
+ View.GONE
|
|
|
}
|
|
|
- onePriceInputNumberEdittext = this
|
|
|
- setOnTextChangeListener { view, value ->
|
|
|
- if (value.isNullOrEmpty().not()) {
|
|
|
- float_delisting_amount.text = NumberUtils.roundNum(
|
|
|
- buyOrSelldata.fixedprice?.toDouble()
|
|
|
- ?.times(value.toString().toDouble()) ?: 0.0, 2
|
|
|
- )
|
|
|
- one_seekbar.progress = value.toDouble()
|
|
|
- .div(maxpickNumber.value ?: 0.0)
|
|
|
- .times(100).toInt()
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌价格"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
}
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = buyOrSelldata.fixedprice
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ visibility = if (pricetype == "2") {
|
|
|
+ View.VISIBLE
|
|
|
+ } else {
|
|
|
+ View.GONE
|
|
|
}
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "基差"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = buyOrSelldata.pricemove
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.buy_hall_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌数量"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = buyOrSelldata.orderqty
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ verticalLayout {
|
|
|
+ textView {
|
|
|
+ text = "摘牌数量"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ topMargin = autoSize(36)
|
|
|
+ }
|
|
|
|
|
|
- }.lparams(0, autoSize(72), 1f)
|
|
|
+ textView {
|
|
|
+ text = "(" + data.minivalue + data.enumdicname + "起)"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), autoSize(290))
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ numberEditText {
|
|
|
+ text = "1"
|
|
|
+ maxpickNumber.bindOptional(context) {
|
|
|
+ max = it ?: 1.0
|
|
|
+ }
|
|
|
+ onePriceInputNumberEdittext = this
|
|
|
+ setOnTextChangeListener { view, value ->
|
|
|
+ if (value.isNullOrEmpty().not()) {
|
|
|
+ float_delisting_amount.text =
|
|
|
+ NumberUtils.roundNum(
|
|
|
+ buyOrSelldata.fixedprice?.toDouble()
|
|
|
+ ?.times(value.toString().toDouble())
|
|
|
+ ?: 0.0, 2
|
|
|
+ )
|
|
|
+ one_seekbar.progress = value.toDouble()
|
|
|
+ .div(maxpickNumber.value ?: 0.0)
|
|
|
+ .times(100).toInt()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(0, autoSize(72), 1f)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.enumdicname
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ inflateLayout<SeekBar>(R.layout.main_seekbar) {
|
|
|
+ min = 10
|
|
|
+ max = 100
|
|
|
+ one_seekbar = this
|
|
|
+ isIndeterminate = false
|
|
|
+ splitTrack = false
|
|
|
+ setPadding(0, 0, 0, 0)
|
|
|
+ thumb = resources.getDrawable(R.mipmap.hnst_seekbar)
|
|
|
+ progressDrawable =
|
|
|
+ resources.getDrawable(R.drawable.seekbar_bg)
|
|
|
+ setOnSeekBarChangeListener(object :
|
|
|
+ SeekBar.OnSeekBarChangeListener {
|
|
|
+ override fun onProgressChanged(
|
|
|
+ p0: SeekBar?,
|
|
|
+ p1: Int,
|
|
|
+ p2: Boolean
|
|
|
+ ) {
|
|
|
+ onePriceInputNumberEdittext.text =
|
|
|
+ NumberUtils.roundNum(
|
|
|
+ maxpickNumber.value?.times(p1.div(100.0))
|
|
|
+ ?: 0.0, 0
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStartTrackingTouch(p0: SeekBar?) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStopTrackingTouch(p0: SeekBar?) {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.lparams(matchParent, autoSize(46)) {
|
|
|
+ marginEnd = autoSize(110)
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
|
|
|
- textView {
|
|
|
- text = data.enumdicname
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginEnd = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "0"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ textView {
|
|
|
+ maxpickNumber.bindOptional(context) {
|
|
|
+ text = it?.toString() + data.enumdicname
|
|
|
+ }
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, wrapContent) {
|
|
|
+ marginEnd = autoSize(110)
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ }
|
|
|
|
|
|
- inflateLayout<SeekBar>(R.layout.main_seekbar) {
|
|
|
- min = 10
|
|
|
- max = 100
|
|
|
- one_seekbar = this
|
|
|
- isIndeterminate = false
|
|
|
- splitTrack = false
|
|
|
- setPadding(0, 0, 0, 0)
|
|
|
- thumb = resources.getDrawable(R.mipmap.hnst_seekbar)
|
|
|
- progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
|
- setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
|
|
- override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
|
|
|
- onePriceInputNumberEdittext.text = NumberUtils.roundNum(
|
|
|
- maxpickNumber.value?.times(p1.div(100.0))
|
|
|
- ?: 0.0, 0
|
|
|
- )
|
|
|
- }
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
|
|
|
- override fun onStartTrackingTouch(p0: SeekBar?) {
|
|
|
+ itemView()
|
|
|
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ onThrottleFirstClick {
|
|
|
+ dialog1.show()
|
|
|
+ }
|
|
|
+ textView {
|
|
|
+ text = "融资方案"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(autoSize(214), wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
}
|
|
|
|
|
|
- override fun onStopTrackingTouch(p0: SeekBar?) {
|
|
|
-
|
|
|
+ textView {
|
|
|
+ viewModel.slectfinancingData.bindOptional(context) {
|
|
|
+ if (dialog1.isVisible) {
|
|
|
+ dialog1.dismiss()
|
|
|
+ }
|
|
|
+ var cost = ""//费用
|
|
|
+ if (it?.interestratemode == "1") {
|
|
|
+ cost = it.interestrate?.toPercentage() ?: ""
|
|
|
+ } else if (it?.interestratemode == "2") {
|
|
|
+ cost = it.interestrate?.toWanPercentage() ?: ""
|
|
|
+ } else if (it?.interestratemode == "3") {//固定值
|
|
|
+ cost = NumberUtils.roundNum(it.interestrate, 2)
|
|
|
+ }
|
|
|
+ text =
|
|
|
+ it?.username + "-" + it?.productname + "-" + it?.financingdays + "天-" + it?.marginratio?.toPercentage() + "-" + cost + "-" + if (it?.interestsettlemode == "1") {
|
|
|
+ "日结"
|
|
|
+ } else {
|
|
|
+ "月结"
|
|
|
+ } + "-" + it?.interestminlen
|
|
|
+ }
|
|
|
+ text = "请选择融资方案"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "摘牌金额"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(autoSize(214), wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
}
|
|
|
- })
|
|
|
- }.lparams(matchParent, autoSize(46)) {
|
|
|
- marginEnd = autoSize(110)
|
|
|
- topMargin = autoSize(20)
|
|
|
- }
|
|
|
|
|
|
- linearLayout {
|
|
|
- textView {
|
|
|
- text = "0"
|
|
|
- textSizeAuto = 29
|
|
|
- textColorInt = R.color.rma_gray_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ textView {
|
|
|
+ text = NumberUtils.roundNum(
|
|
|
+ buyOrSelldata.fixedprice?.toDouble()
|
|
|
+ ?.times("1".toDouble()) ?: 0.0, 2
|
|
|
+ )
|
|
|
+ float_delisting_amount = this
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "履约保证金"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(autoSize(214), wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
|
|
|
- emptyView()
|
|
|
+ textView {
|
|
|
+ viewModel.slectfinancingData.bindOptional(context) {
|
|
|
+ if (float_delisting_amount.text.toString()
|
|
|
+ .isNullOrEmpty()
|
|
|
+ ) {
|
|
|
+ text = "--"
|
|
|
+ } else {
|
|
|
+ text = NumberUtils.roundNum(
|
|
|
+ float_delisting_amount.text.toString().toDouble()
|
|
|
+ .times(it?.marginratio?.toDouble() ?: 0.0), 2
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ text = "--"
|
|
|
+ performance_bond_amount = this
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
|
textView {
|
|
|
- maxpickNumber.bindOptional(context){
|
|
|
- text = it?.toString() + data.enumdicname
|
|
|
+ viewModel.usedAccountData.bindOptional(context) {
|
|
|
+ text = "可用资金 " + NumberUtils.roundNum(
|
|
|
+ it?.canUserAmount.toString(),
|
|
|
+ 2
|
|
|
+ )
|
|
|
}
|
|
|
textSizeAuto = 29
|
|
|
- textColorInt = R.color.rma_gray_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, wrapContent) {
|
|
|
- marginEnd = autoSize(110)
|
|
|
- topMargin = autoSize(10)
|
|
|
- }
|
|
|
-
|
|
|
- }.lparams(matchParent, autoSize(290))
|
|
|
- }.lparams(matchParent, autoSize(290))
|
|
|
-
|
|
|
- itemView()
|
|
|
-
|
|
|
- linearLayout {
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- onThrottleFirstClick {
|
|
|
- dialog1.show()
|
|
|
- }
|
|
|
- textView {
|
|
|
- text = "融资方案"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(autoSize(214), wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
-
|
|
|
- textView {
|
|
|
- viewModel.slectfinancingData.bindOptional(context){
|
|
|
- if (dialog1.isVisible){
|
|
|
- dialog1.dismiss()
|
|
|
- }
|
|
|
- var cost = ""//费用
|
|
|
- if (it?.interestratemode == "1"){
|
|
|
- cost = it.interestrate?.toPercentage() ?: ""
|
|
|
- }else if (it?.interestratemode == "2"){
|
|
|
- cost = it.interestrate?.toWanPercentage() ?: ""
|
|
|
- }else if (it?.interestratemode == "3"){//固定值
|
|
|
- cost = NumberUtils.roundNum(it.interestrate,2)
|
|
|
- }
|
|
|
- text = it?.username + "-" + it?.productname + "-" + it?.financingdays + "天-" + it?.marginratio?.toPercentage() + "-" + cost + "-" + if (it?.interestsettlemode == "1") {
|
|
|
- "日结"
|
|
|
- } else {
|
|
|
- "月结"
|
|
|
- } + "-" + it?.interestminlen
|
|
|
- }
|
|
|
- text = "请选择融资方案"
|
|
|
- textSizeAuto = 29
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
-
|
|
|
- itemView()
|
|
|
-
|
|
|
- linearLayout {
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- textView {
|
|
|
- text = "摘牌金额"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(autoSize(214), wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
-
|
|
|
- textView {
|
|
|
- text = NumberUtils.roundNum(
|
|
|
- buyOrSelldata.fixedprice?.toDouble()
|
|
|
- ?.times("1".toDouble()) ?: 0.0, 2
|
|
|
- )
|
|
|
- float_delisting_amount = this
|
|
|
- textSizeAuto = 29
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
-
|
|
|
- itemView()
|
|
|
-
|
|
|
- linearLayout {
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- textView {
|
|
|
- text = "履约保证金"
|
|
|
- textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
- }.lparams(autoSize(214), wrapContent) {
|
|
|
- marginStart = autoSize(36)
|
|
|
- }
|
|
|
-
|
|
|
- textView {
|
|
|
- viewModel.slectfinancingData.bindOptional(context){
|
|
|
- if (float_delisting_amount.text.toString().isNullOrEmpty()){
|
|
|
- text = "--"
|
|
|
- }else{
|
|
|
- text = NumberUtils.roundNum(float_delisting_amount.text.toString().toDouble().times(it?.marginratio?.toDouble() ?: 0.0),2)
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ marginStart = autoSize(250)
|
|
|
+ bottomMargin = autoSize(200)
|
|
|
}
|
|
|
}
|
|
|
- text = "--"
|
|
|
- performance_bond_amount = this
|
|
|
- textSizeAuto = 29
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(matchParent, autoSize(143))
|
|
|
-
|
|
|
- textView {
|
|
|
- viewModel.usedAccountData.bindOptional(context) {
|
|
|
- text = "可用资金 " + NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
|
|
|
}
|
|
|
- textSizeAuto = 29
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- topMargin = autoSize(20)
|
|
|
- marginStart = autoSize(250)
|
|
|
- }
|
|
|
|
|
|
- verticalEmptyView()
|
|
|
|
|
|
- linearLayout {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- textView {
|
|
|
- onThrottleFirstClick {
|
|
|
- if (type == "1"){//仓单贸易
|
|
|
- if (pricetype == "1"){//一口价
|
|
|
- viewModel.HdWRDealOrderReq(
|
|
|
- pricetype = pricetype,
|
|
|
- type = type,
|
|
|
- data = data,
|
|
|
- RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
- ?: 0,
|
|
|
- WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
- OrderQty = onePriceInputNumberEdittext.text.toString()
|
|
|
- .toLong(),
|
|
|
- BuyOrSell = 0,
|
|
|
- LadingBillId = 0,
|
|
|
- SubNum = 0,
|
|
|
- WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
- DeliveryMonth = data.deliverymonth ?: "",
|
|
|
- HasWr = 1,
|
|
|
- IsFinancing = 1,
|
|
|
- ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
|
|
|
- ) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
- dialog.dismiss()
|
|
|
+ linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ if (type == "1") {//仓单贸易
|
|
|
+ if (pricetype == "1") {//一口价
|
|
|
+ viewModel.HdWRDealOrderReq(
|
|
|
+ pricetype = pricetype,
|
|
|
+ type = type,
|
|
|
+ data = data,
|
|
|
+ RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
+ ?: 0,
|
|
|
+ WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
+ OrderQty = onePriceInputNumberEdittext.text.toString()
|
|
|
+ .toLong(),
|
|
|
+ BuyOrSell = 0,
|
|
|
+ LadingBillId = 0,
|
|
|
+ SubNum = 0,
|
|
|
+ WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
+ DeliveryMonth = data.deliverymonth ?: "",
|
|
|
+ HasWr = 1,
|
|
|
+ IsFinancing = 1,
|
|
|
+ ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
|
|
|
+ ?: 0
|
|
|
+ ) {
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
+ dialog.dismiss()
|
|
|
+ }
|
|
|
+ } else {//浮动价
|
|
|
+ viewModel.HdWRDealOrderReq(
|
|
|
+ pricetype = pricetype,
|
|
|
+ type = type,
|
|
|
+ data = data,
|
|
|
+ RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
+ ?: 0,
|
|
|
+ WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
+ OrderQty = onePriceInputNumberEdittext.text.toString()
|
|
|
+ .toLong(),
|
|
|
+ BuyOrSell = 0,
|
|
|
+ LadingBillId = 0,
|
|
|
+ SubNum = 0,
|
|
|
+ WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
+ DeliveryMonth = data.deliverymonth ?: "",
|
|
|
+ HasWr = 1,
|
|
|
+ IsFinancing = 1,
|
|
|
+ ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
|
|
|
+ ?: 0
|
|
|
+ ) {
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
+ dialog.dismiss()
|
|
|
+ }
|
|
|
}
|
|
|
- }else{//浮动价
|
|
|
- viewModel.HdWRDealOrderReq(
|
|
|
- pricetype = pricetype,
|
|
|
- type = type,
|
|
|
- data = data,
|
|
|
- RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
- ?: 0,
|
|
|
- WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
- OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
|
|
|
- BuyOrSell = 0,
|
|
|
- LadingBillId = 0,
|
|
|
- SubNum = 0,
|
|
|
- WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
- DeliveryMonth = data.deliverymonth ?: "",
|
|
|
- HasWr = 1,
|
|
|
- IsFinancing = 1,
|
|
|
- ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
|
|
|
- ) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
- dialog.dismiss()
|
|
|
+ } else {//仓单预售
|
|
|
+ if (pricetype == "1") {//一口价
|
|
|
+ viewModel.HdWRDealOrderReq(
|
|
|
+ pricetype = pricetype,
|
|
|
+ type = type,
|
|
|
+ data = data,
|
|
|
+ RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
+ ?: 0,
|
|
|
+ WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
+ OrderQty = onePriceInputNumberEdittext.text.toString()
|
|
|
+ .toLong(),
|
|
|
+ BuyOrSell = 0,
|
|
|
+ LadingBillId = 0,
|
|
|
+ SubNum = 0,
|
|
|
+ WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
+ DeliveryMonth = data.deliverymonth ?: "",
|
|
|
+ HasWr = 0,
|
|
|
+ IsFinancing = 1,
|
|
|
+ ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
|
|
|
+ ?: 0
|
|
|
+ ) {
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
+ dialog.dismiss()
|
|
|
+ }
|
|
|
+ } else {//浮动价
|
|
|
+ viewModel.HdWRDealOrderReq(
|
|
|
+ pricetype = pricetype,
|
|
|
+ type = type,
|
|
|
+ data = data,
|
|
|
+ RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
+ ?: 0,
|
|
|
+ WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
+ OrderQty = onePriceInputNumberEdittext.text.toString()
|
|
|
+ .toLong(),
|
|
|
+ BuyOrSell = 0,
|
|
|
+ LadingBillId = 0,
|
|
|
+ SubNum = 0,
|
|
|
+ WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
+ DeliveryMonth = data.deliverymonth ?: "",
|
|
|
+ HasWr = 0,
|
|
|
+ IsFinancing = 1,
|
|
|
+ ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
|
|
|
+ ?: 0
|
|
|
+ ) {
|
|
|
+ viewModel.queryOneOrderQuote(
|
|
|
+ wrpricetype = pricetype,
|
|
|
+ haswr = if (type == "1") {
|
|
|
+ "1"
|
|
|
+ } else {
|
|
|
+ "0"
|
|
|
+ },
|
|
|
+ wrfactortypeid = data.wrfactortypeid ?: ""
|
|
|
+ )
|
|
|
+ dialog.dismiss()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }else{//仓单预售
|
|
|
- if (pricetype == "1"){//一口价
|
|
|
- viewModel.HdWRDealOrderReq(
|
|
|
- pricetype = pricetype,
|
|
|
- type = type,
|
|
|
- data = data,
|
|
|
- RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
- ?: 0,
|
|
|
- WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
- OrderQty = onePriceInputNumberEdittext.text.toString()
|
|
|
- .toLong(),
|
|
|
- BuyOrSell = 0,
|
|
|
- LadingBillId = 0,
|
|
|
- SubNum = 0,
|
|
|
- WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
- DeliveryMonth = data.deliverymonth ?: "",
|
|
|
- HasWr = 0,
|
|
|
- IsFinancing = 1,
|
|
|
- ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
|
|
|
- ) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
- dialog.dismiss()
|
|
|
- }
|
|
|
- }else{//浮动价
|
|
|
- viewModel.HdWRDealOrderReq(
|
|
|
- pricetype = pricetype,
|
|
|
- type = type,
|
|
|
- data = data,
|
|
|
- RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
|
|
|
- ?: 0,
|
|
|
- WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
|
|
|
- OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
|
|
|
- BuyOrSell = 0,
|
|
|
- LadingBillId = 0,
|
|
|
- SubNum = 0,
|
|
|
- WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
- DeliveryMonth = data.deliverymonth ?: "",
|
|
|
- HasWr = 0,
|
|
|
- IsFinancing = 1,
|
|
|
- ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
|
|
|
- ) {
|
|
|
- viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
|
|
|
- dialog.dismiss()
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundResource = R.drawable.qhj_main_blue_bg
|
|
|
+ text = "买入"
|
|
|
+ textSizeAuto = 38
|
|
|
+ textColorInt = R.color.white
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
+ marginStart = autoSize(24)
|
|
|
}
|
|
|
- gravity = Gravity.CENTER
|
|
|
- backgroundResource = R.drawable.qhj_main_blue_bg
|
|
|
- text = "买入"
|
|
|
- textSizeAuto = 38
|
|
|
- textColorInt = R.color.white
|
|
|
- }.lparams(autoSize(419), autoSize(119)) {
|
|
|
- marginStart = autoSize(24)
|
|
|
- }
|
|
|
|
|
|
- textView {
|
|
|
- onThrottleFirstClick {
|
|
|
- dialog.dismiss()
|
|
|
- }
|
|
|
- gravity = Gravity.CENTER
|
|
|
- backgroundResource = R.drawable.hnxt_cancel_bg
|
|
|
- text = "取消"
|
|
|
- textColorInt = R.color.white
|
|
|
- textSizeAuto = 38
|
|
|
- }.lparams(autoSize(419), autoSize(119)) {
|
|
|
- marginStart = autoSize(13)
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ dialog.dismiss()
|
|
|
+ }
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundResource = R.drawable.hnxt_cancel_bg
|
|
|
+ text = "取消"
|
|
|
+ textColorInt = R.color.white
|
|
|
+ textSizeAuto = 38
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
+ marginStart = autoSize(13)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(144)) {
|
|
|
+ gravity = Gravity.BOTTOM
|
|
|
}
|
|
|
- }.lparams(matchParent, autoSize(144)) {
|
|
|
- gravity = Gravity.BOTTOM
|
|
|
- }
|
|
|
+
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
|
|
|
}.lparams(matchParent, matchParent) {
|
|
|
topMargin = autoSize(120)
|