Sfoglia il codice sorgente

风险管理10月11日提交代码-liu.bolan-天津麦顿

Liu.bolan 4 anni fa
parent
commit
822a26ff7e
34 ha cambiato i file con 495 aggiunte e 136 eliminazioni
  1. 2 0
      RMA/app/src/main/AndroidManifest.xml
  2. 25 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/exposure/ExposureManager.kt
  3. 29 5
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountData.kt
  4. 83 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ExposureGoodsData.kt
  5. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  6. 4 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureContentAdapter.java
  7. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureFragment.kt
  8. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureNumberViewHolder.kt
  9. 39 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureViewModel.kt
  10. 10 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/entrusts/EntrustChildViewModel.kt
  11. 2 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/HnstMainFragment.kt
  12. 1 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/account/RydzAccountActivity.kt
  13. 52 26
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersActivity.kt
  14. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersViewModel.kt
  15. 61 39
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java
  16. 20 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryViewModel.kt
  17. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/unwind/AgreementUnwindViewHolder.kt
  18. 4 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/unwind/ContractUnWindActivity.kt
  19. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/unwind/ContractUnwindViewHolder.kt
  20. 1 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceTempateActivity.kt
  21. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceViewHolder.kt
  22. 40 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reference/ReferenceAdapter.java
  23. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tjmd/TjmdHomeMarketViewHolder.kt
  24. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ProcurementViewModel.kt
  25. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/SpotFragment.kt
  26. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleListedSellUI.kt
  27. 6 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/tradecircle/TradeCircleListedingViewModel.kt
  28. 36 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/adapter/TransferAdapter.java
  29. 5 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/chart/YrdzChartActivity.kt
  30. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/TransferSwapsAdapter.java
  31. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingActivity.kt
  32. 1 1
      RMA/app/src/main/res/drawable/qhj_main_withdraw_blue_bg.xml
  33. 7 0
      RMA/app/src/main/res/drawable/qhj_main_withdraw_blue_foure.xml
  34. 2 2
      RMA/app/src/main/res/values/strings.xml

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

@@ -473,6 +473,8 @@
         <activity android:name=".view.base.home.spotaudit.SpotAuditActivity"/>
 
         <activity android:name=".view.base.home.commodity.newspot.NewAddSpotGoodsActivity"/>
+
+        <activity android:name=".view.base.hnstmain.contractorders.unwind.ContractUnWindActivity"/>
     </application>
 
 </manifest>

+ 25 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/exposure/ExposureManager.kt

