Explorar o código

风险管理11月12日提交代码-liu.bolan-风管bug

Liu.bolan %!s(int64=4) %!d(string=hai) anos
pai
achega
10639a917e
Modificáronse 18 ficheiros con 116 adicións e 93 borrados
  1. 2 2
      RMA/app/build.gradle
  2. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/SCMiddleGoodsData.kt
  3. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  4. 3 16
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarket.kt
  5. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarketModel.kt
  6. 18 14
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/MarketBaseModel.kt
  7. 0 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysFragment.kt
  8. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/arecancelled/AreCancelledActivity.kt
  9. 12 10
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/inventory/inventoryaudit/InventoryAuditViewModel.kt
  10. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt
  11. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/about/AboutActivity.kt
  12. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ProcurementFragment.kt
  13. 3 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/contraceui/ContractUI.kt
  14. 40 27
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/report/PricingReport.kt
  15. 1 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/SpotFragment.kt
  16. 4 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/perioddocuments/BusinessAssociationsViewHolder.kt
  17. 7 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/dialog/WarehouseFloatListedDialog.kt
  18. BIN=BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_about_icon.png

+ 2 - 2
RMA/app/build.gradle

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

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

@@ -17,6 +17,8 @@ data class SCMiddleGoodsData(
     val deliverygoodscode : String? = "",//现货品种代码
     @SerializedName("deliverygoodsid")
     val deliverygoodsid : String? = "",//现货品种ID
+    @SerializedName("convertratio")
+    val convertratio : String? = "",//折算系数
     @SerializedName("deliverygoodsname")
     val deliverygoodsname : String? = "",//现货品种名称
     @SerializedName("enumdicname")
@@ -70,6 +72,7 @@ data class SCMiddleGoodsData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readInt()
     ) {
     }
