|
|
@@ -49,6 +49,7 @@ import org.greenrobot.eventbus.EventBus
|
|
|
import org.greenrobot.eventbus.Subscribe
|
|
|
import org.greenrobot.eventbus.ThreadMode
|
|
|
import org.jetbrains.anko.*
|
|
|
+import org.jetbrains.anko.sdk25.coroutines.textChangedListener
|
|
|
|
|
|
/**
|
|
|
* 现货仓单-挂单
|
|
|
@@ -112,13 +113,16 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
|
|
|
//------------贸易圈时多余的内容-----------
|
|
|
//履约保证金
|
|
|
- lateinit var performance_bond : EditText
|
|
|
+ lateinit var performance_bond: EditText
|
|
|
+
|
|
|
//挂牌有效期
|
|
|
lateinit var validity_of_listing: TextView
|
|
|
+
|
|
|
//选择的履约模版数据
|
|
|
- val selectPerformanceStepData : MutableLiveData<PermancePlanTmpData> = MutableLiveData()
|
|
|
+ val selectPerformanceStepData: MutableLiveData<PermancePlanTmpData> = MutableLiveData()
|
|
|
+
|
|
|
//选择的朋友列表
|
|
|
- val selectFriendList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
|
|
|
+ val selectFriendList: MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
|
|
|
|
|
|
/**
|
|
|
* 本页面选择的挂牌方式
|
|
|
@@ -136,7 +140,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
viewModel.initSelectGoodsInfo()
|
|
|
}
|
|
|
|
|
|
- var marginValue = 0.0//履约保证金比例
|
|
|
+ var marginValue: MutableLiveData<Double> = MutableLiveData()//履约保证金比例
|
|
|
|
|
|
//浮动价挂牌金额
|
|
|
val listed_price: MutableLiveData<Double> = MutableLiveData()
|
|
|
@@ -144,28 +148,30 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
/**
|
|
|
* 是否可议价的选择
|
|
|
*/
|
|
|
- lateinit var can_be_negotiation : CheckBox
|
|
|
+ lateinit var can_be_negotiation: CheckBox
|
|
|
|
|
|
/**
|
|
|
* 是否整单
|
|
|
*/
|
|
|
- lateinit var whole_list : CheckBox
|
|
|
+ lateinit var whole_list: CheckBox
|
|
|
|
|
|
- val whole_list_data : MutableLiveData<Boolean> = MutableLiveData<Boolean>().apply { value = false }
|
|
|
+ val whole_list_data: MutableLiveData<Boolean> =
|
|
|
+ MutableLiveData<Boolean>().apply { value = false }
|
|
|
|
|
|
/**
|
|
|
* 朋友是否不限
|
|
|
*/
|
|
|
- lateinit var no_friend : CheckBox
|
|
|
+ lateinit var no_friend: CheckBox
|
|
|
|
|
|
//初始化设置履约保证金比例
|
|
|
fun setMarginValue() {
|
|
|
+ viewModel.queryMarketRun()
|
|
|
if (type == "1") {//现货仓单
|
|
|
- marginValue =
|
|
|
+ marginValue.value =
|
|
|
GlobalDataCollection.instance?.marketTradeConfigData?.sellmarginvalue?.toDouble()
|
|
|
?: 0.0
|
|
|
} else {
|
|
|
- marginValue =
|
|
|
+ marginValue.value =
|
|
|
GlobalDataCollection.instance?.marketTradeConfigData?.sellmarginvalue2?.toDouble()
|
|
|
?: 0.0
|
|
|
}
|
|
|
@@ -199,11 +205,13 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
|
|
super.onActivityResult(requestCode, resultCode, data)
|
|
|
- if (requestCode == 1004 && resultCode == 1005){
|
|
|
- val permancePlanTmpData = data?.getParcelableExtra<PermancePlanTmpData>("data") as PermancePlanTmpData
|
|
|
+ if (requestCode == 1004 && resultCode == 1005) {
|
|
|
+ val permancePlanTmpData =
|
|
|
+ data?.getParcelableExtra<PermancePlanTmpData>("data") as PermancePlanTmpData
|
|
|
selectPerformanceStepData.postValue(permancePlanTmpData)
|
|
|
- }else if (requestCode == 1000 && resultCode == 1001){
|
|
|
- val selectFriendDataList = data?.getParcelableExtra<SelectFriendListData>("datalist") as SelectFriendListData
|
|
|
+ } else if (requestCode == 1000 && resultCode == 1001) {
|
|
|
+ val selectFriendDataList =
|
|
|
+ data?.getParcelableExtra<SelectFriendListData>("datalist") as SelectFriendListData
|
|
|
selectFriendList.postValue(selectFriendDataList.selectFriendList)
|
|
|
}
|
|
|
}
|
|
|
@@ -478,7 +486,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
text = "0"
|
|
|
decimal = 2
|
|
|
setOnTextChangeListener { view, value ->
|
|
|
- if (value.toString().isNullOrEmpty().not()){
|
|
|
+ if (value.toString().isNullOrEmpty().not()) {
|
|
|
val delistingAmount = value.toDouble().times(
|
|
|
listednumberEdittext.text.toString()
|
|
|
.toDouble()
|
|
|
@@ -488,9 +496,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
delistingAmount,
|
|
|
2
|
|
|
) + "(需履约保证金" + NumberUtils.roundNum(
|
|
|
- delistingAmount?.times(
|
|
|
- marginValue
|
|
|
- ) ?: 0.0, 2
|
|
|
+ delistingAmount.times(
|
|
|
+ marginValue.value ?: 0.0
|
|
|
+ ), 2
|
|
|
) + ")"
|
|
|
}
|
|
|
|
|
|
@@ -502,7 +510,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
|
|
|
linearLayout {
|
|
|
listedType.bindOptional(context) {
|
|
|
- if (it?.id == "3" ) {
|
|
|
+ if (it?.id == "3") {
|
|
|
visibility = View.VISIBLE
|
|
|
} else {
|
|
|
visibility = View.GONE
|
|
|
@@ -512,9 +520,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
checkBox {
|
|
|
can_be_negotiation = this
|
|
|
buttonDrawable = null
|
|
|
- background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
+ background =
|
|
|
+ resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
|
|
|
- }.lparams(autoSize(41), autoSize(41)){
|
|
|
+ }.lparams(autoSize(41), autoSize(41)) {
|
|
|
marginStart = autoSize(36)
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
@@ -523,7 +532,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
text = "可议价"
|
|
|
textSizeAuto = 34
|
|
|
textColorInt = R.color.rma_zhushi_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
}.lparams(wrapContent, autoSize(143))
|
|
|
@@ -596,9 +605,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
numberEditText {
|
|
|
listednumberEdittext = this
|
|
|
- if (type == "1"){
|
|
|
+ if (type == "1") {
|
|
|
text = data.minivalue
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
text = data1.minivalue
|
|
|
}
|
|
|
|
|
|
@@ -614,9 +623,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
delistingAmount,
|
|
|
2
|
|
|
) + "(需履约保证金" + NumberUtils.roundNum(
|
|
|
- delistingAmount?.times(
|
|
|
- marginValue
|
|
|
- ) ?: 0.0, 2
|
|
|
+ delistingAmount.times(
|
|
|
+ marginValue.value ?: 0.0
|
|
|
+ ), 2
|
|
|
) + ")"
|
|
|
} else if (listedType.value?.id == "2") {//浮动价 //计算估算总额
|
|
|
val floatDelistingAmount =
|
|
|
@@ -625,7 +634,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
)
|
|
|
if (floatDelistingAmount != 0.0) {
|
|
|
//显示估算总额
|
|
|
- if (marginValue == 0.0) {
|
|
|
+ if (marginValue.value == 0.0) {
|
|
|
one_delisting_amount.text =
|
|
|
NumberUtils.roundNum(
|
|
|
floatDelistingAmount ?: 0.0,
|
|
|
@@ -638,7 +647,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
2
|
|
|
) + "(需履约保证金" + NumberUtils.roundNum(
|
|
|
floatDelistingAmount?.times(
|
|
|
- marginValue
|
|
|
+ marginValue.value ?: 0.0
|
|
|
) ?: 0.0,
|
|
|
2
|
|
|
) + ")"
|
|
|
@@ -661,10 +670,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}
|
|
|
|
|
|
linearLayout {
|
|
|
- listedType.bindOptional(context){
|
|
|
- if (it?.id == "3"){
|
|
|
+ listedType.bindOptional(context) {
|
|
|
+ if (it?.id == "3") {
|
|
|
visibility = View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
visibility = View.GONE
|
|
|
}
|
|
|
}
|
|
|
@@ -672,11 +681,12 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
checkBox {
|
|
|
whole_list = this
|
|
|
buttonDrawable = null
|
|
|
- background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
+ background =
|
|
|
+ resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
setOnCheckedChangeListener { compoundButton, b ->
|
|
|
whole_list_data.postValue(b)
|
|
|
}
|
|
|
- }.lparams(autoSize(41), autoSize(41)){
|
|
|
+ }.lparams(autoSize(41), autoSize(41)) {
|
|
|
marginStart = autoSize(36)
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
@@ -685,7 +695,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
text = "整单"
|
|
|
textSizeAuto = 34
|
|
|
textColorInt = R.color.rma_zhushi_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
}.lparams(wrapContent, autoSize(143))
|
|
|
@@ -762,10 +772,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
- whole_list_data.bindOptional(context){
|
|
|
- if (it == true){
|
|
|
+ whole_list_data.bindOptional(context) {
|
|
|
+ if (it == true) {
|
|
|
visibility = View.GONE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
visibility = View.VISIBLE
|
|
|
}
|
|
|
}
|
|
|
@@ -821,10 +831,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
- listedType.bindOptional(context){
|
|
|
- if (it?.id == "3"){
|
|
|
+ listedType.bindOptional(context) {
|
|
|
+ if (it?.id == "3") {
|
|
|
visibility = View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
visibility = View.GONE
|
|
|
}
|
|
|
}
|
|
|
@@ -844,6 +854,15 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
editText {
|
|
|
performance_bond = this
|
|
|
+ textChangedListener {
|
|
|
+ afterTextChanged {
|
|
|
+ if (it.toString().isNotEmpty()) {
|
|
|
+ marginValue.postValue(
|
|
|
+ it?.toString()?.toDouble()?.div(100.0)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
hint = "请输入履约保证金"
|
|
|
background = null
|
|
|
inputType = EditorInfo.TYPE_CLASS_NUMBER
|
|
|
@@ -868,10 +887,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
- listedType.bindOptional(context){
|
|
|
- if (it?.id == "3"){
|
|
|
+ listedType.bindOptional(context) {
|
|
|
+ if (it?.id == "3") {
|
|
|
visibility = View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
visibility = View.GONE
|
|
|
}
|
|
|
}
|
|
|
@@ -890,7 +909,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = TimeUtils.getNowTime("yyyy-MM-dd")
|
|
|
+ viewModel.marketRunData.bindOptional(context) {
|
|
|
+ text = it?.tradedate
|
|
|
+ }
|
|
|
validity_of_listing = this
|
|
|
textSizeAuto = 34
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
@@ -908,10 +929,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
viewItemUI()
|
|
|
|
|
|
linearLayout {
|
|
|
- listedType.bindOptional(context){
|
|
|
- if (it?.id == "3"){
|
|
|
+ listedType.bindOptional(context) {
|
|
|
+ if (it?.id == "3") {
|
|
|
visibility = View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
visibility = View.GONE
|
|
|
}
|
|
|
}
|
|
|
@@ -919,8 +940,11 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
onThrottleFirstClick {
|
|
|
val intent = Intent()
|
|
|
- intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
|
|
|
- startActivityForResult(intent,1004)
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ SelectPerformanceTemplateActivity::class.java
|
|
|
+ )
|
|
|
+ startActivityForResult(intent, 1004)
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
@@ -955,21 +979,21 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
- listedType.bindOptional(context){
|
|
|
- if (it?.id == "3"){
|
|
|
+ listedType.bindOptional(context) {
|
|
|
+ if (it?.id == "3") {
|
|
|
visibility = View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
visibility = View.GONE
|
|
|
}
|
|
|
}
|
|
|
background = resources.getDrawable(R.color.white)
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
onThrottleFirstClick {
|
|
|
- if (no_friend.isChecked.not()){
|
|
|
+ if (no_friend.isChecked.not()) {
|
|
|
val intent = Intent()
|
|
|
intent.setClass(context, SelectFriendActivty::class.java)
|
|
|
- startActivityForResult(intent,1000)
|
|
|
- }else{
|
|
|
+ startActivityForResult(intent, 1000)
|
|
|
+ } else {
|
|
|
ToastUtils.showLong("勾选不限后不能选择朋友")
|
|
|
}
|
|
|
|
|
|
@@ -985,9 +1009,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
|
|
|
textView {
|
|
|
selectFriendList.bindOptional(context) {
|
|
|
- if (no_friend.isChecked){
|
|
|
+ if (no_friend.isChecked) {
|
|
|
text = "不限"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
text = "已选" + it?.size + "人"
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}
|
|
|
@@ -1012,13 +1036,14 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
checkBox {
|
|
|
no_friend = this
|
|
|
buttonDrawable = null
|
|
|
- background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
+ background =
|
|
|
+ resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
setOnCheckedChangeListener { compoundButton, b ->
|
|
|
- if (b){
|
|
|
+ if (b) {
|
|
|
selectFriendList.postValue(arrayListOf())
|
|
|
}
|
|
|
}
|
|
|
- }.lparams(autoSize(41), autoSize(41)){
|
|
|
+ }.lparams(autoSize(41), autoSize(41)) {
|
|
|
marginStart = autoSize(36)
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
@@ -1027,7 +1052,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
text = "不限"
|
|
|
textSizeAuto = 34
|
|
|
textColorInt = R.color.rma_zhushi_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
}.lparams(wrapContent, autoSize(132))
|
|
|
@@ -1121,6 +1146,27 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
+ marginValue.bindOptional(context) {
|
|
|
+ if (onePriceInputEdittext.text.toString().isNullOrEmpty()
|
|
|
+ .not() && listednumberEdittext.text.toString()
|
|
|
+ .isNullOrEmpty().not()
|
|
|
+ ) {
|
|
|
+ val delistingAmount =
|
|
|
+ onePriceInputEdittext.text.toString().toDouble().times(
|
|
|
+ listednumberEdittext.text.toString()
|
|
|
+ .toDouble()
|
|
|
+ )
|
|
|
+ one_delisting_amount.text =
|
|
|
+ NumberUtils.roundNum(
|
|
|
+ delistingAmount,
|
|
|
+ 2
|
|
|
+ ) + "(需履约保证金" + NumberUtils.roundNum(
|
|
|
+ delistingAmount.times(
|
|
|
+ it ?: 0.0
|
|
|
+ ), 2
|
|
|
+ ) + ")"
|
|
|
+ }
|
|
|
+ }
|
|
|
text = "0"
|
|
|
one_delisting_amount = this
|
|
|
textSizeAuto = 34
|
|
|
@@ -1152,7 +1198,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
|
- if (check().not()){
|
|
|
+ if (check().not()) {
|
|
|
return@onThrottleFirstClick
|
|
|
}
|
|
|
if (type == "1") {//现货仓单挂单
|
|
|
@@ -1188,7 +1234,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
) {
|
|
|
finish()
|
|
|
}
|
|
|
- } else if(listedType.value?.id == "2") {//浮动价
|
|
|
+ } else if (listedType.value?.id == "2") {//浮动价
|
|
|
viewModel.requeryWRListingOrderReq(
|
|
|
FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
|
|
|
LadingBillId = data.ladingbillid?.toLong() ?: 0,
|
|
|
@@ -1219,36 +1265,37 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
) {
|
|
|
finish()
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
var canBargain = 0
|
|
|
- if (can_be_negotiation.isChecked){
|
|
|
+ if (can_be_negotiation.isChecked) {
|
|
|
canBargain = 1
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
canBargain = 0
|
|
|
}
|
|
|
var canPart = 1
|
|
|
- var the_pick : Long = 0
|
|
|
- if (whole_list.isChecked){
|
|
|
+ var the_pick: Long = 0
|
|
|
+ if (whole_list.isChecked) {
|
|
|
canPart = 0
|
|
|
+ } else {
|
|
|
the_pick = startInputNumber.text.toString().toLong()
|
|
|
- }else{
|
|
|
- the_pick = 0
|
|
|
canPart = 1
|
|
|
}
|
|
|
var allFriendsFlag = 0
|
|
|
- if (no_friend.isChecked){
|
|
|
+ if (no_friend.isChecked) {
|
|
|
allFriendsFlag = 1
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
allFriendsFlag = 0
|
|
|
}
|
|
|
|
|
|
- viewModel.requeryWRListingOrderReq(
|
|
|
- ValidTime = validity_of_listing.text.toString().removeSuffix("-"),
|
|
|
- MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
|
|
|
- MarginAlgorithm = 1,//指定保证金方式 1:比率 2:固定
|
|
|
- MarginValue = performance_bond.text.toString().toDouble().div(100),//指定保证金设置值
|
|
|
- AllFriendsFlag = allFriendsFlag,
|
|
|
- MatchAccIDsString = getSelectFriendList(),
|
|
|
+ viewModel.requeryWRListingOrderReq(
|
|
|
+ ValidTime = validity_of_listing.text.toString()
|
|
|
+ .removeSuffix("-"),
|
|
|
+ MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
|
|
|
+ MarginAlgorithm = 1,//指定保证金方式 1:比率 2:固定
|
|
|
+ MarginValue = performance_bond.text.toString().toDouble()
|
|
|
+ .div(100),//指定保证金设置值
|
|
|
+ AllFriendsFlag = allFriendsFlag,
|
|
|
+ MatchAccIDsString = getSelectFriendList(),
|
|
|
FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
|
|
|
LadingBillId = data.ladingbillid?.toLong() ?: 0,
|
|
|
TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
|
|
|
@@ -1261,12 +1308,13 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
OrderQty = listednumberEdittext.text.toString().toLong(),
|
|
|
DeliveryGoodsID = data.deliverygoodsid?.toInt() ?: 0,
|
|
|
WRPriceType = 1,
|
|
|
- FixedPrice = onePriceInputEdittext.text.toString()
|
|
|
- .toDouble(),
|
|
|
+ FixedPrice = onePriceInputEdittext.text.toString()
|
|
|
+ .toDouble(),
|
|
|
WRTradeGoods = getWRTradeGoods(),
|
|
|
- TimevalidType = 4,
|
|
|
+ TimevalidType = 3,
|
|
|
FirstRatio = 0.0,
|
|
|
- PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
|
|
|
+ PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong()
|
|
|
+ ?: 0,
|
|
|
BuyOrSell = 1,
|
|
|
PriceDisplayMode = 1,
|
|
|
CanBargain = canBargain,
|
|
|
@@ -1345,33 +1393,34 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
) {
|
|
|
finish()
|
|
|
}
|
|
|
- }else{
|
|
|
- var canBargain = 0
|
|
|
- if (can_be_negotiation.isChecked){
|
|
|
+ } else {
|
|
|
+ var canBargain = 0
|
|
|
+ if (can_be_negotiation.isChecked) {
|
|
|
canBargain = 1
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
canBargain = 0
|
|
|
}
|
|
|
var canPart = 1
|
|
|
- var the_pick : Long = 0
|
|
|
- if (whole_list.isChecked){
|
|
|
+ var the_pick: Long = 0
|
|
|
+ if (whole_list.isChecked) {
|
|
|
canPart = 0
|
|
|
+ } else {
|
|
|
the_pick = startInputNumber.text.toString().toLong()
|
|
|
- }else{
|
|
|
- the_pick = 0
|
|
|
canPart = 1
|
|
|
}
|
|
|
var allFriendsFlag = 0
|
|
|
- if (no_friend.isChecked){
|
|
|
+ if (no_friend.isChecked) {
|
|
|
allFriendsFlag = 1
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
allFriendsFlag = 0
|
|
|
}
|
|
|
viewModel.requeryWRListingOrderReq(
|
|
|
- ValidTime = validity_of_listing.text.toString().removeSuffix("-"),
|
|
|
+ ValidTime = validity_of_listing.text.toString()
|
|
|
+ .removeSuffix("-"),
|
|
|
MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
|
|
|
MarginAlgorithm = 1,//指定保证金方式 1:比率 2:固定
|
|
|
- MarginValue = performance_bond.text.toString().toDouble().div(100),//指定保证金设置值
|
|
|
+ MarginValue = performance_bond.text.toString().toDouble()
|
|
|
+ .div(100),//指定保证金设置值
|
|
|
AllFriendsFlag = allFriendsFlag,
|
|
|
MatchAccIDsString = getSelectFriendList(),
|
|
|
FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
|
|
|
@@ -1389,9 +1438,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
WRTradeGoods = getWRTradeGoods(),
|
|
|
FixedPrice = onePriceInputEdittext.text.toString()
|
|
|
.toDouble(),
|
|
|
- TimevalidType = 4,
|
|
|
+ TimevalidType = 3,
|
|
|
FirstRatio = 0.0,
|
|
|
- PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
|
|
|
+ PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong()
|
|
|
+ ?: 0,
|
|
|
DeliveryMonth = month_text.text.toString(),
|
|
|
BuyOrSell = 1,
|
|
|
PriceDisplayMode = 1,
|
|
|
@@ -1426,7 +1476,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fun getSelectFriendList() : List<String>{
|
|
|
+ fun getSelectFriendList(): List<String> {
|
|
|
val returnList = arrayListOf<String>()
|
|
|
selectFriendList.value?.forEach {
|
|
|
returnList.add(it.frienduserid?.toString() ?: "")
|
|
|
@@ -1469,12 +1519,12 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
ToastUtils.showLong("请输入起摘数量")
|
|
|
return false
|
|
|
}
|
|
|
- if (type == "2"){
|
|
|
+ if (type == "2") {
|
|
|
if (startInputNumber.text.toString().toLong() < data1.minivalue?.toLong() ?: 0) {
|
|
|
ToastUtils.showLong("起摘数量不能小于" + data1.minivalue)
|
|
|
return false
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
|
|
|
ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
|
|
|
return false
|
|
|
@@ -1511,12 +1561,12 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
ToastUtils.showLong("请输入起摘数量")
|
|
|
return false
|
|
|
}
|
|
|
- if (type == "2"){
|
|
|
+ if (type == "2") {
|
|
|
if (startInputNumber.text.toString().toLong() < data1.minivalue?.toLong() ?: 0) {
|
|
|
ToastUtils.showLong("起摘数量不能小于" + data1.minivalue)
|
|
|
return false
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
|
|
|
ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
|
|
|
return false
|
|
|
@@ -1529,7 +1579,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (onePriceInputEdittext.text.toString().isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请输入挂牌价格")
|
|
|
return false
|
|
|
@@ -1546,17 +1596,22 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
ToastUtils.showLong("挂牌数量不能为0")
|
|
|
return false
|
|
|
}
|
|
|
- if (startInputNumber.text.toString().isNullOrEmpty()) {
|
|
|
- ToastUtils.showLong("请输入起摘数量")
|
|
|
- return false
|
|
|
- }
|
|
|
- if (whole_list.isChecked.not()){
|
|
|
- if (type == "2"){
|
|
|
- if (startInputNumber.text.toString().toLong() < data1.minivalue?.toLong() ?: 0) {
|
|
|
+
|
|
|
+ if (whole_list.isChecked.not()) {
|
|
|
+
|
|
|
+ if (startInputNumber.text.toString().isNullOrEmpty()) {
|
|
|
+ ToastUtils.showLong("请输入起摘数量")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (type == "2") {
|
|
|
+ if (startInputNumber.text.toString()
|
|
|
+ .toLong() < data1.minivalue?.toLong() ?: 0
|
|
|
+ ) {
|
|
|
ToastUtils.showLong("起摘数量不能小于" + data1.minivalue)
|
|
|
return false
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
|
|
|
ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
|
|
|
return false
|
|
|
@@ -1564,7 +1619,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (performance_bond.text.toString().isNullOrEmpty()){
|
|
|
+ if (performance_bond.text.toString().isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请输入履约保证金比例")
|
|
|
return false
|
|
|
}
|
|
|
@@ -1573,13 +1628,13 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
|
|
|
+ if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择履约模版")
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- if (no_friend.isChecked.not()){
|
|
|
- if (selectFriendList.value.isNullOrEmpty()){
|
|
|
+ if (no_friend.isChecked.not()) {
|
|
|
+ if (selectFriendList.value.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择朋友")
|
|
|
return false
|
|
|
}
|