Переглянути джерело

风险管理11月4日提交代码-liu.bolan- 企业风管6期bug修复

Liu.bolan 4 роки тому
батько
коміт
dea314302e
18 змінених файлів з 1013 додано та 239 видалено
  1. 108 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/common/CommonManager.kt
  2. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt
  3. 105 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsSectionData.kt
  4. 111 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/SpotGroupTradeSumData.kt
  5. 49 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/SpotGroupTradeSumDetailData.kt
  6. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  7. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java
  8. 64 159
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeFragment.kt
  9. 308 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeSonUI.kt
  10. 62 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeViewModel.kt
  11. 35 31
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/IndexViewHolder.kt
  12. 95 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/viewholder/YrdzInformationViewHolder.kt
  13. 0 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/AddInvoiceInformationActivity.kt
  14. 45 37
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/InvoiceInformationViewHolder.kt
  15. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/InvoiceInformationViewModel.kt
  16. 8 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessBuyHallViewHolder.kt
  17. 8 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessSellHallViewHolder.kt
  18. 7 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/listed/SwapsListedActivity.kt

+ 108 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/common/CommonManager.kt

@@ -240,4 +240,112 @@ class CommonManager {
         )
     }
 
+    /**
+     * 查询资讯
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<PendingAuditInfoData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryYrdzSiteColumnDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<SiteColumnDetailData>?, error: Error?) -> Unit
+    ){
+
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/WrTrade2/QuerySiteColumnDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<SiteColumnDetailData>>>(){
+                override fun onResponse(response: BaseResult<List<SiteColumnDetailData>>?, id: Int) {
+                    responseBack(true,response?.data,null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+    /**
+     * 查询指数 (用于云融大宗的首页指数)
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<PendingAuditInfoData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun querySpotGroupTradeSum(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<SpotGroupTradeSumData>?, error: Error?) -> Unit
+    ){
+
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/WrTrade2/QuerySpotGroupTradeSum",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<SpotGroupTradeSumData>>>(){
+                override fun onResponse(response: BaseResult<List<SpotGroupTradeSumData>>?, id: Int) {
+                    responseBack(true,response?.data,null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+    /**
+     * 查询板块(分类)
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<PendingAuditInfoData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryDeliveryGoodsSection(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<DeliveryGoodsSectionData>?, error: Error?) -> Unit
+    ){
+
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryDeliveryGoodsSection",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<DeliveryGoodsSectionData>>>(){
+                override fun onResponse(response: BaseResult<List<DeliveryGoodsSectionData>>?, id: Int) {
+                    responseBack(true,response?.data,null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+
+    /**
+     * 查询指数详细(价格走势图)
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<PendingAuditInfoData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun querySpotGroupTradeSumDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<SpotGroupTradeSumDetailData>?, error: Error?) -> Unit
+    ){
+
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/WrTrade2/QuerySpotGroupTradeSumDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<SpotGroupTradeSumDetailData>>>(){
+                override fun onResponse(response: BaseResult<List<SpotGroupTradeSumDetailData>>?, id: Int) {
+                    responseBack(true,response?.data,null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
 }

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt

@@ -256,11 +256,11 @@ fun String.toShowTime2(format : String = "yyyy-MM-dd HH:mm:ss") : String{
  * @receiver String
  * @return String
  */
