Parcourir la source

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

Liu.bolan il y a 4 ans
Parent
commit
53ebab3b54
29 fichiers modifiés avec 11877 ajouts et 306 suppressions
  1. 6 0
      RMA/app/src/main/AndroidManifest.xml
  2. 38 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  3. 55 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt
  4. 63 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/performance/PerformanceAdapter.kt
  5. 97 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/performance/PerformanceManager.kt
  6. 50 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt
  7. 142 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/PermancePlanTmpData.kt
  8. 45 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/WrPerformanceStepTypeData.kt
  9. 9 0
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/funcode/FunCode.java
  10. 10457 248
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI3.java
  11. 4 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/HnstMainFragment.kt
  12. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersViewModel.kt
  13. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractOrderContentAdapter.java
  14. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryActivity.kt
  15. 40 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/FriendViewHolder.kt
  16. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendActivity.kt
  17. 86 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendViewModel.kt
  18. 133 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/SelectFriendActivty.kt
  19. 190 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceTempateActivity.kt
  20. 84 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceViewHolder.kt
  21. 121 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateActivity.kt
  22. 113 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewHolder.kt
  23. 84 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewModel.kt
  24. 0 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalViewModel.kt
  25. 39 37
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/adapter/TransferAdapter.java
  26. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/delisting/PurchaseDelistingActivity.kt
  27. 8 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/delisting/PurchaseDelistingViewModel.kt
  28. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_delete_icon.png
  29. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_performance_add_icon.png

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

@@ -435,6 +435,12 @@
         <activity android:name=".view.base.hnstmain.spotwarehouse.arecancelled.AreCancelledActivity"/>
 
         <activity android:name=".view.base.hnstmain.friend.MainFriendActivity"/>
+
+        <activity android:name=".view.base.hnstmain.friend.SelectFriendActivty"/>
+
+        <activity android:name=".view.base.hnstmain.performancetemplate.PerformanceTemplateActivity"/>
+
+        <activity android:name=".view.base.hnstmain.performancetemplate.AddPerformanceTempateActivity"/>
     </application>
 
 </manifest>

+ 38 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt

@@ -4,6 +4,7 @@ import cn.muchinfo.rma.business.account.adapter.AccountAdapter
 import cn.muchinfo.rma.business.bank.adapter.BankAdapter
 import cn.muchinfo.rma.business.commodity.adapter.CommodityAdapter
 import cn.muchinfo.rma.business.contract.adapter.ContractAdapter
