Browse Source

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

Liu.bolan 4 năm trước cách đây
mục cha
commit
661a2e50e8
20 tập tin đã thay đổi với 712 bổ sung97 xóa
  1. 4 0
      RMA/app/src/main/AndroidManifest.xml
  2. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/money/MoneyManager.kt
  3. 47 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountInOutApplyData.kt
  4. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt
  5. 148 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/WebActivity.kt
  6. 6 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  7. 23 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/HomeViewModel.kt
  8. 94 20
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt
  9. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/PayViewModel.kt
  10. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/CastSurelyDetailsActivity.kt
  11. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/CastSurelyDetailsViewHolder.kt
  12. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyViewHolder.kt
  13. 124 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithDrawLogActivity.kt
  14. 80 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithDrawLogViewHolder.kt
  15. 85 34
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithDrawManagementActivity.kt
  16. 33 15
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalActivity.kt
  17. 20 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalViewModel.kt
  18. 1 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeActivity.kt
  19. 3 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PositionDetailsActivity.kt
  20. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PositionViewHolder.kt

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

@@ -342,6 +342,10 @@
         <activity android:name=".view.base.platinumtreasure.PlatinumTrasureDetailsActivity"/>
 
         <activity android:name=".view.base.home.InformationDetailsActivity"/>
+
+        <activity android:name=".view.base.WebActivity"/>
+
+        <activity android:name=".view.base.main.withdrawmanagement.WithDrawLogActivity"/>
     </application>
 
 </manifest>

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

@@ -363,4 +363,31 @@ class MoneyManager {
             }
         )
     }