-fun String.toShowTime3(format : String = "yyyy-MM-dd") : String{
+fun String.toShowTime3(format : String = "yyyy-MM-dd",timeFormat : String = "yyyy-MM-dd HH:mm:ss") : String{
     if (this.isNullOrEmpty()){
         return "--"
     }
-    val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA)
+    val sdf = SimpleDateFormat(timeFormat, Locale.CHINA)
     val sdf1 = SimpleDateFormat(format, Locale.CHINA)
     var timeString = sdf1.format(sdf.parse(this)!!)
     return timeString

+ 105 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsSectionData.kt

@@ -0,0 +1,105 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 查询板块(分类
+ * @property imagepath String?
+ * @property orderindex String?
+ * @property sectionid String?
+ * @property sectionname String?
+ * @property sectiontype String?
+ * @property dglst List<WrDeliveryGoodsSectionConfig>?
+ * @constructor
+ */
+data class DeliveryGoodsSectionData(
+    @SerializedName("imagepath")
+    val imagepath : String? = "",//图片地址
+    @SerializedName("orderindex")
+    val orderindex : String? = "",//排序
+    @SerializedName("sectionid")
+    val sectionid : String? = "",//版块ID (SEQ_DELIVERYGOODSSECTION) - 自增100开始, 前面ID预留给SectionType = 1的版块1 - 云融指数
+    @SerializedName("sectionname")
+    val sectionname : String? = "",//版块名称
+    @SerializedName("sectiontype")
+    val sectiontype : String? = "",//版块类型 - 1:指数版块 2:普通版块
+    @SerializedName("dglst")
+    val dglst : List<WrDeliveryGoodsSectionConfig>? = arrayListOf()
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createTypedArrayList(WrDeliveryGoodsSectionConfig)
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(imagepath)
+        parcel.writeString(orderindex)
+        parcel.writeString(sectionid)
+        parcel.writeString(sectionname)
+        parcel.writeString(sectiontype)
+        parcel.writeTypedList(dglst)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<DeliveryGoodsSectionData> {
+        override fun createFromParcel(parcel: Parcel): DeliveryGoodsSectionData {
+            return DeliveryGoodsSectionData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<DeliveryGoodsSectionData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+data class WrDeliveryGoodsSectionConfig(
+    @SerializedName("deliverygoodscode")
+    val deliverygoodscode : String? = "",//现货商品代码
+    @SerializedName("deliverygoodsid")
+    val deliverygoodsid : String? = "",//现货品种ID(SEQ_DELIVERYGOODS)
+    @SerializedName("deliverygoodsname")
+    val deliverygoodsname : String? = "",//现货商品名称
+    @SerializedName("orderindex")
+    val orderindex : String? = ""//排序
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(orderindex)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrDeliveryGoodsSectionConfig> {
+        override fun createFromParcel(parcel: Parcel): WrDeliveryGoodsSectionConfig {
+            return WrDeliveryGoodsSectionConfig(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrDeliveryGoodsSectionConfig?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 111 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/SpotGroupTradeSumData.kt

@@ -0,0 +1,111 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 云融大宗的 指数实体模型
+ * @property prereckondate String?
+ * @property reckondate String?
+ * @property lst List<WrSpotGroupTradeSumData>?
+ * @constructor
+ */
+data class SpotGroupTradeSumData(
+    @SerializedName("prereckondate")
+    val prereckondate : String? = "",//上上个交易日(yyymmdd)
+    @SerializedName("reckondate")
+    val reckondate : String? = "",//上个交易日(yyyymmdd)
+    @SerializedName("lst")
+    val lst : List<WrSpotGroupTradeSumData>? = arrayListOf()
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createTypedArrayList(WrSpotGroupTradeSumData)
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(prereckondate)
+        parcel.writeString(reckondate)
+        parcel.writeTypedList(lst)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<SpotGroupTradeSumData> {
+        override fun createFromParcel(parcel: Parcel): SpotGroupTradeSumData {
+            return SpotGroupTradeSumData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<SpotGroupTradeSumData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}
+
+data class WrSpotGroupTradeSumData(
+    @SerializedName("deliverygoodscode")
+    val deliverygoodscode : String? = "",//现货品种代码
+    @SerializedName("deliverygoodsid")
+    val deliverygoodsid : String? = "",//现货品种ID(SEQ_DELIVERYGOODS)
+    @SerializedName("deliverygoodsname")
+    val deliverygoodsname : String? = "",//现货品种名称
+    @SerializedName("lastavgprice")
+    val lastavgprice : String? = "",//上上个交易日价格(前2天价格)
+    @SerializedName("lastreckondate")
+    val lastreckondate : String? = "",//上上个交易日(前2天交易日)
+    @SerializedName("reckondate")
+    val reckondate : String? = "",//上个交易日(前1天交易日)
+    @SerializedName("todayavgprice")
+    val todayavgprice : String? = "",//上个交易日价格(前1天价格)
+    @SerializedName("updown")
+    val updown : String? = "",//涨跌
+    @SerializedName("updownratio")
+    val updownratio : String? = ""//涨幅(已格式化, 直接显示即可)
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(lastavgprice)
+        parcel.writeString(lastreckondate)
+        parcel.writeString(reckondate)
+        parcel.writeString(todayavgprice)
+        parcel.writeString(updown)
+        parcel.writeString(updownratio)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrSpotGroupTradeSumData> {
+        override fun createFromParcel(parcel: Parcel): WrSpotGroupTradeSumData {
+            return WrSpotGroupTradeSumData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrSpotGroupTradeSumData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 49 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/SpotGroupTradeSumDetailData.kt

@@ -0,0 +1,49 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 指数详细(价格走势图)
+ * @property deliverygoodsid String?
+ * @property price String?
+ * @property reckondate String?
+ * @constructor
+ */
+data class SpotGroupTradeSumDetailData(
+    @SerializedName("deliverygoodsid")
+    val deliverygoodsid : String? = "",//现货商品id
+    @SerializedName("price")
+    val price : String? = "",//价格
+    @SerializedName("reckondate")
+    val reckondate : String? = ""//日期(yyymmdd, 如:20211031)
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(price)
+        parcel.writeString(reckondate)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<SpotGroupTradeSumDetailData> {
+        override fun createFromParcel(parcel: Parcel): SpotGroupTradeSumDetailData {
+            return SpotGroupTradeSumDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<SpotGroupTradeSumDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -15,9 +15,10 @@ 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.203:8080/cfg?key=test_203"//李倩云融 18611112222
+//    const val baseurl = "http://192.168.31.203:8080/cfg?key=test_203"//李倩云融 18611112222
 //
 //    const val baseurl = "http://192.168.31.204:8080/cfg?key=test_204"// 瑶姐 云融 190000000001 123456
+    const val baseurl = "http://192.168.31.205:8080/cfg?key=test_205"// 瑶姐 云融 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"

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

@@ -179,8 +179,8 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
                 rightData.add("--");
             }
 
-            //占用保证金
-            rightData.add(NumberUtils.roundNum(data.getUsedmargin(), 2));
+            //占用保证金 刚加上不到半个月的字段就要去掉了(2021年11月4号)
+//            rightData.add(NumberUtils.roundNum(data.getUsedmargin(), 2));
             //计算成本价
             double closePrice = (Double.parseDouble(data.getAverageprice()));
             //计算出成本价和现价的价差

+ 64 - 159
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeFragment.kt

@@ -18,9 +18,11 @@ import androidx.annotation.Nullable
 import androidx.cardview.widget.CardView
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentPagerAdapter
+import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.bingoogolapple.bgabanner.BGABanner
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.BannerData
 import cn.muchinfo.rma.global.data.NoticeData
 import cn.muchinfo.rma.global.toShowTime3
@@ -34,6 +36,10 @@ import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.hnstmain.bookingwarehouse.BookingWarehouseActivity
 import cn.muchinfo.rma.view.base.hnstmain.performance.PerformanceInformationActivity
 import cn.muchinfo.rma.view.base.hnstmain.performancetemplate.PerformanceTemplateActivity
+import cn.muchinfo.rma.view.base.home.MessageUI
+import cn.muchinfo.rma.view.base.home.NewAnnouncementUI
+import cn.muchinfo.rma.view.base.home.NewInformationUI
+import cn.muchinfo.rma.view.base.home.NewResearchReportUI
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.reference.ReferenceActivity
 import cn.muchinfo.rma.view.base.home.set.SettingActivity
@@ -70,68 +76,79 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
     lateinit var segment1: QMUITabSegment
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
+    lateinit var noticeViewFlipper : ViewFlipper
 
+    private val yrdzIndexUI : YrdzIndexUI by lazy { YrdzIndexUI(this,viewModel) }
 
-    //viewpager的适配器
-    private var newPagerAdapter: FragmentPagerAdapter? = null
+    private val yrAnnouncementUI: YrAnnouncementUI by lazy {
+        YrAnnouncementUI(
+            this,
+            viewModel
+        )
+    }//公告
 
-    //tabSegment标题
-    private val newTabsArray: ArrayList<String> = arrayListOf()
+    private val yrdzInformationUI: YrdzInformationUI by lazy {
+        YrdzInformationUI(
+            this,
+            viewModel
+        )
+    }//咨讯
+    private val yrMessageUI: YrMessageUI by lazy {
+        YrMessageUI(
+            this,
+            viewModel
+        )
+    }//消息
 
-    //viewpager绑定的页面集合
-    private val newTabFragment: ArrayList<Fragment> = arrayListOf()
 
-    lateinit var noticeViewFlipper : ViewFlipper
 
-    val indexAdapter: BaseAdapter<IndexData, IndexViewHolder> =
-        BaseAdapter { _, _ ->
-            IndexViewHolder(
-                this
-            )
-        }
+    //viewpager的适配器
+    private var pagerAdapter : PagerAdapter? = null
 
-    fun initMenuData() {
-        newTabsArray.add("通用塑料")
-        newTabFragment.add(YrdzMarketFragment.getInstance("通用塑料"))
+    //tabSegment标题
+    private val tabsArray : ArrayList<String> = arrayListOf()
 
-        newTabsArray.add("工程塑料")
-        newTabFragment.add(YrdzMarketFragment.getInstance("工程塑料"))
+    //暂存的页面组
+    private val uiMessageList : ArrayList<_FrameLayout> = arrayListOf()
 
-        newTabsArray.add("特种工程塑料")
-        newTabFragment.add(YrdzMarketFragment.getInstance("特种工程塑料"))
 
-        newTabsArray.add("合金塑料")
-        newTabFragment.add(YrdzMarketFragment.getInstance("合金塑料"))
 
-        newTabsArray.add("热塑弹性体")
-        newTabFragment.add(YrdzMarketFragment.getInstance("热塑弹性体"))
+    fun initMessageMenuData(){
+        tabsArray.add("资讯")
+        uiMessageList.add(yrdzInformationUI.root)
+        tabsArray.add("公告")
+        uiMessageList.add(yrAnnouncementUI.root)
+        tabsArray.add("消息")
+        uiMessageList.add(yrMessageUI.root)
+        tabsArray.add("消息")
+        uiMessageList.add(yrdzIndexUI.root)
 
-        newTabsArray.add("降解塑料")
-        newTabFragment.add(YrdzMarketFragment.getInstance("降解塑料"))
+        pagerAdapter = object : PagerAdapter() {
 
-        newTabsArray.add("热固性塑料")
-        newTabFragment.add(YrdzMarketFragment.getInstance("降解塑料"))
+            override fun getPageTitle(position: Int): CharSequence? = tabsArray[position]
 
-        newPagerAdapter = object : FragmentPagerAdapter(
-            getAppCompatActivity().supportFragmentManager,
-            BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
-        ) {
-            @NonNull
-            override fun getItem(position: Int): Fragment {
-                return newTabFragment[position]
+            override fun instantiateItem(container: ViewGroup, position: Int): Any {
+                return uiMessageList.get(position).apply {
+                    container.addView(
+                        this,
+                        ViewGroup.LayoutParams(matchParent, matchParent)
+                    )
+                }
             }
 
-            override fun getCount(): Int {
-                return newTabFragment.size
+            override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
+                (`object` as? View)?.let { container.removeView(it) }
             }
 
-            @Nullable
-            override fun getPageTitle(position: Int): CharSequence? {
-                return newTabsArray[position]
-            }
+            override fun isViewFromObject(view: View, `object`: Any): Boolean = view == `object`
+
+            override fun getCount(): Int = tabsArray.size
+
         }
+
     }
 
+
     private fun initViewFlipper(notice: List<NoticeData>) {
         for (i in 0 until notice.size) {
             val view = TextView(context)
@@ -172,7 +189,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
         savedInstanceState: Bundle?
     ): View? {
         return UI {
-            initMenuData()
+            initMessageMenuData()
             viewModel.getBanner()
             viewModel.setDataList()
             viewModel.queryNotice()
@@ -194,6 +211,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
                     }
 
                     imageView {
+                        visibility = View.GONE
                         onThrottleFirstClick {
                             val intent = Intent()
                             intent.setClass(context, YrdzNoticeActivity::class.java)
@@ -275,6 +293,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
                             itemView()
 
                             linearLayout {
+                                visibility = View.GONE
                                 gravity = Gravity.CENTER_VERTICAL
                                 imageView {
                                     imageResource = R.mipmap.yrdz_nctice_icon
@@ -480,7 +499,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
                                         selectedTabIndex = index
                                     }
                                 })
-                                mode = QMUITabSegment.MODE_SCROLLABLE
+                                mode = QMUITabSegment.MODE_FIXED
                                 setIndicator(
                                     QMUITabIndicator(
                                         QMUIDisplayHelper.dp2px(context, 2),
@@ -502,127 +521,13 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
                                 marginEnd = autoSize(32)
                             }
                             viewPager {
-                                id = R.id.view_pager
                                 background = resources.getDrawable(R.color.white)
                                 viewPager = this
-                                adapter = newPagerAdapter
-                            }.lparams(matchParent, autoSize(150))
+                                adapter = pagerAdapter
+                            }.lparams(matchParent, autoSize(800))
 
                             segment.setupWithViewPager(viewPager)
                             segment.selectTab(selectedTabIndex)
-
-
-
-                            linearLayout {
-                                gravity = Gravity.CENTER_VERTICAL
-
-                                view {
-                                    background = resources.getDrawable(R.color.rma_blue_color)
-                                }.lparams(autoSize(12), autoSize(43))
-
-                                textView {
-                                    text = "云融指数"
-                                    textSizeAuto = 34
-                                    textColorInt = R.color.rma_black_33
-                                    typeface = Typeface.defaultFromStyle(Typeface.BOLD)
-                                }.lparams(wrapContent, wrapContent) {
-                                    marginStart = autoSize(36)
-                                }
-
-                                emptyView()
-
-                                imageView {
-                                    imageResource = R.mipmap.yrdz_chart_icon
-                                }.lparams(autoSize(36), autoSize(36)) {
-                                    marginEnd = autoSize(36)
-                                }
-                            }.lparams(matchParent, autoSize(80))
-
-                            frameLayout {
-                                verticalLayout {
-                                    linearLayout {
-                                        linearLayout {
-
-                                        }.lparams(0, autoSize(70), 1f)
-
-                                        linearLayout {
-                                            gravity = Gravity.CENTER
-                                            textView {
-                                                text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400))
-                                                    ?.toShowTime3("dd") + "日"
-                                                textSizeAuto = 29
-                                                textColorInt = R.color.hint_text_color
-                                            }.lparams(wrapContent, wrapContent)
-                                        }.lparams(0, autoSize(70), 1f)
-
-                                        linearLayout {
-                                            gravity = Gravity.CENTER
-                                            textView {
-                                                text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(172800))
-                                                    ?.toShowTime3("dd") + "日"
-                                                textSizeAuto = 29
-                                                textColorInt = R.color.hint_text_color
-                                            }.lparams(wrapContent, wrapContent)
-                                        }.lparams(0, autoSize(70), 1f)
-
-                                        linearLayout {
-                                            gravity = Gravity.CENTER
-                                            textView {
-                                                text = "涨跌"
-                                                textSizeAuto = 29
-                                                textColorInt = R.color.hint_text_color
-                                            }.lparams(wrapContent, wrapContent)
-                                        }.lparams(0, autoSize(70), 1f)
-
-                                        linearLayout {
-                                            gravity = Gravity.CENTER
-                                            textView {
-                                                text = "涨幅"
-                                                textSizeAuto = 29
-                                                textColorInt = R.color.hint_text_color
-                                            }.lparams(wrapContent, wrapContent)
-                                        }.lparams(0, autoSize(70), 1f)
-                                    }.lparams(matchParent, autoSize(70))
-
-                                    statusLayout(contentBlock = {
-                                        statusLayout = this
-//                bindTaskStatus(viewModule.status)
-                                        setRetryAction {
-
-                                        }
-                                        swipeToLoadLayout {
-                                            swipeToLayout = this
-                                            setEnableRefresh(false)
-                                            setEnableLoadMore(false)
-                                            setOnRefreshListener {
-
-                                            }
-                                            setEnableScrollContentWhenLoaded(false)
-                                            setEnableLoadMoreWhenContentNotFull(false)
-
-                                            // 未提交列表
-                                            recyclerView {
-                                                background = resources.getDrawable(R.color.white)
-                                                adapter = indexAdapter
-                                            }.lparams(matchParent, matchParent)
-                                        }
-                                    }, emptyBlock = {
-                                        emptyView(hint = resources.getString(R.string.now_no_data))
-                                    }).lparams(matchParent, matchParent)
-
-                                    viewModel.dataList.bindOptional(context) {
-                                        if (it?.isEmpty() == true || it?.size == 0) {
-                                            statusLayout.showEmpty()
-                                        } else {
-                                            if (swipeToLayout.getIsRefreshing()) {
-                                                swipeToLayout.finishRefresh()
-                                            }
-                                            statusLayout.showSuccess()
-                                            indexAdapter.setNewData(it)
-                                        }
-                                    }
-                                }
-                            }
                         }
                     }.lparams(matchParent, matchParent)
 

+ 308 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeSonUI.kt

@@ -0,0 +1,308 @@
+package cn.muchinfo.rma.view.base.home.yrdz
+
+import android.annotation.SuppressLint
+import android.view.Gravity
+import androidx.fragment.app.Fragment
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.global.data.SiteColumnDetailData
+import cn.muchinfo.rma.global.data.WrSpotGroupTradeSumData
+import cn.muchinfo.rma.global.toShowTime3
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.lifecycle.getAppCompatActivity
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.home.AnnouncementViewHolder
+import cn.muchinfo.rma.view.base.home.HomeViewModel
+import cn.muchinfo.rma.view.base.home.yrdz.market.IndexData
+import cn.muchinfo.rma.view.base.home.yrdz.market.IndexViewHolder
+import cn.muchinfo.rma.view.base.home.yrdz.viewholder.YrdzInformationViewHolder
+import cn.muchinfo.rma.view.base.qhjhome.QhjInformationViewHolder
+import com.blankj.utilcode.util.TimeUtils
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import org.jetbrains.anko.*
+
+/**
+ * 咨讯
+ */
+
+class YrdzInformationUI(
+    private val baseFragment: Fragment,
+    private val viewModule: YrdzHomeViewModel
+) {
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    private val informationAdapter: BaseAdapter<SiteColumnDetailData, YrdzInformationViewHolder> =
+        BaseAdapter { _, _ -> YrdzInformationViewHolder(baseFragment, viewModule) }
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            viewModule.querySiteColumnDetail()
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = informationAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.SiteColumnDetailList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    informationAdapter.setNewData(it)
+                }
+            }
+        }
+    }
+}
+
+
+/**
+ * 公告
+ */
+class YrAnnouncementUI(
+    private val baseFragment: Fragment,
+    private val viewModule: YrdzHomeViewModel
+) {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    private val announcementAdapter: BaseAdapter<NoticeData, AnnouncementViewHolder> =
+        BaseAdapter { _, _ -> AnnouncementViewHolder(baseFragment.getAppCompatActivity()) }
+
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            viewModule.queryNotice()
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = announcementAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.noticeDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    announcementAdapter.setNewData(it)
+                }
+
+            }
+        }
+    }
+}
+
+/**
+ * 消息
+ */
+class YrMessageUI(
+    private val baseFragment: Fragment,
+    private val viewModule: YrdzHomeViewModel
+) {
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    private val announcementAdapter: BaseAdapter<NoticeData, AnnouncementViewHolder> =
+        BaseAdapter { _, _ -> AnnouncementViewHolder(baseFragment.getAppCompatActivity()) }
+
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            viewModule.queryMessage()
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = announcementAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.messageDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    announcementAdapter.setNewData(it)
+                }
+
+            }
+        }
+    }
+}
+
+/**
+ * 指数
+ * @property baseFragment Fragment
+ * @property viewModule YrdzHomeViewModel
+ * @property swipeToLayout SwipeToLoadLayout
+ * @property statusLayout StatusLayout
+ * @property recyclerView RecyclerView
+ * @property indexAdapter BaseAdapter<WrSpotGroupTradeSumData, IndexViewHolder>
+ * @property root _FrameLayout
+ * @constructor
+ */
+class YrdzIndexUI(
+    private val baseFragment: Fragment,
+    private val viewModule: YrdzHomeViewModel
+) {
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    val indexAdapter: BaseAdapter<WrSpotGroupTradeSumData, IndexViewHolder> =
+        BaseAdapter { _, _ ->
+            IndexViewHolder(
+                baseFragment
+            )
+        }
+
+    @SuppressLint("SetTextI18n")
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            viewModule.querySpotGroupTradeSum()
+
+            linearLayout {
+                linearLayout {
+                    imageView {
+                        imageResource = R.mipmap.yrdz_chart_icon
+                    }.lparams(autoSize(43), autoSize(43)){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(70), 1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        viewModule.spotGroupTradeSumDataList.bindOptional(context){
+                            text = it?.prereckondate?.toShowTime3("dd","yyyyMMdd") + "日"
+                        }
+                        textSizeAuto = 29
+                        textColorInt = R.color.hint_text_color
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(70), 1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        viewModule.spotGroupTradeSumDataList.bindOptional(context){
+                            text = it?.reckondate?.toShowTime3("dd","yyyyMMdd") + "日"
+                        }
+                        text
+                        textSizeAuto = 29
+                        textColorInt = R.color.hint_text_color
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(70), 1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "涨跌"
+                        textSizeAuto = 29
+                        textColorInt = R.color.hint_text_color
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(70), 1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "涨幅"
+                        textSizeAuto = 29
+                        textColorInt = R.color.hint_text_color
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(70), 1f)
+            }.lparams(matchParent, autoSize(70))
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = indexAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.spotGroupTradeSumDataList.bindOptional(context) {
+                if (it?.lst?.isEmpty() == true || it?.lst?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    indexAdapter.setNewData(it?.lst)
+                }
+
+            }
+        }
+    }
+}

+ 62 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeViewModel.kt

@@ -4,6 +4,8 @@ import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.BannerData
 import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.global.data.SiteColumnDetailData
+import cn.muchinfo.rma.global.data.SpotGroupTradeSumData
 import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
 import cn.muchinfo.rma.view.MyApplication
@@ -37,6 +39,66 @@ class YrdzHomeViewModel : BaseViewModel(){
      */
     val noticeDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
 
+    /**
+     * 咨询信息
+     */
+    val SiteColumnDetailList : MutableLiveData<List<SiteColumnDetailData>> = MutableLiveData()
+
+    /**
+     * 首页消息
+     */
+    val messageDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
+
+    /**
+     * 指数数据
+     */
+    val spotGroupTradeSumDataList : MutableLiveData<SpotGroupTradeSumData> = MutableLiveData()
+
+    /**
+     * 查询指数数据
+     */
+    fun querySpotGroupTradeSum(){
+        val params = mutableMapOf<String, String>()
+        MyApplication.getInstance()?.commonManager?.querySpotGroupTradeSum(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData?.size ?: 0 > 0){
+                    spotGroupTradeSumDataList.postValue(respData?.get(0))
+                }
+            }
+        }
+    }
+
+    /**
+     * 通知公告查询
+     */
+    fun queryMessage(){
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+            put("msgType","2")
+        }
+
+        MyApplication.getInstance()?.commonManager?.queryNotice(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                messageDataList.postValue(respData)
+            }
+        }
+    }
+
+
+    /**
+     * 查询咨询
+     */
+    fun querySiteColumnDetail(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commonManager?.queryYrdzSiteColumnDetail(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                SiteColumnDetailList.postValue(respData)
+            }
+        }
+    }
+
     fun setDataList(){
         val list = arrayListOf(
             IndexData(name = "ABS",firstNumber = 18234.0,secondNumber = 18673.0),

+ 35 - 31
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/IndexViewHolder.kt

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
 import android.view.Gravity
 import androidx.fragment.app.Fragment
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrSpotGroupTradeSumData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
@@ -13,7 +14,7 @@ import cn.muchinfo.rma.view.base.future.trade.itemView
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
-class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<IndexData>(fragment.context!!){
+class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<WrSpotGroupTradeSumData>(fragment.context!!){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     @SuppressLint("SetTextI18n")
@@ -26,7 +27,7 @@ class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<IndexDat
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
                     textView {
                         data.bindOptional(context){
-                            text = it?.name
+                            text = it?.deliverygoodsname
                         }
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
@@ -40,7 +41,7 @@ class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<IndexDat
                     gravity = Gravity.CENTER
                     textView {
                         data.bindOptional(context){
-                            text = it?.firstNumber?.toString()
+                            text = it?.lastavgprice
                         }
                         textSizeAuto = 31
                         textColorInt = R.color.rma_black_33
@@ -48,21 +49,22 @@ class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<IndexDat
 
                 }.lparams(0, autoSize(80),1f)
 
-                //昨天军舰
+                //昨天均价
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
                         data.bindOptional(context){
-                            text = it?.secondNumber?.toString()
-                            val difference = it?.secondNumber?.minus(it.firstNumber)
-                            if (difference ?: 0.0 > 0){
-                                textColorInt = R.color.rma_red_color
-                            }else if (difference ?: 0.0 < 0){
-                                textColorInt = R.color.rma_green_color
-                            }else{
-                                textColorInt = R.color.rma_black_33
-                            }
+                            text = it?.todayavgprice?.toString()
+//                            val difference = it?.todayavgprice?.toDouble()?.minus(it.lastavgprice?.toDouble() ?: 0.0)
+//                            if (difference ?: 0.0 > 0){
+//                                textColorInt = R.color.rma_red_color
+//                            }else if (difference ?: 0.0 < 0){
+//                                textColorInt = R.color.rma_green_color
+//                            }else{
+//                                textColorInt = R.color.rma_black_33
+//                            }
                         }
+                        textColorInt = R.color.rma_red_color
                         textSizeAuto = 31
                     }.lparams(wrapContent, wrapContent)
                 }.lparams(0, autoSize(80),1f)
@@ -72,15 +74,16 @@ class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<IndexDat
                     gravity = Gravity.CENTER
                     textView {
                         data.bindOptional(context){
-                            val difference = it?.secondNumber?.minus(it.firstNumber)
-                            if (difference ?: 0.0 > 0){
-                                textColorInt = R.color.rma_red_color
-                            }else if (difference ?: 0.0 < 0){
-                                textColorInt = R.color.rma_green_color
-                            }else{
-                                textColorInt = R.color.rma_black_33
-                            }
-                            text = NumberUtils.roundNum(difference ?: 0.0,2)
+//                            val difference = it?.todayavgprice?.toDouble()?.minus(it.lastavgprice?.toDouble() ?: 0.0)
+//                            if (difference ?: 0.0 > 0){
+//                                textColorInt = R.color.rma_red_color
+//                            }else if (difference ?: 0.0 < 0){
+//                                textColorInt = R.color.rma_green_color
+//                            }else{
+//                                textColorInt = R.color.rma_black_33
+//                            }
+                            textColorInt = R.color.rma_red_color
+                            text = NumberUtils.roundNum(it?.updown,2)
                         }
                         textSizeAuto = 31
                     }.lparams(wrapContent, wrapContent)
@@ -91,15 +94,16 @@ class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<IndexDat
                     gravity = Gravity.CENTER
                     textView {
                         data.bindOptional(context){
-                            val difference = it?.secondNumber?.minus(it.firstNumber)
-                            if (difference ?: 0.0 > 0){
-                                textColorInt = R.color.rma_red_color
-                            }else if (difference ?: 0.0 < 0){
-                                textColorInt = R.color.rma_green_color
-                            }else{
-                                textColorInt = R.color.rma_black_33
-                            }
-                            text = NumberUtils.roundNum(difference?.div(it.firstNumber) ?: 0.0,2) + "%"
+//                            val difference = it?.todayavgprice?.toDouble()?.minus(it.lastavgprice?.toDouble() ?: 0.0)
+//                            if (difference ?: 0.0 > 0){
+//                                textColorInt = R.color.rma_red_color
+//                            }else if (difference ?: 0.0 < 0){
+//                                textColorInt = R.color.rma_green_color
+//                            }else{
+//                                textColorInt = R.color.rma_black_33
+//                            }
+                            textColorInt = R.color.rma_red_color
+                            text = it?.updownratio
                         }
                         textSizeAuto = 31
                     }.lparams(wrapContent, wrapContent)

+ 95 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/viewholder/YrdzInformationViewHolder.kt

@@ -0,0 +1,95 @@
+package cn.muchinfo.rma.view.base.home.yrdz.viewholder
+
+import android.content.Intent
+import android.graphics.Typeface
+import android.text.TextUtils
+import android.view.Gravity
+import android.view.View
+import androidx.fragment.app.Fragment
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.global.data.SiteColumnDetailData
+import cn.muchinfo.rma.global.toShowTime
+import cn.muchinfo.rma.global.toShowTime3
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.base.home.HomeViewModel
+import cn.muchinfo.rma.view.base.home.InformationDetailsActivity
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
+import cn.muchinfo.rma.view.base.home.yrdz.YrdzHomeViewModel
+import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.SPUtils
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import mtp.polymer.com.information_management.hnstocks.message.MessageDetailsActivity
+import org.jetbrains.anko.*
+
+class YrdzInformationViewHolder(
+    private val baseFragment: Fragment,
+    private val viewModel: YrdzHomeViewModel
+) : BaseViewHolder<SiteColumnDetailData>(baseFragment.context!!) {
+    override val itemSize: IntArray = intArrayOf(matchParent, autoSize(161))
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+
+            onThrottleFirstClick {
+                val intent = Intent()
+                intent.putExtra("data",data.value)
+                intent.setClass(context, InformationDetailsActivity::class.java)
+                ActivityUtils.startActivity(intent)
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                verticalLayout {
+                    textView {
+                        maxLines = 2
+                        ellipsize = TextUtils.TruncateAt.END
+                        data.bindOptional(context){
+                            text = it?.title
+                        }
+                        textSizeAuto = 29
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        marginEnd = autoSize(20)
+                        marginStart = autoSize(36)
+                        topMargin = autoSize(20)
+                    }
+
+                    verticalEmptyView()
+
+                    textView {
+                        data.bindOptional(context){
+                            text = it?.publishdate?.toShowTime3("MM-dd")
+                        }
+                        textSizeAuto = 24
+                        textColorInt = R.color.rma_gray_color
+                    }.lparams(wrapContent, wrapContent){
+                        bottomMargin = autoSize(20)
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(160),1f)
+
+                imageView {
+                    data.bindOptional(context){
+                        if (it?.coverimage.isNullOrEmpty()){
+                            imageResource = R.mipmap.yrdz_banner_placeholder
+                        }else{
+                            showImage(SPUtils.getInstance().getString(Constant.uploadUrl).replace("/upload","") + it?.coverimage?.substring(1))
+                        }
+
+                    }
+                }.lparams(autoSize(200), autoSize(140)){
+                    marginEnd = autoSize(20)
+                }
+
+            }.lparams(matchParent, autoSize(160))
+
+            view {
+                background = resources.getDrawable(R.color.main_hit_bg_color)
+            }.lparams(matchParent, autoSize(1))
+        }.lparams(matchParent, autoSize(161))
+    }
+
+}

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

@@ -103,7 +103,6 @@ class AddInvoiceInformationActivity : BaseActivity<InvoiceInformationViewModel>(
                             selectInvoiceType.postValue(this)
                         }
                     }
-
                 }
                 linearLayout {
                     gravity = Gravity.CENTER_VERTICAL

+ 45 - 37
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/InvoiceInformationViewHolder.kt

@@ -52,7 +52,13 @@ class InvoiceInformationViewHolder(
                         backgroundDrawable = createRoundRectDrawable("#828E95", 20)
                         gravity = Gravity.CENTER
                         textView {
-                            text = "企业"
+                            data.bindOptional(context){
+                                if (it?.receipttype == "1"){//发票类型 - 1:个人 2:企业
+                                    text = "个人"
+                                }else{
+                                    text = "企业"
+                                }
+                            }
                             textSizeAuto = 25
                             textColorInt = R.color.white
                         }.lparams(wrapContent, wrapContent)
@@ -73,13 +79,15 @@ class InvoiceInformationViewHolder(
                     emptyView()
 
                     linearLayout {
-                        data.bindOptional(context){
-                            if (it?.isdefault == "0"){
-                                visibility = View.GONE
-                            }else{
-                                visibility = View.VISIBLE
-                            }// 0:否 1:是
-                        }
+
+                        visibility = View.GONE
+//                        data.bindOptional(context){
+//                            if (it?.isdefault == "0"){
+//                                visibility = View.GONE
+//                            }else{
+//                                visibility = View.VISIBLE
+//                            }// 0:否 1:是
+//                        }
                         backgroundDrawable = createRoundRectDrawable("#FFE8D3", 20)
                         gravity = Gravity.CENTER
                         textView {
@@ -92,13 +100,14 @@ class InvoiceInformationViewHolder(
                     }
 
                     textView {
-                        data.bindOptional(context){
-                            if (it?.isdefault == "0"){
-                                visibility = View.VISIBLE
-                            }else{
-                                visibility = View.GONE
-                            }// 0:否 1:是
-                        }
+                        visibility = View.GONE
+//                        data.bindOptional(context){
+//                            if (it?.isdefault == "0"){
+//                                visibility = View.VISIBLE
+//                            }else{
+//                                visibility = View.GONE
+//                            }// 0:否 1:是
+//                        }
                         onThrottleFirstClick {
                             activity.createWarningDialog {
                                 setTitle("温馨提示")
@@ -173,13 +182,14 @@ class InvoiceInformationViewHolder(
                 emptyView()
 
                 linearLayout {
-                    data.bindOptional(context){
-                        if (it?.isdefault == "0"){
-                            visibility = View.GONE
-                        }else{
-                            visibility = View.VISIBLE
-                        }// 0:否 1:是
-                    }
+                    visibility = View.GONE
+//                    data.bindOptional(context){
+//                        if (it?.isdefault == "0"){
+//                            visibility = View.GONE
+//                        }else{
+//                            visibility = View.VISIBLE
+//                        }// 0:否 1:是
+//                    }
                     backgroundDrawable = createRoundRectDrawable("#FFE8D3", 20)
                     gravity = Gravity.CENTER
                     textView {
@@ -192,13 +202,15 @@ class InvoiceInformationViewHolder(
                 }
 
                 textView {
-                    data.bindOptional(context){
-                        if (it?.isdefault == "0"){
-                            visibility = View.VISIBLE
-                        }else{
-                            visibility = View.GONE
-                        }// 0:否 1:是
-                    }
+
+                    visibility = View.GONE
+//                    data.bindOptional(context){
+//                        if (it?.isdefault == "0"){
+//                            visibility = View.VISIBLE
+//                        }else{
+//                            visibility = View.GONE
+//                        }// 0:否 1:是
+//                    }
                     onThrottleFirstClick {
                         activity.createWarningDialog {
                             setTitle("温馨提示")
@@ -242,7 +254,7 @@ class InvoiceInformationViewHolder(
                         val intent = Intent()
                         intent.putExtra("type","2")
                         intent.putExtra("data",data.value)
-                        intent.setClass(context, AddSpotMarketPriceActivity::class.java)
+                        intent.setClass(context, AddInvoiceInformationActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
@@ -255,12 +267,6 @@ class InvoiceInformationViewHolder(
                 }
 
                 textView {
-                    visibility = View.GONE //任务 #95309
-//                    if (GlobalDataCollection.instance?.getSecondLevelMenu(firstCode = "client_spotmarketprice",secondCode = "client_spotmarketprice_delete") == true){
-//                        visibility = View.VISIBLE
-//                    }else{
-//                        visibility = View.GONE
-//                    }
                     onThrottleFirstClick {
                         activity.createWarningDialog {
                             setTitle("温馨提示")
@@ -269,8 +275,10 @@ class InvoiceInformationViewHolder(
                                 dialog.dismiss()
                             }
                             addAction("确定") { dialog, _ ->
+                                viewModel.delUserReceiptInfoReq(ReceiptInfoId = data.value?.autoid?.toLong() ?: 0){
+                                    viewModel.queryWrUserReceiptInfo()
+                                }
                                 dialog.dismiss()
-
                             }
                         }.show()
 

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

@@ -57,6 +57,8 @@ class InvoiceInformationViewModel : BaseViewModel() {
         }
     }
 
+
+
     /**
      * 新增修改用户发票信息请求
      */

+ 8 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessBuyHallViewHolder.kt

@@ -54,12 +54,17 @@ class SwapsBusinessBuyHallViewHolder(private val activity : AppCompatActivity, p
                     gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT
                     textView {
                         data.bindOptional(context){
-                            if (viewModel.quoteDayData.value?.getPrice() == 0.0){
-                                text = NumberUtils.roundNum(it?.orderprice?.toDouble()?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                            if (it?.pricemode == "3"){
+                                if (viewModel.quoteDayData.value?.getPrice() == 0.0){
+                                    text = NumberUtils.roundNum(it?.orderprice?.toDouble()?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                }else{
+                                    text = NumberUtils.roundNum(viewModel.quoteDayData.value?.getPrice()?.plus(it?.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                }
                             }else{
-                                text = NumberUtils.roundNum(viewModel.quoteDayData.value?.getPrice()?.plus(it?.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                text = NumberUtils.roundNum(it?.orderprice,2)
                             }
 
+
                         }
                         viewModel.quoteDayData.bindOptional(context){
                             if (data.value?.goodsid.isNullOrEmpty().not()){

+ 8 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessSellHallViewHolder.kt

@@ -58,12 +58,17 @@ class SwapsBusinessSellHallViewHolder(private val activity : AppCompatActivity,
                      gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT
                      textView {
                          data.bindOptional(context){
-                             if (viewModel.quoteDayData.value?.getPrice() == 0.0){
-                                 text = NumberUtils.roundNum(it?.orderprice?.toDouble()?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                             if (it?.pricemode == "3"){
+                                 if (viewModel.quoteDayData.value?.getPrice() == 0.0){
+                                     text = NumberUtils.roundNum(it.orderprice?.toDouble()?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                 }else{
+                                     text = NumberUtils.roundNum(viewModel.quoteDayData.value?.getPrice()?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                 }
                              }else{
-                                 text = NumberUtils.roundNum(viewModel.quoteDayData.value?.getPrice()?.plus(it?.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                 text = NumberUtils.roundNum(it?.orderprice,2)
                              }
 
+
                          }
                          viewModel.quoteDayData.bindOptional(context){
                              if (data.value?.goodsid.isNullOrEmpty().not()){

+ 7 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/listed/SwapsListedActivity.kt

@@ -682,6 +682,13 @@ class SellListedUI(
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
                     onThrottleFirstClick {
+                        if (priceType.value == 2){//浮动价挂牌
+                            if (basis_price_input.text.toString().isNullOrEmpty()){
+                                ToastUtils.showLong("请输入点差")
+                                return@onThrottleFirstClick
+                            }
+                        }
+
                         if (onePriceInputEdittext.text.toString()
                                 .isNullOrEmpty() || onePriceInputEdittext.text.toString()
                                 .toDouble() == 0.0