Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

jieyu 4 gadi atpakaļ
vecāks
revīzija
783dbc4ea3
25 mainītis faili ar 1357 papildinājumiem un 140 dzēšanām
  1. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  2. 28 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/transfer/ContractTransferActivity.kt
  3. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performance/adapter/PerformanceInformationContentAdapter.java
  4. 17 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceTempateActivity.kt
  5. 12 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt
  6. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgePlanActivity.kt
  7. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotaudit/someprice/SomePriceFragment.kt
  8. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ContractDetailActivity.kt
  9. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/data/ContractDetailsData.kt
  10. 25 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/detailsviewholder/ContractDetailsViewHolder.kt
  11. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/purchasesale/PurchaseSaleFragment.kt
  12. 17 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/SpotFragment.kt
  13. 707 39
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/PeriodAssociatedFragment.kt
  14. 290 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/PeriodAssociatedViewModel.kt
  15. 11 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/externalorder/OutAssociationContentAdapter.java
  16. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/BusinessAssociationsActivity.kt
  17. 163 52
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/FillSingleConnectionActivity.kt
  18. 5 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/FillSingleConnectionViewModel.kt
  19. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/PeriodAssociationContentAdapter.java
  20. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/PeriodDocumentsFragment.kt
  21. 16 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/relationalrecord/RelationalRecordContentAdapter.java
  22. 32 19
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemSonViewHolder.kt
  23. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemViewHolder.kt
  24. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessHallActivity.kt
  25. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingActivity.kt

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

