Pārlūkot izejas kodu

风险管理12月3日提交代码-liu.bolan-天津麦顿bug

Liu.bolan 4 gadi atpakaļ
vecāks
revīzija
b6dff9a280

+ 2 - 2
RMA/app/build.gradle

@@ -19,8 +19,8 @@ android {
         applicationId "cn.muchinfo.rma"
         minSdkVersion 24
         targetSdkVersion 30
-        versionCode 50040
-        versionName "5.0.40"
+        versionCode 50042
+        versionName "5.0.42"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         //指定room.schemaLocation生成的文件路径

+ 0 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/financial/FinancialManager.kt

@@ -1,6 +1,5 @@
 package cn.muchinfo.rma.business.financial
 
-import cn.muchinfo.rma.business.customer.adapter.CustomerAdapter
 import cn.muchinfo.rma.business.financial.adapter.FinancialAdapter
 import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.netManage.base.ResponseCallback

+ 1 - 3
RMA/app/src/main/java/cn/muchinfo/rma/global/data/BusinessData.kt

@@ -105,7 +105,6 @@ data class BusinessData(
     val wrstandardcode : String? = "",//现货品种代码
     @SerializedName("wrstandardid")
     val wrstandardid : String? = ""//现货品种ID
-
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -143,8 +142,7 @@ data class BusinessData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString()
-    ) {
-    }
+    )
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
         parcel.writeString(addmargin)

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/data/FinancialManageData.kt