+import cn.muchinfo.rma.business.performance.PerformanceAdapter
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.data.account.LoginQueryData
@@ -74,6 +75,43 @@ class AccountManager {
     }
 
     /**
+     * 好友操作请求
+     */
+    fun friendOperateReqInfo(
+        operatetype : Int = 0,//操作类型-1:申请 2:审核通过 3:审核拒绝 4: 删除
+        userid : Long = 0,//申请人用户ID
+        frienduserid : Long = 0,//好友用户ID
+        applysrc : Int = 0,//申请来源 - 1:管理端 2:终端
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = AccountAdapter.getFriendOperateReqInfo(
+            operatetype, userid, frienduserid, applysrc
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FID_FriendOperateRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = AccountAdapter.analysisFriendOperateRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
      * 账户登录
      * @param IP String 交易接入地址
      * @param port String 交易接入端口

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

@@ -24,6 +24,61 @@ import kotlin.math.log
  */
 class AccountAdapter {
     companion object {
+
+        /**
+         * 好友操作请求
+         */
+        fun getFriendOperateReqInfo(
+            operatetype : Int = 0,//操作类型-1:申请 2:审核通过 3:审核拒绝 4: 删除
+            userid : Long = 0,//申请人用户ID
+            frienduserid : Long = 0,//好友用户ID
+            applysrc : Int = 0//申请来源 - 1:管理端 2:终端
+        ) : Packet50{
+            val builder = ManageServiceMI3.FriendOperateReq.newBuilder()
+            val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+            builder.setHeader(
+                MessageHeadModel.getHead(
+                    FunCode.FID_FriendOperateReq,
+                    loginInfo.userID,
+                    0,
+                    0,
+                    18
+                )
+            )
+            builder.operatetype = operatetype
+            builder.userid = userid
+            builder.frienduserid = frienduserid
+            builder.applysrc = applysrc
+            builder.applicantid = loginInfo.loginID
+            val arrayOutputStream = ByteArrayOutputStream();
+            builder.build().writeTo(arrayOutputStream)
+            return Packet50(FunCode.FID_FriendOperateReq, arrayOutputStream.toByteArray())
+        }
+
+        /**
+         * 期货账户新增修改报文解析
+         * @param packet50 Packet50
+         * @return Triple<Boolean, Error?, ManageServiceMI2.HedgeOutMainConfigRsp?>
+         */
+        fun analysisFriendOperateRsp(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI3.FriendOperateRsp?> {
+            return try {
+                val loginRsp = ManageServiceMI3.FriendOperateRsp.parseFrom(packet50.content)
+                if (loginRsp.retCode == 0) {
+                    // 操作成功
+                    Triple(true, null, loginRsp)
+                }else if (loginRsp.retCode == -1){
+                    // 操作失败
+                    Triple(false, Error(loginRsp.retDesc), null)
+                } else {
+                    // 操作失败
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+                }
+            } catch (e: Exception) {
+                // 操作失败
+                Triple(false, Error("装箱失败"), null)
+            }
+        }
+
         /**
          * 构建登录请求报文
          * @return Packet50 登录请求报文

+ 63 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/performance/PerformanceAdapter.kt

@@ -6,6 +6,7 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.netcore.packet.Packet50
 import cn.muchinfo.rma.protobuf.funcode.FunCode
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI3
 import cn.muchinfo.rma.protobuf.protoclasses.PerformanceMI1
 import java.io.ByteArrayOutputStream
 import java.lang.Exception
@@ -15,6 +16,68 @@ import java.lang.Exception
  */
 object PerformanceAdapter {
 
+
+    /**
+     * 履约模版信息操作
+     */
+    fun getPerformancePlanTemplateReq(
+        autoid : Long = 0,//履约计划模板主键不为0且不为空修改否则新增
+        templatename : String = "",//模板名称
+        takemode : Int = 0,//提货方式 1 无 2买方自提 3卖方发货
+        type : Int = 0,//模版类型 0通用 1交割 2仓单贸易 3预售集采
+        performancesteps : List<ManageServiceMI3.EPerformanceStepTemplateInfo>,
+        userid : Long = 0,//所属用户
+        paymenttype : Long = 0//支付方式 1 冻结 2扣款
+    ) : Packet50{
+        val builder = ManageServiceMI3.PerformancePlanTemplateReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.FID_PerformancePlanTemplateReq,
+                loginInfo.userID,
+                0,
+                0,
+                18
+            )
+        )
+        builder.autoid = autoid
+        builder.templatename = templatename
+        builder.takemode = takemode
+        builder.type = type
+        builder.addAllPerformancesteps(performancesteps)
+        builder.userid = userid
+        builder.paymenttype = paymenttype
+        builder.creatorid = loginInfo.loginID
+        val arrayOutputStream = ByteArrayOutputStream();
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.FID_PerformancePlanTemplateReq, arrayOutputStream.toByteArray())
+    }
+
+
+    /**
+     * 履约激活请求 即是交收功能确认应答
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ErmcpMI1.SpotContractOperateRsp?>
+     */
+    fun analysisPerformancePlanTemplateRsp(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI3.PerformancePlanTemplateRsp?> {
+        return try {
+            val resultRsp = ManageServiceMI3.PerformancePlanTemplateRsp.parseFrom(packet50.content)
+            if (resultRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, resultRsp)
+            }else if (resultRsp.retCode == -1){
+                // 操作失败
+                Triple(false, Error(resultRsp.retDesc), null)
+            } else {
+                // 操作失败
+                Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
+
     /**
      * 履约激活请求 即是交收功能
      */

+ 97 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/performance/PerformanceManager.kt

@@ -1,13 +1,17 @@
 package cn.muchinfo.rma.business.performance
 
+import cn.muchinfo.rma.business.account.adapter.AccountAdapter
 import cn.muchinfo.rma.business.customer.adapter.CustomerAdapter
 import cn.muchinfo.rma.global.data.PerformancePlanData
+import cn.muchinfo.rma.global.data.PermancePlanTmpData
 import cn.muchinfo.rma.global.data.WrPerformancePlanStepData
+import cn.muchinfo.rma.global.data.WrPerformanceStepTypeData
 import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
 import cn.muchinfo.rma.netcore.packet.Packet50
 import cn.muchinfo.rma.netcore.socket.Callback
 import cn.muchinfo.rma.protobuf.funcode.FunCode
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI3
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.guard
 import cn.muchinfo.rma.view.base.app.BaseResult
@@ -22,6 +26,46 @@ import java.lang.Exception
 class PerformanceManager {
 
     /**
+     * 履约模版信息操作
+     */
+    fun performancePlanTemplateReq(
+        autoid : Long = 0,//履约计划模板主键不为0且不为空修改否则新增
+        templatename : String = "",//模板名称
+        takemode : Int = 0,//提货方式 1 无 2买方自提 3卖方发货
+        type : Int = 0,//模版类型 0通用 1交割 2仓单贸易 3预售集采
+        performancesteps : List<ManageServiceMI3.EPerformanceStepTemplateInfo>,
+        userid : Long = 0,//所属用户
+        paymenttype : Long = 0,//支付方式 1 冻结 2扣款
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = PerformanceAdapter.getPerformancePlanTemplateReq(
+            autoid, templatename, takemode, type, performancesteps, userid, paymenttype
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FID_PerformancePlanTemplateRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = PerformanceAdapter.analysisPerformancePlanTemplateRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
      * 履约激活请求 即是交收功能
      * @param marketid Int
      * @param PerformancePlanID Long
@@ -113,6 +157,59 @@ class PerformanceManager {
         )
     }
 
+
+    /**
+     * 查询履约模板
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<BusinessData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryPermancePlanTmp(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<PermancePlanTmpData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryPermancePlanTmp",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<PermancePlanTmpData>>>() {
+                override fun onResponse(response: BaseResult<List<PermancePlanTmpData>>?, 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<BusinessData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryWrPerformanceStepType(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<WrPerformanceStepTypeData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryWrPerformanceStepType",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<WrPerformanceStepTypeData>>>() {
+                override fun onResponse(response: BaseResult<List<WrPerformanceStepTypeData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
     //履约手动确认请求
     fun performanceManualConfirmReq(
         marketid : Long = 0,//市场id

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

@@ -177,6 +177,56 @@ fun String.channelinnerorderstatus() : String{
 
 
 /**
+ * //委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
+ */
+fun String.tradeorderstatus() : String{
+    if (this.isNullOrEmpty()){
+        return "--"
+    }
+    var str = ""
+    when {
+        this == "1" -> {
+            str = "委托请求"
+        }
+        this == "2" -> {
+            str = "待冻结"
+        }
+        this == "3" -> {
+            str = "委托成功"
+        }
+        this == "4" -> {
+            str = "委托失败"
+        }
+        this == "5" -> {
+            str = "配对成功"
+        }
+        this == "6" -> {
+            str = "已撤销"
+        }
+        this == "7" -> {
+            str = "部分成交"
+        }
+        this == "8" -> {
+            str = "已成交"
+        }
+        this == "9" -> {
+            str = "部成部撤"
+        }
+        this == "10" -> {
+            str = "成交失败"
+        }
+        this == "11" -> {
+            str = "已拒绝"
+        }
+        this == "12" -> {
+            str = "经过摘牌"
+        }
+    }
+
+    return str
+}
+
+/**
  * 履约状态  1:初始化 2:正常 3:处理错误 4:违约待处理 5:违约处理中 6:完成 7.违约已完成 8:释放冻结失败 9:超时待处理 10:超时关闭
  */
 fun String.performancestatus() : String{

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

@@ -0,0 +1,142 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 履约模板
+ */
+data class PermancePlanTmpData(
+    @SerializedName("autoid")
+    val autoid : String? = "",//AutoID 模板id
+    @SerializedName("createtime")
+    val createtime : String? = "",//创建时间
+    @SerializedName("creatorid")
+    val creatorid : String? = "",//创建人
+    @SerializedName("lstStep")
+    val lstStep : List<WrGoodsPerformanceStepData>? = arrayListOf(),//步骤信息列表
+    @SerializedName("paymenttype")
+    val paymenttype : String? = "",//支付方式 - 1:冻结 2:扣款
+    @SerializedName("takemode")
+    val takemode:  String? = "",//提货方式 - 1:无 2:买方自提 3:卖方发货
+    @SerializedName("templatename")
+    val templatename:  String? = "",//模板名称
+    @SerializedName("templatetype")
+    val templatetype : String? = "",//模板类型 - 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
+    @SerializedName("userid")
+    val userid : String? = "",//所属用户
+    var isClick : Int = 0//是否点击
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createTypedArrayList(WrGoodsPerformanceStepData),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(autoid)
+        parcel.writeString(createtime)
+        parcel.writeString(creatorid)
+        parcel.writeTypedList(lstStep)
+        parcel.writeString(paymenttype)
+        parcel.writeString(takemode)
+        parcel.writeString(templatename)
+        parcel.writeString(templatetype)
+        parcel.writeString(userid)
+        parcel.writeInt(isClick)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<PermancePlanTmpData> {
+        override fun createFromParcel(parcel: Parcel): PermancePlanTmpData {
+            return PermancePlanTmpData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<PermancePlanTmpData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+//履约步骤 步骤信息列表
+data class WrGoodsPerformanceStepData(
+    @SerializedName("autoid")
+    var autoid : Int? = 0,//AutoID
+    @SerializedName("isauto")
+    val isauto : String? = "",//是否自动 - 0:不自动 1:自动
+    @SerializedName("remark")
+    val remark : String? = "",//备注
+    @SerializedName("stepdate")
+    val stepdate : String? = "",//天数信息(T+N)
+    @SerializedName("stepdays")
+    val stepdays : String? = "",//距离上一步天数
+    @SerializedName("stepindex")
+    val stepindex : String? = "",//步骤序号
+    @SerializedName("stepinfo")
+    val stepinfo : String? = "",//步骤信息(步骤名称+步骤值)
+    @SerializedName("steptypeid")
+    val steptypeid : String? = "",//履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结 10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款) 用于-1模板“
+    @SerializedName("steptypename")
+    val steptypename : String? = "",//步骤名称
+    @SerializedName("stepvalue")
+    val stepvalue : String? = "",//步骤值
+    @SerializedName("templateid")
+    val templateid : String? = ""//履约计划模板ID
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readValue(Int::class.java.classLoader) as? Int,
+        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.writeValue(autoid)
+        parcel.writeString(isauto)
+        parcel.writeString(remark)
+        parcel.writeString(stepdate)
+        parcel.writeString(stepdays)
+        parcel.writeString(stepindex)
+        parcel.writeString(stepinfo)
+        parcel.writeString(steptypeid)
+        parcel.writeString(steptypename)
+        parcel.writeString(stepvalue)
+        parcel.writeString(templateid)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrGoodsPerformanceStepData> {
+        override fun createFromParcel(parcel: Parcel): WrGoodsPerformanceStepData {
+            return WrGoodsPerformanceStepData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrGoodsPerformanceStepData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,45 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 履约步骤枚举
+ */
+data class WrPerformanceStepTypeData(
+    @SerializedName("canauto")
+    val canauto : String? = "",//能否自动确认 - 0:不可自动确认 1:可自动确认 (可设置自动确认步骤: 1:买方支付 3:买方自提 5:买方确认货 7:买方确认票)
+    @SerializedName("steptypeid")
+    val steptypeid : String? = "",//步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
+    @SerializedName("steptypename")
+    val steptypename : String? = ""//步骤类型名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(canauto)
+        parcel.writeString(steptypeid)
+        parcel.writeString(steptypename)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrPerformanceStepTypeData> {
+        override fun createFromParcel(parcel: Parcel): WrPerformanceStepTypeData {
+            return WrPerformanceStepTypeData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrPerformanceStepTypeData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 9 - 0
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/funcode/FunCode.java

@@ -378,6 +378,15 @@ public class FunCode {
     //交割申报应答
     public static final int DeliveryOrderRsp = 393218;
 
+    //好友操作请求
+    public static final int FID_FriendOperateReq = 1900741;
+    //好友操作响应
+    public static final int FID_FriendOperateRsp = 1900742;
+    //模板信息操作请求
+    public static final int FID_PerformancePlanTemplateReq = 1900746;
+    //模板信息操作响应
+    public static final int FID_PerformancePlanTemplateRsp = 1900747;
+
     /**
      * 交易委托请求(196639)
      */

Fichier diff supprimé car celui-ci est trop grand
+ 10457 - 248
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI3.java


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

@@ -30,6 +30,7 @@ import cn.muchinfo.rma.view.base.hnstmain.contractorders.delivery.DeliveryActivi
 import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementActivity
 import cn.muchinfo.rma.view.base.hnstmain.friend.MainFriendActivity
 import cn.muchinfo.rma.view.base.hnstmain.performance.PerformanceInformationActivity
+import cn.muchinfo.rma.view.base.hnstmain.performancetemplate.PerformanceTemplateActivity
 import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.SpotWareHouseActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.main.addressmanagement.MyAddressManagementActivity
@@ -528,7 +529,9 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
 
                         linearLayout {
                             onThrottleFirstClick {
-
+                                val intent = Intent()
+                                intent.setClass(context, PerformanceTemplateActivity::class.java)
+                                ActivityUtils.startActivity(intent)
                             }
                             gravity = Gravity.CENTER_VERTICAL
                             imageView {

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

@@ -5,6 +5,7 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.toShowTime
 import cn.muchinfo.rma.global.toShowTime2
+import cn.muchinfo.rma.global.tradeorderstatus
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
@@ -266,6 +267,8 @@ class ContractOrdersViewModel : BaseViewModel(){
             newRightData.add(it.orderid ?: "-")
             //委托时间
             newRightData.add(it.ordertime?.toShowTime2() ?: "-")
+            //状态
+            newRightData.add(it.orderstatus?.tradeorderstatus() ?: "-")
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }

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

@@ -116,6 +116,8 @@ public class ContractOrderContentAdapter extends RecyclerView.Adapter<ContractOr
 
         if (data.getOrderstatus().equals("3") || data.getOrderstatus().equals("7")){
             itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+        }else {
+            itemViewHolder.invoice_register.setVisibility(View.GONE);
         }
 
 

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

@@ -143,7 +143,8 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                              * 仓单数量 = 合约手数*u*k*(r2/r1) u=合约单位 k=最小交割系数 r2=兑换系数(仓单标准)(R2) r1=兑换系数(交易合约)(R1)
                              */
                             viewModel.deliveryRelationLiveData.bindOptional(context){
-                                text = "可交收数量" + data.enableqty?.toDouble()?.times(viewModel.goodsInfo.value?.agreeunit ?: 1)?.times(it?.mindeliveryqty?.toDouble() ?: 1.0)?.times(it?.rratio2?.toDouble() ?: 1.0)?.div(it?.rratio1?.toDouble() ?: 1.0)?.toInt()
+                                val goodsInfo = DataBase.getInstance().goodsInfoDao().getGoodsInfo(it?.goodsid?.toInt() ?: 0)
+                                text = "可交收数量" + data.enableqty?.toDouble()?.times(goodsInfo?.agreeunit ?: 1)?.times(it?.mindeliveryqty?.toDouble() ?: 1.0)?.times(it?.rratio2?.toDouble() ?: 1.0)?.div(it?.rratio1?.toDouble() ?: 1.0)?.toInt()
                             }
                             textSizeAuto = 32
                             textColorInt = R.color.buy_hall_color

+ 40 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/FriendViewHolder.kt

@@ -4,6 +4,7 @@ import android.view.Gravity
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.WrUserFriendData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
@@ -22,21 +23,26 @@ import org.jetbrains.anko.*
  * @property itemSize IntArray
  * @constructor
  */
-class FriendViewHolder(private val activity : AppCompatActivity,private val viewModel: MainFriendViewModel) : BaseViewHolder<WrUserFriendData>(activity){
+class FriendViewHolder(private val activity : AppCompatActivity,private val viewModel: MainFriendViewModel,private val type : String) : BaseViewHolder<WrUserFriendData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     override fun _FrameLayout.createContentView() {
         verticalLayout {
             onThrottleFirstClick {
-                if (data.value?.isfriend == "1"){//只有是我的好友时才可以点击
+                if (type == "1"){
+                    if (data.value?.isfriend == "1"){//只有是我的好友时才可以点击
+                        viewModel.setOnItemClick(userid = data.value?.userid ?: "")
+                    }
+                }else{//选择朋友时的点击
 
                 }
+
             }
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
                     data.bindOptional(context){
-                        text = it?.userid
+                        text = it?.frienduserid
                     }
                     textSizeAuto = 34
                     textColorInt = R.color.rma_blue_color
@@ -67,6 +73,16 @@ class FriendViewHolder(private val activity : AppCompatActivity,private val view
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
                     textView {
+                        onThrottleFirstClick {
+                            viewModel.friendOperateReqInfo(
+                                operatetype = 1,
+                                userid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong() ?: 0,
+                                frienduserid = data.value?.frienduserid?.toLong() ?: 0,
+                                applysrc = 2
+                            ){
+                                viewModel.queryWrUserFriend()
+                            }
+                        }
                         text = "加为好友"
                         textSizeAuto = 29
                         textColorInt = R.color.rma_blue_color
@@ -77,11 +93,32 @@ class FriendViewHolder(private val activity : AppCompatActivity,private val view
             }.lparams(matchParent, autoSize(144))
 
             linearLayout {
+                data.bindOptional(context){
+                    if (type == "1"){
+                        if (it?.isClick == 0){
+                            visibility = View.GONE
+                        }else{
+                            visibility = View.VISIBLE
+                        }
+                    }else{
+                        visibility = View.GONE
+                    }
+                }
                 gravity = Gravity.CENTER_VERTICAL
 
                 emptyView()
 
                 textView {
+                    onThrottleFirstClick {
+                        viewModel.friendOperateReqInfo(
+                            operatetype = 4,
+                            userid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong() ?: 0,
+                            frienduserid = data.value?.frienduserid?.toLong() ?: 0,
+                            applysrc = 2
+                        ){
+                            viewModel.queryWrUserFriend()
+                        }
+                    }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
                     text = "删除"

+ 5 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendActivity.kt

@@ -12,6 +12,8 @@ import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewHolder
 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.*
 
 /**
@@ -29,13 +31,15 @@ class MainFriendActivity : BaseActivity<MainFriendViewModel>(){
         BaseAdapter { _, _ ->
             FriendViewHolder(
                 this,
-                viewModel
+                viewModel,
+                "1"
             )
         }
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             viewModel.queryWrUserFriend()
             topBar {
                 commonLeftButton()

+ 86 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendViewModel.kt

@@ -3,8 +3,12 @@ package cn.muchinfo.rma.view.base.hnstmain.friend
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.WrUserFriendData
+import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 我的朋友viewmodel
@@ -12,11 +16,39 @@ import cn.muchinfo.rma.view.base.BaseViewModel
 class MainFriendViewModel : BaseViewModel(){
 
     /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
      * 朋友列表
      */
     val friendDataList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
 
     /**
+     * 选择朋友显示列表
+     */
+    val showSelectFriendDataList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
+
+
+    /**
+     * 通过输入内容进行列表的筛选
+     */
+    fun screeninFriendData(inputId : String = ""){
+        val newFriendDataList = arrayListOf<WrUserFriendData>()
+        friendDataList.value?.forEach {
+            if (inputId.isNullOrEmpty()){
+                newFriendDataList.add(it)
+            }else{
+                if (it.frienduserid?.contains(inputId) == true){
+                    newFriendDataList.add(it)
+                }
+            }
+        }
+        showSelectFriendDataList.postValue(newFriendDataList)
+    }
+
+    /**
      * 请求朋友列表
      */
     fun queryWrUserFriend(friendUserid : String = ""){
@@ -29,6 +61,60 @@ class MainFriendViewModel : BaseViewModel(){
         MyApplication.getInstance()?.accountManager?.queryWrUserFriend(params = params){isSuccess, respData, error ->
             if (isSuccess){
                 friendDataList.postValue(respData)
+                showSelectFriendDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 我的朋友的item的点击事件
+     */
+    fun setOnItemClick(userid : String){
+        val newFriendDataList = arrayListOf<WrUserFriendData>()
+        friendDataList.value?.forEach {
+            if (it.userid == userid){
+                if (it.isClick == 1){
+                    newFriendDataList.add(it.copy(isClick = 0))
+                }else{
+                    newFriendDataList.add(it.copy(isClick = 1))
+                }
+            }else{
+                newFriendDataList.add(it.copy(isClick = 0))
+            }
+        }
+        friendDataList.postValue(newFriendDataList)
+    }
+
+    /**
+     * 好友操作请求
+     */
+    fun friendOperateReqInfo(
+        operatetype : Int = 0,//操作类型-1:申请 2:审核通过 3:审核拒绝 4: 删除
+        userid : Long = 0,//申请人用户ID
+        frienduserid : Long = 0,//好友用户ID
+        applysrc : Int = 0,//申请来源 - 1:管理端 2:终端
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.accountManager?.friendOperateReqInfo(
+                operatetype = operatetype,
+                userid = userid,
+                frienduserid = frienduserid,
+                applysrc = applysrc
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
             }
         }
     }

+ 133 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/SelectFriendActivty.kt

@@ -0,0 +1,133 @@
+package cn.muchinfo.rma.view.base.hnstmain.friend
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.Gravity
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrUserFriendData
+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 mtp.polymer.com.autowidget.adapter.BaseAdapter
+import org.jetbrains.anko.*
+import org.jetbrains.anko.sdk25.coroutines.textChangedListener
+
+/**
+ * 选择朋友列表
+ */
+class SelectFriendActivty : BaseActivity<MainFriendViewModel>(){
+
+    lateinit var input_userid : EditText
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    private val friendAdapter: BaseAdapter<WrUserFriendData, FriendViewHolder> =
+        BaseAdapter { _, _ ->
+            FriendViewHolder(
+                this,
+                viewModel,
+                "2"
+            )
+        }
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            viewModel.queryWrUserFriend()
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "选择朋友"
+                }
+            }
+
+            linearLayout {
+                backgroundResource = R.drawable.yrdz_item_click_bg
+                gravity = Gravity.CENTER_VERTICAL
+                imageView {
+                    imageResource = R.mipmap.yrdz_search_icon
+                }.lparams(autoSize(36), autoSize(36)){
+                    marginStart = autoSize(25)
+                }
+
+                editText {
+                    hint = "搜索"
+                    textChangedListener {
+                        afterTextChanged {
+                            if (it.toString().isNotEmpty()) {
+                                viewModel.screeninFriendData(it?.toString() ?: "")
+                            }
+                        }
+                    }
+                    background = null
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    inputType = EditorInfo.TYPE_CLASS_NUMBER
+                    textColorStr = "#333333"
+                }.lparams(0, autoSize(80),1f){
+                    topMargin = autoSize(5)
+                }
+
+                imageView {
+                    imageResource = R.mipmap.yrdz_delect_icon
+                }.lparams(autoSize(36), autoSize(36)){
+                    marginEnd = autoSize(25)
+                }
+            }.lparams(matchParent, autoSize(80)){
+                marginStart = autoSize(36)
+                marginEnd = autoSize(36)
+                topMargin = autoSize(36)
+            }
+
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                setRetryAction {
+
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.queryWrUserFriend(friendUserid = input_userid.text.toString())
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = friendAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.showSelectFriendDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    friendAdapter.setNewData(it)
+                }
+            }
+            friendAdapter.setOnItemClickListener { adapter, view, position ->
+                val intent = Intent()
+                intent.putExtra("maildata",viewModel.showSelectFriendDataList.value?.get(position))
+                setResult(1001, intent)
+                finish()
+            }
+        }
+    }
+
+}

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

@@ -0,0 +1,190 @@
+package cn.muchinfo.rma.view.base.hnstmain.performancetemplate
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.PermancePlanTmpData
+import cn.muchinfo.rma.global.data.WrGoodsPerformanceStepData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+
+/**
+ * 新增修改履约模版的页面
+ */
+class AddPerformanceTempateActivity : BaseActivity<PerformanceTemplateViewModel>(){
+
+    /**
+     * 1 新增 2 修改
+     */
+    val type by lazy { intent.getStringExtra("type") }
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    private val addPerformanceAdapter: BaseAdapter<WrGoodsPerformanceStepData, AddPerformanceViewHolder> =
+        BaseAdapter { _, _ ->
+            AddPerformanceViewHolder(
+                this,
+                viewModel
+            )
+        }
+
+    //模版名称
+    lateinit var performance_name : EditText
+
+    /**
+     * 页面数据的初始化
+     */
+    fun initializeData(){
+        if (type == "1"){
+            val newDataList = arrayListOf<WrGoodsPerformanceStepData>()
+            newDataList.add(WrGoodsPerformanceStepData(autoid = 1))
+            viewModel.wrGoodsPerformanceStepDataList.postValue(newDataList)
+            viewModel.wrGoodsPerformanceStepCashDataList.postValue(newDataList)
+        }else{
+
+        }
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            initializeData()
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
+            viewModel.queryWrPerformanceStepType()
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    if (type == "1"){
+                        text = "新增模板管理"
+                    }else{
+                        text = "修改模板管理"
+                    }
+                }
+            }
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "模版名称"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    performance_name = this
+                    hint = "请输入模版名称"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(0, autoSize(132), 1f) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "步骤类型"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(80),1.5f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "步骤值(%)"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(80),1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "距离上一步天数"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(80),1.5f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "操作"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(80),1f)
+            }.lparams(matchParent, autoSize(80))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                setRetryAction {
+
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = addPerformanceAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.wrGoodsPerformanceStepDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    addPerformanceAdapter.setNewData(it)
+                }
+            }
+
+        }
+    }
+
+}

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

@@ -0,0 +1,84 @@
+package cn.muchinfo.rma.view.base.hnstmain.performancetemplate
+
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrGoodsPerformanceStepData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class AddPerformanceViewHolder(private val activity : AppCompatActivity,private val viewModel: PerformanceTemplateViewModel) : BaseViewHolder<WrGoodsPerformanceStepData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    onThrottleFirstClick {
+
+                    }
+                    textView {
+                        text = "请选择步骤类型"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_down
+                    }.lparams(autoSize(36), autoSize(36))
+                }.lparams(0, autoSize(100),1.5f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "步骤值(%)"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(100),1f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "距离上一步天数"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(100),1.5f)
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    imageView {
+                        imageResource = R.mipmap.yrdz_delete_icon
+                    }.lparams(autoSize(36), autoSize(36))
+
+                    emptyView()
+
+                    imageView {
+                        data.bindOptional(context){
+                            if (dataIndex.plus(1) == dataCount){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                        }
+                        imageResource = R.mipmap.yrdz_performance_add_icon
+                    }.lparams(autoSize(36), autoSize(36))
+                }.lparams(0, autoSize(100),1f)
+            }.lparams(matchParent, autoSize(100))
+        }.lparams(matchParent, wrapContent)
+    }
+
+}

+ 121 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateActivity.kt

@@ -0,0 +1,121 @@
+package cn.muchinfo.rma.view.base.hnstmain.performancetemplate
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.Gravity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.PermancePlanTmpData
+import cn.muchinfo.rma.global.data.WrUserFriendData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.hnstmain.friend.FriendViewHolder
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.main.addressmanagement.AddAddressManagementActivity
+import com.blankj.utilcode.util.ActivityUtils
+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.*
+
+/**
+ * 履约模板管理页面
+ */
+class PerformanceTemplateActivity : BaseActivity<PerformanceTemplateViewModel>(){
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    private val performanceTemplateAdapter: BaseAdapter<PermancePlanTmpData, PerformanceTemplateViewHolder> =
+        BaseAdapter { _, _ ->
+            PerformanceTemplateViewHolder(
+                this,
+                viewModel,
+                "1"
+            )
+        }
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
+            viewModel.queryPermancePlanTmp()
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "履约模板管理"
+                }
+                // 新增履约模板
+                commonMenuButton(R.mipmap.hnst_add_icon) {
+                    val intent = Intent()
+                    intent.putExtra("type","1")
+                    intent.setClass(context,AddPerformanceTempateActivity::class.java)
+                    ActivityUtils.startActivity(intent)
+                }
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "模版名称"
+                    textSizeAuto = 29
+                    textColorInt = R.color.hint_text_color
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                emptyView()
+
+                textView {
+                    text = "创建时间"
+                    textSizeAuto = 29
+                    textColorInt = R.color.hint_text_color
+                }.lparams(wrapContent, wrapContent){
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(70))
+
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                setRetryAction {
+                    viewModel.queryPermancePlanTmp()
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.queryPermancePlanTmp()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = performanceTemplateAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.permancePlanTmpDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    performanceTemplateAdapter.setNewData(it)
+                }
+            }
+
+        }
+
+    }
+
+}

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

@@ -0,0 +1,113 @@
+package cn.muchinfo.rma.view.base.hnstmain.performancetemplate
+
+import android.graphics.Typeface
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.PermancePlanTmpData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.warehousereceipt.BusinessItemView
+import cn.muchinfo.rma.view.base.warehousereceipt.RulesItem
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,private val viewModel: PerformanceTemplateViewModel,private val type : String) : BaseViewHolder<PermancePlanTmpData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    data.bindOptional(context){
+                        text = it?.templatename
+                    }
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                    typeface = Typeface.defaultFromStyle(Typeface.BOLD)
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+                emptyView()
+                textView {
+                    data.bindOptional(context){
+                        text = it?.createtime
+                    }
+                    textSizeAuto = 32
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(wrapContent, wrapContent){
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(100))
+
+            horizontalScrollView {
+                isHorizontalScrollBarEnabled = false
+
+                linearLayout {
+                    data.bindOptional(context){
+                        it?.lstStep?.forEach { data ->
+                            RulesItem(name = data.stepinfo ?: "",value = data.stepdate ?: "")
+                        }
+                    }
+                }
+
+            }.lparams(matchParent, autoSize(175))
+
+            linearLayout {
+                data.bindOptional(context){
+                    if (type == "1"){
+                        if (it?.isClick == 0){
+                            visibility = View.GONE
+                        }else{
+                            visibility = View.VISIBLE
+                        }
+                    }else{
+                        visibility = View.GONE
+                    }
+                }
+                gravity = Gravity.CENTER_VERTICAL
+
+                emptyView()
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "修改"
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_blue_color
+                }.lparams(autoSize(100), autoSize(60)){
+                    marginEnd = autoSize(36)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "删除"
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_blue_color
+                }.lparams(autoSize(100), autoSize(60)){
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(72))
+
+            BusinessItemView()
+
+        }.lparams(matchParent, wrapContent)
+    }
+
+
+}

+ 84 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewModel.kt

@@ -0,0 +1,84 @@
+package cn.muchinfo.rma.view.base.hnstmain.performancetemplate
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.PermancePlanTmpData
+import cn.muchinfo.rma.global.data.WrGoodsPerformanceStepData
+import cn.muchinfo.rma.global.data.WrPerformanceStepTypeData
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.base.BaseViewModel
+import mtp.polymer.com.autowidget.utils.TaskUiModel
+
+/**
+ * 履约模版viewmodel
+ */
+class PerformanceTemplateViewModel : BaseViewModel(){
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
+     * 我的履约模版数据
+     */
+    val permancePlanTmpDataList : MutableLiveData<List<PermancePlanTmpData>> = MutableLiveData()
+
+    /**
+     * 履约模版步骤枚举
+     */
+    val wrPerformanceStepTypeDataList : MutableLiveData<List<WrPerformanceStepTypeData>> = MutableLiveData()
+
+    /**
+     * 新增修改时的viewholder数据
+     */
+    val wrGoodsPerformanceStepDataList : MutableLiveData<List<WrGoodsPerformanceStepData>> = MutableLiveData()
+
+    /**
+     * 新增修改时的提交数据
+     */
+    val wrGoodsPerformanceStepCashDataList : MutableLiveData<List<WrGoodsPerformanceStepData>> = MutableLiveData()
+
+    /**
+     * 对履约模版添加修改时每部操作后进行数据的更新
+     * operationType 1 修改相应资料 2 新增item
+     * dataIndex item变更的索引
+     * steptypename 步骤名
+     * stepValue 步骤值
+     * stepdays 距离上一步天数
+     */
+    fun setPerformanceStepDataList(operationType : String,dataIndex : Int,steptypename : String = "",stepValue : String = "",stepdays : String = ""){
+//        if (operationType == "1"){
+//            val showDataList =
+//        }
+    }
+
+    /**
+     * 查询履约步骤枚举
+     */
+    fun queryWrPerformanceStepType(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID?.toString() ?: "")
+        }
+        MyApplication.getInstance()?.performanceManager?.queryWrPerformanceStepType(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                wrPerformanceStepTypeDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 查询我的履约模版
+     */
+    fun queryPermancePlanTmp(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID?.toString() ?: "")
+        }
+
+        MyApplication.getInstance()?.performanceManager?.queryPermancePlanTmp(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                permancePlanTmpDataList.postValue(respData)
+            }
+        }
+    }
+
+}

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

@@ -242,9 +242,7 @@ class WithdrawalViewModel : BaseViewModel(){
 
     val payInfoRequest : MutableLiveData<String> = MutableLiveData()
     fun getPayInfo(marketId: String = "", orderNo: String = "", orderDate: String = "", totalAmount: String, msgType: String,payType : String) {//从后台获取支付信息
-
         var url = ""
-
         if (SPUtils.getInstance().getString(Constant.otherPayUrl).endsWith("/")){
             url = SPUtils.getInstance().getString(Constant.otherPayUrl) + "pay"
         }else{
@@ -260,7 +258,6 @@ class WithdrawalViewModel : BaseViewModel(){
         json["accountName"] = GlobalDataCollection.instance?.accountData?.accountid
         json["accountId"] = GlobalDataCollection.instance?.accountData?.accountid
         json["marketId"] = "69201"
-//        json["orderNo"] = orderNo
         json["payType"] = payType//1 成交支付 2 尾款支付 3 保证金支付 4 充值
         json["orderDate"] = "2021-6-18"
         json["totalAmount"] = totalAmount

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

@@ -112,16 +112,18 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
         GoodsInfo relateGoodsInfo = null;//关联商品实体
         relateGoodsInfo = DataBase.Companion.getInstance().goodsInfoDao().getGoodsInfo(data.getRelatedgoodsid());//获取关联商品的商品详情
         List<GoodsInfoAndQuotes> quotesList = GlobalDataCollection.Companion.getInstance().getGoodsInfoAndQuotesList();//获取盘面信息列表
-        for (int j = 0;j < quotesList.size();j++){
-            if (data.getOutgoodscode().equals(quotesList.get(j).getOutgoodscode())){
-                quoteDayData = quotesList.get(j).getQuoteDayData();//赋值当前商品的盘面信息
+        for (int j = 0; j < quotesList.size(); j++) {
+            if (quotesList.get(j) != null) {
+                if (data.getGoodscode().equals(quotesList.get(j).getOutgoodscode())) {
+                    quoteDayData = quotesList.get(j).getQuoteDayData();//赋值当前商品的盘面信息
+                }
             }
         }
 
-        if (quoteDayData != null){
+        if (quoteDayData != null) {
             // 卖价取卖一价
             QHjRightData askData = new QHjRightData();
-            askData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getAsk())),2));
+            askData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getAsk())), 2));
             askData.setColorType("3");
             rightData.add(askData);
 
@@ -133,7 +135,7 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
 
             //买价取买一价
             QHjRightData bidData = new QHjRightData();
-            bidData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getBid())),2));
+            bidData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getBid())), 2));
             bidData.setColorType("3");
             rightData.add(bidData);
 
