Преглед изворни кода

风险管理7月16日提交代码-liu.bolan-千海金

Liu.bolan пре 4 година
родитељ
комит
58620f6ad9
25 измењених фајлова са 500 додато и 60 уклоњено
  1. 26 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt
  2. 26 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/report/ReportManager.kt
  3. 17 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/BaseGlobalData.java
  4. 101 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaExpourseParamChLogDetailData.kt
  5. 9 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractData.kt
  6. 57 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ErmcpGoodsSortByPositionData.kt
  7. 5 3
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/chart/ChartTSData.kt
  8. 8 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  9. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/chart/old/timeCharts/TimeChartView.java
  10. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/FutureFragment.kt
  11. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/FutureViewModel.kt
  12. 44 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/costs/CostInfoFragment.kt
  13. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldViewModel.kt
  14. 18 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarket.kt
  15. 24 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarketModel.kt
  16. 22 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/MarketFragment.kt
  17. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeActivity.kt
  18. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/AddContractActivity.kt
  19. 7 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractViewModel.kt
  20. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/InvoiceRegistrationActivity.kt
  21. 19 9
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/ExposureReportContentAdapter.java
  22. 65 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsViewModel.kt
  23. 35 13
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/NoPayDetailsActivity.kt
  24. 1 0
      RMA/app/src/main/res/layout/future_head_view.xml
  25. 2 1
      RMA/app/src/main/res/layout/layout_item_inventory_current.xml

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

@@ -684,5 +684,31 @@ class FutureManager {
         )
     }
 