@@ -56,7 +56,7 @@ data class FinancialManageData(
     val goodscode : String? = "",
     @SerializedName("goodsname")
     val goodsname : String? = "",
-    @SerializedName("InvoiceAmount")
+    @SerializedName("invoiceamount")
     val InvoiceAmount : String? = "",
     @SerializedName("operateapplyid")
     val operateapplyid : String? = "",

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

@@ -7,9 +7,9 @@ object Constant {
      * 获取基础url的接口
      */
 //    const val baseurl = "http://103.40.249.123:38280/cfg?key=mtp_20" // 天津麦顿
-    const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
+//    const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
 //    const val baseurl = "http://103.40.249.123:8280/cfg?key=mtp_20"//千海金外盘
-//    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
+    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
 
 
 

+ 4 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/AnnouncementViewHolder.kt

@@ -5,10 +5,8 @@ import android.graphics.Typeface
 import android.text.TextUtils
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
-import androidx.fragment.app.Fragment
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.NoticeData
-import cn.muchinfo.rma.global.isShowTimeString
 import cn.muchinfo.rma.global.toShowTime
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
@@ -20,6 +18,7 @@ import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.information_management.hnstocks.message.MessageDetailsActivity
 import org.jetbrains.anko.*
 
+@Suppress("DEPRECATION")
 class AnnouncementViewHolder(
     private val activity: AppCompatActivity
 ) : BaseViewHolder<NoticeData>(activity) {
@@ -38,10 +37,10 @@ class AnnouncementViewHolder(
             linearLayout {
                 imageView {
                     data.bindOptional(context){
-                        if (it?.msgtype == "1"){
-                            imageResource = R.mipmap.main_announcement_logo
+                        imageResource = if (it?.msgtype == "1"){
+                            R.mipmap.main_announcement_logo
                         }else{
-                            imageResource = R.mipmap.rma_message_img
+                            R.mipmap.rma_message_img
                         }
                     }
                 }.lparams(autoSize(56), autoSize(41)) {

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

@@ -23,6 +23,7 @@ import org.jetbrains.anko.custom.ankoView
 /**
  * 资讯详情
  */
+@Suppress("DEPRECATION")
 class InformationDetailsActivity : BaseActivity<HomeViewModel>() {
 
     lateinit var itemView1: X5WebView
@@ -108,7 +109,7 @@ class InformationDetailsActivity : BaseActivity<HomeViewModel>() {
                     override fun onPageFinished(view: WebView?, p1: String?) {
                         super.onPageFinished(view, p1)
                         //修改图片大小
-                        if (data.context?.contains("src=") == true){
+                        if (data.context?.contains("src=") == true) {
                             val screenWidth = ScreenUtils.getScreenWidth().toString()
 //                        val width =  SizeUtils.dp2px(50f).toString()
 //                        val width2 =  SizeUtils.px2dp(screenWidth.toFloat()).toString()

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

@@ -14,8 +14,6 @@ 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.home.business.BusinessManagementViewModel
-import cn.muchinfo.rma.view.base.home.business.BusinessManagementViewholder
 import cn.muchinfo.rma.view.base.home.business.creatBusinessUI
 import com.blankj.utilcode.util.ConvertUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
@@ -33,42 +31,62 @@ import org.jetbrains.anko.view
  * 现货审核-点价审核页面
  * @property someToAuditPriceUI SomeToAuditPriceUI
  */
-class SomePriceFragment : BaseFragment<SomePriceViewModel>(){
+@Suppress("DEPRECATION")
+class SomePriceFragment : BaseFragment<SomePriceViewModel>() {
 
     lateinit var segment: QMUITabSegment
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
 
-    var indexFirst : Int = 0
+    var indexFirst: Int = 0
 
     //待审核
-    private val someToAuditPriceUI by lazy { SomeToAuditPriceUI(this.getAppCompatActivity(),viewModel) }
+    private val someToAuditPriceUI by lazy {
+        SomeToAuditPriceUI(
+            this.getAppCompatActivity(),
+            viewModel
+        )
+    }
 
     //已审核
-    private val someApprovedPriceUI by lazy { SomeApprovedPriceUI(this.getAppCompatActivity(),viewModel) }
-
+    private val someApprovedPriceUI by lazy {
+        SomeApprovedPriceUI(
+            this.getAppCompatActivity(),
+            viewModel
+        )
+    }
 
     //viewpager的适配器
-    private var newPagerAdapter : PagerAdapter? = null
+    private var newPagerAdapter: PagerAdapter? = null
 
     //tabSegment标题
-    private val newTabsArray : ArrayList<String> = arrayListOf()
+    private val newTabsArray: ArrayList<String> = arrayListOf()
 
     //暂存的页面组
-    private val uiList : ArrayList<_FrameLayout> = arrayListOf()
+    private val uiList: ArrayList<_FrameLayout> = arrayListOf()
 
-    fun initMenuData(){
+    fun initMenuData() {
 
-        if (uiList.size > 0){
+        if (uiList.size > 0) {
             newPagerAdapter = null
             newTabsArray.clear()
             uiList.clear()
         }
-        if (GlobalDataCollection.instance?.getThreeLevelMenu(firstCode = "client_spotsaduit",secondCode = "client_spotsaduit_point",threeCode = "client_spotsaduit_point_unaduit") == true){
+        if (GlobalDataCollection.instance?.getThreeLevelMenu(
+                firstCode = "client_spotsaduit",
+                secondCode = "client_spotsaduit_point",
+                threeCode = "client_spotsaduit_point_unaduit"
+            ) == true
+        ) {
             newTabsArray.add("待审核")
             uiList.add(someToAuditPriceUI.root)
         }
-        if (GlobalDataCollection.instance?.getThreeLevelMenu(firstCode = "client_spotsaduit",secondCode = "client_spotsaduit_point",threeCode = "client_spotsaduit_point_aduited") == true){
+        if (GlobalDataCollection.instance?.getThreeLevelMenu(
+                firstCode = "client_spotsaduit",
+                secondCode = "client_spotsaduit_point",
+                threeCode = "client_spotsaduit_point_aduited"
+            ) == true
+        ) {
             newTabsArray.add("已审核")
             uiList.add(someApprovedPriceUI.root)
         }
@@ -77,7 +95,7 @@ class SomePriceFragment : BaseFragment<SomePriceViewModel>(){
             override fun getPageTitle(position: Int): CharSequence? = newTabsArray[position]
 
             override fun instantiateItem(container: ViewGroup, position: Int): Any {
-                return uiList.get(position).apply {
+                return uiList[position].apply {
                     container.addView(
                         this,
                         ViewGroup.LayoutParams(matchParent, matchParent)
@@ -108,7 +126,7 @@ class SomePriceFragment : BaseFragment<SomePriceViewModel>(){
         savedInstanceState: Bundle?
     ): View? {
         initMenuData()
-        if (indexFirst > 0){
+        if (indexFirst > 0) {
             segment.reset()
             viewPager.adapter = newPagerAdapter
         }
@@ -137,6 +155,7 @@ class SomePriceFragment : BaseFragment<SomePriceViewModel>(){
                     marginStart = autoSize(32)
                     marginEnd = autoSize(32)
                 }
+
                 viewPager {
                     background = resources.getDrawable(R.color.white)
                     viewPager = this
@@ -155,14 +174,16 @@ class SomePriceFragment : BaseFragment<SomePriceViewModel>(){
 /**
  * 点价-待审核
  */
+@Suppress("DEPRECATION")
 class SomeToAuditPriceUI(
     private val activity: AppCompatActivity,
-    private val viewModel : SomePriceViewModel
-){
+    private val viewModel: SomePriceViewModel
+) {
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val unSubmitAdapter: BaseAdapter<BusinessData, SomePriceViewholder> = BaseAdapter { _, _ -> SomePriceViewholder(activity, viewModel,"1") }
+    private val unSubmitAdapter: BaseAdapter<BusinessData, SomePriceViewholder> =
+        BaseAdapter { _, _ -> SomePriceViewholder(activity, viewModel, "1") }
 
     val root = _FrameLayout(activity).apply {
         verticalLayout {
@@ -194,11 +215,11 @@ class SomeToAuditPriceUI(
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            viewModel.somePriceToAuditList.bindOptional(context){
-                if (it?.isEmpty() == true || it?.size == 0){
+            viewModel.somePriceToAuditList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
-                }else {
-                    if (swipeToLayout.getIsRefreshing()){
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
                         swipeToLayout.finishRefresh()
                     }
                     statusLayout.showSuccess()
@@ -213,14 +234,16 @@ class SomeToAuditPriceUI(
 /**
  * 点价-已审核
  */
+@Suppress("DEPRECATION")
 class SomeApprovedPriceUI(
     private val activity: AppCompatActivity,
-    private val viewModel : SomePriceViewModel
-){
+    private val viewModel: SomePriceViewModel
+) {
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val unSubmitAdapter: BaseAdapter<BusinessData, SomePriceViewholder> = BaseAdapter { _, _ -> SomePriceViewholder(activity, viewModel,"1") }
+    private val unSubmitAdapter: BaseAdapter<BusinessData, SomePriceViewholder> =
+        BaseAdapter { _, _ -> SomePriceViewholder(activity, viewModel, "1") }
 
     val root = _FrameLayout(activity).apply {
         verticalLayout {
@@ -252,11 +275,11 @@ class SomeApprovedPriceUI(
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            viewModel.somePriceApprovedList.bindOptional(context){
-                if (it?.isEmpty() == true || it?.size == 0){
+            viewModel.somePriceApprovedList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
-                }else {
-                    if (swipeToLayout.getIsRefreshing()){
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
                         swipeToLayout.finishRefresh()
                     }
                     statusLayout.showSuccess()

+ 4 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotaudit/someprice/SomePriceViewModel.kt

@@ -28,7 +28,7 @@ class SomePriceViewModel : BaseViewModel(){
     val somePriceToAuditList: MutableLiveData<List<BusinessData>> = MutableLiveData()
 
     /**
-     * 交收-待审核列表 applystatus String?申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+     * 交收-待审核列表 已审核列表 applystatus String?申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
      */
     val somePriceApprovedList: MutableLiveData<List<BusinessData>> = MutableLiveData()
 
@@ -49,6 +49,7 @@ class SomePriceViewModel : BaseViewModel(){
                         } else {
                             datanewlist.add(it.copy(indexSelect = 0))
                         }
+
                     } else {
                         datanewlist.add(it.copy(indexSelect = 0))
                     }
@@ -90,9 +91,9 @@ class SomePriceViewModel : BaseViewModel(){
                 val toAuditList = arrayListOf<BusinessData>()
                 val approvedList = arrayListOf<BusinessData>()
                 respData?.forEach {
-                    if (it.applystatus == "1" || it.applystatus == "3"){
+                    if (it.applystatus == "1"){
                         toAuditList.add(it)
-                    }else if (it.applystatus == "2"){
+                    }else if (it.applystatus == "2" || it.applystatus == "3"){
                         approvedList.add(it)
                     }
                 }

+ 11 - 38
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tjmd/TjmdHomeFragment.kt

@@ -1,8 +1,8 @@
 package cn.muchinfo.rma.view.base.home.tjmd
 
+import android.annotation.SuppressLint
 import android.content.Intent
 import android.graphics.Rect
-import android.graphics.Typeface
 import android.net.Uri
 import android.os.Bundle
 import android.text.TextUtils
@@ -13,12 +13,7 @@ import android.view.ViewGroup
 import android.widget.FrameLayout
 import android.widget.TextView
 import android.widget.ViewFlipper
-import androidx.annotation.NonNull
-import androidx.annotation.Nullable
 import androidx.cardview.widget.CardView
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentPagerAdapter
-import androidx.recyclerview.widget.GridLayoutManager
 import androidx.recyclerview.widget.LinearLayoutManager
 import androidx.recyclerview.widget.RecyclerView
 import androidx.recyclerview.widget.StaggeredGridLayoutManager
@@ -28,10 +23,7 @@ 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.data.WrGoodsPerformanceStepData
 import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
-import cn.muchinfo.rma.global.toShowTime
-import cn.muchinfo.rma.global.toShowTime3
 import cn.muchinfo.rma.global.utils.TimeUtils
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.getAppCompatActivity
@@ -40,24 +32,15 @@ import cn.muchinfo.rma.view.base.BaseFragment
 import cn.muchinfo.rma.view.base.WebActivity
 import cn.muchinfo.rma.view.base.app.Constant
 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.PerformanceItemViewHolder
-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.yrdz.YrdzHomeFragment
 import cn.muchinfo.rma.view.base.home.yrdz.YrdzNoticeActivity
-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.market.YrdzMarketFragment
 import cn.muchinfo.rma.view.eventbus.MainTabSelectMessageEvent
 import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
 import com.blankj.utilcode.util.*
 import com.facebook.drawee.view.SimpleDraweeView
 import com.github.aachartmodel.aainfographics.aachartcreator.*
 import com.github.aachartmodel.aainfographics.aaoptionsmodel.AAScrollablePlotArea
-import com.qmuiteam.qmui.util.QMUIDisplayHelper
-import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.GlobalScope
@@ -69,11 +52,11 @@ import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.UI
-import org.jetbrains.anko.support.v4.viewPager
 
 /**
  * 天津麦顿首页
  */
+@Suppress("DEPRECATION")
 class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
 
 
@@ -141,13 +124,14 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
             val goodsInfo = viewModel.dataList.value?.find { it.goodsInfo?.goodsid == goodid }
             viewModel.dataList.value?.indexOf(goodsInfo)?.let {
                 if (it != -1) {//刷新相应item
-                    tjmdHomeMarketViewHolder?.notifyItemChanged(it)
+                    tjmdHomeMarketViewHolder.notifyItemChanged(it)
                 }
             }
         }
 
     }
 
+    @SuppressLint("RtlHardcoded")
     private fun initViewFlipper(notice: List<NoticeData>) {
         for (i in 0 until notice.size) {
             val view = TextView(context)
@@ -162,12 +146,12 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
             view.ellipsize = TextUtils.TruncateAt.END
             view.setTextColor(context?.resources?.getColor(R.color.rma_black_33)!!)
             view.textSize = 12f
-            view.setOnClickListener(View.OnClickListener {
+            view.setOnClickListener {
                 val intent = Intent()
-                intent.putExtra("data",notice.get(i))
+                intent.putExtra("data", notice[i])
                 intent.setClass(context!!, MessageDetailsActivity::class.java)
                 ActivityUtils.startActivity(intent)
-            })
+            }
             noticeViewFlipper.addView(view)
         }
         //是否自动开始滚动
@@ -190,7 +174,7 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
         return UI {
             viewModel.getBanner()
 
-            viewModel.setDataList(thisTag){isCompleted, err ->
+            viewModel.setDataList(thisTag){ _, _ ->
                 GlobalScope.launch(Dispatchers.Main) {
 //                    chartModel.yAxisMin(viewModel.wrAverageTradePriceMin)
 //                    chartModel.yAxisMax(viewModel.wrAverageTradePriceMax)
@@ -261,7 +245,7 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
                                         null
                                     )
                                 }
-                                setDelegate { banner, itemView, model, position ->
+                                setDelegate { _, _, model, _ ->
                                     val data = model as BannerData
                                     val intent = Intent()
                                     intent.putExtra("url",data.url)
@@ -269,13 +253,6 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
                                     intent.setClass(context, WebActivity::class.java)
                                     ActivityUtils.startActivity(intent)
                                 }
-//                                setDelegate(new BGABanner.Delegate() {
-//                                    @Override
-//                                    public void onBannerItemClick(BGABanner banner, View itemView, @Nullable Object model, int position) {
-//
-//                                    }
-//                                });
-
 
                                 setAdapter(object : BGABanner.Adapter<CardView, BannerData> {
                                     override fun fillBannerItem(
@@ -292,9 +269,6 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
                                             }else{
                                                 SPUtils.getInstance().getString(Constant.uploadUrl) + model?.imagepath?.substring(1)
                                             }))
-//                                            Uri.parse(
-//                                                SPUtils.getInstance().getString(
-//                                                    Constant.uploadUrl) + model?.imagepath?.substring(1)))
                                     }
                                 })
 
@@ -520,11 +494,11 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
                                             lastShow = linearLayoutManager.findLastVisibleItemPosition()//获取最后一个显示条目
                                             if (fistShow != -1 && lastShow != -1) {
                                                 viewModel.queryQuoteDay(
-                                                    tag = thisTag ?: "",
+                                                    tag = thisTag,
                                                     first = fistShow,
                                                     last = lastShow,
                                                     list = viewModel.dataList.value ?: arrayListOf()
-                                                ) { isCompleted, err ->
+                                                ) { isCompleted, _ ->
                                                     if (isCompleted) {
                                                         dataRecyclerview.adapter?.notifyItemRangeChanged(fistShow, lastShow)
                                                     }
@@ -586,7 +560,6 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
 
                             }.lparams(matchParent, autoSize(380))
 
-
                             recyclerView {
                                 background = resources.getDrawable(R.color.white)
                                 val staggeredGridLayoutManager = StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)

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

@@ -1,8 +1,7 @@
 package cn.muchinfo.rma.view.base.home.yrdz
 
+import android.annotation.SuppressLint
 import android.content.Intent
-import android.graphics.Rect
-import android.graphics.Typeface
 import android.net.Uri
 import android.os.Bundle
 import android.text.TextUtils
@@ -13,21 +12,14 @@ import android.view.ViewGroup
 import android.widget.FrameLayout
 import android.widget.TextView
 import android.widget.ViewFlipper
-import androidx.annotation.NonNull
-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
 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.WebActivity
@@ -35,24 +27,13 @@ import cn.muchinfo.rma.view.base.app.Constant
 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
-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.market.YrdzMarketFragment
 import cn.muchinfo.rma.view.eventbus.MainTabSelectMessageEvent
 import com.blankj.utilcode.util.*
 import com.facebook.drawee.view.SimpleDraweeView
 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.adapter.BaseAdapter
 import mtp.polymer.com.information_management.hnstocks.message.MessageDetailsActivity
 import org.greenrobot.eventbus.EventBus
 import org.jetbrains.anko.*
@@ -62,6 +43,7 @@ import org.jetbrains.anko.support.v4.viewPager
 /**
  * 云融大宗的首页
  */
+@Suppress("DEPRECATION")
 class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>() {
 
     companion object {
@@ -132,7 +114,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>() {
             override fun getPageTitle(position: Int): CharSequence? = tabsArray[position]
 
             override fun instantiateItem(container: ViewGroup, position: Int): Any {
-                return uiMessageList.get(position).apply {
+                return uiMessageList[position].apply {
                     container.addView(
                         this,
                         ViewGroup.LayoutParams(matchParent, matchParent)
@@ -153,8 +135,9 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>() {
     }
 
 
+    @SuppressLint("RtlHardcoded")
     private fun initViewFlipper(notice: List<NoticeData>) {
-        for (i in 0 until notice.size) {
+        for (i in notice.indices) {
             val view = TextView(context)
             val params = FrameLayout.LayoutParams(
                 ViewGroup.LayoutParams.WRAP_CONTENT,
@@ -167,12 +150,12 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>() {
             view.ellipsize = TextUtils.TruncateAt.END
             view.setTextColor(context?.resources?.getColor(R.color.rma_black_33)!!)
             view.textSize = 12f
-            view.setOnClickListener(View.OnClickListener {
+            view.setOnClickListener {
                 val intent = Intent()
                 intent.putExtra("data", notice.get(i))
                 intent.setClass(context!!, MessageDetailsActivity::class.java)
                 ActivityUtils.startActivity(intent)
-            })
+            }
             noticeViewFlipper.addView(view)
         }
         //是否自动开始滚动
@@ -239,7 +222,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>() {
                                 null
                             )
                         }
-                        setDelegate { banner, itemView, model, position ->
+                        setDelegate { _, _, model, _ ->
                             val data = model as BannerData
                             val intent = Intent()
                             intent.putExtra("url", data.url)

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

@@ -73,12 +73,9 @@ class YrdzInformationViewHolder(
 
                 imageView {
                     data.bindOptional(context){
-                        if (it?.coverimage.isNullOrEmpty()){
-
-                        }else{
-                            showImage(SPUtils.getInstance().getString(Constant.uploadUrl).replace("/upload","") + it?.coverimage?.substring(1))
+                        if (it?.coverimage?.isNotEmpty() == true){
+                            showImage(SPUtils.getInstance().getString(Constant.uploadUrl).replace("/upload","") + it.coverimage.substring(1))
                         }
-
                     }
                 }.lparams(autoSize(200), autoSize(140)){
                     marginEnd = autoSize(20)

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

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.reference
 
+import android.annotation.SuppressLint
 import android.os.Bundle
 import android.view.*
 import androidx.recyclerview.widget.LinearLayoutManager
@@ -74,6 +75,7 @@ class ReferenceFragment : BaseFragment<ReferenceViewModel>() , ReferenceAdapter.
 
     }
 
+    @SuppressLint("RtlHardcoded")
     override fun onCreateView(
         inflater: LayoutInflater,
         container: ViewGroup?,