Explorar o código

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

Liu.bolan %!s(int64=4) %!d(string=hai) anos
pai
achega
d94ec238ab

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

@@ -1,6 +1,7 @@
 package cn.muchinfo.rma.business.bank
 
 import cn.muchinfo.rma.global.data.BankAccountSignData
+import cn.muchinfo.rma.global.data.BankInfoData
 import cn.muchinfo.rma.global.data.CusBankSignBankData
 import cn.muchinfo.rma.global.data.GoodsPickupData
 import cn.muchinfo.rma.netManage.base.ResponseCallback
@@ -15,6 +16,32 @@ import java.lang.Exception
 class BankManager {
 
     /**
+     * 查询开户行
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryBankInfo(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<BankInfoData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Qhj/QueryBankInfo",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<BankInfoData>>>() {
+                override fun onResponse(response: BaseResult<List<BankInfoData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+    /**
      * 查询托管银行
      * @param params Map<String, String>
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>

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

@@ -63,6 +63,32 @@ class CommonManager {
         )
     }
 
+    //SiteColumnDetailData
+    /**
+     * 查询资讯 - 千海金
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<NoticeData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun querySiteColumnDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<SiteColumnDetailData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Qhj/QuerySiteColumnDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<SiteColumnDetailData>>>(){
+                override fun onResponse(response: BaseResult<List<SiteColumnDetailData>>?, 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>

+ 60 - 3
RMA/app/src/main/java/cn/muchinfo/rma/business/contractgoods/ContractGoodsManager.kt

@@ -1,9 +1,7 @@
 package cn.muchinfo.rma.business.contractgoods
 
 import cn.muchinfo.rma.global.GlobalDataCollection
-import cn.muchinfo.rma.global.data.ContractHisTradeDetailData
-import cn.muchinfo.rma.global.data.ContractTradeDetailData
-import cn.muchinfo.rma.global.data.ContractTradeOrderDetailData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.data.futureOrders.FutureEntrustData
 import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
@@ -19,6 +17,65 @@ import java.util.ArrayList
  */
 class ContractGoodsManager {
 
+
+    /**
+     * 查询待付款单据
+     * @param params Map<String, String> accountID/资金账户ID startDate/ 开始时间 - 闭区间,格式:yyyy-MM-dd endDate / 结束时间 - 闭区间,格式:yyyy-MM-dd
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FutureDetailsData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryPayOrder(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<PayOrderData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Qhj/QueryPayOrder",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<PayOrderData>>>() {
+                override fun onResponse(response: BaseResult<List<PayOrderData>>?, id: Int) {
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
+                    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> accountID/资金账户ID startDate/ 开始时间 - 闭区间,格式:yyyy-MM-dd endDate / 结束时间 - 闭区间,格式:yyyy-MM-dd
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FutureDetailsData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryContract(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<QhjContractDetailsData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Qhj/QueryContract",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<QhjContractDetailsData>>>() {
+                override fun onResponse(response: BaseResult<List<QhjContractDetailsData>>?, id: Int) {
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
+                    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> accountID/资金账户ID startDate/ 开始时间 - 闭区间,格式:yyyy-MM-dd endDate / 结束时间 - 闭区间,格式:yyyy-MM-dd

+ 34 - 8
RMA/app/src/main/java/cn/muchinfo/rma/business/money/MoneyManager.kt

@@ -23,14 +23,14 @@ class MoneyManager {
 
     /**
      *
-     * @param regularlyStrategyID Long
-     * @param goodsID Long
-     * @param regularlyCycle Int
-     * @param regularlyCycleValue Int
-     * @param regularlyMode Int
-     * @param regularlyModeValue Double
-     * @param remark String
-     * @param operateType Int
+     * @param regularlyStrategyID Long 定投策略ID
+     * @param goodsID Long 定投商品ID
+     * @param regularlyCycle Int 定投频率 - 1:每周 2:每月
+     * @param regularlyCycleValue Int 定投频率值 - 每周几(0-6)  或 每月几号(<=28)
+     * @param regularlyMode Int 定投方式 - 1:按数量 2:按金额
+     * @param regularlyModeValue Double  定投方式值 - 数量或金额
+     * @param remark String 备注
+     * @param operateType Int 操作类型:1:新增,2:修改,3:暂停,4:恢复,5:关闭
      * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
      */
     fun requestQhjRegularlyStrategyReq(
@@ -70,6 +70,32 @@ class MoneyManager {
         )
     }
 
+    /**
+     * 查询定投价(结算价)
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryReckonPriceLog(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ReckonPriceLogData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Qhj/QueryReckonPriceLog",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ReckonPriceLogData>>>() {
+                override fun onResponse(response: BaseResult<List<ReckonPriceLogData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
 
     /**
      * 查询提现账户设置

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

@@ -0,0 +1,47 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 开户行实体
+ */
+data class BankInfoData(
+    val bankid : String? = "",//银行ID
+    val bankname : String? = "",//银行名称
+    val clearbankno : String? = "",//清算系统银行编号
+    val orderindex : String? = "",//排序顺序
+    val status : String? = ""//状态 - 0:正常 1:注销
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(bankid)
+        parcel.writeString(bankname)
+        parcel.writeString(clearbankno)
+        parcel.writeString(orderindex)
+        parcel.writeString(status)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<BankInfoData> {
+        override fun createFromParcel(parcel: Parcel): BankInfoData {
+            return BankInfoData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<BankInfoData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,95 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 待付款
+ */
+data class PayOrderData(
+    val buyaccountid : String? = "",//买方账号ID[报价币种]
+    val buyorderid : String? = "",//买方委托单号
+    val createtime : String? = "",//创建时间
+    val goodscode : String? = "",//商品代码
+    val goodsid : String? = "",//商品ID
+    val goodsname : String? = "",//商品名称
+    val marketid : String? = "",//市场ID
+    val offamount : String? = "",//优惠金额
+    val operatetype : String? = "",//买委托操作类型 - 1:正常下单 16:融资买入
+    val payamount : String? = "",//支付金额=TradeAmount + TradeCharge
+    val payflag : String? = "",//付款标识 - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止
+    val paylimitedtime : String? = "",//支付期限
+    val paytime : String? = "",//付款时间
+    val sellaccountid : String? = "",//卖方账号ID[报价币种]
+    val sellorderid : String? = "",//卖方委托单号
+    val tradeamount : String? = "",//成交金额(优惠后金额)
+    val tradecharge : String? = "",//成交手续费(买方)
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    val tradeid : String? = "",//成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+    val tradeprice : String? = "",//成交价格
+    val tradeqty : String? = ""//成交数量
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(buyaccountid)
+        parcel.writeString(buyorderid)
+        parcel.writeString(createtime)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(marketid)
+        parcel.writeString(offamount)
+        parcel.writeString(operatetype)
+        parcel.writeString(payamount)
+        parcel.writeString(payflag)
+        parcel.writeString(paylimitedtime)
+        parcel.writeString(paytime)
+        parcel.writeString(sellaccountid)
+        parcel.writeString(sellorderid)
+        parcel.writeString(tradeamount)
+        parcel.writeString(tradecharge)
+        parcel.writeString(tradedate)
+        parcel.writeString(tradeid)
+        parcel.writeString(tradeprice)
+        parcel.writeString(tradeqty)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<PayOrderData> {
+        override fun createFromParcel(parcel: Parcel): PayOrderData {
+            return PayOrderData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<PayOrderData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,103 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 千海金融资明细
+ */
+data class QhjContractDetailsData(
+    val contractconfirmtime : String? = "",//合同确认时间(时间)
+    val enumdicname : String? = "",//单位名称
+    val goodscode : String? = "",//商品代码
+    val goodsid : String? = "",//商品ID [5:融资单]
+    val goodsname : String? = "",//商品名称
+    val goodunitid : String? = "",//商品单位id
+    val initmargin : String? = "",//初始保证金(首付款)
+    val lenderamount : String? = "",//贷款金额(总额|订单总额)
+    val marginratio : String? = "",//保证金比率(首付比例)
+    val payamount : String? = "",//已付(已付货款)
+    val recoveredmargin : String? = "",//已追缴保证金
+    val remainamount : String? = "",//合同剩余金额(融资额)//流水-剩余货款
+    val scfcontractid : String? = "",//SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)//流水-剩余货款
+    val scfcontracttype : String? = "",//合同类型 - 1:仓单回购 2:仓单质押 3:合作套保 4:资金贷款 5:融资单
+    val totalinterest : String? = "",//已计总利息(利息)
+    val tradeprice : String? = "",//成交价格(成本价格)
+    val userid : String? = "",//用户ID
+    val username : String? = "",//用户名称
+    val wrqty : String? = "",//仓单数量(数量)
+    //-----以下用于融资明细流水
+    val amount : String? = "",
+    val amounttype : String? = "",
+    val logid : String? = "",
+    val updatetime : String? = ""
+
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(contractconfirmtime)
+        parcel.writeString(enumdicname)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(goodunitid)
+        parcel.writeString(initmargin)
+        parcel.writeString(lenderamount)
+        parcel.writeString(marginratio)
+        parcel.writeString(payamount)
+        parcel.writeString(recoveredmargin)
+        parcel.writeString(remainamount)
+        parcel.writeString(scfcontractid)
+        parcel.writeString(scfcontracttype)
+        parcel.writeString(totalinterest)
+        parcel.writeString(tradeprice)
+        parcel.writeString(userid)
+        parcel.writeString(username)
+        parcel.writeString(wrqty)
+        parcel.writeString(amount)
+        parcel.writeString(amounttype)
+        parcel.writeString(logid)
+        parcel.writeString(updatetime)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<QhjContractDetailsData> {
+        override fun createFromParcel(parcel: Parcel): QhjContractDetailsData {
+            return QhjContractDetailsData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<QhjContractDetailsData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,77 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 定投价(结算价)
+ */
+data class ReckonPriceLogData(
+    val goodsid : String? = "",//商品ID
+    val lastreckonprice : String? = "",//上日结算价
+    val nextdnlimitprice : String? = "",//下个交易日跌停价
+    val nexttrade : String? = "",//下个交易日
+    val nextuplimitprice : String? = "",//下个交易日涨停价
+    val reckonprice : String? = "",//今日结算价(定投价)
+    val reckontime : String? = "",//结算时间
+    val totalholderqty : String? = "",//总持仓数
+    val totalstock : String? = "",//总库存
+    val tradedate : String? = "",//交易日
+    val updowncount : String? = "",//连续涨(跌)停天数 (涨跌停标志变为0时值归0,变成涨停或是跌停时值为1,连续涨停天数+1,连续跌停天数+1)
+    val updownflag : String? = "",//连续涨跌停标志 - 0:无涨跌停 -1:跌停 1:涨停
+    val updownrate : String? = "",//今日涨跌幅
+    val updownrate_2d : String? = "",//连续两日涨跌幅
+    val updownrate_3d : String? = ""//连续三日涨跌幅
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(goodsid)
+        parcel.writeString(lastreckonprice)
+        parcel.writeString(nextdnlimitprice)
+        parcel.writeString(nexttrade)
+        parcel.writeString(nextuplimitprice)
+        parcel.writeString(reckonprice)
+        parcel.writeString(reckontime)
+        parcel.writeString(totalholderqty)
+        parcel.writeString(totalstock)
+        parcel.writeString(tradedate)
+        parcel.writeString(updowncount)
+        parcel.writeString(updownflag)
+        parcel.writeString(updownrate)
+        parcel.writeString(updownrate_2d)
+        parcel.writeString(updownrate_3d)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ReckonPriceLogData> {
+        override fun createFromParcel(parcel: Parcel): ReckonPriceLogData {
+            return ReckonPriceLogData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ReckonPriceLogData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,86 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 千海金咨询
+ */
+data class SiteColumnDetailData(
+    val author : String? = "",//作者
+    val brief : String? = "",//简介
+    val columnid : String? = "",//所属栏目
+    val context : String? = "",//内容
+    val coverimage : String? = "",//封面图片
+    val creaedate : String? = "",//创建时间
+    val creatorid : String? = "",//创建人
+    val hits : String? = "",//点击数
+    val id : String? = "",//ID(SEQ_SITE_COLUMNDETAIL)
+    val isshow : String? = "",//是否展示 - 0:不展示 1:展示
+    val istop : String? = "",//是否置顶 - 0:不置 1:置顶
+    val modifierid : String? = "",//操作人
+    val publishdate : String? = "",//发布日期
+    val status : String? = "",//状态 - 1:暂存 10:待审核 20:审核通过 30:审核拒绝
+    val title : String? = "",//标题
+    val updatedate : String? = "",//修改时间
+    val userid : String? = "",//用户ID(默认为0, 核心为为机构用户ID)
+    val username : String? = ""//用户名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(author)
+        parcel.writeString(brief)
+        parcel.writeString(columnid)
+        parcel.writeString(context)
+        parcel.writeString(coverimage)
+        parcel.writeString(creaedate)
+        parcel.writeString(creatorid)
+        parcel.writeString(hits)
+        parcel.writeString(id)
+        parcel.writeString(isshow)
+        parcel.writeString(istop)
+        parcel.writeString(modifierid)
+        parcel.writeString(publishdate)
+        parcel.writeString(status)
+        parcel.writeString(title)
+        parcel.writeString(updatedate)
+        parcel.writeString(userid)
+        parcel.writeString(username)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<SiteColumnDetailData> {
+        override fun createFromParcel(parcel: Parcel): SiteColumnDetailData {
+            return SiteColumnDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<SiteColumnDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -10,12 +10,12 @@ object Constant {
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
-      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
+//      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
 //    const val baseurl = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
 
-//     const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
+     const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
 
     /**
      * 用sp存储基础url的key
@@ -263,5 +263,5 @@ object Constant {
     const val SUCCESS_ADD_CUSTOMER = "SUCCESS_ADD_CUSTOMER"
 
     //是否是千海金
-    const val IS_QHJ = false
+    const val IS_QHJ = true
 }

+ 22 - 9
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/AddCastSurelyActivity.kt

@@ -43,10 +43,18 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
     val selectPayType : MutableLiveData<SelectData> = MutableLiveData()
 
     /**
+     * selectTime选择的定投时间策略 id = 1 是周 ID= 2 是月
+     */
+    val selectTime : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
      * 选择的商品信息
      */
     val selectGoodsInfoData : MutableLiveData<GoodsInfo> = MutableLiveData()
 
+    //  1是新增 2是修改
+    val type by lazy { intent.getStringExtra("type") }
+
 
     fun initData(){
         viewModel.initCastSureData()
@@ -56,6 +64,7 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            initData()
             createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.rma_item_bg)
             topBar {
@@ -105,7 +114,9 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                             selectPayType.postValue(this)
                         }
                     }
-                    text = "按金额定投"
+                    selectPayType.bindOptional(context){
+                        text = it?.value
+                    }
                     textSizeAuto = 32
                     textColorInt = R.color.rma_gray_color
                 }.lparams(wrapContent, wrapContent) {
@@ -114,6 +125,13 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                 }
 
                 imageView {
+                    onThrottleFirstClick {
+                        val selectDataList = arrayListOf(SelectData(id = "1",value = "按克数定投"),
+                            SelectData(id = "2",value = "按金额定投"))
+                        creatBottomSheetDialog("请选择方式", selectDataList) {
+                            selectPayType.postValue(this)
+                        }
+                    }
                     imageResource = R.mipmap.qhj_trade_numberamout_select
                 }.lparams(autoSize(14), autoSize(14)) {
                     marginStart = autoSize(25)
@@ -174,20 +192,15 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                                 options1Items.get(options1).autoId
                             else
                                 ""
-
                             opt2tx =
                                 if (options2Items.size > 0 && options2Items.get(options1).size > 0)
                                     options2Items.get(options1).get(options2)
                                 else
                                     ""
-//                        viewModule.selectNewPriceName.value = options2Items.get(options1).get(options2)
-
-                            val tx = opt1tx + opt2tx
-                            ToastUtils.showLong(tx)
-//                        viewModule.getPreGoodsByCityList(viewModule.getmarketId("2"),opt1tx ?: "",opt2tx ?: "")
+                            selectTime.postValue(SelectData(id = opt1tx ?: "",value = opt2tx ?: ""))
+                            ToastUtils.showLong( opt1tx + "----" +  opt2tx)
                         })
-
-                        .setTitleText("城市选择")
+                        .setTitleText("定投策略选择")
                         .setDividerColor(Color.BLACK)
                         .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
                         .setContentTextSize(20)

+ 99 - 32
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/CastSurelyDetailsActivity.kt

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.main.castsurely
 
+import android.annotation.SuppressLint
 import android.content.Intent
 import android.graphics.Typeface
 import android.os.Bundle
@@ -7,10 +8,16 @@ import android.view.Gravity
 import android.view.View
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.MTPEnums
+import cn.muchinfo.rma.global.data.RSTriggerLogData
+import cn.muchinfo.rma.global.data.RStrategyData
+import cn.muchinfo.rma.global.database.DataBase
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.dialog.SelectData
 import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
@@ -26,10 +33,13 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
+    //定投记录
+    private val data by lazy { intent.getParcelableExtra<RStrategyData>("RStrategyData") as RStrategyData }
+
     /**
      * 定投列表适配器
      */
-    private val myCastSurelyAdapter: BaseAdapter<String, CastSurelyDetailsViewHolder> =
+    private val myCastSurelyAdapter: BaseAdapter<RSTriggerLogData, CastSurelyDetailsViewHolder> =
         BaseAdapter { _, _ ->
             CastSurelyDetailsViewHolder(
                 this,
@@ -37,9 +47,11 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
             )
         }
 
+    @SuppressLint("SetTextI18n")
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            viewModel.queryRSTriggerLog(data.regularlystrategyid ?: "")
             background = resources.getDrawable(R.color.main_title_bg_color)
             //页面标题
             topBar {
@@ -47,28 +59,57 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                 commonTitle {
                     text = "定投详情"
                 }
-                // 新增市价录入
-                commonMenuButton(R.mipmap.qhj_dian_dian) {
-                    val selectDataList = arrayListOf(
-                        SelectData(
-                            id = "1",
-                            value = "修改"
-                        ),
-                        SelectData(
-                            id = "2",
-                            value = "暂停"
-                        ),
-                        SelectData(
-                            id = "3",
-                            value = "终止"
-                        ),
-                        SelectData(
-                            id = "4",
-                            value = "取消"
+                if (data.regularlystrategystatus != "3"){
+                    // 新增市价录入
+                    commonMenuButton(R.mipmap.qhj_dian_dian) {
+                        val selectDataList = arrayListOf<SelectData>()
+                        if (data.regularlystrategystatus == "1"){//策略状态 - 1:正常 2:暂停 3:终止
+                            selectDataList.add(
+                                SelectData(
+                                    id = "1",
+                                    value = "修改"
+                                )
+                            )
+                            selectDataList.add(
+                                SelectData(
+                                    id = "2",
+                                    value = "暂停"
+                                )
+                            )
+                            selectDataList.add(
+                                SelectData(
+                                    id = "3",
+                                    value = "终止"
+                                )
+                            )
+                        }else if (data.regularlystrategystatus == "2"){
+                            selectDataList.add(
+                                SelectData(
+                                    id = "5",
+                                    value = "恢复"
+                                )
+                            )
+                        }
+                        selectDataList.add(
+                            SelectData(
+                                id = "4",
+                                value = "取消"
+                            )
                         )
-                    )
-                    creatBottomSheetNoTitleDialog(selectDataList) {
+                        creatBottomSheetNoTitleDialog(selectDataList) {
+                            if (this.id == "1"){
+                                val intent = Intent()
+                                intent.putExtra("type","2")
+                                intent.setClass(context,AddCastSurelyActivity::class.java)
+                                ActivityUtils.startActivity(intent)
+                            } else if (this.id == "2"){//暂停
+
+                            }else if (this.id == "3"){//终止
 
+                            }else if (this.id == "5"){//恢复
+
+                            }
+                        }
                     }
                 }
             }
@@ -76,7 +117,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                 linearLayout {
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
-                        text = "黄金"
+                        text = data.goodsname
                         textSizeAuto = 43
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent){
@@ -86,6 +127,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                     emptyView()
 
                     imageView {
+                        visibility = View.GONE
                         imageResource = R.mipmap.rma_more
                     }.lparams(autoSize(30), autoSize(30)){
                         marginEnd = autoSize(36)
@@ -106,7 +148,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                         }
 
                         textView {
-                            text = "2300.23"
+                            text = NumberUtils.roundNum(data.triggertotalamount,2)
                             textColorInt = R.color.rma_black_33
                             textSizeAuto = 36
                             typeface = Typeface.defaultFromStyle(Typeface.BOLD)
@@ -118,7 +160,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                     verticalLayout {
                         gravity = Gravity.CENTER_HORIZONTAL
                         textView {
-                            text = "累计定投(克)"
+                            text =  "累计定投(" + data.enumdicname + ")"
                             textColorInt = R.color.qhj_hint_text_color
                             textSizeAuto = 29
                         }.lparams(wrapContent, wrapContent){
@@ -126,7 +168,8 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                         }
 
                         textView {
-                            text = "19g"
+                            val qtydecimalplace = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data?.goodsid?.toInt() ?: 0).qtydecimalplace
+                            text = NumberUtils.roundNum(data?.triggertotalqty?.toDouble()?.times(qtydecimalplace).toString(),qtydecimalplace)
                             textColorInt = R.color.rma_black_33
                             textSizeAuto = 36
                             typeface = Typeface.defaultFromStyle(Typeface.BOLD)
@@ -146,7 +189,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                         }
 
                         textView {
-                            text = "10期"
+                            text = data.triggersuccesstimes
                             textColorInt = R.color.rma_black_33
                             textSizeAuto = 36
                             typeface = Typeface.defaultFromStyle(Typeface.BOLD)
@@ -160,7 +203,18 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                     background = createRoundRectDrawable("#E5EFF5", 3)
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
-                        text = "定投计划:每月1日定投2g"
+                        val qtydecimalplace = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data.goodsid?.toInt() ?: 0).qtydecimalplace
+                        if (data.regularlystrategystatus == "1"){//1:正常 2:暂停 3:终止
+                            if (data.regularlymode == "1"){//按数量
+                                text = data.nexttriggerdate + "(" + data.regularlycyclevalue + ")将从余额扣款定投" + data.nexttriggerqty?.toDouble()?.times(qtydecimalplace) + data.enumdicname
+                            }else{//按金额
+                                text = data.nexttriggerdate + "(" + data.regularlycyclevalue + ")将从余额扣款定投" + NumberUtils.roundNum(data.nexttriggeramount,2)
+                            }
+                        }else if (data.regularlystrategystatus == "2"){
+                            text = "定投已暂停"
+                        }else if (data.regularlystrategystatus == "3"){
+                            text = "定投已终止"
+                        }
                         textColorInt = R.color.rma_zhushi_text_color
                         textSizeAuto = 31
                     }.lparams(wrapContent, wrapContent){
@@ -170,8 +224,11 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                     emptyView()
 
                     textView {
-//                        backgroundResource = R.drawable.qhj_transparent_bg
-//                    background = createRoundRectDrawable("#2794FF", 5)
+                        if (data.regularlystrategystatus == "1"){
+                            visibility = View.VISIBLE
+                        }else{
+                            visibility = View.GONE
+                        }
                         gravity = Gravity.CENTER
                         text = "进行中"
                         textColorInt = R.color.rma_blue_color
@@ -204,14 +261,14 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                 statusLayout = this
 //                bindTaskStatus(viewModule.status)
                 setRetryAction {
-
+                    viewModel.queryRSTriggerLog(data.regularlystrategyid ?: "")
                 }
                 swipeToLoadLayout {
                     swipeToLayout = this
                     setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
-
+                        viewModel.queryRSTriggerLog(data.regularlystrategyid ?: "")
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -226,7 +283,17 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            myCastSurelyAdapter.setNewData(arrayListOf("1","2","3","4","5"))
+            viewModel.castSurelyLogDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    myCastSurelyAdapter.setNewData(it)
+                }
+            }
 
         }
     }

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

@@ -3,6 +3,8 @@ package cn.muchinfo.rma.view.base.main.castsurely
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.RSTriggerLogData
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
@@ -10,14 +12,16 @@ import cn.muchinfo.rma.view.base.home.contract.emptyView
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
-class CastSurelyDetailsViewHolder(private val activity: AppCompatActivity,private val viewModel: MyCastSurelyViewModel) : BaseViewHolder<String>(activity){
+class CastSurelyDetailsViewHolder(private val activity: AppCompatActivity,private val viewModel: MyCastSurelyViewModel) : BaseViewHolder<RSTriggerLogData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     override fun _FrameLayout.createContentView() {
          linearLayout {
              gravity = Gravity.CENTER_VERTICAL
              textView {
-                 text = "2021-5-30  2g  (100元)"
+                 data.bindOptional(context){
+                     text = it?.triggertradedate + "   " + it?.triggerqty + it?.enumdicname + "(" + it?.triggeramount + ")"
+                 }
                  textSizeAuto = 31
                  textColorInt = R.color.text_hint_color_two
              }.lparams(wrapContent, wrapContent){
@@ -27,7 +31,13 @@ class CastSurelyDetailsViewHolder(private val activity: AppCompatActivity,privat
              emptyView()
 
              textView {
-                 text = "定投成功"
+                 data.bindOptional(context){
+                     if (it?.triggerstatus == "1"){
+                         text = "定投成功"
+                     }else{
+                         text = "定投失败"
+                     }
+                 }
                  textSizeAuto = 31
                  textColorInt = R.color.rma_black_33
              }.lparams(wrapContent, wrapContent){

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyActivity.kt

@@ -80,6 +80,7 @@ class MyCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                 imageView {
                     onThrottleFirstClick {
                         val intent = Intent()
+                        intent.putExtra("type","1")
                         intent.setClass(context,AddCastSurelyActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }

+ 68 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyViewModel.kt

@@ -29,6 +29,9 @@ class MyCastSurelyViewModel : BaseViewModel(){
     //我的定投历史数据
     val castSurrelyhistoryDataList : MutableLiveData<List<RStrategyData>> = MutableLiveData()
 
+    //我的定投数据Log
+    val castSurelyLogDataList : MutableLiveData<List<RSTriggerLogData>> = MutableLiveData()
+
     /**
      * 选择的商品的关联商品表
      */
@@ -103,6 +106,21 @@ class MyCastSurelyViewModel : BaseViewModel(){
     }
 
     /**
+     * 查询我的定投log
+     */
+    fun queryRSTriggerLog(regularlystrategyid : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            put("regularlystrategyid",regularlystrategyid)//定投策略id
+        }
+        MyApplication.getInstance()?.moneyManager?.queryRSTriggerLog(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                castSurelyLogDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
      * 定投策略请求
      */
     fun qhjRegularlyStrategyReq(
@@ -160,6 +178,56 @@ class MyCastSurelyViewModel : BaseViewModel(){
         }
     }
 
+    /**
+     *
+     * @param regularlyStrategyID Long 定投策略ID
+     * @param goodsID Long 定投商品ID
+     * @param regularlyCycle Int 定投频率 - 1:每周 2:每月
+     * @param regularlyCycleValue Int 定投频率值 - 每周几(0-6)  或 每月几号(<=28)
+     * @param regularlyMode Int 定投方式 - 1:按数量 2:按金额
+     * @param regularlyModeValue Double  定投方式值 - 数量或金额
+     * @param remark String 备注
+     * @param operateType Int 操作类型:1:新增,2:修改,3:暂停,4:恢复,5:关闭
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun requestQhjRegularlyStrategyReq(
+        regularlyStrategyID : Long = 0,
+        goodsID : Long,
+        regularlyCycle : Int,
+        regularlyCycleValue : Int,
+        regularlyMode : Int,
+        regularlyModeValue : Double,
+        remark : String = "",
+        operateType : Int,
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.moneyManager?.requestQhjRegularlyStrategyReq(
+                regularlyStrategyID = regularlyStrategyID,
+                goodsID = goodsID,
+                regularlyCycle = regularlyCycle,
+                regularlyCycleValue = regularlyCycleValue,
+                regularlyMode = regularlyMode,
+                regularlyModeValue = regularlyModeValue,
+                operateType = operateType
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
+
 
 
 }