+
+
+    /**
+     * 查询充值提现
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryAccountInOutApply(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AccountInOutApplyData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Qhj/QueryAccountInOutApply",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AccountInOutApplyData>>>() {
+                override fun onResponse(response: BaseResult<List<AccountInOutApplyData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
 }

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

@@ -0,0 +1,47 @@
+package cn.muchinfo.rma.global.data
+
+//充值提现
+data class AccountInOutApplyData(
+    val accountcode : String = "",//资金账号
+    val accountname : String = "",//用户名称(名称)
+    val accountpwd : String = "",//资金密码
+    val accountticket : String = "",//最新账户服务流水号
+    val amount : String = "",//金额
+    val applyremark : String = "",//申请备注
+    val applystatus : String = "",//申请状态 - 1:待审核 2:待复审 3:初审拒绝 4:交易冻结中 5:交易解冻中 6:交易解冻扣款中 7:交易入金中 8:交易冻结/解冻/扣款中(银行发起出金时用) 9:银行出金中 10:银行入金中 11:成功 12:失败 13:银行审核中 14:账户服务入金失败; 15:账户服务解冻失败; 16:账户服务解冻扣款失败; 17:账户服务出金失败 18:复审通过 19:复审拒绝 20:提交审核,账户冻结中 21:审核拒绝,账户解冻中;22: 待审核,账户服务解冻回滚中; 23:待复审,账户服务解冻回滚中; 24: 审核通过,账户冻结金额检查中;25: 复审通过,账户冻结金额检查中;
+    val auditid : String = "",//审核人
+    val audittime : String = "",//审核时间
+    val bank_apply_ticket : String = "",//银行申请流水
+    val bankaccountname : String = "",//银行账户名
+    val bankaccountno : String = "",//银行卡号
+    val bankid : String = "",//银行编号
+    val bankticket : String = "",//银行流水
+    val branchbankid : String = "",//银行支行号
+    val branchbankname : String = "",//银行支行名称
+    val capamountout : String = "",//出金(劣后本金) - 外部子账户
+    val certificatephotourl : String = "",//凭证地址
+    val charge : String = "",//手续费
+    val checkerrorflag : String = "",//对账差错标志 - 1:为单边账;其它为正常出入金
+    val currency : String = "",//币种
+    val cusbankid : String = "",//托管银行编号
+    val exchticket : String = "",//银行服务流水号
+    val executetype : String = "",//申请类型 - 1:出金 2:入金 3: 单边账调整:入金; 4:单边账调整:出金 5:外部母账户调整:入金 6:外部母账户调整:出金 7:外部子账户:入金 8:外部子账户:出金
+    val extendinfo : String = "",//扩展信息
+    val extoperateid : String = "",//交易服务流水号
+    val infamount : String = "",//劣后金额(自有)
+    val logincode : String = "",//登录账号(账号)
+    val netaddr : String = "",//调转网址
+    val priamount : String = "",//优先金额(授信)
+    val reauditid : String = "",//复审人
+    val reauditremark : String = "",//复审备注
+    val reaudittime : String = "",//复审时间
+    val relatedorderid : String = "",//三方关联ID
+    val remark : String = "",//备注
+    val remark2 : String = "",//备注(失败原因)
+    val soucreamount : String = "",//原始出入金金额
+    val soucrecurrencyid : String = "",//原始出入金币种
+    val tradedate : String = "",//交易日(yyyyMMdd)
+    val updatetime : String = "",//更新时间(申请时间)
+    val userid : String = "",//用户id
+    val userinfotype : String = ""//账户类型 1-个人 2-企业
+)

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt

@@ -50,7 +50,7 @@ class MainViewModel : BaseViewModel() {
         MyApplication.getInstance()?.bankManager?.queryBankAccountSign(params = params){isSuccess, respData, error ->
             if (isSuccess){
                 if (respData?.size ?: 0 > 0){
-                    GlobalDataCollection.instance?.bankAccountSignData = respData?.get(0)
+                    GlobalDataCollection.instance?.bankAccountSignData = respData?.find { it.signstatus == "4" }
                 }
             }
         }

+ 148 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/WebActivity.kt

@@ -0,0 +1,148 @@
+package cn.muchinfo.rma.view.base
+
+import android.content.Intent
+import android.graphics.Bitmap
+import android.net.Uri
+
+import android.os.Bundle
+
+import android.widget.FrameLayout
+import android.widget.TextView
+import androidx.appcompat.app.AppCompatActivity
+import androidx.core.content.ContextCompat
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.MainViewModel
+import cn.muchinfo.rma.view.autoWidget.*
+
+import com.tencent.smtt.sdk.WebChromeClient
+import com.tencent.smtt.sdk.WebSettings
+
+import com.tencent.smtt.sdk.WebView
+import com.tencent.smtt.sdk.WebViewClient
+import org.jetbrains.anko.custom.ankoView
+import org.jetbrains.anko.frameLayout
+import org.jetbrains.anko.verticalLayout
+import java.net.URISyntaxException
+import java.util.concurrent.atomic.AtomicBoolean
+
+
+@Suppress("DEPRECATION")
+class WebActivity : AppCompatActivity() {
+
+    private var webView: WebView? = null
+    lateinit var pageTitle: TextView
+    private val initPage: AtomicBoolean = AtomicBoolean(false)
+    private lateinit var statusLayout: StatusLayout
+    private lateinit var content: FrameLayout
+
+    val url  by lazy {
+        intent.getStringExtra("url")
+    }
+
+//    private val isHtml by lazy {
+//        //之前只有html和url。1是html 3是pdf
+//        intent.getStringExtra("isHtml")
+//    }
+
+    val titleString  by lazy {
+        intent.getStringExtra("title")
+    }
+
+//    private val pdfViewAdapter: BaseAdapter<Bitmap, PdfViewHolder> = BaseAdapter { _, _ -> PdfViewHolder(context = this) }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = ContextCompat.getDrawable(this@WebActivity, R.color.white)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    pageTitle = this
+                }
+
+            }
+
+            statusLayout = statusLayout(contentBlock = {
+                frameLayout().apply { content = this }
+            })
+
+            content.showWeb(url ?: "")
+        }
+    }
+
+    private fun FrameLayout.showPDF(pdfName: String) {
+        pageTitle.text = titleString
+//        imageView {
+//            val bitmap =  FileUtils.fileToBitmap(com.blankj.utilcode.util.FileUtils.getFileName(FileUtils.fileFromAsset(context, "MaraginProtocol.pdf")))
+//            val bitmapS =  FileUtils.pdfToBitmap(FileUtils.fileFromAsset(context, "MaraginProtocol.pdf"),context)
+//            val bitmap = ImageUtils.getBitmap(FileUtils.fileFromAsset(context, "MaraginProtocol.pdf"), autoSize(900),autoSize(1300).times(bitmapS.size))
+//            setImageBitmap(bitmap)
+//        }
+//        recyclerView {
+//            background = resources.getDrawable(R.color.manager_title_bg)
+//            adapter = pdfViewAdapter
+//        }
+//
+//        val bitmapS = FileUtils.pdfToBitmap(FileUtils.fileFromAsset(context, "MaraginProtocol.pdf"), context)
+//        pdfViewAdapter.setNewData(bitmapS)
+    }
+
+    private fun FrameLayout.showWeb(url: String) {
+        pageTitle.text = titleString
+        ankoView({ X5WebView(context) }, theme = 0) {
+            webView = this
+            settings.cacheMode = WebSettings.LOAD_NO_CACHE
+            loadUrl(url)
+            setWebChromeClient(object : WebChromeClient() {
+                override fun onReceivedTitle(view: WebView?, title: String?) {
+//                    pageTitle.text = getString(R.string.in_money_quick)
+                    pageTitle.text = titleString
+                }
+
+                override fun onProgressChanged(webView: WebView, progress: Int) {
+                    if (initPage.get().not()) {
+                        if ((progress >= 100)) {
+                            initPage.compareAndSet(false, true)
+                            statusLayout.showSuccess()
+                        } else {
+                            statusLayout.showLoading("$progress%")
+                        }
+                    }
+                }
+            })
+
+
+            setWebViewClient(object : WebViewClient() {
+                override fun shouldOverrideUrlLoading(view: WebView?, newurl: String): Boolean {
+                    try {
+                        //处理intent协议
+                        var url = ""
+                        // 处理自定义scheme协议
+                        if (!newurl.startsWith("http")) {
+
+                            try {
+                                // 以下固定写法
+                                val intent = Intent(Intent.ACTION_VIEW,
+                                        Uri.parse(newurl))
+                                intent.flags = (Intent.FLAG_ACTIVITY_NEW_TASK
+                                        or Intent.FLAG_ACTIVITY_SINGLE_TOP)
+                                startActivity(intent)
+                            } catch (e: Exception) {
+                                // 防止没有安装的情况
+                                e.printStackTrace()
+                            }
+                            return true
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    }
+
+                    return super.shouldOverrideUrlLoading(view, newurl)
+                }
+
+            })
+        }
+
+
+    }
+}

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

@@ -10,15 +10,15 @@ object Constant {
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
-//        const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"//李倩千海金
+//        const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"//李倩千海金 18611112222
 //      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
-//          const val baseurl = "http://192.168.31.107:8080/cfg?key=test_107"// 瑶姐 千海金
+          const val baseurl = "http://192.168.31.107:8080/cfg?key=test_107"// 瑶姐 千海金 13760119855
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
 //    const val baseurl = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
 
 //     const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
-    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境
+//    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境
 //    const val baseurl = "http://192.168.21.71:8280/cfg?key=mtp_20"
 
     /**
@@ -271,4 +271,7 @@ object Constant {
 
     //订阅持仓汇总的tag
     const val position_tag = "position_tag"
+
+    //支付宝支付地址
+    const val alipay_path = "http://192.168.31.91:6069/bank_alipay/pay"
 }

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

@@ -50,6 +50,11 @@ class HomeViewModel : BaseViewModel(){
      */
     val noticeDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
 
