Forráskód Böngészése

风险管理4月22日提交代码-liu.bolan

Liu.bolan 4 éve
szülő
commit
96957d71f6
30 módosított fájl, 2602 hozzáadás és 573 törlés
  1. 2 0
      RMA/app/src/main/AndroidManifest.xml
  2. 0 45
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  3. 28 94
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt
  4. 76 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/CommodityManager.kt
  5. 35 6
      RMA/app/src/main/java/cn/muchinfo/rma/business/report/ReportManager.kt
  6. 84 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/spot/SpotAdapter.kt
  7. 123 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/spot/SpotManager.kt
  8. 5 4
      RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/WarehouseManager.kt
  9. 12 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaStockApplyData.kt
  10. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaStockApplySumData.kt
  11. 9 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaStockReportData.kt
  12. 326 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsDetailData.kt
  13. 44 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/Ermcp3GoodsbrandData.kt
  14. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/FinancialReportData.kt
  15. 101 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/GoodsWrstandardData.kt
  16. 47 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ReportAreaSpotPLData.kt
  17. 123 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/SpotGoodsPriceData.kt
  18. 20 14
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/SpotReportData.kt
  19. 164 164
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java
  20. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/MyApplication.kt
  21. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  22. 417 119
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryActivity.kt
  23. 186 58
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt
  24. 205 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/SpotEarningRecordAdapter.java
  25. 104 46
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/AddSpotMarketPriceActivity.kt
  26. 129 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketDetailsActivity.kt
  27. 60 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketDetailsViewHolder.kt
  28. 16 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceActivity.kt
  29. 45 17
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewHolder.kt
  30. 221 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewModel.kt

+ 2 - 0
RMA/app/src/main/AndroidManifest.xml

@@ -253,6 +253,8 @@
         <activity android:name=".view.base.home.accountmanager.futureaccount.AddFutureSonAccountActivity"/>
 
         <activity android:name=".view.base.home.accountmanager.futureaccount.FutureCreditActivity"/>
+
+        <activity android:name=".view.base.home.spotmarket.SpotMarketDetailsActivity"/>
     </application>
 
 </manifest>

+ 0 - 45
RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt

@@ -857,51 +857,6 @@ class AccountManager {
         )
     }
 
-    /**
-     * 现货市价请求报文装箱
-     * @param WRStandardID Long 现货商品ID
-     * @param SpotGoodsModelID Long 现货品类ID(通用则为0)
-     * @param SpotGoodsBrandID Long 现货品牌ID(通用则为0, 不为0则须先有品类ID)
-     * @param CurrencyID Long 报价货币ID
-     * @param SpotGoodsPrice Double 现货价格
-     * @param TradeDate String 交易日(yyyyMMdd)
-     * @param OperateType Int 操作类型 - 1:新增 2:修改 3:删除
-     */
-    fun ErmcpSpotGoodsPriceReq(
-        WRStandardID : Long,
-        SpotGoodsModelID : Long = 0,
-        SpotGoodsBrandID : Long = 0,
-        CurrencyID : Long = 0,
-        SpotGoodsPrice : Double,
-        TradeDate : String,
-        OperateType : Int,
-        callback: (isCompleted: Boolean, err: Error?) -> Unit
-    ){
-        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
-            callback(false, Error("交易链路未初始化"))
-            return
-        }
-
-        val reqPacket = AccountAdapter.getErmcpSpotGoodsPriceReqInfo(
-           WRStandardID, SpotGoodsModelID, SpotGoodsBrandID, CurrencyID, SpotGoodsPrice, TradeDate, OperateType
-        )
 
-        tradeSocketManager.send(
-            reqPacket,
-            FunCode.FunCode_Trade_ErmcpSpotGoodsPriceRsp,
-            object : Callback<Packet50> {
-                override fun onSuccess(rsp: Packet50?) {
-                    val rst = AccountAdapter.analysisErmcpSpotGoodsPriceRsq(rsp!!)
-                    callback(rst.first, rst.second)
-                }
-
-                override fun onFail(err: Error?) {
-                    // 发送数据失败
-                    callback(false, err)
-                }
-
-            }
-        )
-    }
 
 }

+ 28 - 94
RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt

@@ -461,13 +461,15 @@ class AccountAdapter {
          */
         fun analysisManagerRoleOperateRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.ManagerRoleOperateRsp?> {
             return try {
-                val loginRsp = ManageServiceMI2.ManagerRoleOperateRsp.parseFrom(packet50.content)
-                if (loginRsp.retCode == 0) {
+                val resultRsp = ManageServiceMI2.ManagerRoleOperateRsp.parseFrom(packet50.content)
+                if (resultRsp.retCode == 0) {
                     // 操作成功
-                    Triple(true, null, loginRsp)
-                } else {
+                    Triple(true, null, resultRsp)
+                }  else if (resultRsp.retCode == -1){
+                    Triple(false,  Error(resultRsp.retDesc), null)
+                }else {
                     // 操作失败
-                    Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
                 }
             } catch (e: Exception) {
                 // 操作失败
@@ -511,13 +513,15 @@ class AccountAdapter {
          */
         fun analysisTaaccountOperateRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.TaaccountOperateRsp?> {
             return try {
-                val loginRsp = ManageServiceMI2.TaaccountOperateRsp.parseFrom(packet50.content)
-                if (loginRsp.retCode == 0) {
+                val resultRsp = ManageServiceMI2.TaaccountOperateRsp.parseFrom(packet50.content)
+                if (resultRsp.retCode == 0) {
                     // 操作成功
-                    Triple(true, null, loginRsp)
-                } else {
+                    Triple(true, null, resultRsp)
+                }  else if (resultRsp.retCode == -1){
+                    Triple(false,  Error(resultRsp.retDesc), null)
+                }else {
                     // 操作失败
-                    Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
                 }
             } catch (e: Exception) {
                 // 操作失败
@@ -563,13 +567,15 @@ class AccountAdapter {
          */
         fun analysisTaaccountTransfersxmoneyRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.TaaccountTransfersxmoneyRsp?> {
             return try {
-                val loginRsp = ManageServiceMI2.TaaccountTransfersxmoneyRsp.parseFrom(packet50.content)
-                if (loginRsp.retCode == 0) {
+                val resultRsp = ManageServiceMI2.TaaccountTransfersxmoneyRsp.parseFrom(packet50.content)
+                if (resultRsp.retCode == 0) {
                     // 操作成功
-                    Triple(true, null, loginRsp)
-                } else {
+                    Triple(true, null, resultRsp)
+                }  else if (resultRsp.retCode == -1){
+                    Triple(false,  Error(resultRsp.retDesc), null)
+                }else {
                     // 操作失败
-                    Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
                 }
             } catch (e: Exception) {
                 // 操作失败
@@ -654,87 +660,15 @@ class AccountAdapter {
          */
         fun analysisLoginaccountOperateRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.LoginaccountOperateRsp?> {
             return try {
-                val loginRsp = ManageServiceMI2.LoginaccountOperateRsp.parseFrom(packet50.content)
-                if (loginRsp.retCode == 0) {
-                    // 操作成功
-                    Triple(true, null, loginRsp)
-                } else {
-                    // 操作失败
-                    Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
-                }
-            } catch (e: Exception) {
-                // 操作失败
-                Triple(false, Error("装箱失败"), null)
-            }
-        }
-
-        /**
-         * 现货市价请求报文装箱
-         * @param WRStandardID Long 现货商品ID
-         * @param SpotGoodsModelID Long 现货品类ID(通用则为0)
-         * @param SpotGoodsBrandID Long 现货品牌ID(通用则为0, 不为0则须先有品类ID)
-         * @param CurrencyID Long 报价货币ID
-         * @param SpotGoodsPrice Double 现货价格
-         * @param TradeDate String 交易日(yyyyMMdd)
-         * @param OperateType Int 操作类型 - 1:新增 2:修改 3:删除
-         */
-        fun getErmcpSpotGoodsPriceReqInfo(
-            WRStandardID : Long,
-            SpotGoodsModelID : Long = 0,
-            SpotGoodsBrandID : Long = 0,
-            CurrencyID : Long = 0,
-            SpotGoodsPrice : Double,
-            TradeDate : String,
-            OperateType : Int
-        ) : Packet50{
-            val builder = ManageServiceMI2.ErmcpSpotGoodsPriceReq.newBuilder()
-            val loginInfo = GlobalDataCollection.instance?.loginRsp!!
-
-            builder.setHeader(
-                MessageHeadModel.getHead(
-                    FunCode.FunCode_Trade_ErmcpSpotGoodsPriceReq,
-                    loginInfo.userID,
-                    GlobalDataCollection.instance?.accountId ?: 0,
-                    0,
-                    18
-                )
-            )
-            builder.operateID = loginInfo.loginID
-            builder.operateSrc = 2
-            builder.wrStandardID = WRStandardID
-            if (SpotGoodsModelID != 0L){
-                builder.spotGoodsModelID = SpotGoodsModelID
-            }
-            if (SpotGoodsBrandID != 0L){
-                builder.spotGoodsBrandID = SpotGoodsBrandID
-            }
-            if (CurrencyID != 0L){
-                builder.currencyID = CurrencyID
-            }
-            builder.spotGoodsPrice = SpotGoodsPrice
-            builder.tradeDate = TradeDate
-            builder.operateType = OperateType
-
-            val arrayOutputStream = ByteArrayOutputStream()
-            builder.build().writeTo(arrayOutputStream)
-            return Packet50(FunCode.FunCode_Trade_ErmcpSpotGoodsPriceReq, arrayOutputStream.toByteArray())
-        }
-
-
-        /**
-         * 期货账户授信报文解析
-         * @param packet50 Packet50
-         * @return Triple<Boolean, Error?, ManageServiceMI2.TaaccountOperateRsp?>
-         */
-        fun analysisErmcpSpotGoodsPriceRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.ErmcpSpotGoodsPriceRsp?> {
-            return try {
-                val loginRsp = ManageServiceMI2.ErmcpSpotGoodsPriceRsp.parseFrom(packet50.content)
-                if (loginRsp.retCode == 0) {
+                val resultRsp = ManageServiceMI2.LoginaccountOperateRsp.parseFrom(packet50.content)
+                if (resultRsp.retCode == 0) {
                     // 操作成功
-                    Triple(true, null, loginRsp)
-                } else {
+                    Triple(true, null, resultRsp)
+                }  else if (resultRsp.retCode == -1){
+                    Triple(false,  Error(resultRsp.retDesc), null)
+                }else {
                     // 操作失败
-                    Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
                 }
             } catch (e: Exception) {
                 // 操作失败

+ 76 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/CommodityManager.kt

@@ -74,6 +74,82 @@ class CommodityManager {
     }
 
     /**
+     * /Ermcp3/QueryDeliveryGoods 查询现货商品详情
+     */
+    fun queryDeliveryGoodsDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<DeliveryGoodsDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryDeliveryGoodsDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<DeliveryGoodsDetailData>>>() {
+                override fun onResponse(response: BaseResult<List<DeliveryGoodsDetailData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+    /**
+     * /Ermcp3/QueryGoodsWrstandard 查询商品品类
+     */
+    fun queryGoodsWrstandard(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<GoodsWrstandardData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryGoodsWrstandard",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<GoodsWrstandardData>>>() {
+                override fun onResponse(response: BaseResult<List<GoodsWrstandardData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+    /**
+     * /Ermcp3/QueryGoodsbrand 查询商品品牌
+     */
+    fun queryGoodsbrand(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<Ermcp3GoodsbrandData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryGoodsbrand",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<Ermcp3GoodsbrandData>>>() {
+                override fun onResponse(response: BaseResult<List<Ermcp3GoodsbrandData>>?, 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] WrStandardDetail?, [@kotlin.ParameterName] Error?, Unit>

+ 35 - 6
RMA/app/src/main/java/cn/muchinfo/rma/business/report/ReportManager.kt

@@ -2,6 +2,7 @@ package cn.muchinfo.rma.business.report
 
 import cn.muchinfo.rma.global.data.ExposureReportData
 import cn.muchinfo.rma.global.data.FinancialReportData
+import cn.muchinfo.rma.global.data.ReportAreaSpotPLData
 import cn.muchinfo.rma.global.data.SpotReportData
 import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
@@ -17,6 +18,7 @@ import java.lang.Exception
 class ReportManager {
 
     /**
+     * /Ermcp3/QryReportDayFinanceFp
      * 查询财务日报表发票(菜单:报表查询/财务报表/日报表/发票)
      * @param params Map<String, String> userid : 用户ID / tradedate : 交易日(格式:yyyyMMdd)
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FinancialReportData>?, [@kotlin.ParameterName] Error?, Unit>
@@ -26,7 +28,7 @@ class ReportManager {
         responseBack: (isSuccess: Boolean, respData: List<FinancialReportData>?, error: Error?) -> Unit
     ){
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QryReportDayFinanceFp",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryReportDayFinanceFp",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<FinancialReportData>>>(){
@@ -43,6 +45,7 @@ class ReportManager {
     }
 
     /**
+     * /Ermcp3/QryReportDayFinanceKx
      * 查询财务日报表款项(菜单:报表查询/财务报表/日报表/款项)
      * @param params Map<String, String> userid : 用户ID / tradedate : 交易日(格式:yyyyMMdd)
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FinancialReportData>?, [@kotlin.ParameterName] Error?, Unit>
@@ -52,7 +55,7 @@ class ReportManager {
         responseBack: (isSuccess: Boolean, respData: List<FinancialReportData>?, error: Error?) -> Unit
     ){
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QryReportDayFinanceKx",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryReportDayFinanceKx",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<FinancialReportData>>>(){
@@ -156,7 +159,7 @@ class ReportManager {
         responseBack: (isSuccess: Boolean, respData: List<SpotReportData>?, error: Error?) -> Unit
     ){
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QryReportDaySpot",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryReportDaySpot",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<SpotReportData>>>(){
@@ -182,7 +185,7 @@ class ReportManager {
         responseBack: (isSuccess: Boolean, respData: List<SpotReportData>?, error: Error?) -> Unit
     ){
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QryReportMonthSpot",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryReportMonthSpot",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<SpotReportData>>>(){
@@ -208,7 +211,7 @@ class ReportManager {
         responseBack: (isSuccess: Boolean, respData: List<SpotReportData>?, error: Error?) -> Unit
     ){
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QryReportDaySpotDetail",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryReportDaySpotDetail",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<SpotReportData>>>(){
@@ -234,7 +237,7 @@ class ReportManager {
         responseBack: (isSuccess: Boolean, respData: List<SpotReportData>?, error: Error?) -> Unit
     ){
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QryReportMonthSpotDetail",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryReportMonthSpotDetail",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<SpotReportData>>>(){
@@ -250,4 +253,30 @@ class ReportManager {
         )
     }
 
+    /**
+     * 查询现货损益报表(现货损益报表)
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<SpotReportData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun qryReportAreaSpotPL(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ReportAreaSpotPLData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryReportAreaSpotPL",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ReportAreaSpotPLData>>>(){
+                override fun onResponse(response: BaseResult<List<ReportAreaSpotPLData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
 }

+ 84 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/spot/SpotAdapter.kt

@@ -0,0 +1,84 @@
+package cn.muchinfo.rma.business.spot
+
+import cn.muchinfo.rma.business.global.MessageHeadModel
+import cn.muchinfo.rma.global.ErrorMessageUtils
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.netcore.packet.Packet50
+import cn.muchinfo.rma.protobuf.funcode.FunCode
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
+import com.blankj.utilcode.util.TimeUtils
+import java.io.ByteArrayOutputStream
+import java.lang.Exception
+import java.text.SimpleDateFormat
+
+object SpotAdapter {
+
+    /**
+     * 现货市价请求报文装箱
+     * @param WRStandardID Long 现货商品ID
+     * @param SpotGoodsModelID Long 现货品类ID(通用则为0)
+     * @param SpotGoodsBrandID Long 现货品牌ID(通用则为0, 不为0则须先有品类ID)
+     * @param CurrencyID Long 报价货币ID
+     * @param SpotGoodsPrice Double 现货价格
+     * @param TradeDate String 交易日(yyyyMMdd)
+     * @param OperateType Int 操作类型 - 1:新增 2:修改 3:删除
+     */
+    fun getErmcpSpotGoodsPriceReqInfo(
+        DeliveryGoodsID : Long,
+        WRStandardID : Long = 0,
+        SpotGoodsBrandID : Long = 0,
+        SpotGoodsPrice : Double = 0.0,
+        OperateType : Int
+    ) : Packet50{
+        val builder = ManageServiceMI2.ErmcpSpotGoodsPriceReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        // FIXME: - 250000000005
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.FunCode_Trade_ErmcpSpotGoodsPriceReq,
+                loginInfo.userID,
+                GlobalDataCollection.instance?.accountId ?: 0,
+                0,
+                18
+            )
+        )
+        builder.deliveryGoodsID = DeliveryGoodsID
+        if (SpotGoodsPrice != 0.0){
+            builder.spotGoodsPrice = SpotGoodsPrice
+        }
+        builder.operateType = OperateType
+        builder.currencyID = 1
+        builder.tradeDate = TimeUtils.getNowString(SimpleDateFormat("yyyyMMdd"))
+        builder.operateID = loginInfo.loginID
+        builder.operateSrc = 2
+        builder.wrStandardID = WRStandardID
+        builder.spotGoodsBrandID = SpotGoodsBrandID
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.FunCode_Trade_ErmcpSpotGoodsPriceReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     *  现货市价报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ErmcpSpotGoodsPriceRsp?>
+     */
+    fun analysisErmcpSpotGoodsPriceRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.ErmcpSpotGoodsPriceRsp?> {
+        return try {
+            val resultRsp = ManageServiceMI2.ErmcpSpotGoodsPriceRsp.parseFrom(packet50.content)
+            if (resultRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, resultRsp)
+            }  else if (resultRsp.retCode == -1){
+                Triple(false,  Error(resultRsp.retDesc), null)
+            }else {
+                // 操作失败
+                Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
+
+}

+ 123 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/spot/SpotManager.kt

@@ -0,0 +1,123 @@
+package cn.muchinfo.rma.business.spot
+
+import cn.muchinfo.rma.business.account.adapter.AccountAdapter
+import cn.muchinfo.rma.global.data.AccMgrLoginUserData
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.netManage.base.ResponseCallback
+import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
+import cn.muchinfo.rma.netcore.packet.Packet50
+import cn.muchinfo.rma.netcore.socket.Callback
+import cn.muchinfo.rma.protobuf.funcode.FunCode
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.guard
+import cn.muchinfo.rma.view.base.app.BaseResult
+import cn.muchinfo.rma.view.base.app.Constant
+import com.blankj.utilcode.util.SPUtils
+import okhttp3.Call
+import java.lang.Exception
+
+/**
+ * 现货市价管理类
+ */
+class SpotManager {
+
+    /**
+     * 查询现货市价(现货市价)
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<SpotGoodsPriceData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun querySpotGoodsPrice(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<SpotGoodsPriceData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QuerySpotGoodsPrice",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<SpotGoodsPriceData>>>() {
+                override fun onResponse(response: BaseResult<List<SpotGoodsPriceData>>?, 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<SpotGoodsPriceData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun querySpotGoodsPriceLog(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<SpotGoodsPriceData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QuerySpotGoodsPriceLog",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<SpotGoodsPriceData>>>() {
+                override fun onResponse(response: BaseResult<List<SpotGoodsPriceData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+    /**
+     * 现货市价请求
+     * @param DeliveryGoodsID Long 现货品种ID
+     * @param WRStandardID Long 现货品类ID(通用则为0)
+     * @param SpotGoodsBrandID Long 现货品牌ID(通用则为0, 不为0则须先有品类ID)
+     * @param SpotGoodsPrice Double 现货价格
+     * @param OperateType Int 操作类型 - 1:新增 2:修改 3:删除
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun ErmcpSpotGoodsPriceReq(
+        DeliveryGoodsID : Long,
+        WRStandardID : Long = 0,
+        SpotGoodsBrandID : Long = 0,
+        SpotGoodsPrice : Double,
+        OperateType : Int,
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = SpotAdapter.getErmcpSpotGoodsPriceReqInfo(
+            DeliveryGoodsID, WRStandardID, SpotGoodsBrandID, SpotGoodsPrice, OperateType
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FunCode_Trade_ErmcpSpotGoodsPriceRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = SpotAdapter.analysisErmcpSpotGoodsPriceRsq(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+
+
+
+}

+ 5 - 4
RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/WarehouseManager.kt

@@ -90,7 +90,7 @@ class WarehouseManager {
     ) {
         MyOkHttpUtils().query(
             URL = SPUtils.getInstance()
-                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockApply",
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryAreaStockApply",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<AreaStockApplyData>>>() {
@@ -118,7 +118,7 @@ class WarehouseManager {
     ) {
         MyOkHttpUtils().query(
             URL = SPUtils.getInstance()
-                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockApplySum",
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryAreaStockApplySum",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<AreaStockApplySumData>>>() {
@@ -138,6 +138,7 @@ class WarehouseManager {
 
 
     /**
+     *  /Ermcp3/QueryAreaStockReport
      * 查询库存报表
      * @param params Map<String, String>
      *     userid 用户ID
@@ -155,7 +156,7 @@ class WarehouseManager {
     ) {
         MyOkHttpUtils().query(
             URL = SPUtils.getInstance()
-                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockReport",
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryAreaStockReport",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<AreaStockReportData>>>() {
@@ -190,7 +191,7 @@ class WarehouseManager {
     ) {
         MyOkHttpUtils().query(
             URL = SPUtils.getInstance()
-                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockReportDetail",
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryAreaStockReportDetail",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<AreaStockApplyData>>>() {

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

@@ -57,6 +57,10 @@ data class AreaStockApplyData(
     val auditname : String? = "",//审核人名称
     val auditremark : String? = "",//审核备注
     val auditsrc : String? = "",//审核来源 - 1:管理端 2:终端
+    val buynickname :String? = "",//采购方昵称
+    val deliverygoodscode : String? = "",//现货品种代码
+    val deliverygoodsname : String?  ="",////现货品种名称
+    val sellnickname : String? = "",//销售方昵称
     val audittime : String? = "",//审核时间
     val audittradedate : String? = "",//审核交易日(yyyyMMdd)
     val brandname : String? = "",//品牌名称
@@ -128,6 +132,10 @@ data class AreaStockApplyData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
         parcel.createStringArrayList()
     ) {
     }
@@ -143,6 +151,10 @@ data class AreaStockApplyData(
         parcel.writeString(auditname)
         parcel.writeString(auditremark)
         parcel.writeString(auditsrc)
+        parcel.writeString(buynickname)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(sellnickname)
         parcel.writeString(audittime)
         parcel.writeString(audittradedate)
         parcel.writeString(brandname)

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

@@ -13,8 +13,10 @@ data class AreaStockApplySumData(
     val spotcontractid : String? = "",//关联现货合同ID
     val spotgoodsbrandid : String? = "",//品牌id
     val spotgoodsmodelid : String? = "",//型号id
+    val wrstandardid : String? = "",//品类id
+    val wrstandardname : String? = "",//品类名称
     val totalqty : String? = ""//总数量
-) : Parcelable{
+) : Parcelable {
     constructor(parcel: Parcel) : this(
         parcel.readString(),
         parcel.readString(),
@@ -22,6 +24,8 @@ data class AreaStockApplySumData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -33,6 +37,8 @@ data class AreaStockApplySumData(
         parcel.writeString(spotcontractid)
         parcel.writeString(spotgoodsbrandid)
         parcel.writeString(spotgoodsmodelid)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
         parcel.writeString(totalqty)
     }
 

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

@@ -9,8 +9,11 @@ import android.os.Parcelable
 data class AreaStockReportData(
     val brandname : String? = "",//品牌名称
     val curstock : String? = "",//期末库存量
+    val deliverygoodscode : String? = "",//现货品种代码
     val deliverygoodsid : String? = "",//现货品种ID
+    val deliverygoodsname : String? = "",//现货品种名称
     val enumdicname : String? = "",//单位名称
+    val goodsunitid : String? = "",//现货单位id
     val modelname : String? = "",//型号名称
     val oristock : String? = "",//期初库存量
     val spotgoodsbrandid : String? = "",//现货品牌ID
@@ -56,6 +59,9 @@ data class AreaStockReportData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
         parcel.createStringArrayList()
     ) {
     }
@@ -63,8 +69,11 @@ data class AreaStockReportData(
     override fun writeToParcel(parcel: Parcel, flags: Int) {
         parcel.writeString(brandname)
         parcel.writeString(curstock)
+        parcel.writeString(deliverygoodscode)
         parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
         parcel.writeString(enumdicname)
+        parcel.writeString(goodsunitid)
         parcel.writeString(modelname)
         parcel.writeString(oristock)
         parcel.writeString(spotgoodsbrandid)

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

@@ -0,0 +1,326 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 现货商品详情实体
+ */
+data class DeliveryGoodsDetailData(
+    val data : ErmcpDeliveryGoods? = ErmcpDeliveryGoods(),
+    val gblist : List<Ermcp3Brand>? = arrayListOf(),
+    val gmlist : List<ErmcpWrstandard>? = arrayListOf(),
+    val goodslist : List<ErmcpRelatedGoods>? = arrayListOf(),
+    val wrslist : List<WRSConverTDetail>? = arrayListOf()
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readParcelable(ErmcpDeliveryGoods::class.java.classLoader),
+        parcel.createTypedArrayList(Ermcp3Brand),
+        parcel.createTypedArrayList(ErmcpWrstandard),
+        parcel.createTypedArrayList(ErmcpRelatedGoods),
+        parcel.createTypedArrayList(WRSConverTDetail)
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeParcelable(data, flags)
+        parcel.writeTypedList(gblist)
+        parcel.writeTypedList(gmlist)
+        parcel.writeTypedList(goodslist)
+        parcel.writeTypedList(wrslist)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<DeliveryGoodsDetailData> {
+        override fun createFromParcel(parcel: Parcel): DeliveryGoodsDetailData {
+            return DeliveryGoodsDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<DeliveryGoodsDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}
+
+data class ErmcpDeliveryGoods(
+    val agreeunit : String? = "",//合约单位[散货时默认为1, 整装时默认为标准数量]
+    val areauserid: String? = "",//所属机构
+    val auditflag : String? = "",//交割是否需要审核 - 0:不需要 1:需要审核 默认为0
+    val categoryid : String? = "",//类别ID(SEQ_WRCATEGORY)
+    val deliverygoodscode : String? = "",//现货品种代码
+    val deliverygoodsid : String?  ="",//现货品种ID(SEQ_DELIVERYGOODS)
+    val deliverygoodsname : String? = "",//现货品种名称
+    val deliverygoodstype : String? = "",//现货品种类型: 1-整装不拆分 2-散装记录明细 3:整装拆分 4:散装不记录明细
+    val dgstatus : String? = "",//品种状态 - 作废 - 0:未激活 1:正常
+    val enumdicname : String?  ="",//现货品种单位名称
+    val goodsunitid : String? ="",//现货品种单位ID
+    val isvalid : String? ="",//是否有效 - 0:无效 1:有效
+    val qtydecimalplace : String? = "",//成交量小数位
+    val remark : String? = "",//备注
+    val standardqty : String?  = "",//标准数量(库位数量) [标准品特有]
+    val standardqtyrange : String? = ""//标准数量偏差范围 [标准品特有]
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        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(agreeunit)
+        parcel.writeString(areauserid)
+        parcel.writeString(auditflag)
+        parcel.writeString(categoryid)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(deliverygoodstype)
+        parcel.writeString(dgstatus)
+        parcel.writeString(enumdicname)
+        parcel.writeString(goodsunitid)
+        parcel.writeString(isvalid)
+        parcel.writeString(qtydecimalplace)
+        parcel.writeString(remark)
+        parcel.writeString(standardqty)
+        parcel.writeString(standardqtyrange)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ErmcpDeliveryGoods> {
+        override fun createFromParcel(parcel: Parcel): ErmcpDeliveryGoods {
+            return ErmcpDeliveryGoods(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ErmcpDeliveryGoods?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+data class Ermcp3Brand(
+    val areauserid : String? = "",//用户id
+    val brandid : String? = "",//品牌id
+    val brandname : String? = "",//品牌名称
+    val deliverygoodsid : String? = ""//品种ID
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(brandid)
+        parcel.writeString(brandname)
+        parcel.writeString(deliverygoodsid)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<Ermcp3Brand> {
+        override fun createFromParcel(parcel: Parcel): Ermcp3Brand {
+            return Ermcp3Brand(parcel)
+        }
+
+        override fun newArray(size: Int): Array<Ermcp3Brand?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+data class ErmcpWrstandard(
+    val areauserid : String? = "",//所属机构
+    val createtime : String? = "",//创建时间
+    val creatorid : String?  ="",//创建人
+    val deliverygoodsid : String? = "",//品种ID
+    val enumdicname : String? = "",//单位名称
+    val isvalid : String? = "",//是否有效 0-无效(停用) 1-有效(正常)
+    val minivalue : String?  ="",//最小变动值
+    val minivaluedp : String? = "",//最小变动值小数位
+    val realminivalue : String? = "",//实际最小变动值
+    val realminivaluedp : String? = "",//实际最小变动值小数位
+    val remark : String? = "",//备注
+    val unitid : String?  ="",//单位ID
+    val updatetime : String? = "",//更新时间
+    val wrstandardcode : String? = "",//现货商品代码
+    val wrstandardid : String? = "",//现货商品ID(SEQ_WRSTANDARD)
+    val wrstandardname : String? = ""//现货商品名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        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(areauserid)
+        parcel.writeString(createtime)
+        parcel.writeString(creatorid)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(enumdicname)
+        parcel.writeString(isvalid)
+        parcel.writeString(minivalue)
+        parcel.writeString(minivaluedp)
+        parcel.writeString(realminivalue)
+        parcel.writeString(realminivaluedp)
+        parcel.writeString(remark)
+        parcel.writeString(unitid)
+        parcel.writeString(updatetime)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ErmcpWrstandard> {
+        override fun createFromParcel(parcel: Parcel): ErmcpWrstandard {
+            return ErmcpWrstandard(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ErmcpWrstandard?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+data class ErmcpRelatedGoods(
+    val deliverygoodsid : String? = "",//品种ID
+    val goodscode : String? = "",//品种ID
+    val goodsid: String? = "",//商品id
+    val goodsname : String? = ""//商品名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ErmcpRelatedGoods> {
+        override fun createFromParcel(parcel: Parcel): ErmcpRelatedGoods {
+            return ErmcpRelatedGoods(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ErmcpRelatedGoods?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+data class WRSConverTDetail(
+    val convertratio : String? = "",//套保系数
+    val deliverygoodscode :String?  ="",//现货商品代码
+    val deliverygoodsid : String? = "",//现货品种ID
+    val deliverygoodsname : String? = "",//现货商品名称
+    val enumdicname :String? = "",//单位名称
+    val goodsunitid :String? ="",//套保品种单位id
+    val middlegoodscode :String? = "",//套保品种代码
+    val middlegoodsid : String? = "",//套保品种ID
+    val middlegoodsname : String? = "",//套保品种名称
+    val modifytime : String? = "",//修改时间
+    val wrstandardid : String? = ""//品类ID
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        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(convertratio)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(enumdicname)
+        parcel.writeString(goodsunitid)
+        parcel.writeString(middlegoodscode)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(middlegoodsname)
+        parcel.writeString(modifytime)
+        parcel.writeString(wrstandardid)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WRSConverTDetail> {
+        override fun createFromParcel(parcel: Parcel): WRSConverTDetail {
+            return WRSConverTDetail(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WRSConverTDetail?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,44 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * Ermcp3/QueryGoodsbrand查询商品品牌
+ */
+data class Ermcp3GoodsbrandData(
+    val areauserid : String? = "",//用户id
+    val brandid : String? = "",//品牌id
+    val brandname : String? = "",//品牌名称
+    val deliverygoodsid : String? = ""//品种ID
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(brandid)
+        parcel.writeString(brandname)
+        parcel.writeString(deliverygoodsid)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<Ermcp3GoodsbrandData> {
+        override fun createFromParcel(parcel: Parcel): Ermcp3GoodsbrandData {
+            return Ermcp3GoodsbrandData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<Ermcp3GoodsbrandData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -41,7 +41,11 @@ data class FinancialReportData(
     val applyid : String? = "",//操作人
     val applyname : String? = "",//操作人名称
     val biztype : String? = "",//业务类型 - 1:套保计划 2:现货合同
+    val brandname : String? = "",//品牌名称
     val contracttype : String? = "",//现货合同类型 - 1:采购 -1:销售
+    val deliverygoodscode : String? = "",//现货品种代码
+    val deliverygoodsid : String? = "",//现货品种id
+    val deliverygoodsname : String? = "",//现货品种名称
     val enumdicName : String? = "",//单位名称
     val logdatetime : String? = "",//流水日期(时间)
     val logid : String? = "",//流水ID(604+Unix秒时间戳(10位)+xxxxxx)

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

@@ -0,0 +1,101 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 查询商品品类 Ermcp3
+ * @property areauserid String?
+ * @property convertfactor String?
+ * @property createtime String?
+ * @property creatorid String?
+ * @property deliverygoodsid String?
+ * @property enumdicname String?
+ * @property isvalid String?
+ * @property minivalue String?
+ * @property minivaluedp String?
+ * @property realminivalue String?
+ * @property realminivaluedp String?
+ * @property remark String?
+ * @property unitid String?
+ * @property updatetime String?
+ * @property wrstandardcode String?
+ * @property wrstandardid String?
+ * @property wrstandardname String?
+ * @constructor
+ */
+data class GoodsWrstandardData(
+    val areauserid : String? = "",//所属机构
+    val convertfactor : String? = "",//标仓系数
+    val createtime : String? = "",//创建时间
+    val creatorid : String? = "",//创建人
+    val deliverygoodsid : String? = "",//现货品种ID
+    val enumdicname : String? = "",//品类单位名称
+    val isvalid : String? = "",//是否有效 0-无效(停用) 1-有效(正常)
+    val minivalue : String? = "",//最小变动值
+    val minivaluedp : String? = "",//最小变动值小数位
+    val realminivalue : String? = "",//实际最小变动值
+    val realminivaluedp : String? = "",//实际最小变动值小数位
+    val remark : String? = "",//备注
+    val unitid : String? = "",//品类单位ID
+    val updatetime : String? = "",//更新时间
+    val wrstandardcode : String? = "",//品类代码
+    val wrstandardid : String? = "",//品类ID(SEQ_WRSTANDARD)
+    val wrstandardname : String? = ""//品类名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        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(areauserid)
+        parcel.writeString(convertfactor)
+        parcel.writeString(createtime)
+        parcel.writeString(creatorid)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(enumdicname)
+        parcel.writeString(isvalid)
+        parcel.writeString(minivalue)
+        parcel.writeString(minivaluedp)
+        parcel.writeString(realminivalue)
+        parcel.writeString(realminivaluedp)
+        parcel.writeString(remark)
+        parcel.writeString(unitid)
+        parcel.writeString(updatetime)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<GoodsWrstandardData> {
+        override fun createFromParcel(parcel: Parcel): GoodsWrstandardData {
+            return GoodsWrstandardData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<GoodsWrstandardData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,47 @@
+package cn.muchinfo.rma.global.data
+
+/**
+ * 查询现货损益报表(现货损益报表) Ermcp3
+ */
+data class ReportAreaSpotPLData(
+    val actualpl : String? = "",//实际损益
+    val areauserid : String? = "",//所属机构
+    val brandname : String? = "",//品牌名称
+    val curamount : String? = "",//期末额
+    val curaverageprice : String? = "",//期末均价
+    val curbuyamount : String? = "",//期末采购总额(采购额)
+    val curbuyqty : String? = "",//期末采购总量
+    val curmarketvalue : String? = "",//参考市值
+    val curqty : String? = "",//期末量
+    val cursellamount : String? = "",//期末销售总额(销售额)
+    val cursellqty : String? = "",//期末销售总量
+    val curspotprice : String? = "",//参考市价
+    val deliverygoodscode : String? = "",//现货品种代码
+    val deliverygoodsid : String? = "",//现货品种id
+    val deliverygoodsname : String? = "",//现货品种名称
+    val enumdicname : String? = "",//现货商品单位名称
+    val floatpl : String? = "",//浮动损益
+    val gbenumdicname : String? = "",//品类单位名称
+    val gbunitid : String? = "",//现货单位id
+    val modelname : String? = "",//品类名称
+    val oriamount : String? = "",//期初额
+    val oriaverageprice : String? = "",//期初均价
+    val oribuyamount : String? = "",//期初采购总额
+    val oribuyqty : String? = "",//期初采购总量
+    val oriqty : String?  ="",//期初量
+    val orisellamount : String? = "",//期初销售总额
+    val orisellqty : String? = "",//期初销售总量
+    val spotgoodsbrandid : String? = "",//现货品牌ID
+    val todaybuyamount : String? = "",//今日采购额
+    val todaybuyaverageprice : String?  ="",//今日采购均价(采购均价)
+    val todaybuyqty : String? = "",//今日采购量(采购增量)
+    val todaysellamount : String? = "",//今日销售额
+    val todaysellaverageprice : String? = "",//今日销售均价(销售均价)
+    val todaysellqty : String? = "",//今日销售量(销售增量)
+    val unitid : String? = "",//品类单位id
+    val updatetime : String? = "",//更新时间
+    val wrstandardcode : String? = "",//品类代码
+    val wrstandardid : String? = "",//品类ID
+    val wrstandardname : String? = "",//品类名称
+    var rightData : List<String>? = arrayListOf()//组装的右侧数据
+)

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

@@ -0,0 +1,123 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 查询现货市价(现货市价)
+ * @property areauserid String?
+ * @property brandname String?
+ * @property currencyid String?
+ * @property enumdicname String?
+ * @property gbenumdicname String?
+ * @property gmunitid String?
+ * @property isvalid String?
+ * @property modelname String?
+ * @property operateid String?
+ * @property operatesrc String?
+ * @property operatetime String?
+ * @property operatorname String?
+ * @property spotgoodsbrandid String?
+ * @property spotgoodsmodelid String?
+ * @property spotgoodsprice String?
+ * @property tradedate String?
+ * @property unitid String?
+ * @property wrstandardcode String?
+ * @property wrstandardid String?
+ * @property wrstandardname String?
+ * @constructor
+ */
+data class SpotGoodsPriceData(
+    val areauserid : String? = "",//所属机构id
+    val brandname : String? = "",//品牌名称
+    val currencyid : String? = "",//报价货币ID
+    val deliverygoodscode : String?  ="",//现货商品代码
+    val deliverygoodsid : String? = "",//现货商品id
+    val deliverygoodsname : String? = "",//现货商品名称
+    val enumdicname : String? = "",//现货商品单位名称
+    val gbenumdicname : String? = "",//品类单位名称
+    val gmunitid : String?  ="",//品类单位id
+    val isvalid : String? = "",//是否有效 - 0:无效 1:有效
+    val operateid : String?  ="",//最后操作人
+    val operatesrc : String? = "",//最后操作来源 - 1:管理端 2:终端
+    val operatetime : String?  ="",//最后操作时间
+    val operatorname : String?  ="",//操作人名称
+    val spotgoodsbrandid : String?  ="",//现货品牌ID(通用则为0, 不为0则须先有品类ID)
+    val spotgoodsprice : String? = "",//现货价格
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    val unitid : String? = "",//现货商品单位id
+    val wrstandardcode : String? = "",//品类代码
+    val wrstandardid : String? = "",//现货品类ID(通用则为0)
+    val wrstandardname : String? = "", //品类名称
+    val logid : String? = "",//logid
+    var isClick : Int = 0//是否点击展开
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(brandname)
+        parcel.writeString(currencyid)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(enumdicname)
+        parcel.writeString(gbenumdicname)
+        parcel.writeString(gmunitid)
+        parcel.writeString(isvalid)
+        parcel.writeString(operateid)
+        parcel.writeString(operatesrc)
+        parcel.writeString(operatetime)
+        parcel.writeString(operatorname)
+        parcel.writeString(spotgoodsbrandid)
+        parcel.writeString(spotgoodsprice)
+        parcel.writeString(tradedate)
+        parcel.writeString(unitid)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+        parcel.writeString(logid)
+        parcel.writeInt(isClick)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<SpotGoodsPriceData> {
+        override fun createFromParcel(parcel: Parcel): SpotGoodsPriceData {
+            return SpotGoodsPriceData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<SpotGoodsPriceData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}

+ 20 - 14
RMA/app/src/main/java/cn/muchinfo/rma/global/data/SpotReportData.kt

@@ -20,6 +20,11 @@ data class SpotReportData(
     val areauserid : String? = "",//所属机构T
     val enumdicname : String? = "",//现货商品单位名称
     val reckondate : String? = "",//日照时期(yyyyMMdd)  日报表
+    val buyinqty : String? = "",//采购入库量
+    val deliverygoodscode : String? = "",//现货品种代码
+    val deliverygoodsid : String? = "",//现货品种id
+    val deliverygoodsname : String? = "",//现货品种名称
+    val selloutqty : String? = "",//销售出库量
     val todaybuyreckonqty : String? = "",//采购确定量
     val todaysellreckonqty : String? = "",//销售确定量
     val totalbuypricedqty : String? = "",//采购定价量 = 期末 - 期初
@@ -30,19 +35,20 @@ data class SpotReportData(
     val cycletime : String? = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】月报表
     val cycletype : String? = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】 月报表
     //日月报表详情
-    val applyid : String? = "",
-    val applyname : String? = "",
-    val biztype : String? = "",
-    val contracttype : String? = "",
-    val logdatetime : String? = "",
-    val logid : String? = "",
-    val logtypename : String? = "",
-    val logvalue : String? = "",
-    val operatelogtype : String? = "",
-    val optypename : String? = "",
-    val relatedid : String? = "",
-    val relatedno : String? = "",
-    val tradedate : String? = "",
-    val userid : String? = "",
+    val applyid : String? = "",//操作人
+    val applyname : String? = "",//操作人名称
+    val brandname : String? = "",//品牌名称
+    val biztype : String? = "",//业务类型 - 1:套保计划 2:现货合同
+    val contracttype : String? = "",//现货合同类型 - 1:采购 -1:销售
+    val logdatetime : String? = "",//流水日期(时间)
+    val logid : String? = "",//流水ID(604+Unix秒时间戳(10位)+xxxxxx)
+    val logtypename : String? = "",//合同类型(名称)
+    val logvalue : String? = "",//数值
+    val operatelogtype : String? = "",//操作流水类型 -
+    val optypename : String? = "",//流水类型名称
+    val relatedid : String? = "",//现货合同ID\套保计划
+    val relatedno : String? = "",//合同编号
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    val userid : String? = "",//机构ID
     var indexSelect: Int = 0
 )

+ 164 - 164
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java

@@ -66418,7 +66418,7 @@ public final class ManageServiceMI2 {
 
     /**
      * <pre>
-     * uint64 �û�ID
+     * uint64 �û�IDs
      * </pre>
      *
      * <code>optional uint64 userid = 4;</code>
@@ -66427,7 +66427,7 @@ public final class ManageServiceMI2 {
     boolean hasUserid();
     /**
      * <pre>
-     * uint64 �û�ID
+     * uint64 �û�IDs
      * </pre>
      *
      * <code>optional uint64 userid = 4;</code>
@@ -66701,7 +66701,7 @@ public final class ManageServiceMI2 {
     private long userid_;
     /**
      * <pre>
-     * uint64 �û�ID
+     * uint64 �û�IDs
      * </pre>
      *
      * <code>optional uint64 userid = 4;</code>
@@ -66713,7 +66713,7 @@ public final class ManageServiceMI2 {
     }
     /**
      * <pre>
-     * uint64 �û�ID
+     * uint64 �û�IDs
      * </pre>
      *
      * <code>optional uint64 userid = 4;</code>
@@ -67503,7 +67503,7 @@ public final class ManageServiceMI2 {
       private long userid_ ;
       /**
        * <pre>
-       * uint64 �û�ID
+       * uint64 �û�IDs
        * </pre>
        *
        * <code>optional uint64 userid = 4;</code>
@@ -67515,7 +67515,7 @@ public final class ManageServiceMI2 {
       }
       /**
        * <pre>
-       * uint64 �û�ID
+       * uint64 �û�IDs
        * </pre>
        *
        * <code>optional uint64 userid = 4;</code>
@@ -67527,7 +67527,7 @@ public final class ManageServiceMI2 {
       }
       /**
        * <pre>
-       * uint64 �û�ID
+       * uint64 �û�IDs
        * </pre>
        *
        * <code>optional uint64 userid = 4;</code>
@@ -67542,7 +67542,7 @@ public final class ManageServiceMI2 {
       }
       /**
        * <pre>
-       * uint64 �û�ID
+       * uint64 �û�IDs
        * </pre>
        *
        * <code>optional uint64 userid = 4;</code>
@@ -67695,41 +67695,41 @@ public final class ManageServiceMI2 {
 
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 �ֻ�Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return Whether the wRStandardID field is set.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return Whether the deliveryGoodsID field is set.
      */
-    boolean hasWRStandardID();
+    boolean hasDeliveryGoodsID();
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 �ֻ�Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return The wRStandardID.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return The deliveryGoodsID.
      */
-    long getWRStandardID();
+    long getDeliveryGoodsID();
 
     /**
      * <pre>
      * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
      * </pre>
      *
-     * <code>optional uint64 SpotGoodsModelID = 3;</code>
-     * @return Whether the spotGoodsModelID field is set.
+     * <code>optional uint64 WRStandardID = 3;</code>
+     * @return Whether the wRStandardID field is set.
      */
-    boolean hasSpotGoodsModelID();
+    boolean hasWRStandardID();
     /**
      * <pre>
      * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
      * </pre>
      *
-     * <code>optional uint64 SpotGoodsModelID = 3;</code>
-     * @return The spotGoodsModelID.
+     * <code>optional uint64 WRStandardID = 3;</code>
+     * @return The wRStandardID.
      */
-    long getSpotGoodsModelID();
+    long getWRStandardID();
 
     /**
      * <pre>
@@ -67940,12 +67940,12 @@ public final class ManageServiceMI2 {
             }
             case 16: {
               bitField0_ |= 0x00000002;
-              wRStandardID_ = input.readUInt64();
+              deliveryGoodsID_ = input.readUInt64();
               break;
             }
             case 24: {
               bitField0_ |= 0x00000004;
-              spotGoodsModelID_ = input.readUInt64();
+              wRStandardID_ = input.readUInt64();
               break;
             }
             case 32: {
@@ -68055,45 +68055,45 @@ public final class ManageServiceMI2 {
       return header_ == null ? cn.muchinfo.rma.protobuf.protoclasses.Common.MessageHead.getDefaultInstance() : header_;
     }
 
-    public static final int WRSTANDARDID_FIELD_NUMBER = 2;
-    private long wRStandardID_;
+    public static final int DELIVERYGOODSID_FIELD_NUMBER = 2;
+    private long deliveryGoodsID_;
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 �ֻ�Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return Whether the wRStandardID field is set.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return Whether the deliveryGoodsID field is set.
      */
     @java.lang.Override
-    public boolean hasWRStandardID() {
+    public boolean hasDeliveryGoodsID() {
       return ((bitField0_ & 0x00000002) != 0);
     }
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 �ֻ�Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return The wRStandardID.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return The deliveryGoodsID.
      */
     @java.lang.Override
-    public long getWRStandardID() {
-      return wRStandardID_;
+    public long getDeliveryGoodsID() {
+      return deliveryGoodsID_;
     }
 
-    public static final int SPOTGOODSMODELID_FIELD_NUMBER = 3;
-    private long spotGoodsModelID_;
+    public static final int WRSTANDARDID_FIELD_NUMBER = 3;
+    private long wRStandardID_;
     /**
      * <pre>
      * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
      * </pre>
      *
-     * <code>optional uint64 SpotGoodsModelID = 3;</code>
-     * @return Whether the spotGoodsModelID field is set.
+     * <code>optional uint64 WRStandardID = 3;</code>
+     * @return Whether the wRStandardID field is set.
      */
     @java.lang.Override
-    public boolean hasSpotGoodsModelID() {
+    public boolean hasWRStandardID() {
       return ((bitField0_ & 0x00000004) != 0);
     }
     /**
@@ -68101,12 +68101,12 @@ public final class ManageServiceMI2 {
      * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
      * </pre>
      *
-     * <code>optional uint64 SpotGoodsModelID = 3;</code>
-     * @return The spotGoodsModelID.
+     * <code>optional uint64 WRStandardID = 3;</code>
+     * @return The wRStandardID.
      */
     @java.lang.Override
-    public long getSpotGoodsModelID() {
-      return spotGoodsModelID_;
+    public long getWRStandardID() {
+      return wRStandardID_;
     }
 
     public static final int SPOTGOODSBRANDID_FIELD_NUMBER = 4;
@@ -68349,10 +68349,10 @@ public final class ManageServiceMI2 {
         output.writeMessage(1, getHeader());
       }
       if (((bitField0_ & 0x00000002) != 0)) {
-        output.writeUInt64(2, wRStandardID_);
+        output.writeUInt64(2, deliveryGoodsID_);
       }
       if (((bitField0_ & 0x00000004) != 0)) {
-        output.writeUInt64(3, spotGoodsModelID_);
+        output.writeUInt64(3, wRStandardID_);
       }
       if (((bitField0_ & 0x00000008) != 0)) {
         output.writeUInt64(4, spotGoodsBrandID_);
@@ -68390,11 +68390,11 @@ public final class ManageServiceMI2 {
       }
       if (((bitField0_ & 0x00000002) != 0)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeUInt64Size(2, wRStandardID_);
+          .computeUInt64Size(2, deliveryGoodsID_);
       }
       if (((bitField0_ & 0x00000004) != 0)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeUInt64Size(3, spotGoodsModelID_);
+          .computeUInt64Size(3, wRStandardID_);
       }
       if (((bitField0_ & 0x00000008) != 0)) {
         size += com.google.protobuf.CodedOutputStream
@@ -68443,16 +68443,16 @@ public final class ManageServiceMI2 {
         if (!getHeader()
             .equals(other.getHeader())) return false;
       }
+      if (hasDeliveryGoodsID() != other.hasDeliveryGoodsID()) return false;
+      if (hasDeliveryGoodsID()) {
+        if (getDeliveryGoodsID()
+            != other.getDeliveryGoodsID()) return false;
+      }
       if (hasWRStandardID() != other.hasWRStandardID()) return false;
       if (hasWRStandardID()) {
         if (getWRStandardID()
             != other.getWRStandardID()) return false;
       }
-      if (hasSpotGoodsModelID() != other.hasSpotGoodsModelID()) return false;
-      if (hasSpotGoodsModelID()) {
-        if (getSpotGoodsModelID()
-            != other.getSpotGoodsModelID()) return false;
-      }
       if (hasSpotGoodsBrandID() != other.hasSpotGoodsBrandID()) return false;
       if (hasSpotGoodsBrandID()) {
         if (getSpotGoodsBrandID()
@@ -68504,16 +68504,16 @@ public final class ManageServiceMI2 {
         hash = (37 * hash) + HEADER_FIELD_NUMBER;
         hash = (53 * hash) + getHeader().hashCode();
       }
+      if (hasDeliveryGoodsID()) {
+        hash = (37 * hash) + DELIVERYGOODSID_FIELD_NUMBER;
+        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+            getDeliveryGoodsID());
+      }
       if (hasWRStandardID()) {
         hash = (37 * hash) + WRSTANDARDID_FIELD_NUMBER;
         hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
             getWRStandardID());
       }
-      if (hasSpotGoodsModelID()) {
-        hash = (37 * hash) + SPOTGOODSMODELID_FIELD_NUMBER;
-        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
-            getSpotGoodsModelID());
-      }
       if (hasSpotGoodsBrandID()) {
         hash = (37 * hash) + SPOTGOODSBRANDID_FIELD_NUMBER;
         hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
@@ -68690,9 +68690,9 @@ public final class ManageServiceMI2 {
           headerBuilder_.clear();
         }
         bitField0_ = (bitField0_ & ~0x00000001);
-        wRStandardID_ = 0L;
+        deliveryGoodsID_ = 0L;
         bitField0_ = (bitField0_ & ~0x00000002);
-        spotGoodsModelID_ = 0L;
+        wRStandardID_ = 0L;
         bitField0_ = (bitField0_ & ~0x00000004);
         spotGoodsBrandID_ = 0L;
         bitField0_ = (bitField0_ & ~0x00000008);
@@ -68745,11 +68745,11 @@ public final class ManageServiceMI2 {
           to_bitField0_ |= 0x00000001;
         }
         if (((from_bitField0_ & 0x00000002) != 0)) {
-          result.wRStandardID_ = wRStandardID_;
+          result.deliveryGoodsID_ = deliveryGoodsID_;
           to_bitField0_ |= 0x00000002;
         }
         if (((from_bitField0_ & 0x00000004) != 0)) {
-          result.spotGoodsModelID_ = spotGoodsModelID_;
+          result.wRStandardID_ = wRStandardID_;
           to_bitField0_ |= 0x00000004;
         }
         if (((from_bitField0_ & 0x00000008) != 0)) {
@@ -68832,12 +68832,12 @@ public final class ManageServiceMI2 {
         if (other.hasHeader()) {
           mergeHeader(other.getHeader());
         }
+        if (other.hasDeliveryGoodsID()) {
+          setDeliveryGoodsID(other.getDeliveryGoodsID());
+        }
         if (other.hasWRStandardID()) {
           setWRStandardID(other.getWRStandardID());
         }
-        if (other.hasSpotGoodsModelID()) {
-          setSpotGoodsModelID(other.getSpotGoodsModelID());
-        }
         if (other.hasSpotGoodsBrandID()) {
           setSpotGoodsBrandID(other.getSpotGoodsBrandID());
         }
@@ -69047,72 +69047,72 @@ public final class ManageServiceMI2 {
         return headerBuilder_;
       }
 
-      private long wRStandardID_ ;
+      private long deliveryGoodsID_ ;
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 �ֻ�Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
-       * @return Whether the wRStandardID field is set.
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
+       * @return Whether the deliveryGoodsID field is set.
        */
       @java.lang.Override
-      public boolean hasWRStandardID() {
+      public boolean hasDeliveryGoodsID() {
         return ((bitField0_ & 0x00000002) != 0);
       }
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 �ֻ�Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
-       * @return The wRStandardID.
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
+       * @return The deliveryGoodsID.
        */
       @java.lang.Override
-      public long getWRStandardID() {
-        return wRStandardID_;
+      public long getDeliveryGoodsID() {
+        return deliveryGoodsID_;
       }
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 �ֻ�Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
-       * @param value The wRStandardID to set.
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
+       * @param value The deliveryGoodsID to set.
        * @return This builder for chaining.
        */
-      public Builder setWRStandardID(long value) {
+      public Builder setDeliveryGoodsID(long value) {
         bitField0_ |= 0x00000002;
-        wRStandardID_ = value;
+        deliveryGoodsID_ = value;
         onChanged();
         return this;
       }
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 �ֻ�Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
        * @return This builder for chaining.
        */
-      public Builder clearWRStandardID() {
+      public Builder clearDeliveryGoodsID() {
         bitField0_ = (bitField0_ & ~0x00000002);
-        wRStandardID_ = 0L;
+        deliveryGoodsID_ = 0L;
         onChanged();
         return this;
       }
 
-      private long spotGoodsModelID_ ;
+      private long wRStandardID_ ;
       /**
        * <pre>
        * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
        * </pre>
        *
-       * <code>optional uint64 SpotGoodsModelID = 3;</code>
-       * @return Whether the spotGoodsModelID field is set.
+       * <code>optional uint64 WRStandardID = 3;</code>
+       * @return Whether the wRStandardID field is set.
        */
       @java.lang.Override
-      public boolean hasSpotGoodsModelID() {
+      public boolean hasWRStandardID() {
         return ((bitField0_ & 0x00000004) != 0);
       }
       /**
@@ -69120,25 +69120,25 @@ public final class ManageServiceMI2 {
        * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
        * </pre>
        *
-       * <code>optional uint64 SpotGoodsModelID = 3;</code>
-       * @return The spotGoodsModelID.
+       * <code>optional uint64 WRStandardID = 3;</code>
+       * @return The wRStandardID.
        */
       @java.lang.Override
-      public long getSpotGoodsModelID() {
-        return spotGoodsModelID_;
+      public long getWRStandardID() {
+        return wRStandardID_;
       }
       /**
        * <pre>
        * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
        * </pre>
        *
-       * <code>optional uint64 SpotGoodsModelID = 3;</code>
-       * @param value The spotGoodsModelID to set.
+       * <code>optional uint64 WRStandardID = 3;</code>
+       * @param value The wRStandardID to set.
        * @return This builder for chaining.
        */
-      public Builder setSpotGoodsModelID(long value) {
+      public Builder setWRStandardID(long value) {
         bitField0_ |= 0x00000004;
-        spotGoodsModelID_ = value;
+        wRStandardID_ = value;
         onChanged();
         return this;
       }
@@ -69147,12 +69147,12 @@ public final class ManageServiceMI2 {
        * uint64 �ֻ�Ʒ��ID(ͨ����Ϊ0)
        * </pre>
        *
-       * <code>optional uint64 SpotGoodsModelID = 3;</code>
+       * <code>optional uint64 WRStandardID = 3;</code>
        * @return This builder for chaining.
        */
-      public Builder clearSpotGoodsModelID() {
+      public Builder clearWRStandardID() {
         bitField0_ = (bitField0_ & ~0x00000004);
-        spotGoodsModelID_ = 0L;
+        wRStandardID_ = 0L;
         onChanged();
         return this;
       }
@@ -90035,71 +90035,71 @@ public final class ManageServiceMI2 {
       "\014 \001(\004\"y\n\026LoginaccountOperateRsp\022\034\n\006Heade" +
       "r\030\001 \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017" +
       "\n\007RetDesc\030\003 \001(\t\022\016\n\006userid\030\004 \001(\004\022\017\n\007login" +
-      "id\030\005 \001(\004\"\373\001\n\026ErmcpSpotGoodsPriceReq\022\034\n\006H" +
-      "eader\030\001 \001(\0132\014.MessageHead\022\024\n\014WRStandardI" +
-      "D\030\002 \001(\004\022\030\n\020SpotGoodsModelID\030\003 \001(\004\022\030\n\020Spo" +
-      "tGoodsBrandID\030\004 \001(\004\022\022\n\nCurrencyID\030\005 \001(\004\022" +
-      "\026\n\016SpotGoodsPrice\030\006 \001(\001\022\021\n\tTradeDate\030\007 \001" +
-      "(\t\022\022\n\nOperateSrc\030\010 \001(\005\022\021\n\tOperateID\030\t \001(" +
-      "\004\022\023\n\013OperateType\030\n \001(\005\"X\n\026ErmcpSpotGoods" +
-      "PriceRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017" +
-      "\n\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\"\365\002\n\021Erm" +
-      "cpHedgePlanReq\022\034\n\006Header\030\001 \001(\0132\014.Message" +
-      "Head\022\023\n\013HedgePlanID\030\002 \001(\004\022\023\n\013HedgePlanNo" +
-      "\030\003 \001(\t\022\024\n\014ContractType\030\004 \001(\005\022\022\n\nAreaUser" +
-      "ID\030\005 \001(\004\022\027\n\017DeliveryGoodsID\030\006 \001(\004\022\024\n\014WrS" +
-      "tandardID\030\007 \001(\004\022\023\n\013ProductType\030\010 \001(\005\022\025\n\r" +
-      "SpotGoodsDesc\030\t \001(\t\022\017\n\007PlanQty\030\n \001(\001\022\025\n\r" +
-      "ConvertFactor\030\013 \001(\001\022\020\n\010PlanTime\030\014 \001(\t\022\021\n" +
-      "\tTradeDate\030\r \001(\t\022\020\n\010ApplySrc\030\016 \001(\005\022\017\n\007Ap" +
-      "plyId\030\017 \001(\004\022\016\n\006Remark\030\020 \001(\t\022\023\n\013OperateTy" +
-      "pe\030\021 \001(\005\"S\n\021ErmcpHedgePlanRsp\022\034\n\006Header\030" +
-      "\001 \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007" +
-      "RetDesc\030\003 \001(\t\"\355\005\n\020SpotContractInfo\022\022\n\nCo" +
-      "ntractNo\030\001 \001(\t\022\024\n\014ContractType\030\002 \001(\005\022\016\n\006" +
-      "UserID\030\003 \001(\r\022\021\n\tBuyUserID\030\004 \001(\r\022\022\n\nSellU" +
-      "serID\030\005 \001(\r\022\020\n\010SignDate\030\006 \001(\t\022\032\n\022Contrac" +
-      "tAttachment\030\007 \001(\014\022\026\n\016ContractMargin\030\010 \001(" +
-      "\001\022\027\n\017DeliveryGoodsID\030\t \001(\r\022\024\n\014WrStandard" +
-      "ID\030\n \001(\r\022\017\n\007BrandID\030\013 \001(\t\022\023\n\013ProductType" +
-      "\030\014 \001(\r\022\025\n\rConvertFactor\030\r \001(\001\022\025\n\rSpotGoo" +
-      "dsDesc\030\016 \001(\t\022\021\n\tPriceType\030\017 \001(\r\022\013\n\003Qty\030\020" +
-      " \001(\001\022\r\n\005Price\030\021 \001(\001\022\016\n\006Amount\030\022 \001(\001\022\031\n\021D" +
-      "eliveryStartDate\030\023 \001(\t\022\027\n\017DeliveryEndDat" +
-      "e\030\024 \001(\t\022\017\n\007GoodsID\030\025 \001(\r\022\021\n\tPriceMove\030\026 " +
-      "\001(\001\022\021\n\tStartDate\030\027 \001(\t\022\017\n\007EndDate\030\030 \001(\t\022" +
-      "\021\n\tPointDesc\030\031 \001(\t\022\024\n\014DeliveryDesc\030\032 \001(\t" +
-      "\022\021\n\tMerUserID\030\033 \001(\r\022\023\n\013TradeUserID\030\034 \001(\r" +
-      "\022\021\n\tPricedQty\030\035 \001(\001\022\024\n\014PricedAmount\030\036 \001(" +
-      "\001\022\030\n\020SpotGoodsModelID\030\037 \001(\r\022\030\n\020SpotGoods" +
-      "BrandID\030  \001(\r\022\016\n\006Remark\030! \001(\t\022\022\n\nSaleUse" +
-      "rID\030\" \001(\r\022\021\n\tAccountID\030# \001(\004\022\017\n\007BizType\030" +
-      "$ \001(\r\"\344\001\n\033ErmcpSpotContractOperateReq\022\034\n" +
-      "\006Header\030\001 \001(\0132\014.MessageHead\022\026\n\016SpotContr" +
-      "actID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022\022\n\nOper" +
-      "ateSrc\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006Remark\030\006" +
-      " \001(\t\022\024\n\014ClientTicket\030\007 \001(\t\0220\n\004Info\030\010 \001(\013" +
-      "2\".ManageServiceMI2.SpotContractInfo\"\264\001\n" +
-      "\033ErmcpSpotContractOperateRsp\022\034\n\006Header\030\001" +
+      "id\030\005 \001(\004\"\372\001\n\026ErmcpSpotGoodsPriceReq\022\034\n\006H" +
+      "eader\030\001 \001(\0132\014.MessageHead\022\027\n\017DeliveryGoo" +
+      "dsID\030\002 \001(\004\022\024\n\014WRStandardID\030\003 \001(\004\022\030\n\020Spot" +
+      "GoodsBrandID\030\004 \001(\004\022\022\n\nCurrencyID\030\005 \001(\004\022\026" +
+      "\n\016SpotGoodsPrice\030\006 \001(\001\022\021\n\tTradeDate\030\007 \001(" +
+      "\t\022\022\n\nOperateSrc\030\010 \001(\005\022\021\n\tOperateID\030\t \001(\004" +
+      "\022\023\n\013OperateType\030\n \001(\005\"X\n\026ErmcpSpotGoodsP" +
+      "riceRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n" +
+      "\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\"\365\002\n\021Ermc" +
+      "pHedgePlanReq\022\034\n\006Header\030\001 \001(\0132\014.MessageH" +
+      "ead\022\023\n\013HedgePlanID\030\002 \001(\004\022\023\n\013HedgePlanNo\030" +
+      "\003 \001(\t\022\024\n\014ContractType\030\004 \001(\005\022\022\n\nAreaUserI" +
+      "D\030\005 \001(\004\022\027\n\017DeliveryGoodsID\030\006 \001(\004\022\024\n\014WrSt" +
+      "andardID\030\007 \001(\004\022\023\n\013ProductType\030\010 \001(\005\022\025\n\rS" +
+      "potGoodsDesc\030\t \001(\t\022\017\n\007PlanQty\030\n \001(\001\022\025\n\rC" +
+      "onvertFactor\030\013 \001(\001\022\020\n\010PlanTime\030\014 \001(\t\022\021\n\t" +
+      "TradeDate\030\r \001(\t\022\020\n\010ApplySrc\030\016 \001(\005\022\017\n\007App" +
+      "lyId\030\017 \001(\004\022\016\n\006Remark\030\020 \001(\t\022\023\n\013OperateTyp" +
+      "e\030\021 \001(\005\"S\n\021ErmcpHedgePlanRsp\022\034\n\006Header\030\001" +
       " \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007R" +
-      "etDesc\030\003 \001(\t\022\026\n\016SpotContractID\030\004 \001(\004\022\023\n\013" +
-      "OperateType\030\005 \001(\r\022\022\n\nOperateSrc\030\006 \001(\r\022\024\n" +
-      "\014ClientTicket\030\007 \001(\t\"n\n\030ContractOperateAp" +
-      "plyInfo\022\030\n\020OperateApplyType\030\001 \001(\r\022\021\n\tRel" +
-      "atedID\030\002 \001(\004\022\022\n\nDetailJson\030\003 \001(\014\022\021\n\tAtta" +
-      "chUrl\030\004 \001(\014\"\355\001\n\034ErmcpContractOperateAppl" +
-      "yReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\026\n\016Op" +
-      "erateApplyID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022" +
-      "\022\n\nOperateSrc\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006R" +
-      "emark\030\006 \001(\t\022\024\n\014ClientTicket\030\007 \001(\t\0228\n\004Inf" +
-      "o\030\010 \001(\0132*.ManageServiceMI2.ContractOpera" +
-      "teApplyInfo\"\265\001\n\034ErmcpContractOperateAppl" +
-      "yRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n\007Re" +
-      "tCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\026\n\016OperateA" +
-      "pplyID\030\004 \001(\004\022\023\n\013OperateType\030\005 \001(\r\022\022\n\nOpe" +
-      "rateSrc\030\006 \001(\r\022\024\n\014ClientTicket\030\007 \001(\tB?\n%c" +
-      "n.muchinfo.rma.protobuf.protoclassesZ\026co" +
-      "m.muchinfo.mtp.proto"
+      "etDesc\030\003 \001(\t\"\355\005\n\020SpotContractInfo\022\022\n\nCon" +
+      "tractNo\030\001 \001(\t\022\024\n\014ContractType\030\002 \001(\005\022\016\n\006U" +
+      "serID\030\003 \001(\r\022\021\n\tBuyUserID\030\004 \001(\r\022\022\n\nSellUs" +
+      "erID\030\005 \001(\r\022\020\n\010SignDate\030\006 \001(\t\022\032\n\022Contract" +
+      "Attachment\030\007 \001(\014\022\026\n\016ContractMargin\030\010 \001(\001" +
+      "\022\027\n\017DeliveryGoodsID\030\t \001(\r\022\024\n\014WrStandardI" +
+      "D\030\n \001(\r\022\017\n\007BrandID\030\013 \001(\t\022\023\n\013ProductType\030" +
+      "\014 \001(\r\022\025\n\rConvertFactor\030\r \001(\001\022\025\n\rSpotGood" +
+      "sDesc\030\016 \001(\t\022\021\n\tPriceType\030\017 \001(\r\022\013\n\003Qty\030\020 " +
+      "\001(\001\022\r\n\005Price\030\021 \001(\001\022\016\n\006Amount\030\022 \001(\001\022\031\n\021De" +
+      "liveryStartDate\030\023 \001(\t\022\027\n\017DeliveryEndDate" +
+      "\030\024 \001(\t\022\017\n\007GoodsID\030\025 \001(\r\022\021\n\tPriceMove\030\026 \001" +
+      "(\001\022\021\n\tStartDate\030\027 \001(\t\022\017\n\007EndDate\030\030 \001(\t\022\021" +
+      "\n\tPointDesc\030\031 \001(\t\022\024\n\014DeliveryDesc\030\032 \001(\t\022" +
+      "\021\n\tMerUserID\030\033 \001(\r\022\023\n\013TradeUserID\030\034 \001(\r\022" +
+      "\021\n\tPricedQty\030\035 \001(\001\022\024\n\014PricedAmount\030\036 \001(\001" +
+      "\022\030\n\020SpotGoodsModelID\030\037 \001(\r\022\030\n\020SpotGoodsB" +
+      "randID\030  \001(\r\022\016\n\006Remark\030! \001(\t\022\022\n\nSaleUser" +
+      "ID\030\" \001(\r\022\021\n\tAccountID\030# \001(\004\022\017\n\007BizType\030$" +
+      " \001(\r\"\344\001\n\033ErmcpSpotContractOperateReq\022\034\n\006" +
+      "Header\030\001 \001(\0132\014.MessageHead\022\026\n\016SpotContra" +
+      "ctID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022\022\n\nOpera" +
+      "teSrc\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006Remark\030\006 " +
+      "\001(\t\022\024\n\014ClientTicket\030\007 \001(\t\0220\n\004Info\030\010 \001(\0132" +
+      "\".ManageServiceMI2.SpotContractInfo\"\264\001\n\033" +
+      "ErmcpSpotContractOperateRsp\022\034\n\006Header\030\001 " +
+      "\001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007Re" +
+      "tDesc\030\003 \001(\t\022\026\n\016SpotContractID\030\004 \001(\004\022\023\n\013O" +
+      "perateType\030\005 \001(\r\022\022\n\nOperateSrc\030\006 \001(\r\022\024\n\014" +
+      "ClientTicket\030\007 \001(\t\"n\n\030ContractOperateApp" +
+      "lyInfo\022\030\n\020OperateApplyType\030\001 \001(\r\022\021\n\tRela" +
+      "tedID\030\002 \001(\004\022\022\n\nDetailJson\030\003 \001(\014\022\021\n\tAttac" +
+      "hUrl\030\004 \001(\014\"\355\001\n\034ErmcpContractOperateApply" +
+      "Req\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\026\n\016Ope" +
+      "rateApplyID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022\022" +
+      "\n\nOperateSrc\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006Re" +
+      "mark\030\006 \001(\t\022\024\n\014ClientTicket\030\007 \001(\t\0228\n\004Info" +
+      "\030\010 \001(\0132*.ManageServiceMI2.ContractOperat" +
+      "eApplyInfo\"\265\001\n\034ErmcpContractOperateApply" +
+      "Rsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n\007Ret" +
+      "Code\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\026\n\016OperateAp" +
+      "plyID\030\004 \001(\004\022\023\n\013OperateType\030\005 \001(\r\022\022\n\nOper" +
+      "ateSrc\030\006 \001(\r\022\024\n\014ClientTicket\030\007 \001(\tB?\n%cn" +
+      ".muchinfo.rma.protobuf.protoclassesZ\026com" +
+      ".muchinfo.mtp.proto"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -90371,7 +90371,7 @@ public final class ManageServiceMI2 {
     internal_static_ManageServiceMI2_ErmcpSpotGoodsPriceReq_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_ManageServiceMI2_ErmcpSpotGoodsPriceReq_descriptor,
-        new java.lang.String[] { "Header", "WRStandardID", "SpotGoodsModelID", "SpotGoodsBrandID", "CurrencyID", "SpotGoodsPrice", "TradeDate", "OperateSrc", "OperateID", "OperateType", });
+        new java.lang.String[] { "Header", "DeliveryGoodsID", "WRStandardID", "SpotGoodsBrandID", "CurrencyID", "SpotGoodsPrice", "TradeDate", "OperateSrc", "OperateID", "OperateType", });
     internal_static_ManageServiceMI2_ErmcpSpotGoodsPriceRsp_descriptor =
       getDescriptor().getMessageTypes().get(44);
     internal_static_ManageServiceMI2_ErmcpSpotGoodsPriceRsp_fieldAccessorTable = new

+ 4 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/MyApplication.kt

@@ -21,6 +21,7 @@ import cn.muchinfo.rma.business.management.BusinessManager
 import cn.muchinfo.rma.business.quote.QuoteManager
 import cn.muchinfo.rma.business.quote.adapter.QuoteAdapter
 import cn.muchinfo.rma.business.report.ReportManager
+import cn.muchinfo.rma.business.spot.SpotManager
 import cn.muchinfo.rma.business.tradingquery.TradingQueryManager
 import cn.muchinfo.rma.business.warehouse.WarehouseManager
 import cn.muchinfo.rma.global.GlobalDataCollection
@@ -121,6 +122,8 @@ class MyApplication : BaseApplication() {
     /** 仓库相关管理类 */
     var warehouseManager : WarehouseManager? = null
 
+    /*** 现货市价管理类 **/
+    var spotManager : SpotManager? = null
 
     companion object {
         private var instance: MyApplication? = null
@@ -237,6 +240,7 @@ class MyApplication : BaseApplication() {
         futureManager = FutureManager()
         chartManager = ChartManager()
         warehouseManager = WarehouseManager()
+        spotManager = SpotManager()
     }
 
     /**

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

@@ -10,8 +10,8 @@ object Constant {
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
-//      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
-    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // shenzhen01  123123
+      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
+//    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // shenzhen01  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
 
     /**
@@ -114,6 +114,9 @@ object Constant {
     /** 库存报表-出库明细 **/
     const val table_mobile_stock_report_out_detail = "table_mobile_stock_report_out_detail"
 
+    /** 现货损益报表 **/
+    const val table_mobile_report_spot_profit = "table_mobile_report_spot_profit"
+
     /**--------------------------------------------------------------------------------------**/
 
     const val FISTOPENAPP = "first_open_app"

+ 417 - 119
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryActivity.kt

@@ -55,7 +55,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
 
     /** tab标题 **/
     private val tabsArray: List<String> by lazy {
-        arrayListOf("财务报表", "敞口报表", "现货报表", "库存报表")
+        arrayListOf("财务报表", "敞口报表", "现货报表", "库存报表","现货损益报表")
     }
 
     /** 财务报表 **/
@@ -70,6 +70,9 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
     /** 库存报表 ***/
     private val invertoryReportUI by lazy { InvertoryReportUI(this, viewModel) }
 
+    /** 现货损益报表 **/
+    private val spotEarningReportUI by lazy { SpotEarningReportUI(this,viewModel) }
+
     private val pagerAdapter: PagerAdapter by lazy {
         object : PagerAdapter() {
 
@@ -109,6 +112,14 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
                             )
                         }
                     }
+                    4 -> {
+                        return spotEarningReportUI.root.apply {//现货损益报表
+                            container.addView(
+                                this,
+                                ViewGroup.LayoutParams(matchParent, matchParent)
+                            )
+                        }
+                    }
                     else -> return super.instantiateItem(container, position)
                 }
             }
@@ -157,6 +168,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
                         selectedTabIndex = index
                     }
                 })
+                mode = QMUITabSegment.MODE_SCROLLABLE
                 setIndicator(QMUITabIndicator(QMUIDisplayHelper.dp2px(context, 2), false, true))
                 setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
             }.lparams(matchParent, autoSize(100))
@@ -878,110 +890,6 @@ class ExposureReportUI(
                     contentAdapter.setDatas(it)
                 }
             }
-//            linearLayout {
-//                verticalLayout {
-//                    gravity = Gravity.START
-//                    textView {
-//                        text = "套保品种"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent){
-//                        marginStart = autoSize(36)
-//                        topMargin = autoSize(15)
-//                    }
-//
-//                    textView {
-//                        text = "代码"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent){
-//                        marginStart = autoSize(36)
-//                    }
-//                }.lparams(autoSize(225), autoSize(97))
-//
-//                verticalLayout {
-//                    gravity = Gravity.CENTER
-//                    textView {
-//                        text = "现货数量"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent)
-//
-//                    textView {
-//                        text = "应套保比例"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent)
-//                }.lparams(autoSize(225), autoSize(97))
-//
-//                verticalLayout {
-//                    gravity = Gravity.CENTER
-//                    textView {
-//                        text = "期货应套保量"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent)
-//
-//                    textView {
-//                        text = "期货数量"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent)
-//                }.lparams(autoSize(225), autoSize(97))
-//
-//                verticalLayout {
-//                    gravity = Gravity.END
-//                    textView {
-//                        text = "应套保敞口"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent){
-//                        marginEnd = autoSize(36)
-//                        topMargin = autoSize(15)
-//                    }
-//
-//                    textView {
-//                        text = "比例"
-//                        textSizeAuto = 24
-//                        textColorInt = R.color.hint_text_color
-//                    }.lparams(wrapContent, wrapContent){
-//                        marginEnd = autoSize(36)
-//                    }
-//                }.lparams(autoSize(225), autoSize(97))
-//            }.lparams(matchParent, autoSize(97))
-//
-//            statusLayout(contentBlock = {
-//                statusLayout = this
-////                bindTaskStatus(viewModule.status)
-//                swipeToLoadLayout {
-//                    swipeToLayout = this
-//                    setEnableRefresh(false)
-//                    setEnableLoadMore(false)
-//                    setOnRefreshListener {
-//
-//                    }
-//                    setEnableScrollContentWhenLoaded(false)
-//                    setEnableLoadMoreWhenContentNotFull(false)
-//                    recyclerView {
-//                        background = resources.getDrawable(R.color.white)
-//                        adapter = exposureReportAdapter
-//                    }.lparams(matchParent, matchParent)
-//                }
-//            }, emptyBlock = {
-//                emptyView(hint = resources.getString(R.string.now_no_data))
-//            }).lparams(matchParent, matchParent)
-//
-//            viewModel.exposureReportDataList.bindOptional(context){
-//                if (it?.isEmpty() == true || it?.size == 0){
-//                    statusLayout.showEmpty()
-//                }else {
-//                    if (swipeToLayout.getIsRefreshing()){
-//                        swipeToLayout.finishRefresh()
-//                    }
-//                    statusLayout.showSuccess()
-//                    exposureReportAdapter.setNewData(it)
-//                }
-//            }
         }
     }
 }
@@ -1208,7 +1116,403 @@ class SpotReportUI(
 }
 
 /**
- * 仓库报表
+ * 现货收益报表
+ * @property activity AppCompatActivity
+ * @property viewModel ReportQueryViewModel
+ * @constructor
+ */
+class SpotEarningReportUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: ReportQueryViewModel
+) : SpotEarningRecordAdapter.OnContentScrollListener{
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    //列表头部的数据adapter
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    //列表adapter
+    val exposureContentAdapter by lazy {
+        SpotEarningRecordAdapter(activity)
+    }
+
+    /** 选择的现货品种 */
+    private val selectDeiveryData: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+
+    /** 选择的型号品类 **/
+    private val selectWrStandModel: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+
+    /** 选择的品牌 ***/
+    private val selectWrStandBrand: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+
+    /**
+     * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
+     */
+    var tradedate: String = TimeUtils.millis2String(
+        TimeUtils.getNowMills().minus(86400000),
+        SimpleDateFormat("yyyy-MM-dd")
+    )
+
+    /** 查询时间textview **/
+    lateinit var tradedatetextview: TextView
+
+    fun initData(){
+        viewModel.queryDeliveryGoods()//查询现货品种
+        viewModel.queryGoodsWrstandard()//查询品类
+        viewModel.queryGoodsbrand()//查询品牌
+    }
+
+    @RequiresApi(Build.VERSION_CODES.N)
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            initData()
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    onThrottleFirstClick {
+                        if (viewModel.isSelectspotEarningMonthOrDay.value == "1") {
+                            viewModel.isSelectspotEarningMonthOrDay.postValue("2")
+                        } else {
+                            viewModel.isSelectspotEarningMonthOrDay.postValue("1")
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        viewModel.isSelectspotEarningMonthOrDay.bindOptional(context) {
+                            if (it == "1") {
+                                text = "日报表"
+                                exposureContentAdapter.setquerytype("1")
+                            } else if (it == "2") {
+                                text = "月报表"
+                                exposureContentAdapter.setquerytype("2")
+                            }
+                        }
+                        text = "日报表"
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(18)
+                    }
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_down
+                    }.lparams(autoSize(25), autoSize(25)){
+                        marginEnd = autoSize(10)
+                    }
+
+                }.lparams(autoSize(264), autoSize(67)) {
+                    marginStart = autoSize(36)
+                }
+
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.showDataSelectDialog(type = viewModel.isSelectspotEarningMonthOrDay.value.toString()) {
+                            tradedate = this
+                            exposureContentAdapter.setquerydate(this)
+                            tradedatetextview.text = this
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        tradedatetextview = this
+                        text = TimeUtils.millis2String(
+                            TimeUtils.getNowMills().minus(86400000),
+                            SimpleDateFormat("yyyy-MM-dd")
+                        )
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(18)
+                    }
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_search_by_time
+                    }.lparams(autoSize(38), autoSize(38)){
+                        marginEnd = autoSize(10)
+                    }
+                }.lparams(autoSize(264), autoSize(67)) {
+                    marginStart = autoSize(12)
+                }
+
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.creatBottomSheetDialog(
+                            "请选择现货品种",
+                            viewModel.getDeliverySelectData()
+                        ) {
+                            selectDeiveryData.postValue(this)
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        selectDeiveryData.bindOptional(context) {
+                            text = it?.value
+                            textColorInt = R.color.rma_black_33
+                        }
+                        text = "现货品种"
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(18)
+                    }
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_down
+                    }.lparams(autoSize(38), autoSize(38)){
+                        marginEnd = autoSize(10)
+                    }
+                }.lparams(autoSize(264), autoSize(67)) {
+                    marginStart = autoSize(12)
+                }
+
+
+            }.lparams(matchParent, autoSize(100))
+
+            linearLayout {
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.creatBottomSheetDialog(
+                            "请选择品类",
+                            viewModel.getGoodsWrstandardSelectList()
+                        ) {
+                            selectWrStandModel.postValue(this)
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        selectWrStandModel.bindOptional(context) {
+                            text = it?.value
+                            textColorInt = R.color.rma_black_33
+                        }
+                        text = "品类"
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(18)
+                    }
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_down
+                    }.lparams(autoSize(38), autoSize(38)){
+                        marginEnd = autoSize(10)
+                    }
+                }.lparams(0, autoSize(67), 1f) {
+                    marginStart = autoSize(12)
+                }
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.creatBottomSheetDialog(
+                            "请选择品牌",
+                            viewModel.getGoodsBrandSelectList()
+                        ) {
+                            selectWrStandBrand.postValue(this)
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        selectWrStandBrand.bindOptional(context) {
+                            text = it?.value
+                            textColorInt = R.color.rma_black_33
+                        }
+                        text = "品牌"
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(18)
+                    }
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_down
+                    }.lparams(autoSize(38), autoSize(38)){
+                        marginEnd = autoSize(10)
+                    }
+                }.lparams(0, autoSize(67), 1f) {
+                    marginStart = autoSize(12)
+                }
+
+
+                textView {
+                    onThrottleFirstClick {
+                        var querydate = ""
+                        if (viewModel.isSelectspotEarningMonthOrDay.value == "1"){//日报表
+                            querydate = tradedate.replace("-", "")
+                        }else{//月报表
+                            querydate = tradedate.replace("-", "")
+                        }
+                        viewModel.qryReportAreaSpotPL(
+                            querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
+                            querydate = querydate,
+                            deliverygoodsid = selectDeiveryData.value?.id ?: "",
+                            spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
+                            wrstandardid = selectWrStandModel.value?.id ?: ""
+                        )
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
+                    text = "查询"
+                    textSizeAuto = 31
+                    textColorInt = R.color.white
+                }.lparams(autoSize(122), autoSize(67)) {
+                    marginStart = autoSize(12)
+                }
+            }.lparams(matchParent, autoSize(100))
+            //初始化数据进行头部数据请求
+            viewModel.querySpotEarningTitle(
+                querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
+                querydate = tradedate.replace("-", "")
+            )
+            exposureContentAdapter.setOnContentScrollListener(this@SpotEarningReportUI)
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//头部右侧数据
+                        viewModel.spotEarningRecordTitle.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 24
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(SizeUtils.dp2px(90f)), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    /**
+                     * 用来同步内容列表的item左右滑动
+                     */
+                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY ->
+                        exposureContentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<SpotEarningRecordAdapter.ItemViewHolder> =
+                            exposureContentAdapter.viewHolderCacheList
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.spotEarningRecordTitle.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        var querydate = ""
+                        if (viewModel.isSelectspotEarningMonthOrDay.value == "1"){//日报表
+                            querydate = tradedate.replace("-", "")
+                        }else{//月报表
+                            querydate = tradedate.replace("-", "")
+                        }
+                        /**
+                         * 下拉刷新
+                         */
+                        viewModel.qryReportAreaSpotPL(
+                            querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
+                            querydate = querydate,
+                            deliverygoodsid = selectDeiveryData.value?.id ?: "",
+                            spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
+                            wrstandardid = selectWrStandModel.value?.id ?: ""
+                        )
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = exposureContentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<SpotEarningRecordAdapter.ItemViewHolder> =
+                                    exposureContentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
+                                            exposureContentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.spotEarningDataList.bindOptional(context) {
+
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    exposureContentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
+
+
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+
+
+}
+
+/**
+ * 库存报表
  * @property activity AppCompatActivity
  * @property viewModel ReportQueryViewModel
  * @constructor
@@ -1257,7 +1561,9 @@ class InvertoryReportUI(
     lateinit var tradedatetextview: TextView
 
     init {
-        viewModel.queryWrStandardList()//查询现货列表
+        viewModel.queryDeliveryGoods()//查询现货品种
+        viewModel.queryGoodsWrstandard()//查询品类
+        viewModel.queryGoodsbrand()//查询品牌
         viewModel.queryWarehouseInfo()//查询可选择的仓库信息
     }
 
@@ -1342,12 +1648,10 @@ class InvertoryReportUI(
                     onThrottleFirstClick {
                         activity.creatBottomSheetDialog(
                             "请选择现货品种",
-                            viewModel.selectSpotVarietiesList(
-                                viewModel.wrStandardDataList.value ?: arrayListOf()
-                            )
+                            viewModel.getDeliverySelectData()
                         ) {
                             selectWrStandardData.postValue(this)
-                            viewModel.queryWrStandardDetail(this.id)
+
                         }
                     }
                     backgroundResource = R.drawable.rma_time_click_bg
@@ -1383,10 +1687,7 @@ class InvertoryReportUI(
                     onThrottleFirstClick {
                         activity.creatBottomSheetDialog(
                             "请选择品类",
-                            viewModel.selectWrStandardModel(
-                                viewModel.wrStandardDataDetail.value
-                                    ?: WrStandardDetail()
-                            )
+                            viewModel.getGoodsWrstandardSelectList()
                         ) {
                             selectWrStandModel.postValue(this)
                         }
@@ -1419,10 +1720,7 @@ class InvertoryReportUI(
                     onThrottleFirstClick {
                         activity.creatBottomSheetDialog(
                             "请选择品牌",
-                            viewModel.selectWrStandardBrand(
-                                viewModel.wrStandardDataDetail.value
-                                    ?: WrStandardDetail()
-                            )
+                            viewModel.getGoodsBrandSelectList()
                         ) {
                             selectWrStandBrand.postValue(this)
                         }

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

@@ -5,6 +5,7 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.remove
 import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseViewModel
@@ -81,11 +82,26 @@ class ReportQueryViewModel : BaseViewModel(){
     val inventoryDetailsDataList: MutableLiveData<List<AreaStockReportData>> = MutableLiveData()
 
     /**
+     * 现货收益报表数据
+     */
+    val spotEarningDataList: MutableLiveData<List<ReportAreaSpotPLData>> = MutableLiveData()
+
+    /**
+     * 现货损益报表选择的日报表还是月报表 1为日报表 2为月报表
+     */
+    val isSelectspotEarningMonthOrDay : MutableLiveData<String> = MutableLiveData<String>().apply { value = "1" }
+
+    /**
      * 库存报表数据头部数据
      */
     val inventoryRecordTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
 
     /**
+     * 现货损益报表数据头部数据
+     */
+    val spotEarningRecordTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
      * 现货品种列表
      */
     val wrStandardDataList: MutableLiveData<List<WrStandardData>> = MutableLiveData()
@@ -100,6 +116,23 @@ class ReportQueryViewModel : BaseViewModel(){
      */
     val wrStandardDataDetail: MutableLiveData<WrStandardDetail> = MutableLiveData()
 
+    //-----------------------Ermcp3-----------------------
+
+    /**
+     * 现货商品列表
+     */
+    val deliveryGoodsList : MutableLiveData<List<DeliveryGoodsData>> = MutableLiveData()
+
+    /**
+     * 商品品类列表
+     */
+    val goodsWrstandardDataList : MutableLiveData<List<GoodsWrstandardData>> = MutableLiveData()
+
+    /**
+     * 商品品牌列表
+     */
+    val ermcp3GoodsbrandDataList : MutableLiveData<List<Ermcp3GoodsbrandData>> = MutableLiveData()
+
     /**
      * 查询财务日报表(菜单:报表查询/财务报表/日报表)
      * @param tradedate String
@@ -429,20 +462,7 @@ class ReportQueryViewModel : BaseViewModel(){
         return newList
     }
 
-    /**
-     * 查询现货品种列表
-     */
-    fun queryWrStandardList() {
-        val params = mutableMapOf<String, String>().apply {
-            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-            put("status", "1")
-        }
-        MyApplication.getInstance()?.commodityManager?.queryWrStandard(params) { isSuccess, respData, error ->
-            if (isSuccess) {
-                wrStandardDataList.postValue(respData)
-            }
-        }
-    }
+
 
     /**
      * 查询仓库信息
@@ -464,84 +484,192 @@ class ReportQueryViewModel : BaseViewModel(){
         }
     }
 
+
+
+
     /**
-     * 根据选择控件进行数据重新组装(现货品种列表)
+     * 根据选择控件进行数据重新组装(客户
      * @param dataList List<UserInfoData>
      * @return ArrayList<SelectData>
      */
-    fun selectSpotVarietiesList(dataList: List<WrStandardData>): ArrayList<SelectData> {
-        val newSpotVarietiesList = arrayListOf<SelectData>()
+    fun setSelectWarehouseList(dataList: List<WarehouseInfoData>): ArrayList<SelectData> {
+        val newCustomerList = arrayListOf<SelectData>()
         dataList.forEach {
-            newSpotVarietiesList.add(
+            newCustomerList.add(
                 SelectData(
-                    id = it.wrstandardid ?: "",
-                    value = it.wrstandardname ?: "",
-                    deliverygoodsid = it.deliverygoodsid ?: "",
-                    enumdicname = it.enumdicname ?: ""
+                    id = it.autoid.toString() ?: "",
+                    value = it.warehousename ?: ""
                 )
             )
         }
-        return newSpotVarietiesList
+        return newCustomerList
     }
 
     /**
-     * 用来请求选择现货品种后的型号和品牌信息
-     * @param wrstandardid String
+     * querytype 查询类型 1-日报表 2-月报表
+     * querydate 查询日期(格式 日报表YYYYMMDD, 月报表YYYYMM)
+     * 查询现货损益报表列表头部数据
+     * @param tableKey String
      */
-    fun queryWrStandardDetail(wrstandardid: String) {
+    fun querySpotEarningTitle(
+        querytype: String = "",
+        querydate: String = ""
+    ){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", Constant.table_mobile_report_spot_profit)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                spotEarningRecordTitle.postValue(newlist)
+                qryReportAreaSpotPL(querytype = querytype,querydate = querydate)
+            }
+        }
+    }
+
+    /**
+     * 查询现货损益报表(现货损益报表)
+     * userid 用户ID
+     * querytype 查询类型 1-日报表 2-月报表
+     * querydate 查询日期(格式 日报表YYYYMMDD, 月报表YYYYMM)
+     * deliverygoodsid 现货商品ID
+     * spotgoodsbrandid 品牌ID
+     * wrstandardid 品类ID
+     */
+    fun qryReportAreaSpotPL(querytype : String,querydate : String,deliverygoodsid : String = "",spotgoodsbrandid : String = "",wrstandardid : String = ""){
         val params = mutableMapOf<String, String>().apply {
             put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-            put("wrstandardid", wrstandardid)
+            put("querytype", querytype)
+            put("querydate",querydate)
+            if (deliverygoodsid.isNotEmpty()){
+                put("deliverygoodsid",deliverygoodsid)
+            }
+            if (spotgoodsbrandid.isNotEmpty()){
+                put("spotgoodsbrandid",spotgoodsbrandid)
+            }
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
         }
+        MyApplication.getInstance()?.reportManager?.qryReportAreaSpotPL(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                spotEarningDataList.postValue(getSpotEarningRightData(respData ?: arrayListOf()))
+            }
+        }
+    }
 
-        MyApplication.getInstance()?.commodityManager?.queryWrStandardDetail(params) { isSuccess, respData, _ ->
+    /**
+     * 库存报表组装右部数据
+     * @param respData List<RealExposureData>
+     * @return List<RealExposureData>
+     */
+    private fun getSpotEarningRightData(respData: List<ReportAreaSpotPLData>): List<ReportAreaSpotPLData> {
+        val newList = arrayListOf<ReportAreaSpotPLData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            newRightData.add(it.curqty + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.curaverageprice))
+            newRightData.add(NumberUtils.doubleDistortion(it.actualpl) + "\n" + NumberUtils.doubleDistortion(it.floatpl))
+            newRightData.add(NumberUtils.doubleDistortion(it.curmarketvalue) + "\n" + NumberUtils.doubleDistortion(it.curspotprice))
+            newRightData.add(NumberUtils.doubleDistortion(it.curbuyamount) + "\n" + NumberUtils.doubleDistortion(it.cursellamount))
+            newRightData.add(it.curbuyqty + it.enumdicname +  "\n" + NumberUtils.doubleDistortion(it.todaybuyaverageprice))
+            newRightData.add(it.todaysellqty + it.enumdicname +  "\n" + NumberUtils.doubleDistortion(it.todaysellaverageprice))
+            newRightData.add(it.oriqty + it.enumdicname +  "\n" + NumberUtils.doubleDistortion(it.oriaverageprice))
+            newRightData.add(it.oriamount +  "\n" + NumberUtils.doubleDistortion(it.curamount))
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+    /**
+     * /Ermcp3/QueryDeliveryGoods 查询现货商品
+     */
+    fun queryDeliveryGoods(){
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commodityManager?.queryDeliveryGoods(params = params) { isSuccess, respData, error ->
             if (isSuccess) {
-                wrStandardDataDetail.postValue(respData?.get(0))
+                deliveryGoodsList.postValue(respData?.remove { it.dgstatus == "0" })
+            } else {
+                ToastUtils.showLong("数据请求失败")
             }
         }
     }
 
     /**
-     * 根据选择控件进行数据重新组装(型号)
-     * @param data WrStandardDetail
-     * @return ArrayList<SelectData>
+     * /Ermcp3/QueryGoodsWrstandard查询商品品类
+     */
+    fun queryGoodsWrstandard(){
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commodityManager?.queryGoodsWrstandard(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                goodsWrstandardDataList.postValue(respData?.remove { it.isvalid == "0" })
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
+        }
+    }
+
+    /**
+     * /Ermcp3/QueryGoodsbrand查询商品品牌
      */
-    fun selectWrStandardModel(data: WrStandardDetail): ArrayList<SelectData> {
-        val wrstandardModel = arrayListOf<SelectData>()
-        data.gtList.forEach {
-            wrstandardModel.add(SelectData(id = it.modelid, value = it.modelname))
+    fun queryGoodsbrand(){
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commodityManager?.queryGoodsbrand(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                ermcp3GoodsbrandDataList.postValue(respData)
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
         }
-        return wrstandardModel
     }
 
     /**
-     * 根据选择控件进行数据重新组装(品牌)
-     * @param data WrStandardDetail
-     * @return ArrayList<SelectData>
+     * 获取可供选择的现货商品
+     * @return List<SelectData>
      */
-    fun selectWrStandardBrand(data: WrStandardDetail): ArrayList<SelectData> {
-        val wrstandardBrand = arrayListOf<SelectData>()
-        data.gbList.forEach {
-            wrstandardBrand.add(SelectData(id = it.brandid, value = it.brandname))
+    fun getDeliverySelectData() : List<SelectData>{
+        val oldList = deliveryGoodsList.value
+        val resultDataList = arrayListOf<SelectData>()
+        oldList?.forEach {
+            resultDataList.add(SelectData(id = it.deliverygoodsid ?: "",value = it.deliverygoodsname ?: "",enumdicname = it.enumdicname ?: ""))
         }
-        return wrstandardBrand
+        return resultDataList
     }
 
     /**
-     * 根据选择控件进行数据重新组装(客户)
-     * @param dataList List<UserInfoData>
-     * @return ArrayList<SelectData>
+     * 获取可控选择品类列表
+     * @return List<SelectData>
      */
-    fun setSelectWarehouseList(dataList: List<WarehouseInfoData>): ArrayList<SelectData> {
-        val newCustomerList = arrayListOf<SelectData>()
-        dataList.forEach {
-            newCustomerList.add(
-                SelectData(
-                    id = it.autoid.toString() ?: "",
-                    value = it.warehousename ?: ""
-                )
-            )
+    fun getGoodsWrstandardSelectList() : List<SelectData>{
+        val oldList = goodsWrstandardDataList.value
+        val resultDataList = arrayListOf<SelectData>()
+        oldList?.forEach {
+            resultDataList.add(SelectData(id = it?.wrstandardid ?: "",value = it.wrstandardname ?: ""))
         }
-        return newCustomerList
+        return resultDataList
+    }
+
+    /**
+     * 获取可供选择的品牌列表
+     * @return List<SelectData>
+     */
+    fun getGoodsBrandSelectList() : List<SelectData>{
+        val oldList = ermcp3GoodsbrandDataList.value
+        val resultDataList = arrayListOf<SelectData>()
+        oldList?.forEach {
+            resultDataList.add(SelectData(id = it?.brandid ?: "",value = it.brandname ?: ""))
+        }
+        return resultDataList
     }
+
 }

+ 205 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/SpotEarningRecordAdapter.java

@@ -0,0 +1,205 @@
+package cn.muchinfo.rma.view.base.home.reportquery;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.blankj.utilcode.util.ActivityUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.AreaStockReportData;
+import cn.muchinfo.rma.global.data.ReportAreaSpotPLData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.app.Constant;
+import cn.muchinfo.rma.view.base.home.inventory.inventorymanager.InventoryDetailsActivity;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 用于库存管理现货损益报表的列表adapter
+ */
+public class SpotEarningRecordAdapter extends RecyclerView.Adapter<SpotEarningRecordAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<ReportAreaSpotPLData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    private String querytype = "1";
+    private String querydate;
+
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+    public SpotEarningRecordAdapter(Context context) {
+        this.context = context;
+    }
+
+    public void setDatas(List<ReportAreaSpotPLData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    /**
+     * 设置是日报表还是月报表 1是日报表 2是月报表
+     * @param querytype
+     */
+    public void setquerytype(String querytype){
+        this.querytype = querytype;
+    }
+
+    /**
+     * 设置查询的时间
+     * @param querydate
+     */
+    public void setquerydate(String querydate){
+        this.querydate = querydate;
+    }
+
+    private void setPosition(int position){
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.layout_item_inventory_current, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        if (TextUtils.isEmpty(datas.get(i).getDeliverygoodsname())){
+            itemViewHolder.exposure_tvLeftTitle.setText("--");
+        }else {
+            itemViewHolder.exposure_tvLeftTitle.setText(datas.get(i).getDeliverygoodsname());
+        }
+        itemViewHolder.exposure_tv_left_bottom_title.setText(datas.get(i).getWrstandardname() + "/" + datas.get(i).getBrandname());
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.exposure_rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.exposure_rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.exposure_rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        if (i == this.position){
+            itemViewHolder.exposure_roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            itemViewHolder.exposure_allView.setVisibility(View.VISIBLE);
+        }else {
+            itemViewHolder.exposure_roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.exposure_allView.setVisibility(View.GONE);
+        }
+
+//        itemViewHolder.exposure_all_click_View.setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View view) {
+//                setPosition(i);
+//            }
+//        });
+
+        //入库明细
+        itemViewHolder.futures_subsidiary.setOnClickListener(view -> {
+
+        });
+        //出库明细
+        itemViewHolder.place_the_order.setOnClickListener(view -> {
+
+        });
+
+        itemViewHolder.exposure_horItemScrollview.setEventListener(event -> {
+            if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.exposure_horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.exposure_horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout exposure_roots_view;//根部布局
+        TextView futures_subsidiary;//
+        TextView place_the_order;//
+        LinearLayout exposure_allView;//隐藏的底部操作空间
+        LinearLayout exposure_all_click_View;//item左侧点击控件
+        TextView exposure_tvLeftTitle;//左边
+        TextView exposure_tv_left_bottom_title;//合同编号
+        RecyclerView exposure_rvItemRight;//右方的列表
+        public CustomHorizontalScrollView exposure_horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            futures_subsidiary = itemView.findViewById(R.id.futures_subsidiary);
+            place_the_order = itemView.findViewById(R.id.place_the_order);
+            exposure_tvLeftTitle = itemView.findViewById(R.id.exposure_tv_left_title);
+            exposure_rvItemRight = itemView.findViewById(R.id.exposure_rv_item_right);
+            exposure_horItemScrollview = itemView.findViewById(R.id.exposure_hor_item_scrollview);
+            exposure_allView = itemView.findViewById(R.id.exposure_all_view);
+            exposure_tv_left_bottom_title = itemView.findViewById(R.id.exposure_tv_left_bottom_title);
+            exposure_all_click_View = itemView.findViewById(R.id.exposure_all_click_View);
+            exposure_roots_view = itemView.findViewById(R.id.exposure_roots_view);
+        }
+    }
+}

+ 104 - 46
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/AddSpotMarketPriceActivity.kt

@@ -7,6 +7,7 @@ import android.view.inputmethod.EditorInfo
 import android.widget.EditText
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 
@@ -14,7 +15,11 @@ import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewModel
+import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 /**
@@ -28,17 +33,22 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
     val type by lazy { intent.getStringExtra("type") }
 
     /**
+     * 详情实体
+     */
+    val data by lazy { intent.getParcelableExtra<SpotGoodsPriceData>("data") as SpotGoodsPriceData }
+
+    /**
      * 选择的现货品种
      */
     val selectDeliveryGoods : MutableLiveData<SelectData> = MutableLiveData()
 
     /**
-     * 选择的品类
+     * 选择的商品品类
      */
     val selectCategory : MutableLiveData<SelectData> = MutableLiveData()
 
     /**
-     * 选择的品牌
+     * 选择的商品品牌
      */
     val selectBrand : MutableLiveData<SelectData> = MutableLiveData()
 
@@ -47,9 +57,19 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
      */
     lateinit var spot_price : EditText
 
+    private val dialog by lazy { createLoadingDialog(hintStr = "正在提交") }
+
+    fun initData(){
+        viewModel.queryDeliveryGoods()
+        viewModel.queryGoodsWrstandard()
+        viewModel.queryGoodsbrand()
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            initData()
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.main_hit_bg_color)
             //页面标题
             topBar {
@@ -67,19 +87,10 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                 background = resources.getDrawable(R.color.white)
                 gravity = Gravity.CENTER_VERTICAL
                 onThrottleFirstClick {
-//                    val selectDataList = arrayListOf(
-//                        SelectData(
-//                            id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
-//                            value = "采购合同"
-//                        ),
-//                        SelectData(
-//                            id = MTPEnums.CONTRACT_TYPE_SELL.toString(),
-//                            value = "销售合同"
-//                        )
-//                    )
-//                    creatBottomSheetDialog("请选择合同类型", selectDataList) {
-//                        contractType.postValue(this)
-//                    }
+                    val selectDataList = viewModel.getDeliverySelectData()
+                    creatBottomSheetDialog("请选择现货品种", selectDataList) {
+                        selectDeliveryGoods.postValue(this)
+                    }
                 }
                 textView {
                     text = "*"
@@ -102,7 +113,12 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                         text = it?.value
                         textColorInt = R.color.rma_black_33
                     }
-                    text = "请选择现货品种"
+                    text = if (type == "1"){
+                        "请选择现货品种"
+                    }else{
+                        data.deliverygoodsname
+                    }
+
                     textSizeAuto = 31
                     textColorInt = R.color.rma_hint_text_color_ccc
                 }.lparams(wrapContent, wrapContent) {
@@ -124,19 +140,10 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                 background = resources.getDrawable(R.color.white)
                 gravity = Gravity.CENTER_VERTICAL
                 onThrottleFirstClick {
-//                    val selectDataList = arrayListOf(
-//                        SelectData(
-//                            id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
-//                            value = "采购合同"
-//                        ),
-//                        SelectData(
-//                            id = MTPEnums.CONTRACT_TYPE_SELL.toString(),
-//                            value = "销售合同"
-//                        )
-//                    )
-//                    creatBottomSheetDialog("请选择合同类型", selectDataList) {
-//                        contractType.postValue(this)
-//                    }
+                    val selectDataList = viewModel.getGoodsWrstandardSelectList()
+                    creatBottomSheetDialog("请选择品类", selectDataList) {
+                        selectCategory.postValue(this)
+                    }
                 }
                 textView {
                     visibility = View.INVISIBLE
@@ -160,7 +167,12 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                         text = it?.value
                         textColorInt = R.color.rma_black_33
                     }
-                    text = "请选择品类"
+                    if (type == "1"){
+                        text = "请选择品类"
+                    }else{
+                        text = data.wrstandardname
+                    }
+
                     textSizeAuto = 31
                     textColorInt = R.color.rma_hint_text_color_ccc
                 }.lparams(wrapContent, wrapContent) {
@@ -182,19 +194,10 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                 background = resources.getDrawable(R.color.white)
                 gravity = Gravity.CENTER_VERTICAL
                 onThrottleFirstClick {
-//                    val selectDataList = arrayListOf(
-//                        SelectData(
-//                            id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
-//                            value = "采购合同"
-//                        ),
-//                        SelectData(
-//                            id = MTPEnums.CONTRACT_TYPE_SELL.toString(),
-//                            value = "销售合同"
-//                        )
-//                    )
-//                    creatBottomSheetDialog("请选择合同类型", selectDataList) {
-//                        contractType.postValue(this)
-//                    }
+                    val selectDataList = viewModel.getGoodsBrandSelectList()
+                    creatBottomSheetDialog("请选择品牌", selectDataList) {
+                        selectBrand.postValue(this)
+                    }
                 }
                 textView {
                     visibility = View.INVISIBLE
@@ -218,7 +221,11 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                         text = it?.value
                         textColorInt = R.color.rma_black_33
                     }
-                    text = "请选择品牌"
+                    if (type == "1"){
+                        text = "请选择品牌"
+                    }else{
+                        text = data.brandname
+                    }
                     textSizeAuto = 31
                     textColorInt = R.color.rma_hint_text_color_ccc
                 }.lparams(wrapContent, wrapContent) {
@@ -257,7 +264,10 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
 
                 editText {
                     spot_price = this
-                    hint = "请输入合同编号"
+                    if (type == "2"){
+                        setText(data.spotgoodsprice)
+                    }
+                    hint = "请输入现货价格"
                     background = null
                     inputType = EditorInfo.TYPE_CLASS_NUMBER
                     setDecimalInputType()
@@ -267,6 +277,16 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                 }.lparams(matchParent, autoSize(132)) {
                     marginStart = autoSize(80)
                 }
+
+                textView {
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                    selectDeliveryGoods.bindOptional(context){
+                        text = "元/" + it?.enumdicname
+                    }
+                }.lparams(wrapContent, wrapContent){
+                    marginEnd = autoSize(36)
+                }
             }.lparams(matchParent, autoSize(132))
 
             view {  }.lparams(autoSize(1),0,1f)
@@ -277,7 +297,24 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
 
                 textView {
                     onThrottleFirstClick {
-
+                        if (check().not()){
+                            return@onThrottleFirstClick
+                        }
+                        var operateType = 1
+                        if (type == "1"){
+                            operateType = 1
+                        }else{
+                            operateType = 2
+                        }
+                        viewModel.ErmcpSpotGoodsPriceReq(
+                            DeliveryGoodsID = selectDeliveryGoods.value?.id?.toLong() ?: 0,
+                            WRStandardID = selectCategory.value?.id?.toLong() ?: 0,
+                            SpotGoodsBrandID = selectBrand.value?.id?.toLong() ?: 0,
+                            SpotGoodsPrice = spot_price.text.toString().toDouble(),
+                            OperateType = operateType
+                        ){
+                            finish()
+                        }
                     }
                     gravity = Gravity.CENTER
                     backgroundResource = R.mipmap.rma_save_info_bg
@@ -292,4 +329,25 @@ class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
         }
     }
 
+    /**
+     * 提交数据前的校验
+     */
+    fun check() : Boolean{
+        if (selectDeliveryGoods.value?.id.isNullOrEmpty()){
+            ToastUtils.showLong("请选择现货品种")
+            return false
+        }
+        if (selectBrand.value?.id?.isNotEmpty() == true){//如果选择了品牌必定要选择品类
+            if (selectCategory.value?.id.isNullOrEmpty()){
+                ToastUtils.showLong("请选择品类")
+                return false
+            }
+        }
+        if (spot_price.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入")
+            return false
+        }
+        return true
+    }
+
 }

+ 129 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketDetailsActivity.kt

@@ -0,0 +1,129 @@
+package cn.muchinfo.rma.view.base.home.spotmarket
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.Gravity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.global.isBlankString
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import com.blankj.utilcode.util.ActivityUtils
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import org.jetbrains.anko.*
+
+class SpotMarketDetailsActivity : BaseActivity<SpotMarketPriceViewModel>(){
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    /**
+     * 详情实体
+     */
+    val data by lazy { intent.getParcelableExtra<SpotGoodsPriceData>("data") as SpotGoodsPriceData}
+
+    private val spotMarketPriceAdapter: BaseAdapter<SpotGoodsPriceData, SpotMarketDetailsViewHolder> =
+        BaseAdapter { _, _ ->
+            SpotMarketDetailsViewHolder(
+                this,
+                viewModel
+            )
+        }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            viewModel.querySpotGoodsPriceLog(data.deliverygoodsid ?: "")
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "详情"
+                }
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                background = resources.getDrawable(R.color.rma_blue_color)
+                textView {
+                    textSizeAuto = 29
+                    textColorInt = R.color.white
+                    text = "现货品种:   " + data.deliverygoodsname?.isBlankString() + "  品类:   " + data.wrstandardname?.isBlankString() + data.gbenumdicname?.isBlankString() + "  品牌:  " + data.brandname?.isBlankString()
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(92))
+
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "时间"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(100),1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "价格"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(100),1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "操作人"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(100),1f)
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                setRetryAction {
+                    viewModel.querySpotGoodsPriceLog(data.wrstandardid ?: "")
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.querySpotGoodsPriceLog(data.wrstandardid ?: "")
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = spotMarketPriceAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.spotMarketPriceLogDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    spotMarketPriceAdapter.setNewData(it)
+                }
+            }
+        }
+    }
+
+}

+ 60 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketDetailsViewHolder.kt

@@ -0,0 +1,60 @@
+package cn.muchinfo.rma.view.base.home.spotmarket
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.global.isBlankString
+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
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class SpotMarketDetailsViewHolder(private val activity : AppCompatActivity,private val viewModel : SpotMarketPriceViewModel) : BaseViewHolder<SpotGoodsPriceData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            linearLayout {
+                gravity = Gravity.CENTER
+                //时间
+                textView {
+                    data.bindOptional(context){
+                        text = it?.operatetime?.isShowTimeString("yyyy-MM-dd HH:mm")
+                    }
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(0, autoSize(100),1f)
+
+            linearLayout {
+                gravity = Gravity.CENTER
+                //价格
+                textView {
+                    data.bindOptional(context){
+                        text = it?.spotgoodsprice?.isBlankString()
+                    }
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(0, autoSize(100),1f)
+
+            linearLayout {
+                gravity = Gravity.CENTER
+                //操作人
+                textView {
+                    data.bindOptional(context){
+                        text = it?.operateid?.isBlankString()
+                    }
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(0, autoSize(100),1f)
+        }.lparams(matchParent, autoSize(100))
+    }
+
+}

+ 16 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceActivity.kt

@@ -4,6 +4,7 @@ import android.content.Intent
 import android.os.Bundle
 import android.view.Gravity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
 
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
@@ -11,6 +12,8 @@ import cn.muchinfo.rma.view.base.BaseActivity
 
 import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.linearLayout
 import org.jetbrains.anko.matchParent
 import org.jetbrains.anko.textView
@@ -25,7 +28,7 @@ class SpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val spotMarketPriceAdapter: BaseAdapter<String, SpotMarketPriceViewHolder> =
+    private val spotMarketPriceAdapter: BaseAdapter<SpotGoodsPriceData, SpotMarketPriceViewHolder> =
         BaseAdapter { _, _ ->
             SpotMarketPriceViewHolder(
                 this,
@@ -33,19 +36,30 @@ class SpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
             )
         }
 
+    private val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
+    override fun onResume() {
+        super.onResume()
+        viewModel.querySpotMarketPriceList()
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
+            viewModel.querySpotMarketPriceList()
             background = resources.getDrawable(R.color.main_hit_bg_color)
             //页面标题
             topBar {
                 commonLeftButton()
                 commonTitle {
-                    text = "角色设置"
+                    text = "现货市价"
                 }
                 // 新增角色设置
                 commonMenuButton(R.mipmap.add_new) {
                     val intent = Intent()
+                    intent.putExtra("type","1")
+                    intent.putExtra("data",SpotGoodsPriceData())
                     intent.setClass(context,
                         AddSpotMarketPriceActivity::class.java)
                     ActivityUtils.startActivity(intent)

+ 45 - 17
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewHolder.kt

@@ -1,14 +1,18 @@
 package cn.muchinfo.rma.view.base.home.spotmarket
 
+import android.content.Intent
 import android.view.Gravity
+import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
@@ -18,46 +22,61 @@ import org.jetbrains.anko.*
  * @property viewModel SpotMarketPriceViewModel
  * @constructor
  */
-class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private val viewModel: SpotMarketPriceViewModel) : BaseViewHolder<String>(activity){
+class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private val viewModel: SpotMarketPriceViewModel) : BaseViewHolder<SpotGoodsPriceData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     override fun _FrameLayout.createContentView() {
         verticalLayout {
+            onThrottleFirstClick {
+                viewModel.setOnItemClick(data.value?.deliverygoodsid ?: "")
+            }
             linearLayout {
+                //现货品种
                 textView {
                     gravity = Gravity.CENTER
-                    text = "现货品种"
+                    data.bindOptional(context){
+                        text = it?.deliverygoodsname
+                    }
                     textSizeAuto = 30
-                    textColorInt = R.color.rma_hint_title_text_color
+                    textColorInt = R.color.rma_black_33
                 }.lparams(0, autoSize(100),1f)
+                //品类
                 textView {
                     gravity = Gravity.CENTER
-                    text = "品类"
+                    data.bindOptional(context){
+                        text = it?.wrstandardname + it?.gbenumdicname
+                    }
                     textSizeAuto = 30
-                    textColorInt = R.color.rma_hint_title_text_color
+                    textColorInt = R.color.rma_black_33
                 }.lparams(0, autoSize(100),1f)
+                //品牌
                 textView {
                     gravity = Gravity.CENTER
-                    text = "品牌"
+                    data.bindOptional(context){
+                        text = it?.brandname
+                    }
                     textSizeAuto = 30
-                    textColorInt = R.color.rma_hint_title_text_color
+                    textColorInt = R.color.rma_black_33
                 }.lparams(0, autoSize(100),1f)
+                //价格
                 textView {
                     gravity = Gravity.CENTER
-                    text = "价格"
+                    data.bindOptional(context){
+                        text = it?.spotgoodsprice
+                    }
                     textSizeAuto = 30
-                    textColorInt = R.color.rma_hint_title_text_color
+                    textColorInt = R.color.rma_black_33
                 }.lparams(0, autoSize(100),1f)
             }.lparams(matchParent, autoSize(100))
 
             // 控制区
             linearLayout {
                 data.bindOptional(context) {
-//                    if (it?.indexSelect == 0) {
-//                        visibility = View.GONE
-//                    } else if (it?.indexSelect == 1) {
-//                        visibility = View.VISIBLE
-//                    }
+                    if (it?.isClick == 0) {
+                        visibility = View.GONE
+                    } else if (it?.isClick == 1) {
+                        visibility = View.VISIBLE
+                    }
                 }
                 gravity = Gravity.CENTER_VERTICAL
 
@@ -65,7 +84,11 @@ class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private
 
                 textView {
                     onThrottleFirstClick {
-
+                        val intent = Intent()
+                        intent.putExtra("type","2")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context,AddSpotMarketPriceActivity::class.java)
+                        ActivityUtils.startActivity(intent)
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
@@ -78,7 +101,9 @@ class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private
 
                 textView {
                     onThrottleFirstClick {
-
+                        viewModel.ErmcpSpotGoodsPriceReq(DeliveryGoodsID = data.value?.deliverygoodsid?.toLong() ?: 0,OperateType = 3,WRStandardID = data.value?.wrstandardid?.toLong() ?: 0,SpotGoodsBrandID = data.value?.spotgoodsbrandid?.toLong() ?: 0){
+                            viewModel.querySpotMarketPriceList()
+                        }
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
@@ -91,7 +116,10 @@ class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private
 
                 textView {
                     onThrottleFirstClick {
-
+                        val intent = Intent()
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context,SpotMarketDetailsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER

+ 221 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewModel.kt

@@ -1,7 +1,20 @@
 package cn.muchinfo.rma.view.base.home.spotmarket
 
 import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.DeliveryGoodsData
+import cn.muchinfo.rma.global.data.Ermcp3GoodsbrandData
+import cn.muchinfo.rma.global.data.GoodsWrstandardData
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.remove
 import cn.muchinfo.rma.view.base.BaseViewModel
+import com.blankj.utilcode.util.ToastUtils
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 现货市价viewmodel
@@ -10,12 +23,219 @@ class SpotMarketPriceViewModel : BaseViewModel(){
 
 
     /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
      * 现货市价列表数据
      */
-    val spotMarketPriceDataList : MutableLiveData<List<String>> = MutableLiveData()
+    val spotMarketPriceDataList : MutableLiveData<List<SpotGoodsPriceData>> = MutableLiveData()
+
+    /**
+     * 现货市价详情
+     */
+    val spotMarketPriceLogDataList : MutableLiveData<List<SpotGoodsPriceData>> = MutableLiveData()
+
+    /**
+     * 现货商品列表
+     */
+    val deliveryGoodsList : MutableLiveData<List<DeliveryGoodsData>> = MutableLiveData()
 
+    /**
+     * 商品品类列表
+     */
+    val goodsWrstandardDataList : MutableLiveData<List<GoodsWrstandardData>> = MutableLiveData()
+
+    /**
+     * 商品品牌列表
+     */
+    val ermcp3GoodsbrandDataList : MutableLiveData<List<Ermcp3GoodsbrandData>> = MutableLiveData()
+
+    /**
+     * 查询现货市价(现货市价)
+     */
     fun querySpotMarketPriceList(){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+
+        MyApplication.getInstance()?.spotManager?.querySpotGoodsPrice(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+//                spotMarketPriceDataList.postValue(respData?.remove { it.isvalid == "0" })
+                spotMarketPriceDataList.postValue(respData)
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
+        }
+    }
+
+    /**
+     * viewhodler内的item点击事件
+     * @param deliverygoodsid String
+     */
+    fun setOnItemClick(deliverygoodsid : String){
+        val oldList = spotMarketPriceDataList.value
+        val newDataList = arrayListOf<SpotGoodsPriceData>()
+        oldList?.forEach {
+            if (deliverygoodsid == it.deliverygoodsid){
+                if (it.isClick == 0){
+                    newDataList.add(it.copy(isClick = 1))
+                }else{
+                    newDataList.add(it.copy(isClick = 0))
+                }
+            }else{
+                newDataList.add(it)
+            }
+        }
+        spotMarketPriceDataList.postValue(newDataList)
+    }
+
+    /**
+     * 查询现货市价详情(现货市价/详情)
+     * @param wrstandardid String
+     */
+    fun querySpotGoodsPriceLog(deliverygoodsid : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            put("deliverygoodsid",deliverygoodsid)
+        }
+        MyApplication.getInstance()?.spotManager?.querySpotGoodsPriceLog(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                spotMarketPriceLogDataList.postValue(respData?.remove { it.isvalid == "0" })
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
+        }
+    }
 
+    /**
+     * 现货市价请求
+     * @param DeliveryGoodsID Long 现货品种ID
+     * @param WRStandardID Long 现货品类ID(通用则为0)
+     * @param SpotGoodsBrandID Long 现货品牌ID(通用则为0, 不为0则须先有品类ID)
+     * @param SpotGoodsPrice Double 现货价格
+     * @param OperateType Int 操作类型 - 1:新增 2:修改 3:删除
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun ErmcpSpotGoodsPriceReq(
+        DeliveryGoodsID : Long,
+        WRStandardID : Long = 0,
+        SpotGoodsBrandID : Long = 0,
+        SpotGoodsPrice : Double = 0.0,
+        OperateType : Int,
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.spotManager?.ErmcpSpotGoodsPriceReq(
+                DeliveryGoodsID = DeliveryGoodsID,
+                WRStandardID = WRStandardID,
+                SpotGoodsBrandID = SpotGoodsBrandID,
+                SpotGoodsPrice = SpotGoodsPrice,
+                OperateType = OperateType
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
+
+    /**
+     * /Ermcp3/QueryDeliveryGoods 查询现货商品
+     */
+    fun queryDeliveryGoods(){
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commodityManager?.queryDeliveryGoods(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                deliveryGoodsList.postValue(respData?.remove { it.dgstatus == "0" })
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
+        }
+    }
+
+    /**
+     * /Ermcp3/QueryGoodsWrstandard查询商品品类
+     */
+    fun queryGoodsWrstandard(){
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commodityManager?.queryGoodsWrstandard(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                goodsWrstandardDataList.postValue(respData?.remove { it.isvalid == "0" })
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
+        }
+    }
+
+    /**
+     * /Ermcp3/QueryGoodsbrand查询商品品牌
+     */
+    fun queryGoodsbrand(){
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commodityManager?.queryGoodsbrand(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                ermcp3GoodsbrandDataList.postValue(respData)
+            } else {
+                ToastUtils.showLong("数据请求失败")
+            }
+        }
+    }
+
+    /**
+     * 获取可供选择的现货商品
+     * @return List<SelectData>
+     */
+    fun getDeliverySelectData() : List<SelectData>{
+        val oldList = deliveryGoodsList.value
+        val resultDataList = arrayListOf<SelectData>()
+        oldList?.forEach {
+            resultDataList.add(SelectData(id = it.deliverygoodsid ?: "",value = it.deliverygoodsname ?: "",enumdicname = it.enumdicname ?: ""))
+        }
+        return resultDataList
+    }
+
+    /**
+     * 获取可控选择品类列表
+     * @return List<SelectData>
+     */
+    fun getGoodsWrstandardSelectList() : List<SelectData>{
+        val oldList = goodsWrstandardDataList.value
+        val resultDataList = arrayListOf<SelectData>()
+        oldList?.forEach {
+            resultDataList.add(SelectData(id = it?.wrstandardid ?: "",value = it.wrstandardname ?: ""))
+        }
+        return resultDataList
+    }
+
+    /**
+     * 获取可供选择的品牌列表
+     * @return List<SelectData>
+     */
+    fun getGoodsBrandSelectList() : List<SelectData>{
+        val oldList = ermcp3GoodsbrandDataList.value
+        val resultDataList = arrayListOf<SelectData>()
+        oldList?.forEach {
+            resultDataList.add(SelectData(id = it?.brandid ?: "",value = it.brandname ?: ""))
+        }
+        return resultDataList
     }
 
 }