zhou.xiaoning vor 3 Jahren
Ursprung
Commit
2686d47f62

+ 1 - 1
RMA/.idea/compiler.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="CompilerConfiguration">
-    <bytecodeTargetLevel target="1.8" />
+    <bytecodeTargetLevel target="11" />
   </component>
 </project>

+ 1 - 3
RMA/.idea/gradle.xml

@@ -4,7 +4,7 @@
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
-        <option name="testRunner" value="PLATFORM" />
+        <option name="testRunner" value="GRADLE" />
         <option name="distributionType" value="DEFAULT_WRAPPED" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="gradleJvm" value="1.8" />
@@ -16,9 +16,7 @@
           </set>
         </option>
         <option name="resolveModulePerSourceSet" value="false" />
-        <option name="useQualifiedModuleNames" value="true" />
       </GradleProjectSettings>
     </option>
-    <option name="offlineMode" value="true" />
   </component>
 </project>

+ 1 - 4
RMA/.idea/misc.xml

@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="ProjectPlainTextFileTypeManager">
-    <file url="file://$PROJECT_DIR$/app/src/main/res/layout/tab_item.xml" />
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 3 - 0
RMA/app/src/main/AndroidManifest.xml

@@ -385,6 +385,9 @@
         <activity android:name=".view.base.hnstmain.spotwarehouse.listed.ListedActivity"
             android:screenOrientation="portrait"
             android:windowSoftInputMode="adjustPan"/>
+        <activity android:name=".view.base.hnstmain.spotwarehouse.listed.YrdzListedActivity"
+            android:screenOrientation="portrait"
+            android:windowSoftInputMode="adjustPan"/>
 
         <activity android:name=".view.base.hnstmain.spotwarehouse.pickup.PickUpGoodsActivity"
             android:screenOrientation="portrait"

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt

@@ -36,6 +36,7 @@ import cn.muchinfo.rma.view.eventbus.EventConstent
 import cn.muchinfo.rma.view.eventbus.MainTabSelectMessageEvent
 import cn.muchinfo.rma.view.eventbus.MessageEvent
 import com.blankj.utilcode.util.AppUtils
+import com.blankj.utilcode.util.LogUtils
 import com.blankj.utilcode.util.SPUtils
 import com.facebook.drawee.backends.pipeline.Fresco
 import com.next.easynavigation.view.EasyNavigationBar

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt

@@ -7,7 +7,7 @@ object Constant {
      * 获取基础url的接口
      */
 //    const val baseurl = "http://103.40.249.123:38280/cfg?key=mtp_20" // 天津麦顿
-//    const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
+    const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
 //    const val baseurl = "http://103.40.249.123:8280/cfg?key=mtp_20"//千海金外盘
 //    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
 
@@ -23,7 +23,7 @@ object Constant {
 //    const val baseurl = "http://192.168.31.205:8080/cfg?key=test_205"// 瑶姐 云融 190000000001 123456
 //    const val baseurl = "http://192.168.31.201:8080/cfg?key=test_201"// 邓工 千海金
 
-    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
+//    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
 //    const val baseurl = "http://192.168.31.139:8080/cfg?key=test_139"// 邓工
 //

+ 12 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/DetailsWarehouseContentAdapter.java

@@ -17,6 +17,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
 import com.blankj.utilcode.util.ActivityUtils;
+import com.blankj.utilcode.util.LogUtils;
+import com.blankj.utilcode.util.SPUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -26,7 +28,9 @@ import cn.muchinfo.rma.global.data.ContractData;
 import cn.muchinfo.rma.global.data.HnstWrPositionData;
 import cn.muchinfo.rma.global.data.HoldLBData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.app.Constant;
 import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.listed.ListedActivity;
+import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.listed.YrdzListedActivity;
 import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.pickup.PickUpGoodsActivity;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
 
@@ -139,7 +143,14 @@ public class DetailsWarehouseContentAdapter extends RecyclerView.Adapter<Details
             intent.putExtra("data1",new HnstWrPositionData());
             intent.putExtra("type","1");
             intent.putExtra("data",data);
-            intent.setClass(context, ListedActivity.class);
+            //LogUtils.eTag("RMA", "oem: " + SPUtils.getInstance().getString(Constant.oem));
+            // 判断是否云融大宗
+            if (SPUtils.getInstance().getString(Constant.oem).equals("yrdz")) {
+                intent.setClass(context, YrdzListedActivity.class);
+            } else {
+                intent.setClass(context, ListedActivity.class);
+            }
+
             ActivityUtils.startActivity(intent);
         });
         //提货

Datei-Diff unterdrückt, da er zu groß ist
+ 478 - 441
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallActivity.kt


+ 398 - 384
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/FloatListedDialog.kt

@@ -32,6 +32,7 @@ import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
 import com.blankj.utilcode.util.ConvertUtils
+import com.blankj.utilcode.util.LogUtils
 import com.blankj.utilcode.util.ToastUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