@@ -145,73 +147,73 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
 
             //最新价
             QHjRightData newPriceData = new QHjRightData();
-            newPriceData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPrice())),2));
+            newPriceData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPrice())), 2));
             newPriceData.setColorType(quoteDayData.getColor());
             rightData.add(newPriceData);
         }
 
-        if (quoteDayData != null){
+        if (quoteDayData != null) {
             //涨跌幅
             QHjRightData appliesData = new QHjRightData();
             //涨跌
             QHjRightData riseFallData = new QHjRightData();
             //今开
             QHjRightData openRightData = new QHjRightData();
-            openRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getOpened())),2));
+            openRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getOpened())), 2));
             double openRightDatColor = quoteDayData.getOpened() - quoteDayData.getPreclose();
-            if (openRightDatColor > 0){
+            if (openRightDatColor > 0) {
                 openRightData.setColorType("3");
-            }else if (openRightDatColor < 0){
+            } else if (openRightDatColor < 0) {
                 openRightData.setColorType("2");
-            }else {
+            } else {
                 openRightData.setColorType("1");
             }
             //最高价
             QHjRightData highRightData = new QHjRightData();
-            highRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getHighest())),2));
+            highRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getHighest())), 2));
             double highRightDatColor = quoteDayData.getHighest() - quoteDayData.getPreclose();