@@ -19,6 +19,31 @@ class ExposureManager {
      * @param params Map<String, String>  参数 AreaUserId
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
      */
+    fun queryExposureGoods(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ExposureGoodsData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryExposureGoods",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ExposureGoodsData>>>(){
+                override fun onResponse(response: BaseResult<List<ExposureGoodsData>>?, id: Int) {
+                    responseBack(true,response?.data,null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+    /**
+     * 查询实时敞口
+     * @param params Map<String, String>  参数 AreaUserId
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
     fun queryRealtimeExposure(
         params: Map<String, String>,
         responseBack: (isSuccess: Boolean, respData: List<RealExposureData>?, error: Error?) -> Unit

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

@@ -1,6 +1,7 @@
 package cn.muchinfo.rma.global.data
 
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
 import cn.muchinfo.rma.global.database.DataBase
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import com.google.gson.annotations.SerializedName
@@ -183,11 +184,34 @@ open class AccountData(
     fun setNormalData() {
 
         /** 计算总市值 ***/
+        //甚是无语,合约订单分为两个市场16和46,而46的市场还要自己去组合关联商品信息进去然后去订阅
         val contractTradePositionDataArrayList =
             GlobalDataCollection.instance?.contractTradePositionDataArrayList
-        contractTradePositionDataArrayList?.forEach {
-            val goodsInfoData = DataBase.getInstance().goodsInfoDao()
-                .getGoodsInfo(it?.goodsid?.toInt() ?: 0)
+
+        val newList = arrayListOf<ContractTradePositionData>()
+        val quoteGoodsListDataArrayList = GlobalDataCollection.instance?.quoteGoodsListDataArrayList
+        contractTradePositionDataArrayList?.forEach {data ->
+            val quoteGoodsListData = quoteGoodsListDataArrayList?.find { data.goodsid.toString() == it.goodsid }
+            if (quoteGoodsListData?.refgoodscode.isNullOrEmpty().not()){
+                newList.add(data.copy(refgoodsId = quoteGoodsListData?.refgoodsid?.toInt() ?: 0,refgoodsCode = quoteGoodsListData?.refgoodscode))
+            }else{
+                newList.add(data)
+            }
+        }
+
+        newList.forEach {
+            var goodsInfoData : GoodsInfo
+            if (it.trademode == "16"){
+                goodsInfoData = DataBase.getInstance().goodsInfoDao()
+                    .getGoodsInfo(it.goodsid?.toInt() ?: 0)
+            }else{
+                goodsInfoData = DataBase.getInstance().goodsInfoDao()
+                    .getGoodsInfo(it.refgoodsId)
+            }
+            //瞎几把搞,46市场的价格取参考,其他信息取本身的
+            val goodsInfo2 = DataBase.getInstance().goodsInfoDao()
+                .getGoodsInfo(it.goodsid?.toInt() ?: 0)
+
             val quoteDayData =
                 GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find { data ->
                     data.outgoodscode == goodsInfoData.goodscode
@@ -205,12 +229,12 @@ open class AccountData(
                 } else {
                     if (it.buyorsell == "1") { //卖方向
                         Profit = NumberUtils.roundNum(
-                            (quoteDayData.getPrice().minus(it?.averageprice?.toDouble() ?: 0.0)).times(it?.curpositionqty?.toDouble() ?: 0.0).times(goodsInfoData.agreeunit).times(-1).toString(),
+                            (quoteDayData.getPrice().minus(it.averageprice?.toDouble() ?: 0.0)).times(it.curpositionqty?.toDouble() ?: 0.0).times(goodsInfo2.agreeunit).times(-1).toString(),
                             2
                         ).toDouble()
                     } else {
                         Profit = NumberUtils.roundNum(
-                            (quoteDayData.getPrice().minus(it?.averageprice?.toDouble() ?: 0.0)).times(it?.curpositionqty?.toDouble() ?: 0.0).times(goodsInfoData.agreeunit).toString(),
+                            (quoteDayData.getPrice().minus(it.averageprice?.toDouble() ?: 0.0)).times(it.curpositionqty?.toDouble() ?: 0.0).times(goodsInfo2.agreeunit).toString(),
                             2
                         ).toDouble()
                     }

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

@@ -0,0 +1,83 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+//敞口主力合约
+data class ExposureGoodsData(
+    @SerializedName("agreeunit")
+    val agreeunit : String? = "",//合约乘数
+    @SerializedName("convertratio")
+    val convertratio : String? = "",//折算系数
+    @SerializedName("enumdicname")
+    val enumdicname : String? = "",//单位名称(交易商品)
+    @SerializedName("goodscode")
+    val goodscode:  String? = "",//交易商品代码
+    @SerializedName("goodsgroupid")
+    val goodsgroupid : String? = "",//交易品种id
+    @SerializedName("goodsid")
+    val goodsid : String? = "",//商品Id
+    @SerializedName("goodsname")
+    val goodsname : String? = "",//交易商品名称
+    @SerializedName("goodunitid")
+    val goodunitid : String? = "",//交易商品单位id
+    @SerializedName("middlegoodsid")
+    val middlegoodsid : String? = "",//套保商品id
+    @SerializedName("middlegoodsname")
+    val middlegoodsname : String? = "",//套保商品名称
+    @SerializedName("middlegoodsswcode")
+    val middlegoodsswcode : String? = "",//套保商品代码
+    @SerializedName("needarbitrageratio")
+    val needarbitrageratio : String? = "",//应套利比例
+    @SerializedName("needhedgeratio")
+    val needhedgeratio : String? = ""//应套保比例
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(agreeunit)
+        parcel.writeString(convertratio)
+        parcel.writeString(enumdicname)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsgroupid)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(goodunitid)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(middlegoodsname)
+        parcel.writeString(middlegoodsswcode)
+        parcel.writeString(needarbitrageratio)
+        parcel.writeString(needhedgeratio)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ExposureGoodsData> {
+        override fun createFromParcel(parcel: Parcel): ExposureGoodsData {
+            return ExposureGoodsData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ExposureGoodsData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -14,7 +14,7 @@ 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.104:8080/cfg?key=test_104"//李倩云融 18611112222
 //
 //    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
 
@@ -29,7 +29,7 @@ object Constant {
 //    const val baseurl = "http://192.168.31.181:8080/cfg?key=test_181"//黄老板 华南顺通 调试 110010000001/123123  120010000001/123123
 //    const val baseurl = "http://192.168.31.136:8080/cfg?key=test_136"//黄老板 华南顺通
 
-//    const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176"//黄老板 天津麦顿调试
+    const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176"//黄老板 天津麦顿调试
 //    const val baseurl = "http://192.168.31.167:8080/cfg?key=test_167"//黄老板 平安云平台(企业风管)
 
     /**

+ 4 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureContentAdapter.java

@@ -37,6 +37,7 @@ public class ExposureContentAdapter extends RecyclerView.Adapter<ExposureContent
     private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
     public int offestX = 0;
     private OnContentScrollListener onContentScrollListener;
+    private ExposureViewModel viewModel;
 
     public interface OnContentScrollListener {
         void onScroll(MotionEvent event);
@@ -47,8 +48,9 @@ public class ExposureContentAdapter extends RecyclerView.Adapter<ExposureContent
     }
 
 
-    public ExposureContentAdapter(Context context) {
+    public ExposureContentAdapter(Context context,ExposureViewModel viewModel) {
         this.context = context;
+        this.viewModel = viewModel;
     }
 
     public void setDatas(List<RealExposureData> datas) {
@@ -138,11 +140,7 @@ public class ExposureContentAdapter extends RecyclerView.Adapter<ExposureContent
         }
         //下单
         itemViewHolder.place_the_order.setOnClickListener(view -> {
-            Intent intent = new Intent();
-            intent.putExtra("goodsId", "");
-            intent.putExtra("outGoodsCode", "");
-            intent.setClass(context, GoodsTradeActivity.class);
-            ActivityUtils.startActivity(intent);
+            viewModel.queryExposureGoods(datas.get(i).getMiddleGoodsID());
         });
 
         itemViewHolder.exposure_horItemScrollview.setEventListener(event -> {

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

@@ -14,6 +14,7 @@ import cn.muchinfo.rma.global.data.ExposureHistoryData
 import cn.muchinfo.rma.global.data.FinancialManageData
 import cn.muchinfo.rma.global.data.NumberSpotData
 import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.lifecycle.getAppCompatActivity
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseFragment
 import cn.muchinfo.rma.view.base.app.Constant
@@ -26,6 +27,8 @@ import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.UI
 import org.jetbrains.anko.support.v4.viewPager
@@ -119,6 +122,7 @@ class ExposureFragment : BaseFragment<ExposureViewModel>() {
     ): View? {
         initMenuData()
         return UI {
+            createLoadingDialog(hintStr = "跳转中...").bindTaskStatus(getAppCompatActivity(), viewModel.loadingDialogStatus)
             verticalLayout {
                 linearLayout {
                     background = resources.getDrawable(R.color.main_title_bg_color)
@@ -218,7 +222,7 @@ class RealTimeExposureUI(
     }
 
     val exposureContentAdapter by lazy {
-        ExposureContentAdapter(baseFragment.context)
+        ExposureContentAdapter(baseFragment.context,viewModule)
     }
 
     fun reFresh(){

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

@@ -46,7 +46,7 @@ class ExposureNumberViewHolder(
                  textView {
                      data.bindOptional(context){
                          text = if (type == "1"){
-                             it?.deliverygoodsname?.isBlankString()
+                             it?.wrstandardname?.isBlankString()
                          }else{
                              if (it?.goodsname?.length ?: 0 > 6){
                                  textSizeAuto = 21
@@ -63,7 +63,7 @@ class ExposureNumberViewHolder(
                  textView {
                      data.bindOptional(context){
                          text = if (type == "1"){
-                             it?.deliverygoodscode?.isBlankString()
+                             it?.wrstandardcode?.isBlankString()
                          }else{
                              it?.goodscode?.isBlankString()
                          }

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

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.exposure
 
+import android.content.Intent
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.*
@@ -8,10 +9,18 @@ import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseViewModel
+import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity
+import com.blankj.utilcode.util.ActivityUtils
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 class ExposureViewModel : BaseViewModel(){
 
     /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
      * 实时敞口头部数据
      */
     val realTimeExposureTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
@@ -119,10 +128,10 @@ class ExposureViewModel : BaseViewModel(){
         val newList = arrayListOf<ExposureRealTimeDetailsData>()
         respData.forEach {
             val newRightData = arrayListOf<String>()
-            newRightData.add(it.deliverygoodsname + "\n" + NumberUtils.doubleDistortion(it.qty) + it.enumdicname)
+            newRightData.add(it.wrstandardname + "\n" + NumberUtils.doubleDistortion(it.qty) + it.enumdicname)
             newRightData.add(NumberUtils.roundNum(it.changeQty,2) + it.mgunitidname)
             newRightData.add(NumberUtils.roundNum(it.relateNo ?: "",2))
-            newRightData.add(NumberUtils.roundNum(it.convertfactor,2) + "\n" + it.convertratio)
+            newRightData.add(NumberUtils.roundNum(it.convertfactor,2) /*+ "\n" + it.convertratio*/)
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }
@@ -148,6 +157,34 @@ class ExposureViewModel : BaseViewModel(){
         return newList
     }
 
+    //查询敞口主力合约
+    fun queryExposureGoods(middlegoodsid : String){
+//        loadingDialogStatus.value = TaskUiModel.inFlight()
+        val params = mutableMapOf<String,String>().apply {
+            put("middlegoodsid",middlegoodsid)
+        }
+        MyApplication.getInstance()?.exposureManager?.queryExposureGoods(params = params) { isSuccess, respData, error ->
+            val intent = Intent()
+            if (isSuccess) {
+//                loadingDialogStatus.value = TaskUiModel.success()
+                 if (respData?.size ?: 0 > 0){
+                     val data =  respData?.get(0)
+                     intent.putExtra("goodsId", data?.goodsid)
+                     intent.putExtra("outGoodsCode", data?.goodscode)
+                 }else{
+                     intent.putExtra("goodsId", "")
+                     intent.putExtra("outGoodsCode", "")
+                 }
+            }else{
+//                loadingDialogStatus.value = TaskUiModel.success()
+                intent.putExtra("goodsId", "")
+                intent.putExtra("outGoodsCode", "")
+            }
+            intent.setClass(context!!, GoodsTradeActivity::class.java)
+            ActivityUtils.startActivity(intent)
+        }
+    }
+
 
 
     /**

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

@@ -110,17 +110,19 @@ class EntrustChildViewModel : BaseViewModel() {
             val itemData = list?.get(position)
             entrust.idGoodsName?.text = itemData?.goodsname
             entrust.idStatus?.text = ViewEnumUtils.getchannelinnerorderstatus(list?.get(position)?.channelinnerorderstatus?.toString() ?: "")
-            entrust.idEntrustType?.text = getType(itemData!!)
-            if (itemData.buyorsell == 0){
+            entrust.idEntrustType?.text = ViewEnumUtils.getDealOrderType(list?.get(position)?.buyorsell.toString(),
+                list?.get(position)?.channelbuildtype.toString()
+            )
+            if (itemData?.buyorsell == 0){
                 entrust.idEntrustType?.textColorInt = R.color.rma_red_color
             }else{
                 entrust.idEntrustType?.textColorInt = R.color.rma_green_color
             }
-            entrust.idDate?.text = getTime(itemData)
-            entrust.idEntrustPrice?.text = itemData.orderprice.toString()
-            entrust.idEntrustNum?.text = itemData.orderqty.toString()
-            entrust.id_entrust_people?.text = itemData.orderlogincode
-            entrust.id_entrust_cancel_people?.text = itemData.cancellogincode
+            entrust.idDate?.text = getTime(itemData ?: FutureEntrustData())
+            entrust.idEntrustPrice?.text = itemData?.orderprice.toString()
+            entrust.idEntrustNum?.text = itemData?.orderqty.toString()
+            entrust.id_entrust_people?.text = itemData?.orderlogincode
+            entrust.id_entrust_cancel_people?.text = itemData?.cancellogincode
             entrust.idEntrustPl?.text = list?.get(position)?.tradeqty.toString().isBlankString()
 
             // 下面三个按钮的点击事件
@@ -157,7 +159,7 @@ class EntrustChildViewModel : BaseViewModel() {
                         (fragment as EntrustChildFragment).loadingDialogStatus.postValue(
                             TaskUiModel.inFlight())
                         GlobalScope.launch {
-                            MyApplication.getInstance()?.futureManager?.cancelOrder(orderId = itemData.orderid?.toLong() ?: 0,accountId = GlobalDataCollection.instance?.accountId ?: 0,marketId = itemData.marketid,goodsId = itemData.goodsid) { isCompleted, err ->
+                            MyApplication.getInstance()?.futureManager?.cancelOrder(orderId = itemData?.orderid?.toLong() ?: 0,accountId = GlobalDataCollection.instance?.accountId ?: 0,marketId = itemData?.marketid ?: 0,goodsId = itemData?.goodsid ?: 0) { isCompleted, err ->
                                 if (isCompleted) {
                                     (fragment as EntrustChildFragment).loadingDialogStatus.postValue(
                                         TaskUiModel.success(msg = "请求成功"))

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

@@ -552,9 +552,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
 
 
                                             } else {//0.净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
-                                                worth = it?.currentbalance?.plus(
-                                                    it.valueOfposition
-                                                )?.plus(it.valueOfposition_keep_watch_profit_and_loss) ?: 0.0
+                                                worth = it?.currentbalance?.plus(it.valueOfposition_keep_watch_profit_and_loss) ?: 0.0
                                                     .minus(it?.otherfreezemargin ?: 0.0)
                                                     .minus(it?.outamountfreeze ?: 0.0) ?: 0.0
                                             }
@@ -625,7 +623,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                     intent.setClass(context, WithdrawalActivity::class.java)
                                     ActivityUtils.startActivity(intent)
                                 }
-                                backgroundResource = R.drawable.qhj_main_withdraw_blue_bg
+                                backgroundResource = R.drawable.qhj_main_withdraw_blue_foure
                                 gravity = Gravity.CENTER
                                 textView {
                                     gravity = Gravity.CENTER_HORIZONTAL

+ 1 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/account/RydzAccountActivity.kt

@@ -558,9 +558,7 @@ class MoneyInfoUI(
 
 
                         } else {//0.净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
-                            worth = it?.currentbalance?.plus(
-                                it.valueOfposition
-                            )?.plus(it.valueOfposition_keep_watch_profit_and_loss) ?: 0.0
+                            worth = it?.currentbalance?.plus(it.valueOfposition_keep_watch_profit_and_loss) ?: 0.0
                                 .minus(it?.otherfreezemargin ?: 0.0)
                                 .minus(it?.outamountfreeze ?: 0.0) ?: 0.0
                         }

+ 52 - 26
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersActivity.kt

@@ -14,6 +14,7 @@ import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.ContractTradePositionData
 import cn.muchinfo.rma.global.database.DataBase
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
@@ -42,37 +43,37 @@ import org.jetbrains.anko.support.v4.viewPager
 /**
  * 合约订单页面
  */
-class ContractOrdersActivity : BaseActivity<ContractOrdersViewModel>(){
+class ContractOrdersActivity : BaseActivity<ContractOrdersViewModel>() {
 
     lateinit var segment: QMUITabSegment
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
 
     //合约汇总单
-    val positionUI by lazy { PositionUI(this,viewModel) }
+    val positionUI by lazy { PositionUI(this, viewModel) }
 
     //委托单
-    val orderUI by lazy { OrderUI(this,viewModel) }
+    val orderUI by lazy { OrderUI(this, viewModel) }
 
     //协议单
-    val agreementUI by lazy { AgreementUI(this,viewModel) }
+    val agreementUI by lazy { AgreementUI(this, viewModel) }
 
     //成交单
-    val traderUI by lazy { TraderUI(this,viewModel) }
+    val traderUI by lazy { TraderUI(this, viewModel) }
 
     //交收单
-    val deliveryUI by lazy { DeliveryUI(this,viewModel) }
+    val deliveryUI by lazy { DeliveryUI(this, viewModel) }
 
     //viewpager的适配器
-    private var newPagerAdapter : PagerAdapter? = null
+    private var newPagerAdapter: PagerAdapter? = null
 
     //tabSegment标题
-    private val newTabsArray : ArrayList<String> = arrayListOf()
+    private val newTabsArray: ArrayList<String> = arrayListOf()
 
     //暂存的页面组
-    private val uiList : ArrayList<_FrameLayout> = arrayListOf()
+    private val uiList: ArrayList<_FrameLayout> = arrayListOf()
 
-    fun initMenuData(){
+    fun initMenuData() {
 
         newTabsArray.add("订单汇总")
         uiList.add(positionUI.root)
@@ -119,7 +120,7 @@ class ContractOrdersActivity : BaseActivity<ContractOrdersViewModel>(){
     fun onQuoteMessageEvent(quoteMessageEvent: QuoteMessageEvent) {
         val goodsids = quoteMessageEvent.goodsid
         //如果推送的goodsid包含当前页面的goodsid,则进行页面刷新
-        if (selectedTabIndex == 0){
+        if (selectedTabIndex == 0) {
             positionUI.refresh(quoteMessageEvent = quoteMessageEvent)
         }
 
@@ -198,7 +199,10 @@ class ContractOrdersActivity : BaseActivity<ContractOrdersViewModel>(){
  * @property viewModel SpotWareHouseViewModel
  * @constructor
  */
-class PositionUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractPositionContentAdapter.OnContentScrollListener {
+class PositionUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: ContractOrdersViewModel
+) : ContractPositionContentAdapter.OnContentScrollListener {
 
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
@@ -206,14 +210,27 @@ class PositionUI(private val activity : AppCompatActivity, private val viewModel
     lateinit var recyclerView: RecyclerView
 
 
-    fun refresh(quoteMessageEvent: QuoteMessageEvent){
+    fun refresh(quoteMessageEvent: QuoteMessageEvent) {
         quoteMessageEvent.goodsid.forEach { goodid ->
             //找到相应商品信息
-            val goodsInfo =
-                viewModel.positionDataList.value?.find { it.refgoodsId == goodid }
-            viewModel.positionDataList.value?.indexOf(goodsInfo)?.let {
-                if (it != -1) {//刷新相应item
-                    contractPositionContentAdapter.notifyItemChanged(it)
+            var goodsInfo: ContractTradePositionData?
+
+            viewModel.positionDataList.value?.forEach { data ->
+                if (data.refgoodsId == 0) {
+                    goodsInfo =
+                        viewModel.positionDataList.value?.find { data.goodsid == goodid.toString() }
+                    viewModel.positionDataList.value?.indexOf(goodsInfo)?.let {
+                        if (it != -1) {//刷新相应item
+                            contractPositionContentAdapter.notifyItemChanged(it)
+                        }
+                    }
+                } else {
+                    goodsInfo = viewModel.positionDataList.value?.find { data.refgoodsId == goodid }
+                    viewModel.positionDataList.value?.indexOf(goodsInfo)?.let {
+                        if (it != -1) {//刷新相应item
+                            contractPositionContentAdapter.notifyItemChanged(it)
+                        }
+                    }
                 }
             }
         }
@@ -356,7 +373,10 @@ class PositionUI(private val activity : AppCompatActivity, private val viewModel
  * @property viewModel SpotWareHouseViewModel
  * @constructor
  */
-class OrderUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractOrderContentAdapter.OnContentScrollListener {
+class OrderUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: ContractOrdersViewModel
+) : ContractOrderContentAdapter.OnContentScrollListener {
 
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
@@ -369,7 +389,7 @@ class OrderUI(private val activity : AppCompatActivity, private val viewModel: C
 
     val contractOrderContentAdapter by lazy {
         ContractOrderContentAdapter(
-            activity,viewModel
+            activity, viewModel
         )
     }
 
@@ -383,8 +403,8 @@ class OrderUI(private val activity : AppCompatActivity, private val viewModel: C
         verticalLayout {
             viewModel.queryContractOrderTitle(Constant.table_mobile_hnst_hydd_wt)
             contractOrderContentAdapter.setOnContentScrollListener(this@OrderUI)
-            viewModel.showCancelDialog.bindOptional(context){
-                if (it == true){
+            viewModel.showCancelDialog.bindOptional(context) {
+                if (it == true) {
                     activity.createWarningDialog {
                         setTitle("温馨提示")
                         setMessage("确定撤销此委托吗?")
@@ -399,7 +419,7 @@ class OrderUI(private val activity : AppCompatActivity, private val viewModel: C
                                 marketid = data1?.marketid?.toInt() ?: 0,
                                 accountid = GlobalDataCollection.instance?.accountId ?: 0,
                                 oldOrderId = data1?.orderid?.toLong() ?: 0
-                            ){
+                            ) {
                                 //撤单成功后再次请求申请单
                                 viewModel.queryContractTradeOrderDetail()
                             }
@@ -527,7 +547,10 @@ class OrderUI(private val activity : AppCompatActivity, private val viewModel: C
  * @property viewModel SpotWareHouseViewModel
  * @constructor
  */
-class TraderUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractTraderContentAdapter.OnContentScrollListener {
+class TraderUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: ContractOrdersViewModel
+) : ContractTraderContentAdapter.OnContentScrollListener {
 
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
@@ -671,7 +694,10 @@ class TraderUI(private val activity : AppCompatActivity, private val viewModel:
  * @property viewModel SpotWareHouseViewModel
  * @constructor
  */
-class DeliveryUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractDeliveryContentAdapter.OnContentScrollListener {
+class DeliveryUI(
+    private val activity: AppCompatActivity,
+    private val viewModel: ContractOrdersViewModel
+) : ContractDeliveryContentAdapter.OnContentScrollListener {
 
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
@@ -684,7 +710,7 @@ class DeliveryUI(private val activity : AppCompatActivity, private val viewModel
 
     val contractDeliveryContentAdapter by lazy {
         ContractDeliveryContentAdapter(
-            activity,viewModel
+            activity, viewModel
         )
     }
 

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

@@ -463,6 +463,8 @@ class ContractOrdersViewModel : BaseViewModel(){
             val quoteGoodsListData = quoteGoodsListDataArrayList?.find { data.goodsid.toString() == it.goodsid }
             if (quoteGoodsListData?.refgoodscode.isNullOrEmpty().not()){
                 newList.add(data.copy(refgoodsId = quoteGoodsListData?.refgoodsid?.toInt() ?: 0,refgoodsCode = quoteGoodsListData?.refgoodscode))
+            }else{
+                newList.add(data)
             }
         }
         positionDataList.postValue(newList)
@@ -523,7 +525,11 @@ class ContractOrdersViewModel : BaseViewModel(){
     fun getgoodsCodes(list : List<ContractTradePositionData>): String {
         var goodsCodes = ""
         list?.forEach {
-            goodsCodes = goodsCodes + it.refgoodsCode + "," //+ DataBase.getInstance().goodsInfoDao().getGoodsInfo(it.relatedgoodsid).goodscode + ","
+            if (it.marketid?.startsWith("16") == true){
+                goodsCodes = goodsCodes + it.goodscode + ","
+            }else{
+                goodsCodes = goodsCodes + it.refgoodsCode + ","
+            }
         }
         return goodsCodes
     }

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

@@ -36,6 +36,7 @@ import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersViewModel
 import cn.muchinfo.rma.view.base.hnstmain.contractorders.delivery.DeliveryActivity;
 import cn.muchinfo.rma.view.base.hnstmain.contractorders.transfer.ContractTransferActivity;
 import cn.muchinfo.rma.view.base.hnstmain.contractorders.unwind.AgreementUnwindActivity;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.unwind.ContractUnWindActivity;
 import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementDetailsActivity;
 import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementViewModel;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
@@ -114,16 +115,25 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         goodsInfo = DataBase.Companion.getInstance().goodsInfoDao().getGoodsInfo(Integer.valueOf(data.getGoodsid()));
 
         List<GoodsInfoAndQuotes> quotesList = GlobalDataCollection.Companion.getInstance().getGoodsInfoAndQuotesList();//获取盘面信息列表
-        for (int j = 0;j < quotesList.size();j++){
-            if (data.getRefgoodsCode().equals(quotesList.get(j).getOutgoodscode())){
-                quoteDayData = quotesList.get(j).getQuoteDayData();//赋值当前商品的盘面信息
+        for (int j = 0; j < quotesList.size(); j++) {
+            if (data.getMarketid().startsWith("16")) {
+                //日了狗,16市场的用本身的goodscode
+                if (data.getGoodscode().equals(quotesList.get(j).getOutgoodscode())){
+                    quoteDayData = quotesList.get(j).getQuoteDayData();//赋值当前商品的盘面信息
+                }
+            } else {
+                //掉期市场用46市场的 fuck
+                if (data.getRefgoodsCode().equals(quotesList.get(j).getOutgoodscode())) {
+                    quoteDayData = quotesList.get(j).getQuoteDayData();//赋值当前商品的盘面信息
+                }
             }
+
         }
         List<String> rightData = new ArrayList<>();
         //方向
-        if (data.getBuyorsell().equals("0")){
+        if (data.getBuyorsell().equals("0")) {
             rightData.add("买入");
-        }else {
+        } else {
             rightData.add("卖出");
         }
         //持有数量
@@ -133,39 +143,39 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         //冻结数量
         rightData.add(data.getFrozenqty());
         //持仓均价
-        rightData.add(data.getAverageprice());
-        if (quoteDayData != null){
+        rightData.add(NumberUtils.roundNum(data.getAverageprice(),goodsInfo.getDecimalplace()));
+        if (quoteDayData != null) {
             //现价
-            if (quoteDayData.getPrice() == 0.0){
+            if (quoteDayData.getPrice() == 0.0) {
                 rightData.add("--");
-            }else {
-                rightData.add(NumberUtils.roundNum(String.valueOf(quoteDayData.getPrice()),2));
+            } else {
+                rightData.add(NumberUtils.roundNum(String.valueOf(quoteDayData.getPrice()), 2));
             }
 
             //持仓金额
-            rightData.add(NumberUtils.roundNum(data.getCurholderamount(),2));
+            rightData.add(NumberUtils.roundNum(data.getCurholderamount(), 2));
             //计算成本价
             double closePrice = (Double.parseDouble(data.getAverageprice()));
             //计算出成本价和现价的价差
             double differencePrice = quoteDayData.getPrice() - closePrice;
             String Profit = "";
-            if (quoteDayData.getPrice() == 0.0){
+            if (quoteDayData.getPrice() == 0.0) {
                 Profit = "--";
-            }else {
-                if (closePrice == 0.0){
+            } else {
+                if (closePrice == 0.0) {
                     Profit = "--";
-                }else {
-                    if (data.getBuyorsell().equals("1")){//卖方向
-                        Profit = NumberUtils.roundNum(differencePrice * Double.parseDouble(data.getCurpositionqty()) * goodsInfo.getAgreeunit() * -1,2) ;
-                    }else {
-                        Profit = NumberUtils.roundNum(differencePrice * Double.parseDouble(data.getCurpositionqty()) * goodsInfo.getAgreeunit(),2) ;
+                } else {
+                    if (data.getBuyorsell().equals("1")) {//卖方向
+                        Profit = NumberUtils.roundNum(differencePrice * Double.parseDouble(data.getCurpositionqty()) * goodsInfo.getAgreeunit() * -1, 2);
+                    } else {
+                        Profit = NumberUtils.roundNum(differencePrice * Double.parseDouble(data.getCurpositionqty()) * goodsInfo.getAgreeunit(), 2);
                     }
 
                 }
             }
             //浮动盈亏
             rightData.add(Profit);
-        }else {
+        } else {
             //现价
             rightData.add("0");
             //持仓金额
@@ -199,8 +209,6 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         });
 
 
-
-
         //转让
         itemViewHolder.warehouse_register.setOnClickListener(view -> {
             Intent intent = new Intent();
@@ -214,24 +222,36 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         List<DeliveryRelationData> dataList = GlobalDataCollection.Companion.getInstance().getDeliveryRelationDataArrayList();
 
         for (int j = 0; j < dataList.size(); j++) {
-            if (data.getGoodsid().equals(dataList.get(j).getGoodsid())){
+            if (data.getGoodsid().equals(dataList.get(j).getGoodsid())) {
                 deliveryData = dataList.get(j);
-                if (dataList.get(j).getDeliverytype().equals("1") || dataList.get(j).getDeliverytype().equals("3")){//云融大宗的挂牌转让
+                if (dataList.get(j).getDeliverytype().equals("1") || dataList.get(j).getDeliverytype().equals("3")) {//云融大宗的挂牌转让
                     type = "1";
-                }else {//云融大宗的基差点价
+                } else {//云融大宗的基差点价
                     type = "2";
                 }
             }
         }
 
         if (Double.parseDouble(data.getEnableqty()) > 0) {
-            if (deliveryData == null){
+            if (deliveryData == null) {
                 itemViewHolder.fanacel_register.setVisibility(View.GONE);
-            }else {
+            } else {
                 itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
             }
-            if (data.getMarketid().startsWith("46")){
-                itemViewHolder.to_unwind.setVisibility(View.VISIBLE);
+
+        } else {
+            itemViewHolder.fanacel_register.setVisibility(View.GONE);
+            itemViewHolder.warehouse_register.setVisibility(View.GONE);
+        }
+
+        if (data.getTrademode().equals("46")) {
+            if (Double.parseDouble(data.getPositionqty()) > 0) {
+                if (GlobalDataCollection.Companion.getInstance().getLoginQueryData().getUserInfo().getUsertype() == 5){
+                    itemViewHolder.to_unwind.setVisibility(View.VISIBLE);
+                }else {
+                    itemViewHolder.to_unwind.setVisibility(View.GONE);
+                }
+
                 itemViewHolder.agreement_to_unwind.setVisibility(View.VISIBLE);
                 itemViewHolder.warehouse_register.setVisibility(View.GONE);
             }else {
@@ -239,16 +259,18 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
                 itemViewHolder.agreement_to_unwind.setVisibility(View.GONE);
                 itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
             }
-
-
         } else {
-            itemViewHolder.fanacel_register.setVisibility(View.GONE);
-            itemViewHolder.warehouse_register.setVisibility(View.GONE);
+            itemViewHolder.to_unwind.setVisibility(View.GONE);
+            itemViewHolder.agreement_to_unwind.setVisibility(View.GONE);
+            itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
         }
 
         //平仓操作
         itemViewHolder.to_unwind.setOnClickListener(view -> {
-
+            Intent intent = new Intent();
+            intent.putExtra("data", data);
+            intent.setClass(context, ContractUnWindActivity.class);
+            ActivityUtils.startActivity(intent);
         });
 
         //协议平仓
@@ -265,12 +287,12 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
             List<DeliveryRelationData> newdataList = GlobalDataCollection.Companion.getInstance().getDeliveryRelationDataArrayList();
 
             for (int j = 0; j < dataList.size(); j++) {
-                if (data.getGoodsid().equals(dataList.get(j).getGoodsid())){
+                if (data.getGoodsid().equals(dataList.get(j).getGoodsid())) {
                     newdeliveryData = dataList.get(j);
-                    if (dataList.get(j).getDeliverytype().equals("1") || dataList.get(j).getDeliverytype().equals("3")){//云融大宗的挂牌转让
-                        intent.putExtra("type","1");
-                    }else {//云融大宗的基差点价
-                        intent.putExtra("type","2");
+                    if (dataList.get(j).getDeliverytype().equals("1") || dataList.get(j).getDeliverytype().equals("3")) {//云融大宗的挂牌转让
+                        intent.putExtra("type", "1");
+                    } else {//云融大宗的基差点价
+                        intent.putExtra("type", "2");
                     }
                 }
             }

+ 20 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryViewModel.kt

@@ -90,12 +90,31 @@ class DeliveryViewModel : BaseViewModel(){
         }
         MyApplication.getInstance()?.deliveryManager?.queryWrDeliveryAvalidHoldLB(params = params){isSuccess, respData, error ->
             if (isSuccess){
-                deliveryDataList.postValue(respData)
+//                deliveryDataList.postValue(respData)
+                firstSetDeliveryList(respData ?: arrayListOf(),0)
             }
         }
     }
 
 
+    fun firstSetDeliveryList(list: List<WrDeliveryAvalidHoldLBData>,dataIndex: Int){
+        val newWrStandardFactoryItemDataList = arrayListOf<WrDeliveryAvalidHoldLBData>()
+        list?.forEach {
+            if (list?.indexOf(it) == dataIndex){
+                if (it.isClick == 0){
+                    newWrStandardFactoryItemDataList.add(it.copy(isClick = 1))
+                    deliveryData.postValue(it.copy(isClick = 1))
+                }else{
+                    newWrStandardFactoryItemDataList.add(it.copy(isClick = 0))
+                    deliveryData.postValue(WrDeliveryAvalidHoldLBData())
+                }
+            }else{
+                newWrStandardFactoryItemDataList.add(it.copy(isClick = 0))
+            }
+        }
+        deliveryDataList.postValue(newWrStandardFactoryItemDataList)
+    }
+
     /**
      * item的点击事件
      */

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

@@ -64,7 +64,7 @@ class AgreementUnwindViewHolder(private val activity : AppCompatActivity, privat
 
                 textView {
                     data.bindOptional(context){
-                        text = it?.tradetime?.toShowTime3()
+                        text = it?.expiredate
                     }
                     textSizeAuto = 32
                     textColorInt = R.color.rma_black_33

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

@@ -198,6 +198,9 @@ class ContractUnWindActivity : BaseActivity<ContractUnWindViewModel>(){
                 }
 
                 verticalLayout {
+                    viewModel.agreementData.bindOptional(context){
+
+                    }
                     background = resources.getDrawable(R.color.white)
                     linearLayout {
                         gravity = Gravity.CENTER_VERTICAL
@@ -210,7 +213,7 @@ class ContractUnWindActivity : BaseActivity<ContractUnWindViewModel>(){
                             }.lparams(wrapContent, wrapContent) {
                                 marginStart = autoSize(36)
                             }
-                        }.lparams(autoSize(250), autoSize(100))
+                        }.lparams(wrapContent, autoSize(100))
 
                         textView {
                             viewModel.quoteDayData.bindOptional(context){

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

@@ -81,7 +81,7 @@ class ContractUnwindViewHolder(private val activity : AppCompatActivity, private
 
                 textView {
                     data.bindOptional(context){
-                        text = it?.tradetime?.toShowTime3()
+                        text = it?.expiredate
                     }
                     textSizeAuto = 32
                     textColorInt = R.color.rma_black_33

+ 1 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceTempateActivity.kt

@@ -384,9 +384,7 @@ class AddPerformanceTempateActivity : BaseActivity<PerformanceTemplateViewModel>
                 returnBooble = false
             } else {
                 if (it.steptypeid == "1" || it.steptypeid == "2") {
-                    returnBooble = !(it.stepdays.isNullOrEmpty() || it.stepvalue.isNullOrEmpty())
-                } else {
-                    returnBooble = !it.stepdays.isNullOrEmpty()
+                    returnBooble = !(it.stepvalue.isNullOrEmpty())
                 }
             }
         }

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceViewHolder.kt

@@ -141,7 +141,7 @@ class AddPerformanceViewHolder(private val activity : AppCompatActivity,private
                             }
                             viewModel.setPerformanceStepDataList(
                                 "2",
-                                dataIndex.plus(1).toString()
+                                dataIndex.toString()
                             )
 
                         }

+ 40 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reference/ReferenceAdapter.java

@@ -116,7 +116,12 @@ public class ReferenceAdapter extends RecyclerView.Adapter<ReferenceAdapter.Item
         if (quoteDayData != null){
             // 卖价取卖一价
             QHjRightData askData = new QHjRightData();
-            askData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getAsk())),2));
+            if (quoteDayData.getAsk() == 0.0){
+                askData.setValue("--");
+            }else {
+                askData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getAsk())),2));
+            }
+
             askData.setColorType("3");
             rightData.add(askData);
 
@@ -128,7 +133,12 @@ public class ReferenceAdapter extends RecyclerView.Adapter<ReferenceAdapter.Item
 
             //买价取买一价
             QHjRightData bidData = new QHjRightData();
-            bidData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getBid())),2));
+            if (quoteDayData.getBid() == 0.0){
+                bidData.setValue("--");
+            }else {
+                bidData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getBid())),2));
+            }
+
             bidData.setColorType("3");
             rightData.add(bidData);
 
@@ -142,7 +152,11 @@ public class ReferenceAdapter extends RecyclerView.Adapter<ReferenceAdapter.Item
         if (quoteDayData != null){
             //最新价
             QHjRightData newPriceData = new QHjRightData();
-            newPriceData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPrice())),2));
+            if (quoteDayData.getPrice() == 0.0){
+                newPriceData.setValue("--");
+            }else {
+                newPriceData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPrice())),2));
+            }
             newPriceData.setColorType(quoteDayData.getColor());
             rightData.add(newPriceData);
             //涨跌幅
@@ -151,7 +165,11 @@ public class ReferenceAdapter extends RecyclerView.Adapter<ReferenceAdapter.Item
             QHjRightData riseFallData = new QHjRightData();
             //今开
             QHjRightData openRightData = new QHjRightData();
-            openRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getOpened())),2));
+            if (quoteDayData.getOpened() == 0.0){
+                openRightData.setValue("--");
+            }else {
+                openRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getOpened())),2));
+            }
             double openRightDatColor = quoteDayData.getOpened() - quoteDayData.getPreclose();
             if (openRightDatColor > 0){
                 openRightData.setColorType("3");
@@ -162,7 +180,12 @@ public class ReferenceAdapter extends RecyclerView.Adapter<ReferenceAdapter.Item
             }
             //最高价
             QHjRightData highRightData = new QHjRightData();
-            highRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getHighest())),2));
+            if (quoteDayData.getHighest() == 0.0){
+                highRightData.setValue("--");
+            }else {
+                highRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getHighest())),2));
+            }
+
             double highRightDatColor = quoteDayData.getHighest() - quoteDayData.getPreclose();
             if (highRightDatColor > 0){
                 highRightData.setColorType("3");
@@ -174,7 +197,12 @@ public class ReferenceAdapter extends RecyclerView.Adapter<ReferenceAdapter.Item
             highRightData.setColorType("1");
             //最低价
             QHjRightData lowestRightData = new QHjRightData();
-            lowestRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getLowest())),data.getDecimalplace()));
+            if (quoteDayData.getLowest() == 0.0){
+                lowestRightData.setValue("--");
+            }else {
+                lowestRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getLowest())),data.getDecimalplace()));
+            }
+
             double lowestRightDatColor = quoteDayData.getLowest() - quoteDayData.getPreclose();
             if (lowestRightDatColor > 0){
                 lowestRightData.setColorType("3");
@@ -186,7 +214,12 @@ public class ReferenceAdapter extends RecyclerView.Adapter<ReferenceAdapter.Item
             lowestRightData.setColorType("1");
             //昨收价
             QHjRightData yesCloseRightData = new QHjRightData();
-            yesCloseRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPreclose())),data.getDecimalplace()));
+            if (quoteDayData.getPreclose() == 0.0){
+                yesCloseRightData.setValue("--");
+            }else {
+                yesCloseRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPreclose())),data.getDecimalplace()));
+            }
+
             yesCloseRightData.setColorType("1");
             //行情时间
             QHjRightData timeRightData = new QHjRightData();

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

@@ -66,9 +66,12 @@ class TjmdHomeMarketViewHolder(private val activity : AppCompatActivity,private
                         //获取盘面信息
                         var quoteDayData: QuoteDayData? = null
                         quotesList?.forEach {
-                            if (data?.goodsInfo?.goodscode == it.outgoodscode){
-                                quoteDayData = it?.quoteDayData ?: QuoteDayData()
+                            if (it?.outgoodscode.isNullOrEmpty().not()){
+                                if (data?.goodsInfo?.goodscode == it.outgoodscode){
+                                    quoteDayData = it?.quoteDayData ?: QuoteDayData()
+                                }
                             }
+
                         }
 
                         if (quoteDayData != null){

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

@@ -201,9 +201,9 @@ class ProcurementViewModel : BaseViewModel() {
             val newRightData = arrayListOf<String>()
 
             newRightData.add(if (it.contracttype == "1"){
-                it.sellusername
+                it.sellnickname
             }else{
-                it.buyusername
+                it.buynickname
             } + "\n" + it.qty + it.enumdicname)//'对手方/\n合同量 '
             newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n品类 '
             newRightData.add(if (it.biztype == "1"){

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

@@ -13,12 +13,15 @@ import androidx.fragment.app.FragmentPagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.ContractData
+import cn.muchinfo.rma.global.data.HedgePlanData
+import cn.muchinfo.rma.global.data.MiddleGoodsDetail
 import cn.muchinfo.rma.lifecycle.getAppCompatActivity
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseFragment
 import cn.muchinfo.rma.view.base.home.commodity.AddHedgeGoodsActivity
 import cn.muchinfo.rma.view.base.home.commodity.newspot.NewAddSpotGoodsActivity
 import cn.muchinfo.rma.view.base.home.contract.AddContractActivity
+import cn.muchinfo.rma.view.base.home.hedge.AddHedgePlanActivity
 import cn.muchinfo.rma.view.base.procurement.ProcurementFragment
 import cn.muchinfo.rma.view.base.purchasesale.PurchaseSaleFragment
 import cn.muchinfo.rma.view.base.sale.SaleFragment
@@ -129,7 +132,8 @@ class SpotFragment : BaseFragment<SpotViewModel>(){
                              if (selectedTabIndex == 2){
                                  val intent = Intent()
                                  intent.putExtra("type","1")
-                                 intent.setClass(context, AddHedgeGoodsActivity::class.java)
+                                 intent.putExtra("data", HedgePlanData())
+                                 intent.setClass(context, AddHedgePlanActivity::class.java)
                                  ActivityUtils.startActivity(intent)
                              }else{
                                  val intent = Intent()

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

@@ -136,7 +136,7 @@ class TradeCircleListedSellUI(
         if (hasType == "1"){
             viewModel.querydetailsWarehouseWrPosition(wrfactortypeid = data.wrfactortypeid ?: "")
         }else{
-            viewModel.querydetailsWarehouseWrPosition(deliverygoodsid = listedData.DeliveryGoodsID ?: "",wrstandardid = listedData.WrFtWrstandard?.wrstandardid ?: "")
+            viewModel.querydetailsWarehouseWrPosition(deliverygoodsid = listedData.DeliveryGoodsID ?: "",wrstandardid = listedData.WrFtWrstandard?.wrstandardid ?: "",warehouseid = listedData.getWarehouseid())
         }
 
     }

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

@@ -68,13 +68,14 @@ class TradeCircleListedingViewModel : BaseViewModel(){
     /**
      * 查询相应要素下的预售仓单
      */
-    fun queryorderSummaryWrPosition(deliverygoodsid : String = "",wrstandardid : String = ""){
+    fun queryorderSummaryWrPosition(deliverygoodsid : String = "",wrstandardid : String = "",dgitemname : String = ""){
         val params = mutableMapOf<String,String>().apply {
             put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             put("querytype","2")
             put("haswr","0")
             put("deliverygoodsid",deliverygoodsid)
             put("wrstandardid",wrstandardid)
+            put("dgitemname",dgitemname)
         }
         MyApplication.getInstance()?.warehouseManager?.queryWrPosition(params = params){ isSuccess, respData, error ->
             if (isSuccess){
@@ -88,7 +89,7 @@ class TradeCircleListedingViewModel : BaseViewModel(){
     /**
      * 查询现货明细
      */
-    fun querydetailsWarehouseWrPosition(wrfactortypeid : String = "",deliverygoodsid : String = "",wrstandardid : String = ""){
+    fun querydetailsWarehouseWrPosition(wrfactortypeid : String = "",deliverygoodsid : String = "",wrstandardid : String = "",warehouseid : String = ""){
         val params = mutableMapOf<String,String>().apply {
             put("accountid", GlobalDataCollection.instance?.accountId.toString())
             if (wrfactortypeid.isNullOrEmpty().not()){
@@ -100,6 +101,9 @@ class TradeCircleListedingViewModel : BaseViewModel(){
             if (wrstandardid.isNullOrEmpty().not()){
                 put("wrstandardid",wrstandardid)
             }
+            if (warehouseid.isNullOrEmpty().not()){
+                put("warehouseid",warehouseid)
+            }
         }
         MyApplication.getInstance()?.warehouseManager?.queryHoldLB(params = params){isSuccess, respData, error ->
             if (isSuccess){

+ 36 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/adapter/TransferAdapter.java

@@ -124,7 +124,12 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
         if (quoteDayData != null) {
             // 卖价取卖一价
             QHjRightData askData = new QHjRightData();
-            askData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getAsk())), 2));
+            if (quoteDayData.getAsk() == 0.0){
+                askData.setValue("--");
+            }else {
+                askData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getAsk())), 2));
+            }
+
             askData.setColorType("3");
             rightData.add(askData);
 
@@ -136,7 +141,12 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
 
             //买价取买一价
             QHjRightData bidData = new QHjRightData();
-            bidData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getBid())), 2));
+            if (quoteDayData.getBid() == 0.0){
+                bidData.setValue("--");
+            }else {
+                bidData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getBid())), 2));
+            }
+
             bidData.setColorType("3");
             rightData.add(bidData);
 
@@ -166,7 +176,12 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
             QHjRightData riseFallData = new QHjRightData();
             //今开
             QHjRightData openRightData = new QHjRightData();
-            openRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getOpened())), 2));
+            if (quoteDayData.getOpened() == 0.0){
+                openRightData.setValue("--");
+            }else {
+                openRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getOpened())), 2));
+            }
+
             double openRightDatColor = quoteDayData.getOpened() - quoteDayData.getPreclose();
             if (openRightDatColor > 0) {
                 openRightData.setColorType("3");
@@ -177,7 +192,12 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
             }
             //最高价
             QHjRightData highRightData = new QHjRightData();
-            highRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getHighest())), 2));
+            if (quoteDayData.getHighest() == 0.0){
+                highRightData.setValue("--");
+            }else {
+                highRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getHighest())), 2));
+            }
+
             double highRightDatColor = quoteDayData.getHighest() - quoteDayData.getPreclose();
             if (highRightDatColor > 0) {
                 highRightData.setColorType("3");
@@ -189,7 +209,12 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
             highRightData.setColorType("1");
             //最低价
             QHjRightData lowestRightData = new QHjRightData();
-            lowestRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getLowest())), data.getDecimalplace()));
+            if (quoteDayData.getLowest() == 0.0){
+                lowestRightData.setValue("--");
+            }else {
+                lowestRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getLowest())), data.getDecimalplace()));
+            }
+
             double lowestRightDatColor = quoteDayData.getLowest() - quoteDayData.getPreclose();
             if (lowestRightDatColor > 0) {
                 lowestRightData.setColorType("3");
@@ -201,7 +226,12 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
             lowestRightData.setColorType("1");
             //昨收价
             QHjRightData yesCloseRightData = new QHjRightData();
-            yesCloseRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPreclose())), data.getDecimalplace()));
+            if (quoteDayData.getPreclose() == 0.0){
+                yesCloseRightData.setValue("--");
+            }else {
+                yesCloseRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPreclose())), data.getDecimalplace()));
+            }
+
             yesCloseRightData.setColorType("1");
 
             if (quoteDayData.getLast() != 0 && quoteDayData.getPreclose() != 0) {

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

@@ -375,15 +375,16 @@ class YrdzChartActivity : BaseActivity<YrdzChartViewModel>() , View.OnClickListe
         val goodsids = quoteMessageEvent.goodsid
         //如果推送的goodsid包含当前页面的goodsid,则进行页面刷新
         if (goodsids.contains(viewModel.goodsId.toInt())){
-            // 这里把当前最新价转化为历史
-            timeChartView.refreshDate(ChartDataAdapter().getHisTikData(viewModel.outGoodsCode))
-            // 这里更新最新价
-            viewModel.refreshTimePrice(timeChartView)
             //更新当前商品的盘面信息
             val quote = GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find { viewModel.outGoodsCode == it.outgoodscode }?.quoteDayData
             if (quote != null){
                 viewModel.quoteDayData.postValue(quote)
             }
+            // 这里把当前最新价转化为历史
+            timeChartView.refreshDate(ChartDataAdapter().getHisTikData(viewModel.outGoodsCode))
+            // 这里更新最新价
+            viewModel.refreshTimePrice(timeChartView)
+
         }
     }
 

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/TransferSwapsAdapter.java