@@ -231,473 +232,476 @@ class FloatSellListedUI(
     @SuppressLint("SetTextI18n")
     @RequiresApi(Build.VERSION_CODES.O)
     val root = _FrameLayout(activity).apply {
-        verticalLayout {
-            setMarginValue()
-            selectAccountData.postValue(GlobalDataCollection.instance?.accountData)
-            backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
-            viewModel.quoteDayData.bindOptional(context){
-                //行情下发计算挂牌金额 = (基差价格+期货合约价)* 挂牌数量
-                if (isdefineByBasis && basisInputEdittext.text.toString().isNullOrEmpty().not()  && basisInputEdittext.text.toString() != "-"){//初始化相应控件后才能取值计算
-                    listed_price.postValue(basisInputEdittext.text.toString().toDouble().plus(it?.getPrice() ?: 0.0))
-                }
-            }
-            linearLayout {
-                gravity = Gravity.CENTER_VERTICAL
-                onThrottleFirstClick {
-                    activity.creatAccountDataSheetDialog("请选择资金账号", GlobalDataCollection.instance?.accountDataList ?: arrayListOf()) {
-                        selectAccountData.postValue(this)
+        scrollView {
+            verticalLayout {
+                setMarginValue()
+                selectAccountData.postValue(GlobalDataCollection.instance?.accountData)
+                backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
+                viewModel.quoteDayData.bindOptional(context){
+                    //行情下发计算挂牌金额 = (基差价格+期货合约价)* 挂牌数量
+                    if (isdefineByBasis && basisInputEdittext.text.toString().isNullOrEmpty().not()  && basisInputEdittext.text.toString() != "-"){//初始化相应控件后才能取值计算
+                        listed_price.postValue(basisInputEdittext.text.toString().toDouble().plus(it?.getPrice() ?: 0.0))
                     }
                 }
                 linearLayout {
-                    textView {
-                        text = "交易账户"
-                        textSizeAuto = 34
-                        textColorInt = R.color.rma_hint_text_color_ccc
-                    }.lparams(wrapContent, wrapContent){
-                        marginStart = autoSize(36)
+                    gravity = Gravity.CENTER_VERTICAL
+                    onThrottleFirstClick {
+                        activity.creatAccountDataSheetDialog("请选择资金账号", GlobalDataCollection.instance?.accountDataList ?: arrayListOf()) {
+                            selectAccountData.postValue(this)
+                        }
                     }
-                }.lparams(autoSize(250), wrapContent)
+                    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 {
+                        selectAccountData.bindOptional(context){
+                            text = it?.accountid.toString() + "   " + it?.accountname
+                        }
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
 
-                emptyView()
+                    emptyView()
 
-                imageView {
-                    imageResource = R.mipmap.rma_more
-                }.lparams(autoSize(36), autoSize(36))
+                    imageView {
+                        imageResource = R.mipmap.rma_more
+                    }.lparams(autoSize(36), autoSize(36))
 
-            }.lparams(matchParent, autoSize(143))
+                }.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)
+                    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)
 
-                numberEditText3 {
-                    viewModel.quoteDayData.bindOptional(context){
-                        val MarketTradeConfig = GlobalDataCollection.instance?.marketTradeConfigData
-                        max = it?.preclose?.times(MarketTradeConfig?.basisupratio?.toDouble() ?: 0.0) ?: 0.0
-                        min = it?.preclose?.times(-1.0)?.times(MarketTradeConfig?.basisdownratio?.toDouble() ?: 0.0) ?: 0.0
-                    }
-                    basisInputEdittext = this
-                    isdefineByBasis = true
-                    text = "0"
-                    setOnTextChangeListener { view, value ->
-                        if (value.isNotEmpty()){
-                            //行情下发计算挂牌金额 = (基差价格+期货合约价)* 挂牌数量
-                            listed_price.postValue(value.toString().toDouble().plus(viewModel.quoteDayData.value?.getPrice() ?: 0.0))
+                    numberEditText3 {
+                        viewModel.quoteDayData.bindOptional(context){
+                            val MarketTradeConfig = GlobalDataCollection.instance?.marketTradeConfigData
+                            max = it?.preclose?.times(MarketTradeConfig?.basisupratio?.toDouble() ?: 0.0) ?: 0.0
+                            min = it?.preclose?.times(-1.0)?.times(MarketTradeConfig?.basisdownratio?.toDouble() ?: 0.0) ?: 0.0
                         }
+                        basisInputEdittext = this
+                        isdefineByBasis = true
+                        text = "0"
+                        setOnTextChangeListener { view, value ->
+                            if (value.isNotEmpty()){
+                                //行情下发计算挂牌金额 = (基差价格+期货合约价)* 挂牌数量
+                                listed_price.postValue(value.toString().toDouble().plus(viewModel.quoteDayData.value?.getPrice() ?: 0.0))
+                            }
+                        }
+                    }.lparams(0, autoSize(72),1f){
+                        marginEnd = autoSize(110)
                     }
-                }.lparams(0, autoSize(72),1f){
-                    marginEnd = autoSize(110)
-                }
-            }.lparams(matchParent, autoSize(143))
+                }.lparams(matchParent, autoSize(143))
 
-             itemView()
+                itemView()
 
-            linearLayout {
-                if (type == "2"){//预售挂卖时不需要选择现货仓单
-                    visibility = View.GONE
-                }else{
-                    visibility = View.VISIBLE
-                }
-                gravity = Gravity.CENTER_VERTICAL
-                onThrottleFirstClick {
-                    activity.creatHnstSpotDetailSheetDialog("请选择现货仓单", viewModel.detailsWarehouseContentDataList.value ?: arrayListOf()) {
-                        selectSpotDetailsData.postValue(this)
-                    }
-                }
                 linearLayout {
-                    textView {
-                        text = "现货仓单"
-                        textSizeAuto = 34
-                        textColorInt = R.color.rma_hint_text_color_ccc
-                    }.lparams(wrapContent, wrapContent){
-                        marginStart = autoSize(36)
+                    if (type == "2"){//预售挂卖时不需要选择现货仓单
+                        visibility = View.GONE
+                    }else{
+                        visibility = View.VISIBLE
                     }
-                }.lparams(autoSize(250), wrapContent)
-
-                textView {
-                    text = "请选择现货仓单"
-                    selectSpotDetailsData.bindOptional(context){
-                        text = it?.ladingbillid + "(" + it?.enableqty + it?.enumdicname + ")"
+                    gravity = Gravity.CENTER_VERTICAL
+                    onThrottleFirstClick {
+                        activity.creatHnstSpotDetailSheetDialog("请选择现货仓单", viewModel.detailsWarehouseContentDataList.value ?: arrayListOf()) {
+                            selectSpotDetailsData.postValue(this)
+                        }
                     }
-                    textSizeAuto = 34
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent)
+                    linearLayout {
+                        textView {
+                            text = "现货仓单"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), wrapContent)
 
-                emptyView()
+                    textView {
+                        text = "请选择现货仓单"
+                        selectSpotDetailsData.bindOptional(context){
+                            text = it?.ladingbillid + "(" + it?.enableqty + it?.enumdicname + ")"
+                        }
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
 
-                imageView {
-                    imageResource = R.mipmap.rma_more
-                }.lparams(autoSize(36), autoSize(36))
+                    emptyView()
 
-            }.lparams(matchParent, autoSize(143))
+                    imageView {
+                        imageResource = R.mipmap.rma_more
+                    }.lparams(autoSize(36), autoSize(36))
 
-            itemView()
+                }.lparams(matchParent, autoSize(143))
 
-            linearLayout {
-                verticalLayout {
-                    textView {
-                        text = "挂牌数量"
-                        textSizeAuto = 34
-                        textColorInt = R.color.rma_hint_text_color_ccc
-                    }.lparams(wrapContent, wrapContent){
-                        marginStart = autoSize(36)
-                        topMargin = autoSize(36)
-                    }
+                itemView()
 
-                }.lparams(autoSize(250), autoSize(290))
+                linearLayout {
+                    verticalLayout {
+                        textView {
+                            text = "挂牌数量"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                            topMargin = autoSize(36)
+                        }
 
-                verticalLayout {
-                    linearLayout {
-                        gravity = Gravity.CENTER_VERTICAL
-                        numberEditText {
-                            text = data.minivalue
-                            changeValue = data.minivalue?.toDouble() ?: 1.0
-                            listednumberEdittext = this
-                            setOnTextChangeListener { view, value ->
-                                if (value.isNullOrEmpty().not()) {
-                                    if (selectSpotDetailsData.value?.accountid.isNullOrEmpty().not()) {
-                                        val floatDelistingAmount = listed_price.value?.times(value.toString().toDouble())
-                                        if (floatDelistingAmount != 0.0){
-                                            //显示估算总额
-                                            if (marginValue == 0.0){
-                                                float_delisting_amount.text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2)
-                                            }else{
-                                                float_delisting_amount.text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2) + "(需履约保证金" + NumberUtils.roundNum(floatDelistingAmount?.times(marginValue) ?: 0.0,2) + ")"
+                    }.lparams(autoSize(250), autoSize(290))
+
+                    verticalLayout {
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            numberEditText {
+                                text = data.minivalue
+                                changeValue = data.minivalue?.toDouble() ?: 1.0
+                                listednumberEdittext = this
+                                setOnTextChangeListener { view, value ->
+                                    if (value.isNullOrEmpty().not()) {
+                                        if (selectSpotDetailsData.value?.accountid.isNullOrEmpty().not()) {
+                                            val floatDelistingAmount = listed_price.value?.times(value.toString().toDouble())
+                                            if (floatDelistingAmount != 0.0){
+                                                //显示估算总额
+                                                if (marginValue == 0.0){
+                                                    float_delisting_amount.text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2)
+                                                }else{
+                                                    float_delisting_amount.text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2) + "(需履约保证金" + NumberUtils.roundNum(floatDelistingAmount?.times(marginValue) ?: 0.0,2) + ")"
+                                                }
                                             }
                                         }
                                     }
                                 }
+                                setTextColor(R.color.buy_hall_color)
+                            }.lparams(0, autoSize(72),1f){
+                                marginEnd = autoSize(36)
                             }
-                            setTextColor(R.color.buy_hall_color)
-                        }.lparams(0, autoSize(72),1f){
-                            marginEnd = autoSize(36)
-                        }
-
-                        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
-                        isIndeterminate = false
-                        splitTrack = false
-                        setPadding(autoSize(30), 0, autoSize(30), 0)
-                        thumb = resources.getDrawable(R.mipmap.hnst_seekbar)
-                        thumbOffset = 0
-                        progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
-                        setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
-                            override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
-                                listednumberEdittext.text = NumberUtils.roundNum(max_number.text.toString().toDouble().times(p1.div(100.0)),0)
+                            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
+                            isIndeterminate = false
+                            splitTrack = false
+                            setPadding(autoSize(30), 0, autoSize(30), 0)
+                            thumb = resources.getDrawable(R.mipmap.hnst_seekbar)
+                            thumbOffset = 0
+                            progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
+                            setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
+                                override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
+                                    listednumberEdittext.text = NumberUtils.roundNum(max_number.text.toString().toDouble().times(p1.div(100.0)),0)
+                                }
 
-                            override fun onStartTrackingTouch(p0: SeekBar?) {
+                                override fun onStartTrackingTouch(p0: SeekBar?) {
 
-                            }
+                                }
 
-                            override fun onStopTrackingTouch(p0: SeekBar?) {
+                                override fun onStopTrackingTouch(p0: SeekBar?) {
 
-                            }
-                        })
-                    }.lparams(matchParent, wrapContent){
-                        marginEnd = autoSize(110)
-                        topMargin = autoSize(20)
-                    }
+                                }
+                            })
+                        }.lparams(matchParent, wrapContent){
+                            marginEnd = autoSize(110)
+                            topMargin = autoSize(20)
+                        }
 
-                    linearLayout {
-                        textView {
-                            text = "0"
-                            textSizeAuto = 29
-                            textColorInt = R.color.rma_gray_color
-                        }.lparams(wrapContent, wrapContent)
+                        linearLayout {
+                            textView {
+                                text = "0"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_gray_color
+                            }.lparams(wrapContent, wrapContent)
 
-                        emptyView()
+                            emptyView()
 
-                        textView {
-                            max_number = this
-                            viewModel.summaryWrPositionDataByDialog.bindOptional(context){
-                                if (type == "2"){
-                                    text = it?.creditenableqty + data.enumdicname
+                            textView {
+                                max_number = this
+                                viewModel.summaryWrPositionDataByDialog.bindOptional(context){
+                                    if (type == "2"){
+                                        text = it?.creditenableqty + data.enumdicname
+                                    }
                                 }
-                            }
-                            selectSpotDetailsData.bindOptional(context){
-                                if (type == "1"){
-                                    text = it?.enableqty + data.enumdicname
+                                selectSpotDetailsData.bindOptional(context){
+                                    if (type == "1"){
+                                        text = it?.enableqty + data.enumdicname
+                                    }
+
                                 }
+                                text = "1"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_gray_color
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, wrapContent){
+                            marginEnd = autoSize(110)
+                            topMargin = autoSize(10)
+                        }
 
-                            }
-                            text = "1"
+                    }.lparams(matchParent, autoSize(290))
+                }.lparams(matchParent, autoSize(290))
+
+                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)
+
+                    verticalLayout {
+                        linearLayout {
+                            editText {
+                                setText(data.minivalue)
+                                startInputNumber = this
+                                hint = "请输入起摘数量"
+                                background = null
+                                inputType = EditorInfo.TYPE_CLASS_NUMBER
+//                            setDecimalInputType()
+                                hintColorStr = "#CCCCCC"
+                                textSizeAuto = 31
+                                textColorStr = "#333333"
+                            }.lparams(0, autoSize(132),1f)
+
+                            textView {
+                                text = data.enumdicname
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(100))
+
+                        textView {
+                            text = "最小单位" + data.minivalue + data.enumdicname
                             textSizeAuto = 29
-                            textColorInt = R.color.rma_gray_color
+                            textColorInt = R.color.rma_hint_text_color_ccc
                         }.lparams(wrapContent, wrapContent)
-                    }.lparams(matchParent, wrapContent){
-                        marginEnd = autoSize(110)
-                        topMargin = autoSize(10)
-                    }
+                    }.lparams(matchParent, autoSize(167))
 
-                }.lparams(matchParent, autoSize(290))
-            }.lparams(matchParent, autoSize(290))
+                }.lparams(matchParent, autoSize(167))
 
-            itemView()
+                itemView()
 
-            linearLayout {
-                gravity = Gravity.CENTER_VERTICAL
                 linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
                     textView {
-                        text = "起摘数量"
+                        text = "估算总价"
                         textSizeAuto = 34
                         textColorInt = R.color.rma_hint_text_color_ccc
-                    }.lparams(wrapContent, wrapContent){
+                    }.lparams(autoSize(214), wrapContent) {
                         marginStart = autoSize(36)
                     }
-                }.lparams(autoSize(250), wrapContent)
-
-                verticalLayout {
-                    linearLayout {
-                        editText {
-                            setText(data.minivalue)
-                            startInputNumber = this
-                            hint = "请输入起摘数量"
-                            background = null
-                            inputType = EditorInfo.TYPE_CLASS_NUMBER
-//                            setDecimalInputType()
-                            hintColorStr = "#CCCCCC"
-                            textSizeAuto = 31
-                            textColorStr = "#333333"
-                        }.lparams(0, autoSize(132),1f)
-
-                        textView {
-                            text = data.enumdicname
-                            textSizeAuto = 31
-                            textColorInt = R.color.rma_black_33
-                        }.lparams(wrapContent, wrapContent)
-                    }.lparams(matchParent, autoSize(100))
 
                     textView {
-                        text = "最小单位" + data.minivalue + data.enumdicname
+                        text = "--"
+                        listed_price.bindOptional(context){
+                            text = NumberUtils.roundNum(it ?: 0.0,2)
+                        }
+                        float_total_amount = this
                         textSizeAuto = 29
-                        textColorInt = R.color.rma_hint_text_color_ccc
+                        textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(167))
-
-            }.lparams(matchParent, autoSize(167))
+                }.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)
-                }
+                itemView()
 
-                textView {
-                    text = "--"
-                    listed_price.bindOptional(context){
-                        text = NumberUtils.roundNum(it ?: 0.0,2)
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "估算总额"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(autoSize(214), wrapContent) {
+                        marginStart = autoSize(36)
                     }
-                    float_total_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 {
-                    text = "--"
-                    listed_price.bindOptional(context){
-                        val floatDelistingAmount = it?.times(listednumberEdittext.text.toString().toDouble())
-                        if (floatDelistingAmount != 0.0){
-                            if (marginValue == 0.0){
-                                text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2)
-                            }else{
-                                text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2) + "(需履约保证金" + NumberUtils.roundNum(floatDelistingAmount?.times(marginValue) ?: 0.0,2) + ")"
+                    textView {
+                        text = "--"
+                        listed_price.bindOptional(context){
+                            val floatDelistingAmount = it?.times(listednumberEdittext.text.toString().toDouble())
+                            if (floatDelistingAmount != 0.0){
+                                if (marginValue == 0.0){
+                                    text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2)
+                                }else{
+                                    text = NumberUtils.roundNum(floatDelistingAmount ?: 0.0,2) + "(需履约保证金" + NumberUtils.roundNum(floatDelistingAmount?.times(marginValue) ?: 0.0,2) + ")"
+                                }
                             }
                         }
+                        float_delisting_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)
                     }
-                    float_delisting_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)
+                }.lparams(wrapContent, wrapContent){
+                    topMargin = autoSize(20)
+                    marginStart = autoSize(250)
                 }
-                textSizeAuto = 29
-                textColorInt = R.color.rma_black_33
-            }.lparams(wrapContent, wrapContent){
-                topMargin = autoSize(20)
-                marginStart = autoSize(250)
-            }
 
-            verticalEmptyView()
+                verticalEmptyView()
 
-            linearLayout {
-                background = resources.getDrawable(R.color.white)
-                gravity = Gravity.CENTER_VERTICAL
-                textView {
-                    onThrottleFirstClick {
-                        if (type == "1") {
-                            if (selectSpotDetailsData.value?.deliverygoodsid.isNullOrEmpty()) {
-                                ToastUtils.showLong("请选择现货仓单明细")
+                linearLayout {
+                    background = resources.getDrawable(R.color.white)
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        onThrottleFirstClick {
+                            if (type == "1") {
+                                if (selectSpotDetailsData.value?.deliverygoodsid.isNullOrEmpty()) {
+                                    ToastUtils.showLong("请选择现货仓单明细")
+                                    return@onThrottleFirstClick
+                                }
+                            }else{
+                                if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty()){
+                                    ToastUtils.showLong("没有对应的仓单数据,不能进行挂牌操作")
+                                    return@onThrottleFirstClick
+                                }
+                            }
+                            if (listednumberEdittext.text.toString().isNullOrEmpty()){
+                                ToastUtils.showLong("请输入挂牌数量")
                                 return@onThrottleFirstClick
                             }
-                        }else{
-                            if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty()){
-                                ToastUtils.showLong("没有对应的仓单数据,不能进行挂牌操作")
+                            if (listednumberEdittext.text.toString().toDouble() == 0.0){
+                                ToastUtils.showLong("挂牌数量不能为零")
                                 return@onThrottleFirstClick
                             }
-                        }
-                        if (listednumberEdittext.text.toString().isNullOrEmpty()){
-                            ToastUtils.showLong("请输入挂牌数量")
-                            return@onThrottleFirstClick
-                        }
-                        if (listednumberEdittext.text.toString().toDouble() == 0.0){
-                            ToastUtils.showLong("挂牌数量不能为零")
-                            return@onThrottleFirstClick
-                        }
 
-                        if (basisInputEdittext.text.toString().isNullOrEmpty()){
-                            ToastUtils.showLong("请输入基差")
-                            return@onThrottleFirstClick
-                        }
-
-                        if (startInputNumber.text.toString().isNullOrEmpty()) {
-                            ToastUtils.showLong("请输入起摘数量")
-                            return@onThrottleFirstClick
-                        }
-                        if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0){
-                            ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
-                            return@onThrottleFirstClick
-                        }
+                            if (basisInputEdittext.text.toString().isNullOrEmpty()){
+                                ToastUtils.showLong("请输入基差")
+                                return@onThrottleFirstClick
+                            }
 
-                        if (type == "1"){
-                            viewModel.requeryWRListingOrderReq(
-                                FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
-                                LadingBillId = selectSpotDetailsData.value?.ladingbillid?.toLong() ?: 0,
-                                TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
-                                SubNum = selectSpotDetailsData.value?.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 = 2,
-                                WRTradeGoods = getWRTradeGoods(data),
-                                PriceFactor = 1.0,
-                                PriceMove = basisInputEdittext.text.toString().toDouble(),
-                                TimevalidType = 4,
-                                FirstRatio = 0.0,
-                                PerformanceTemplateID = 0,
-                                BuyOrSell = 1,
-                                PriceDisplayMode = 1,
-                                CanBargain = 0,
-                                ApplyID = 0,
-                                CanPart = 1,
-                                HasWr = 1,
-                                DelistMinQty = startInputNumber.text.toString().toLong(),
-                                WRStandardID = data.wrstandardid?.toInt() ?: 0
-                            ){
-                                viewModel.controlDialogDisappear.postValue(true)
+                            if (startInputNumber.text.toString().isNullOrEmpty()) {
+                                ToastUtils.showLong("请输入起摘数量")
+                                return@onThrottleFirstClick
                             }
-                        }else{
-                            viewModel.requeryWRListingOrderReq(
-                                FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
-                                LadingBillId = 0,
-                                TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
-                                SubNum = 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 = 2,
-                                WRTradeGoods = getWRTradeGoods(data),
-                                PriceFactor = 1.0,
-                                PriceMove = basisInputEdittext.text.toString().toDouble(),
-                                TimevalidType = 4,
-                                FirstRatio = 0.0,
-                                PerformanceTemplateID = 0,
-                                BuyOrSell = 1,
-                                PriceDisplayMode = 1,
-                                CanBargain = 0,
-                                ApplyID = 0,
-                                CanPart = 1,
-                                HasWr = 0,
-                                DelistMinQty = startInputNumber.text.toString().toLong(),
-                                WRStandardID = data.wrstandardid?.toInt() ?: 0
-                            ){
-                                viewModel.controlDialogDisappear.postValue(true)
+                            if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0){
+                                ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
+                                return@onThrottleFirstClick
                             }
-                        }
 
+                            if (type == "1"){
+                                viewModel.requeryWRListingOrderReq(
+                                    FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
+                                    LadingBillId = selectSpotDetailsData.value?.ladingbillid?.toLong() ?: 0,
+                                    TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
+                                    SubNum = selectSpotDetailsData.value?.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 = 2,
+                                    WRTradeGoods = getWRTradeGoods(data),
+                                    PriceFactor = 1.0,
+                                    PriceMove = basisInputEdittext.text.toString().toDouble(),
+                                    TimevalidType = 4,
+                                    FirstRatio = 0.0,
+                                    PerformanceTemplateID = 0,
+                                    BuyOrSell = 1,
+                                    PriceDisplayMode = 1,
+                                    CanBargain = 0,
+                                    ApplyID = 0,
+                                    CanPart = 1,
+                                    HasWr = 1,
+                                    DelistMinQty = startInputNumber.text.toString().toLong(),
+                                    WRStandardID = data.wrstandardid?.toInt() ?: 0
+                                ){
+                                    viewModel.controlDialogDisappear.postValue(true)
+                                }
+                            }else{
+                                viewModel.requeryWRListingOrderReq(
+                                    FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
+                                    LadingBillId = 0,
+                                    TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
+                                    SubNum = 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 = 2,
+                                    WRTradeGoods = getWRTradeGoods(data),
+                                    PriceFactor = 1.0,
+                                    PriceMove = basisInputEdittext.text.toString().toDouble(),
+                                    TimevalidType = 4,
+                                    FirstRatio = 0.0,
+                                    PerformanceTemplateID = 0,
+                                    BuyOrSell = 1,
+                                    PriceDisplayMode = 1,
+                                    CanBargain = 0,
+                                    ApplyID = 0,
+                                    CanPart = 1,
+                                    HasWr = 0,
+                                    DelistMinQty = startInputNumber.text.toString().toLong(),
+                                    WRStandardID = data.wrstandardid?.toInt() ?: 0
+                                ){
+                                    viewModel.controlDialogDisappear.postValue(true)
+                                }
+                            }
+
+                        }
+                        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 {
-                        viewModel.controlDialogDisappear.postValue(true)
+                    textView {
+                        onThrottleFirstClick {
+                            viewModel.controlDialogDisappear.postValue(true)
+                        }
+                        gravity = Gravity.CENTER
+                        backgroundResource = R.drawable.hnxt_cancel_bg
+                        text = "取消"
+                        textColorInt = R.color.white
+                        textSizeAuto = 38
+                    }.lparams(autoSize(419), autoSize(119)) {
+                        marginStart = autoSize(13)
                     }
-                    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
             }
         }
+
     }
 
     fun getWRTradeGoods(data: OrderQuoteData) : WarehouseTradeMI1.WRGoodsInfo{
@@ -910,6 +914,7 @@ class FloatBuyListedUI(
                     }
 
                     linearLayout {
+                        LogUtils.aTag("aaaa", "aaaa:" + maxlistedNumber.toString())
                         textView {
                             text = "0"
                             textSizeAuto = 29
@@ -918,6 +923,7 @@ class FloatBuyListedUI(
 
                         emptyView()
 
+                        maxlistedNumber.postValue(0)
                         textView {
                             maxlistedNumber.bindOptional(context){
                                 text = it.toString() + data.enumdicname
@@ -993,9 +999,17 @@ class FloatBuyListedUI(
                     text = "--"
                     listed_price.bindOptional(context){
                         text = NumberUtils.roundNum(it ?: 0.0,2)
+
                         if (it != 0.0 && marginValue != 0.0){
-                            maxlistedNumber.postValue(viewModel.usedAccountData.value?.canUserAmount?.div(marginValue)?.div(it ?: 1.0)?.toInt())
+                            var maxNumber = viewModel.usedAccountData.value?.canUserAmount?.div(marginValue)?.div(it ?: 1.0)?.toInt()
+                            if (maxNumber != null) {
+                                if (maxNumber < 0) { maxNumber = 0 }
+                            }
+                            maxlistedNumber.postValue(maxNumber)
+                        } else {
+                            maxlistedNumber.postValue(0)
                         }
+                        LogUtils.aTag("aaaa", "aaaa:" + maxlistedNumber)
                     }
                     float_total_amount = this
                     textSizeAuto = 29
@@ -1136,7 +1150,7 @@ class FloatBuyListedUI(
                     }
                     gravity = Gravity.CENTER
                     backgroundResource = R.drawable.qhj_main_blue_bg
-                    text = "卖出"
+                    text = "买入"
                     textSizeAuto = 38
                     textColorInt = R.color.white
                 }.lparams(autoSize(419), autoSize(119)) {

+ 32 - 20
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/OneListedDialog.kt

@@ -219,10 +219,12 @@ class OneSellListedUI(
     @SuppressLint("NewApi", "SetTextI18n")
     @RequiresApi(Build.VERSION_CODES.O)
     val root = _FrameLayout(activity).apply {
+        scrollView {
         verticalLayout {
             setMarginValue()
             selectAccountData.postValue(GlobalDataCollection.instance?.accountData)
             backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
+
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL
                 onThrottleFirstClick {
@@ -267,7 +269,7 @@ class OneSellListedUI(
                 onThrottleFirstClick {
                     val intent = Intent()
                     intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
-                    activity.startActivityForResult(intent,1004)
+                    activity.startActivityForResult(intent, 1004)
                 }
 
                 textView {
@@ -314,6 +316,7 @@ class OneSellListedUI(
                 }.lparams(autoSize(250), wrapContent)
 
                 numberEditText {
+                    decimal = 2
                     text = "0"
                     onePriceInputEdittext = this
                     setOnTextChangeListener { view, value ->
@@ -348,9 +351,9 @@ class OneSellListedUI(
             itemView()
 
             linearLayout {
-                if (type == "2"){//预售挂卖时不需要选择现货仓单
+                if (type == "2") {//预售挂卖时不需要选择现货仓单
                     visibility = View.GONE
-                }else{
+                } else {
                     visibility = View.VISIBLE
                 }
                 gravity = Gravity.CENTER_VERTICAL
@@ -408,7 +411,7 @@ class OneSellListedUI(
                     linearLayout {
                         gravity = Gravity.CENTER_VERTICAL
                         numberEditText {
-                            viewModel.summaryWrPositionDataByDialog.bindOptional(context){
+                            viewModel.summaryWrPositionDataByDialog.bindOptional(context) {
                                 max = it?.enalbeqty?.toDouble() ?: 1.0
                             }
                             text = data.minivalue
@@ -466,9 +469,12 @@ class OneSellListedUI(
                         progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
                         setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                             override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
-                                if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty().not()){
+                                if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty()
+                                        .not()
+                                ) {
                                     oneNumberInputEdittext.text = NumberUtils.roundNum(
-                                        viewModel.summaryWrPositionDataByDialog.value?.creditenableqty?.toDouble()?.times(p1.div(100.0)).toString(), 0
+                                        viewModel.summaryWrPositionDataByDialog.value?.creditenableqty?.toDouble()
+                                            ?.times(p1.div(100.0)).toString(), 0
                                     )
                                 }
                             }
@@ -496,13 +502,13 @@ class OneSellListedUI(
                         emptyView()
 
                         textView {
-                            viewModel.summaryWrPositionDataByDialog.bindOptional(context){
-                                if (type == "2"){
+                            viewModel.summaryWrPositionDataByDialog.bindOptional(context) {
+                                if (type == "2") {
                                     text = it?.creditenableqty + it?.enumdicname
                                 }
                             }
-                            selectSpotDetailsData.bindOptional(context){
-                                if (type == "1"){
+                            selectSpotDetailsData.bindOptional(context) {
+                                if (type == "1") {
                                     text = it?.enableqty + data.enumdicname
                                 }
                             }
@@ -610,14 +616,14 @@ class OneSellListedUI(
                                 ToastUtils.showLong("请选择现货仓单明细")
                                 return@onThrottleFirstClick
                             }
-                        }else{
-                            if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty()){
+                        } else {
+                            if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty()) {
                                 ToastUtils.showLong("没有对应的仓单数据,不能进行挂牌操作")
                                 return@onThrottleFirstClick
                             }
                         }
 
-                        if (viewModel.selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
+                        if (viewModel.selectPerformanceStepData.value?.autoid.isNullOrEmpty()) {
                             ToastUtils.showLong("请选择履约模版")
                             return@onThrottleFirstClick
                         }
@@ -669,7 +675,8 @@ class OneSellListedUI(
                                 WRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder().build(),
                                 TimevalidType = 4,
                                 FirstRatio = 0.0,
-                                PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
+                                PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong()
+                                    ?: 0,
                                 BuyOrSell = 1,
                                 PriceDisplayMode = 1,
                                 CanBargain = 0,
@@ -699,7 +706,8 @@ class OneSellListedUI(
                                 WRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder().build(),
                                 TimevalidType = 4,
                                 FirstRatio = 0.0,
-                                PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
+                                PerformanceTemplateID = viewModel.selectPerformanceStepData.value?.autoid?.toLong()
+                                    ?: 0,
                                 BuyOrSell = 1,
                                 PriceDisplayMode = 1,
                                 CanBargain = 0,
@@ -740,6 +748,7 @@ class OneSellListedUI(
             }
         }
     }
+    }
 }
 
 //一口价买挂牌
@@ -882,17 +891,20 @@ class OneBuyListedUI(
                 }.lparams(autoSize(250), wrapContent)
 
                 numberEditText {
+                    decimal = 2
                     text = "0"
                     onePriceInputEdittext = this
                     setOnTextChangeListener { view, value ->
                         if (value.isNullOrEmpty().not()) {
                             //这里计算最多购买数量 挂牌最大数量=可用资金/(买方履约保证金比例*挂牌价格)
                             if (value.toDouble() != 0.0 && marginValue1 != 0.0) {
-                                maxlistedNumber.postValue(
-                                    viewModel.usedAccountData.value?.canUserAmount?.div(
-                                        value.toString().toDouble()
-                                    )?.div(marginValue1.toDouble())?.toInt()
-                                )
+                                var maxNumber = viewModel.usedAccountData.value?.canUserAmount?.div(
+                                    value.toString().toDouble()
+                                )?.div(marginValue1.toDouble())?.toInt()
+                                if (maxNumber != null) {
+                                    if (maxNumber < 0) { maxNumber = 0 }
+                                }
+                                maxlistedNumber.postValue(maxNumber)
                             }
                             if (oneNumberInputEdittext.text.toString().isNullOrEmpty().not()) {
                                 //这里计算金额和履约保证金

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/dialog/WarehouseFloatListedDialog.kt

@@ -953,7 +953,13 @@ class FloatBuyListedUI(
                     listed_price.bindOptional(context){
                         text = NumberUtils.roundNum(it ?: 0.0,2)
                         if (it != 0.0 && marginValue != 0.0){
-                            maxlistedNumber.postValue(viewModel.usedAccountData.value?.canUserAmount?.div(marginValue)?.div(it ?: 1.0)?.toInt())
+                            var maxNumber = viewModel.usedAccountData.value?.canUserAmount?.div(marginValue)?.div(it ?: 1.0)?.toInt()
+                            if (maxNumber != null) {
+                                if (maxNumber < 0) maxNumber = 0
+                            } else {
+                                maxNumber = 0
+                            }
+                            maxlistedNumber.postValue(maxNumber)
                         }
                     }
                     float_total_amount = this

+ 8 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/dialog/WarehouseOneListedDialog.kt

@@ -755,10 +755,14 @@ class OneBuyListedUI(
                     setOnTextChangeListener { view, value ->
                         if (value.isNullOrEmpty().not()) {
                             if (value.toDouble() != 0.0 && marginValue != 0.0) {
+                                var maxNumber = viewModel.usedAccountData.value?.canUserAmount?.div(
+                                    value.toString().toDouble()
+                                )?.div(marginValue.toDouble())?.toInt()
+                                if (maxNumber != null) {
+                                    if (maxNumber < 0) maxNumber = 0
+                                }
                                 maxlistedNumber.postValue(
-                                    viewModel.usedAccountData.value?.canUserAmount?.div(
-                                        value.toString().toDouble()
-                                    )?.div(marginValue.toDouble())?.toInt()
+                                    maxNumber
                                 )
                             }
                             if (oneNumberInputEdittext.text.toString().isNullOrEmpty().not()) {
@@ -887,6 +891,7 @@ class OneBuyListedUI(
                         emptyView()
 
                         textView {
+                            maxlistedNumber.postValue(0)
                             maxlistedNumber.bindOptional(context){
                                 text = it.toString() + data.WrFtWrstandard?.enumdicname
                             }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.