Procházet zdrojové kódy

风险管理8月31日提交代码-liu.bolan-云融大宗

Liu.bolan před 4 roky
rodič
revize
0e7be4a542
29 změnil soubory, kde provedl 4481 přidání a 614 odebrání
  1. 2 2
      RMA/app/build.gradle
  2. 8 4
      RMA/app/src/main/java/cn/muchinfo/rma/business/spot/SpotAdapter.kt
  3. 3 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/spot/SpotManager.kt
  4. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/adapter/WarehouseAdapter.kt
  5. 45 9
      RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt
  6. 40 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/WrOrderDetailData.kt
  7. 3944 355
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI3.java
  8. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  9. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysViewModel.kt
  10. 18 9
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/bookingwarehouse/BookingWarehouseViewModel.kt
  11. 10 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/bookingwarehouse/adapter/BookingAreCancelContentAdapter.java
  12. 7 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java
  13. 38 40
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewHolder.kt
  14. 7 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/SpotWareHouseViewModel.kt
  15. 49 28
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/arecancelled/AreCancelledActivity.kt
  16. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainContentAdapter.java
  17. 171 116
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt
  18. 19 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedViewModel.kt
  19. 15 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt
  20. 2 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptViewModel.kt
  21. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/circle/TradeCircleContentAdapter.java
  22. 59 19
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleDelistedActivity.kt
  23. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleDelistedViewModel.kt
  24. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleListedBuyUI.kt
  25. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleListedSellUI.kt
  26. 17 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleListedingViewModel.kt
  27. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/chart/YrdzChartActivity.kt
  28. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/chart/YrdzChartViewModel.kt
  29. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/dealdetails/YrdzDealDetailsViewModel.kt

+ 2 - 2
RMA/app/build.gradle

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

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