+    /**
+     * 首页消息
+     */
+    val messageDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
+
     val pendingAudit : MutableLiveData<PendingAuditInfoData> = MutableLiveData()
 
     /**
@@ -103,7 +108,7 @@ class HomeViewModel : BaseViewModel(){
             bannerUrlList.add(SPUtils.getInstance().getString(Constant.openApiUrl) + it.imagepath.substring(1))
         }
         bannerList.postValue(datalist.remove {
-            it.isshow == "1"
+            it.isshow == "0"
         })
     }
 
@@ -122,6 +127,7 @@ class HomeViewModel : BaseViewModel(){
     fun queryNotice(){
         val params = mutableMapOf<String, String>().apply {
             put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+            put("msgType","1")
         }
 
         MyApplication.getInstance()?.commonManager?.queryNotice(params = params){ isSuccess, respData, error ->
@@ -132,6 +138,22 @@ class HomeViewModel : BaseViewModel(){
     }
 
     /**
+     * 通知公告查询
+     */
+    fun queryMessage(){
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+            put("msgType","2")
+        }
+
+        MyApplication.getInstance()?.commonManager?.queryNotice(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                messageDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
      * 查询未读消息数
      */
     fun queryPendingAuditInfo(){

+ 94 - 20
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt

@@ -28,6 +28,7 @@ import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.getAppCompatActivity
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.WebActivity
 import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity
 import cn.muchinfo.rma.view.base.home.accountmanager.AccountManagerActivity
@@ -83,6 +84,7 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
     private val announcementUI: NewAnnouncementUI by lazy { NewAnnouncementUI(this, viewModel) }//公告
     private val researchReportUI: NewResearchReportUI by lazy { NewResearchReportUI(this, viewModel) }//研报
     private val informationUI: NewInformationUI by lazy { NewInformationUI(this, viewModel) }//咨讯
+    private val messageUI: MessageUI by lazy { MessageUI(this, viewModel) }//消息
 
 
     val menuTab: MutableLiveData<Int> = MutableLiveData<Int>().apply { value = 0 }//用于控制菜单页切换后的点点显示
@@ -142,28 +144,46 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
     }
     lateinit var userImage: ImageView
 
-    private val tabsArray: List<String> by lazy { arrayListOf("公告", "研报", "资讯") }
 
-    private val pagerAdapter: PagerAdapter by lazy {
-        object : PagerAdapter() {
+    //viewpager的适配器
+    private var pagerAdapter : PagerAdapter? = null
+
+    //tabSegment标题
+    private val tabsArray : ArrayList<String> = arrayListOf()
+
+    //暂存的页面组
+    private val uiMessageList : ArrayList<_FrameLayout> = arrayListOf()
+
+
+
+    fun initMessageMenuData(){
+        if (GlobalDataCollection.instance?.getFirstLevelMenu("client_qhjbjb") == true){
+            tabsArray.add("资讯")
+            uiMessageList.add(informationUI.root)
+            tabsArray.add("公告")
+            uiMessageList.add(announcementUI.root)
+            tabsArray.add("消息")
+            uiMessageList.add(messageUI.root)
+        }else{
+            tabsArray.add("公告")
+            uiMessageList.add(announcementUI.root)
+            tabsArray.add("资讯")
+            uiMessageList.add(informationUI.root)
+            tabsArray.add("研报")
+            uiMessageList.add(researchReportUI.root)
+        }
+
+        pagerAdapter = object : PagerAdapter() {
 
             override fun getPageTitle(position: Int): CharSequence? = tabsArray[position]
 
             override fun instantiateItem(container: ViewGroup, position: Int): Any {
-                if (position == 0) {
-                    return announcementUI.root.apply {
-                        container.addView(this, ViewGroup.LayoutParams(matchParent, matchParent))
-                    }
-                } else if (position == 1) {
-                    return researchReportUI.root.apply {
-                        container.addView(this, ViewGroup.LayoutParams(matchParent, matchParent))
-                    }
-                } else if (position == 2) {
-                    return informationUI.root.apply {
-                        container.addView(this, ViewGroup.LayoutParams(matchParent, matchParent))
-                    }
+                return uiMessageList.get(position).apply {
+                    container.addView(
+                        this,
+                        ViewGroup.LayoutParams(matchParent, matchParent)
+                    )
                 }
-                return super.instantiateItem(container, position)
             }
 
             override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
@@ -175,6 +195,7 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
             override fun getCount(): Int = tabsArray.size
 
         }
+
     }
 
     override fun onResume() {
@@ -215,9 +236,8 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
         savedInstanceState: Bundle?
     ): View? {
         return UI {
-            // FIXME: - test
-//            viewModel.login()
             initDataMenuTab()
+            initMessageMenuData()
             viewModel.homeMenuTabList.postValue(GlobalDataCollection.instance?.homeMenuTabName)
             viewModel.getBanner()
 
@@ -243,7 +263,11 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
                         }
                         textView {
                             viewModel.loginQueryData.bindOptional(context) {
-                                text = it?.username + "(" + it?.loginAccount?.logincode + ")"
+                                if (Constant.IS_QHJ){
+                                    text = "(" + it?.userInfo?.customername + ")"
+                                }else{
+                                    text = it?.username + "(" + it?.loginAccount?.logincode + ")"
+                                }
                             }
                             textColorStr = "#AED6F0"
                             textSizeAuto = 29
@@ -309,7 +333,11 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
                                 }
                                 setDelegate { banner, itemView, model, position ->
                                     val data = model as BannerData
-                                    ToastUtils.showLong(data.url + "2-----")
+                                    val intent = Intent()
+                                    intent.putExtra("url",data.url)
+                                    intent.putExtra("title",data.title)
+                                    intent.setClass(context,WebActivity::class.java)
+                                    ActivityUtils.startActivity(intent)
                                 }
 //                                setDelegate(new BGABanner.Delegate() {
 //                                    @Override
@@ -531,6 +559,52 @@ class NewAnnouncementUI(private val baseFragment: Fragment, private val viewModu
     }
 }
 
+/**
+ * 消息
+ */
+class MessageUI(
+    private val baseFragment: Fragment,
+    private val viewModule: HomeViewModel
+){
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    private val announcementAdapter: BaseAdapter<NoticeData, AnnouncementViewHolder> =
+        BaseAdapter { _, _ -> AnnouncementViewHolder(baseFragment, viewModule) }
+
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            viewModule.queryMessage()
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = announcementAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.messageDataList.bindOptional(context) {
+                announcementAdapter.setNewData(it)
+            }
+        }
+    }
+}
+
 
 /**
  * 研报

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

@@ -128,7 +128,7 @@ class PayViewModel : BaseViewModel(){
         json["totalAmount"] = totalAmount
         json["msgType"] = msgType
         OkHttpUtils.postString()
-            .url("http://192.168.21.71:39400/bank_scancode/pay")
+            .url(Constant.alipay_path)
             .content(json.toJSONString())
             .mediaType(MediaType.parse("application/json; charset=utf-8"))
             .build()

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

@@ -223,10 +223,10 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                     textView {
                         val qtydecimalplace = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data.goodsid?.toInt() ?: 0).qtydecimalplace
                         if (data.regularlystrategystatus == "1"){//1:正常 2:暂停 3:终止
-                            if (data?.regularlymode == "1"){//按数量
-                                text = viewModel.getCastSureRegularlyCycleValueName(data.regularlycycle ?: "",data.regularlycyclevalue ?: "") + "定投" + data.nexttriggerqty + data.enumdicname
+                            if (data.regularlymode == "1"){//按数量
+                                text = viewModel.getCastSureRegularlyCycleValueName(data.regularlycycle ?: "",data.regularlycyclevalue ?: "") + "定投" + data.regularlymodevalue + data.enumdicname
                             }else{//按金额
-                                text = viewModel.getCastSureRegularlyCycleValueName(data.regularlycycle ?: "",data.regularlycyclevalue ?: "") + "定投" + NumberUtils.roundNum(data.nexttriggeramount,2) + "元"
+                                text = viewModel.getCastSureRegularlyCycleValueName(data.regularlycycle ?: "",data.regularlycyclevalue ?: "") + "定投" + NumberUtils.roundNum(data.regularlymodevalue,2) + "元"
                             }
                         }else if (data.regularlystrategystatus == "2"){
                             text = "定投已暂停"

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

@@ -1,6 +1,8 @@
 package cn.muchinfo.rma.view.base.main.castsurely
 
+import android.annotation.SuppressLint
 import android.view.Gravity
+import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.RSTriggerLogData
@@ -18,6 +20,7 @@ import org.jetbrains.anko.*
 class CastSurelyDetailsViewHolder(private val activity: AppCompatActivity,private val viewModel: MyCastSurelyViewModel) : BaseViewHolder<RSTriggerLogData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
+    @SuppressLint("SetTextI18n")
     override fun _FrameLayout.createContentView() {
          linearLayout {
              gravity = Gravity.CENTER_VERTICAL
@@ -38,8 +41,10 @@ class CastSurelyDetailsViewHolder(private val activity: AppCompatActivity,privat
                  data.bindOptional(context){
                      if (it?.triggerstatus == "1"){
                          text = "定投成功"
-                     }else{
+                     }else if (it?.triggerstatus == "2"){
                          text = "定投失败"
+                     }else{
+                         text = "--"
                      }
                  }
                  textSizeAuto = 31
@@ -49,6 +54,7 @@ class CastSurelyDetailsViewHolder(private val activity: AppCompatActivity,privat
              }
 
              imageView {
+                 visibility = View.GONE
                 imageResource = R.mipmap.rma_more
              }.lparams(autoSize(35), autoSize(35)){
                  marginEnd = autoSize(36)

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

@@ -144,9 +144,9 @@ class MyCastSurelyViewHolder(private val activity : AppCompatActivity,private va
                             val qtydecimalplace = DataBase.getInstance().goodsInfoDao().getGoodsInfo(it?.goodsid?.toInt() ?: 0).qtydecimalplace
                             if (type == "1"){
                                 if (it?.regularlymode == "1"){//按数量
-                                    text = viewModel.getCastSureRegularlyCycleValueName(it.regularlycycle ?: "",it.regularlycyclevalue ?: "") + "定投" + it.nexttriggerqty + it.enumdicname
+                                    text = viewModel.getCastSureRegularlyCycleValueName(it.regularlycycle ?: "",it.regularlycyclevalue ?: "") + "定投" + it.regularlymodevalue + it.enumdicname
                                 }else{//按金额
-                                    text = viewModel.getCastSureRegularlyCycleValueName(it?.regularlycycle ?: "",it?.regularlycyclevalue ?: "") + "定投" + NumberUtils.roundNum(it?.nexttriggeramount,2) + "元"
+                                    text = viewModel.getCastSureRegularlyCycleValueName(it?.regularlycycle ?: "",it?.regularlycyclevalue ?: "") + "定投" + NumberUtils.roundNum(it?.regularlymodevalue,2) + "元"
                                 }
                             }else{
                                 text = "定投已终止"

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

@@ -0,0 +1,124 @@
+package cn.muchinfo.rma.view.base.main.withdrawmanagement
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.Gravity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.AccountInOutApplyData
+import cn.muchinfo.rma.global.data.RStrategyData
+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.main.castsurely.MyCastSurelyViewHolder
+import com.blankj.utilcode.util.ActivityUtils
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import org.jetbrains.anko.*
+
+/**
+ * 充值提现记录
+ */
+class WithDrawLogActivity : BaseActivity<WithdrawalViewModel>(){
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    /**
+     * 定投列表适配器
+     */
+    private val withdrawLogAdapter: BaseAdapter<AccountInOutApplyData, WithDrawLogViewHolder> =
+        BaseAdapter { _, _ ->
+            WithDrawLogViewHolder(
+                this,
+                viewModel
+            )
+        }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            viewModel.queryAccountInOutApply()
+            background = resources.getDrawable(R.color.rma_item_bg)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "充值提现记录"
+                }
+
+            }
+
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "类型/申请时间"
+                        textSizeAuto = 29
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(72),3f)
+
+                linearLayout {
+                    gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "金额"
+                        textSizeAuto = 29
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(72),2f)
+
+                linearLayout {
+                    gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "状态"
+                        textSizeAuto = 29
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginEnd = autoSize(36)
+                    }
+                }.lparams(0, autoSize(72),2f)
+            }.lparams(matchParent, autoSize(72))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                setRetryAction {
+                    viewModel.queryAccountInOutApply()
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.queryAccountInOutApply()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = withdrawLogAdapter
+                    }.lparams(org.jetbrains.anko.matchParent, org.jetbrains.anko.matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(org.jetbrains.anko.matchParent, org.jetbrains.anko.matchParent)
+
+            viewModel.withDrawLogDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    withdrawLogAdapter.setNewData(it)
+                }
+            }
+        }
+    }
+
+}

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

