ソースを参照

风险管理10月23日提交代码-liu.bolan-天津麦顿/企业风管6期开发

Liu.bolan 4 年 前
コミット
42e735da01

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

@@ -495,6 +495,12 @@
         <activity android:name=".view.base.home.commodity.modify.ChangeSpotVarietyActivity"/>
 
         <activity android:name=".view.base.home.commodity.modify.ChangeHedgeRatioActivity"/>
+
+        <activity android:name=".view.base.main.invoice.InvoiceInformationActivity"/>
+
+        <activity android:name=".view.base.main.invoice.AddInvoiceInformationActivity"/>
+
+        <activity android:name=".view.base.main.phonebinding.PhoneBindingActivity"/>
     </application>
 
 </manifest>

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

@@ -17,6 +17,119 @@ import java.util.*
 
 object SpotAdapter {
 
+
+    /**
+     * 删除用户发票信息请求报文装箱
+     */
+    fun getDelUserReceiptInfoReqInfo(
+        ReceiptInfoId : Long = 0
+    ) : Packet50{
+        val builder = ManageServiceMI1.DelUserReceiptInfoReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.FID_DelUserReceiptInfoReq,
+                loginInfo.userID,
+                0,
+                0,
+                18
+            )
+        )
+        builder.receiptInfoId = ReceiptInfoId
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.FID_DelUserReceiptInfoReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 删除用户发票信息请求响应
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ErmcpSpotGoodsPriceRsp?>
+     */
+    fun analysisDelUserReceiptInfoRsp(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI1.DelUserReceiptInfoRsp?> {
+        return try {
+            val resultRsp = ManageServiceMI1.DelUserReceiptInfoRsp.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)
+        }
+    }
+
+    /**
+     * 新增修改用户发票信息请求报文装箱
+     */
+    fun getUserReceiptInfoReqInfo(
+        UserName : String = "",//发票抬头姓名
+        ReceiptType : Int = 0,//发票类型
+        TaxpayerID : String = "",//纳税人识别号
+        ContactInfo : String = "",//联系方式
+        ReceiptInfoId : Long = 0,//修改时填用户发票信息id
+        ReceiptBank : String = "",//发票开户行[发票类型:企业]
+        ReceiptAccount : String = "",//发票帐号[发票类型:企业]
+        Address : String = "",//地址[发票类型:企业
+        IDNum : String = ""//身份证号码[发票类型:个人]
+    ) : Packet50{
+        val builder = ManageServiceMI1.UserReceiptInfoReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.FID_UserReceiptInfoReq,
+                loginInfo.userID,
+                0,
+                0,
+                18
+            )
+        )
+        builder.clientSerialID = TimeUtils.getNowMills()
+        builder.userID = loginInfo.userID
+        builder.userName = UserName
+        builder.receiptType = ReceiptType
+        builder.taxpayerID = TaxpayerID
+        builder.contactInfo = ContactInfo
+        if (ReceiptInfoId != 0L){
+            builder.receiptInfoId = ReceiptInfoId
+        }
+        builder.receiptBank = ReceiptBank
+        builder.receiptAccount = ReceiptAccount
+        builder.address = Address
+        builder.idNum = IDNum
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.FID_UserReceiptInfoReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 新增修改用户发票信息请求响应
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ErmcpSpotGoodsPriceRsp?>
+     */
+    fun analysisUserReceiptInfoRsp(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI1.UserReceiptInfoRsp?> {
+        return try {
+            val resultRsp = ManageServiceMI1.UserReceiptInfoRsp.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)
+        }
+    }
+
     /**
      * 补录内部成交单请求
      */

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