@@ -207,7 +207,12 @@ public class TransferSwapsAdapter extends RecyclerView.Adapter<TransferSwapsAdap
                 riseFallData.setColorType("1");
             }
             QHjRightData openPriceData = new QHjRightData();//开盘价
-            openPriceData.setValue(NumberUtils.roundNum(quoteDayData.getOpened(),2));
+            if (quoteDayData.getOpened() == 0.0){
+                openPriceData.setValue("--");
+            }else {
+                openPriceData.setValue(NumberUtils.roundNum(quoteDayData.getOpened(),2));
+            }
+
             openPriceData.setColorType("3");
 
             //最高价

+ 27 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingActivity.kt

@@ -362,6 +362,33 @@ class SwapsDelistingActivity : BaseActivity<SwapsDelistingViewModel>(){
 
             linearLayout {
                 if (GlobalDataCollection.instance?.loginQueryData?.userInfo?.usertype == 2){//登录用户为掉期交易商时只能整单摘
+                    visibility = View.VISIBLE
+                }else{//登录用户为普通交易商时摘牌时能修改摘牌数量
+                    visibility = View.GONE
+                }
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    textView {
+                        text = "摘牌数量"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(autoSize(250), wrapContent)
+
+                textView {
+                    text = data.orderqty
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(143))
+
+            itemView()
+
+            linearLayout {
+                if (GlobalDataCollection.instance?.loginQueryData?.userInfo?.usertype == 2){//登录用户为掉期交易商时只能整单摘
                     visibility = View.GONE
                 }else{//登录用户为普通交易商时摘牌时能修改摘牌数量
                     visibility = View.VISIBLE

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

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

+ 7 - 0
RMA/app/src/main/res/drawable/qhj_main_withdraw_blue_foure.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/rma_blue_color"/>
+    <corners android:radius="45dp"
+       />
+</shape>

+ 2 - 2
RMA/app/src/main/res/values/strings.xml

@@ -76,8 +76,8 @@
     <string name="str_available_hold">可用/\n持仓</string>
     <string name="str_last_cost">开仓均价/\n持仓均价</string>
     <string name="str_pl_plp">持仓盈亏/\n盈亏比</string>
-    <string name="str_buy">买</string>
-    <string name="str_sell">卖</string>
+    <string name="str_buy">买</string>
+    <string name="str_sell">卖</string>
     <string name="str_pl">持仓盈亏</string>
     <string name="str_status_date">状态/\n时间</string>
     <string name="str_name_type">名称/\n类型</string>