Parcourir la source

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

Liu.bolan il y a 4 ans
Parent
commit
51bc7d654f
24 fichiers modifiés avec 764 ajouts et 62 suppressions
  1. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt
  2. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/report/ReportManager.kt
  3. 81 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt
  4. 45 27
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountData.kt
  5. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradePositionData.kt
  6. 90 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/SCMiddleGoodsData.kt
  7. 201 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/SCMiddleGoodsReportData.kt
  8. 21 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/UserInfoData.kt
  9. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  10. 5 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java
  11. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/unwind/ContractUnWindActivity.kt
  12. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newspot/NewAddSpotGoodsViewModel.kt
  13. 9 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractViewModel.kt
  14. 63 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/AddCustomerDataActivity.kt
  15. 158 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/CustomerDataDetailsActivity.kt
  16. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/CustomerDataViewModel.kt
  17. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgeDetailsActivity.kt
  18. 34 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgePlanViewHolder.kt
  19. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/trademain/OperationTradeActivity.kt
  20. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/trademain/TradeMainActivity.kt
  21. 6 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/trademain/TradeNormalViewHolder.kt
  22. 6 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/listed/SwapsListedActivity.kt
  23. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/listed/SwapsListedViewModel.kt
  24. 1 1
      RMA/app/src/main/res/drawable/qhj_main_blue_bg.xml

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

@@ -747,6 +747,7 @@ class AccountAdapter {
             builder.modifierid = loginInfo.loginID
             builder.areauserid = loginInfo.userID.toLong()
             builder.operatetype = operatetype
+            builder.loginid = loginInfo.loginID
             if (userid != 0L){
                 builder.userid = userid
             }

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

@@ -15,6 +15,33 @@ import java.lang.Exception
 class ReportManager {
 
     /**
+     * /Ermcp3/QrySCMiddleGoodsReport
+     * 查询定价报表
+     * @param params Map<String, String> userid : 用户ID / tradedate : 交易日(格式:yyyyMMdd)
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FinancialReportData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun qrySCMiddleGoodsReport(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<SCMiddleGoodsReportData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QrySCMiddleGoodsReport",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<SCMiddleGoodsReportData>>>(){
+                override fun onResponse(response: BaseResult<List<SCMiddleGoodsReportData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+    /**
      * /Ermcp3/QryReportDayFinanceFp
      * 查询财务日报表发票(菜单:报表查询/财务报表/日报表/发票)
      * @param params Map<String, String> userid : 用户ID / tradedate : 交易日(格式:yyyyMMdd)

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

@@ -962,3 +962,84 @@ fun String.steptypeid() : String{
 }
 
 
+fun String.cardtype() : String{
+    if (this.isNullOrEmpty()){
+        return "--"
+    }
+    var str = ""
+
+    when {
+        this == "0" -> {
+            str = "身份证"
+        }
+        this == "1" -> {
+            str = "港澳通行证"
+        }
+        this == "2" -> {
+            str = "组织机构代码证"
+        }
+        this == "3" -> {
+            str = "驾驶证"
+        }
+        this == "4" -> {
+            str = "营业执照"
+        }
+        this == "5" -> {
+            str = "军官证"
+        }
+        this == "6" -> {
+            str = "解放军文职干部证"
+        }
+        this == "7" -> {
+            str = "警官证"
+        }
+        this == "8" -> {
+            str = "解放军士兵证"
+        }
+        this == "9" -> {
+            str = "户口簿"
+        }
+        this == "10" -> {
+            str = "临时身份证"
+        }
+        this == "11" -> {
+            str = "(外国)护照"
+        }
+        this == "12" -> {
+            str = "中国)护照"
+        }
+        this == "13" -> {
+            str = "武警文职干部证"
+        }
+        this == "14" -> {
+            str = "武警士兵证"
+        }
+        this == "15" -> {
+            str = "海外客户编号"
+        }
+        this == "16" -> {
+            str = "学员证"
+        }
+        this == "17" -> {
+            str = "退休证"
+        }
+        this == "18" -> {
+            str = "对公营业执照号码"
+        }
+        this == "19" -> {
+            str = "台湾通行证"
+        }
+        this == "20" -> {
+            str = "统一社会信用代码"
+        }
+        this == "21" -> {
+            str = "个人其他类证件"
+        }
+        this == "22" -> {
+            str = "非个人其他类证件"
+        }
+    }
+    return str
+}
+
+

+ 45 - 27
RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountData.kt

@@ -173,7 +173,7 @@ open class AccountData(
 
     var raisedAmount: Double = 0.0,//合约市场融资额
     var valueOfposition: Double = 0.0,//合约市场总市值
-    var valueOfposition_keep_watch_profit_and_loss : Double = 0.0//合约市场浮动总盈亏
+    var valueOfposition_keep_watch_profit_and_loss: Double = 0.0//合约市场浮动总盈亏
 ) {
 
     /**
@@ -190,21 +190,27 @@ open class AccountData(
 
         val newList = arrayListOf<ContractTradePositionData>()
         val quoteGoodsListDataArrayList = GlobalDataCollection.instance?.quoteGoodsListDataArrayList
-        contractTradePositionDataArrayList?.forEach {data ->
-            val quoteGoodsListData = quoteGoodsListDataArrayList?.find { data.goodsid.toString() == it.goodsid }
-            if (quoteGoodsListData?.refgoodscode.isNullOrEmpty().not()){
-                newList.add(data.copy(refgoodsId = quoteGoodsListData?.refgoodsid?.toInt() ?: 0,refgoodsCode = quoteGoodsListData?.refgoodscode))
-            }else{
+        contractTradePositionDataArrayList?.forEach { data ->
+            val quoteGoodsListData =
+                quoteGoodsListDataArrayList?.find { data.goodsid.toString() == it.goodsid }
+            if (quoteGoodsListData?.refgoodscode.isNullOrEmpty().not()) {
+                newList.add(
+                    data.copy(
+                        refgoodsId = quoteGoodsListData?.refgoodsid?.toInt() ?: 0,
+                        refgoodsCode = quoteGoodsListData?.refgoodscode
+                    )
+                )
+            } else {
                 newList.add(data)
             }
         }
 
         newList.forEach {
-            var goodsInfoData : GoodsInfo
-            if (it.trademode == "16"){
+            var goodsInfoData: GoodsInfo
+            if (it.trademode == "16") {
                 goodsInfoData = DataBase.getInstance().goodsInfoDao()
                     .getGoodsInfo(it.goodsid?.toInt() ?: 0)
-            }else{
+            } else {
                 goodsInfoData = DataBase.getInstance().goodsInfoDao()
                     .getGoodsInfo(it.refgoodsId)
             }
@@ -216,32 +222,44 @@ open class AccountData(
                 GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find { data ->
                     data.outgoodscode == goodsInfoData.goodscode
                 }?.quoteDayData
-            valueOfposition += quoteDayData?.getPrice()?.times(
-                it?.curpositionqty?.toDouble() ?: 0.0
-            )?.times(goodsInfoData.agreeunit) ?: 0.0
+            if (it.tradeproperty == "2") {//交易模式为所有权时才在我的页面算市值
+                valueOfposition += quoteDayData?.getPrice()?.times(
+                    it.curpositionqty?.toDouble() ?: 0.0
+                )?.times(goodsInfoData.agreeunit) ?: 0.0
+            }
 
             var Profit: Double? = 0.0
-            if (quoteDayData!!.getPrice() == 0.0) {
-                Profit = 0.0
-            } else {
-                if (it?.averageprice == "" || it?.averageprice == "0") {
+            if (it.tradeproperty == "1") {//交易模式为收益权时才在我的页面算浮动盈亏
+                if (quoteDayData!!.getPrice() == 0.0) {
                     Profit = 0.0
                 } else {
-                    if (it.buyorsell == "1") { //卖方向
-                        Profit = NumberUtils.roundNum(
-                            (quoteDayData.getPrice().minus(it.averageprice?.toDouble() ?: 0.0)).times(it.curpositionqty?.toDouble() ?: 0.0).times(goodsInfo2.agreeunit).times(-1).toString(),
-                            2
-                        ).toDouble()
+                    if (it.averageprice == "" || it.averageprice == "0") {
+                        Profit = 0.0
                     } else {
-                        Profit = NumberUtils.roundNum(
-                            (quoteDayData.getPrice().minus(it.averageprice?.toDouble() ?: 0.0)).times(it.curpositionqty?.toDouble() ?: 0.0).times(goodsInfo2.agreeunit).toString(),
-                            2
-                        ).toDouble()
-                    }
+                        if (it.buyorsell == "1") { //卖方向
+                            Profit = NumberUtils.roundNum(
+                                (quoteDayData.getPrice().minus(
+                                    it.averageprice?.toDouble() ?: 0.0
+                                )).times(it.curpositionqty?.toDouble() ?: 0.0)
+                                    .times(goodsInfo2.agreeunit).times(-1).toString(),
+                                2
+                            ).toDouble()
+                        } else {
+                            Profit = NumberUtils.roundNum(
+                                (quoteDayData.getPrice().minus(
+                                    it.averageprice?.toDouble() ?: 0.0
+                                )).times(it.curpositionqty?.toDouble() ?: 0.0)
+                                    .times(goodsInfo2.agreeunit).toString(),
+                                2
+                            ).toDouble()
+                        }
 
+                    }
                 }
+                valueOfposition_keep_watch_profit_and_loss += Profit
             }
-            valueOfposition_keep_watch_profit_and_loss += Profit
+
+
         }
         /** 计算融资额 **/
         val qhjContractDetailsDataArrayList =

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

@@ -62,6 +62,8 @@ data class ContractTradePositionData(
     val tnusedqty : String? = "",//T+N使用量(可以使用T+N的冻结数量)
     @SerializedName("trademode")
     val trademode : String? ="",//交易模式
+    @SerializedName("tradeproperty")
+    val tradeproperty : String? = "",
     @SerializedName("isClick")
     var isClick : Int = 0,//是否点击展开
     @SerializedName("usedmargin")
@@ -98,6 +100,7 @@ data class ContractTradePositionData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readInt(),
         parcel.readString(),
         parcel.readInt(),
@@ -134,6 +137,7 @@ data class ContractTradePositionData(
         parcel.writeString(tnqty)
         parcel.writeString(tnusedqty)
         parcel.writeString(trademode)
+        parcel.writeString(tradeproperty)
         parcel.writeInt(isClick)
         parcel.writeString(usedmargin)
         parcel.writeInt(refgoodsId)

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

@@ -0,0 +1,90 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+data class SCMiddleGoodsData(
+    @SerializedName("contractno")
+    val contractno : String? = "",//合同编号
+    @SerializedName("contracttype")
+    val contracttype : String? = "",//合同类型 1:采购 -1:销售
+    @SerializedName("customername")
+    val customername : String? = "",//对手手名称
+    @SerializedName("customeruserid")
+    val customeruserid : String? = "",//对手id
+    @SerializedName("middlegoodsid")
+    val middlegoodsid : String? = "",//套保品种ID
+    @SerializedName("middlegoodspricedqty3")
+    val middlegoodspricedqty3 : String? = "",//应套保数量 = MiddleGoodsPricedQty2 * 套保比率
+    @SerializedName("needhedgeratio")
+    val needhedgeratio : String? = "",//套保比例
+    @SerializedName("pricedqty")
+    val pricedqty : String? = "",//已关联数量 | 已定价量
+    @SerializedName("spotcontractid")
+    val spotcontractid : String? = "",//合同编号
+    @SerializedName("unitid")
+    val unitid : String? = "",//现货单位id
+    @SerializedName("userid")
+    val userid : String? = "",//用户id
+    @SerializedName("vatrate")
+    val vatrate : String? = "",//增值税率
+    @SerializedName("wrstandardcode")
+    val wrstandardcode : String? = "",//现货商品代码
+    @SerializedName("wrstandardid")
+    val wrstandardid : String? = "",//现货商品id
+    @SerializedName("wrstandardname")
+    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()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(contractno)
+        parcel.writeString(contracttype)
+        parcel.writeString(customername)
+        parcel.writeString(customeruserid)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(middlegoodspricedqty3)
+        parcel.writeString(needhedgeratio)
+        parcel.writeString(pricedqty)
+        parcel.writeString(spotcontractid)
+        parcel.writeString(unitid)
+        parcel.writeString(userid)
+        parcel.writeString(vatrate)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<SCMiddleGoodsData> {
+        override fun createFromParcel(parcel: Parcel): SCMiddleGoodsData {
+            return SCMiddleGoodsData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<SCMiddleGoodsData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,201 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 定价报表数据模型
+ */
+data class SCMiddleGoodsReportData(
+    @SerializedName("begindate")
+    val begindate : String? = "",//开始交易日
+    @SerializedName("contractno")
+    val contractno : String? = "",//合同编号
+    @SerializedName("contracttype")
+    val contracttype : String? = "",//合同类型 1:采购 -1:销售
+    @SerializedName("convertratio")
+    val convertratio : String? = "",//折算系数
+    @SerializedName("cycletime")
+    val cycletime : String? = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
+    @SerializedName("cycletype")
+    val cycletype : String? = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    @SerializedName("deliverygoodscode")
+    val deliverygoodscode : String? = "",//品种代码
+    @SerializedName("deliverygoodsid")
+    val deliverygoodsid : String? = "",//现货品种ID
+    @SerializedName("deliverygoodsname")
+    val deliverygoodsname : String? = "",//品种名称
+    @SerializedName("diffprice")
+    val diffprice : String? = "",//现期价格差 = 今日点价登记均价(基价) - 今日期货成交均价
+    @SerializedName("diffqty")
+    val diffqty : String? = "",//期现数量差 = 套保计划量 - 今日期货关联成交量
+    @SerializedName("enddate")
+    val enddate : String? = "",//结束交易日
+    @SerializedName("hedgeplanqty")
+    val hedgeplanqty : String? = "",//套保计划量 = TodayPricedQty * 折算系数 * (1/(1+增值税率)) * 套保比例
+    @SerializedName("mathname")
+    val mathname : String? = "",//交易对手方
+    @SerializedName("middlegoodscode")
+    val middlegoodscode : String? = "",//套保品种代码
+    @SerializedName("middlegoodsid")
+    val middlegoodsid : String? = "",//套保品种ID
+    @SerializedName("middlegoodsname")
+    val middlegoodsname : String? = "",//套保品种名称
+    @SerializedName("middlegoodspricedqty")
+    val middlegoodspricedqty : String? = "",//已定价量(套保品种 - 税前) = PricedQty * 折算系数
+    @SerializedName("middlegoodspricedqty2")
+    val middlegoodspricedqty2 : String? = "",//已定价量(套保品种- 税后) = MiddleGoodsPricedQty * (1/(1+增值税率))
+    @SerializedName("middlegoodspricedqty3")
+    val middlegoodspricedqty3 : String? = "",//已定价量(套保品种应套保量) = MiddleGoodsPricedQty2 * 套保比率
+    @SerializedName("needhedgeratio")
+    val needhedgeratio : String? = "",//套保系数
+    @SerializedName("pricedamount")
+    val pricedamount : String? = "",//已定价额(现货)
+    @SerializedName("pricedamount2")
+    val pricedamount2 : String? = "",//已定价额(现货-基价额)
+    @SerializedName("pricedqty")
+    val pricedqty : String? = "",//已定价量(现货)
+    @SerializedName("reckondate")
+    val reckondate : String? = "",//日照时期(yyyyMMdd)
+    @SerializedName("relatedmiddlegoodsamount")
+    val relatedmiddlegoodsamount : String? = "",//已关联额(期货)
+    @SerializedName("relatedmiddlegoodsqty")
+    val relatedmiddlegoodsqty : String? = "",//已关联量(套保品种)(期货)
+    @SerializedName("spotcontractid")
+    val spotcontractid : String? = "",//现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+    @SerializedName("todayavgfutuprice")
+    val todayavgfutuprice : String? = "",//今日期货成交均价 = TodayRelatedMiddleGoodsAmount /TodayRelatedMiddleGoodsQty
+    @SerializedName("todayavgprice")
+    val todayavgprice : String? = "",//今日定价均价 = TodayPricedAmount / TodayPricedQty
+    @SerializedName("todayavgprice2")
+    val todayavgprice2 : String? = "",//今日点价登记均价(基价) = TodayPricedAmount2 / TodayPricedQty
+    @SerializedName("todaypricedamount")
+    val todaypricedamount : String? = "",//今日定价额(现货)
+    @SerializedName("todaypricedamount2")
+    val todaypricedamount2 : String? = "",//今日定价额(现货-基价额)
+    @SerializedName("todaypricedqty")
+    val todaypricedqty : String? = "",//今日定价量(现货)
+    @SerializedName("todayrelatedmiddlegoodsamount")
+    val todayrelatedmiddlegoodsamount : String? = "",//今日关联额(期货)
+    @SerializedName("todayrelatedmiddlegoodsqty")
+    val todayrelatedmiddlegoodsqty : String? = "",//今日关联量(期货)
+    @SerializedName("updatetime")
+    val updatetime : String? = "",//更新时间
+    @SerializedName("userid")
+    val userid : String? = "",//合同所属用户id
+    @SerializedName("vatrate")
+    val vatrate : String? = "",//增值税率
+    @SerializedName("wrstandardcode")
+    val wrstandardcode : String? = "",//商品(品类) 代码
+    @SerializedName("wrstandardid")
+    val wrstandardid : String? = "",//现货商品ID
+    @SerializedName("wrstandardname")
+    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(),
+        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.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(begindate)
+        parcel.writeString(contractno)
+        parcel.writeString(contracttype)
+        parcel.writeString(convertratio)
+        parcel.writeString(cycletime)
+        parcel.writeString(cycletype)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(diffprice)
+        parcel.writeString(diffqty)
+        parcel.writeString(enddate)
+        parcel.writeString(hedgeplanqty)
+        parcel.writeString(mathname)
+        parcel.writeString(middlegoodscode)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(middlegoodsname)
+        parcel.writeString(middlegoodspricedqty)
+        parcel.writeString(middlegoodspricedqty2)
+        parcel.writeString(middlegoodspricedqty3)
+        parcel.writeString(needhedgeratio)
+        parcel.writeString(pricedamount)
+        parcel.writeString(pricedamount2)
+        parcel.writeString(pricedqty)
+        parcel.writeString(reckondate)
+        parcel.writeString(relatedmiddlegoodsamount)
+        parcel.writeString(relatedmiddlegoodsqty)
+        parcel.writeString(spotcontractid)
+        parcel.writeString(todayavgfutuprice)
+        parcel.writeString(todayavgprice)
+        parcel.writeString(todayavgprice2)
+        parcel.writeString(todaypricedamount)
+        parcel.writeString(todaypricedamount2)
+        parcel.writeString(todaypricedqty)
+        parcel.writeString(todayrelatedmiddlegoodsamount)
+        parcel.writeString(todayrelatedmiddlegoodsqty)
+        parcel.writeString(updatetime)
+        parcel.writeString(userid)
+        parcel.writeString(vatrate)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<SCMiddleGoodsReportData> {
+        override fun createFromParcel(parcel: Parcel): SCMiddleGoodsReportData {
+            return SCMiddleGoodsReportData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<SCMiddleGoodsReportData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -136,6 +136,16 @@ data class UserInfoData(
         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()
     ) {
     }
@@ -170,6 +180,16 @@ data class UserInfoData(
         parcel.writeString(legalpersonname)
         parcel.writeString(nickname)
         parcel.writeString(taxpayernum)
+        parcel.writeString(cityname)
+        parcel.writeString(countryname)
+        parcel.writeString(districtname)
+        parcel.writeString(logincode)
+        parcel.writeString(memberusername)
+        parcel.writeString(parentuserid)
+        parcel.writeString(parentusername)
+        parcel.writeString(provincename)
+        parcel.writeString(proxystatementurl)
+        parcel.writeString(username)
     }
 
     override fun describeContents(): Int {
@@ -186,4 +206,5 @@ data class UserInfoData(
         }
     }
 
+
 }

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

@@ -9,14 +9,14 @@ object Constant {
 //    const val baseurl = "http://103.40.249.123:38280/cfg?key=mtp_20" // 天津麦顿
 //    const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
 //    const val baseurl = "http://103.40.249.123:8280/cfg?key=mtp_20"//千海金外盘
-    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
+//    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
 
 
 
 //    const val baseurl = "http://192.168.31.93:8080/cfg?key=test_93"//李倩企业风管 18611112222
 //    const val baseurl = "http://192.168.31.104:8080/cfg?key=test_104"//李倩云融 18611112222
 //
-//    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
+    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
 
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
@@ -29,7 +29,7 @@ object Constant {
 //    const val baseurl = "http://192.168.31.181:8080/cfg?key=test_181"//黄老板 华南顺通 调试 110010000001/123123  120010000001/123123
 //    const val baseurl = "http://192.168.31.136:8080/cfg?key=test_136"//黄老板 华南顺通
 
-    const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176"//黄老板 天津麦顿调试
+//    const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176"//黄老板 天津麦顿调试
 //    const val baseurl = "http://192.168.31.167:8080/cfg?key=test_167"//黄老板 平安云平台(企业风管)
 
     /**

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

@@ -143,7 +143,11 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         //冻结数量
         rightData.add(data.getFrozenqty());
         //持仓均价
-        rightData.add(NumberUtils.roundNum(data.getAverageprice(),goodsInfo.getDecimalplace()));
+        if (data.getAverageprice().equals("0")){
+            rightData.add("--");
+        }else {
+            rightData.add(NumberUtils.roundNum(data.getAverageprice(),goodsInfo.getDecimalplace()));
+        }
         if (quoteDayData != null) {
             //现价
             if (quoteDayData.getPrice() == 0.0) {
@@ -151,7 +155,6 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
             } else {
                 rightData.add(NumberUtils.roundNum(String.valueOf(quoteDayData.getPrice()), 2));
             }
-
             //持仓金额
             rightData.add(NumberUtils.roundNum(data.getCurholderamount(), 2));
             //计算成本价
@@ -170,7 +173,6 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
                     } else {
                         Profit = NumberUtils.roundNum(differencePrice * Double.parseDouble(data.getCurpositionqty()) * goodsInfo.getAgreeunit(), 2);
                     }
-
                 }
             }
             //浮动盈亏

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/unwind/ContractUnWindActivity.kt

@@ -285,7 +285,7 @@ class ContractUnWindActivity : BaseActivity<ContractUnWindViewModel>(){
                                     TradeID = applyData?.tradeid?.toLong() ?: 0,
                                     BuyOrSell = applyData?.buyorsell?.toInt() ?: 0
                                 ) {
-                                    finish()
+                                    viewModel.queryTradeHolderDetail(data = data,tag = thisTag)
                                 }
                             }
                             text = "平仓"

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newspot/NewAddSpotGoodsViewModel.kt

@@ -121,7 +121,7 @@ class NewAddSpotGoodsViewModel : BaseViewModel(){
                     value = data.wrstandardname ?: "",
                     enumdicname = data.enumdicname ?: "",
                     enumdicnameid = data.unitid ?: "",
-                    coefficientwarehouse = data.vatrate ?: "",
+                    coefficientwarehouse = data.vatrate?.toDouble()?.times(100).toString() ?: "",
                     middleGoodsId = data.wrstandardid ?: "",
                     middleGoodsList = newMiddleGoodsList
                 )

+ 9 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractViewModel.kt

@@ -476,15 +476,19 @@ class ContractViewModel : BaseViewModel() {
                 it.buynickname
             } + "\n" + it.qty + it.enumdicname)//'对手方/\n合同量 '
             newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n品类 '
-            newRightData.add(getProducType(it.producttype ?: "") + "\n" + it.vatrate)//'产品类型/\n增值税税率% '
-            newRightData.add(ViewEnumUtils.getPriceType(it.pricetype ?: "")  + "\n" + it.goodsname?.isBlankString())//'定价类型/\n点价合约 '
-            newRightData.add(it.price + "\n" + it.pricemove)//'价格/\n升贴水 '
-            newRightData.add(it.amount + "\n" + it.margin)//'金额/\n保证金 '
             newRightData.add(if (it.biztype == "1"){
                 "套保"
             }else{
                 "套利"
-            } + "\n" + it.accountid)//'业务类型/\n资金账户 '
+            } + "\n" + it.vatrate?.toPercentage())//'业务类型/\n增值税税率% '
+            newRightData.add(ViewEnumUtils.getPriceType(it.pricetype ?: "")  + "\n" + it.goodsname?.isBlankString())//'定价类型/\n点价合约 '
+            newRightData.add(it.price + "元" + "\n" + it.pricemove + "元")//'价格/\n升贴水 '
+            newRightData.add(it.amount + "元" + "\n" + it.margin + "元")//'金额/\n保证金 '
+//            newRightData.add(if (it.biztype == "1"){
+//                "套保"
+//            }else{
+//                "套利"
+//            } + "\n" + it.accountid)//'业务类型/\n资金账户 '
 
             if (QueryType != "3"){
                 newRightData.add(it.startdate?.isShowTimeString("MM-dd") + "~" + it.enddate?.isShowTimeString("MM-dd") + "\n" + it.deliverystartdate?.isShowTimeString("MM-dd") + "~" + it.deliveryenddate?.isShowTimeString("MM-dd"))//'点价期/\n交收期 '

+ 63 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/AddCustomerDataActivity.kt

@@ -147,6 +147,11 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
     lateinit var contact_number: EditText
 
     /**
+     * 邮箱
+     */
+    lateinit var email: EditText
+
+    /**
      * 备注
      */
     lateinit var remark: EditText
@@ -518,7 +523,11 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
 
                             editText {
                                 if (status != "1") {
-                                    setText(data.customername)
+                                    if (data.userinfotype == 1){
+                                        setText(data.username)
+                                    }else{
+                                        setText(data.nickname)
+                                    }
                                 }
                                 if (status != "1" && status != "2") {
                                     isEnabled = false
@@ -1269,6 +1278,47 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
 
                         viewItemUI()
 
+                        // 邮箱
+                        linearLayout {
+                            customerType.bindOptional(context) {
+                                if (it?.id == "2") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+
+                            textView {
+                                text = "邮        箱"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            editText {
+                                if (status != "1") {
+                                    setText(data.telphone?.isBlankString())
+                                }
+                                if (status != "1" && status != "2") {
+                                    isEnabled = false
+                                }
+                                email = this
+                                hint = "请输入邮箱"
+                                background = null
+                                inputType = EditorInfo.TYPE_CLASS_PHONE
+                                hintColorStr = "#CCCCCC"
+                                textSizeAuto = 31
+                                textColorStr = "#333333"
+                            }.lparams(autoSize(500), wrapContent) {
+                                marginStart = autoSize(86)
+                            }
+
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
+
                         // 联系电话
                         linearLayout {
                             customerType.bindOptional(context) {
@@ -1299,7 +1349,6 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                                 hint = "请输入联系电话"
                                 background = null
                                 inputType = EditorInfo.TYPE_CLASS_PHONE
-//                    setDecimalInputType()
                                 hintColorStr = "#CCCCCC"
                                 textSizeAuto = 31
                                 textColorStr = "#333333"
@@ -1330,7 +1379,14 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                             gravity = Gravity.CENTER_VERTICAL
 
                             textView {
-                                textResource = R.string.correspondence_address
+                                customerType.bindOptional(context) {
+                                    if (it?.id == "1") {
+                                        textResource = R.string.correspondence_address
+                                    } else {
+                                        text = "常用地址"
+                                    }
+                                }
+
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
@@ -1736,6 +1792,10 @@ class AddCustomerDataActivity : BaseActivity<CustomerDataViewModel>() {
                 data.cardbackphotourl = backIdCarduploadFile
             }
 
+            if (email.text.toString().isNotEmpty()){
+                data.email = email.text.toString()
+            }
+
             data.nickname = enterprise_name.text.toString()
         }else{//企业
             // 营业执照

+ 158 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/customerdata/CustomerDataDetailsActivity.kt

@@ -6,6 +6,7 @@ import android.view.View
 import android.view.inputmethod.EditorInfo
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.cardtype
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.global.data.UserInfoData
 import cn.muchinfo.rma.global.database.DataBase
@@ -109,7 +110,11 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
 
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
-                                text = "企业名称"
+                                if (data.userinfotype == 1){
+                                    text = "姓        名"
+                                }else{
+                                    text = "企业名称"
+                                }
                                 textSizeAuto = 31
                                 textColorInt = R.color.p_normal_summary_txt_color
                             }.lparams(wrapContent, wrapContent) {
@@ -117,7 +122,11 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
                             }
 
                             textView {
-                                text = data.customername
+                                if (data.userinfotype == 1){
+                                    text = data.username
+                                }else{
+                                    text = data.customername
+                                }
                                 textColorInt = R.color.black
                                 textSizeAuto = 31
                             }.lparams(wrapContent, wrapContent) {
@@ -154,7 +163,11 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
                         viewItemUI()
 
                         linearLayout {
-
+                            if (data.userinfotype == 2){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
                                 text = "证件类型"
@@ -165,7 +178,7 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
                             }
 
                             textView {
-                                text = data.cardtypename?.isBlankString()
+                                text = data.cardtype?.toString()?.cardtype()
                                 textColorInt = R.color.black
                                 textSizeAuto = 31
                             }.lparams(wrapContent, wrapContent) {
@@ -179,7 +192,11 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
 
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
-                                text = "证件号码"
+                                if (data.userinfotype == 1){
+                                    text = "身份证号码"
+                                }else{
+                                    text = "证件号码"
+                                }
                                 textSizeAuto = 31
                                 textColorInt = R.color.p_normal_summary_txt_color
                             }.lparams(wrapContent, wrapContent) {
@@ -224,7 +241,81 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
                         viewItemUI()
 
                         linearLayout {
+                            if (data.userinfotype == 1){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "身份证正面照"
+                                textSizeAuto = 31
+                                textColorInt = R.color.p_normal_summary_txt_color
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            textView {
+                                onThrottleFirstClick {
+                                     if (data.cardfrontphotourl?.isNotEmpty() == true){
+                                         PhotoUtils().showImageViewer(
+                                             this@CustomerDataDetailsActivity,
+                                             1,
+                                             arrayListOf(data.cardfrontphotourl!!)
+                                         )
+                                     }
+                                }
+                                text = "查看附件"
+                                textColorInt = R.color.rma_yellow_text_color
+                                textSizeAuto = 31
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(80)
+                            }
+                        }.lparams(matchParent, autoSize(136))
+
+                         viewItemUI()
+
+                        linearLayout {
+                            if (data.userinfotype == 1){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "身份证反面照"
+                                textSizeAuto = 31
+                                textColorInt = R.color.p_normal_summary_txt_color
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            textView {
+                                onThrottleFirstClick {
+                                     if (data.cardfrontphotourl?.isNotEmpty() == true){
+                                         PhotoUtils().showImageViewer(
+                                             this@CustomerDataDetailsActivity,
+                                             1,
+                                             arrayListOf(data.cardbackphotourl!!)
+                                         )
+                                     }
+                                }
+                                text = "查看附件"
+                                textColorInt = R.color.rma_yellow_text_color
+                                textSizeAuto = 31
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(80)
+                            }
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
 
+                        linearLayout {
+                            if (data.userinfotype == 2){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
                                 text = "营业执照"
@@ -278,6 +369,32 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
                             }
                         }.lparams(matchParent, autoSize(136))
 
+                         viewItemUI()
+
+                        linearLayout {
+                            if (data.userinfotype == 2){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "联  系  人"
+                                textSizeAuto = 31
+                                textColorInt = R.color.p_normal_summary_txt_color
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            textView {
+                                text = data.contactname?.isBlankString()
+                                textColorInt = R.color.black
+                                textSizeAuto = 31
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(80)
+                            }
+                        }.lparams(matchParent, autoSize(136))
+
                         viewItemUI()
 
                         linearLayout {
@@ -303,7 +420,11 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
                         viewItemUI()
 
                         linearLayout {
-
+                            if (data.userinfotype == 2){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
                                 text = "联系电话"
@@ -325,10 +446,40 @@ class CustomerDataDetailsActivity : BaseActivity<CustomerDataViewModel>(){
                         viewItemUI()
 
                         linearLayout {
+                            if (data.userinfotype == 1){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "邮        箱"
+                                textSizeAuto = 31
+                                textColorInt = R.color.p_normal_summary_txt_color
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(59)
+                            }
+
+                            textView {
+                                text = data.email?.isBlankString()
+                                textColorInt = R.color.black
+                                textSizeAuto = 31
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(80)
+                            }
+                        }.lparams(matchParent, autoSize(136))
+
+                        viewItemUI()
+
+                        linearLayout {
 
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
-                                text = "通讯地址"
+                                if (data.userinfotype == 1){
+                                    text = "常住地址"
+                                }else{
+                                    text = "通讯地址"
+                                }
                                 textSizeAuto = 31
                                 textColorInt = R.color.p_normal_summary_txt_color
                             }.lparams(wrapContent, wrapContent) {

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

@@ -159,7 +159,7 @@ class CustomerDataViewModel : BaseViewModel() {
                     "2" -> {    // 待审核 mmp 根本没有返回审核时间
                         val newList = respData?.toArrayList()
                         newList?.sortWith(Comparator { t1, t2 ->
-                            (TimeUtils.string2Millis(t1.createtime) - TimeUtils.string2Millis(t2.createtime)).toInt()
+                            (TimeUtils.string2Millis(t2.createtime) - TimeUtils.string2Millis(t1.createtime)).toInt()
                         })
                         toAuditList.postValue(newList)
                     }

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

@@ -157,7 +157,7 @@ class HedgeDetailsActivity : BaseActivity<HedgePlanViewModel>() {
 
                             creatHedgeItemView(
                                 titleString = "计  划  量",
-                                content = data.planqty + data.enumdicname
+                                content = data.planqty + data.wrunitidame
                             )
 
                             if (type == "2") {

+ 34 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgePlanViewHolder.kt

@@ -238,6 +238,40 @@ class HedgePlanViewHolder(private val activity: AppCompatActivity,private val vi
                 }.lparams(autoSize(168), autoSize(48)) {
                     marginEnd = autoSize(24)
                 }
+
+                 textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","3")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context,HedgeDetailsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    data.bindOptional(context) {
+                       if (type == "0") {
+                           //判断是否有相应权限显示该功能
+                           if (GlobalDataCollection.instance?.getFourLevelMenu(firstCode = "client_spots",secondCode = "client_spots_hedgeplan",threeCode = "client_spots_hedgeplan_new",fourCode = "client_spots_hedgeplan_new_delete") == true){
+                               if (it?.hedgeplanstatus == "1" || it?.hedgeplanstatus == "0") {
+                                   visibility = View.VISIBLE
+                               } else {
+                                   visibility = View.GONE
+                               }
+                           }else{
+                               visibility = View.GONE
+                           }
+                        } else {
+                           visibility = View.GONE
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "删除"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(168), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
                 textView {
                     onThrottleFirstClick {
                         val intent = Intent()

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

@@ -105,7 +105,7 @@ class OperationTradeActivity : BaseActivity<TradeMainViewModel>(){
                                 finish()
                             }
                         }else if (type == "2"){//修改
-                            viewModel.ermcpPaAreaSubjectReq(SubjectID = data.subjectid?.toLong() ?: 0,SubjectName = input_trade_main_name.text.toString(),OperateType = 1){
+                            viewModel.ermcpPaAreaSubjectReq(SubjectID = data.subjectid?.toLong() ?: 0,SubjectName = input_trade_main_name.text.toString(),OperateType = 2){
                                 finish()
                             }
                         }

+ 3 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/trademain/TradeMainActivity.kt

@@ -24,6 +24,8 @@ import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import io.reactivex.disposables.Disposable
 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.*
 import org.jetbrains.anko.support.v4.viewPager
 
@@ -95,6 +97,7 @@ class TradeMainActivity : BaseActivity<TradeMainViewModel>(){
         initMenuData()
         verticalLayout {
             val margerding = autoSize(32)
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.segtabment_bg_color)
             topBar {
                 commonLeftButton()

+ 6 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/trademain/TradeNormalViewHolder.kt

@@ -119,7 +119,9 @@ class TradeNormalViewHolder(private val activity : AppCompatActivity,private val
                             }
                             addAction("确定") { dialog, _ ->
                                 dialog.dismiss()
-
+                                viewModel.ermcpPaAreaSubjectReq(SubjectID = data.value?.subjectid?.toLong() ?: 0,OperateType = 3,SubjectName = data.value?.subjectname ?: ""){
+                                    viewModel.getNormalDataList()
+                                }
                             }
                         }.show()
 
@@ -148,10 +150,11 @@ class TradeNormalViewHolder(private val activity : AppCompatActivity,private val
                             }
                             addAction("确定") { dialog, _ ->
                                 dialog.dismiss()
-
+                                viewModel.ermcpPaAreaSubjectReq(SubjectID = data.value?.subjectid?.toLong() ?: 0,OperateType = 4,SubjectName = data.value?.subjectname ?: ""){
+                                    viewModel.getDisableDataList()
+                                }
                             }
                         }.show()
-
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER

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

@@ -477,11 +477,11 @@ class SellListedUI(
                     setOnTextChangeListener { view, value ->
                         if (value.isNullOrEmpty().not() && value.toString().toDouble() != 0.0) {
                             valueChange.postValue(valueChange.value)
-                            viewModel.maxSellListedingNumber.postValue(
-                                viewModel.usedAccountData.value?.canUserAmount?.div(
-                                    value?.toString()?.toDouble() ?: 1.0
-                                )?.toInt().toString()
-                            )
+//                            viewModel.maxSellListedingNumber.postValue(
+//                                viewModel.usedAccountData.value?.canUserAmount?.div(
+//                                    value?.toString()?.toDouble() ?: 1.0
+//                                )?.toInt().toString()
+//                            )
                         }
                     }
                     setTextColor(R.color.buy_hall_color)
@@ -661,6 +661,7 @@ class SellListedUI(
             }.lparams(matchParent, autoSize(143))
 
             textView {
+                visibility = View.GONE
                 viewModel.usedAccountData.bindOptional(context) {
                     text = "可用资金" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.canUserAmount.toString()), 2)
                 }

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

@@ -117,6 +117,7 @@ class SwapsListedViewModel : BaseViewModel(){
         val selectPositionData = dataList.find { it.goodsid == goodsId }
         if (selectPositionData?.goodsid.isNullOrEmpty().not()){
             tradePositionData.postValue(selectPositionData)
+            maxSellListedingNumber.postValue(selectPositionData?.enableqty)
         }else{
             tradePositionData.postValue(ContractTradePositionData())
         }

+ 1 - 1
RMA/app/src/main/res/drawable/qhj_main_blue_bg.xml

@@ -2,6 +2,6 @@
 <shape
     xmlns:android="http://schemas.android.com/apk/res/android">
     <solid android:color="@color/rma_blue_color"/>
-    <corners android:radius="45dp"
+    <corners android:radius="5dp"
        />
 </shape>