ProGo преди 4 години
родител
ревизия
e5319d5333

+ 2 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt

@@ -119,9 +119,10 @@ class FutureManager {
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FutureDetailsData>?, [@kotlin.ParameterName] Error?, Unit>
      */
     fun queryErmcpHisEntrustDetails(
-        params: Map<String, String>,
         responseBack: (isSuccess: Boolean, respData: List<FutureEntrustData>?, error: Error?) -> Unit
     ){
+        val params = mutableMapOf<String, String>()
+        params["accountID"] = SPUtils.getInstance().getLong(Constant.SELECT_ACCOUNT_ID).toString()
         MyOkHttpUtils().query(
             URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpHisOrderDetails",
             params = params,

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

@@ -9,10 +9,11 @@ class ChartActivity : BaseActivity<ChartViewModel>() {
 
     companion object {
         // 启动页面
-        fun start(goodsId: Int = 0, context: Context) {
+        fun start(goodsCode: String?, outGoodsCode: String?, context: Context) {
             val intent = Intent()
             intent.setClass(context, ChartActivity::class.java)
-            intent.putExtra("goodsId", goodsId)
+            intent.putExtra("goodsCode", goodsCode)
+            intent.putExtra("outGoodsCode", outGoodsCode)
             context.startActivity(intent)
         }
     }

+ 8 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/entrusts/EntrustChildViewModel.kt

@@ -149,6 +149,14 @@ class EntrustChildViewModel : BaseViewModel() {
                 noDataLiveData.value = true
             }
         }
+
+        FutureManager().queryErmcpHisEntrustDetails { _isSuccess, _respData, _ ->
+            if (_isSuccess && !_respData!!.isNullOrEmpty()) { // 查询成功
+                entrustLiveData.value = _respData
+            } else { // 查询失败
+                noDataLiveData.value = true
+            }
+        }
     }
 
     //endregion

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

@@ -177,7 +177,7 @@ class MarketBaseModel : BaseViewModel() {
             holder.itemView.tag = list?.get(position)?.goodsid
             holder.itemView.setOnClickListener {
                 val goodsId: Int = it.tag as Int
-                ChartActivity.start(goodsId, context!!)
+                ChartActivity.start(list?.get(position)?.goodscode, list?.get(position)?.outgoodscode, context!!)
             }
         }