@@ -15,9 +15,9 @@ object Constant {
 
 //    const val baseurl = "http://192.168.31.93:8080/cfg?key=test_93"//李倩企业风管 18611112222
 //    const val baseurl = "http://192.168.31.104:8080/cfg?key=test_104"//李倩云融 18611112222
-    const val baseurl = "http://192.168.31.137:8080/cfg?key=test_137"//李倩云融 18611112222
+//    const val baseurl = "http://192.168.31.137:8080/cfg?key=test_137"//李倩云融 18611112222
 //
-//    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
+    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
 
 //    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"

+ 28 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/transfer/ContractTransferActivity.kt

@@ -21,6 +21,7 @@ import cn.muchinfo.rma.view.base.BaseActivity
 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.LogUtils
 import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.dialog.createLoadingDialog
 import mtp.polymer.com.autowidget.utils.bindTaskStatus
@@ -46,6 +47,14 @@ class ContractTransferActivity : BaseActivity<ContractTransferViewModel>(){
     //挂牌金额
     lateinit var one_delisting_amount: TextView
 
+    lateinit var main_seekbar : SeekBar
+
+    //seekbar驱动变化
+    var changeSeekbar : Boolean = false
+
+    //数量输入框的驱动变化
+    var numberChangeEdittext : Boolean = false
+
     @RequiresApi(Build.VERSION_CODES.O)
     @SuppressLint("SetTextI18n")
     override fun onCreate(savedInstanceState: Bundle?) {
@@ -153,6 +162,14 @@ class ContractTransferActivity : BaseActivity<ContractTransferViewModel>(){
                             oneNumberInputEdittext = this
                             setOnTextChangeListener { view, value ->
                                 if (value.isNullOrEmpty().not()) {
+                                    numberChangeEdittext = true
+                                    if (changeSeekbar.not()){
+                                        main_seekbar.max = 100
+                                        main_seekbar.progress = value.toString().toDouble().div(data.enableqty?.toDouble() ?: 1.0).times(100).toInt()
+                                        LogUtils.eTag("dasfafafadssada",value.toString().toDouble().div(data.enableqty?.toDouble() ?: 1.0).times(100).toInt())
+                                    }
+//
+
                                     if (onePriceInputEdittext.text.toString().isNullOrEmpty()
                                             .not()
                                     ) {
@@ -165,7 +182,9 @@ class ContractTransferActivity : BaseActivity<ContractTransferViewModel>(){
                                             2
                                         )
                                     }
+                                    numberChangeEdittext = false
                                 }
+
                             }
                             setTextColor(R.color.buy_hall_color)
                         }.lparams(0, autoSize(72), 1f) {
@@ -183,7 +202,8 @@ class ContractTransferActivity : BaseActivity<ContractTransferViewModel>(){
                     }.lparams(matchParent, autoSize(143))
 
                     inflateLayout<SeekBar>(R.layout.main_seekbar) {
-                        min = 10
+                        main_seekbar = this
+                        min = 1
                         max = 100
                         isIndeterminate = false
                         splitTrack = false
@@ -193,9 +213,13 @@ class ContractTransferActivity : BaseActivity<ContractTransferViewModel>(){
                         progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
                         setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                             override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
-                                oneNumberInputEdittext.text = NumberUtils.roundNum(
-                                    data.enableqty?.toDouble()?.times(p1.div(100.0)).toString(), 0
-                                )
+                                changeSeekbar = true
+                                if (numberChangeEdittext.not()){
+                                    oneNumberInputEdittext.text = NumberUtils.roundNum(
+                                        data.enableqty?.toDouble()?.times(p1.div(100.0)).toString(), 0
+                                    )
+                                }
+                                changeSeekbar = false
                             }
 
                             override fun onStartTrackingTouch(p0: SeekBar?) {

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performance/adapter/PerformanceInformationContentAdapter.java

@@ -144,7 +144,7 @@ public class PerformanceInformationContentAdapter extends RecyclerView.Adapter<P
 
         if (data.getPerformancestatus().equals("2")){
             if (type.equals("1")){//买履约
-                if (data.getSteptypeid().equals("1") || data.getSteptypeid().equals("6") || data.getSteptypeid().equals("10")){//步骤为买方支付,货款溢短,卖方发票时,延期,违约,详情按钮才显示
+                if (data.getSteptypeid().equals("8") || data.getSteptypeid().equals("2") || data.getSteptypeid().equals("1") || data.getSteptypeid().equals("6") || data.getSteptypeid().equals("10")){//步骤为 8:仓单转移 2:卖方收款 买方支付,货款溢短,卖方发票时,延期,违约,详情按钮才显示
                     itemViewHolder.spot_details.setText("延期");
                     itemViewHolder.spot_details.setVisibility(View.VISIBLE);
                     itemViewHolder.future_details.setText("违约");
@@ -162,7 +162,7 @@ public class PerformanceInformationContentAdapter extends RecyclerView.Adapter<P
                 }
             }else if (type.equals("2")){//卖履约
                 itemViewHolder.warehouse_register.setVisibility(View.GONE);
-                if (data.getSteptypeid().equals("1") || data.getSteptypeid().equals("4") || data.getSteptypeid().equals("6") || data.getSteptypeid().equals("8")){//步骤为买方支付,卖方发货,卖方发票,仓单转移时,延期,违约,详情按钮才显示
+                if ( data.getSteptypeid().equals("1") || data.getSteptypeid().equals("4") || data.getSteptypeid().equals("6") || data.getSteptypeid().equals("8") || data.getSteptypeid().equals("2")  || data.getSteptypeid().equals("10")){//步骤为买方支付,卖方发货,卖方发票,仓单转移时,延期,违约,详情按钮才显示
                     itemViewHolder.spot_details.setText("延期");
                     itemViewHolder.spot_details.setVisibility(View.VISIBLE);
                     itemViewHolder.future_details.setText("违约");

+ 17 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceTempateActivity.kt

@@ -230,6 +230,11 @@ class AddPerformanceTempateActivity : BaseActivity<PerformanceTemplateViewModel>
                                     return@onThrottleFirstClick
                                 }
 
+                                if (checkTransfer().not()){
+                                    ToastUtils.showLong("请配置仓单转移")
+                                    return@onThrottleFirstClick
+                                }
+
                                 if (type == "1") {
                                     viewModel.performancePlanTemplateReq(
                                         templatename = performance_name.text.toString(),
@@ -375,6 +380,18 @@ class AddPerformanceTempateActivity : BaseActivity<PerformanceTemplateViewModel>
         return returnBooble
     }
 
+    //校验是否配置了仓单转移
+    fun checkTransfer() : Boolean{
+        var returnBooble = false
+        val cashDataList = viewModel.wrGoodsPerformanceStepCashDataList.value
+        cashDataList?.forEach {
+            if (it.steptypeid == "8"){
+                returnBooble = true
+            }
+        }
+        return returnBooble
+    }
+
 
     fun check(): Boolean {
         var returnBooble = false

+ 12 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt

@@ -85,6 +85,8 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
     var opt1tx: JsonBean? = null
     var opt2tx: JsonBean.CityBean? = null
 
+    lateinit var main_seekbar : SeekBar
+
     /**
      * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
      */
@@ -627,6 +629,14 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
                                         setOnTextChangeListener { view, value ->
                                             if (value.isNullOrEmpty().not()) {
+
+                                                if (type == "1") {
+//                                                    main_seekbar.progress = value.toString().toDouble().div(data.enableqty?.toDouble() ?: 1.0).toInt()
+                                                    main_seekbar.progress = value.toString().toDouble().div(data.enableqty?.toDouble() ?: 1.0).times(100).toInt()
+                                                } else {
+                                                    main_seekbar.progress = value.toString().toDouble().div(data1.creditenableqty?.toDouble() ?: 1.0).times(100).toInt()
+                                                }
+
                                                 if (listedType.value?.id == "1" || listedType.value?.id == "3") {//一口价
                                                     val delistingAmount = value.toDouble().times(
                                                         onePriceInputEdittext.text.toString()
@@ -716,6 +726,8 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 }.lparams(matchParent, autoSize(143))
 
                                 inflateLayout<SeekBar>(R.layout.main_seekbar) {
+                                    main_seekbar = this
+
                                     min = 10
                                     max = 100
                                     isIndeterminate = false

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgePlanActivity.kt

@@ -418,7 +418,7 @@ fun _LinearLayout.creatHedgeHeadUI() {
         verticalLayout {
             gravity = Gravity.CENTER
             textView {
-                text = "现货商品/"
+                text = "现货商品"
                 textColorInt = R.color.hint_text_color
                 textSizeAuto = 24
             }.lparams(wrapContent, wrapContent){

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotaudit/someprice/SomePriceFragment.kt

@@ -220,7 +220,7 @@ class SomeApprovedPriceUI(
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val unSubmitAdapter: BaseAdapter<BusinessData, SomePriceViewholder> = BaseAdapter { _, _ -> SomePriceViewholder(activity, viewModel,"2") }
+    private val unSubmitAdapter: BaseAdapter<BusinessData, SomePriceViewholder> = BaseAdapter { _, _ -> SomePriceViewholder(activity, viewModel,"1") }
 
     val root = _FrameLayout(activity).apply {
         verticalLayout {

+ 3 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ContractDetailActivity.kt

@@ -323,6 +323,9 @@ class ContractDetailsUI(
                     },content = accnoutname
                 ),
                 ContractDetailsData(title = "交易主体", content = data.subjectname ?: ""),
+
+                ContractDetailsData(title = "合同附件", content = data.attachment ?: "",type = "2"),
+
                 ContractDetailsData(title = "业务类型",content = if (data.biztype == "1"){
                     "套保"
                 }else{

+ 2 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/data/ContractDetailsData.kt

@@ -8,5 +8,6 @@ package cn.muchinfo.rma.view.base.procurement.data
  */
 data class ContractDetailsData(
     val title : String = "",
-    val content : String = ""
+    val content : String = "",
+    val type : String = "1"//类型,1是正常显示类型,2是附件
 )

+ 25 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/detailsviewholder/ContractDetailsViewHolder.kt

@@ -1,13 +1,18 @@
 package cn.muchinfo.rma.view.base.procurement.detailsviewholder
 
+import android.content.Intent
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.main.promotioncode.ShowImageByUrlActivity
 import cn.muchinfo.rma.view.base.procurement.data.ContractDetailsData
+import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
@@ -32,11 +37,29 @@ class ContractDetailsViewHolder(private val activity : AppCompatActivity) : Base
             }.lparams(autoSize(250), autoSize(120))
 
             textView {
+                onThrottleFirstClick {
+                    if (data.value?.type == "2"){
+                        if (data.value?.content.isNullOrEmpty().not()){
+                            val intent = Intent()
+                            intent.putExtra("url",data.value?.content)
+                            intent.setClass(context, ShowImageByUrlActivity::class.java)
+                            ActivityUtils.startActivity(intent)
+                        }else{
+                            ToastUtils.showLong("无附件")
+                        }
+                    }
+                }
                 data.bindOptional(context){
-                    text = it?.content
+                    if (it?.type == "1"){
+                        text = it.content
+                        textColorInt = R.color.rma_black_33
+                    }else{
+                        text = "查看"
+                        textColorInt = R.color.rma_yellow_text_color
+                    }
                 }
                 textSizeAuto = 31
-                textColorInt = R.color.rma_black_33
+
             }.lparams(wrapContent, wrapContent){
                 marginStart = autoSize(35)
             }

+ 6 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/purchasesale/PurchaseSaleFragment.kt

@@ -102,6 +102,12 @@ class PurchaseSaleFragment : BaseFragment<HedgePlanViewModel>(){
         initMenuData()
     }
 
+    override fun onResume() {
+        super.onResume()
+        viewModel.queryHedegList("0")
+        viewModel.queryHedegList("2")
+    }
+
     override fun onCreateView(
         inflater: LayoutInflater,
         container: ViewGroup?,

+ 17 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/SpotFragment.kt

@@ -12,6 +12,7 @@ import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentPagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.global.data.HedgePlanData
 import cn.muchinfo.rma.global.data.MiddleGoodsDetail
@@ -81,17 +82,25 @@ class SpotFragment : BaseFragment<SpotViewModel>(){
 
     fun initMenuData() {
 
-        newTabsArray.add("采购合同")
-        newTabFragment.add(procurementFragment)
+        if (GlobalDataCollection.instance?.getSecondLevelMenu("client_spots","client_spots_purchase") == true) {
+            newTabsArray.add("采购合同")
+            newTabFragment.add(procurementFragment)
+        }
 
-        newTabsArray.add("销售合同")
-        newTabFragment.add(saleFragment)
+        if (GlobalDataCollection.instance?.getSecondLevelMenu("client_spots","client_spots_sales") == true) {
+            newTabsArray.add("销售合同")
+            newTabFragment.add(saleFragment)
+        }
 
-        newTabsArray.add("购销计划")
-        newTabFragment.add(purchaseSaleFragment)
+        if (GlobalDataCollection.instance?.getSecondLevelMenu("client_spots","client_spots_hedgeplan") == true) {
+            newTabsArray.add("购销计划")
+            newTabFragment.add(purchaseSaleFragment)
+        }
 
-        newTabsArray.add("期限关联")
-        newTabFragment.add(periodAssociatedFragment)
+        if (GlobalDataCollection.instance?.getSecondLevelMenu("client_spots","client_spots_link") == true){
+            newTabsArray.add("期限关联")
+            newTabFragment.add(periodAssociatedFragment)
+        }
 
         newPagerAdapter = object : FragmentPagerAdapter(
             getAppCompatActivity().supportFragmentManager,

+ 707 - 39
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/PeriodAssociatedFragment.kt

@@ -2,96 +2,125 @@ package cn.muchinfo.rma.view.base.spot.associated
 
 import android.content.Intent
 import android.os.Bundle
-import android.view.Gravity
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
+import android.view.*
+import android.widget.EditText
 import androidx.annotation.NonNull
 import androidx.annotation.Nullable
+import androidx.appcompat.app.AppCompatActivity
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentPagerAdapter
 import androidx.lifecycle.MutableLiveData
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.getAppCompatActivity
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
 import cn.muchinfo.rma.view.base.spot.associated.externalorder.ExternalOrderAssociationFragment
+import cn.muchinfo.rma.view.base.spot.associated.externalorder.OutAssociationContentAdapter
 import cn.muchinfo.rma.view.base.spot.associated.perioddocuments.BusinessAssociationsActivity
 import cn.muchinfo.rma.view.base.spot.associated.perioddocuments.FillSingleConnectionActivity
+import cn.muchinfo.rma.view.base.spot.associated.perioddocuments.PeriodAssociationContentAdapter
 import cn.muchinfo.rma.view.base.spot.associated.perioddocuments.PeriodDocumentsFragment
+import cn.muchinfo.rma.view.base.spot.associated.relationalrecord.RelationalRecordContentAdapter
 import cn.muchinfo.rma.view.base.spot.associated.relationalrecord.RelationalRecordFragment
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ConvertUtils
+import com.blankj.utilcode.util.SizeUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.UI
 import org.jetbrains.anko.support.v4.viewPager
 
-class PeriodAssociatedFragment : BaseFragment<PeriodAssociatedViewModel>(){
+class PeriodAssociatedFragment : BaseFragment<PeriodAssociatedViewModel>() {
 
     lateinit var segment: QMUITabSegment
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
 
-    val selectedTabIndexData : MutableLiveData<Int> = MutableLiveData()
+    val selectedTabIndexData: MutableLiveData<Int> = MutableLiveData()
+
+    var indexFirst: Int = 0
 
     //外部成交单关联
-    val externalOrderAssociationFragment by lazy {
-        ExternalOrderAssociationFragment()
+    val externalOrderAssociationUI by lazy {
+        ExternalOrderAssociationUI(this.getAppCompatActivity(), viewModel)
     }
 
     //期现单据关联
-    val periodDocumentsFragment by lazy {
-        PeriodDocumentsFragment()
+    val periodDocumentsUI by lazy {
+        PeriodDocumentsUI(this.getAppCompatActivity(), viewModel)
     }
 
     //关联记录
-    val relationalRecordFragment by lazy {
-        RelationalRecordFragment()
+    val relationalRecordUI by lazy {
+        RelationalRecordUI(this.getAppCompatActivity(), viewModel)
     }
 
     //viewpager的适配器
-    private var newPagerAdapter: FragmentPagerAdapter? = null
+    private var newPagerAdapter: PagerAdapter? = null
 
     //tabSegment标题
     private val newTabsArray: ArrayList<String> = arrayListOf()
 
-    //viewpager绑定的页面集合
-    private val newTabFragment: ArrayList<Fragment> = arrayListOf()
+    //暂存的页面组
+    private val uiList: ArrayList<_FrameLayout> = arrayListOf()
 
     fun initMenuData() {
 
-        newTabsArray.add("外部成交单关联")
-        newTabFragment.add(externalOrderAssociationFragment)
+        if (uiList.size > 0) {
+            newPagerAdapter = null
+            newTabsArray.clear()
+            uiList.clear()
+        }
 
-        newTabsArray.add("期现单据关联")
-        newTabFragment.add(periodDocumentsFragment)
+        if (GlobalDataCollection.instance?.getThreeLevelMenu("client_spots","client_spots_link","client_spots_link_outorder") == true){
+            newTabsArray.add("外部成交单关联")
+            uiList.add(externalOrderAssociationUI.root)
+        }
 
-        newTabsArray.add("关联记录")
-        newTabFragment.add(relationalRecordFragment)
+        if (GlobalDataCollection.instance?.getThreeLevelMenu("client_spots","client_spots_link","client_spots_link_pa") == true) {
+            newTabsArray.add("期现单据关联")
+            uiList.add(periodDocumentsUI.root)
+        }
+        if (GlobalDataCollection.instance?.getThreeLevelMenu("client_spots","client_spots_link","client_spots_link_logs") == true) {
+            newTabsArray.add("关联记录")
+            uiList.add(relationalRecordUI.root)
+        }
 
-        newPagerAdapter = object : FragmentPagerAdapter(
-            getAppCompatActivity().supportFragmentManager,
-            BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
-        ) {
-            @NonNull
-            override fun getItem(position: Int): Fragment {
-                return newTabFragment[position]
-            }
+        newPagerAdapter = object : PagerAdapter() {
 
-            override fun getCount(): Int {
-                return newTabFragment.size
+            override fun getPageTitle(position: Int): CharSequence? = newTabsArray[position]
+
+            override fun instantiateItem(container: ViewGroup, position: Int): Any {
+                return uiList.get(position).apply {
+                    container.addView(
+                        this,
+                        ViewGroup.LayoutParams(matchParent, matchParent)
+                    )
+                }
             }
 
-            @Nullable
-            override fun getPageTitle(position: Int): CharSequence? {
-                return newTabsArray[position]
+            override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
+                (`object` as? View)?.let { container.removeView(it) }
             }
+
+            override fun isViewFromObject(view: View, `object`: Any): Boolean = view == `object`
+
+            override fun getCount(): Int = newTabsArray.size
+
         }
+
     }
 
 
@@ -101,6 +130,12 @@ class PeriodAssociatedFragment : BaseFragment<PeriodAssociatedViewModel>(){
         savedInstanceState: Bundle?
     ): View? {
         initMenuData()
+
+        if (indexFirst > 0) {
+            segment.reset()
+            viewPager.adapter = newPagerAdapter
+        }
+        indexFirst++
         return UI {
             verticalLayout {
 
@@ -128,15 +163,15 @@ class PeriodAssociatedFragment : BaseFragment<PeriodAssociatedViewModel>(){
                         )
 
                         setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
-                    }.lparams(0, autoSize(80),4f)
+                    }.lparams(0, autoSize(80), 4f)
 
                     linearLayout {
                         gravity = Gravity.CENTER
                         visibility = View.INVISIBLE
-                        selectedTabIndexData.bindOptional(context){
-                            if (it == 1){
+                        selectedTabIndexData.bindOptional(context) {
+                            if (it == 1) {
                                 visibility = View.VISIBLE
-                            }else{
+                            } else {
                                 visibility = View.INVISIBLE
                             }
                         }
@@ -152,7 +187,7 @@ class PeriodAssociatedFragment : BaseFragment<PeriodAssociatedViewModel>(){
                             textSizeAuto = 29
                             textColorInt = R.color.rma_blue_color
                         }.lparams(autoSize(150), autoSize(50))
-                    }.lparams(0, autoSize(80),1f)
+                    }.lparams(0, autoSize(80), 1f)
                 }.lparams(matchParent, autoSize(80))
 
 
@@ -178,4 +213,637 @@ class PeriodAssociatedFragment : BaseFragment<PeriodAssociatedViewModel>(){
         }.view
     }
 
+}
+
+
+/**
+ * 外部期限关联ui
+ */
+class ExternalOrderAssociationUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: PeriodAssociatedViewModel
+) : OutAssociationContentAdapter.OnContentScrollListener {
+
+    //输入的搜索外部订单号
+    lateinit var order_in_edittext: EditText
+
+    //输入的搜索合约名称/代码
+    lateinit var code_in_edittext: EditText
+
+    //选择的是否是关联和未关联的
+    val seleAssociatedType: MutableLiveData<SelectData> = MutableLiveData()
+
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contentAdapter by lazy {
+        OutAssociationContentAdapter(
+            activity
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    val root = _FrameLayout(activity).apply {
+        viewModel.queryOutOrderAssociationTitle(
+            tableKey = Constant.table_mobile_spotfuturerelate_outertradeorder,
+            hasinnerorder = "0"
+        )
+        verticalLayout {
+            background = resources.getDrawable(R.color.white)
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    backgroundResource = R.drawable.qyfg_search_item_bg
+                    editText {
+                        order_in_edittext = this
+                        hint = "搜索外部订单号"
+                        background = null
+//                            inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_DECIMAL or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
+//                            setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(90)) {
+                        marginStart = autoSize(20)
+                    }
+                }.lparams(0, autoSize(100), 1f) {
+                    marginStart = autoSize(32)
+                    marginEnd = autoSize(16)
+                }
+
+                linearLayout {
+                    backgroundResource = R.drawable.qyfg_search_item_bg
+                    editText {
+                        code_in_edittext = this
+                        hint = "搜索合约名称/代码"
+                        background = null
+//                            inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_DECIMAL or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
+//                            setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(90)) {
+                        marginStart = autoSize(20)
+                    }
+                }.lparams(0, autoSize(100), 1f) {
+                    marginStart = autoSize(16)
+                    marginEnd = autoSize(32)
+                }
+            }.lparams(matchParent, autoSize(120))
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    onThrottleFirstClick {
+                        val selectDataList = arrayListOf<SelectData>(
+                            SelectData(id = "0", value = "未关联"),
+                            SelectData(id = "1", value = "已关联")
+                        )
+                        activity.creatBottomSheetDialog("请选择指定交易用户", selectDataList) {
+                            seleAssociatedType.postValue(this)
+                        }
+                    }
+                    seleAssociatedType.bindOptional(context) {
+                        text = it?.value
+                    }
+                    gravity = Gravity.CENTER
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 31
+                }.lparams(0, autoSize(90), 1f) {
+                    marginStart = autoSize(32)
+                    marginEnd = autoSize(16)
+                }
+
+                textView {
+                    backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
+                    onThrottleFirstClick {
+                        viewModel.queryOutTradeLink(
+                            outtradeid = order_in_edittext.text.toString(),
+                            goodsname = code_in_edittext.text.toString(),
+                            hasinnerorder = seleAssociatedType.value?.id ?: "0"
+                        )
+                    }
+                    gravity = Gravity.CENTER
+                    text = "查询"
+                    textColorInt = R.color.white
+                    textSizeAuto = 31
+                }.lparams(0, autoSize(90), 1f) {
+                    marginStart = autoSize(16)
+                    marginEnd = autoSize(32)
+                }
+            }.lparams(matchParent, autoSize(120))
+
+            contentAdapter.setOnContentScrollListener(this@ExternalOrderAssociationUI)
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.orderAssociationTitleList.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 24
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(SizeUtils.dp2px(135f)), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        contentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<OutAssociationContentAdapter.ItemViewHolder> =
+                            contentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.orderAssociationTitleList.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(true)
+                    setOnRefreshListener {
+                        viewModel.queryOutTradeLink(
+                            outtradeid = order_in_edittext.text.toString(),
+                            goodsname = code_in_edittext.text.toString(),
+                            hasinnerorder = seleAssociatedType.value?.id ?: "0"
+                        )
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = contentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<OutAssociationContentAdapter.ItemViewHolder> =
+                                    contentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.orderAssociationDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    contentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
+
+}
+
+/**
+ * 期现单据关联页面
+ * @property activity AppCompatActivity
+ * @property viewModel PeriodAssociatedViewModel
+ * @property swipeToLayout SwipeToLoadLayout
+ * @property statusLayout StatusLayout
+ * @property horScrollview CustomHorizontalScrollView
+ * @property recyclerView RecyclerView
+ * @property topAdapter TopTabAdpater
+ * @property contentAdapter PeriodAssociationContentAdapter
+ * @property root _FrameLayout
+ * @constructor
+ */
+class PeriodDocumentsUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: PeriodAssociatedViewModel
+) : PeriodAssociationContentAdapter.OnContentScrollListener {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contentAdapter by lazy {
+        PeriodAssociationContentAdapter(
+            activity
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+
+    val root = _FrameLayout(activity).apply {
+        viewModel.queryPeriodAssociationTitle(tableKey = Constant.table_mobile_spotfuturerelate_order)
+        verticalLayout {
+            contentAdapter.setOnContentScrollListener(this@PeriodDocumentsUI)
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.periodAssociationTitleList.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 24
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(SizeUtils.dp2px(135f)), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        contentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<PeriodAssociationContentAdapter.ItemViewHolder> =
+                            contentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.periodAssociationTitleList.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(
+                                    data.columntitle?.replace("\\n", "\n") ?: ""
+                                )
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(true)
+                    setOnRefreshListener {
+
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = contentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(
+                                recyclerView: RecyclerView,
+                                dx: Int,
+                                dy: Int
+                            ) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<PeriodAssociationContentAdapter.ItemViewHolder> =
+                                    contentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.periodAssociationDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    contentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
+
+}
+
+
+class RelationalRecordUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: PeriodAssociatedViewModel
+) : RelationalRecordContentAdapter.OnContentScrollListener {
+
+    //搜索期货订单号
+    lateinit var futures_order_number: EditText
+
+    //搜索现货编号
+    lateinit var spot_number: EditText
+
+    //搜索期货账户
+    lateinit var futures_account: EditText
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contentAdapter by lazy {
+        RelationalRecordContentAdapter(
+            activity
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    val root = _FrameLayout(activity).apply {
+        viewModel.queryRelationRecordTitle(tableKey = Constant.table_mobile_spotfuturerelate_order)
+        verticalLayout {
+
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    backgroundResource = R.drawable.qyfg_search_item_bg
+                    editText {
+                        futures_order_number = this
+                        hint = "搜索期货订单号"
+                        background = null
+//                            inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_DECIMAL or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
+//                            setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(90)) {
+                        marginStart = autoSize(20)
+                    }
+                }.lparams(0, autoSize(100), 1f) {
+                    marginStart = autoSize(32)
+                    marginEnd = autoSize(16)
+                }
+
+                linearLayout {
+                    backgroundResource = R.drawable.qyfg_search_item_bg
+                    editText {
+                        spot_number = this
+                        hint = "搜索现货编号"
+                        background = null
+//                            inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_DECIMAL or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
+//                            setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(90)) {
+                        marginStart = autoSize(20)
+                    }
+                }.lparams(0, autoSize(100), 1f) {
+                    marginStart = autoSize(16)
+                    marginEnd = autoSize(32)
+                }
+            }.lparams(matchParent, autoSize(120))
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    backgroundResource = R.drawable.qyfg_search_item_bg
+                    editText {
+                        futures_account = this
+                        hint = "搜索期货账户"
+                        background = null
+//                            inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_DECIMAL or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
+//                            setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(90)) {
+                        marginStart = autoSize(20)
+                    }
+                }.lparams(0, autoSize(100), 1f) {
+                    marginStart = autoSize(32)
+                    marginEnd = autoSize(16)
+                }
+
+                textView {
+                    backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
+                    onThrottleFirstClick {
+                        viewModel.queryRelationRecordTitle(
+                            tableKey = Constant.table_mobile_spotfuturerelate_order,
+                            tradeid = futures_order_number.text.toString(),
+                            contractno = spot_number.text.toString(),
+                            taname = futures_account.text.toString()
+                        )
+                    }
+                    gravity = Gravity.CENTER
+                    text = "查询"
+                    textColorInt = R.color.white
+                    textSizeAuto = 31
+                }.lparams(0, autoSize(90), 1f) {
+                    marginStart = autoSize(16)
+                    marginEnd = autoSize(32)
+                }
+            }.lparams(matchParent, autoSize(120))
+
+            contentAdapter.setOnContentScrollListener(this@RelationalRecordUI)
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.relationRecordTitleList.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 24
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(SizeUtils.dp2px(135f)), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        contentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<RelationalRecordContentAdapter.ItemViewHolder> =
+                            contentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.relationRecordTitleList.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(
+                                    data.columntitle?.replace("\\n", "\n") ?: ""
+                                )
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(true)
+                    setOnRefreshListener {
+
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = contentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(
+                                recyclerView: RecyclerView,
+                                dx: Int,
+                                dy: Int
+                            ) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<RelationalRecordContentAdapter.ItemViewHolder> =
+                                    contentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.relationRecordDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    contentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
+
 }

+ 290 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/PeriodAssociatedViewModel.kt

@@ -1,5 +1,15 @@
 package cn.muchinfo.rma.view.base.spot.associated
 
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.ColumnsData
+import cn.muchinfo.rma.global.data.OutTradeLinkData
+import cn.muchinfo.rma.global.data.PaTradeLinkData
+import cn.muchinfo.rma.global.data.PaTradeLinkDetailData
+import cn.muchinfo.rma.global.isBlankString
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.toArrayList
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseViewModel
 
 /**
@@ -7,5 +17,285 @@ import cn.muchinfo.rma.view.base.BaseViewModel
  */
 class PeriodAssociatedViewModel : BaseViewModel(){
 
+    //外部成交单关联列头数据
+    val orderAssociationTitleList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
 
+    //外部成交单内容数据
+    val orderAssociationDataList : MutableLiveData<List<OutTradeLinkData>> = MutableLiveData()
+
+    /**
+     * 定价报表头部数据请求
+     * @param tradedate String
+     * @param cycletype String
+     */
+    fun queryOutOrderAssociationTitle(
+        tableKey: String,
+        outtradeid: String = "",
+        goodsname: String = "",
+        hasinnerorder : String = ""
+    ){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                orderAssociationTitleList.postValue(newlist)
+                queryOutTradeLink(
+                    outtradeid = outtradeid,
+                    goodsname = goodsname,
+                    hasinnerorder = hasinnerorder
+                )
+            }
+        }
+    }
+
+    /**
+     * 定价报表数据查询
+     * @param tradedate String
+     * @param cycletype String
+     */
+    fun queryOutTradeLink(
+        outtradeid: String = "",
+        goodsname: String = "",
+        hasinnerorder : String = ""
+    ){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            if (outtradeid.isNotEmpty()){
+                put("outtradeid",outtradeid)
+            }
+            if (goodsname.isNotEmpty()){
+                put("goodsname",goodsname)
+            }
+            if (hasinnerorder.isNotEmpty()){
+                put("spotcontractid",hasinnerorder)
+            }
+        }
+        MyApplication.getInstance()?.spotManager?.queryOutTradeLink(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                orderAssociationDataList.postValue(resetorderAssociationDataList(respData ?: arrayListOf()))
+            }
+        }
+    }
+
+    /**
+     * 针对定价报表的内容数据进行再次组装
+     * @param list List<SCMiddleGoodsReportData>
+     */
+    private fun resetorderAssociationDataList(respData: List<OutTradeLinkData>) : List<OutTradeLinkData>{
+        val newList = arrayListOf<OutTradeLinkData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            newRightData.add(it.tradetime?.isBlankString() ?: "--")//'成交时间
+            newRightData.add(it.hedgeaccountcode?.isBlankString() + "\n" + if (it.buyorsell == "0"){"买入"}else{"卖出"})//'外部期货账号/\n方向
+            newRightData.add(it.tradeqty + "\n" + NumberUtils.doubleDistortion(it.tradeprice))//成交数量/\n成交价格
+            newRightData.add(
+                it.outtradeid?.isBlankString() ?: "--"
+            )//外部订单号
+            newRightData.add(it.currencyname?.isBlankString() ?: "--")//结算币种
+            newRightData.add(
+                it.exexchangename?.isBlankString() ?: "--"
+            )// 交易所
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+
+    //---------------------------------------------------------------------------------------------------
+
+    //外部成交单关联列头数据
+    val periodAssociationTitleList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    //外部成交单内容数据
+    val periodAssociationDataList : MutableLiveData<List<PaTradeLinkData>> = MutableLiveData()
+
+
+    /**
+     * 定价报表头部数据请求
+     * @param tradedate String
+     * @param cycletype String
+     */
+    fun queryPeriodAssociationTitle(
+        tableKey: String
+    ){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                periodAssociationTitleList.postValue(newlist)
+                queryPaTradeLink(
+
+                )
+            }
+        }
+    }
+
+    /**
+     * 定价报表数据查询
+     * @param tradedate String
+     * @param cycletype String
+     */
+    fun queryPaTradeLink(
+    ){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.spotManager?.queryPaTradeLink(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                periodAssociationDataList.postValue(resetPeriodDocumentsDataList(respData ?: arrayListOf()))
+            }
+        }
+    }
+
+    /**
+     * 针对定价报表的内容数据进行再次组装
+     * @param list List<SCMiddleGoodsReportData>
+     */
+    private fun resetPeriodDocumentsDataList(respData: List<PaTradeLinkData>) : List<PaTradeLinkData>{
+        val newList = arrayListOf<PaTradeLinkData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            newRightData.add(it.tradetime?.isBlankString() ?: "--")//'时间
+            newRightData.add(it.ordertypename?.isBlankString() + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.tradeprice),2))//'订单类型/\n成交价格
+            newRightData.add(it.tradelot + "\n" + it.relatedlot)//成交数量/\n已关联数量
+            newRightData.add(
+                it.tradeid?.isBlankString() ?: "--"
+            )//期货单号
+            newRightData.add(it.username?.isBlankString() ?: "--")//用户名称
+            newRightData.add(
+                it.taname?.isBlankString() ?: "--"
+            )// 期货账户名称
+            newRightData.add(
+                it.accountid?.isBlankString() ?: "--"
+            )// 期货账户代码
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+
+    //----------------------------------------------------------------------------------------------------
+    //外部成交单关联列头数据
+    val relationRecordTitleList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    //外部成交单内容数据
+    val relationRecordDataList : MutableLiveData<List<PaTradeLinkDetailData>> = MutableLiveData()
+
+
+    /**
+     * 关联记录列头数据
+     * @param tradedate String
+     * @param cycletype String
+     */
+    fun queryRelationRecordTitle(
+        tableKey: String,
+        tradeid :String = "",
+        contractno : String = "",
+        taname : String = ""
+    ){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                relationRecordTitleList.postValue(newlist)
+                queryPaTradeLinkDetail(
+                    tradeid = tradeid,
+                    contractno = contractno,
+                    taname = taname
+                )
+            }
+        }
+    }
+
+    /**
+     * 定价报表数据查询
+     * @param tradedate String
+     * @param cycletype String
+     */
+    fun queryPaTradeLinkDetail(
+        tradeid :String = "",
+        contractno : String = "",
+        taname : String = ""
+    ){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            if (tradeid.isNotEmpty()){
+                put("tradeid",tradeid)
+            }
+            if (contractno.isNotEmpty()){
+                put("contractno",contractno)
+            }
+            if (taname.isNotEmpty()){
+                put("taname",taname)
+            }
+        }
+        MyApplication.getInstance()?.spotManager?.queryPaTradeLinkDetail(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                relationRecordDataList.postValue(resetRelationalRecordDataList(respData ?: arrayListOf()))
+            }
+        }
+    }
+
+    /**
+     * 针对定价报表的内容数据进行再次组装
+     * @param list List<SCMiddleGoodsReportData>
+     */
+    private fun resetRelationalRecordDataList(respData: List<PaTradeLinkDetailData>) : List<PaTradeLinkDetailData>{
+        val newList = arrayListOf<PaTradeLinkDetailData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            newRightData.add(it.relatedqty?.isBlankString() ?: "--")//'关联数量
+            newRightData.add(it.contractno?.isBlankString() ?: "--")//现货编号
+            newRightData.add(it.tradeid?.isBlankString() ?: "--")//期货订单号
+            newRightData.add(
+                it.tradetime?.isBlankString() ?: "--"
+            )//期货成交时间
+            newRightData.add(it.username?.isBlankString() ?: "--")//用户名称
+            newRightData.add(
+                it.taname?.isBlankString() ?: "--"
+            )// 期货账户
+            newRightData.add(
+                it.goodsname?.isBlankString() ?: "--" + "\n" + it.goodscode
+            )// 合约名称/\n代码
+            newRightData.add(
+                if (it.buyorsell == "0"){
+                    "买入"
+                }else{
+                    "卖出"
+                }
+            )// 方向
+            newRightData.add(
+                it.tradelot?.isBlankString() ?: "--"
+            )// 成交数量
+            newRightData.add(
+                it.tradeprice?.isBlankString() ?: "--"
+            )// 成交价格
+            newRightData.add(
+                it.createtime?.isBlankString() ?: "--"
+            )// 关联时间
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
 }

+ 11 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/externalorder/OutAssociationContentAdapter.java

@@ -131,10 +131,19 @@ public class OutAssociationContentAdapter extends RecyclerView.Adapter<OutAssoci
             }
         });
         if (data.getHasinnerorder().equals("0")){//无关联
-            itemViewHolder.associated.setVisibility(View.VISIBLE);
+            if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_link", "client_spots_link_outorder", "client_spots_link_outorder_link")){
+                itemViewHolder.associated.setVisibility(View.VISIBLE);
+            }else {
+                itemViewHolder.associated.setVisibility(View.GONE);
+            }
+
             itemViewHolder.dissociated.setVisibility(View.GONE);
         }else {//有关联
-            itemViewHolder.dissociated.setVisibility(View.VISIBLE);
+            if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_link", "client_spots_link_outorder", "client_spots_link_outorder_unlink")) {
+                itemViewHolder.dissociated.setVisibility(View.VISIBLE);
+            }else {
+                itemViewHolder.dissociated.setVisibility(View.GONE);
+            }
             itemViewHolder.associated.setVisibility(View.GONE);
         }
 

+ 3 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/BusinessAssociationsActivity.kt

@@ -21,6 +21,8 @@ import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.dialog.SelectData
 import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 /**
@@ -57,6 +59,7 @@ class BusinessAssociationsActivity : BaseActivity<BusinessAssociationsViewModel>
         super.onCreate(savedInstanceState)
         verticalLayout {
             viewModel.querySCMiddleGoods(data = data)
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.rma_hint_line_color_eee)
             topBar {
                 commonLeftButton()

+ 163 - 52
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/FillSingleConnectionActivity.kt

@@ -2,6 +2,7 @@ package cn.muchinfo.rma.view.base.spot.associated.perioddocuments
 
 import android.os.Bundle
 import android.view.Gravity
+import android.view.View
 import android.view.inputmethod.EditorInfo
 import android.widget.EditText
 import androidx.lifecycle.MutableLiveData
@@ -21,6 +22,8 @@ import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.dialog.SelectData
 import mtp.polymer.com.autowidget.dialog.creatAccountDataSheetDialog
 import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 /**
@@ -29,37 +32,37 @@ import org.jetbrains.anko.*
 class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>() {
 
     //选择的业务类型
-    val selectBusinessType : MutableLiveData<SelectData> = MutableLiveData()
+    val selectBusinessType: MutableLiveData<SelectData> = MutableLiveData()
 
     //选择的资金账号
-    val selectAccountData : MutableLiveData<AccountData> = MutableLiveData()
+    val selectAccountData: MutableLiveData<AccountData> = MutableLiveData()
 
     //选择的商品组
-    val selectGoodsGroup : MutableLiveData<SelectData> = MutableLiveData()
+    val selectGoodsGroup: MutableLiveData<SelectData> = MutableLiveData()
 
     //选择的期货合约
-    val selectGoods : MutableLiveData<SelectData> = MutableLiveData()
+    val selectGoods: MutableLiveData<SelectData> = MutableLiveData()
 
     //选择的买入卖出
-    val selectBuyOrSell : MutableLiveData<SelectData> = MutableLiveData()
+    val selectBuyOrSell: MutableLiveData<SelectData> = MutableLiveData()
 
     //选择的下单类型
-    val selectChannelBuildType : MutableLiveData<SelectData> = MutableLiveData()
+    val selectChannelBuildType: MutableLiveData<SelectData> = MutableLiveData()
 
     //输入的价格
-    lateinit var price_edittext : MangeNumberEditText2
+    lateinit var price_edittext: MangeNumberEditText2
 
     //输入的数量
-    lateinit var number_edittext : MangeNumberEditText2
+    lateinit var number_edittext: MangeNumberEditText2
 
     //输入的现货编号
-    lateinit var spot_number_edittext : EditText
+    lateinit var spot_number_edittext: EditText
 
     //输入的对手方
-    lateinit var counterparty_edittext : EditText
+    lateinit var counterparty_edittext: EditText
 
     //输入的现货商品
-    lateinit var spot_goods_edittext : EditText
+    lateinit var spot_goods_edittext: EditText
 
     private val businessAssociationsAdapter: BaseAdapter<SCMiddleGoodsData, FillSingleAssociationsViewHolder> =
         BaseAdapter { _, _ ->
@@ -69,14 +72,15 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
             )
         }
 
-    fun initData(){
-        selectBuyOrSell.postValue(SelectData(id = "0",value = "买入"))
-        selectChannelBuildType.postValue(SelectData(id = "1",value = "建仓"))
+    fun initData() {
+        selectBuyOrSell.postValue(SelectData(id = "0", value = "买入"))
+        selectChannelBuildType.postValue(SelectData(id = "1", value = "建仓"))
     }
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             initData()
             background = resources.getDrawable(R.color.rma_hint_line_color_eee)
             topBar {
@@ -167,19 +171,25 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                 gravity = Gravity.CENTER_VERTICAL
                                 backgroundResource = R.drawable.qyfg_search_item_bg
                                 onThrottleFirstClick {
-                                    creatBottomSheetDialog("请选择品种", viewModel.getSelectGoodsGroupList()) {
+                                    creatBottomSheetDialog(
+                                        "请选择品种",
+                                        viewModel.getSelectGoodsGroupList()
+                                    ) {
                                         selectGoodsGroup.postValue(this)
-                                        viewModel.querySCMiddleGoods(buyorsell = selectBuyOrSell.value?.id ?: "0",goodsgroupid = this.goodsgroupid)
+                                        viewModel.querySCMiddleGoods(
+                                            buyorsell = selectBuyOrSell.value?.id ?: "0",
+                                            goodsgroupid = this.goodsgroupid
+                                        )
                                     }
                                 }
                                 textView {
-                                    selectGoodsGroup.bindOptional(context){
+                                    selectGoodsGroup.bindOptional(context) {
                                         text = it?.value
                                     }
                                     text = "品种"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginStart = autoSize(10)
                                 }
 
@@ -187,10 +197,10 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
 
                                 imageView {
                                     imageResource = R.mipmap.rma_down
-                                }.lparams(autoSize(23), autoSize(23)){
+                                }.lparams(autoSize(23), autoSize(23)) {
                                     marginEnd = autoSize(14)
                                 }
-                            }.lparams(0, autoSize(84),1f){
+                            }.lparams(0, autoSize(84), 1f) {
                                 marginEnd = autoSize(24)
                             }
 
@@ -199,24 +209,29 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                 backgroundResource = R.drawable.qyfg_search_item_bg
                                 onThrottleFirstClick {
 
-                                    if (selectGoodsGroup.value?.id.isNullOrEmpty()){
+                                    if (selectGoodsGroup.value?.id.isNullOrEmpty()) {
                                         ToastUtils.showLong("请先选择品种")
                                         return@onThrottleFirstClick
                                     }
 
-                                    creatBottomSheetDialog("请选择期货合约", viewModel.getSelectGoodsByGoodsgroupid(selectGoodsGroup.value?.id ?: "")) {
+                                    creatBottomSheetDialog(
+                                        "请选择期货合约",
+                                        viewModel.getSelectGoodsByGoodsgroupid(
+                                            selectGoodsGroup.value?.id ?: ""
+                                        )
+                                    ) {
                                         selectGoods.postValue(this)
                                     }
 
                                 }
                                 textView {
-                                    selectGoods.bindOptional(context){
+                                    selectGoods.bindOptional(context) {
                                         text = it?.value
                                     }
                                     text = "期货合约"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginStart = autoSize(10)
                                 }
 
@@ -225,10 +240,10 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
 
                                 imageView {
                                     imageResource = R.mipmap.rma_down
-                                }.lparams(autoSize(23), autoSize(23)){
+                                }.lparams(autoSize(23), autoSize(23)) {
                                     marginEnd = autoSize(14)
                                 }
-                            }.lparams(0, autoSize(84),1f){
+                            }.lparams(0, autoSize(84), 1f) {
                                 marginEnd = autoSize(32)
                             }
                         }.lparams(matchParent, autoSize(95))
@@ -261,21 +276,23 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                 gravity = Gravity.CENTER_VERTICAL
                                 backgroundResource = R.drawable.qyfg_search_item_bg
                                 onThrottleFirstClick {
-                                    val selectBuyOrSellList = arrayListOf(SelectData(id = "0",value = "买入"),
-                                        SelectData(id = "1",value = "卖出"))
+                                    val selectBuyOrSellList = arrayListOf(
+                                        SelectData(id = "0", value = "买入"),
+                                        SelectData(id = "1", value = "卖出")
+                                    )
 
                                     creatBottomSheetDialog("请选择方向", selectBuyOrSellList) {
                                         selectBuyOrSell.postValue(this)
                                     }
                                 }
                                 textView {
-                                    selectBuyOrSell.bindOptional(context){
+                                    selectBuyOrSell.bindOptional(context) {
                                         text = it?.value
                                     }
                                     text = "买入"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginStart = autoSize(10)
                                 }
 
@@ -284,10 +301,10 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
 
                                 imageView {
                                     imageResource = R.mipmap.rma_down
-                                }.lparams(autoSize(23), autoSize(23)){
+                                }.lparams(autoSize(23), autoSize(23)) {
                                     marginEnd = autoSize(14)
                                 }
-                            }.lparams(0, autoSize(84),1f){
+                            }.lparams(0, autoSize(84), 1f) {
                                 marginEnd = autoSize(24)
                             }
 
@@ -295,21 +312,23 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                 gravity = Gravity.CENTER_VERTICAL
                                 backgroundResource = R.drawable.qyfg_search_item_bg
                                 onThrottleFirstClick {
-                                    val selectBuyOrSellList = arrayListOf(SelectData(id = "1",value = "建仓"),
-                                        SelectData(id = "2",value = "平仓"))
+                                    val selectBuyOrSellList = arrayListOf(
+                                        SelectData(id = "1", value = "建仓"),
+                                        SelectData(id = "2", value = "平仓")
+                                    )
 
                                     creatBottomSheetDialog("请选择下单类型", selectBuyOrSellList) {
                                         selectChannelBuildType.postValue(this)
                                     }
                                 }
                                 textView {
-                                    selectChannelBuildType.bindOptional(context){
+                                    selectChannelBuildType.bindOptional(context) {
                                         text = it?.value
                                     }
                                     text = "建仓"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginStart = autoSize(10)
                                 }
 
@@ -318,10 +337,10 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
 
                                 imageView {
                                     imageResource = R.mipmap.rma_down
-                                }.lparams(autoSize(23), autoSize(23)){
+                                }.lparams(autoSize(23), autoSize(23)) {
                                     marginEnd = autoSize(14)
                                 }
-                            }.lparams(0, autoSize(84),1f){
+                            }.lparams(0, autoSize(84), 1f) {
                                 marginEnd = autoSize(32)
                             }
                         }.lparams(matchParent, autoSize(95))
@@ -420,6 +439,10 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                             onThrottleFirstClick {
                                 val selectDataList = arrayListOf(
                                     SelectData(
+                                        id = "0",
+                                        value = "无"
+                                    ),
+                                    SelectData(
                                         id = "1",
                                         value = "套期保值"
                                     ),
@@ -478,13 +501,20 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                         }.lparams(matchParent, autoSize(18))
 
                         linearLayout {
+                            selectBusinessType.bindOptional(context) {
+                                if (it?.id == "0") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
                                 text = "现货订单"
                                 textSizeAuto = 34
                                 textColorInt = R.color.rma_black_33
-                            }.lparams(wrapContent, wrapContent){
+                            }.lparams(wrapContent, wrapContent) {
                                 marginStart = autoSize(32)
                             }
 
@@ -493,13 +523,20 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                             textView {
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_red_color
-                            }.lparams(wrapContent, wrapContent){
+                            }.lparams(wrapContent, wrapContent) {
                                 marginEnd = autoSize(32)
                             }
 
                         }.lparams(matchParent, autoSize(95))
 
                         linearLayout {
+                            selectBusinessType.bindOptional(context) {
+                                if (it?.id == "0") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             background = resources.getDrawable(R.color.white)
                             linearLayout {
                                 backgroundResource = R.drawable.qyfg_search_item_bg
@@ -515,7 +552,7 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                     textColorStr = "#333333"
                                 }.lparams(matchParent, autoSize(80))
 
-                            }.lparams(0, autoSize(80),1f){
+                            }.lparams(0, autoSize(80), 1f) {
                                 marginStart = autoSize(28)
                             }
 
@@ -532,7 +569,7 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                     inputType = EditorInfo.TYPE_CLASS_NUMBER
                                     textColorStr = "#333333"
                                 }.lparams(matchParent, autoSize(80))
-                            }.lparams(0, autoSize(80),1f){
+                            }.lparams(0, autoSize(80), 1f) {
                                 marginStart = autoSize(28)
                                 marginEnd = autoSize(28)
                             }
@@ -550,7 +587,7 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                     inputType = EditorInfo.TYPE_CLASS_NUMBER
                                     textColorStr = "#333333"
                                 }.lparams(matchParent, autoSize(80))
-                            }.lparams(0, autoSize(80),1f){
+                            }.lparams(0, autoSize(80), 1f) {
                                 marginEnd = autoSize(28)
                             }
                         }.lparams(matchParent, autoSize(90))
@@ -560,18 +597,30 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                         }.lparams(matchParent, autoSize(18))
 
                         linearLayout {
+                            selectBusinessType.bindOptional(context) {
+                                if (it?.id == "0") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             background = resources.getDrawable(R.color.white)
                             textView {
                                 onThrottleFirstClick {
-                                    viewModel.querySCMiddleGoods(buyorsell = selectBuyOrSell.value?.id ?: "0",goodsgroupid = selectGoodsGroup.value?.id ?: "",contractno = spot_number_edittext.text.toString(),
-                                        customername = counterparty_edittext.text.toString(),wrstandardname = spot_goods_edittext.text.toString())
+                                    viewModel.querySCMiddleGoods(
+                                        buyorsell = selectBuyOrSell.value?.id ?: "0",
+                                        goodsgroupid = selectGoodsGroup.value?.id ?: "",
+                                        contractno = spot_number_edittext.text.toString(),
+                                        customername = counterparty_edittext.text.toString(),
+                                        wrstandardname = spot_goods_edittext.text.toString()
+                                    )
                                 }
                                 backgroundResource = R.drawable.yrdz_item_click_bg
                                 gravity = Gravity.CENTER
                                 text = "查询"
                                 textSizeAuto = 34
                                 textColorInt = R.color.rma_blue_color
-                            }.lparams(matchParent, autoSize(68)){
+                            }.lparams(matchParent, autoSize(68)) {
                                 marginStart = autoSize(28)
                                 marginEnd = autoSize(28)
                             }
@@ -582,16 +631,23 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                         }.lparams(matchParent, autoSize(18))
 
                         linearLayout {
+                            selectBusinessType.bindOptional(context) {
+                                if (it?.id == "0") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             verticalLayout {
                                 gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
                                 textView {
                                     text = "商品"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_hint_text_color_ccc
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginStart = autoSize(32)
                                 }
-                            }.lparams(0, autoSize(85),1f)
+                            }.lparams(0, autoSize(85), 1f)
 
                             verticalLayout {
                                 gravity = Gravity.CENTER_HORIZONTAL
@@ -599,7 +655,7 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                     text = "应套保数量/"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_hint_text_color_ccc
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
 
                                 }
 
@@ -608,7 +664,7 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_hint_text_color_ccc
                                 }.lparams(wrapContent, wrapContent)
-                            }.lparams(0, autoSize(85),1f)
+                            }.lparams(0, autoSize(85), 1f)
 
                             verticalLayout {
                                 gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
@@ -616,13 +672,20 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                                     text = "本次关联数量(期货)"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_hint_text_color_ccc
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginEnd = autoSize(32)
                                 }
-                            }.lparams(0, autoSize(85),1f)
+                            }.lparams(0, autoSize(85), 1f)
                         }.lparams(matchParent, autoSize(85))
 
                         recyclerView {
+                            selectBusinessType.bindOptional(context) {
+                                if (it?.id == "0") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             background = resources.getDrawable(R.color.segtabment_bg_color)
                             adapter = businessAssociationsAdapter
                         }.lparams(matchParent, matchParent)
@@ -640,6 +703,54 @@ class FillSingleConnectionActivity : BaseActivity<FillSingleConnectionViewModel>
                     textView {
                         onThrottleFirstClick {
 
+                            if (selectAccountData.value?.accountid?.toString().isNullOrEmpty()){
+                                ToastUtils.showLong("请选择账户")
+                                return@onThrottleFirstClick
+                            }
+
+                            if (selectGoods.value?.id.isNullOrEmpty()){
+                                ToastUtils.showLong("请选择期货合约")
+                                return@onThrottleFirstClick
+                            }
+
+                            if (price_edittext.text.toString().isNullOrEmpty()){
+                                ToastUtils.showLong("请输入价格")
+                                return@onThrottleFirstClick
+                            }
+
+                            if (price_edittext.text.toString().toDouble() == 0.0){
+                                ToastUtils.showLong("输入价格不能为零")
+                                return@onThrottleFirstClick
+                            }
+
+                            if (number_edittext.text.toString().isNullOrEmpty()){
+                                ToastUtils.showLong("请输入数量")
+                                return@onThrottleFirstClick
+                            }
+
+                            if (number_edittext.text.toString().toDouble() == 0.0){
+                                ToastUtils.showLong("输入的数量为零")
+                                return@onThrottleFirstClick
+                            }
+
+                            if (selectBusinessType.value?.id != "0") {
+                                if (viewModel.selectSpotData.value?.contractno.isNullOrEmpty()) {
+                                    ToastUtils.showLong("请选择现货仓单")
+                                    return@onThrottleFirstClick
+                                }
+                            }
+
+                            viewModel.manageAmendOrderReq(AccountID = selectAccountData.value?.accountid?.toLong() ?: 0,BuyOrSell = selectBuyOrSell.value?.id?.toInt() ?: 0,
+                                GoodsID = selectGoods.value?.id?.toInt() ?: 0,
+                                ChannelBuildType = selectChannelBuildType.value?.id?.toInt() ?: 0,
+                                TradePrice = price_edittext.text.toString().toDouble(),
+                                TradeQty = number_edittext.text.toString().toLong(),
+                                HedgeFlag = selectBusinessType.value?.id?.toInt() ?: 0,
+                                SpotContractID = viewModel.selectSpotData.value?.spotcontractid?.toLong() ?: 0,
+                                SaleUserID = viewModel.selectSpotData.value?.userid?.toInt() ?: 0){
+                                finish()
+                            }
+
                         }
                         gravity = Gravity.CENTER
                         backgroundResource = R.mipmap.rma_submit_bg

+ 5 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/FillSingleConnectionViewModel.kt

@@ -26,6 +26,9 @@ class FillSingleConnectionViewModel : BaseViewModel(){
     //现货订单列表数据
     val associationsSpotDataList : MutableLiveData<List<SCMiddleGoodsData>> = MutableLiveData()
 
+    //选择现货订单数据
+    val selectSpotData : MutableLiveData<SCMiddleGoodsData> = MutableLiveData()
+
     //缓存的用于提交的现货订单数据
 //    val associationsSpotCashDataList : MutableLiveData<List<SCMiddleGoodsData>> = MutableLiveData()
 
@@ -39,8 +42,10 @@ class FillSingleConnectionViewModel : BaseViewModel(){
             if (it.contractno == contractno){
                 if (it.isClick == 0){
                     newWrStandardFactoryItemDataList.add(it.copy(isClick = 1))
+                    selectSpotData.postValue(it.copy(isClick = 1))
                 }else{
                     newWrStandardFactoryItemDataList.add(it.copy(isClick = 0))
+                    selectSpotData.postValue(SCMiddleGoodsData())
                 }
             }else{
                 newWrStandardFactoryItemDataList.add(it.copy(isClick = 0))

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/PeriodAssociationContentAdapter.java

@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.GlobalDataCollection;
 import cn.muchinfo.rma.global.data.OutTradeLinkData;
 import cn.muchinfo.rma.global.data.PaTradeLinkData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
@@ -122,7 +123,12 @@ public class PeriodAssociationContentAdapter extends RecyclerView.Adapter<Period
             }
         });
 
-        itemViewHolder.associated.setVisibility(View.VISIBLE);
+        if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_link", "client_spots_link_pa", "client_spots_link_pa_link")){
+            itemViewHolder.associated.setVisibility(View.VISIBLE);
+        }else {
+            itemViewHolder.associated.setVisibility(View.GONE);
+        }
+
 
         itemViewHolder.associated.setOnClickListener(view -> {
             Intent intent = new Intent();

+ 4 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/PeriodDocumentsFragment.kt

@@ -48,6 +48,10 @@ class PeriodDocumentsFragment : BaseFragment<PeriodDocumentsViewModel>(),
         if (null != horScrollview) horScrollview.onTouchEvent(event)
     }
 
+    override fun onResume() {
+        super.onResume()
+
+    }
 
     override fun onCreateView(
         inflater: LayoutInflater,

+ 16 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/relationalrecord/RelationalRecordContentAdapter.java

@@ -2,6 +2,7 @@ package cn.muchinfo.rma.view.base.spot.associated.relationalrecord;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
+import android.content.Intent;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
@@ -14,15 +15,19 @@ import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
+import com.blankj.utilcode.util.ActivityUtils;
+
 import java.util.ArrayList;
 import java.util.List;
 
 import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.GlobalDataCollection;
 import cn.muchinfo.rma.global.ViewEnumUtils;
 import cn.muchinfo.rma.global.data.PaTradeLinkData;
 import cn.muchinfo.rma.global.data.PaTradeLinkDetailData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+import cn.muchinfo.rma.view.base.spot.associated.perioddocuments.BusinessAssociationsActivity;
 
 /**
  * 关联记录adapter
@@ -38,8 +43,6 @@ public class RelationalRecordContentAdapter extends RecyclerView.Adapter<Relatio
     public int offestX = 0;
     private OnContentScrollListener onContentScrollListener;
 
-
-
     public interface OnContentScrollListener {
         void onScroll(MotionEvent event);
     }
@@ -48,7 +51,6 @@ public class RelationalRecordContentAdapter extends RecyclerView.Adapter<Relatio
         this.onContentScrollListener = onContentScrollListener;
     }
 
-
     public RelationalRecordContentAdapter(Context context) {
         this.context = context;
     }
@@ -114,8 +116,18 @@ public class RelationalRecordContentAdapter extends RecyclerView.Adapter<Relatio
                 setPosition(i);
             }
         });
+        if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_link", "client_spots_link_logs", "client_spots_link_logs_unlink")) {
+            itemViewHolder.dissociated.setVisibility(View.VISIBLE);
+        }else {
+            itemViewHolder.dissociated.setVisibility(View.GONE);
+        }
 
-
+        itemViewHolder.dissociated.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("data",data);
+            intent.setClass(context, RemoveRelationalRecordActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
 
         itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
             @Override

+ 32 - 19
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemSonViewHolder.kt

@@ -1,6 +1,9 @@
 package cn.muchinfo.rma.view.base.warehousereceipt.viewholder
 
+import android.os.Build
 import android.view.Gravity
+import android.widget.TextView
+import androidx.annotation.RequiresApi
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.WrStandardFactoryItem
@@ -12,37 +15,47 @@ import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
+import org.w3c.dom.Text
 
 //要素子item
 class WrStandardFactoryItemSonViewHolder(private val activity : AppCompatActivity,private val viewModel: WarehouseReceiptViewModel,private val dgfactoryitemtypeid : String) : BaseViewHolder<WrStandardFactoryItem>(activity){
 
-    override val itemSize: IntArray = intArrayOf(autoSize(160), autoSize(72))
+    override val itemSize: IntArray = intArrayOf(autoSize(210), autoSize(80))
 
+    @RequiresApi(Build.VERSION_CODES.O)
     override fun _FrameLayout.createContentView() {
-        linearLayout {
-            onThrottleFirstClick {
-                viewModel.setOnRightItemClick(dgfactoryitemid = data.value?.dgfactoryitemid ?: "",dgfactoryitemtypeid = dgfactoryitemtypeid)
-            }
-            gravity = Gravity.CENTER
-            data.bindOptional(context){
-                if (it?.isSelect == 0){
-                    backgroundResource = R.drawable.rma_item_normal_bg
-                }else{
-                    backgroundResource = R.drawable.rma_item_select_bg
+
+        verticalLayout {
+            linearLayout {
+                onThrottleFirstClick {
+                    viewModel.setOnRightItemClick(dgfactoryitemid = data.value?.dgfactoryitemid ?: "",dgfactoryitemtypeid = dgfactoryitemtypeid)
                 }
-            }
-            textView {
+                gravity = Gravity.CENTER
                 data.bindOptional(context){
-                    text = it?.dgfactoryitemvalue
                     if (it?.isSelect == 0){
-                        textColorInt = R.color.rma_black_33
+                        backgroundResource = R.drawable.rma_item_normal_bg
                     }else{
-                        textColorInt = R.color.rma_blue_color
+                        backgroundResource = R.drawable.rma_item_select_bg
                     }
                 }
-                textSizeAuto = 32
-            }.lparams(wrapContent, wrapContent)
-        }.lparams(autoSize(160), autoSize(72))
+                textView {
+                    gravity = Gravity.CENTER
+                    setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
+                    data.bindOptional(context){
+                        text = it?.dgfactoryitemvalue
+
+                        if (it?.isSelect == 0){
+                            textColorInt = R.color.rma_black_33
+                        }else{
+                            textColorInt = R.color.rma_blue_color
+                        }
+                    }
+                    textSizeAuto = 32
+                }.lparams(autoSize(210), wrapContent)
+            }.lparams(autoSize(210), autoSize(72))
+
+        }.lparams(autoSize(210), autoSize(80))
+
     }
 
 }

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemViewHolder.kt

@@ -45,7 +45,7 @@ class WrStandardFactoryItemViewHolder(private val activity : AppCompatActivity,p
 
             recyclerView {
                 recyclerview = this
-                val staggeredGridLayoutManager = StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)
+                val staggeredGridLayoutManager = StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)
                 layoutManager = staggeredGridLayoutManager
                 background = resources.getDrawable(R.color.white)
             }.lparams(matchParent, wrapContent)

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessHallActivity.kt

@@ -233,6 +233,7 @@ class SwapsBusinessHallActivity : BaseActivity<SwapsBusinessHallViewModel>() {
                 }
 
                 imageView {
+                    visibility = View.GONE
                     onThrottleFirstClick {
                         val intent = Intent()
                         intent.putExtra("data", OrderQuoteData())

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingActivity.kt

@@ -232,7 +232,7 @@ class SwapsDelistingActivity : BaseActivity<SwapsDelistingViewModel>(){
                     gravity = Gravity.CENTER_VERTICAL
                     linearLayout {
                         textView {
-                            text = "买入价格"
+                            text = if (type == "0") { "卖出价格" } else { "买入价格" }
                             textSizeAuto = 34
                             textColorInt = R.color.rma_hint_text_color_ccc
                         }.lparams(wrapContent, wrapContent) {