@@ -81,6 +84,7 @@ data class SCMiddleGoodsData(
         parcel.writeString(customeruserid)
         parcel.writeString(deliverygoodscode)
         parcel.writeString(deliverygoodsid)
+        parcel.writeString(convertratio)
         parcel.writeString(deliverygoodsname)
         parcel.writeString(enumdicname)
         parcel.writeString(relatedmiddlegoodsqty)

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

@@ -7,7 +7,7 @@ object Constant {
      * 获取基础url的接口
      */
 //    const val baseurl = "http://103.40.249.123:38280/cfg?key=mtp_20" // 天津麦顿
-//    const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
+    const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
 //    const val baseurl = "http://103.40.249.123:8280/cfg?key=mtp_20"//千海金外盘
 //    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
 
@@ -17,7 +17,7 @@ object Constant {
 //    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.204:8080/cfg?key=test_204"// 瑶姐 云融 190000000001 123456
+//    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

+ 3 - 16
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarket.kt

@@ -13,10 +13,7 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.ErmcpGoodsSortByPositionData
 import cn.muchinfo.rma.global.data.account.loginQeruy.ExternalExchanges
-import cn.muchinfo.rma.global.database.AppDatabase
-import cn.muchinfo.rma.global.room.Builder
 import cn.muchinfo.rma.lifecycle.bindOptional
-import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.base.BaseFragment
 import cn.muchinfo.rma.view.base.future.BaseFutureModel
@@ -55,10 +52,6 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
         }
     }
 
-    fun refrash(){
-        viewModel.getErmcpGoodsSortByPosition()
-    }
-
     override fun onResume() {
         super.onResume()
 //        viewModel.getErmcpGoodsSortByPosition()
@@ -77,12 +70,6 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
         return _view
     }
 
-
-
-    private fun initData(){
-
-    }
-
     private fun initViews(list : List<ErmcpGoodsSortByPositionData>) {
         idFutureTab = _view?.findViewById(R.id.id_future_tab)
         idMarketPager = _view?.findViewById(R.id.id_market_pager)
@@ -100,9 +87,9 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
         }
         // 加载数据
         tabsData?.forEach {data ->
-            val goodsgroupid = GlobalDataCollection.instance?.loginQueryData?.goodsgroups?.find {
-                it.exexchangeid == data.autoid
-            }?.goodsgroupid
+//            val goodsgroupid = GlobalDataCollection.instance?.loginQueryData?.goodsgroups?.find {
+//                it.exexchangeid == data.autoid
+//            }?.goodsgroupid
             val item = builder?.setText(data.exexchangename)?.build(context)
             idFutureTab?.addTab(item)
             tabFragments.add(MarketFragment.getInstance(data))

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarketModel.kt

@@ -18,7 +18,7 @@ class FutureMarketModel : BaseViewModel(){
         val params = mutableMapOf<String,String>().apply {
             put("sortIndex","1")
         }
-        MyApplication.getInstance()?.futureManager?.getErmcpGoodsSortByPosition(params = params){isSuccess, respData, error ->
+        MyApplication.getInstance()?.futureManager?.getErmcpGoodsSortByPosition(params = params){ isSuccess, respData, _ ->
             if (isSuccess){
                 GlobalDataCollection.instance?.ermcpGoodsSortByPositionDataArrayList = respData?.toArrayList()
                 ermcpGoodsSortByPositionDataList.postValue(respData)

+ 18 - 14
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/MarketBaseModel.kt

@@ -70,7 +70,7 @@ class MarketBaseModel : BaseViewModel() {
         val params = mutableMapOf<String, String>().apply {
             put("goodsCodes", goodsCodes)
         }
-        MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
+        MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, _, error ->
             if (isSuccess) {
                 callback(true, null)
             } else {
@@ -90,8 +90,8 @@ class MarketBaseModel : BaseViewModel() {
     fun addSubscriptQuote(tag: String, goodsInfoList: List<GoodsInfo>) {
         GlobalScope.launch {
             MyApplication.getInstance()?.quoteManager?.addSubscriptQuote(
-                tag = tag, goodsCodeSet = goodsInfoList.map { it.goodscode.toUpperCase() ?: "" }.toSet()
-            ) { isCompleted, err ->
+                tag = tag, goodsCodeSet = goodsInfoList.map { it.goodscode.toUpperCase() }.toSet()
+            ) { _, _ ->
 
             }
         }
@@ -206,15 +206,19 @@ class MarketBaseModel : BaseViewModel() {
 
                 //和上一口价的差额
                 val upDown = quoteDayData.pricesDifference()
-                if (upDown == 0.0) {
-                    holder.idUpDown?.background = noChange
-                    holder.idPrice?.background = noChange
-                } else if (upDown > 0) {
-                    holder.idUpDown?.background = pink
-                    holder.idPrice?.background = pink
-                } else if (upDown < 0) {
-                    holder.idUpDown?.background = green
-                    holder.idPrice?.background = green
+                when {
+                    upDown == 0.0 -> {
+                        holder.idUpDown?.background = noChange
+                        holder.idPrice?.background = noChange
+                    }
+                    upDown > 0 -> {
+                        holder.idUpDown?.background = pink
+                        holder.idPrice?.background = pink
+                    }
+                    upDown < 0 -> {
+                        holder.idUpDown?.background = green
+                        holder.idPrice?.background = green
+                    }
                 }
 
                 holder.idHoldTotal?.text = NumberUtils.turnoverShort(quoteDayData.totalvolume)
@@ -242,13 +246,13 @@ class MarketBaseModel : BaseViewModel() {
                 }
                 if (isOptional) {//移除自选
                     removeOrAddFavoriteGoods(isAdd = false,goodsId = list?.get(position)?.goodsid.toString())
-                    MyApplication.getInstance()?.futureManager?.removeUserFavoriteGoods(params = params){isSuccess, respData, error ->
+                    MyApplication.getInstance()?.futureManager?.removeUserFavoriteGoods(params = params){ _, _, _ ->
 
                     }
 
                 } else {//添加自选
                     removeOrAddFavoriteGoods(isAdd = true,goodsId = list?.get(position)?.goodsid.toString())
-                    MyApplication.getInstance()?.futureManager?.addUserFavoriteGoods(params = params){isSuccess, respData, error ->
+                    MyApplication.getInstance()?.futureManager?.addUserFavoriteGoods(params = params){ _, _, _ ->
 
                     }
 

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

@@ -195,7 +195,6 @@ class HnstcdysFragment : BaseFragment<HnstcdysViewModel>(){
                             intent.setClass(context, TradeCircleListedingActivity::class.java)
                             ActivityUtils.startActivity(intent)
                         }
-
                         viewModel.resetSelectContent()
                     }
                 }

+ 2 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/arecancelled/AreCancelledActivity.kt

@@ -11,6 +11,7 @@ import cn.muchinfo.rma.global.isShowTimeString
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
@@ -425,7 +426,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>() {
                             }
 
                             textView {
-                                text = data.amount
+                                text = NumberUtils.roundNum(data.amount,2)
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)

+ 12 - 10
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/inventory/inventoryaudit/InventoryAuditViewModel.kt

@@ -110,16 +110,18 @@ class InventoryAuditViewModel : BaseViewModel(){
     private fun getInventoryAuditRightData(respData: List<AreaStockApplyData>) : List<AreaStockApplyData>{
         val newList = arrayListOf<AreaStockApplyData>()
         respData.forEach {
-            val newRightData = arrayListOf<String>()
-            newRightData.add(it.wrstandardname ?: "--")
-            newRightData.add(it.inouttype?.inouttype() + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)
-            newRightData.add(it.applystatus?.inventoryapplystatus() ?: "--")
-            newRightData.add(it.modelname +"\n" +it.brandname)
-            newRightData.add(it.warehousecode ?: "--")
-            newRightData.add(it.contractno ?: "--")
-            newRightData.add(it.applyname + "\n" + it.auditname)
-            val newData = it.copy(rightData = newRightData)
-            newList.add(newData)
+            if (it.applystatus == "2" || it.applystatus == "3"){
+                val newRightData = arrayListOf<String>()
+                newRightData.add(it.wrstandardname ?: "--")
+                newRightData.add(it.inouttype?.inouttype() + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)
+                newRightData.add(it.applystatus.inventoryapplystatus() ?: "--")
+                newRightData.add(it.modelname +"\n" +it.brandname)
+                newRightData.add(it.warehousecode ?: "--")
+                newRightData.add(it.contractno ?: "--")
+                newRightData.add(it.applyname + "\n" + it.auditname)
+                val newData = it.copy(rightData = newRightData)
+                newList.add(newData)
+            }
         }
         return newList
     }

+ 5 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt

@@ -297,12 +297,16 @@ class ReportQueryViewModel : BaseViewModel() {
     fun qrySCMiddleGoodsReport(
         tradedate: String,
         cycletype: String,
-        spotcontractid : String = ""
+        spotcontractid : String = "",
+        contractno : String = ""
     ){
         val params = mutableMapOf<String,String>().apply {
             put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
             put("cycletype",cycletype)
             put("cycletime",tradedate)
+            if (contractno.isNotEmpty()){
+                put("contractno",contractno)
+            }
             if (spotcontractid.isNotEmpty()){
                 put("spotcontractid",spotcontractid)
             }

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/about/AboutActivity.kt

@@ -7,8 +7,10 @@ import cn.muchinfo.rma.BuildConfig
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.SPUtils
 import org.jetbrains.anko.*
 
 /**
@@ -29,7 +31,11 @@ class AboutActivity : BaseActivity<AboutViewModel>(){
             }
 
             imageView {
-                imageResource = R.mipmap.tjmd_about_icon
+                if (SPUtils.getInstance().getString(Constant.oem) == "tjmd"){
+                    imageResource = R.mipmap.tjmd_about_icon
+                }else{
+                    imageResource = R.mipmap.yrdz_about_icon
+                }
             }.lparams(autoSize(480), autoSize(240)) {
                 gravity = Gravity.CENTER_HORIZONTAL
                 topMargin = autoSize(150)

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

@@ -1,3 +1,5 @@
+@file:Suppress("DEPRECATION")
+
 package cn.muchinfo.rma.view.base.procurement
 
 import android.annotation.SuppressLint
@@ -38,6 +40,7 @@ import org.jetbrains.anko.support.v4.viewPager
 /**
  * 采购
  */
+@Suppress("DEPRECATION")
 class ProcurementFragment : BaseFragment<ProcurementViewModel>() {
 
     companion object {
@@ -248,7 +251,7 @@ class PriceUI(private val baseFragment: Fragment, private val viewModule: Procur
                     /**
                      * 用来同步内容列表的item左右滑动
                      */
-                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY ->
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
                         contentAdapter.offestX = scrollX
                         val viewHolderCacheList: List<ContentAdapter.ItemViewHolder> =
                             contentAdapter.viewHolderCacheList
@@ -415,7 +418,7 @@ class SettlementUI(
                     /**
                      * 用来同步内容列表的item左右滑动
                      */
-                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ -> //代码重复,可以抽取/////
                         contentAdapter.offestX = scrollX
                         val viewHolderCacheList: List<ContentAdapter.ItemViewHolder> =
                             contentAdapter.viewHolderCacheList

+ 3 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/contraceui/ContractUI.kt

@@ -1,3 +1,5 @@
+@file:Suppress("DEPRECATION")
+
 package cn.muchinfo.rma.view.base.procurement.contraceui
 
 import android.annotation.SuppressLint
@@ -135,7 +137,7 @@ class SpotBuyUnSubmitUI(
                     /**
                      * 用来同步内容列表的item左右滑动
                      */
-                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY ->
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
                         contractAdapter.offestX = scrollX
                         val viewHolderCacheList: List<SpotContractAdapter.ItemViewHolder> =
                             contractAdapter.viewHolderCacheList

+ 40 - 27
RMA/app/src/main/java/cn/muchinfo/rma/view/base/report/PricingReport.kt

@@ -3,6 +3,7 @@ package cn.muchinfo.rma.view.base.report
 import android.os.Build
 import android.view.Gravity
 import android.view.MotionEvent
+import android.widget.EditText
 import android.widget.TextView
 import androidx.annotation.RequiresApi
 import androidx.appcompat.app.AppCompatActivity
@@ -10,13 +11,11 @@ import androidx.lifecycle.MutableLiveData
 import androidx.recyclerview.widget.LinearLayoutManager
 import androidx.recyclerview.widget.RecyclerView
 import cn.muchinfo.rma.R
-import cn.muchinfo.rma.global.GlobalDataCollection
 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.contract.emptyView
 import cn.muchinfo.rma.view.base.home.reportquery.ReportQueryViewModel
-import cn.muchinfo.rma.view.base.home.reportquery.adapter.SpotReportContentAdapter
 import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
 import com.blankj.utilcode.util.SizeUtils
 import com.blankj.utilcode.util.TimeUtils
@@ -67,6 +66,8 @@ class PricingReportUI(
         if (null != horScrollview) horScrollview.onTouchEvent(event)
     }
 
+    lateinit var contract_number : EditText
+
     init {
         viewModel.queryContract()
         dateType.postValue(SelectData(id = "1",value = "日报表"))
@@ -139,23 +140,38 @@ class PricingReportUI(
 
 
             linearLayout {
-                textView {
-                    backgroundResource = R.drawable.rma_time_click_bg
-                    onThrottleFirstClick {
-                        activity.creatBottomSheetDialog("请选择现货合同编号", viewModel.getAvailableSelectContract()) {
-                            viewModel.selectSpotContractId.postValue(this)
+                linearLayout {
 
-                        }
-                    }
-                    viewModel.selectSpotContractId.bindOptional(context){
-                        text = it?.value
-//                        contentAdapter.setTransaction(it?.value)
-//                        contentAdapter.setTransactionUserid(it?.id)
+                    gravity = Gravity.CENTER_VERTICAL
+                    backgroundResource = R.drawable.qyfg_search_item_bg
+                    editText {
+                        contract_number = this
+                        hint = "输入合同编号"
+                        background = null
+//                            inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_DECIMAL or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
+//                            setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(90)) {
+                        marginStart = autoSize(20)
                     }
-                    gravity = Gravity.CENTER
-                    text = "请选择现货合同编号"
-                    textColorInt = R.color.rma_black_33
-                    textSizeAuto = 31
+//                    backgroundResource = R.drawable.rma_time_click_bg
+//                    onThrottleFirstClick {
+//                        activity.creatBottomSheetDialog("请选择现货合同编号", viewModel.getAvailableSelectContract()) {
+//                            viewModel.selectSpotContractId.postValue(this)
+//
+//                        }
+//                    }
+//                    viewModel.selectSpotContractId.bindOptional(context){
+//                        text = it?.value
+////                        contentAdapter.setTransaction(it?.value)
+////                        contentAdapter.setTransactionUserid(it?.id)
+//                    }
+//                    gravity = Gravity.CENTER
+//                    text = "请选择现货合同编号"
+//                    textColorInt = R.color.rma_black_33
+//                    textSizeAuto = 31
                 }.lparams(0, autoSize(67),1f){
                     marginStart = autoSize(36)
                 }
@@ -163,11 +179,11 @@ class PricingReportUI(
                     backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
                     onThrottleFirstClick {
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
+                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",contractno = contract_number.text.toString())
                         }else if (dateType.value?.id == "2"){//月报表
-                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
+                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",contractno = contract_number.text.toString())
                         }else if (dateType.value?.id == "3"){//周报表
-                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
+                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",contractno = contract_number.text.toString())
                         }
                     }
                     gravity = Gravity.CENTER
@@ -178,10 +194,8 @@ class PricingReportUI(
                     marginStart = autoSize(36)
                     marginEnd = autoSize(36)
                 }
-
             }.lparams(matchParent, autoSize(100))
 
-//            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
             contentAdapter.setOnContentScrollListener(this@PricingReportUI)
             linearLayout {
                 linearLayout {
@@ -199,7 +213,7 @@ class PricingReportUI(
 
                 inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
                     horScrollview = this
-                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ -> //代码重复,可以抽取/////
                         contentAdapter.offestX = scrollX
                         val viewHolderCacheList: List<PricingReportContentAdapter.ItemViewHolder> =
                             contentAdapter.viewHolderCacheList
@@ -245,13 +259,12 @@ class PricingReportUI(
                          * 下拉刷新
                          */
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
+                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "0",contractno = contract_number.text.toString())
                         }else if (dateType.value?.id == "2"){//月报表
-                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
+                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "1",contractno = contract_number.text.toString())
                         }else if (dateType.value?.id == "3"){//周报表
-                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",spotcontractid = viewModel.selectSpotContractId.value?.id ?: "")
+                            viewModel.qrySCMiddleGoodsReport(tradedate = tradedate.replace("-", ""),cycletype = "4",contractno = contract_number.text.toString())
                         }
-//                        viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)

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

@@ -15,12 +15,9 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.global.data.HedgePlanData
-import cn.muchinfo.rma.global.data.MiddleGoodsDetail
 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.commodity.AddHedgeGoodsActivity
-import cn.muchinfo.rma.view.base.home.commodity.newspot.NewAddSpotGoodsActivity
 import cn.muchinfo.rma.view.base.home.contract.AddContractActivity
 import cn.muchinfo.rma.view.base.home.hedge.AddHedgePlanActivity
 import cn.muchinfo.rma.view.base.procurement.ProcurementFragment
@@ -32,8 +29,6 @@ import com.blankj.utilcode.util.ConvertUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
-import mtp.polymer.com.autowidget.dialog.createLoadingDialog
-import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.UI
 import org.jetbrains.anko.support.v4.viewPager
@@ -41,6 +36,7 @@ import org.jetbrains.anko.support.v4.viewPager
 /**
  * 现货fragment
  */
+@Suppress("DEPRECATION")
 class SpotFragment : BaseFragment<SpotViewModel>(){
 
     companion object {

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

@@ -136,14 +136,16 @@ class BusinessAssociationsViewHolder(private val activity : AppCompatActivity, p
 //                            text =  it?.middlegoodspricedqty3?.toDouble()?.minus(it.pricedqty?.toDouble() ?: 0.0).toString()
 //                            spot_number.text = "现货数量" + NumberUtils.roundNum(it?.middlegoodspricedqty3?.toDouble()?.minus(it.relatedmiddlegoodsqty?.toDouble() ?: 0.0)?.toString()?.toDouble()?.times(agreeunit.toDouble()) ?: 0.0,2) + "吨"
                             text = "1"
-                            spot_number.text = "现货数量" + NumberUtils.roundNum("1"?.toDouble()?.times(agreeunit.toDouble()) ?: 0.0,2) + "吨"
+                            spot_number.text = "现货数量" + NumberUtils.roundNum("1".toDouble().times(agreeunit.toDouble()).times(it?.convertratio?.toDouble() ?: 0.0),2) + "吨"
                         }
 
 
                         setOnTextChangeListener { view, value ->
                             if (value.isNullOrEmpty().not()) {
                                 if (data.value?.isClick == 1){
-                                    spot_number.text = "现货数量" + NumberUtils.roundNum(value?.toString()?.toDouble()?.times(agreeunit.toDouble()) ?: 0.0,2) + "吨"
+                                    if (data.value?.convertratio.isNullOrEmpty().not()){
+                                        spot_number.text = "现货数量" + NumberUtils.roundNum(value?.toString()?.toDouble()?.times(agreeunit.toDouble())?.times(data.value?.convertratio?.toDouble() ?: 0.0) ?: 0.0,2) + "吨"
+                                    }
                                     viewModel.resetNumberForAssciaotionDataList(contractno = data.value?.contractno ?: "",number = value.toString())
                                 }
                             }

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

@@ -124,7 +124,7 @@ fun AppCompatActivity.WarehouseFloatListedDialog(
         backgroundColor = Color.parseColor("#5f000000")
         initMenuData()
         viewModel.resetAccountData()
-        viewModel.queryQuoteDayByListed(tag = tag,goodsCodes = data?.goodsCode ?: "",isShowLoading = false)
+        viewModel.queryQuoteDayByListed(tag = tag,goodsCodes = data.goodsCode ?: "",isShowLoading = false)
         verticalLayout {
             viewModel.controlDialogDisappear.bindOptional(context){
                 if (it == true){
@@ -366,7 +366,7 @@ class FloatSellListedUI(
                             text = data.WrFtWrstandard?.minivalue
                             changeValue = data.WrFtWrstandard?.minivalue?.toDouble() ?: 1.0
                             listednumberEdittext = this
-                            setOnTextChangeListener { view, value ->
+                            setOnTextChangeListener { _, value ->
                                 if (value.isNullOrEmpty().not()) {
                                     if (selectSpotDetailsData.value?.accountid.isNullOrEmpty().not()) {
                                         val floatDelistingAmount = listed_price.value?.times(value.toString().toDouble())
@@ -654,11 +654,11 @@ class FloatSellListedUI(
 
     fun getWRTradeGoods(data: ListedData) : WarehouseTradeMI1.WRGoodsInfo{
         val wRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder()
-        wRTradeGoods.setGoodsID(data.goodsId?.toInt() ?: 0)
-        wRTradeGoods.setGoodsCode(data.goodsCode)
-        wRTradeGoods.setPriceFactor(1.0)
-        wRTradeGoods.setPriceMove(1.0)
-        wRTradeGoods.setWeightRatio(1.0)
+        wRTradeGoods.goodsID = data.goodsId?.toInt() ?: 0
+        wRTradeGoods.goodsCode = data.goodsCode
+        wRTradeGoods.priceFactor = 1.0
+        wRTradeGoods.priceMove = 1.0
+        wRTradeGoods.weightRatio = 1.0
         return wRTradeGoods.build()
     }
 }

BIN=BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_about_icon.png