@@ -0,0 +1,80 @@
+package cn.muchinfo.rma.view.base.main.withdrawmanagement
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.AccountInOutApplyData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class WithDrawLogViewHolder(private val activity : AppCompatActivity,private val viewModel: WithdrawalViewModel) : BaseViewHolder<AccountInOutApplyData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            verticalLayout {
+                gravity = Gravity.LEFT
+                textView {
+                    data.bindOptional(context){
+                        text = if (it?.executetype == "1" || it?.executetype == "4" || it?.executetype == "6" || it?.executetype == "8"){
+                            "提现"
+                        }else{
+                            "充值"
+                        }
+                    }
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                    topMargin = autoSize(20)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.updatetime
+                    }
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+            }.lparams(0, autoSize(100),3f)
+
+            linearLayout {
+                gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
+                textView {
+                    data.bindOptional(context){
+                        text = NumberUtils.roundNum(it?.amount,2)
+                    }
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(0, autoSize(100),2f)
+
+            linearLayout {
+                gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
+                textView {
+                    data.bindOptional(context){
+                         if (it?.applystatus == "1"){
+                             text = "待审核"
+                         }else if (it?.applystatus == "11"){
+                             text = "已成功"
+                         }else if (it?.applystatus == "12"){
+                             text = "失败"
+                         }
+                    }
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(0, autoSize(100),2f)
+        }.lparams(matchParent, autoSize(100))
+    }
+
+}

+ 85 - 34
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithDrawManagementActivity.kt

@@ -8,12 +8,16 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.BankAccountSignData
 import cn.muchinfo.rma.global.data.CusBankSignBankData
+import cn.muchinfo.rma.global.data.RStrategyData
 import cn.muchinfo.rma.global.data.UserCollectConfigData
 import cn.muchinfo.rma.global.data.transit.SignReq
 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.main.castsurely.AddCastSurelyActivity
+import cn.muchinfo.rma.view.base.main.castsurely.MyCastSurelyHistoryActivity
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.TimeUtils
 import com.blankj.utilcode.util.ToastUtils
@@ -46,46 +50,93 @@ class WithDrawManagementActivity : BaseActivity<WithDrawManagementViewModel>() {
             )
             viewModel.userCollectConfigData.postValue(data)
             background = resources.getDrawable(R.color.rma_item_bg)
-            //页面标题
-            topBar {
-                commonLeftButton()
-                commonTitle {
-                    text = "提现账户管理"
+            linearLayout {
+                background = resources.getDrawable(R.color.rma_blue_color)
+                gravity = Gravity.CENTER_VERTICAL
+                imageView {
+                    onThrottleFirstClick {
+                        finish()
+                    }
+                    imageResource = R.mipmap.back
+                }.lparams(autoSize(48),autoSize(48)){
+                    marginStart = autoSize(36)
                 }
-                // 新增收货地址
-                commonMenuButton(R.mipmap.qhj_dian_dian) {
-                    val selectDataList = arrayListOf(
-                        SelectData(
-                            id = "1",
-                            value = "修改"
-                        ),
-                        SelectData(
-                            id = "2",
-                            value = "删除"
+                view {
+
+                }.lparams(autoSize(48),autoSize(48)){
+                    marginStart = autoSize(36)
+                }
+
+                emptyView()
+
+                textView {
+                    text = "提现账户管理"
+                    textColorInt = R.color.white
+                    textSizeAuto = 43
+                }.lparams(wrapContent, wrapContent)
+
+                emptyView()
+
+                imageView {
+                    viewModel.userCollectConfigData.bindOptional(context){
+                        if (it?.bankid.isNullOrEmpty()){
+                            visibility = View.INVISIBLE
+                        }else{
+                            visibility = View.VISIBLE
+
+                        }
+                    }
+                    onThrottleFirstClick {
+                        val selectDataList = arrayListOf(
+                            SelectData(
+                                id = "1",
+                                value = "修改"
+                            ),
+                            SelectData(
+                                id = "2",
+                                value = "删除"
+                            )
                         )
-                    )
-                    creatBottomSheetNoTitleDialog(selectDataList) {
-                        if (this.id == "1"){
-                            val intent = Intent()
-                            intent.putExtra("type","2")
-                            intent.putExtra("data",data)
-                            intent.setClass(context,AddWithDrawActivity::class.java)
-                            ActivityUtils.startActivity(intent)
-                        }else if (this.id == "2"){
-                            viewModel.T2bBankCancelSignReq(
-                                AccountCode = data.accountcode ?: "",
-                                Currency = data.currency ?: "",
-                                CusBankID = data.cusbankid ?: "",
-                                BankChildAcc = data.bankaccountno ?: "",
-                                BankChildAccName = data.bankaccountname ?: "",
-                                TradeDate = viewModel.cusBankSignBankDataList.value?.tradedate ?: ""
-                            ){
-                                viewModel.userCollectConfigData.postValue(BankAccountSignData())
+                        creatBottomSheetNoTitleDialog(selectDataList) {
+                            if (this.id == "1"){
+                                val intent = Intent()
+                                intent.putExtra("type","2")
+                                intent.putExtra("data",viewModel.userCollectConfigData.value)
+                                intent.setClass(context,AddWithDrawActivity::class.java)
+                                ActivityUtils.startActivity(intent)
+                            }else if (this.id == "2"){
+                                viewModel.T2bBankCancelSignReq(
+                                    AccountCode = data.accountcode ?: "",
+                                    Currency = data.currency ?: "",
+                                    CusBankID = data.cusbankid ?: "",
+                                    BankChildAcc = data.bankaccountno ?: "",
+                                    BankChildAccName = data.bankaccountname ?: "",
+                                    TradeDate = viewModel.cusBankSignBankDataList.value?.tradedate ?: ""
+                                ){
+                                    viewModel.userCollectConfigData.postValue(BankAccountSignData())
+                                }
                             }
                         }
                     }
+
+                    imageResource = R.mipmap.qhj_dian_dian
+                }.lparams(autoSize(48),autoSize(48)){
+                    marginEnd = autoSize(36)
                 }
-            }
+            }.lparams(com.qmuiteam.qmui.kotlin.matchParent, autoSize(120))
+//            //页面标题
+//            topBar {
+//                commonLeftButton()
+//                commonTitle {
+//                    text = "提现账户管理"
+//                }
+//                // 新增收货地址
+//                commonMenuButton(R.mipmap.qhj_dian_dian) {
+//
+//                }
+//
+//
+//            }
 
             /**
              * 无提现账户信息时空

+ 33 - 15
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalActivity.kt

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.main.withdrawmanagement
 
+import android.content.Intent
 import android.net.Uri
 import android.os.Bundle
 import android.view.Gravity
@@ -30,10 +31,7 @@ import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
 import cn.muchinfo.rma.view.base.main.withdrawmanagement.adapter.CardViewAdapter
 import cn.muchinfo.rma.view.base.main.withdrawmanagement.adapter.ScaleTransformerCardView
 import com.alibaba.fastjson.JSON
-import com.blankj.utilcode.util.ConvertUtils
-import com.blankj.utilcode.util.LogUtils
-import com.blankj.utilcode.util.SPUtils
-import com.blankj.utilcode.util.ToastUtils
+import com.blankj.utilcode.util.*
 import com.cuieney.sdk.rxpay.RxPay
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
@@ -136,6 +134,11 @@ class WithdrawalActivity : BaseActivity<WithdrawalViewModel>(){
                 commonTitle {
                     text = "充值提现"
                 }
+                commonMenuButton(R.mipmap.qhj_dian_dian) {
+                    val intent = Intent()
+                    intent.setClass(context,WithDrawLogActivity::class.java)
+                    ActivityUtils.startActivity(intent)
+                }
             }
             tabSegment {
                 segment = this
@@ -282,6 +285,8 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
 
     lateinit var amount_input : EditText
 
+    var canUseBanlance : Double = 0.0
+
     val root = _FrameLayout(activity).apply {
         verticalLayout {
             linearLayout {
@@ -316,6 +321,7 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
                             viewModel.usedAccountData.bindOptional(context){
                                 val freezeAmount = it?.freezemargin?.plus(it.otherfreezemargin)?.plus(it.freezecharge)?.plus(it.outamountfreeze)//冻结金额
                                 val balance = it?.currentbalance?.minus(freezeAmount ?: 0.0)//
+                                canUseBanlance = balance ?: 0.0
                                 text = "可提现金额 " + NumberUtils.roundNum(NumberUtils.doubleDistortion(balance?.toString()),2)
                             }
                             textSizeAuto = 31
@@ -327,6 +333,9 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
                         emptyView()
 
                         textView {
+                            onThrottleFirstClick {
+                                amount_input.setText(canUseBanlance.toString())
+                            }
                             text = "全部"
                             textSizeAuto = 31
                             textColorInt = R.color.rma_blue_color
@@ -459,8 +468,8 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
                             ToastUtils.showLong("请输入提现金额")
                             return@onThrottleFirstClick
                         }
-                        if (amount_input.text.toString() == "0"){
-                            ToastUtils.showLong("提现金额不能为0")
+                        if (amount_input.text.toString() == "0" || amount_input.text.toString() == "0.0" || amount_input.text.toString() == "0.00" || amount_input.text.toString() == "0."){
+                            ToastUtils.showLong("提现金额不能为")
                             return@onThrottleFirstClick
                         }
                         val singingInfo = viewModel.userCollectConfigData.value
@@ -473,7 +482,7 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
                             Amount = amount_input.text.toString().toDouble(),
                             extend_info = getJSONExtendInfo() ?: ""
                         ){
-                            ToastUtils.showLong("提现申请成功")
+                            amount_input.setText("")
                         }
                     }
                     gravity = Gravity.CENTER
@@ -615,7 +624,7 @@ class MoneyInOnlineUI(private val activity: WithdrawalActivity,private val viewM
                 RxPay(activity)
                     .requestAlipay(it ?: "")
                     .subscribe {
-
+                        amount_input.setText("")
                     }
 
             }
@@ -624,12 +633,15 @@ class MoneyInOnlineUI(private val activity: WithdrawalActivity,private val viewM
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
                     onThrottleFirstClick {
-//                        RxPay(activity)
-//                            .requestAlipay("alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2021002151602507&biz_content=%7B%22body%22%3A%22%E6%88%91%E6%98%AF%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%22%2C%22out_trade_no%22%3A%2220170216test01%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22subject%22%3A%22App%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95%22%2C%22timeout_express%22%3A%2230m%22%2C%22total_amount%22%3A%220.01%22%7D&charset=utf-8&format=json&method=alipay.trade.app.pay&notify_url=http%3A%2F%2Fwww.test.notify&sign=LAG%2BEkHUunMW7pd4fNZc2gzFB6l1rfkXhWPf0EZKZtun9mG8AJtAK2OJOYCSJJExdQjVzOhUHlXxAtVP3llmyiqNrHeX%2BzxKWLNqVwNKRTR39%2BLJI2fRfArFhl%2Bb3h0FWWjs%2FidbpSsGZyXjjkL7ZqaE79X4fIYdGxaQFk%2BeyQv9nEUpNiokz1fC3xFVEllUZPyjCY5Te7AAHNqoC2sVRt79v%2F%2FuySlkXfRsMP7H85vklkLGA5YPGxzwl4NqIPrU2cI57H1nLE%2F1xgEj9qKPJj9Lf3ggdnyMngimG8wuS2R1lfz8mMNepcV%2BPg71OzzpmUATrwZ49Vcs1p0S8xwxbA%3D%3D&sign_type=RSA2&timestamp=2021-06-18+17%3A35%3A21&version=1.0")
-//                            .subscribe{
-//
-//                            }
-                        viewModel.getPayInfo(totalAmount = "0.01",payType = "4",msgType = "9")
+                        if (amount_input.text.toString().isNullOrEmpty()){
+                            ToastUtils.showLong("请输入充值金额")
+                            return@onThrottleFirstClick
+                        }
+                        if (amount_input.text.toString() == "0" || amount_input.text.toString() == "0.0" || amount_input.text.toString() == "0.00" || amount_input.text.toString() == "0."){
+                            ToastUtils.showLong("充值金额不能为零")
+                            return@onThrottleFirstClick
+                        }
+                        viewModel.getPayInfo(totalAmount = amount_input.text.toString(),payType = "4",msgType = "9")
                     }
                     gravity = Gravity.CENTER
                     backgroundResource = R.mipmap.rma_submit_bg
@@ -912,6 +924,10 @@ class MoneyInOutlineUI(private val activity: WithdrawalActivity,private val view
                             ToastUtils.showLong("请输入充值金额")
                             return@onThrottleFirstClick
                         }
+                        if (amount_input.text.toString() == "0" || amount_input.text.toString() == "0.0" || amount_input.text.toString() == "0.00" || amount_input.text.toString() == "0."){
+                            ToastUtils.showLong("充值金额不能为零")
+                            return@onThrottleFirstClick
+                        }
                         if (uploadFile.isNullOrEmpty()){
                             ToastUtils.showLong("请上传充值凭证")
                             return@onThrottleFirstClick
@@ -930,7 +946,9 @@ class MoneyInOutlineUI(private val activity: WithdrawalActivity,private val view
                             Amount = amount_input.text.toString().toDouble(),
                             extend_info = getJSONExtendInfo(uploadFile) ?: ""
                         ){
-                            ToastUtils.showLong("充值成功")
+                            amount_input.setText("")
+                            uploadFile = ""
+                            imageString.postValue("")
                         }
                     }
                     gravity = Gravity.CENTER

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

@@ -3,6 +3,7 @@ package cn.muchinfo.rma.view.base.main.withdrawmanagement
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.AccountData
+import cn.muchinfo.rma.global.data.AccountInOutApplyData
 import cn.muchinfo.rma.global.data.BankAccountSignData
 import cn.muchinfo.rma.global.data.UserCollectConfigData
 import cn.muchinfo.rma.netManage.base.InteractiveException
@@ -46,6 +47,22 @@ class WithdrawalViewModel : BaseViewModel(){
     val usedAccountData : MutableLiveData<AccountData> = MutableLiveData()
 
 
+    /**
+     * 充值提现记录
+     */
+    val withDrawLogDataList : MutableLiveData<List<AccountInOutApplyData>> = MutableLiveData()
+
+    fun queryAccountInOutApply(){
+        val param = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.moneyManager?.queryAccountInOutApply(params = param){isSuccess, respData, error ->
+            if (isSuccess){
+                withDrawLogDataList.postValue(respData)
+            }
+        }
+    }
+
     //重新赋值资金账户
     fun resetAccountData(){
         val accountDataList = GlobalDataCollection.instance?.accountDataList
@@ -130,7 +147,7 @@ class WithdrawalViewModel : BaseViewModel(){
                 extend_info = extend_info
             ) { isCompleted, err ->
                 if (isCompleted) {
-                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请成功"))
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "提现申请成功,请耐心等待审核"))
                     isSuccess(true)
                 } else {
                     loadingDialogStatus.postValue(
@@ -196,7 +213,7 @@ class WithdrawalViewModel : BaseViewModel(){
                 extend_info = extend_info
             ) { isCompleted, err ->
                 if (isCompleted) {
-                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "提交成功,请耐心等待审核"))
                     isSuccess(true)
                 } else {
                     loadingDialogStatus.postValue(
@@ -226,7 +243,7 @@ class WithdrawalViewModel : BaseViewModel(){
         json["msgType"] = msgType
         LogUtils.d("dhasfhkajhlka", json.toJSONString())
         OkHttpUtils.postString()
-            .url("http://192.168.21.71:39400/bank_scancode/pay")
+            .url(Constant.alipay_path)
             .content(json.toJSONString())
             .mediaType(MediaType.parse("application/json; charset=utf-8"))
             .build()

+ 1 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeActivity.kt

@@ -171,7 +171,6 @@ class PlatinumTradeActivity : BaseActivity<PlatinumTradeViewModel>(){
         }else if (selectedTabIndex == 3){
             platinumPositionUI.refresh(quoteMessageEvent)
         }
-        viewModel.getTaAccounts()
     }
 
     //通用的消息更新通知
@@ -228,7 +227,7 @@ class PlatinumTradeActivity : BaseActivity<PlatinumTradeViewModel>(){
                     viewModel.queryContractTradeDetail()
                     viewModel.queryPayOrder()
                 }else if (it == 5){//资金
-
+                    viewModel.initAccountData()
                 }
             }
             viewModel.initAccountData()

+ 3 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PositionDetailsActivity.kt

@@ -185,7 +185,7 @@ class PositionDetailsActivity : BaseActivity<PlatinumTradeViewModel>() {
                 textView {
                     quoteDayData.bindOptional(context) {
                         val goodsInfoData = DataBase.getInstance().goodsInfoDao()
-                            .getGoodsInfo(data?.goodsid?.toInt() ?: 0)
+                            .getGoodsInfo(data.goodsid?.toInt() ?: 0)
 
                         text = NumberUtils.roundNum(
                             NumberUtils.doubleDistortion(it?.bid?.toString()),
@@ -193,13 +193,8 @@ class PositionDetailsActivity : BaseActivity<PlatinumTradeViewModel>() {
                         )
                         var differencePrice = 0.0
 
-                        if (data?.buyorsell == "0") {
-                            differencePrice =
-                                it?.bid?.minus(data.averageprice?.toDouble() ?: 0.0) ?: 0.0
-                        } else {
-                            differencePrice =
-                                it?.bid?.minus(data.averageprice?.toDouble() ?: 0.0) ?: 0.0
-                        }
+                        differencePrice =
+                            it?.bid?.minus(data.averageprice?.toDouble() ?: 0.0) ?: 0.0
 
                         if (differencePrice > 0) {
                             textColorInt = R.color.rma_red_color

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

@@ -97,7 +97,7 @@ class PositionViewHolder(
                                 }?.quoteDayData
 
 
-                            val costPrice = NumberUtils.roundNum(it?.curholderamount?.toDouble()?.div(it.curpositionqty?.toDouble() ?: 1.0)?.div(goodsInfoData.agreeunit?.toDouble() ?: 1.0).toString(),goodsInfoData.decimalplace)
+                            val costPrice = NumberUtils.roundNum(it?.curholderamount?.toDouble()?.div(it.curpositionqty?.toDouble() ?: 1.0)?.div(goodsInfoData.agreeunit.toDouble()).toString(),3)//任务96017
                             cost_price_text.text = costPrice//赋值成本价
                             var differencePrice = 0.0
 
@@ -111,12 +111,12 @@ class PositionViewHolder(
                                 textColorInt = R.color.rma_red_color
                                 now_price_text.textColorInt = R.color.rma_red_color
                                 proportion_Text.textColorInt = R.color.rma_red_color
-                                proportion_Text.text = 1.minus(costPrice?.toDouble()?.minus(differencePrice)?.div(costPrice.toDouble()) ?: 0.0)?.toString()?.toPercentage()
+                                proportion_Text.text = 1.minus(costPrice?.toDouble()?.minus(differencePrice)?.div(costPrice.toDouble()) ?: 0.0).toString().toPercentage()
                             }else if (differencePrice < 0){
                                 textColorInt = R.color.rma_green_color
                                 now_price_text.textColorInt = R.color.rma_green_color
                                 proportion_Text.textColorInt = R.color.rma_green_color
-                                proportion_Text.text = 1.minus(costPrice?.toDouble()?.plus(differencePrice)?.div(costPrice?.toDouble()) ?: 0.0)?.toString()?.toPercentage()
+                                proportion_Text.text = 1.minus(costPrice?.toDouble()?.plus(differencePrice)?.div(costPrice.toDouble()) ?: 0.0).toString().toPercentage()
                             }else{
                                 now_price_text.textColorInt = R.color.rma_black_33
                                 textColorInt = R.color.rma_black_33