-            if (highRightDatColor > 0){
+            if (highRightDatColor > 0) {
                 highRightData.setColorType("3");
-            }else if (highRightDatColor < 0){
+            } else if (highRightDatColor < 0) {
                 highRightData.setColorType("2");
-            }else {
+            } else {
                 highRightData.setColorType("1");
             }
             highRightData.setColorType("1");
             //最低价
             QHjRightData lowestRightData = new QHjRightData();
-            lowestRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getLowest())),data.getDecimalplace()));
+            lowestRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getLowest())), data.getDecimalplace()));
             double lowestRightDatColor = quoteDayData.getLowest() - quoteDayData.getPreclose();
-            if (lowestRightDatColor > 0){
+            if (lowestRightDatColor > 0) {
                 lowestRightData.setColorType("3");
-            }else if (lowestRightDatColor < 0){
+            } else if (lowestRightDatColor < 0) {
                 lowestRightData.setColorType("2");
-            }else {
+            } else {
                 lowestRightData.setColorType("1");
             }
             lowestRightData.setColorType("1");
             //昨收价
             QHjRightData yesCloseRightData = new QHjRightData();
-            yesCloseRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPreclose())),data.getDecimalplace()));
+            yesCloseRightData.setValue(NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf(quoteDayData.getPreclose())), data.getDecimalplace()));
             yesCloseRightData.setColorType("1");
 
             if (quoteDayData.getLast() != 0 && quoteDayData.getPreclose() != 0) {
                 String textApplies = "";
-                String textUpDown = NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf((quoteDayData.getPrice() - quoteDayData.getPresettle()))),2);//涨跌
-                if (quoteDayData.getPresettle() == 0){
+                String textUpDown = NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf((quoteDayData.getPrice() - quoteDayData.getPresettle()))), 2);//涨跌
+                if (quoteDayData.getPresettle() == 0) {
                     textApplies = "--";
-                }else {
-                    textApplies = NumberUtils.roundNum(String.valueOf((((quoteDayData.getPrice() - quoteDayData.getPresettle()) / quoteDayData.getPresettle()) * 100)),2);//涨跌幅
+                } else {
+                    textApplies = NumberUtils.roundNum(String.valueOf((((quoteDayData.getPrice() - quoteDayData.getPresettle()) / quoteDayData.getPresettle()) * 100)), 2);//涨跌幅
                 }
                 riseFallData.setValue(textUpDown);
                 appliesData.setValue(textApplies + "%");