+    /**
+     * 查询企业风管期货主力、次主力商品信息
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun getErmcpGoodsSortByPosition(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ErmcpGoodsSortByPositionData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/GetErmcpGoodsSortByPosition",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ErmcpGoodsSortByPositionData>>>() {
+                override fun onResponse(response: BaseResult<List<ErmcpGoodsSortByPositionData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
 
 }

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

@@ -242,6 +242,32 @@ class ReportManager {
         )
     }
 
+
+    /**
+     * 查询敞口参数调整明细
+     */
+    fun qryAreaExpourseParamChLogDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AreaExpourseParamChLogDetailData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryAreaExpourseParamChLogDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AreaExpourseParamChLogDetailData>>>(){
+                override fun onResponse(response: BaseResult<List<AreaExpourseParamChLogDetailData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+
     /**
      * 新版查询现货报表
      */

+ 17 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/BaseGlobalData.java

@@ -8,6 +8,7 @@ import cn.muchinfo.rma.global.data.AccountData;
 import cn.muchinfo.rma.global.data.BankAccountSignData;
 import cn.muchinfo.rma.global.data.ClientMenuData;
 import cn.muchinfo.rma.global.data.ContractTradePositionData;
+import cn.muchinfo.rma.global.data.ErmcpGoodsSortByPositionData;
 import cn.muchinfo.rma.global.data.ErmcpRoleFuncMenuData;
 import cn.muchinfo.rma.global.data.FutureDetailsData;
 import cn.muchinfo.rma.global.data.GoodsExInfoData;
@@ -124,6 +125,22 @@ public class BaseGlobalData {
     private ArrayList<QhjContractDetailsData> qhjContractDetailsDataArrayList;
 
     /**
+     * 主力合约
+     */
+    private ArrayList<ErmcpGoodsSortByPositionData> ermcpGoodsSortByPositionDataArrayList;
+
+    public ArrayList<ErmcpGoodsSortByPositionData> getErmcpGoodsSortByPositionDataArrayList() {
+        if (ermcpGoodsSortByPositionDataArrayList == null){
+            ermcpGoodsSortByPositionDataArrayList = new ArrayList<>();
+        }
+        return ermcpGoodsSortByPositionDataArrayList;
+    }
+
+    public void setErmcpGoodsSortByPositionDataArrayList(ArrayList<ErmcpGoodsSortByPositionData> ermcpGoodsSortByPositionDataArrayList) {
+        this.ermcpGoodsSortByPositionDataArrayList = ermcpGoodsSortByPositionDataArrayList;
+    }
+
+    /**
      * 提现账户信息
      * @return
      */

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

@@ -0,0 +1,101 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 敞口参数调整明细
+ */
+data class AreaExpourseParamChLogDetailData(
+    @SerializedName("accountid")
+    val accountid : String? = "",//期货账户ID (作废, 默认为0)
+    @SerializedName("aftervalue")
+    val aftervalue : String? = "",//应套保\套利量变更后(调整后应套保总量)
+    @SerializedName("areauserid")
+    val areauserid : String? = "",//所属机构\交易用户ID
+    @SerializedName("beforevalue")
+    val beforevalue : String? = "",//应套保\套利量变更前(调整前应套保总量)
+    @SerializedName("begindate")
+    val begindate : String? = "",//开始交易日
+    @SerializedName("changelogtype")
+    val changelogtype : String? = "",//变更流水类型 - 1:套保比率变更 2:套利比率变更
+    @SerializedName("curvalue")
+    val curvalue : String? = "",//当前套保\套利量(套保总量|套利总量)
+    @SerializedName("diffvalue")
+    val diffvalue : String? = "",//应套保总量变化量
+    @SerializedName("enddate")
+    val enddate : String? = "",//结束交易日
+    @SerializedName("logdatetime")
+    val logdatetime : String? = "",//流水日期
+    @SerializedName("logid")
+    val logid : String? = "",//流水ID(609+Unix秒时间戳(10位)+xxxxxx)
+    @SerializedName("middlegoodscode")
+    val middlegoodscode : String? = "",//套保品种代码
+    @SerializedName("middlegoodsid")
+    val middlegoodsid : String? = "",//套保品种
+    @SerializedName("middlegoodsname")
+    val middlegoodsname : String? = "",//套保品种名称
+    @SerializedName("paramaftervalue")
+    val paramaftervalue : String? = "",//参数变更后(调整后参数值)
+    @SerializedName("parambeforevalue")
+    val parambeforevalue : String? = "",//参数变更前(调整前参数值)
+    @SerializedName("tradedate")
+    val tradedate : String? = ""//交易日(yyyyMMdd)
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(aftervalue)
+        parcel.writeString(areauserid)
+        parcel.writeString(beforevalue)
+        parcel.writeString(begindate)
+        parcel.writeString(changelogtype)
+        parcel.writeString(curvalue)
+        parcel.writeString(diffvalue)
+        parcel.writeString(enddate)
+        parcel.writeString(logdatetime)
+        parcel.writeString(logid)
+        parcel.writeString(middlegoodscode)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(middlegoodsname)
+        parcel.writeString(paramaftervalue)
+        parcel.writeString(parambeforevalue)
+        parcel.writeString(tradedate)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AreaExpourseParamChLogDetailData> {
+        override fun createFromParcel(parcel: Parcel): AreaExpourseParamChLogDetailData {
+            return AreaExpourseParamChLogDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AreaExpourseParamChLogDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -203,7 +203,11 @@ data class ContractData(
     @SerializedName("currencyname")
     val currencyname : String? = "",//币种名称
     @SerializedName("tradeusername")
-    val tradeusername : String? = ""//交易员名称
+    val tradeusername : String? = "",//交易员名称
+    @SerializedName("merusername")
+    val merusername : String? = "",//跟单员名称
+    @SerializedName("saleusername")
+    val saleusername : String? = ""//业务员名称
 ) : Parcelable {
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -281,6 +285,8 @@ data class ContractData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -362,6 +368,8 @@ data class ContractData(
         parcel.writeString(currencyid)
         parcel.writeString(currencyname)
         parcel.writeString(tradeusername)
+        parcel.writeString(merusername)
+        parcel.writeString(saleusername)
     }
 
     override fun describeContents(): Int {

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

@@ -0,0 +1,57 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 企业风管期货主力、次主力商品信息
+ */
+data class ErmcpGoodsSortByPositionData(
+    @SerializedName("goodscode")
+    val goodscode : String? = "",//合约代码 - 易盛接口:合约代码=品种代码+合约代码
+    @SerializedName("goodsgroupcode")
+    val goodsgroupcode : String? = "",//品种代码
+    @SerializedName("prepositionqty")
+    val prepositionqty : String? = "",//昨持仓量
+    @SerializedName("sortindex")
+    val sortindex : String? = "",//排序
+    @SerializedName("tradedate")
+    val tradedate : String? = "",//交易日
+    @SerializedName("updatetime")
+    val updatetime : String? = ""//更新时间
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsgroupcode)
+        parcel.writeString(prepositionqty)
+        parcel.writeString(sortindex)
+        parcel.writeString(tradedate)
+        parcel.writeString(updatetime)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ErmcpGoodsSortByPositionData> {
+        override fun createFromParcel(parcel: Parcel): ErmcpGoodsSortByPositionData {
+            return ErmcpGoodsSortByPositionData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ErmcpGoodsSortByPositionData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 5 - 3
RMA/app/src/main/java/cn/muchinfo/rma/global/data/chart/ChartTSData.kt

@@ -21,13 +21,15 @@ data class ChartTSData(
      * 获取用于分时图的收盘价列表
      */
     fun getTimeChartPriceData() : List<Double> {
-        return if(historyDatas != null && historyDatas.isNotEmpty()){
+        val returnPrice = if(historyDatas != null && historyDatas.isNotEmpty()){
             historyDatas.map {
                 it.c!!.toDouble()
             }
         }else{
             arrayListOf();
-        }
+        }.toArrayList()
+//        returnPrice.add(4000.0)
+        return returnPrice
     }
 
     /**
@@ -41,7 +43,7 @@ data class ChartTSData(
         }else{
             arrayListOf()
         }.toArrayList()
-        returnTime.add(endTime?.toShowTime2() ?: "")
+//        returnTime.add(endTime?.toShowTime2() ?: "")
         return returnTime
     }
 

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

@@ -11,8 +11,8 @@ object Constant {
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //        const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"//李倩千海金 18611112222
-//    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩千海金 18611112222
-      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
+    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩千海金 18611112222
+//      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
 //          const val baseurl = "http://192.168.31.107:8080/cfg?key=test_107"// 瑶姐 千海金 13760119855
 //    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"
@@ -224,6 +224,12 @@ object Constant {
     /** 报表-库存报表-(仓库维度)_周月报表明细 **/
     const val table_mobile_report_warehousestock_weekmonthdetail = "table_mobile_report_warehousestock_weekmonthdetail"
 
+    /** 报表-敞口报表-参数调整变动量明细-日报表 */
+    const val table_mobile_report_expose_adjust_day = "table_mobile_report_expose_adjust_day"
+
+    /** 报表-敞口报表-参数调整变动量明细-周月报表 **/
+    const val table_mobile_report_expose_adjust_weekmonth = "table_mobile_report_expose_adjust_weekmonth"
+
     //-----------------------------------------期货报表----------------------------
     /** 敞口-期货变动量明细——日报表 ***/
     const val table_mobile_report_expose_futures_day = "table_mobile_report_expose_futures_day"

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/chart/old/timeCharts/TimeChartView.java

@@ -116,7 +116,7 @@ public class TimeChartView extends FrameLayout {
                 timeChartData.getDecimalPlace());
         lineChart.setDecimalNum(Integer.parseInt(timeChartData.getDecimalPlace()));
         lineChart.setLineData(lines);
-        lineChart.setDatasNum(timeChartData.getHistoryDatas().size());
+        lineChart.setDatasNum((timeChartData.getHistoryDatas().size()));
 
         lineChart.setNotifyAxisMarginLeft(GridChart.DEFAULT_AXIS_MARGIN_LEFT);
         lineChart.setStartIndex(-1);

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

@@ -235,7 +235,7 @@ class FutureFragment : BaseFragment<FutureViewModel>() {
     fun getHeadView(): View? {
         val headView = LayoutInflater.from(context).inflate(R.layout.future_head_view, null, false)
         idAccountInfo = headView?.findViewById(R.id.id_account_info)
-
+        idAccountInfo?.text = ""
         headView.setOnClickListener {
             (context as AppCompatActivity).creatSelectAccountDialog {
                 EventBus.getDefault()

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

@@ -22,6 +22,10 @@ class FutureViewModel : BaseViewModel() {
     }
 
     fun getAccountInfo(accountInfo: AccountData?): String {
-        return accountInfo?.accountname + "(" + accountInfo?.accountid + ")"
+        if (accountInfo?.accountname.isNullOrEmpty()){
+            return ""
+        }else{
+            return accountInfo?.accountname + "(" + accountInfo?.accountid + ")"
+        }
     }
 }

+ 44 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/costs/CostInfoFragment.kt

@@ -140,7 +140,12 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
 
                             textView {
                                 userAccountData.bindOptional(context){
-                                    text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.rightsAndInterests?.toString()),2)
+                                    if (it?.rightsAndInterests == 0.0){
+                                        text = "0"
+                                    }else{
+                                        text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.rightsAndInterests?.toString()),2)
+                                    }
+
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
@@ -164,7 +169,11 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
 
                             textView {
                                 userAccountData.bindOptional(context){
-                                    text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.canUserAmount?.toString()),2)
+                                    if (it?.canUserAmount == 0.0){
+                                        text = "0"
+                                    }else{
+                                        text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.canUserAmount?.toString()),2)
+                                    }
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
@@ -189,7 +198,12 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
                             textView {
                                 /** 直接去占用保证金 **/
                                 userAccountData.bindOptional(context){
-                                    text = NumberUtils.roundNum(it?.usedmargin.toString(),2)
+                                    if (it?.usedmargin == null){
+                                        text = "0"
+                                    }else{
+                                        text = NumberUtils.roundNum(it?.usedmargin.toString(),2)
+                                    }
+
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
@@ -214,7 +228,11 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
 
                             textView {
                                 userAccountData.bindOptional(context){
-                                    text = it?.freezemargin?.plus(it.freezecharge ?: 0.0)?.plus(it.outamountfreeze ?:0.0).toString()
+                                    if (it?.freezecharge == null){
+                                        text = "0"
+                                    }else{
+                                        text = it?.freezemargin?.plus(it.freezecharge ?: 0.0)?.plus(it.outamountfreeze ?:0.0).toString()
+                                    }
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
@@ -239,7 +257,11 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
 
                             textView {
                                  userAccountData.bindOptional(context){
-                                    text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.close_watch_profit_and_loss?.toString()),2)
+                                     if (it?.close_watch_profit_and_loss == 0.0){
+                                         text = "0"
+                                     }else{
+                                         text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.close_watch_profit_and_loss?.toString()),2)
+                                     }
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
@@ -263,7 +285,12 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
 
                             textView {
                                 profitAndLoss.bindOptional(context){
-                                    text = it?.toString()
+                                    if (it == 0.0){
+                                        text = "0"
+                                    }else{
+                                        text = it?.toString()
+                                    }
+
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
@@ -287,7 +314,12 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
 
                             textView {
                                 userAccountData.bindOptional(context){
-                                    text = it?.inamount.toString()
+                                    if (it?.inamount == null){
+                                        text = "0"
+                                    }else{
+                                        text = it?.inamount.toString()
+                                    }
+
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
@@ -311,7 +343,11 @@ class CostInfoFragment(type: String?) : BaseFragment<CostViewModel>() {
 
                             textView {
                                 userAccountData.bindOptional(context){
-                                    text = it?.outamount.toString()
+                                    if (it?.outamount == null){
+                                        text = "0"
+                                    }else{
+                                        text = it?.outamount.toString()
+                                    }
                                 }
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33

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

@@ -502,7 +502,7 @@ class HoldViewModel : BaseViewModel() {
 //            params["marketID"] = marketID!!
 //        }
         MyApplication.getInstance()?.futureManager?.queryErmcpTradePosition(params) { isSuccess, respData, _ ->
-            if (isSuccess && !respData!!.isNullOrEmpty()) {
+            if (isSuccess) {
                 list = respData as ArrayList<FutureHoldData>
                 holdLiveData.value = list
             } else {

+ 18 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarket.kt

@@ -11,9 +11,11 @@ import androidx.fragment.app.FragmentPagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.ErmcpGoodsSortByPositionData
 import cn.muchinfo.rma.global.data.account.loginQeruy.ExternalExchanges
 import cn.muchinfo.rma.global.database.AppDatabase
 import cn.muchinfo.rma.global.room.Builder
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.base.BaseFragment
@@ -44,13 +46,23 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
     private val tabFragments : ArrayList<Fragment> = arrayListOf()
 //endregion
 
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        viewModel.getErmcpGoodsSortByPosition()
+        viewModel.ermcpGoodsSortByPositionDataList.bindOptional(context!!){
+            initViews(it ?: arrayListOf())
+        }
+    }
+
     override fun onCreateView(
         inflater: LayoutInflater,
         container: ViewGroup?,
         savedInstanceState: Bundle?
     ): View? {
         _view = inflater.inflate(R.layout.future_market, container, false)
-        initViews()
+        if (viewModel.ermcpGoodsSortByPositionDataList.value.isNullOrEmpty().not()){
+            initViews(viewModel.ermcpGoodsSortByPositionDataList?.value ?: arrayListOf())
+        }
         return _view
     }
 
@@ -58,7 +70,7 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
 
     }
 
-    private fun initViews() {
+    private fun initViews(list : List<ErmcpGoodsSortByPositionData>) {
         idFutureTab = _view?.findViewById(R.id.id_future_tab)
         idMarketPager = _view?.findViewById(R.id.id_market_pager)
         // 设置
@@ -66,6 +78,10 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
 
         idFutureTab?.addTab(builder?.setText("自选")?.build(context))
         tabFragments.add(MarketFragment.getInstance(ExternalExchanges(autoid = -1,exexchangename = "自选")))
+        if (list.isNotEmpty()){
+            idFutureTab?.addTab(builder?.setText("主力")?.build(context))
+            tabFragments.add(MarketFragment.getInstance(ExternalExchanges(autoid = -2,exexchangename = "主力")))
+        }
         // 加载数据
         tabsData?.forEach {data ->
             val goodsgroupid = GlobalDataCollection.instance?.loginQueryData?.goodsgroups?.find {

+ 24 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarketModel.kt

@@ -1,7 +1,31 @@
 package cn.muchinfo.rma.view.base.future.markets
 
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.ErmcpGoodsSortByPositionData
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.base.BaseViewModel
 
 class FutureMarketModel : BaseViewModel(){
 
+    /**
+     * 主力次主力合约
+     */
+    val ermcpGoodsSortByPositionDataList : MutableLiveData<List<ErmcpGoodsSortByPositionData>> = MutableLiveData()
+
+    fun getErmcpGoodsSortByPosition(){
+        val params = mutableMapOf<String,String>().apply {
+            put("sortIndex","1")
+        }
+        MyApplication.getInstance()?.futureManager?.getErmcpGoodsSortByPosition(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                GlobalDataCollection.instance?.ermcpGoodsSortByPositionDataArrayList = respData?.toArrayList()
+                ermcpGoodsSortByPositionDataList.postValue(respData)
+            }else{
+                ermcpGoodsSortByPositionDataList.postValue(arrayListOf())
+            }
+        }
+    }
+
 }

+ 22 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/MarketFragment.kt

@@ -132,7 +132,28 @@ class MarketFragment(data: ExternalExchanges) : BaseFragment<MarketBaseModel>()
         idMarketList = _view?.findViewById(R.id.id_market_list)
         val list = arrayListOf<GoodsInfo>()
 
-        if (data?.autoid != -1){
+        if (data?.autoid == -1){//为自选
+
+            val goodsIdList = GlobalDataCollection.instance?.goodsIdList
+            val allList = DataBase.getInstance().goodsInfoDao().all
+            goodsIdList?.forEach { data ->
+                allList.forEach {
+                    if (data == it.goodsid.toString()  && it.goodsstatus == 3){
+                        list.add(it)
+                    }
+                }
+            }
+
+        }else if (data?.autoid == -2){//主力合约
+            val ermcpGoodsSortByPositionDataList = GlobalDataCollection.instance?.ermcpGoodsSortByPositionDataArrayList
+            val allGoodsInfoList = DataBase.getInstance().goodsInfoDao().all
+            ermcpGoodsSortByPositionDataList?.forEach {data ->
+                val goodsInfo = allGoodsInfoList.find { data.goodscode == it.goodscode }
+                if (goodsInfo?.goodsname.isNullOrEmpty().not()){
+                    list.add(goodsInfo!!)
+                }
+            }
+        }else{
             /**
              * 通过autoid和exexchangeid匹配找到交易所下的goodsgroup
              */
@@ -151,16 +172,6 @@ class MarketFragment(data: ExternalExchanges) : BaseFragment<MarketBaseModel>()
                     }
                 }
             }
-        }else{//为自选
-            val goodsIdList = GlobalDataCollection.instance?.goodsIdList
-            val allList = DataBase.getInstance().goodsInfoDao().all
-                goodsIdList?.forEach { data ->
-                    allList.forEach {
-                        if (data == it.goodsid.toString()  && it.goodsstatus == 3){
-                            list.add(it)
-                        }
-                    }
-                }
         }
 
 

+ 3 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeActivity.kt

@@ -1053,6 +1053,9 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                 override fun onTabReselected(index: Int) {}
                                 override fun onTabUnselected(index: Int) {}
                                 override fun onTabSelected(index: Int) {
+                                    if (index == 0){
+
+                                    }
                                     selectedTabIndex = index
                                 }
                             })

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

@@ -210,13 +210,13 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
                 midpointsPeriodTime.postValue(data.startdate + "~" + data.enddate)
             }
             if (data.saleuserid != "0"){
-                selectSalesman.postValue(SelectData(id = data.saleuserid.toString(),value = data.saleuserlogincode.toString()))
+                selectSalesman.postValue(SelectData(id = data.saleuserid.toString(),value = data.saleusername.toString()))
             }
             if (data.tradeuserid != "0"){
                 selectTradingData.postValue(SelectData(id = data.tradeuserid.toString(),value = data.tradeusername.toString()))
             }
             if (data.meruserid != "0"){
-                selectMerchandiser.postValue(SelectData(id = data.meruserid.toString(),value = data.meruserlogincode.toString()))
+                selectMerchandiser.postValue(SelectData(id = data.meruserid.toString(),value = data.merusername.toString()))
             }
             selectGoodsList.postValue(SelectData(id = data.goodsid.toString(),value = data.goodsname.toString()))
 

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

@@ -476,10 +476,14 @@ class ContractViewModel : BaseViewModel() {
      * @return ArrayList<SelectData>
      */
     fun setSelectGoodsList(): ArrayList<SelectData> {
-        val goodsList = DataBase.getInstance().goodsInfoDao().all
+        val goodsList = deliveryGoodsDetailsData.value?.mgList
         val newCustomerList = arrayListOf<SelectData>()
-        goodsList.forEach {
-            newCustomerList.add(SelectData(id = it.goodsid.toString(), value = it.goodsname))
+        goodsList?.forEach {
+            it.gplist?.forEach { data ->
+                data.glist?.forEach { res ->
+                    newCustomerList.add(SelectData(id = res.goodsid.toString(), value = res.goodsname ?: ""))
+                }
+            }
         }
         return newCustomerList
     }

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

@@ -398,7 +398,7 @@ class InvoiceRegistrationActivity : BaseActivity<RegistrationViewModel>() {
                                     linearLayout {
                                         emptyView()
                                         textView {
-                                            text = data.invoiceamount?.toDouble()?.minus(data.totalamount?.toDouble() ?: 0.0).toString()
+                                            text = data.preinvoiceamount
                                             textSizeAuto = 29
                                             textColorInt = R.color.rma_black_33
                                         }.lparams(wrapContent, wrapContent)

+ 19 - 9
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/ExposureReportContentAdapter.java

@@ -201,15 +201,25 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
         });
         //参数调整明细
         itemViewHolder.midpoints_registration.setOnClickListener(view -> {
-//            Intent intent = new Intent();
-//            intent.putExtra("title","参数调整明细");
-//            intent.putExtra("time",this.time);
-//            intent.putExtra("transaction",this.transaction);
-//            intent.putExtra("tabtitle",this.tabtitle);
-//            intent.putExtra("timeType",this.timeType);
-//            intent.putExtra("transactionUserid",this.transactionUserid);
-//            intent.setClass(context, ReportCommonDetailsActivity.class);
-//            ActivityUtils.startActivity(intent);
+            Intent intent = new Intent();
+            intent.putExtra("title","参数调整明细");
+            intent.putExtra("transaction",this.transaction);
+            if (data.getCycletype().equals("0")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_expose_adjust_day);
+                intent.putExtra("time",data.getReckondate());
+            }else {
+                intent.putExtra("tabtitle",Constant.table_mobile_report_expose_adjust_weekmonth);
+                intent.putExtra("time",data.getBegindate() + "~" + data.getEnddate());
+            }
+            intent.putExtra("FutureDataReportData",new FutureDataReportData());
+            intent.putExtra("AreaStockReportData",new AreaStockReportData());
+            intent.putExtra("AreaSumPLData",new AreaSumPLData());
+            intent.putExtra("AreaSpotplReportData",new AreaSpotplReportData());
+            intent.putExtra("ExposureReportData",data);
+            intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.putExtra("FinanceReportData",new FinanceReportData());
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
         });
         //期货明细
         itemViewHolder.settlement_of_registration.setOnClickListener(view -> {

+ 65 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsViewModel.kt

@@ -401,7 +401,72 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
                     exposureReportDataList.postValue(resettable_mobile_report_expose_futures_weekmonth(respData ?: arrayListOf()))
                 }
             }
+        }else if (tabName == Constant.table_mobile_report_expose_adjust_day){//报表-敞口报表-参数调整变动量明细-日报表
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("middlegoodsid", exposureReportData.middlegoodsid ?: "")
+                put("cycletype",exposureReportData.cycletype ?: "")
+                if (exposureReportData.cycletype == "0"){
+                    put("cycletime",exposureReportData.reckondate ?: "")
+                }else{
+                    put("cycletime",exposureReportData.cycletime ?: "")
+                }
+            }
+            MyApplication.getInstance()?.reportManager?.qryAreaExpourseParamChLogDetail(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resettable_mobile_report_expose_adjust_day(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_expose_adjust_weekmonth){//报表-敞口报表-参数调整变动量明细-周月报表
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("middlegoodsid", exposureReportData.middlegoodsid ?: "")
+                put("cycletype",exposureReportData.cycletype ?: "")
+                if (exposureReportData.cycletype == "0"){
+                    put("cycletime",exposureReportData.reckondate ?: "")
+                }else{
+                    put("cycletime",exposureReportData.cycletime ?: "")
+                }
+            }
+            MyApplication.getInstance()?.reportManager?.qryAreaExpourseParamChLogDetail(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resettable_mobile_report_expose_adjust_weekmonth(respData ?: arrayListOf()))
+                }
+            }
+        }
+    }
+
+    //报表-敞口报表-参数调整变动量明细-周月报表
+    fun resettable_mobile_report_expose_adjust_weekmonth(dataList : List<AreaExpourseParamChLogDetailData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.tradedate ?: ""//日期
+            newRightData.add(it.middlegoodsname ?: "" + "\n" + if (it.changelogtype == "1"){"套保比率变更"}else{"套利比率变更"})//'套保品种/\n 参数类型 '
+            newRightData.add(it.parambeforevalue + "\n" +it.paramaftervalue) //'调整前参数值/\n 调整后参数值 '
+            newRightData.add(it.curvalue + "\n" + it.diffvalue)//'套保总量/\n 应套保总量变化量 '
+            newRightData.add(it.beforevalue + "\n" + it.aftervalue)//'调整前应套保总量/\n 调整后应套保总量 '
+            data.rightData = newRightData
+            newList.add(data)
         }
+        return newList
+    }
+
+    //-敞口报表-参数调整变动量明细-日报表
+    fun resettable_mobile_report_expose_adjust_day(dataList : List<AreaExpourseParamChLogDetailData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.middlegoodsname ?: "" + "\n" + if (it.changelogtype == "1"){"套保比率变更"}else{"套利比率变更"}//'套保品种/\n 参数类型 '
+            newRightData.add(it.parambeforevalue + "\n" +it.paramaftervalue) //'调整前参数值/\n 调整后参数值 '
+            newRightData.add(it.curvalue + "\n" + it.diffvalue)//'套保总量/\n 应套保总量变化量 '
+            newRightData.add(it.beforevalue + "\n" + it.aftervalue)//'调整前应套保总量/\n 调整后应套保总量 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
     }
 
     //敞口-期货变动量明细-月周报表

+ 35 - 13
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/NoPayDetailsActivity.kt

@@ -290,29 +290,51 @@ class NoPayDetailsActivity : BaseActivity<PayViewModel>(){
                 }
 
                 inflateLayout<CountdownView>(R.layout.view_countdowntime) {
+                    if (data.payflag == "1"){
+                        visibility = View.VISIBLE
+                    }else{
+                        visibility = View.GONE
+                    }
                     viewModel.systemTime.bindOptional(context) {
-                        val paylimitedtime = com.blankj.utilcode.util.TimeUtils.date2Millis(
-                            TimeUtils.stringToDate(
-                                data.paylimitedtime,
-                                "yyyy-MM-dd HH:mm:ss"
+                        if (data.payflag == "1"){
+                            val paylimitedtime = com.blankj.utilcode.util.TimeUtils.date2Millis(
+                                TimeUtils.stringToDate(
+                                    data.paylimitedtime,
+                                    "yyyy-MM-dd HH:mm:ss"
+                                )
                             )
-                        )
-                        val nowTime = com.blankj.utilcode.util.TimeUtils.date2Millis(
-                            TimeUtils.stringToDate(
-                                it,
-                                "yyyy-MM-dd HH:mm:ss"
+                            val nowTime = com.blankj.utilcode.util.TimeUtils.date2Millis(
+                                TimeUtils.stringToDate(
+                                    it,
+                                    "yyyy-MM-dd HH:mm:ss"
+                                )
                             )
-                        )
-                        if (paylimitedtime.minus(nowTime) < 0){
-                            remaining_time.visibility = View.GONE
+                            if (paylimitedtime.minus(nowTime) < 0){
+                                remaining_time.visibility = View.GONE
+                            }
+                            start( paylimitedtime - nowTime)
                         }
-                        start( paylimitedtime - nowTime)
                     }
                 }.lparams(wrapContent, wrapContent) {
                     marginEnd = autoSize(36)
                     topMargin = autoSize(10)
                 }
 
+                textView {
+                    if (data.payflag == "1"){
+                        visibility = View.GONE
+                    }else{
+                        visibility = View.VISIBLE
+                    }
+                    gravity = Gravity.LEFT
+                    text = "-"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginEnd = autoSize(36)
+                    topMargin = autoSize(10)
+                }
+
             }.lparams(matchParent, autoSize(75))
         }
     }

+ 1 - 0
RMA/app/src/main/res/layout/future_head_view.xml

@@ -15,6 +15,7 @@
         app:layout_constraintTop_toTopOf="parent" />
 
     <ImageView
+        android:visibility="gone"
         android:id="@+id/imageView"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"

+ 2 - 1
RMA/app/src/main/res/layout/layout_item_inventory_current.xml

@@ -18,10 +18,11 @@
             <LinearLayout
                 android:gravity="center_vertical"
                 android:orientation="vertical"
-                android:layout_width="130dp"
+                android:layout_width="110dp"
                 android:layout_height="match_parent">
 
                 <TextView
+
                     android:layout_marginStart="7dp"
                     android:id="@+id/tv_left_title"
                     android:layout_width="wrap_content"