@@ -21,6 +21,33 @@ import java.lang.Exception
 class SpotManager {
 
     /**
+     * 查询发票信息
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<SpotGoodsPriceData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryWrUserReceiptInfo(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<WrUserReceiptInfoData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryWrUserReceiptInfo",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<WrUserReceiptInfoData>>>() {
+                override fun onResponse(response: BaseResult<List<WrUserReceiptInfoData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+
+    /**
      * 查询现货商品参数变更申请(流水)
      * 原型页面:
       1.商品信息->商品参数修改流水-> 增值税税率 | 折算系数 | 成本权重
@@ -618,6 +645,82 @@ class SpotManager {
     }
 
     /**
+     * 新增修改用户发票信息请求
+     */
+    fun userReceiptInfoReq(
+        UserName : String = "",//发票抬头姓名
+        ReceiptType : Int = 0,//发票类型
+        TaxpayerID : String = "",//纳税人识别号
+        ContactInfo : String = "",//联系方式
+        ReceiptInfoId : Long = 0,//修改时填用户发票信息id
+        ReceiptBank : String = "",//发票开户行[发票类型:企业]
+        ReceiptAccount : String = "",//发票帐号[发票类型:企业]
+        Address : String = "",//地址[发票类型:企业
+        IDNum : String = "",//身份证号码[发票类型:个人]
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = SpotAdapter.getUserReceiptInfoReqInfo(
+            UserName, ReceiptType, TaxpayerID, ContactInfo, ReceiptInfoId, ReceiptBank, ReceiptAccount, Address, IDNum
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FID_UserReceiptInfoRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = SpotAdapter.analysisUserReceiptInfoRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
+     * 删除用户发票信息请求
+     */
+    fun delUserReceiptInfoReq(
+        ReceiptInfoId : Long = 0,
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = SpotAdapter.getDelUserReceiptInfoReqInfo(
+           ReceiptInfoId
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FID_UserReceiptInfoRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = SpotAdapter.analysisDelUserReceiptInfoRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
      * 查询交易主体
      * @param params Map<String, String>
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<SpotGoodsPriceData>?, [@kotlin.ParameterName] Error?, Unit>

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

@@ -6,6 +6,13 @@ import com.google.gson.annotations.SerializedName
 
 //查询汇总损益表
 data class AreaSumPLData(
+    @SerializedName("accountname")
+    val accountname : String? = "",//机构名称
+    @SerializedName("enumdicname")
+    val enumdicname : String? = "",
+    @SerializedName("goodsunitid")
+    val goodsunitid : String? = "",
+
     @SerializedName("areauserid")
     val areauserid :String? = "",//所属机构\交易用户ID
     var isOnClick : Int = 0,
@@ -48,6 +55,9 @@ data class AreaSumPLData(
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
         parcel.readInt(),
         parcel.readString(),
         parcel.readString(),
@@ -71,6 +81,9 @@ data class AreaSumPLData(
     }
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountname)
+        parcel.writeString(enumdicname)
+        parcel.writeString(goodsunitid)
         parcel.writeString(areauserid)
         parcel.writeInt(isOnClick)
         parcel.writeString(currencyid)

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

@@ -0,0 +1,93 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/***
+ * 发票信息
+ * @property address String?
+ * @property autoid String?
+ * @property contactinfo String?
+ * @property idnum String?
+ * @property isdefault String?
+ * @property receiptaccount String?
+ * @property receiptbank String?
+ * @property receipttype String?
+ * @property taxpayerid String?
+ * @property userid String?
+ * @property username String?
+ * @property isOnClick Int
+ * @constructor
+ */
+data class WrUserReceiptInfoData(
+    @SerializedName("address")
+    val address : String? = "",//地址[发票类型:企业]
+    @SerializedName("autoid")
+    val autoid : String? = "0",//AutoID
+    @SerializedName("contactinfo")
+    val contactinfo : String? = "",//联系方式
+    @SerializedName("idnum")
+    val idnum : String? = "",//身份证号码[发票类型:个人]
+    @SerializedName("isdefault")
+    val isdefault : String? = "",//是否默认地址 - 0:否 1:是
+    @SerializedName("receiptaccount")
+    val receiptaccount : String? = "",//发票帐号[发票类型:企业]
+    @SerializedName("receiptbank")
+    val receiptbank : String? = "",//发票开户行[发票类型:企业]
+    @SerializedName("receipttype")
+    val receipttype : String? = "",//发票类型 - 1:个人 2:企业
+    @SerializedName("taxpayerid")
+    val taxpayerid : String? = "",//纳税人识别号
+    @SerializedName("userid")
+    val userid : String? = "",//用户ID
+    @SerializedName("username")
+    val username : String? = "",//户名(个人姓名或企业名称)
+    var isOnClick : Int = 0
+) : 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.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(address)
+        parcel.writeString(autoid)
+        parcel.writeString(contactinfo)
+        parcel.writeString(idnum)
+        parcel.writeString(isdefault)
+        parcel.writeString(receiptaccount)
+        parcel.writeString(receiptbank)
+        parcel.writeString(receipttype)
+        parcel.writeString(taxpayerid)
+        parcel.writeString(userid)
+        parcel.writeString(username)
+        parcel.writeInt(isOnClick)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrUserReceiptInfoData> {
+        override fun createFromParcel(parcel: Parcel): WrUserReceiptInfoData {
+            return WrUserReceiptInfoData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrUserReceiptInfoData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -440,6 +440,15 @@ public class FunCode {
     //期货现货关联解绑响应
     public static final int LinkUnbindRsp = 1179668;
 
+    //新增修改用户发票信息请求
+    public static final int FID_UserReceiptInfoReq = 1900549;
+    //新增修改用户发票信息请求响应
+    public static final int FID_UserReceiptInfoRsp = 1900550;
+    //删除用户发票信息请求
+    public static final int FID_DelUserReceiptInfoReq = 1900551;
+    //删除用户发票信息请求响应
+    public static final int FID_DelUserReceiptInfoRsp = 1900552;
+
 
     /**
      * 交易委托请求(196639)

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

@@ -17,11 +17,11 @@ object Constant {
 //    const val baseurl = "http://192.168.31.104:8080/cfg?key=test_104"//李倩云融 18611112222
 //    const val baseurl = "http://192.168.31.137:8080/cfg?key=test_137"//李倩云融 18611112222
 //
-    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
+//    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
 
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
-//    const val baseurl = "http://192.168.31.139:8080/cfg?key=test_139"// 邓工
+    const val baseurl = "http://192.168.31.139:8080/cfg?key=test_139"// 邓工
 //
 //    const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
 //    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境

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

@@ -44,6 +44,8 @@ import cn.muchinfo.rma.view.base.main.about.AboutActivity
 import cn.muchinfo.rma.view.base.main.addressmanagement.MyAddressManagementActivity
 import cn.muchinfo.rma.view.base.main.castsurely.MyCastSurelyActivity
 import cn.muchinfo.rma.view.base.main.integral.MyIntegralActivity
+import cn.muchinfo.rma.view.base.main.invoice.InvoiceInformationActivity
+import cn.muchinfo.rma.view.base.main.phonebinding.PhoneBindingActivity
 import cn.muchinfo.rma.view.base.main.pickup.PickUpGoodsSearchActivity
 import cn.muchinfo.rma.view.base.main.promotioncode.ApplyPromotionCodeActivity
 import cn.muchinfo.rma.view.base.main.reward.MyRewardActivity
@@ -1054,9 +1056,9 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                         linearLayout {
                             gravity = Gravity.CENTER_VERTICAL
                             onThrottleFirstClick {
-//                                val intent = Intent()
-//                                intent.setClass(context, AboutActivity::class.java)
-//                                ActivityUtils.startActivity(intent)
+                                val intent = Intent()
+                                intent.setClass(context, InvoiceInformationActivity::class.java)
+                                ActivityUtils.startActivity(intent)
                             }
                             imageView {
                                 imageResource = R.mipmap.tjmd_invoice_information
@@ -1152,9 +1154,9 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                         linearLayout {
                             gravity = Gravity.CENTER_VERTICAL
                             onThrottleFirstClick {
-//                                val intent = Intent()
-//                                intent.setClass(context, AboutActivity::class.java)
-//                                ActivityUtils.startActivity(intent)
+                                val intent = Intent()
+                                intent.setClass(context, PhoneBindingActivity::class.java)
+                                ActivityUtils.startActivity(intent)
                             }
                             imageView {
                                 imageResource = R.mipmap.binding_phone

+ 398 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/AddInvoiceInformationActivity.kt

@@ -0,0 +1,398 @@
+package cn.muchinfo.rma.view.base.main.invoice
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.MTPEnums
+import cn.muchinfo.rma.global.data.WrUserReceiptInfoData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+
+/**
+ * 新建/修改发票抬头页面
+ */
+@Suppress("DEPRECATION")
+class AddInvoiceInformationActivity : BaseActivity<InvoiceInformationViewModel>(){
+
+    //1 是新增 2 是修改 3 是详情
+    val type by lazy { intent.getStringExtra("type") }
+
+    val data by lazy { intent.getParcelableExtra<WrUserReceiptInfoData>("data") as WrUserReceiptInfoData }
+
+    private val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
+    //输入的发票抬头
+    lateinit var  invoice_looked_up_edittext : EditText
+
+    //纳税人识别号
+    lateinit var taxpayer_identification_number : EditText
+
+    //银行名称
+    lateinit var bank_name_edit : EditText
+
+    //银行账号
+    lateinit var bank_account : EditText
+
+    //企业地址
+    lateinit var address_edittext : EditText
+
+    //企业电话
+    lateinit var phone_number : EditText
+
+    //选择的发票类型
+    val selectInvoiceType : MutableLiveData<SelectData> = MutableLiveData()
+
+    //页面数据的初始化
+    fun initData(){
+        if (type == "1"){
+            selectInvoiceType.postValue(SelectData(id = "2",value = "企业"))
+        }else{
+            selectInvoiceType.postValue(SelectData(id = data.receipttype ?: "",value = if (data.receipttype == "1"){"个人"}else{"企业"}))
+        }
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
+            initData()
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    if (type == "1"){
+                        text = "新建发票抬头"
+                    }else if (type == "2"){
+                        text = "修改发票抬头"
+                    }else{
+                        text = "发票抬头详情"
+                    }
+                }
+            }
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+                    if (type != "3"){
+                        val selectDataList = arrayListOf(
+                            SelectData(
+                                id = "1",
+                                value = "个人"
+                            ),
+                            SelectData(
+                                id = "2",
+                                value = "企业"
+                            )
+                        )
+                        creatBottomSheetDialog("请选择发票类型", selectDataList) {
+                            selectInvoiceType.postValue(this)
+                        }
+                    }
+
+                }
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "发票类型"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    selectInvoiceType.bindOptional(context) {
+                        text = it?.value
+                        textColorInt = R.color.rma_black_33
+                    }
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(wrapContent, wrapContent)
+
+                emptyView()
+
+                imageView {
+                    if (type == "3"){
+                        visibility = View.GONE
+                    }else{
+                        visibility = View.VISIBLE
+                    }
+                    imageResource = R.mipmap.rma_more
+                }.lparams(autoSize(36), autoSize(36)) {
+                    marginEnd = autoSize(25)
+                }
+
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "发票抬头"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(autoSize(250), autoSize(132))
+
+                editText {
+                    if (type == "2" || type == "3"){
+                        setText(data.username)
+                    }
+                    if (type == "3"){
+                        isEnabled = false
+                    }
+                    invoice_looked_up_edittext = this
+                    hint = "抬头名称"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132))
+            }.lparams(matchParent, autoSize(132))
+
+            verticalLayout {
+                background = resources.getDrawable(R.color.white)
+                selectInvoiceType.bindOptional(context){
+                    if (it?.id == "1"){
+                        visibility = View.GONE
+                    }else{
+                        visibility = View.VISIBLE
+                    }
+                }
+                itemView()
+
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "税号"
+                            textSizeAuto = 31
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), autoSize(132))
+
+                    editText {
+                        if (type == "2" || type == "3"){
+                            setText(data.taxpayerid)
+                        }
+                        if (type == "3"){
+                            isEnabled = false
+                        }
+                        taxpayer_identification_number = this
+                        hint = "纳税人识别号"
+                        background = null
+                        inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(132))
+                }.lparams(matchParent, autoSize(132))
+
+                itemView()
+
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "开户银行"
+                            textSizeAuto = 31
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), autoSize(132))
+
+                    editText {
+                        if (type == "2" || type == "3"){
+                            setText(data.receiptbank)
+                        }
+                        if (type == "3"){
+                            isEnabled = false
+                        }
+                        bank_name_edit = this
+                        hint = "选填"
+                        background = null
+                        inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(132))
+                }.lparams(matchParent, autoSize(132))
+
+                itemView()
+
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "银行账号"
+                            textSizeAuto = 31
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), autoSize(132))
+
+                    editText {
+                        if (type == "2" || type == "3"){
+                            setText(data.receiptaccount)
+                        }
+                        if (type == "3"){
+                            isEnabled = false
+                        }
+                        bank_account = this
+                        hint = "选填"
+                        background = null
+                        inputType = EditorInfo.TYPE_CLASS_NUMBER
+//                    setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(132))
+                }.lparams(matchParent, autoSize(132))
+
+                itemView()
+
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "企业地址"
+                            textSizeAuto = 31
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), autoSize(132))
+
+                    editText {
+                        if (type == "2" || type == "3"){
+                            setText(data.address)
+                        }
+                        if (type == "3"){
+                            isEnabled = false
+                        }
+                        address_edittext = this
+                        hint = "选填"
+                        background = null
+                        inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(132))
+                }.lparams(matchParent, autoSize(132))
+
+                itemView()
+
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "企业电话"
+                            textSizeAuto = 31
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), autoSize(132))
+
+                    editText {
+                        if (type == "2" || type == "3"){
+                            setText(data.contactinfo)
+                        }
+                        if (type == "3"){
+                            isEnabled = false
+                        }
+                        phone_number = this
+                        hint = "选填"
+                        background = null
+                        inputType = EditorInfo.TYPE_CLASS_NUMBER
+//                    setDecimalInputType()
+                        hintColorStr = "#CCCCCC"
+                        textSizeAuto = 31
+                        textColorStr = "#333333"
+                    }.lparams(matchParent, autoSize(132))
+                }.lparams(matchParent, autoSize(132))
+            }.lparams(matchParent, wrapContent)
+
+
+            verticalEmptyView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    onThrottleFirstClick {
+                        if (check()){
+                            return@onThrottleFirstClick
+                        }
+                        viewModel.userReceiptInfoReq(UserName = invoice_looked_up_edittext.text.toString(),
+                            ReceiptType = selectInvoiceType.value?.id?.toInt() ?: 0,
+                            TaxpayerID = taxpayer_identification_number.text.toString(),
+                            ContactInfo = phone_number.text.toString(),
+                            ReceiptInfoId = data.autoid?.toLong() ?: 0,
+                            ReceiptBank = bank_name_edit.text.toString(),
+                            ReceiptAccount = bank_account.text.toString(),
+                            Address = address_edittext.text.toString()){
+                            finish()
+                        }
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "提交"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(0, autoSize(119),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(144))
+        }
+    }
+
+    fun check() : Boolean{
+        var returnBoolean = false
+
+        if (invoice_looked_up_edittext.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入抬头名称")
+            return true
+        }
+
+        if (selectInvoiceType.value?.id == "2"){
+            if (taxpayer_identification_number.text.toString().isNullOrEmpty()){
+                ToastUtils.showLong("请输入纳税人识别号")
+                return true
+            }
+        }
+        return returnBoolean
+    }
+
+}

+ 107 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/InvoiceInformationActivity.kt

@@ -0,0 +1,107 @@
+package cn.muchinfo.rma.view.base.main.invoice
+
+import android.content.Intent
+import android.os.Bundle
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.global.data.WrUserReceiptInfoData
+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.home.spotmarket.AddSpotMarketPriceActivity
+import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewHolder
+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.matchParent
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 发票信息页面
+ * @property swipeToLayout SwipeToLoadLayout
+ * @property statusLayout StatusLayout
+ * @property spotMarketPriceAdapter BaseAdapter<WrUserReceiptInfoData, InvoiceInformationViewHolder>
+ * @property dialog Dialog
+ */
+class InvoiceInformationActivity : BaseActivity<InvoiceInformationViewModel>(){
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    private val spotMarketPriceAdapter: BaseAdapter<WrUserReceiptInfoData, InvoiceInformationViewHolder> =
+        BaseAdapter { _, _ ->
+            InvoiceInformationViewHolder(
+                this,
+                viewModel
+            )
+        }
+
+    override fun onResume() {
+        super.onResume()
+        viewModel.queryWrUserReceiptInfo()
+    }
+
+    private val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
+            viewModel.queryWrUserReceiptInfo()
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "发票信息"
+                }
+                commonMenuButton(R.mipmap.add_new) {
+                    val intent = Intent()
+                    intent.putExtra("type","1")
+                    intent.putExtra("data",WrUserReceiptInfoData())
+                    intent.setClass(context,AddInvoiceInformationActivity::class.java)
+                    ActivityUtils.startActivity(intent)
+                }
+            }
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                setRetryAction {
+                    viewModel.queryWrUserReceiptInfo()
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.queryWrUserReceiptInfo()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = spotMarketPriceAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.receiptInfoDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    spotMarketPriceAdapter.setNewData(it)
+                }
+            }
+        }
+    }
+
+}

+ 310 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/InvoiceInformationViewHolder.kt

@@ -0,0 +1,310 @@
+package cn.muchinfo.rma.view.base.main.invoice
+
+import android.annotation.SuppressLint
+import android.content.Intent
+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.WrUserReceiptInfoData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.spotmarket.AddSpotMarketPriceActivity
+import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketDetailsActivity
+import com.blankj.utilcode.util.ActivityUtils
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import mtp.polymer.com.autowidget.dialog.createWarningDialog
+import org.jetbrains.anko.*
+
+/**
+ * 发票信息viewholder
+ * @property activity AppCompatActivity
+ * @property viewModel InvoiceInformationViewModel
+ * @constructor
+ */
+class InvoiceInformationViewHolder(
+    private val activity: AppCompatActivity,
+    private val viewModel: InvoiceInformationViewModel
+) : BaseViewHolder<WrUserReceiptInfoData>(activity) {
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    @SuppressLint("SetTextI18n")
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            onThrottleFirstClick {
+                viewModel.setOnItemClick(data.value?.autoid ?: "")
+            }
+            backgroundDrawable = createRoundRectDrawable("#ffffff", 20)
+            verticalLayout {
+                data.bindOptional(context){
+                    if (it?.receipttype == "1"){//发票类型 - 1:个人 2:企业
+                        visibility = View.GONE
+                    }else{
+                        visibility = View.VISIBLE
+                    }
+                }
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    linearLayout {
+                        backgroundDrawable = createRoundRectDrawable("#828E95", 20)
+                        gravity = Gravity.CENTER
+                        textView {
+                            text = "企业"
+                            textSizeAuto = 25
+                            textColorInt = R.color.white
+                        }.lparams(wrapContent, wrapContent)
+                    }.lparams(autoSize(60), autoSize(36)){
+                        marginStart = autoSize(24)
+                    }
+
+                    textView {
+                        data.bindOptional(context){
+                            text = it?.username
+                        }
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(24)
+                    }
+
+                    emptyView()
+
+                    linearLayout {
+                        data.bindOptional(context){
+                            if (it?.isdefault == "0"){
+                                visibility = View.GONE
+                            }else{
+                                visibility = View.VISIBLE
+                            }// 0:否 1:是
+                        }
+                        backgroundDrawable = createRoundRectDrawable("#FFE8D3", 20)
+                        gravity = Gravity.CENTER
+                        textView {
+                            text = "默认"
+                            textSizeAuto = 25
+                            textColorStr = "#FF881D"
+                        }.lparams(wrapContent, wrapContent)
+                    }.lparams(autoSize(84), autoSize(43)){
+                        marginEnd = autoSize(24)
+                    }
+
+                    textView {
+                        data.bindOptional(context){
+                            if (it?.isdefault == "0"){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }// 0:否 1:是
+                        }
+                        onThrottleFirstClick {
+                            activity.createWarningDialog {
+                                setTitle("温馨提示")
+                                setMessage("确定删除此现货市价吗?")
+                                addAction("取消") { dialog, _ ->
+                                    dialog.dismiss()
+                                }
+                                addAction("确定") { dialog, _ ->
+                                    dialog.dismiss()
+
+                                }
+                            }.show()
+
+                        }
+                        backgroundResource = R.drawable.rma_item_click_bg
+                        gravity = Gravity.CENTER
+                        text = "设为默认"
+                        textColorInt = R.color.rma_item_click_color
+                        textSizeAuto = 26
+                    }.lparams(autoSize(120), autoSize(48)) {
+                        marginEnd = autoSize(24)
+                    }
+                }.lparams(matchParent, autoSize(85))
+
+                itemView()
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        data.bindOptional(context){
+                            text = "税号  " + it?.taxpayerid
+                        }
+                        textSizeAuto = 31
+                        textColorStr = "#666666"
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(50)
+                    }
+                }.lparams(matchParent, autoSize(84))
+            }.lparams(matchParent, autoSize(170))
+
+            linearLayout {
+                data.bindOptional(context){
+                    if (it?.receipttype == "2"){//发票类型 - 1:个人 2:企业
+                        visibility = View.GONE
+                    }else{
+                        visibility = View.VISIBLE
+                    }
+                }
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    backgroundDrawable = createRoundRectDrawable("#828E95", 20)
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "企业"
+                        textSizeAuto = 25
+                        textColorInt = R.color.white
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(60), autoSize(36)){
+                    marginStart = autoSize(24)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.username
+                    }
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(24)
+                }
+
+                emptyView()
+
+                linearLayout {
+                    data.bindOptional(context){
+                        if (it?.isdefault == "0"){
+                            visibility = View.GONE
+                        }else{
+                            visibility = View.VISIBLE
+                        }// 0:否 1:是
+                    }
+                    backgroundDrawable = createRoundRectDrawable("#FFE8D3", 20)
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "默认"
+                        textSizeAuto = 25
+                        textColorStr = "#FF881D"
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(84), autoSize(43)){
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        if (it?.isdefault == "0"){
+                            visibility = View.VISIBLE
+                        }else{
+                            visibility = View.GONE
+                        }// 0:否 1:是
+                    }
+                    onThrottleFirstClick {
+                        activity.createWarningDialog {
+                            setTitle("温馨提示")
+                            setMessage("确定删除此现货市价吗?")
+                            addAction("取消") { dialog, _ ->
+                                dialog.dismiss()
+                            }
+                            addAction("确定") { dialog, _ ->
+                                dialog.dismiss()
+
+                            }
+                        }.show()
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "设为默认"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+            }.lparams(matchParent, autoSize(120))
+
+            // 控制区
+            linearLayout {
+                data.bindOptional(context) {
+                    if (it?.isOnClick == 0) {
+                        visibility = View.GONE
+                    } else if (it?.isOnClick == 1) {
+                        visibility = View.VISIBLE
+                    }
+                }
+                gravity = Gravity.CENTER_VERTICAL
+
+                emptyView()
+
+                textView {
+
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","2")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, AddSpotMarketPriceActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "修改"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    visibility = View.GONE //任务 #95309
+//                    if (GlobalDataCollection.instance?.getSecondLevelMenu(firstCode = "client_spotmarketprice",secondCode = "client_spotmarketprice_delete") == true){
+//                        visibility = View.VISIBLE
+//                    }else{
+//                        visibility = View.GONE
+//                    }
+                    onThrottleFirstClick {
+                        activity.createWarningDialog {
+                            setTitle("温馨提示")
+                            setMessage("确定删除此现货市价吗?")
+                            addAction("取消") { dialog, _ ->
+                                dialog.dismiss()
+                            }
+                            addAction("确定") { dialog, _ ->
+                                dialog.dismiss()
+
+                            }
+                        }.show()
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "删除"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, SpotMarketDetailsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "详情"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(72))
+        }.lparams(matchParent, wrapContent) {
+            marginEnd = autoSize(24)
+            marginStart = autoSize(24)
+            topMargin = autoSize(20)
+        }
+    }
+
+}

+ 131 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/invoice/InvoiceInformationViewModel.kt

@@ -0,0 +1,131 @@
+package cn.muchinfo.rma.view.base.main.invoice
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.global.data.WrUserReceiptInfoData
+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
+ */
+class InvoiceInformationViewModel : BaseViewModel() {
+
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
+     * 发票信息列表数据
+     */
+    val receiptInfoDataList: MutableLiveData<List<WrUserReceiptInfoData>> = MutableLiveData()
+
+    fun setOnItemClick(autoid : String){
+        val oldList = receiptInfoDataList.value
+        val newDataList = arrayListOf<WrUserReceiptInfoData>()
+        oldList?.forEach {
+            if (autoid == it.autoid){
+                if (it.isOnClick == 0){
+                    newDataList.add(it.copy(isOnClick = 1))
+                }else{
+                    newDataList.add(it.copy(isOnClick = 0))
+                }
+            }else{
+                newDataList.add(it.copy(isOnClick = 0))
+            }
+        }
+        receiptInfoDataList.postValue(newDataList)
+    }
+
+    /**
+     * 查询发票信息
+     */
+    fun queryWrUserReceiptInfo() {
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.spotManager?.queryWrUserReceiptInfo(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                receiptInfoDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 新增修改用户发票信息请求
+     */
+    fun userReceiptInfoReq(
+        UserName : String = "",//发票抬头姓名
+        ReceiptType : Int = 0,//发票类型
+        TaxpayerID : String = "",//纳税人识别号
+        ContactInfo : String = "",//联系方式
+        ReceiptInfoId : Long = 0,//修改时填用户发票信息id
+        ReceiptBank : String = "",//发票开户行[发票类型:企业]
+        ReceiptAccount : String = "",//发票帐号[发票类型:企业]
+        Address : String = "",//地址[发票类型:企业
+        IDNum : String = "",//身份证号码[发票类型:个人]
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.spotManager?.userReceiptInfoReq(
+                UserName = UserName,
+                ReceiptType = ReceiptType,
+                TaxpayerID = TaxpayerID,
+                ContactInfo = ContactInfo,
+                ReceiptInfoId = ReceiptInfoId,
+                ReceiptBank = ReceiptBank,
+                ReceiptAccount = ReceiptAccount,
+                Address = Address,
+                IDNum = IDNum
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
+
+    /**
+     * 删除用户发票信息请求
+     */
+    fun delUserReceiptInfoReq(
+        ReceiptInfoId : Long = 0,
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.spotManager?.delUserReceiptInfoReq(
+                ReceiptInfoId = ReceiptInfoId
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
+}

+ 208 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/phonebinding/PhoneBindingActivity.kt

@@ -0,0 +1,208 @@
+package cn.muchinfo.rma.view.base.main.phonebinding
+
+import android.os.Bundle
+import android.text.InputType
+import android.view.Gravity
+import android.view.View
+import android.widget.EditText
+import android.widget.TextView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.tool.IdentifyTextUtils
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemPaddingView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+
+/**
+ * 手机绑定/解绑页面
+ * @property dialog Dialog
+ * @property phone_number EditText
+ * @property version_code EditText
+ * @property mail_btn TextView
+ */
+class PhoneBindingActivity : BaseActivity<PhoneBindingViewModel>(){
+
+    private val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
+    //输入的手机号码
+    lateinit var phone_number : EditText
+
+    //输入的短信验证码
+    lateinit var version_code : EditText
+
+    //获取验证码按钮
+    lateinit var mail_btn: TextView
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "手机绑定/解绑"
+                }
+            }
+
+            linearLayout {
+                visibility = View.GONE
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "12412412412"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                emptyView()
+
+                linearLayout {
+                    backgroundDrawable = createRoundRectDrawable("#828E95", 20)
+                    gravity = Gravity.CENTER
+                    textView {
+                        text = "解锁"
+                        textSizeAuto = 26
+                        textColorInt = R.color.white
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(80), autoSize(36)){
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+
+            verticalLayout {
+                visibility = View.VISIBLE
+                background = resources.getDrawable(R.color.white)
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "手机号码"
+                        textSizeAuto = 29
+                        textColorInt = R.color.hint_text_color
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(matchParent, autoSize(66))
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+
+                    textView {
+                        text = "+86"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                    editText {
+                        hintColorStr = "#DDDDDD"
+                        textColorInt = R.color.rma_black_33
+                        phone_number = this
+                        inputType = InputType.TYPE_CLASS_PHONE
+                        hint = "请输入手机号码"
+                        background = null
+                        textSizeAuto = 34
+                    }.lparams(0, wrapContent, 1f) {
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(matchParent, autoSize(100))
+            }.lparams(matchParent, autoSize(166))
+
+            itemPaddingView()
+
+
+            verticalLayout {
+                visibility = View.VISIBLE
+                background = resources.getDrawable(R.color.white)
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "短信验证码"
+                        textSizeAuto = 29
+                        textColorInt = R.color.hint_text_color
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(matchParent, autoSize(66))
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    editText {
+                        hintColorStr = "#DDDDDD"
+                        textColorInt = R.color.rma_black_33
+                        version_code = this
+                        hint = "请输入短信验证码"
+                        background = null
+                        textSizeAuto = 34
+                    }.lparams(0, wrapContent, 1f) {
+                        marginStart = autoSize(36)
+                    }
+
+                    textView {
+                        onThrottleFirstClick {
+                            if (!NumberUtils.isTelePhoneNoLong(
+                                    phone_number.getText().toString()
+                                )
+                            ) {  //是否是手机号
+                                ToastUtils.showLong("请输入正确的手机号码")
+                                return@onThrottleFirstClick
+                            }
+                            viewModel.sendCode(
+                                pnonenumber = phone_number.getText().toString()
+                            ){
+                                val utils = IdentifyTextUtils(mail_btn, context)  //初始化计时器
+                                utils.startTimer()
+                            }
+                        }
+                        mail_btn = this
+                        text = "获取验证码"
+                        textSizeAuto = 34
+                        textColorStr = "#FF9F30"
+                    }.lparams(wrapContent, wrapContent){
+                        marginEnd = autoSize(36)
+                    }
+                }.lparams(matchParent, autoSize(100))
+            }.lparams(matchParent, autoSize(166))
+
+            verticalEmptyView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    onThrottleFirstClick {
+                        if (phone_number.text.toString().isNullOrEmpty()){
+                            ToastUtils.showLong("请输入手机号码")
+                            return@onThrottleFirstClick
+                        }
+
+                        if (version_code.text.toString().isNullOrEmpty()){
+                            ToastUtils.showLong("请输入短信验证码")
+                            return@onThrottleFirstClick
+                        }
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "提交"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(0, autoSize(119),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(144))
+        }
+    }
+
+}

+ 50 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/phonebinding/PhoneBindingViewModel.kt

@@ -0,0 +1,50 @@
+package cn.muchinfo.rma.view.base.main.phonebinding
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.view.base.BaseViewModel
+import cn.muchinfo.rma.view.base.app.Constant
+import com.blankj.utilcode.util.LogUtils
+import com.blankj.utilcode.util.SPUtils
+import com.zhy.http.okhttp.OkHttpUtils
+import com.zhy.http.okhttp.callback.StringCallback
+import mtp.polymer.com.autowidget.utils.TaskUiModel
+import okhttp3.Call
+
+/**
+ * 手机绑定解绑的viewmodel
+ */
+class PhoneBindingViewModel : BaseViewModel(){
+
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+
+
+    fun sendCode(pnonenumber : String,isSuccess: (isCompleted: Boolean) -> Unit){
+        OkHttpUtils.get()
+            .url(SPUtils.getInstance().getString(Constant.openApiUrl) + "/verifycode/identifyCode/" + pnonenumber)
+            .build()
+            .execute(object : StringCallback() {
+                override fun onResponse(response: String?, id: Int) {
+                    LogUtils.d("dhasfhkajhlka", response)
+                    isSuccess.invoke(true)
+//                    val gson = Gson()
+//                    val allData = gson.fromJson(response, VerificationCodeData::class.java)
+//                    if (allData.success) {
+////                        loadingDialogStatus.value = TaskUiModel.success()
+//                        imageCode.value = allData.msg
+//                    } else {
+////                        loadingDialogStatus.value =
+////                            TaskUiModel.failed(Throwable(message = allData.msg))
+//                    }
+                }
+
+                override fun onError(call: Call?, e: java.lang.Exception?, id: Int) {
+//                    loadingDialogStatus.value = TaskUiModel.failed(Throwable(message = e?.message))
+                    LogUtils.d("dhasfhkajhlka", e?.message)
+                }
+            })
+    }
+}