-                if (Double.valueOf(textUpDown) > 0){
+                if (Double.valueOf(textUpDown) > 0) {
                     riseFallData.setColorType("3");
                     appliesData.setColorType("3");
-                }else if (Double.valueOf(textUpDown) < 0){
+                } else if (Double.valueOf(textUpDown) < 0) {
                     riseFallData.setColorType("2");
                     appliesData.setColorType("2");
-                }else {
+                } else {
                     riseFallData.setColorType("1");
                     appliesData.setColorType("1");
                 }
@@ -232,8 +234,8 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
         }
         ContractTradePositionData positionData = null;
         List<ContractTradePositionData> positionDataList = GlobalDataCollection.Companion.getInstance().getContractTradePositionDataArrayList();
-        for (int j = 0;j < positionDataList.size();j++){
-            if (String.valueOf(data.getGoodsid()).equals(positionDataList.get(j).getGoodsid())){
+        for (int j = 0; j < positionDataList.size(); j++) {
+            if (String.valueOf(data.getGoodsid()).equals(positionDataList.get(j).getGoodsid())) {
                 positionData = positionDataList.get(j);
             }
         }
@@ -264,8 +266,8 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
             @Override
             public void onClick(View view) {
                 Intent intent = new Intent();
-                intent.putExtra("goodsId",String.valueOf(data.getGoodsid()));
-                intent.putExtra("goodsCode",data.getGoodscode());
+                intent.putExtra("goodsId", String.valueOf(data.getGoodsid()));
+                intent.putExtra("goodsCode", data.getGoodscode());
                 intent.setClass(context, ContractBusinessHallActivity.class);
                 ActivityUtils.startActivity(intent);
             }
@@ -278,13 +280,13 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
                 intent.putExtra("outGoodsCode", data.getOutgoodscode());
                 intent.putExtra("goodsCode", data.getGoodscode());
                 intent.putExtra("goodsId", String.valueOf(data.getGoodsid()));
-                intent.putExtra("type","1");
+                intent.putExtra("type", "1");
                 intent.putExtra("marketId", data.getMarketid());
                 intent.setClass(context, YrdzChartActivity.class);
                 ActivityUtils.startActivity(intent);
             }
         });