@@ -25,9 +25,11 @@ object SpotAdapter {
         BuyOrSell : String = "",//摘牌方向
         ApplyQty : Long = 0,//摘牌数量
         ApplyPrice : String = "",//申请价格
-        ApplyRemark : String = ""//申请备注
+        ApplyRemark : String = "",//申请备注
+        LadingBillid : Long = 0,//摘牌方提单ID [卖]
+        SubNum : Long = 0//摘牌方提单子单号 [卖]
     ) : Packet50{
-        val builder = ManageServiceMI1.WrBargainApplyReq.newBuilder()
+        val builder = ManageServiceMI3.WrBargainApplyReq.newBuilder()
         val loginInfo = GlobalDataCollection.instance?.loginRsp!!
 
         builder.setHeader(
@@ -46,6 +48,8 @@ object SpotAdapter {
         builder.applyQty = ApplyQty
         builder.applyPrice = ApplyPrice
         builder.applyRemark = ApplyRemark
+        builder.ladingBillid = LadingBillid
+        builder.subNum = SubNum
         val arrayOutputStream = ByteArrayOutputStream()
         builder.build().writeTo(arrayOutputStream)
         return Packet50(FunCode.FID_WrBargainApplyReq, arrayOutputStream.toByteArray())
@@ -57,9 +61,9 @@ object SpotAdapter {
      * @param packet50 Packet50
      * @return Triple<Boolean, Error?, ManageServiceMI2.ErmcpSpotGoodsPriceRsp?>
      */
-    fun analysisWrBargainApplyRsp(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI1.WrBargainApplyRsp?> {
+    fun analysisWrBargainApplyRsp(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI3.WrBargainApplyRsp?> {
         return try {
-            val resultRsp = ManageServiceMI1.WrBargainApplyRsp.parseFrom(packet50.content)
+            val resultRsp = ManageServiceMI3.WrBargainApplyRsp.parseFrom(packet50.content)
             if (resultRsp.retCode == 0) {
                 // 操作成功
                 Triple(true, null, resultRsp)

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

@@ -32,6 +32,8 @@ class SpotManager {
         BuyOrSell : String = "",//摘牌方向
         ApplyQty : Long = 0,//摘牌数量
         ApplyPrice : String = "",//申请价格
+        LadingBillid : Long = 0,//摘牌方提单ID [卖]
+        SubNum : Long = 0,//摘牌方提单子单号 [卖]
         callback: (isCompleted: Boolean, err: Error?) -> Unit
     ){
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
@@ -40,7 +42,7 @@ class SpotManager {
         }
 
         val reqPacket = SpotAdapter.getWrBargainApplyReqInfo(
-            WRTradeOrderID, UserID, AccountID, BuyOrSell, ApplyQty, ApplyPrice
+            WRTradeOrderID, UserID, AccountID, BuyOrSell, ApplyQty, ApplyPrice,"",LadingBillid,SubNum
         )
 
         tradeSocketManager.send(

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/adapter/WarehouseAdapter.kt

@@ -357,7 +357,7 @@ object WarehouseAdapter {
         if (WRFactorTypeId == 0L){
             builder.addAllFactoryItems(FactoryItems)
         }
-        if (CanPart == 0){
+        if (CanPart == 1){
             builder.delistMinQty = DelistMinQty
         }
         builder.wrFactorTypeId = WRFactorTypeId

+ 45 - 9
RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt

@@ -434,31 +434,67 @@ fun String.wrtradeorderstatus() : String{
             str = "已撤"
         }
         this == "7" -> {
-            str = "成"
+            str = "成"
         }
         this == "8" -> {
-            str = "成交失败"
+            str = "成"
         }
         this == "9" -> {
-            str = "委托拒绝"
+            str = "部成部撤"
         }
         this == "10" -> {
-            str = "挂牌部分成交"
+            str = "成交失败"
         }
         this == "11" -> {
-            str = "仓单生成失败"
+            str = "委托拒绝"
         }
         this == "12" -> {
-            str = "首付扣款失败"
+            str = "经过摘牌"
         }
         this == "13" -> {
-            str = "履约失败"
+            str = "冻结成功"
         }
         this == "14" -> {
-            str = "撤单解冻贷款失败"
+            str = "通道已撤"
         }
         this == "15" -> {
-            str = "部成部撤"
+            str = "通道部成部撤"
+        }
+        this == "16" -> {
+            str = "成交失败违约"
+        }
+        this == "17" -> {
+            str = "冻结PD成功"
+        }
+        this == "18" -> {
+            str = "冻结PD失败"
+        }
+        this == "19" -> {
+            str = "冻结能量成功"
+        }
+        this == "20" -> {
+            str = "冻结能量失败"
+        }
+        this == "21" -> {
+            str = "预约已报价"
+        }
+        this == "22" -> {
+            str = "过期未付"
+        }
+        this == "23" -> {
+            str = "优惠券处理中"
+        }
+        this == "24" -> {
+            str = "仓单生成失败"
+        }
+        this == "25" -> {
+            str = "首付扣款失败"
+        }
+        this == "26" -> {
+            str = "履约失"
+        }
+        this == "27" -> {
+            str = "撤单解冻贷款失"
         }
     }
 

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

@@ -8,6 +8,26 @@ import com.google.gson.annotations.SerializedName
  * 现货仓单 | 预售仓单 -> 挂单实体
  */
 data class WrOrderDetailData(
+    @SerializedName("accountid")
+    val accountid : String? = "",//交易账号(资金账号)
+    @SerializedName("amount")
+    val amount : String? = "",//挂牌金额 = 委托数量 * 固定价或升贴水
+    @SerializedName("delistminqty")
+    val delistminqty : String? = "",//起摘数量
+    @SerializedName("freezemargin")
+    val freezemargin : String? = "",//冻结保证金(保证金)
+    @SerializedName("goodsname")
+    val goodsname : String? = "",//
+    @SerializedName("marginvalue")
+    val marginvalue : String? = "",//保证金设置值(履约保证金)
+    @SerializedName("matchusername")
+    val matchusername : String? = "",//对手方名称(当ISSPECIFIED=1时,有值,指定朋友的名称)
+    @SerializedName("minivalue")
+    val minivalue : String? = "",//现货商品最小变动值
+    @SerializedName("taname")
+    val taname : String? = "",//交易用户名称(资金账号名称)
+    @SerializedName("validtime")
+    val validtime : String? = "",//挂牌有效期
     @SerializedName("buyorsell")
     val buyorsell : String? = "",//买卖 - 0:买 1:卖(挂牌类型 买为采购 卖为销售)
     @SerializedName("cancelqty")
@@ -125,11 +145,31 @@ data class WrOrderDetailData(
         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.createStringArrayList()
     ) {
     }
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(amount)
+        parcel.writeString(delistminqty)
+        parcel.writeString(freezemargin)
+        parcel.writeString(goodsname)
+        parcel.writeString(marginvalue)
+        parcel.writeString(matchusername)
+        parcel.writeString(minivalue)
+        parcel.writeString(taname)
+        parcel.writeString(validtime)
         parcel.writeString(buyorsell)
         parcel.writeString(cancelqty)
         parcel.writeString(deliverygoodscode)

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3944 - 355
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI3.java


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

@@ -16,11 +16,11 @@ object Constant {
 //    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"// 瑶姐 云融 130000000001 123456
+    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 130000000001 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"
-    const val baseurl: String = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
+//    const val baseurl: String = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
 //
 //    const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
 //    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境

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

@@ -5,6 +5,7 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.database.DataBase
 import cn.muchinfo.rma.global.toPercentage
+import cn.muchinfo.rma.global.toShowTime3
 import cn.muchinfo.rma.global.validtype
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.protobuf.protoclasses.WarehouseTradeMI1
@@ -205,7 +206,7 @@ class HnstcdysViewModel : BaseViewModel(){
             //整单
             newRightData.add(if (it.canpart == "0"){"是"}else{"否"})
             //挂牌有效期
-            newRightData.add(it.validtime ?: "-")
+            newRightData.add(it.validtime?.toShowTime3() ?: "-")
             //履约保证金
             newRightData.add(it.marginvalue?.toPercentage() ?: "-")
             //履约方式

+ 18 - 9
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/bookingwarehouse/BookingWarehouseViewModel.kt

@@ -1,11 +1,8 @@
 package cn.muchinfo.rma.view.base.hnstmain.bookingwarehouse
 
 import androidx.lifecycle.MutableLiveData
-import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.*
 import cn.muchinfo.rma.global.data.*
-import cn.muchinfo.rma.global.isBlankString
-import cn.muchinfo.rma.global.toPercentage
-import cn.muchinfo.rma.global.wrtradeorderstatus
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
@@ -201,7 +198,7 @@ class BookingWarehouseViewModel : BaseViewModel(){
             //仓库
             newRightData.add(it.warehousename ?: "-")
             //挂牌类型
-            newRightData.add("-")
+            newRightData.add(if (it.buyorsell == "0"){"买"}else{"卖"})
             //挂牌价格
             newRightData.add(it.fixedprice ?: "-")
             //挂牌数量
@@ -215,13 +212,13 @@ class BookingWarehouseViewModel : BaseViewModel(){
             //履约方式
             newRightData.add(it.templatename ?: "-")
             //最新议价价格
-            newRightData.add("-")
+            newRightData.add(it.applyprice ?: "-")
             //最新议价数量
-            newRightData.add("-")
+            newRightData.add(it.applyqty ?: "-")
             //最新议价时间
-            newRightData.add("-")
+            newRightData.add(it.applytime ?: "-")
             //最新议价状态
-            newRightData.add("-")
+            newRightData.add(it.applystatus?.bargainapplystatus() ?: "-")
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }
@@ -478,6 +475,18 @@ class BookingWarehouseViewModel : BaseViewModel(){
             newRightData.add(it.deliverymonth ?: "-")
             //挂牌类型
             newRightData.add(if (it.buyorsell == "0"){"买入"}else{"卖出"})
+            //挂牌方式
+            if (it.isspecified == "1"){
+                newRightData.add("贸易圈")
+            }else{
+                if (it.wrpricetype == "1"){
+                    newRightData.add("一口价")
+                }else if (it.wrpricetype == "2"){
+                    newRightData.add("浮动价")
+                }else{
+                    newRightData.add("--")
+                }
+            }
             //期货合约/基差
             newRightData.add(if (it.goodscode.isNullOrEmpty()){ "--"}else{ it.goodscode  + "\n" + NumberUtils.roundNum(it.pricemove,2)})
             //挂牌价格

+ 10 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/bookingwarehouse/adapter/BookingAreCancelContentAdapter.java

@@ -26,6 +26,7 @@ import cn.muchinfo.rma.global.data.WrOrderDetailData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
 import cn.muchinfo.rma.view.base.hnstmain.bookingwarehouse.BookingWarehouseViewModel;
 import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.SpotWareHouseViewModel;
+import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.arecancelled.AreCancelledActivity;
 import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.bargain.BargainActivity;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
 
@@ -129,6 +130,7 @@ public class BookingAreCancelContentAdapter extends RecyclerView.Adapter<Booking
         }else {
             itemViewHolder.bargain.setVisibility(View.GONE);
         }
+        itemViewHolder.details.setVisibility(View.VISIBLE);
 
         itemViewHolder.bargain.setOnClickListener(view -> {
             Intent intent = new Intent();
@@ -145,6 +147,13 @@ public class BookingAreCancelContentAdapter extends RecyclerView.Adapter<Booking
             viewModel.getSelectCancelData().postValue(data);
         });
 
+        itemViewHolder.details.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("data", data);
+            intent.setClass(context, AreCancelledActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+
         itemViewHolder.load_more.setOnClickListener(view -> {
 
         });
@@ -209,6 +218,7 @@ public class BookingAreCancelContentAdapter extends RecyclerView.Adapter<Booking
         public ItemViewHolder(@NonNull View itemView) {
             super(itemView);
             bargain = itemView.findViewById(R.id.bargain);
+            details = itemView.findViewById(R.id.details);
             midpoints_registration = itemView.findViewById(R.id.midpoints_registration);
             settlement_of_registration = itemView.findViewById(R.id.settlement_of_registration);
             payment_registration = itemView.findViewById(R.id.payment_registration);

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

@@ -131,12 +131,17 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
             //现价
             rightData.add(NumberUtils.roundNum(String.valueOf(quoteDayData.getPrice()),2));
             //持仓金额
-            rightData.add(NumberUtils.roundNum(String.valueOf((quoteDayData.getPrice() * Double.parseDouble(data.getCurpositionqty()))),2));
+            rightData.add(NumberUtils.roundNum(data.getCurholderamount(),2));
             //计算成本价
             double closePrice = (Double.parseDouble(data.getAverageprice()));
             //计算出成本价和现价的价差
             double differencePrice = quoteDayData.getPrice() - closePrice;
-            String Profit = NumberUtils.roundNum(((differencePrice / closePrice) * 100),2) + "%";
+            String Profit = "";
+            if (closePrice == 0.0){
+                Profit = "--";
+            }else {
+                Profit = NumberUtils.roundNum(((differencePrice / closePrice) * 100),2) + "%";
+            }
             //浮动盈亏
             rightData.add(Profit);
         }else {

+ 38 - 40
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewHolder.kt

@@ -22,7 +22,11 @@ import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.autowidget.dialog.createWarningDialog
 import org.jetbrains.anko.*
 
-class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,private val viewModel: PerformanceTemplateViewModel,private val type : String) : BaseViewHolder<PermancePlanTmpData>(activity){
+class PerformanceTemplateViewHolder(
+    private val activity: AppCompatActivity,
+    private val viewModel: PerformanceTemplateViewModel,
+    private val type: String
+) : BaseViewHolder<PermancePlanTmpData>(activity) {
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     private val performanceItemTemplateAdapter: BaseAdapter<WrGoodsPerformanceStepData, PerformanceItemViewHolder> =
@@ -35,67 +39,61 @@ class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,pri
 
     override fun _FrameLayout.createContentView() {
         verticalLayout {
-           onThrottleFirstClick {
-               if (type == "1"){
-                   viewModel.setOnItemClick(autoid = data.value?.autoid ?: "")
-               }else{
-                   viewModel.selectPerformaceData.postValue(data.value)
-               }
+            onThrottleFirstClick {
+                if (type == "1") {
+                    viewModel.setOnItemClick(autoid = data.value?.autoid ?: "")
+                } else {
+                    viewModel.selectPerformaceData.postValue(data.value)
+                }
 
-           }
+            }
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
-                    data.bindOptional(context){
+                    data.bindOptional(context) {
                         text = it?.templatename
                     }
                     textSizeAuto = 36
                     textColorInt = R.color.rma_black_33
                     typeface = Typeface.defaultFromStyle(Typeface.BOLD)
-                }.lparams(wrapContent, wrapContent){
+                }.lparams(wrapContent, wrapContent) {
                     marginStart = autoSize(36)
                 }
                 emptyView()
                 textView {
-                    if (type == "1"){
+                    if (type == "1") {
                         visibility = View.VISIBLE
-                    }else{
+                    } else {
                         visibility = View.GONE
                     }
-                    data.bindOptional(context){
+                    data.bindOptional(context) {
                         text = it?.createtime
                     }
                     textSizeAuto = 32
                     textColorInt = R.color.rma_gray_color
-                }.lparams(wrapContent, wrapContent){
+                }.lparams(wrapContent, wrapContent) {
                     marginEnd = autoSize(36)
                 }
             }.lparams(matchParent, autoSize(100))
 
-            horizontalScrollView {
-
-                isHorizontalScrollBarEnabled = false
-
-                recyclerView {
-                    background = resources.getDrawable(R.color.white)
-                    adapter = performanceItemTemplateAdapter
-                    layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)
-                }
-                data.bindOptional(context){
-                    performanceItemTemplateAdapter.setNewData(it?.lstStep)
-                }
-
+            recyclerView {
+                background = resources.getDrawable(R.color.white)
+                adapter = performanceItemTemplateAdapter
+                layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)
             }.lparams(matchParent, autoSize(175))
+            data.bindOptional(context) {
+                performanceItemTemplateAdapter.setNewData(it?.lstStep)
+            }
 
             linearLayout {
-                data.bindOptional(context){
-                    if (type == "1"){
-                        if (it?.isClick == 0){
+                data.bindOptional(context) {
+                    if (type == "1") {
+                        if (it?.isClick == 0) {
                             visibility = View.GONE
-                        }else{
+                        } else {
                             visibility = View.VISIBLE
                         }
-                    }else{
+                    } else {
                         visibility = View.GONE
                     }
                 }
@@ -105,10 +103,10 @@ class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,pri
 
                 textView {
                     onThrottleFirstClick {
-                       val intent = Intent()
-                        intent.putExtra("type","2")
-                        intent.setClass(context,AddPerformanceTempateActivity::class.java)
-                        intent.putExtra("data",data.value)
+                        val intent = Intent()
+                        intent.putExtra("type", "2")
+                        intent.setClass(context, AddPerformanceTempateActivity::class.java)
+                        intent.putExtra("data", data.value)
                         ActivityUtils.startActivity(intent)
 
                     }
@@ -117,7 +115,7 @@ class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,pri
                     text = "修改"
                     textSizeAuto = 29
                     textColorInt = R.color.rma_blue_color
-                }.lparams(autoSize(100), autoSize(60)){
+                }.lparams(autoSize(100), autoSize(60)) {
                     marginEnd = autoSize(36)
                 }
 
@@ -131,8 +129,8 @@ class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,pri
                             }
                             addAction("确定") { dialog, _ ->
                                 viewModel.delPerformancePlanTemplateReq(
-                                     autoid = data.value?.autoid?.toLong() ?: 0
-                                ){
+                                    autoid = data.value?.autoid?.toLong() ?: 0
+                                ) {
                                     viewModel.queryPermancePlanTmp()
                                 }
                                 dialog.dismiss()
@@ -144,7 +142,7 @@ class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,pri
                     text = "删除"
                     textSizeAuto = 29
                     textColorInt = R.color.rma_blue_color
-                }.lparams(autoSize(100), autoSize(60)){
+                }.lparams(autoSize(100), autoSize(60)) {
                     marginEnd = autoSize(36)
                 }
             }.lparams(matchParent, autoSize(72))

+ 7 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/SpotWareHouseViewModel.kt

@@ -245,7 +245,7 @@ class SpotWareHouseViewModel : BaseViewModel(){
             //仓库
             newRightData.add(it.warehousename ?: "-")
             //挂牌类型
-            newRightData.add("-")
+            newRightData.add(if (it.buyorsell == "0"){"买"}else{"卖"})
             //挂牌价格
             newRightData.add(it.fixedprice ?: "-")
             //挂牌数量
@@ -257,13 +257,13 @@ class SpotWareHouseViewModel : BaseViewModel(){
             //履约方式
             newRightData.add(it.templatename ?: "-")
             //最新议价价格
-            newRightData.add("-")
+            newRightData.add(it.applyprice ?: "-")
             //最新议价数量
-            newRightData.add("-")
+            newRightData.add(it.applyqty ?: "-")
             //最新议价时间
-            newRightData.add("-")
+            newRightData.add(it.applytime ?: "-")
             //最新议价状态
-            newRightData.add("-")
+            newRightData.add(it.applystatus?.bargainapplystatus() ?: "-")
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }
@@ -610,9 +610,9 @@ class SpotWareHouseViewModel : BaseViewModel(){
             if (it.isspecified == "1"){
                 newRightData.add("贸易圈")
             }else{
-                if (it.wrpricetype == "0"){
+                if (it.wrpricetype == "1"){
                     newRightData.add("一口价")
-                }else if (it.wrpricetype == "1"){
+                }else if (it.wrpricetype == "2"){
                     newRightData.add("浮动价")
                 }else{
                     newRightData.add("--")

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

@@ -1,13 +1,19 @@
 package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.arecancelled
 
+import android.annotation.SuppressLint
 import android.os.Bundle
 import android.view.Gravity
+import android.view.View
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.WrOrderDetailData
+import cn.muchinfo.rma.global.isBlankString
+import cn.muchinfo.rma.global.isShowTimeString
+import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.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.warehousereceipt.BusinessItemView
 import cn.muchinfo.rma.view.base.warehousereceipt.RulesItem
 import org.jetbrains.anko.*
@@ -21,7 +27,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
     val data by lazy { intent.getParcelableExtra<WrOrderDetailData>("data") as WrOrderDetailData }
 
 
-
+    @SuppressLint("SetTextI18n")
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         viewModel.queryWrGoodsInfo(data = data)
@@ -120,7 +126,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = data.accountid
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -140,7 +146,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = if (data.buyorsell == "0"){"采购"}else{"销售"}
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -164,6 +170,19 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
+
+                            emptyView()
+
+                            imageView {
+                                if (data.canbargain == "1"){
+                                    visibility = View.VISIBLE
+                                }else{
+                                    visibility = View.GONE
+                                }
+                                imageResource = R.mipmap.yrdz_delivery_select_icon
+                            }.lparams(autoSize(45), autoSize(45)){
+                                marginEnd = autoSize(36)
+                            }
                         }.lparams(matchParent, autoSize(132))
 
                         itemView()
@@ -180,7 +199,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = data.wrtypename
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -204,26 +223,19 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
-                        }.lparams(matchParent, autoSize(132))
 
-                        itemView()
+                            emptyView()
 
-                        linearLayout {
-                            background = resources.getDrawable(R.color.white)
-                            gravity = Gravity.CENTER_VERTICAL
-                            textView {
-                                text = "挂牌数量"
-                                textSizeAuto = 34
-                                textColorInt = R.color.rma_zhushi_text_color
-                            }.lparams(autoSize(250), wrapContent){
-                                marginStart = autoSize(36)
+                            imageView {
+                                if (data.canpart == "0"){
+                                    visibility = View.VISIBLE
+                                }else{
+                                    visibility = View.GONE
+                                }
+                                imageResource = R.mipmap.yrdz_delivery_select_icon
+                            }.lparams(autoSize(45), autoSize(45)){
+                                marginEnd = autoSize(36)
                             }
-
-                            textView {
-                                text = data.orderqty
-                                textSizeAuto = 29
-                                textColorInt = R.color.rma_black_33
-                            }.lparams(wrapContent, wrapContent)
                         }.lparams(matchParent, autoSize(132))
 
                         itemView()
@@ -232,7 +244,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
-                                text = "起数量"
+                                text = "起数量"
                                 textSizeAuto = 34
                                 textColorInt = R.color.rma_zhushi_text_color
                             }.lparams(autoSize(250), wrapContent){
@@ -240,7 +252,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = data.delistminqty + data.enumdicname
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -260,7 +272,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = data.marginvalue?.toPercentage()
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -280,7 +292,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = data.validtime?.isShowTimeString("yyyy-MM-dd")
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -289,6 +301,11 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                         itemView()
 
                         linearLayout {
+                            if (data.isspecified == "1"){//
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
@@ -300,7 +317,11 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                if (data.allfriendsflag == "1"){
+                                    text = "不限"
+                                }else{
+                                    text = data.matchusername
+                                }
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -320,7 +341,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = data.amount
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
@@ -340,7 +361,7 @@ class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
                             }
 
                             textView {
-                                text = "--"
+                                text = data.freezemargin
                                 textSizeAuto = 29
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainContentAdapter.java

@@ -133,7 +133,7 @@ public class BargainContentAdapter extends RecyclerView.Adapter<BargainContentAd
                 itemViewHolder.confirm.setVisibility(View.GONE);
             }
         }else {//我对别人的议价单
-            itemViewHolder.midpoints_registration.setVisibility(View.GONE);
+            itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
         }
 
         //我对别人的议价单撤销

+ 171 - 116
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt

@@ -49,6 +49,7 @@ import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
 import org.jetbrains.anko.*
+import org.jetbrains.anko.sdk25.coroutines.textChangedListener
 
 /**
  * 现货仓单-挂单
@@ -112,13 +113,16 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
     //------------贸易圈时多余的内容-----------
     //履约保证金
-    lateinit var performance_bond : EditText
+    lateinit var performance_bond: EditText
+
     //挂牌有效期
     lateinit var validity_of_listing: TextView
+
     //选择的履约模版数据
-    val selectPerformanceStepData : MutableLiveData<PermancePlanTmpData> = MutableLiveData()
+    val selectPerformanceStepData: MutableLiveData<PermancePlanTmpData> = MutableLiveData()
+
     //选择的朋友列表
-    val selectFriendList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
+    val selectFriendList: MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
 
     /**
      * 本页面选择的挂牌方式
@@ -136,7 +140,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
         viewModel.initSelectGoodsInfo()
     }
 
-    var marginValue = 0.0//履约保证金比例
+    var marginValue: MutableLiveData<Double> = MutableLiveData()//履约保证金比例
 
     //浮动价挂牌金额
     val listed_price: MutableLiveData<Double> = MutableLiveData()
@@ -144,28 +148,30 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
     /**
      * 是否可议价的选择
      */
-    lateinit var can_be_negotiation : CheckBox
+    lateinit var can_be_negotiation: CheckBox
 
     /**
      * 是否整单
      */
-    lateinit var whole_list : CheckBox
+    lateinit var whole_list: CheckBox
 
-    val whole_list_data : MutableLiveData<Boolean> = MutableLiveData<Boolean>().apply { value = false }
+    val whole_list_data: MutableLiveData<Boolean> =
+        MutableLiveData<Boolean>().apply { value = false }
 
     /**
      * 朋友是否不限
      */
-    lateinit var no_friend : CheckBox
+    lateinit var no_friend: CheckBox
 
     //初始化设置履约保证金比例
     fun setMarginValue() {
+        viewModel.queryMarketRun()
         if (type == "1") {//现货仓单
-            marginValue =
+            marginValue.value =
                 GlobalDataCollection.instance?.marketTradeConfigData?.sellmarginvalue?.toDouble()
                     ?: 0.0
         } else {
-            marginValue =
+            marginValue.value =
                 GlobalDataCollection.instance?.marketTradeConfigData?.sellmarginvalue2?.toDouble()
                     ?: 0.0
         }
@@ -199,11 +205,13 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
     override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
         super.onActivityResult(requestCode, resultCode, data)
-        if (requestCode == 1004 && resultCode == 1005){
-            val permancePlanTmpData = data?.getParcelableExtra<PermancePlanTmpData>("data") as PermancePlanTmpData
+        if (requestCode == 1004 && resultCode == 1005) {
+            val permancePlanTmpData =
+                data?.getParcelableExtra<PermancePlanTmpData>("data") as PermancePlanTmpData
             selectPerformanceStepData.postValue(permancePlanTmpData)
-        }else if (requestCode == 1000 && resultCode == 1001){
-            val selectFriendDataList = data?.getParcelableExtra<SelectFriendListData>("datalist") as SelectFriendListData
+        } else if (requestCode == 1000 && resultCode == 1001) {
+            val selectFriendDataList =
+                data?.getParcelableExtra<SelectFriendListData>("datalist") as SelectFriendListData
             selectFriendList.postValue(selectFriendDataList.selectFriendList)
         }
     }
@@ -478,7 +486,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 text = "0"
                                 decimal = 2
                                 setOnTextChangeListener { view, value ->
-                                    if (value.toString().isNullOrEmpty().not()){
+                                    if (value.toString().isNullOrEmpty().not()) {
                                         val delistingAmount = value.toDouble().times(
                                             listednumberEdittext.text.toString()
                                                 .toDouble()
@@ -488,9 +496,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                                 delistingAmount,
                                                 2
                                             ) + "(需履约保证金" + NumberUtils.roundNum(
-                                                delistingAmount?.times(
-                                                    marginValue
-                                                ) ?: 0.0, 2
+                                                delistingAmount.times(
+                                                    marginValue.value ?: 0.0
+                                                ), 2
                                             ) + ")"
                                     }
 
@@ -502,7 +510,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
                             linearLayout {
                                 listedType.bindOptional(context) {
-                                    if (it?.id == "3" ) {
+                                    if (it?.id == "3") {
                                         visibility = View.VISIBLE
                                     } else {
                                         visibility = View.GONE
@@ -512,9 +520,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 checkBox {
                                     can_be_negotiation = this
                                     buttonDrawable = null
-                                    background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
+                                    background =
+                                        resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
 
-                                }.lparams(autoSize(41), autoSize(41)){
+                                }.lparams(autoSize(41), autoSize(41)) {
                                     marginStart = autoSize(36)
                                     marginEnd = autoSize(36)
                                 }
@@ -523,7 +532,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     text = "可议价"
                                     textSizeAuto = 34
                                     textColorInt = R.color.rma_zhushi_text_color
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginEnd = autoSize(36)
                                 }
                             }.lparams(wrapContent, autoSize(143))
@@ -596,9 +605,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     gravity = Gravity.CENTER_VERTICAL
                                     numberEditText {
                                         listednumberEdittext = this
-                                        if (type == "1"){
+                                        if (type == "1") {
                                             text = data.minivalue
-                                        }else{
+                                        } else {
                                             text = data1.minivalue
                                         }
 
@@ -614,9 +623,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                                             delistingAmount,
                                                             2
                                                         ) + "(需履约保证金" + NumberUtils.roundNum(
-                                                            delistingAmount?.times(
-                                                                marginValue
-                                                            ) ?: 0.0, 2
+                                                            delistingAmount.times(
+                                                                marginValue.value ?: 0.0
+                                                            ), 2
                                                         ) + ")"
                                                 } else if (listedType.value?.id == "2") {//浮动价 //计算估算总额
                                                     val floatDelistingAmount =
@@ -625,7 +634,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                                         )
                                                     if (floatDelistingAmount != 0.0) {
                                                         //显示估算总额
-                                                        if (marginValue == 0.0) {
+                                                        if (marginValue.value == 0.0) {
                                                             one_delisting_amount.text =
                                                                 NumberUtils.roundNum(
                                                                     floatDelistingAmount ?: 0.0,
@@ -638,7 +647,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                                                     2
                                                                 ) + "(需履约保证金" + NumberUtils.roundNum(
                                                                     floatDelistingAmount?.times(
-                                                                        marginValue
+                                                                        marginValue.value ?: 0.0
                                                                     ) ?: 0.0,
                                                                     2
                                                                 ) + ")"
@@ -661,10 +670,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     }
 
                                     linearLayout {
-                                        listedType.bindOptional(context){
-                                            if (it?.id == "3"){
+                                        listedType.bindOptional(context) {
+                                            if (it?.id == "3") {
                                                 visibility = View.VISIBLE
-                                            }else{
+                                            } else {
                                                 visibility = View.GONE
                                             }
                                         }
@@ -672,11 +681,12 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                         checkBox {
                                             whole_list = this
                                             buttonDrawable = null
-                                            background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
+                                            background =
+                                                resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
                                             setOnCheckedChangeListener { compoundButton, b ->
                                                 whole_list_data.postValue(b)
                                             }
-                                        }.lparams(autoSize(41), autoSize(41)){
+                                        }.lparams(autoSize(41), autoSize(41)) {
                                             marginStart = autoSize(36)
                                             marginEnd = autoSize(36)
                                         }
@@ -685,7 +695,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                             text = "整单"
                                             textSizeAuto = 34
                                             textColorInt = R.color.rma_zhushi_text_color
-                                        }.lparams(wrapContent, wrapContent){
+                                        }.lparams(wrapContent, wrapContent) {
                                             marginEnd = autoSize(36)
                                         }
                                     }.lparams(wrapContent, autoSize(143))
@@ -762,10 +772,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                         itemView()
 
                         linearLayout {
-                            whole_list_data.bindOptional(context){
-                                if (it == true){
+                            whole_list_data.bindOptional(context) {
+                                if (it == true) {
                                     visibility = View.GONE
-                                }else{
+                                } else {
                                     visibility = View.VISIBLE
                                 }
                             }
@@ -821,10 +831,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                         itemView()
 
                         linearLayout {
-                            listedType.bindOptional(context){
-                                if (it?.id == "3"){
+                            listedType.bindOptional(context) {
+                                if (it?.id == "3") {
                                     visibility = View.VISIBLE
-                                }else{
+                                } else {
                                     visibility = View.GONE
                                 }
                             }
@@ -844,6 +854,15 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     gravity = Gravity.CENTER_VERTICAL
                                     editText {
                                         performance_bond = this
+                                        textChangedListener {
+                                            afterTextChanged {
+                                                if (it.toString().isNotEmpty()) {
+                                                    marginValue.postValue(
+                                                        it?.toString()?.toDouble()?.div(100.0)
+                                                    )
+                                                }
+                                            }
+                                        }
                                         hint = "请输入履约保证金"
                                         background = null
                                         inputType = EditorInfo.TYPE_CLASS_NUMBER
@@ -868,10 +887,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                         itemView()
 
                         linearLayout {
-                            listedType.bindOptional(context){
-                                if (it?.id == "3"){
+                            listedType.bindOptional(context) {
+                                if (it?.id == "3") {
                                     visibility = View.VISIBLE
-                                }else{
+                                } else {
                                     visibility = View.GONE
                                 }
                             }
@@ -890,7 +909,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             }
 
                             textView {
-                                text = TimeUtils.getNowTime("yyyy-MM-dd")
+                                viewModel.marketRunData.bindOptional(context) {
+                                    text = it?.tradedate
+                                }
                                 validity_of_listing = this
                                 textSizeAuto = 34
                                 textColorInt = R.color.rma_black_33
@@ -908,10 +929,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                         viewItemUI()
 
                         linearLayout {
-                            listedType.bindOptional(context){
-                                if (it?.id == "3"){
+                            listedType.bindOptional(context) {
+                                if (it?.id == "3") {
                                     visibility = View.VISIBLE
-                                }else{
+                                } else {
                                     visibility = View.GONE
                                 }
                             }
@@ -919,8 +940,11 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             gravity = Gravity.CENTER_VERTICAL
                             onThrottleFirstClick {
                                 val intent = Intent()
-                                intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
-                                startActivityForResult(intent,1004)
+                                intent.setClass(
+                                    context,
+                                    SelectPerformanceTemplateActivity::class.java
+                                )
+                                startActivityForResult(intent, 1004)
                             }
 
                             textView {
@@ -955,21 +979,21 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                         itemView()
 
                         linearLayout {
-                            listedType.bindOptional(context){
-                                if (it?.id == "3"){
+                            listedType.bindOptional(context) {
+                                if (it?.id == "3") {
                                     visibility = View.VISIBLE
-                                }else{
+                                } else {
                                     visibility = View.GONE
                                 }
                             }
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             onThrottleFirstClick {
-                                if (no_friend.isChecked.not()){
+                                if (no_friend.isChecked.not()) {
                                     val intent = Intent()
                                     intent.setClass(context, SelectFriendActivty::class.java)
-                                    startActivityForResult(intent,1000)
-                                }else{
+                                    startActivityForResult(intent, 1000)
+                                } else {
                                     ToastUtils.showLong("勾选不限后不能选择朋友")
                                 }
 
@@ -985,9 +1009,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
                             textView {
                                 selectFriendList.bindOptional(context) {
-                                    if (no_friend.isChecked){
+                                    if (no_friend.isChecked) {
                                         text = "不限"
-                                    }else{
+                                    } else {
                                         text = "已选" + it?.size + "人"
                                         textColorInt = R.color.rma_black_33
                                     }
@@ -1012,13 +1036,14 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 checkBox {
                                     no_friend = this
                                     buttonDrawable = null
-                                    background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
+                                    background =
+                                        resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
                                     setOnCheckedChangeListener { compoundButton, b ->
-                                        if (b){
+                                        if (b) {
                                             selectFriendList.postValue(arrayListOf())
                                         }
                                     }
-                                }.lparams(autoSize(41), autoSize(41)){
+                                }.lparams(autoSize(41), autoSize(41)) {
                                     marginStart = autoSize(36)
                                     marginEnd = autoSize(36)
                                 }
@@ -1027,7 +1052,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     text = "不限"
                                     textSizeAuto = 34
                                     textColorInt = R.color.rma_zhushi_text_color
-                                }.lparams(wrapContent, wrapContent){
+                                }.lparams(wrapContent, wrapContent) {
                                     marginEnd = autoSize(36)
                                 }
                             }.lparams(wrapContent, autoSize(132))
@@ -1121,6 +1146,27 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             }
 
                             textView {
+                                marginValue.bindOptional(context) {
+                                    if (onePriceInputEdittext.text.toString().isNullOrEmpty()
+                                            .not() && listednumberEdittext.text.toString()
+                                            .isNullOrEmpty().not()
+                                    ) {
+                                        val delistingAmount =
+                                            onePriceInputEdittext.text.toString().toDouble().times(
+                                                listednumberEdittext.text.toString()
+                                                    .toDouble()
+                                            )
+                                        one_delisting_amount.text =
+                                            NumberUtils.roundNum(
+                                                delistingAmount,
+                                                2
+                                            ) + "(需履约保证金" + NumberUtils.roundNum(
+                                                delistingAmount.times(
+                                                    it ?: 0.0
+                                                ), 2
+                                            ) + ")"
+                                    }
+                                }
                                 text = "0"
                                 one_delisting_amount = this
                                 textSizeAuto = 34
@@ -1152,7 +1198,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
                         onThrottleFirstClick {
-                            if (check().not()){
+                            if (check().not()) {
                                 return@onThrottleFirstClick
                             }
                             if (type == "1") {//现货仓单挂单
@@ -1188,7 +1234,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     ) {
                                         finish()
                                     }
-                                } else if(listedType.value?.id == "2") {//浮动价
+                                } else if (listedType.value?.id == "2") {//浮动价
                                     viewModel.requeryWRListingOrderReq(
                                         FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
                                         LadingBillId = data.ladingbillid?.toLong() ?: 0,
@@ -1219,36 +1265,37 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     ) {
                                         finish()
                                     }
-                                }else{
+                                } else {
                                     var canBargain = 0
-                                    if (can_be_negotiation.isChecked){
+                                    if (can_be_negotiation.isChecked) {
                                         canBargain = 1
-                                    }else{
+                                    } else {
                                         canBargain = 0
                                     }
                                     var canPart = 1
-                                    var the_pick : Long = 0
-                                    if (whole_list.isChecked){
+                                    var the_pick: Long = 0
+                                    if (whole_list.isChecked) {
                                         canPart = 0
+                                    } else {
                                         the_pick = startInputNumber.text.toString().toLong()
-                                    }else{
-                                        the_pick = 0
                                         canPart = 1
                                     }
                                     var allFriendsFlag = 0
-                                    if (no_friend.isChecked){
+                                    if (no_friend.isChecked) {
                                         allFriendsFlag = 1
-                                    }else{
+                                    } else {
                                         allFriendsFlag = 0
                                     }
 
-                                     viewModel.requeryWRListingOrderReq(
-                                        ValidTime = validity_of_listing.text.toString().removeSuffix("-"),
-                                         MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
-                                         MarginAlgorithm = 1,//指定保证金方式 1:比率 2:固定
-                                         MarginValue = performance_bond.text.toString().toDouble().div(100),//指定保证金设置值
-                                         AllFriendsFlag = allFriendsFlag,
-                                         MatchAccIDsString = getSelectFriendList(),
+                                    viewModel.requeryWRListingOrderReq(
+                                        ValidTime = validity_of_listing.text.toString()
+                                            .removeSuffix("-"),
+                                        MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
+                                        MarginAlgorithm = 1,//指定保证金方式 1:比率 2:固定
+                                        MarginValue = performance_bond.text.toString().toDouble()
+                                            .div(100),//指定保证金设置值
+                                        AllFriendsFlag = allFriendsFlag,
+                                        MatchAccIDsString = getSelectFriendList(),
                                         FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
                                         LadingBillId = data.ladingbillid?.toLong() ?: 0,
                                         TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
@@ -1261,12 +1308,13 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                         OrderQty = listednumberEdittext.text.toString().toLong(),
                                         DeliveryGoodsID = data.deliverygoodsid?.toInt() ?: 0,
                                         WRPriceType = 1,
-                                         FixedPrice = onePriceInputEdittext.text.toString()
-                                             .toDouble(),
+                                        FixedPrice = onePriceInputEdittext.text.toString()
+                                            .toDouble(),
                                         WRTradeGoods = getWRTradeGoods(),
-                                        TimevalidType = 4,
+                                        TimevalidType = 3,
                                         FirstRatio = 0.0,
-                                        PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
+                                        PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong()
+                                            ?: 0,
                                         BuyOrSell = 1,
                                         PriceDisplayMode = 1,
                                         CanBargain = canBargain,
@@ -1345,33 +1393,34 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     ) {
                                         finish()
                                     }
-                                }else{
-                                     var canBargain = 0
-                                    if (can_be_negotiation.isChecked){
+                                } else {
+                                    var canBargain = 0
+                                    if (can_be_negotiation.isChecked) {
                                         canBargain = 1
-                                    }else{
+                                    } else {
                                         canBargain = 0
                                     }
                                     var canPart = 1
-                                    var the_pick : Long = 0
-                                    if (whole_list.isChecked){
+                                    var the_pick: Long = 0
+                                    if (whole_list.isChecked) {
                                         canPart = 0
+                                    } else {
                                         the_pick = startInputNumber.text.toString().toLong()
-                                    }else{
-                                        the_pick = 0
                                         canPart = 1
                                     }
                                     var allFriendsFlag = 0
-                                    if (no_friend.isChecked){
+                                    if (no_friend.isChecked) {
                                         allFriendsFlag = 1
-                                    }else{
+                                    } else {
                                         allFriendsFlag = 0
                                     }
                                     viewModel.requeryWRListingOrderReq(
-                                        ValidTime = validity_of_listing.text.toString().removeSuffix("-"),
+                                        ValidTime = validity_of_listing.text.toString()
+                                            .removeSuffix("-"),
                                         MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
                                         MarginAlgorithm = 1,//指定保证金方式 1:比率 2:固定
-                                        MarginValue = performance_bond.text.toString().toDouble().div(100),//指定保证金设置值
+                                        MarginValue = performance_bond.text.toString().toDouble()
+                                            .div(100),//指定保证金设置值
                                         AllFriendsFlag = allFriendsFlag,
                                         MatchAccIDsString = getSelectFriendList(),
                                         FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
@@ -1389,9 +1438,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                         WRTradeGoods = getWRTradeGoods(),
                                         FixedPrice = onePriceInputEdittext.text.toString()
                                             .toDouble(),
-                                        TimevalidType = 4,
+                                        TimevalidType = 3,
                                         FirstRatio = 0.0,
-                                        PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong() ?: 0,
+                                        PerformanceTemplateID = selectPerformanceStepData.value?.autoid?.toLong()
+                                            ?: 0,
                                         DeliveryMonth = month_text.text.toString(),
                                         BuyOrSell = 1,
                                         PriceDisplayMode = 1,
@@ -1426,7 +1476,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
         }
     }
 
-    fun getSelectFriendList() : List<String>{
+    fun getSelectFriendList(): List<String> {
         val returnList = arrayListOf<String>()
         selectFriendList.value?.forEach {
             returnList.add(it.frienduserid?.toString() ?: "")
@@ -1469,12 +1519,12 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                 ToastUtils.showLong("请输入起摘数量")
                 return false
             }
-            if (type == "2"){
+            if (type == "2") {
                 if (startInputNumber.text.toString().toLong() < data1.minivalue?.toLong() ?: 0) {
                     ToastUtils.showLong("起摘数量不能小于" + data1.minivalue)
                     return false
                 }
-            }else{
+            } else {
                 if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
                     ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
                     return false
@@ -1511,12 +1561,12 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                 ToastUtils.showLong("请输入起摘数量")
                 return false
             }
-            if (type == "2"){
+            if (type == "2") {
                 if (startInputNumber.text.toString().toLong() < data1.minivalue?.toLong() ?: 0) {
                     ToastUtils.showLong("起摘数量不能小于" + data1.minivalue)
                     return false
                 }
-            }else{
+            } else {
                 if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
                     ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
                     return false
@@ -1529,7 +1579,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                     return false
                 }
             }
-        }else{
+        } else {
             if (onePriceInputEdittext.text.toString().isNullOrEmpty()) {
                 ToastUtils.showLong("请输入挂牌价格")
                 return false
@@ -1546,17 +1596,22 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                 ToastUtils.showLong("挂牌数量不能为0")
                 return false
             }
-            if (startInputNumber.text.toString().isNullOrEmpty()) {
-                ToastUtils.showLong("请输入起摘数量")
-                return false
-            }
-            if (whole_list.isChecked.not()){
-                if (type == "2"){
-                    if (startInputNumber.text.toString().toLong() < data1.minivalue?.toLong() ?: 0) {
+
+            if (whole_list.isChecked.not()) {
+
+                if (startInputNumber.text.toString().isNullOrEmpty()) {
+                    ToastUtils.showLong("请输入起摘数量")
+                    return false
+                }
+
+                if (type == "2") {
+                    if (startInputNumber.text.toString()
+                            .toLong() < data1.minivalue?.toLong() ?: 0
+                    ) {
                         ToastUtils.showLong("起摘数量不能小于" + data1.minivalue)
                         return false
                     }
-                }else{
+                } else {
                     if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
                         ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
                         return false
@@ -1564,7 +1619,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                 }
             }
 
-            if (performance_bond.text.toString().isNullOrEmpty()){
+            if (performance_bond.text.toString().isNullOrEmpty()) {
                 ToastUtils.showLong("请输入履约保证金比例")
                 return false
             }
@@ -1573,13 +1628,13 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                 return false
             }
 
-            if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
+            if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()) {
                 ToastUtils.showLong("请选择履约模版")
                 return false
             }
 
-            if (no_friend.isChecked.not()){
-                if (selectFriendList.value.isNullOrEmpty()){
+            if (no_friend.isChecked.not()) {
+                if (selectFriendList.value.isNullOrEmpty()) {
                     ToastUtils.showLong("请选择朋友")
                     return false
                 }

+ 19 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedViewModel.kt

@@ -4,6 +4,7 @@ import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.AccountData
 import cn.muchinfo.rma.global.data.GoodsGroupData
+import cn.muchinfo.rma.global.data.MarketRunData
 import cn.muchinfo.rma.global.data.QuoteDayData
 import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsGroups
 import cn.muchinfo.rma.global.database.DataBase
@@ -42,6 +43,24 @@ class ListedViewModel : BaseViewModel(){
      */
     val usedAccountData : MutableLiveData<AccountData> = MutableLiveData()
 
+
+    //当前交易日信息
+    val marketRunData : MutableLiveData<MarketRunData> = MutableLiveData()
+
+
+    fun queryMarketRun(){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketID",GlobalDataCollection.instance?.getMaketidByTrademode(16).toString())
+        }
+        MyApplication.getInstance()?.customerManage?.queryMarketRun(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData?.size ?: 0 > 0){
+                    marketRunData.postValue(respData?.get(0))
+                }
+            }
+        }
+    }
+
     //重新赋值资金账户
     fun resetAccountData(){
         val accountDataList = GlobalDataCollection.instance?.accountDataList

+ 15 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt

@@ -31,6 +31,7 @@ import cn.muchinfo.rma.view.base.BaseFragment
 import cn.muchinfo.rma.view.base.WebActivity
 import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity
+import cn.muchinfo.rma.view.base.hnstmain.performancetemplate.PerformanceTemplateActivity
 import cn.muchinfo.rma.view.base.home.accountmanager.AccountManagerActivity
 import cn.muchinfo.rma.view.base.home.business.BusinessManagementActivity
 import cn.muchinfo.rma.view.base.home.commodity.CommodityInformationActivity
@@ -255,18 +256,26 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
                         }
                         textView {
                             viewModel.rootUserAccountData.bindOptional(context) {
-                                if (it == null){
-                                    text = "--"
+                                if (SPUtils.getInstance().getString(Constant.oem) == "yrdz"){
+                                    text = "云融"
                                 }else{
-                                    if (it.accountname.isNullOrEmpty()){
+                                    if (it == null){
                                         text = "--"
                                     }else{
-                                        text = it.accountname.isBlankString()
+                                        if (it.accountname.isNullOrEmpty()){
+                                            text = "--"
+                                        }else{
+                                            text = it.accountname.isBlankString()
+                                        }
                                     }
                                 }
                             }
                             text = "--"
-                            text = GlobalDataCollection.instance?.loginQueryData?.userInfo?.customername
+                            if (SPUtils.getInstance().getString(Constant.oem) == "yrdz"){
+                                text = "云融"
+                            }else{
+                                text = GlobalDataCollection.instance?.loginQueryData?.userInfo?.customername
+                            }
                             textColorInt = R.color.white
                             textSizeAuto = 36
                         }.lparams(wrapContent, wrapContent) {
@@ -768,7 +777,7 @@ fun jumpActivity(context : Context,code : String){
     }else if (code == "client_mobile_hnsthycx"){//华南顺通-合约查询
 
     }else if (code == "client_mobile_hnstlygl"){//华南顺通-履约管理
-
+        intent.setClass(context, PerformanceTemplateActivity::class.java)
     }else if (code == "client_mobile_hnstcztx"){//华南顺通-充值提现
 
     }else if (code == "client_mobile_hnstckhq"){//华南顺通-参考行情

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

@@ -1,14 +1,11 @@
 package cn.muchinfo.rma.view.base.warehousereceipt
 
 import androidx.lifecycle.MutableLiveData
-import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.*
 import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsGroups
 import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
 import cn.muchinfo.rma.global.database.DataBase
-import cn.muchinfo.rma.global.isBlankString
-import cn.muchinfo.rma.global.toPercentage
-import cn.muchinfo.rma.global.validtype
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.protobuf.protoclasses.WarehouseTradeMI1
 import cn.muchinfo.rma.view.MyApplication
@@ -206,7 +203,7 @@ class WarehouseReceiptViewModel : BaseViewModel(){
             //整单
             newRightData.add(if (it.canpart == "0"){"是"}else{"否"})
             //挂牌有效期
-            newRightData.add(it.validtime ?: "-")
+            newRightData.add(it.validtime?.toShowTime3() ?: "-")
             //履约保证金
             newRightData.add(it.marginvalue?.toPercentage() ?: "-")
             //履约方式

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/circle/TradeCircleContentAdapter.java

@@ -139,6 +139,7 @@ public class TradeCircleContentAdapter extends RecyclerView.Adapter<TradeCircleC
             Intent intent = new Intent();
             intent.putExtra("data",data1);
             intent.putExtra("type","3");
+            intent.putExtra("tmplateid",data.getPerformancetemplateid());
             intent.putExtra("isCircle","1");
             intent.putExtra("goodsId","1");
             intent.setClass(context, BusinessHallDetailsActivity.class);

+ 59 - 19
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleDelistedActivity.kt

@@ -617,6 +617,7 @@ class TradeCircleDelistedActivity : BaseActivity<TradeCircleDelistedViewModel>()
                         }.lparams(wrapContent, wrapContent) {
                             topMargin = autoSize(20)
                             marginStart = autoSize(250)
+                            bottomMargin = autoSize(250)
                         }
 
                     }
@@ -658,29 +659,68 @@ class TradeCircleDelistedActivity : BaseActivity<TradeCircleDelistedViewModel>()
                             }
 
                             if (data.canbargain == "1") {//可议价
-                                if (data.buyorsell == "0") {
-                                    viewModel.WrBargainApplyReq(
-                                        WRTradeOrderID = data.wrtradeorderid?.toLong() ?: 0,
-                                        UserID = GlobalDataCollection.instance?.loginRsp?.userID.toString(),
-                                        AccountID = GlobalDataCollection.instance?.accountId.toString(),
-                                        BuyOrSell = "1",
-                                        ApplyQty = priceAndNumberData.value?.number?.toLong() ?: 0,
-                                        ApplyPrice = priceAndNumberData.value?.price.toString()
-                                    ) {
-                                        finish()
+                                if (modelType == "1") {//现货仓单
+                                    if (data.buyorsell == "0") {
+                                        viewModel.WrBargainApplyReq(
+                                            WRTradeOrderID = data.wrtradeorderid?.toLong() ?: 0,
+                                            UserID = GlobalDataCollection.instance?.loginRsp?.userID.toString(),
+                                            AccountID = GlobalDataCollection.instance?.accountId.toString(),
+                                            BuyOrSell = "1",
+                                            ApplyQty = priceAndNumberData.value?.number?.toLong()
+                                                ?: 0,
+                                            ApplyPrice = priceAndNumberData.value?.price.toString(),
+                                            LadingBillid = selectSpotDetailsData.value?.ladingbillid?.toLong()
+                                                ?: 0,
+                                            SubNum = selectSpotDetailsData.value?.subnum?.toLong()
+                                                ?: 0
+                                        ) {
+                                            finish()
+                                        }
+                                    } else {
+                                        viewModel.WrBargainApplyReq(
+                                            WRTradeOrderID = data.wrtradeorderid?.toLong() ?: 0,
+                                            UserID = GlobalDataCollection.instance?.loginRsp?.userID.toString(),
+                                            AccountID = GlobalDataCollection.instance?.accountId.toString(),
+                                            BuyOrSell = "0",
+                                            ApplyQty = priceAndNumberData.value?.number?.toLong()
+                                                ?: 0,
+                                            ApplyPrice = priceAndNumberData.value?.price.toString(),
+                                            LadingBillid = selectSpotDetailsData.value?.ladingbillid?.toLong()
+                                                ?: 0,
+                                            SubNum = selectSpotDetailsData.value?.subnum?.toLong()
+                                                ?: 0
+                                        ) {
+                                            finish()
+                                        }
                                     }
                                 } else {
-                                    viewModel.WrBargainApplyReq(
-                                        WRTradeOrderID = data.wrtradeorderid?.toLong() ?: 0,
-                                        UserID = GlobalDataCollection.instance?.loginRsp?.userID.toString(),
-                                        AccountID = GlobalDataCollection.instance?.accountId.toString(),
-                                        BuyOrSell = "0",
-                                        ApplyQty = priceAndNumberData.value?.number?.toLong() ?: 0,
-                                        ApplyPrice = priceAndNumberData.value?.price.toString()
-                                    ) {
-                                        finish()
+                                    if (data.buyorsell == "0") {
+                                        viewModel.WrBargainApplyReq(
+                                            WRTradeOrderID = data.wrtradeorderid?.toLong() ?: 0,
+                                            UserID = GlobalDataCollection.instance?.loginRsp?.userID.toString(),
+                                            AccountID = GlobalDataCollection.instance?.accountId.toString(),
+                                            BuyOrSell = "1",
+                                            ApplyQty = priceAndNumberData.value?.number?.toLong()
+                                                ?: 0,
+                                            ApplyPrice = priceAndNumberData.value?.price.toString()
+                                        ) {
+                                            finish()
+                                        }
+                                    } else {
+                                        viewModel.WrBargainApplyReq(
+                                            WRTradeOrderID = data.wrtradeorderid?.toLong() ?: 0,
+                                            UserID = GlobalDataCollection.instance?.loginRsp?.userID.toString(),
+                                            AccountID = GlobalDataCollection.instance?.accountId.toString(),
+                                            BuyOrSell = "0",
+                                            ApplyQty = priceAndNumberData.value?.number?.toLong()
+                                                ?: 0,
+                                            ApplyPrice = priceAndNumberData.value?.price.toString()
+                                        ) {
+                                            finish()
+                                        }
                                     }
                                 }
+
                             } else {//不可议价
                                 var number: Long = 0
                                 if (data.canpart == "0") {//是否允许部份摘牌 - 0:不允许 1:允许

+ 5 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleDelistedViewModel.kt

@@ -51,6 +51,8 @@ class TradeCircleDelistedViewModel : BaseViewModel(){
         BuyOrSell : String = "",//摘牌方向
         ApplyQty : Long = 0,//摘牌数量
         ApplyPrice : String = "",//申请价格
+        LadingBillid : Long = 0,//摘牌方提单ID [卖]
+        SubNum : Long = 0,//摘牌方提单子单号 [卖]
         isSuccess: (isCompleted: Boolean) -> Unit
     ){
         loadingDialogStatus.value = TaskUiModel.inFlight()
@@ -61,7 +63,9 @@ class TradeCircleDelistedViewModel : BaseViewModel(){
                 AccountID = AccountID,
                 ApplyQty = ApplyQty,
                 ApplyPrice = ApplyPrice,
-                BuyOrSell = BuyOrSell
+                BuyOrSell = BuyOrSell,
+                LadingBillid = LadingBillid,
+                SubNum = SubNum
             ) { isCompleted, err ->
                 if (isCompleted) {
                     loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))

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

@@ -122,6 +122,7 @@ class TradeCircleListedBuyUI(
 
     //初始化设置履约保证金比例
     fun setMarginValue() {
+        viewModel.queryMarketRun()
         selectAccountData.postValue(GlobalDataCollection.instance?.accountData)
     }
 
@@ -501,7 +502,9 @@ class TradeCircleListedBuyUI(
                 }
 
                 textView {
-                    text = TimeUtils.getNowTime("yyyy-MM-dd")
+                    viewModel.marketRunData.bindOptional(context){
+                        text = it?.tradedate
+                    }
                     validity_of_listing = this
                     textSizeAuto = 34
                     textColorInt = R.color.rma_black_33
@@ -662,7 +665,7 @@ class TradeCircleListedBuyUI(
             textView {
                 viewModel.usedAccountData.bindOptional(context) {
                     text =
-                        "可用资金" + NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
+                        "可用资金" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.canUserAmount.toString()), 2)
                 }
                 textSizeAuto = 29
                 textColorInt = R.color.rma_black_33

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

@@ -131,6 +131,7 @@ class TradeCircleListedSellUI(
             }
 
         }
+        viewModel.queryMarketRun()
         if (hasType == "1"){
             viewModel.querydetailsWarehouseWrPosition(wrfactortypeid = data.wrfactortypeid ?: "")
         }else{
@@ -568,7 +569,9 @@ class TradeCircleListedSellUI(
                 }
 
                 textView {
-                    text = TimeUtils.getNowTime("yyyy-MM-dd")
+                    viewModel.marketRunData.bindOptional(context){
+                        text = it?.tradedate
+                    }
                     validity_of_listing = this
                     textSizeAuto = 34
                     textColorInt = R.color.rma_black_33
@@ -729,7 +732,7 @@ class TradeCircleListedSellUI(
             textView {
                 viewModel.usedAccountData.bindOptional(context) {
                     text =
-                        "可用资金" + NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
+                        "可用资金" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.canUserAmount.toString()), 2)
                 }
                 textSizeAuto = 29
                 textColorInt = R.color.rma_black_33

+ 17 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleListedingViewModel.kt

@@ -35,6 +35,8 @@ class TradeCircleListedingViewModel : BaseViewModel(){
     val usedAccountData : MutableLiveData<AccountData> = MutableLiveData()
 
 
+
+
     /**
      * 库存明细
      */
@@ -45,7 +47,22 @@ class TradeCircleListedingViewModel : BaseViewModel(){
      */
     val summaryWrPositionDataByDialog : MutableLiveData<HnstWrPositionData> = MutableLiveData()
 
+    //当前交易日信息
+    val marketRunData : MutableLiveData<MarketRunData> = MutableLiveData()
+
 
+    fun queryMarketRun(){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketID",GlobalDataCollection.instance?.getMaketidByTrademode(16).toString())
+        }
+        MyApplication.getInstance()?.customerManage?.queryMarketRun(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData?.size ?: 0 > 0){
+                    marketRunData.postValue(respData?.get(0))
+                }
+            }
+        }
+    }
 
     /**
      * 查询相应要素下的预售仓单

+ 3 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/chart/YrdzChartActivity.kt

@@ -137,6 +137,9 @@ class YrdzChartActivity : BaseActivity<YrdzChartViewModel>() , View.OnClickListe
 
     }
 
+
+
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         EventBus.getDefault().register(this)

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/chart/YrdzChartViewModel.kt

@@ -163,7 +163,7 @@ class YrdzChartViewModel : BaseViewModel() {
     fun queryHistoryTikDatas(goodsCode: String){
         val params = mutableMapOf<String,String>().apply {
             put("goodsCode",goodsCode)
-
+            put("count","30")
         }
         MyApplication.getInstance()?.chartManager?.queryHistoryTikDatas(params = params){isSuccess, respData, error ->
             if (isSuccess){

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/dealdetails/YrdzDealDetailsViewModel.kt

@@ -21,6 +21,7 @@ class YrdzDealDetailsViewModel : BaseViewModel(){
     fun queryHistoryTikDatas(goodsCode: String){
         val params = mutableMapOf<String,String>().apply {
             put("goodsCode",goodsCode)
+            put("count","30")
 
         }
         MyApplication.getInstance()?.chartManager?.queryHistoryTikDatas(params = params){ isSuccess, respData, error ->

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů