|
|
@@ -1,12 +1,14 @@
|
|
|
package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.listed
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
+import android.content.Intent
|
|
|
import android.graphics.Color
|
|
|
import android.os.Build
|
|
|
import android.os.Bundle
|
|
|
import android.view.Gravity
|
|
|
import android.view.View
|
|
|
import android.view.inputmethod.EditorInfo
|
|
|
+import android.widget.CheckBox
|
|
|
import android.widget.EditText
|
|
|
import android.widget.SeekBar
|
|
|
import android.widget.TextView
|
|
|
@@ -15,8 +17,7 @@ import androidx.lifecycle.MutableLiveData
|
|
|
import cn.muchinfo.rma.R
|
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.global.MTPEnums
|
|
|
-import cn.muchinfo.rma.global.data.HnstWrPositionData
|
|
|
-import cn.muchinfo.rma.global.data.HoldLBData
|
|
|
+import cn.muchinfo.rma.global.data.*
|
|
|
import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
|
|
|
import cn.muchinfo.rma.global.database.DataBase
|
|
|
import cn.muchinfo.rma.global.utils.TimeUtils
|
|
|
@@ -31,8 +32,12 @@ import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
|
|
|
import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText3
|
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
+import cn.muchinfo.rma.view.base.hnstmain.friend.SelectFriendActivty
|
|
|
+import cn.muchinfo.rma.view.base.hnstmain.friend.SelectFriendListData
|
|
|
+import cn.muchinfo.rma.view.base.hnstmain.performancetemplate.SelectPerformanceTemplateActivity
|
|
|
import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
import cn.muchinfo.rma.view.base.home.contract.viewItemUI
|
|
|
+import cn.muchinfo.rma.view.base.main.addressmanagement.AddressSelectActivity
|
|
|
import cn.muchinfo.rma.view.base.main.castsurely.JsonBean
|
|
|
import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
|
|
|
import com.blankj.utilcode.util.LogUtils
|
|
|
@@ -105,6 +110,16 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
//挂牌价格输入
|
|
|
lateinit var onePriceInputEdittext: MangeNumberEditText2
|
|
|
|
|
|
+ //------------贸易圈时多余的内容-----------
|
|
|
+ //履约保证金
|
|
|
+ lateinit var performance_bond : EditText
|
|
|
+ //挂牌有效期
|
|
|
+ lateinit var validity_of_listing: TextView
|
|
|
+ //选择的履约模版数据
|
|
|
+ val selectPerformanceStepData : MutableLiveData<PermancePlanTmpData> = MutableLiveData()
|
|
|
+ //选择的朋友列表
|
|
|
+ val selectFriendList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
|
|
|
+
|
|
|
/**
|
|
|
* 本页面选择的挂牌方式
|
|
|
*/
|
|
|
@@ -126,6 +141,21 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
//浮动价挂牌金额
|
|
|
val listed_price: MutableLiveData<Double> = MutableLiveData()
|
|
|
|
|
|
+ /**
|
|
|
+ * 是否可议价的选择
|
|
|
+ */
|
|
|
+ lateinit var can_be_negotiation : CheckBox
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否整单
|
|
|
+ */
|
|
|
+ lateinit var whole_list : CheckBox
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 朋友是否不限
|
|
|
+ */
|
|
|
+ lateinit var no_friend : CheckBox
|
|
|
+
|
|
|
//初始化设置履约保证金比例
|
|
|
fun setMarginValue() {
|
|
|
if (type == "1") {//现货仓单
|
|
|
@@ -164,6 +194,18 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
EventBus.getDefault().unregister(this)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ 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
|
|
|
+ selectPerformanceStepData.postValue(permancePlanTmpData)
|
|
|
+ }else if (requestCode == 1000 && resultCode == 1001){
|
|
|
+ val selectFriendDataList = data?.getParcelableExtra<SelectFriendListData>("datalist") as SelectFriendListData
|
|
|
+ selectFriendList.postValue(selectFriendDataList.selectFriendList)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
@RequiresApi(Build.VERSION_CODES.O)
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
@@ -290,6 +332,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
SelectData(
|
|
|
id = "2",
|
|
|
value = "浮动价"
|
|
|
+ ),
|
|
|
+ SelectData(
|
|
|
+ id = "3",
|
|
|
+ value = "贸易圈"
|
|
|
)
|
|
|
)
|
|
|
creatBottomSheetDialog("请选择挂牌方式", selectDataList) {
|
|
|
@@ -330,10 +376,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
|
|
|
linearLayout {
|
|
|
listedType.bindOptional(context) {
|
|
|
- if (it?.id == "1") {
|
|
|
- visibility = View.GONE
|
|
|
- } else {
|
|
|
+ if (it?.id == "2") {
|
|
|
visibility = View.VISIBLE
|
|
|
+ } else {
|
|
|
+ visibility = View.GONE
|
|
|
}
|
|
|
}
|
|
|
background = resources.getDrawable(R.color.white)
|
|
|
@@ -370,7 +416,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
pvOptions.show()
|
|
|
}
|
|
|
textView {
|
|
|
- text = "挂牌方式"
|
|
|
+ text = "行情商品"
|
|
|
textSizeAuto = 34
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -408,7 +454,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
|
|
|
linearLayout {
|
|
|
listedType.bindOptional(context) {
|
|
|
- if (it?.id == "1") {
|
|
|
+ if (it?.id == "1" || it?.id == "3") {
|
|
|
visibility = View.VISIBLE
|
|
|
} else {
|
|
|
visibility = View.GONE
|
|
|
@@ -440,16 +486,37 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}.lparams(0, autoSize(72), 1f) {
|
|
|
marginEnd = autoSize(110)
|
|
|
}
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ checkBox {
|
|
|
+ can_be_negotiation = this
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
+
|
|
|
+ }.lparams(autoSize(41), autoSize(41)){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "可议价"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(wrapContent, autoSize(143))
|
|
|
}.lparams(matchParent, autoSize(143))
|
|
|
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
listedType.bindOptional(context) {
|
|
|
- if (it?.id == "1") {
|
|
|
- visibility = View.GONE
|
|
|
- } else {
|
|
|
+ if (it?.id == "2") {
|
|
|
visibility = View.VISIBLE
|
|
|
+ } else {
|
|
|
+ visibility = View.GONE
|
|
|
}
|
|
|
}
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
@@ -572,6 +639,27 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ checkBox {
|
|
|
+ whole_list = this
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
+
|
|
|
+ }.lparams(autoSize(41), autoSize(41)){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "整单"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(wrapContent, autoSize(143))
|
|
|
}.lparams(matchParent, autoSize(143))
|
|
|
|
|
|
inflateLayout<SeekBar>(R.layout.main_seekbar) {
|
|
|
@@ -697,6 +785,213 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
+ listedType.bindOptional(context){
|
|
|
+ if (it?.id == "3"){
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }else{
|
|
|
+ visibility = 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)
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ editText {
|
|
|
+ performance_bond = this
|
|
|
+ hint = "请输入履约保证金"
|
|
|
+ background = null
|
|
|
+ inputType = EditorInfo.TYPE_CLASS_NUMBER
|
|
|
+ setDecimalInputType()
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorStr = "#333333"
|
|
|
+ }.lparams(0, autoSize(143), 1f)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "%"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ listedType.bindOptional(context){
|
|
|
+ if (it?.id == "3"){
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }else{
|
|
|
+ visibility = View.GONE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onThrottleFirstClick {
|
|
|
+ showDataSelectDialog(type = "1") {
|
|
|
+ validity_of_listing.text = this
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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 = TimeUtils.getNowTime("yyyy-MM-dd")
|
|
|
+ validity_of_listing = this
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_search_by_time
|
|
|
+ }.lparams(autoSize(38), autoSize(38)) {
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ viewItemUI()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ listedType.bindOptional(context){
|
|
|
+ if (it?.id == "3"){
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }else{
|
|
|
+ visibility = View.GONE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
|
|
|
+ startActivityForResult(intent,1004)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "履约方式"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ selectPerformanceStepData.bindOptional(context) {
|
|
|
+ text = it?.templatename
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
+ text = "请选择履约模版"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36)) {
|
|
|
+ marginEnd = autoSize(25)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ listedType.bindOptional(context){
|
|
|
+ if (it?.id == "3"){
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }else{
|
|
|
+ visibility = View.GONE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ onThrottleFirstClick {
|
|
|
+ if (no_friend.isChecked.not()){
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(context, SelectFriendActivty::class.java)
|
|
|
+ startActivityForResult(intent,1000)
|
|
|
+ }else{
|
|
|
+ ToastUtils.showLong("勾选不限后不能选择朋友")
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "指定朋友"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ selectFriendList.bindOptional(context) {
|
|
|
+ text = "已选" + it?.size + "人"
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }
|
|
|
+ text = "请选择朋友"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36)) {
|
|
|
+ marginEnd = autoSize(25)
|
|
|
+ }
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ checkBox {
|
|
|
+ no_friend = this
|
|
|
+ buttonDrawable = null
|
|
|
+ background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
+
|
|
|
+ }.lparams(autoSize(41), autoSize(41)){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "不限"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(wrapContent, autoSize(132))
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
if (type == "2") {
|
|
|
visibility = View.VISIBLE
|
|
|
} else {
|
|
|
@@ -849,7 +1144,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
) {
|
|
|
finish()
|
|
|
}
|
|
|
- } else {//浮动价
|
|
|
+ } else if(listedType.value?.id == "2") {//浮动价
|
|
|
viewModel.requeryWRListingOrderReq(
|
|
|
FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
|
|
|
LadingBillId = data.ladingbillid?.toLong() ?: 0,
|
|
|
@@ -880,6 +1175,61 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
) {
|
|
|
finish()
|
|
|
}
|
|
|
+ }else{
|
|
|
+ var canBargain = 0
|
|
|
+ if (can_be_negotiation.isChecked){
|
|
|
+ canBargain = 1
|
|
|
+ }else{
|
|
|
+ canBargain = 0
|
|
|
+ }
|
|
|
+ var canPart = 0
|
|
|
+ if (whole_list.isChecked){
|
|
|
+ canPart = 1
|
|
|
+ }else{
|
|
|
+ canPart = 0
|
|
|
+ }
|
|
|
+ var allFriendsFlag = 0
|
|
|
+ if (no_friend.isChecked){
|
|
|
+ allFriendsFlag = 1
|
|
|
+ }else{
|
|
|
+ allFriendsFlag = 0
|
|
|
+ }
|
|
|
+
|
|
|
+ viewModel.requeryWRListingOrderReq(
|
|
|
+ MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
|
|
|
+ MarginAlgorithm = 0,//指定保证金方式 1:比率 2:固定
|
|
|
+ MarginValue = performance_bond.text.toString().toDouble(),//指定保证金设置值
|
|
|
+ AllFriendsFlag = allFriendsFlag,
|
|
|
+ MatchAccIDsString = getSelectFriendList(),
|
|
|
+ FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
|
|
|
+ LadingBillId = data.ladingbillid?.toLong() ?: 0,
|
|
|
+ TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
|
|
|
+ SubNum = data.subnum?.toLong() ?: 0,
|
|
|
+ WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
+ UserID = GlobalDataCollection.instance?.loginRsp?.userID
|
|
|
+ ?: 0,
|
|
|
+ AccountID = GlobalDataCollection.instance?.accountId ?: 0,
|
|
|
+ IsSpecified = 0,
|
|
|
+ OrderQty = listednumberEdittext.text.toString().toLong(),
|
|
|
+ DeliveryGoodsID = data.deliverygoodsid?.toInt() ?: 0,
|
|
|
+ WRPriceType = 1,
|
|
|
+ FixedPrice = onePriceInputEdittext.text.toString()
|
|
|
+ .toDouble(),
|
|
|
+ WRTradeGoods = getWRTradeGoods(),
|
|
|
+ TimevalidType = 4,
|
|
|
+ FirstRatio = 0.0,
|
|
|
+ PerformanceTemplateID = 0,
|
|
|
+ BuyOrSell = 1,
|
|
|
+ PriceDisplayMode = 1,
|
|
|
+ CanBargain = canBargain,
|
|
|
+ ApplyID = 0,
|
|
|
+ CanPart = canPart,
|
|
|
+ HasWr = 1,
|
|
|
+ DelistMinQty = startInputNumber.text.toString().toLong(),
|
|
|
+ WRStandardID = data.wrstandardid?.toInt() ?: 0
|
|
|
+ ) {
|
|
|
+ finish()
|
|
|
+ }
|
|
|
}
|
|
|
} else {//预售仓单挂单
|
|
|
if (listedType.value?.id == "1") {//一口价
|
|
|
@@ -915,7 +1265,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
) {
|
|
|
finish()
|
|
|
}
|
|
|
- } else {//浮动价
|
|
|
+ } else if (listedType.value?.id == "1") {//浮动价
|
|
|
viewModel.requeryWRListingOrderReq(
|
|
|
FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
|
|
|
LadingBillId = 0,
|
|
|
@@ -947,6 +1297,61 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
) {
|
|
|
finish()
|
|
|
}
|
|
|
+ }else{
|
|
|
+ var canBargain = 0
|
|
|
+ if (can_be_negotiation.isChecked){
|
|
|
+ canBargain = 1
|
|
|
+ }else{
|
|
|
+ canBargain = 0
|
|
|
+ }
|
|
|
+ var canPart = 0
|
|
|
+ if (whole_list.isChecked){
|
|
|
+ canPart = 1
|
|
|
+ }else{
|
|
|
+ canPart = 0
|
|
|
+ }
|
|
|
+ var allFriendsFlag = 0
|
|
|
+ if (no_friend.isChecked){
|
|
|
+ allFriendsFlag = 1
|
|
|
+ }else{
|
|
|
+ allFriendsFlag = 0
|
|
|
+ }
|
|
|
+ viewModel.requeryWRListingOrderReq(
|
|
|
+ MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
|
|
|
+ MarginAlgorithm = 0,//指定保证金方式 1:比率 2:固定
|
|
|
+ MarginValue = performance_bond.text.toString().toDouble(),//指定保证金设置值
|
|
|
+ AllFriendsFlag = allFriendsFlag,
|
|
|
+ MatchAccIDsString = getSelectFriendList(),
|
|
|
+ FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
|
|
|
+ LadingBillId = 0,
|
|
|
+ TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
|
|
|
+ SubNum = 0,
|
|
|
+ WRFactorTypeId = data1.wrfactortypeid?.toLong() ?: 0,
|
|
|
+ UserID = GlobalDataCollection.instance?.loginRsp?.userID
|
|
|
+ ?: 0,
|
|
|
+ AccountID = GlobalDataCollection.instance?.accountId ?: 0,
|
|
|
+ IsSpecified = 0,
|
|
|
+ OrderQty = listednumberEdittext.text.toString().toLong(),
|
|
|
+ DeliveryGoodsID = data1.deliverygoodsid?.toInt() ?: 0,
|
|
|
+ WRPriceType = 1,
|
|
|
+ WRTradeGoods = getWRTradeGoods(),
|
|
|
+ FixedPrice = onePriceInputEdittext.text.toString()
|
|
|
+ .toDouble(),
|
|
|
+ TimevalidType = 4,
|
|
|
+ FirstRatio = 0.0,
|
|
|
+ PerformanceTemplateID = 0,
|
|
|
+ DeliveryMonth = month_text.text.toString(),
|
|
|
+ BuyOrSell = 1,
|
|
|
+ PriceDisplayMode = 1,
|
|
|
+ CanBargain = canBargain,
|
|
|
+ ApplyID = 0,
|
|
|
+ CanPart = canPart,
|
|
|
+ HasWr = 0,
|
|
|
+ DelistMinQty = startInputNumber.text.toString().toLong(),
|
|
|
+ WRStandardID = data1.wrstandardid?.toInt() ?: 0
|
|
|
+ ) {
|
|
|
+ finish()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -969,6 +1374,14 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ fun getSelectFriendList() : List<String>{
|
|
|
+ val returnList = arrayListOf<String>()
|
|
|
+ selectFriendList.value?.forEach {
|
|
|
+ returnList.add(it.frienduserid?.toString() ?: "")
|
|
|
+ }
|
|
|
+ return returnList
|
|
|
+ }
|
|
|
+
|
|
|
fun getWRTradeGoods(): WarehouseTradeMI1.WRGoodsInfo {
|
|
|
val wRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder()
|
|
|
wRTradeGoods.setGoodsID(selectGoodsInfo.value?.id?.toInt() ?: 0)
|
|
|
@@ -1021,7 +1434,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
- } else {//浮动价校验
|
|
|
+ } else if (listedType.value?.id == "2") {//浮动价校验
|
|
|
if (selectGoodsInfo.value?.value.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择行情商品")
|
|
|
return false
|
|
|
@@ -1064,6 +1477,60 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ if (onePriceInputEdittext.text.toString().isNullOrEmpty()) {
|
|
|
+ ToastUtils.showLong("请输入挂牌价格")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (onePriceInputEdittext.text.toString() == "0" || onePriceInputEdittext.text.toString() == "0.0" || onePriceInputEdittext.text.toString() == "0.00") {
|
|
|
+ ToastUtils.showLong("挂牌价格不能为0")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (listednumberEdittext.text.toString().isNullOrEmpty()) {
|
|
|
+ ToastUtils.showLong("请输入挂牌数量")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (listednumberEdittext.text.toString() == "0" || listednumberEdittext.text.toString() == "0.0" || listednumberEdittext.text.toString() == "0.00") {
|
|
|
+ ToastUtils.showLong("挂牌数量不能为0")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ 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{
|
|
|
+ if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
|
|
|
+ ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (performance_bond.text.toString().isNullOrEmpty()){
|
|
|
+ ToastUtils.showLong("请输入履约保证金比例")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (performance_bond.text.toString() == "0" || performance_bond.text.toString() == "0.0" || performance_bond.text.toString() == "0.00") {
|
|
|
+ ToastUtils.showLong("履约保证金比例不能为0")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
|
|
|
+ ToastUtils.showLong("请选择履约模版")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (no_friend.isChecked.not()){
|
|
|
+ if (selectFriendList.value.isNullOrEmpty()){
|
|
|
+ ToastUtils.showLong("请选择朋友")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return true
|