-        if (data.getPictureurl().isEmpty()){
+        if (data.getPictureurl().isEmpty()) {
             itemViewHolder.platnum_details.setVisibility(View.GONE);
         }
         //详情点击
@@ -292,9 +294,9 @@ public class TransferAdapter extends RecyclerView.Adapter<TransferAdapter.ItemVi
             @Override
             public void onClick(View view) {
                 Intent intent = new Intent();
-                intent.putExtra("data",new OrderQuoteData());
-                intent.putExtra("type","3");
-                intent.putExtra("goodsId",data.getGoodsid());
+                intent.putExtra("data", new OrderQuoteData());
+                intent.putExtra("type", "3");
+                intent.putExtra("goodsId", data.getGoodsid());
                 intent.setClass(context, BusinessHallDetailsActivity.class);
                 ActivityUtils.startActivity(intent);
             }

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

@@ -341,7 +341,7 @@ class PurchaseDelistingActivity : BaseActivity<PurchaseDelistingViewModel>(){
                         }
 
                         viewModel.commit(
-                            operatorID = data.orderid ?: "",
+                            relatedID = data.orderid ?: "",
                             goodsInfo = viewModel.goodsInfo.value ?: GoodsInfo(),
                             isListed = false,
                             orderPrice = data.orderprice ?: "1",

+ 8 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/delisting/PurchaseDelistingViewModel.kt

@@ -98,7 +98,7 @@ class PurchaseDelistingViewModel : BaseViewModel(){
      * isListed 是否是挂牌
      */
     fun commit(
-        operatorID : String,
+        relatedID : String,
         goodsInfo: GoodsInfo,
         isListed: Boolean = true,
         orderPrice: String,
@@ -126,22 +126,19 @@ class PurchaseDelistingViewModel : BaseViewModel(){
         }
         orderData.orderPrice = orderPrice.toDouble()//价格
         orderData.orderQty = qty.toLong()//数量
-
         orderData.orderSrc = MTPEnums.ORDERSRC_CLIENT// 来自客户端
-        orderData.priceMode = MTPEnums.PRICEMODE_LIMIT//
-        orderData.timevalidType = MTPEnums.TC_IOC
-        orderData.validType = MTPEnums.VALIDTYPE_DR
-        orderData.delistingType = MTPEnums.DELISTINGTYPE_SELECTED
-
-        if (isListed){
+        orderData.priceMode = MTPEnums.PRICEMODE_LIMIT// 限价
+        orderData.timevalidType = MTPEnums.TC_IOC//当日有效  1为当日有效 2为本周有效 3为指定日期有效 4为一直有效 5为指定时间有效
+        orderData.validType = MTPEnums.VALIDTYPE_DR//当日有效
+        orderData.delistingType = MTPEnums.DELISTINGTYPE_SELECTED//点选成交
+        if (isListed){//挂牌
             orderData.listingSelectType = MTPEnums.LISTINGSELECTTYPE_LISTING// 挂牌
         }else{
             orderData.triggerType = 1
             orderData.listingSelectType = MTPEnums.LISTINGSELECTTYPE_DELISTING// 摘牌
-            orderData.relatedID = operatorID.toLong()
+            orderData.relatedID = relatedID.toLong()
         }
-
-        orderData.optionType = MTPEnums.OPTION_TYPE_C
+        orderData.optionType = MTPEnums.OPTION_TYPE_C//认购
         orderData.triggerOperator = 1
         loadingDialogStatus.value = TaskUiModel.inFlight()
         GlobalScope.launch {

BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_delete_icon.png


BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_performance_add_icon.png


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff