فهرست منبع

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

Liu.bolan 4 سال پیش
والد
کامیت
f0b6891ffe
33فایلهای تغییر یافته به همراه362 افزوده شده و 118 حذف شده
  1. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  2. 4 4
      RMA/app/src/main/java/cn/muchinfo/rma/business/contractgoods/ContractGoodsManager.kt
  3. 1 7
      RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt
  4. 18 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/BaseGlobalData.java
  5. 19 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/BannerData.kt
  6. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/RStrategyData.kt
  7. 8 7
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/database/BannerEntity.kt
  8. 5 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt
  9. 17 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt
  10. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  11. 10 12
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/HomeViewModel.kt
  12. 35 19
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt
  13. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/register/PersonalRegisterActivity.kt
  14. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/PayActivity.kt
  15. 13 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainFragment.kt
  16. 0 20
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainViewModel.kt
  17. 11 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/AddCastSurelyActivity.kt
  18. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/CastSurelyDetailsActivity.kt
  19. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/CastSurelyDetailsViewHolder.kt
  20. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyActivity.kt
  21. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyViewHolder.kt
  22. 4 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyViewModel.kt
  23. 3 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/pickup/PickUpGoodViewHolder.kt
  24. 43 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/pickup/PickUpGoodsActivity.kt
  25. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/pickup/PickUpGoodsSearchActivity.kt
  26. 14 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/pickup/PickUpGoodsViewHolder.kt
  27. 28 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalActivity.kt
  28. 18 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalViewModel.kt
  29. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/PlatnumTreasureAdapter.java
  30. 8 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/CancellationsViewHolder.kt
  31. 38 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumBuyOrSellUI.kt
  32. 26 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeViewModel.kt
  33. 2 2
      RMA/app/src/main/res/layout/item_fresco.xml

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

@@ -261,6 +261,12 @@ class AccountManager {
 
                 override fun onResponse(response: BaseResult<LoginQueryData>?, id: Int) {
                     GlobalDataCollection.instance?.loginQueryData = response?.data
+                    val goodsUpdateTime = GlobalDataCollection.instance?.goodsInfoUpdateTime
+                    val localGoodsUpdataTime =
+                        SPUtils.getInstance().getString(Constant.GOODS_UPDATE_TIME)
+                    if (localGoodsUpdataTime != goodsUpdateTime) {//如果发现时间不同,则设置为0,重新请求goodslist
+                        SPUtils.getInstance().put(Constant.GOODS_UPDATE_TIME, "0")
+                    }
                     callBack(true, null)
                 }
             }

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

@@ -78,9 +78,9 @@ class ContractGoodsManager {
      * @param data OrderData
      * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
      */
-    fun orderReq(data: OrderData,callback: (isCompleted: Boolean, err: Error?) -> Unit){
+    fun orderReq(data: OrderData,callback: (isCompleted: Boolean, err: Error?,rsp: TkernelMI1.OrderRsp?) -> Unit){
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
-            callback(false, Error("交易链路未初始化"))
+            callback(false, Error("交易链路未初始化"),null)
             return
         }
 
@@ -94,12 +94,12 @@ class ContractGoodsManager {
             object : Callback<Packet50> {
                 override fun onSuccess(rsp: Packet50?) {
                     val rst = ContractGoodsAdapter.analysisOrderRsq(rsp!!)
-                    callback(rst.first, rst.second)
+                    callback(rst.first, rst.second,rst.third)
                 }
 
                 override fun onFail(err: Error?) {
                     // 发送数据失败
-                    callback(false, err)
+                    callback(false, err,null)
                 }
             }
         )

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

@@ -63,14 +63,8 @@ class FutureManager {
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<GoodsInfo>>>() {
                 override fun onResponse(response: BaseResult<List<GoodsInfo>>?, id: Int) {
-                    val goodsUpdateTime = GlobalDataCollection.instance?.goodsInfoUpdateTime
-                    val localGoodsUpdataTime =
-                        SPUtils.getInstance().getString(Constant.GOODS_UPDATE_TIME)
-                    if (localGoodsUpdataTime != goodsUpdateTime) {
-                        SPUtils.getInstance().put(Constant.GOODS_UPDATE_TIME, goodsUpdateTime)
-                    }
                     //每次请求都把之前的数据清掉,不然会出现不存在的商品
-//                    DataBase.getInstance().goodsInfoDao().clearAllData()
+                    DataBase.getInstance().goodsInfoDao().clearAllData()
                     // 存储直接入库,需要的时候,再查询,检查方法的运行时间,10ms可以接受
                     DataBase.getInstance().goodsInfoDao().insertAll(response?.data)
 //                    Builder.getDatabase<AppDatabase>().goodsInfoDao.insertAll()

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

@@ -5,6 +5,7 @@ import java.util.Date;
 import java.util.List;
 
 import cn.muchinfo.rma.global.data.AccountData;
+import cn.muchinfo.rma.global.data.BankAccountSignData;
 import cn.muchinfo.rma.global.data.ClientMenuData;
 import cn.muchinfo.rma.global.data.ContractTradePositionData;
 import cn.muchinfo.rma.global.data.ErmcpRoleFuncMenuData;
@@ -122,6 +123,23 @@ public class BaseGlobalData {
      */
     private ArrayList<QhjContractDetailsData> qhjContractDetailsDataArrayList;
 
+    /**
+     * 提现账户信息
+     * @return
+     */
+    private BankAccountSignData bankAccountSignData;
+
+    public BankAccountSignData getBankAccountSignData() {
+        if (bankAccountSignData == null){
+            bankAccountSignData = new BankAccountSignData();
+        }
+        return bankAccountSignData;
+    }
+
+    public void setBankAccountSignData(BankAccountSignData bankAccountSignData) {
+        this.bankAccountSignData = bankAccountSignData;
+    }
+
     public ArrayList<QhjContractDetailsData> getQhjContractDetailsDataArrayList() {
         if (qhjContractDetailsDataArrayList == null){
             qhjContractDetailsDataArrayList = new ArrayList<>();

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

@@ -0,0 +1,19 @@
+package cn.muchinfo.rma.global.data
+
+data class BannerData(
+    val areauserid : String = "",//所属机构ID
+    val configid : String = "",//配置ID(SEQ_SZDZ2_IMAGECONFIG)
+    val createdate : String = "",//创建时间
+    val creatorid : String = "",//创建人
+    val imagepath : String = "",//图片
+    val imagetype : String = "",//类型 - 1:首页轮播(移动) 2:我的(移动)
+    val isshow : String = "",//是否展示 - 0:不展示 1:展示
+    val marketid : String = "",//市场ID
+    val modifierid : String = "",//操作人
+    val sort : String = "",//排序
+    val title : String = "",//标题
+    val trademode : String = "",//交易模式
+    val updatedate : String? = "",//修改时间
+    val url : String = "",//链接(地址或商品ID)
+    val urltype : String = ""//链接类型 - 1:直接地址 2:商品ID
+)

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

@@ -9,6 +9,7 @@ data class RStrategyData(
     val accountname: String? = "",//账号名称(ACCOUNTID对应的名称)
     val currencyid : String? = "",//币种id
     val currencyname : String? = "",//币种名称
+    val decimalplace : String? = "",//商品报价小数位
     val enumdicname : String? = "",//单位名称
     val goodscode : String? = "",//定投商品代码
     val goodsid : String? = "",//定投商品ID
@@ -68,6 +69,7 @@ data class RStrategyData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -77,6 +79,7 @@ data class RStrategyData(
         parcel.writeString(accountname)
         parcel.writeString(currencyid)
         parcel.writeString(currencyname)
+        parcel.writeString(decimalplace)
         parcel.writeString(enumdicname)
         parcel.writeString(goodscode)
         parcel.writeString(goodsid)
@@ -120,4 +123,5 @@ data class RStrategyData(
         }
     }
 
+
 }

+ 8 - 7
RMA/app/src/main/java/cn/muchinfo/rma/global/data/database/BannerEntity.kt

@@ -3,13 +3,14 @@ package cn.muchinfo.rma.global.data.database
 import androidx.room.Entity
 import androidx.room.PrimaryKey
 
+
 @Entity(tableName = "banner")
 data class BannerEntity(
-    @PrimaryKey(autoGenerate = true)
-    var configid : Int = 0,
-    var imagepath : String = "",
-    var imagetype : String = "",
-    var sort : String = "",
-    var title : String = "",
-    var url : String = ""
+     @PrimaryKey(autoGenerate = true)
+     var configid : Int = 0,
+     var imagepath : String = "",
+     var imagetype : String = "",
+     var sort : String = "",
+     var title : String = "",
+     var url : String = ""
 )

+ 5 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt

@@ -164,6 +164,11 @@ class MainActivity : BaseActivity<MainViewModel>() {
         EventBus.getDefault().unregister(this)
     }
 
+    override fun onResume() {
+        super.onResume()
+        viewModel.queryUserCollectConfig()
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         Fresco.initialize(this)

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

@@ -40,6 +40,23 @@ class MainViewModel : BaseViewModel() {
     }
 
     /**
+     * 查询提现账户设置信息
+     */
+    fun queryUserCollectConfig(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+
+        MyApplication.getInstance()?.bankManager?.queryBankAccountSign(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData?.size ?: 0 > 0){
+                    GlobalDataCollection.instance?.bankAccountSignData = respData?.get(0)
+                }
+            }
+        }
+    }
+
+    /**
      * 初始化数据
      */
     // FIXME 这里后期需要加上错误信息和枚举的增量查询

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

@@ -10,7 +10,7 @@ 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"//李倩千海金
 //      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.175:8080/cfg?key=test_175" // 8888  123123
@@ -18,7 +18,7 @@ object Constant {
 //    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"
 
     /**

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

@@ -11,9 +11,11 @@ import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
 import cn.muchinfo.rma.protobuf.protoclasses.SystemMI1
 import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.remove
 import cn.muchinfo.rma.view.base.BaseViewModel
 import cn.muchinfo.rma.view.base.app.BaseResult
 import cn.muchinfo.rma.view.base.app.Constant
+import com.blankj.utilcode.util.LogUtils
 import com.blankj.utilcode.util.SPUtils
 import mtp.polymer.com.autowidget.utils.TaskUiModel
 import okhttp3.Call
@@ -26,7 +28,7 @@ class HomeViewModel : BaseViewModel(){
      */
     val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
 
-    val bannerList : MutableLiveData<List<String>> = MutableLiveData()
+    val bannerList : MutableLiveData<List<BannerData>> = MutableLiveData()
 
     /**
      * 使用的当前的资金账户信息
@@ -77,22 +79,16 @@ class HomeViewModel : BaseViewModel(){
      * 在请求之前先获取数据库存储的banner信息
      */
     fun getBanner(){
-        GlobalDataCollection.instance?.loginQueryData
-        val dao = DataBase.getInstance().bannerDao()
-        dao.getBannerList().let {
-            getBannerUrlList(it)
-        }
         val params = mutableMapOf<String,String>()
         params.put("imageType","1")
         MyOkHttpUtils().query(URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Common/QueryImageConfigs",
-            callback = object : ResponseCallback<BaseResult<List<BannerEntity>>>() {
-                override fun onResponse(response: BaseResult<List<BannerEntity>>?, id: Int) {
-                    dao.insertBanner(banners = response?.data ?: arrayListOf())
+            callback = object : ResponseCallback<BaseResult<List<BannerData>>>() {
+                override fun onResponse(response: BaseResult<List<BannerData>>?, id: Int) {
                     getBannerUrlList(response?.data ?: arrayListOf())
                 }
 
                 override fun onError(call: Call?, e: Exception?, id: Int) {
-
+                    LogUtils.eTag("asdasdadasa",e?.message)
                 }
 
             },params = params,type = "1")
@@ -101,12 +97,14 @@ class HomeViewModel : BaseViewModel(){
     /**
      * @param datalist List<BannerEntity>
      */
-    fun getBannerUrlList(datalist : List<BannerEntity>){
+    fun getBannerUrlList(datalist : List<BannerData>){
         val bannerUrlList = arrayListOf<String>()
         datalist.forEach {
             bannerUrlList.add(SPUtils.getInstance().getString(Constant.openApiUrl) + it.imagepath.substring(1))
         }
-        bannerList.postValue(bannerUrlList)
+        bannerList.postValue(datalist.remove {
+            it.isshow == "1"
+        })
     }
 
     /**

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

@@ -18,14 +18,17 @@ import androidx.viewpager.widget.ViewPager
 import cn.bingoogolapple.bgabanner.BGABanner
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.BannerData
 import cn.muchinfo.rma.global.data.NoticeData
 import cn.muchinfo.rma.global.data.PendingAuditInfoData
 import cn.muchinfo.rma.global.data.SiteColumnDetailData
+import cn.muchinfo.rma.global.data.database.BannerEntity
 import cn.muchinfo.rma.global.isBlankString
 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.app.Constant
 import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity
 import cn.muchinfo.rma.view.base.home.accountmanager.AccountManagerActivity
 import cn.muchinfo.rma.view.base.home.business.BusinessManagementActivity
@@ -49,10 +52,7 @@ import cn.muchinfo.rma.view.base.platinumtreasure.trade.PlatinumTradeActivity
 import cn.muchinfo.rma.view.base.qhjhome.QhjInformationViewHolder
 import cn.muchinfo.rma.view.eventbus.EventConstent
 import cn.muchinfo.rma.view.eventbus.MessageEvent
-import com.blankj.utilcode.util.ActivityUtils
-import com.blankj.utilcode.util.ConvertUtils
-import com.blankj.utilcode.util.LogUtils
-import com.blankj.utilcode.util.ToastUtils
+import com.blankj.utilcode.util.*
 import com.facebook.drawee.view.SimpleDraweeView
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
@@ -292,33 +292,44 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
                         verticalLayout {
                             background = resources.getDrawable(R.color.white)
 
-                            imageView {
-                                scaleType = ImageView.ScaleType.CENTER_CROP
-                                imageResource = R.mipmap.banner
-                            }.lparams(matchParent, autoSize(400))
+//                            imageView {
+//                                visibility = View.GONE
+//                                scaleType = ImageView.ScaleType.CENTER_CROP
+//                                imageResource = R.mipmap.banner
+//                            }.lparams(matchParent, autoSize(400))
 
                             inflateLayout<BGABanner>(R.layout.banner) {
-                                visibility = View.GONE
                                 // TODO 目前没有banner
-//                                viewModel.bannerList.bindOptional(context) {
-//                                    setData(
-//                                        R.layout.item_fresco,
-//                                        it,
-//                                        null
-//                                    )
-//                                }
+                                viewModel.bannerList.bindOptional(context) {
+                                    setData(
+                                        R.layout.item_fresco,
+                                        it,
+                                        null
+                                    )
+                                }
+                                setDelegate { banner, itemView, model, position ->
+                                    val data = model as BannerData
+                                    ToastUtils.showLong(data.url + "2-----")
+                                }
+//                                setDelegate(new BGABanner.Delegate() {
+//                                    @Override
+//                                    public void onBannerItemClick(BGABanner banner, View itemView, @Nullable Object model, int position) {
+//
+//                                    }
+//                                });
 
 
-                                setAdapter(object : BGABanner.Adapter<CardView, String> {
+                                setAdapter(object : BGABanner.Adapter<CardView, BannerData> {
                                     override fun fillBannerItem(
                                         banner: BGABanner?,
                                         itemView: CardView?,
-                                        model: String?,
+                                        model: BannerData?,
                                         position: Int
                                     ) {
                                         val simpleDraweeView: SimpleDraweeView =
                                             itemView!!.findViewById(R.id.sdv_item_fresco_content)
-                                        simpleDraweeView.setImageURI(Uri.parse(model))
+                                        simpleDraweeView.setImageURI(Uri.parse(SPUtils.getInstance().getString(
+                                            Constant.openApiUrl) + model?.imagepath?.substring(1)))
                                     }
                                 })
 
@@ -593,6 +604,11 @@ class NewInformationUI(private val baseFragment: Fragment, private val viewModul
 fun jumpActivity(context : Context,code : String){
     val intent = Intent()
     if (code == "client_qhjcztx"){
+        if (GlobalDataCollection.instance?.bankAccountSignData?.accountcode.isNullOrEmpty()){
+            ToastUtils.showLong("请先添加提现账户信息")
+            return
+        }
+        intent.putExtra("selectindex",0)
         intent.setClass(context,WithdrawalActivity::class.java)
     }else if (code == "client_qhjzjxx"){
         intent.putExtra("goodsId", "0")

+ 2 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/register/PersonalRegisterActivity.kt

@@ -5,6 +5,7 @@ import android.graphics.Typeface
 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
@@ -208,6 +209,7 @@ class PersonalRegisterActivity : BaseActivity<RegisterViewModel>(){
                     }
 
                     imageView {
+                        visibility = View.GONE
                         imageResource = R.mipmap.qhj_sqcode
                     }.lparams(autoSize(60), autoSize(60)){
                         marginEnd = autoSize(36)

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

@@ -187,6 +187,7 @@ class PayActivity : BaseActivity<PayViewModel>() {
                         }
                     }.lparams(wrapContent, wrapContent) {
                         marginEnd = autoSize(36)
+                        topMargin = autoSize(10)
                     }
                 }.lparams(matchParent, wrapContent)
 
@@ -248,7 +249,7 @@ class PayActivity : BaseActivity<PayViewModel>() {
                 textView {
                     viewModel.accountData.bindOptional(context) {
                         text =
-                            "(可用" + NumberUtils.doubleDistortion(it?.balance?.toString()) + "元)"
+                            "(可用" + NumberUtils.doubleDistortion(it?.currentbalance?.toString()) + "元)"
                     }
                     textSizeAuto = 31
                     textColorInt = R.color.hint_text_color

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

@@ -52,7 +52,6 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
 
     override fun onResume() {
         super.onResume()
-        viewModel.queryUserCollectConfig()
         viewModel.initDataUsrAccount()
     }
 
@@ -315,7 +314,12 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                             linearLayout {
                                 linearLayout {
                                     onThrottleFirstClick {
+                                        if (GlobalDataCollection.instance?.bankAccountSignData?.accountcode.isNullOrEmpty()){
+                                            ToastUtils.showLong("请先添加提现账户信息")
+                                            return@onThrottleFirstClick
+                                        }
                                         val intent = Intent()
+                                        intent.putExtra("selectindex",1)
                                         intent.setClass(context, WithdrawalActivity::class.java)
                                         ActivityUtils.startActivity(intent)
                                     }
@@ -332,8 +336,14 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                                 }
 
                                 linearLayout {
+
                                     onThrottleFirstClick {
+                                        if (GlobalDataCollection.instance?.bankAccountSignData?.accountcode.isNullOrEmpty()){
+                                            ToastUtils.showLong("请先添加提现账户信息")
+                                            return@onThrottleFirstClick
+                                        }
                                         val intent = Intent()
+                                        intent.putExtra("selectindex",0)
                                         intent.setClass(context, WithdrawalActivity::class.java)
                                         ActivityUtils.startActivity(intent)
                                     }
@@ -531,10 +541,10 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                         linearLayout {
                             onThrottleFirstClick {
                                 val intent = Intent()
-                                if (viewModel.userCollectConfigData.value?.bankid.isNullOrEmpty()) {
+                                if (GlobalDataCollection.instance?.bankAccountSignData?.bankid.isNullOrEmpty()) {
                                     intent.putExtra("data", BankAccountSignData())
                                 } else {
-                                    intent.putExtra("data", viewModel.userCollectConfigData.value)
+                                    intent.putExtra("data", GlobalDataCollection.instance?.bankAccountSignData)
                                 }
                                 intent.setClass(context, WithDrawManagementActivity::class.java)
                                 ActivityUtils.startActivity(intent)

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

@@ -22,10 +22,6 @@ class SeaKingMainViewModel : BaseViewModel(){
      */
     val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
 
-    /**
-     * 提现账户设置信息
-     */
-    val userCollectConfigData : MutableLiveData<BankAccountSignData> = MutableLiveData()
 
     /**
      * useraccount
@@ -88,21 +84,5 @@ class SeaKingMainViewModel : BaseViewModel(){
         userAccount.postValue(GlobalDataCollection.instance?.loginQueryData?.userAccount)
     }
 
-    /**
-     * 查询提现账户设置信息
-     */
-    fun queryUserCollectConfig(){
-        val params = mutableMapOf<String,String>().apply {
-            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
-        }
-
-        MyApplication.getInstance()?.bankManager?.queryBankAccountSign(params = params){isSuccess, respData, error ->
-            if (isSuccess){
-                if (respData?.size ?: 0 > 0){
-                    userCollectConfigData.postValue(respData?.get(0))
-                }
-            }
-        }
-    }
 
 }

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

@@ -129,9 +129,7 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
         super.onCreate(savedInstanceState)
         EventBus.getDefault().register(this)
         verticalLayout {
-            if (type == "1"){
-                viewModel.goodsexinfo.postValue(GoodsExInfoData())
-            }
+
             initData()
             viewModel.isCastSureData.bindOptional(context){//从交易页面进入的定投页,若是针对此商品已进行了定投策略,则该页面为修改定投,并在此进行赋值
                 selectPayType.postValue(SelectData(id = it?.regularlymode ?: "1", value = if (it?.regularlymode == "1"){"按重量定投"}else{"按金额定投"}))
@@ -289,17 +287,20 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                     linearLayout {
                         gravity = Gravity.CENTER_VERTICAL
                         textView {
+                            visibility = View.GONE
                             viewModel.goodsexinfo.bindOptional(context) {
+                                visibility = View.VISIBLE
                                 if (selectPayType.value?.id == "1") {
-                                    text = it?.regularlybuyminqty + "起购"
+                                    text = it?.regularlybuyminqty + viewModel.goodsInfoData.value?.goodunitid + "起购"
                                 } else {
                                     text = it?.regularlybuyminamount + "元起购"
                                 }
                             }
                             selectPayType.bindOptional(context){
+                                visibility = View.VISIBLE
                                 if (viewModel.goodsexinfo.value?.goodsid.isNullOrEmpty().not()){
                                     if (it?.id == "1"){
-                                        text = viewModel.goodsexinfo.value?.regularlybuyminqty + "起购"
+                                        text = viewModel.goodsexinfo.value?.regularlybuyminqty + viewModel.goodsInfoData.value?.goodunitid + "起购"
                                     }else{
                                         text = viewModel.goodsexinfo.value?.regularlybuyminamount + "元起购"
                                     }
@@ -481,6 +482,11 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                 return false
             }
         }
+
+        if (selectTime.value?.id.isNullOrEmpty()){
+            ToastUtils.showLong("请选择定投频率")
+            return false
+        }
         return true
     }
 

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

@@ -179,7 +179,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
 
                         textView {
                             val qtydecimalplace = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data?.goodsid?.toInt() ?: 0).qtydecimalplace
-                            text = NumberUtils.roundNum(data?.triggertotalqty?.toDouble()?.div(Math.pow(10.0,qtydecimalplace.toDouble())).toString(),qtydecimalplace)
+                            text = NumberUtils.roundNum(data.triggertotalqty.toString(),qtydecimalplace)
                             textColorInt = R.color.rma_black_33
                             textSizeAuto = 36
                             typeface = Typeface.defaultFromStyle(Typeface.BOLD)
@@ -199,7 +199,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                         }
 
                         textView {
-                            text = data.triggersuccesstimes
+                            text = data.triggertotaltimes
                             textColorInt = R.color.rma_black_33
                             textSizeAuto = 36
                             typeface = Typeface.defaultFromStyle(Typeface.BOLD)
@@ -224,7 +224,7 @@ class CastSurelyDetailsActivity : BaseActivity<MyCastSurelyViewModel>() {
                         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?.toDouble()?.div(Math.pow(10.0,qtydecimalplace.toDouble())) + data.enumdicname
+                                text = viewModel.getCastSureRegularlyCycleValueName(data.regularlycycle ?: "",data.regularlycyclevalue ?: "") + "定投" + data.nexttriggerqty + data.enumdicname
                             }else{//按金额
                                 text = viewModel.getCastSureRegularlyCycleValueName(data.regularlycycle ?: "",data.regularlycyclevalue ?: "") + "定投" + NumberUtils.roundNum(data.nexttriggeramount,2) + "元"
                             }

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

@@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.RSTriggerLogData
 import cn.muchinfo.rma.global.database.DataBase
+import cn.muchinfo.rma.global.isShowTimeString
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
@@ -23,7 +24,7 @@ class CastSurelyDetailsViewHolder(private val activity: AppCompatActivity,privat
              textView {
                  data.bindOptional(context){
                      val goodsinfo = DataBase.getInstance().goodsInfoDao().getGoodsInfo(it?.goodsid?.toInt() ?: 0)
-                     text = it?.triggertime + "   " + NumberUtils.roundNum(it?.triggerqty?.toDouble()?.div(Math.pow(10.0,goodsinfo.qtydecimalplace?.toDouble() ?: 1.0)).toString(),goodsinfo.qtydecimalplace) + it?.enumdicname + "(" + it?.triggeramount + "元)"
+                     text = it?.triggertime?.isShowTimeString("yyyy-MM-dd") + "   " + NumberUtils.roundNum(it?.triggerqty?.toDouble().toString(),goodsinfo.qtydecimalplace) + it?.enumdicname + "(" + it?.triggeramount + "元)"
                  }
                  textSizeAuto = 31
                  textColorInt = R.color.text_hint_color_two

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

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

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

@@ -103,7 +103,7 @@ class MyCastSurelyViewHolder(private val activity : AppCompatActivity,private va
                         textView {
                             data.bindOptional(context){
                                 val qtydecimalplace = DataBase.getInstance().goodsInfoDao().getGoodsInfo(it?.goodsid?.toInt() ?: 0).qtydecimalplace
-                                text = NumberUtils.roundNum(it?.triggertotalqty?.toDouble()?.div(Math.pow(10.0,qtydecimalplace.toDouble())).toString(),qtydecimalplace)
+                                text = NumberUtils.roundNum(it?.triggertotalqty?.toDouble().toString(),qtydecimalplace)
                             }
                             textColorInt = R.color.rma_black_33
                             textSizeAuto = 36
@@ -125,7 +125,7 @@ class MyCastSurelyViewHolder(private val activity : AppCompatActivity,private va
 
                         textView {
                             data.bindOptional(context){
-                                text = it?.triggersuccesstimes
+                                text = it?.triggertotaltimes
                             }
                             textColorInt = R.color.rma_black_33
                             textSizeAuto = 36
@@ -144,7 +144,7 @@ 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?.toDouble()?.div(Math.pow(10.0,qtydecimalplace.toDouble())) + it.enumdicname
+                                    text = viewModel.getCastSureRegularlyCycleValueName(it.regularlycycle ?: "",it.regularlycyclevalue ?: "") + "定投" + it.nexttriggerqty + it.enumdicname
                                 }else{//按金额
                                     text = viewModel.getCastSureRegularlyCycleValueName(it?.regularlycycle ?: "",it?.regularlycyclevalue ?: "") + "定投" + NumberUtils.roundNum(it?.nexttriggeramount,2) + "元"
                                 }

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

@@ -319,8 +319,10 @@ class MyCastSurelyViewModel : BaseViewModel(){
         }
         MyApplication.getInstance()?.moneyManager?.queryGoodsEx(params = params) { isSuccess, respData, error ->
             if (isSuccess) {
-                if (respData?.size ?: 0 > 0){
-                    goodsexinfo.postValue(respData?.get(0))
+                if (goodsid.isNotEmpty()){
+                    if (respData?.size ?: 0 > 0){
+                        goodsexinfo.postValue(respData?.get(0))
+                    }
                 }
             }
         }

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

@@ -1,6 +1,7 @@
 package cn.muchinfo.rma.view.base.main.pickup
 
 import android.view.Gravity
+import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.PickGoodsData
@@ -31,7 +32,7 @@ class PickUpGoodViewHolder(private val activity : AppCompatActivity,private val
                 gravity = Gravity.CENTER_VERTICAL
                 imageView {
                     data.bindOptional(context){
-                        showImage(SPUtils.getInstance().getString(Constant.openApiUrl) + it?.imageaddress)
+                        showImage(SPUtils.getInstance().getString(Constant.openApiUrl) + it?.imageaddress?.substring(1,it?.imageaddress?.length))
                     }
                 }.lparams(autoSize(96), autoSize(96)){
                     marginStart = autoSize(36)
@@ -65,6 +66,7 @@ class PickUpGoodViewHolder(private val activity : AppCompatActivity,private val
                 emptyView()
 
                 imageView {
+                    visibility = View.GONE
                     imageResource = R.drawable.ic_check_number
                 }.lparams(autoSize(40), autoSize(40))
             }.lparams(matchParent, autoSize(143))

+ 43 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/pickup/PickUpGoodsActivity.kt

@@ -7,6 +7,7 @@ import android.view.Gravity
 import android.view.View
 import android.view.inputmethod.EditorInfo
 import android.widget.EditText
+import android.widget.TextView
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
@@ -29,6 +30,7 @@ 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.*
+import org.jetbrains.anko.sdk25.coroutines.textChangedListener
 
 /**
  * 提货
@@ -47,6 +49,12 @@ class PickUpGoodsActivity : BaseActivity<PickUpGoodsViewModel>(){
     //最大的可提货数量
     val canPickUpMaxNumber : MutableLiveData<Int> = MutableLiveData()
 
+    //最大可提货说量
+    lateinit var maxPickupGoodAmount : TextView
+
+    //取货消耗商品数量
+    lateinit var useGoodsAmount : TextView
+
     override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
         super.onActivityResult(requestCode, resultCode, data)
         if (requestCode == 1000 && resultCode == 1001){
@@ -104,7 +112,7 @@ class PickUpGoodsActivity : BaseActivity<PickUpGoodsViewModel>(){
 
                     textView {
                         val goodsInfo = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data.goodsid?.toInt() ?: 0)
-                        text = NumberUtils.doubleDistortion(data.enableqty?.toDouble()?.times(goodsInfo.agreeunit).toString())
+                        text = NumberUtils.doubleDistortion(data.enableqty?.toDouble()?.times(goodsInfo.agreeunit).toString()) + data.goodunit
                         textSizeAuto = 41
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent){
@@ -160,7 +168,7 @@ class PickUpGoodsActivity : BaseActivity<PickUpGoodsViewModel>(){
 
             linearLayout {
                 background = resources.getDrawable(R.color.white)
-                verticalLayout {
+                linearLayout {
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
                         text = "商品数量"
@@ -169,12 +177,33 @@ class PickUpGoodsActivity : BaseActivity<PickUpGoodsViewModel>(){
                     }.lparams(wrapContent, wrapContent){
                         marginStart = autoSize(36)
                     }
-                }.lparams(autoSize(250), autoSize(180))
+
+                    textView {
+                        maxPickupGoodAmount = this
+                        text = "可提<=--"
+                        textSizeAuto = 25
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+
+                    }
+                }.lparams(autoSize(300), autoSize(180))
 
                 verticalLayout {
                     editText {
                         gravity = Gravity.CENTER_VERTICAL
 //                        isEnabled = false
+                        textChangedListener {
+                            afterTextChanged {
+                                if (it.toString().isNotEmpty()) {//修改品类
+                                     if (it.toString() != "0"){
+                                         if (viewModel.pickGoodsData.value?.pickupgoodsid?.isNotEmpty() == true){
+                                             useGoodsAmount.text = "需要" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.toString()?.toDouble()?.times(viewModel.pickGoodsData.value?.pickupgoodsagreeunit?.toDouble() ?: 1.0)?.times(viewModel.pickGoodsData.value?.pickupratio?.toDouble() ?: 1.0).toString()),2)  + "克" + data.goodsname
+
+                                         }
+                                     }
+                                }
+                            }
+                        }
                         number_input = this
                         hint = "请填写提现商品数量"
                         background = null
@@ -189,13 +218,15 @@ class PickUpGoodsActivity : BaseActivity<PickUpGoodsViewModel>(){
 
                     linearLayout {
                         textView {
+                            useGoodsAmount = this
                             viewModel.pickGoodsData.bindOptional(context){
-                                val goodsInfo = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data?.goodsid?.toInt() ?: 0)
-                                val qry = data.enableqty?.toDouble()?.div(it?.pickupgoodsagreeunit?.toInt() ?: 1)?.div(it?.pickupratio?.toDouble() ?: 1.0)?.times(100.0)?.toInt()?.div(100)
+                                val goodsInfo = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data.goodsid?.toInt() ?: 0)
+                                val qry = data.enableqty?.toDouble()?.div(it?.pickupgoodsagreeunit?.toDouble() ?: 1.0)?.div(it?.pickupratio?.toDouble() ?: 1.0)?.times(100.0)?.toInt()?.div(100)
+                                maxPickupGoodAmount.text = "可提<=" + qry
                                 canPickUpMaxNumber.postValue(qry)
-                                text = "可提货数量" + qry + ",需要" + qry?.times(it?.pickupgoodsagreeunit?.toInt() ?: 1) + "g" + data.goodsname
+                                text = "需要" + NumberUtils.roundNum(NumberUtils.doubleDistortion(qry?.times(it?.pickupgoodsagreeunit?.toDouble() ?: 1.0)?.times(it?.pickupratio?.toDouble() ?: 1.0).toString()),2)  + "克" + data.goodsname
                             }
-                            text = "可提货数量 -- ,需要--" + data.goodsname
+                            text = "需要--" + data.goodsname
                             textSizeAuto = 31
                             textColorInt = R.color.rma_color_ccc
                         }.lparams(wrapContent, wrapContent){
@@ -205,6 +236,11 @@ class PickUpGoodsActivity : BaseActivity<PickUpGoodsViewModel>(){
                         emptyView()
 
                         textView {
+                            onThrottleFirstClick {
+                                if (canPickUpMaxNumber.value?.toString().isNullOrEmpty().not()){
+                                    number_input.setText(canPickUpMaxNumber.value?.toString())
+                                }
+                            }
                             text = "全部"
                             textSizeAuto = 31
                             textColorInt = R.color.rma_blue_color

+ 6 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/pickup/PickUpGoodsSearchActivity.kt

@@ -10,6 +10,8 @@ import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.platinumtreasure.trade.CancellationsViewHolder
 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.*
 
 /**
@@ -36,6 +38,10 @@ class PickUpGoodsSearchActivity : BaseActivity<PickUpGoodsViewModel>(){
         super.onCreate(savedInstanceState)
         verticalLayout {
             viewModel.queryTradeGoodsPickup()
+            createLoadingDialog(hintStr = "请求中...").bindTaskStatus(
+                context,
+                viewModel.loadingDialogStatus
+            )
             background = resources.getDrawable(R.color.main_hit_bg_color)
             //页面标题
             topBar {

+ 14 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/pickup/PickUpGoodsViewHolder.kt

@@ -117,8 +117,13 @@ class PickUpGoodsViewHolder(private val activity : AppCompatActivity,private val
                             visibility = View.GONE
                         }
                     }
-                    onThrottleFirstClick {
-
+                    onThrottleFirstClick {//自提
+                        viewModel.queryGoodsPickupOperate(
+                            operatetype = 3,
+                            takeorderid = data.value?.takeorderid?.toLong() ?: 0
+                        ){
+                            viewModel.queryTradeGoodsPickup()
+                        }
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
@@ -137,8 +142,13 @@ class PickUpGoodsViewHolder(private val activity : AppCompatActivity,private val
                             visibility = View.GONE
                         }
                     }
-                    onThrottleFirstClick {
-
+                    onThrottleFirstClick {//邮寄
+                        viewModel.queryGoodsPickupOperate(
+                            operatetype = 3,
+                            takeorderid = data.value?.takeorderid?.toLong() ?: 0
+                        ){
+                            viewModel.queryTradeGoodsPickup()
+                        }
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER

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

@@ -21,6 +21,7 @@ import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.netManage.utils.UpLoadUtils
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.photopicter.PhotoUtils
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.future.trade.itemView
@@ -62,6 +63,8 @@ class WithdrawalActivity : BaseActivity<WithdrawalViewModel>(){
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
 
+    val selectindex by lazy { intent.getIntExtra("selectindex",0) }
+
     //充值UI
     private val moneyInUI by lazy { MoneyInUI(this,viewModel) }
 
@@ -77,6 +80,17 @@ class WithdrawalActivity : BaseActivity<WithdrawalViewModel>(){
     //暂存的页面组
     private val uiList: ArrayList<_FrameLayout> = arrayListOf()
 
+    /**
+     * 用livedata监测当前页面
+     */
+    val selectIndex1 : MutableLiveData<Int> = MutableLiveData()
+
+
+    override fun onResume() {
+        super.onResume()
+        viewModel.resetAccountData()
+    }
+
     fun initDataTitle() {
         newTabsArray.add("充值")
         uiList.add(moneyInUI.root)
@@ -112,6 +126,7 @@ class WithdrawalActivity : BaseActivity<WithdrawalViewModel>(){
         verticalLayout {
             createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             initDataTitle()
+            selectIndex1.postValue(selectindex)
             viewModel.queryUserCollectConfig()
             viewModel.queryUsersigningInfo()
             background = resources.getDrawable(R.color.rma_item_bg)
@@ -152,6 +167,9 @@ class WithdrawalActivity : BaseActivity<WithdrawalViewModel>(){
 
             segment.setupWithViewPager(viewPager)
             segment.selectTab(selectedTabIndex)
+            selectIndex1.bindOptional(context){
+                segment.selectTab(it ?: 0)
+            }
 
         }
     }
@@ -295,7 +313,11 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
 
                     linearLayout {
                         textView {
-                            text = "可提现金额 5000.00"
+                            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)//
+                                text = "可提现金额 " + NumberUtils.roundNum(NumberUtils.doubleDistortion(balance?.toString()),2)
+                            }
                             textSizeAuto = 31
                             textColorInt = R.color.rma_color_ccc
                         }.lparams(wrapContent, wrapContent){
@@ -422,7 +444,7 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
                 textView {
                     textSizeAuto = 31
                     textColorInt = R.color.text_hint_color_two
-                    text = "充值时间" + GlobalDataCollection.instance?.getSystemParamsValue("012") + "~" + GlobalDataCollection.instance?.getSystemParamsValue("013")
+                    text = "提现时间" + GlobalDataCollection.instance?.getSystemParamsValue("012") + "~" + GlobalDataCollection.instance?.getSystemParamsValue("013")
                 }.lparams(wrapContent, wrapContent){
                     marginStart = autoSize(36)
                 }
@@ -437,6 +459,10 @@ class MoneyOutUI(private val activity: WithdrawalActivity,private val viewModel:
                             ToastUtils.showLong("请输入提现金额")
                             return@onThrottleFirstClick
                         }
+                        if (amount_input.text.toString() == "0"){
+                            ToastUtils.showLong("提现金额不能为0")
+                            return@onThrottleFirstClick
+                        }
                         val singingInfo = viewModel.userCollectConfigData.value
                         viewModel.requeryt2bBankWithdrawReq(
                             AccountCode = singingInfo?.accountcode ?: "",

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

@@ -2,6 +2,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.BankAccountSignData
 import cn.muchinfo.rma.global.data.UserCollectConfigData
 import cn.muchinfo.rma.netManage.base.InteractiveException
@@ -40,6 +41,23 @@ class WithdrawalViewModel : BaseViewModel(){
     val userCollectConfigData : MutableLiveData<BankAccountSignData> = MutableLiveData()
 
     /**
+     * 当前选择的资金账户
+     */
+    val usedAccountData : MutableLiveData<AccountData> = MutableLiveData()
+
+
+    //重新赋值资金账户
+    fun resetAccountData(){
+        val accountDataList = GlobalDataCollection.instance?.accountDataList
+        if (accountDataList.isNullOrEmpty().not()) {
+            val accountData = GlobalDataCollection.instance?.accountData
+            accountData?.clearData()
+            accountData?.setNormalData()
+            usedAccountData.postValue(accountData)
+        }
+    }
+
+    /**
      * 查询提现账户设置信息
      */
     fun queryUsersigningInfo(){

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/PlatnumTreasureAdapter.java

@@ -189,8 +189,13 @@ public class PlatnumTreasureAdapter extends RecyclerView.Adapter<PlatnumTreasure
             }
             timeRightData.setColorType("1");
             if (relateQuoteDayData.getLast() != 0 && relateQuoteDayData.getPreclose() != 0) {
+                String textApplies = "";
                 String textUpDown = NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf((relateQuoteDayData.getPrice() - relateQuoteDayData.getPresettle()))),2);//涨跌
-                String textApplies = NumberUtils.roundNum(String.valueOf((((relateQuoteDayData.getPrice() - relateQuoteDayData.getPresettle()) / relateQuoteDayData.getPresettle()) * 100)),2);//涨跌幅
+                if (relateQuoteDayData.getPresettle() == 0){
+                    textApplies = "--";
+                }else {
+                    textApplies = NumberUtils.roundNum(String.valueOf((((relateQuoteDayData.getPrice() - relateQuoteDayData.getPresettle()) / relateQuoteDayData.getPresettle()) * 100)),2);//涨跌幅
+                }
                 riseFallData.setValue(textUpDown);
                 appliesData.setValue(textApplies + "%");
                 if (Double.valueOf(textUpDown) > 0){

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

@@ -101,7 +101,14 @@ class CancellationsViewHolder(private val activity: AppCompatActivity,private va
                         }
 
                         textView {
-                            text = "已报"
+                            data.bindOptional(context){
+                                if (it?.orderstatus == "3"){
+                                    text = "可撤"
+                                }else if (it?.orderstatus == "6"){
+                                    text = "已撤"
+                                }
+                            }
+
                             textSizeAuto = 31
                             textColorInt = R.color.rma_black_33
                         }.lparams(wrapContent, wrapContent)

+ 38 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumBuyOrSellUI.kt

@@ -23,6 +23,7 @@ import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
 import cn.muchinfo.rma.view.base.app.FutureConstent
 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.PayActivity
 import cn.muchinfo.rma.view.base.main.castsurely.AddCastSurelyActivity
 import cn.muchinfo.rma.view.base.main.castsurely.MyCastSurelyViewHolder
 import cn.muchinfo.rma.view.eventbus.EventConstent
@@ -166,7 +167,7 @@ class PlatinumBuyOrSellUI(
                 }
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
-                    text = "品"
+                    text = "品"
                     textColorInt = R.color.rma_gray_color
                     textSizeAuto = 36
                 }.lparams(wrapContent, wrapContent) {
@@ -315,16 +316,23 @@ class PlatinumBuyOrSellUI(
                                 val goodsExData =
                                     GlobalDataCollection.instance?.goodsExInfoDataArrayList?.find { it.goodsid == data?.goodsid.toString() }
                                 if (goodsExData?.goodsid?.isNotEmpty() == true) {
-                                    if (selectPayType.value?.id == "1") {//按数量
+                                    if (type == "2"){
                                         setMin(
                                             goodsExData.regularlybuyminqty?.toDouble() ?: 1.0
                                         )
                                         setStep(
                                             goodsExData.regularlybuyminqty?.toDouble() ?: 1.0
                                         )
-                                        setText(
-                                            goodsExData.regularlybuyminqty?.toDouble().toString()
+                                        setText("0")
+                                    }else{
+                                        if (selectPayType.value?.id == "1") {//按数量
+                                        setMin(
+                                            goodsExData.regularlybuyminqty?.toDouble() ?: 1.0
                                         )
+                                        setStep(
+                                            goodsExData.regularlybuyminqty?.toDouble() ?: 1.0
+                                        )
+                                        setText("0")
                                     } else {//按金额
                                         setMin(goodsExData.regularlybuyminamount?.toDouble() ?: 0.0)
                                         setStep(
@@ -332,6 +340,8 @@ class PlatinumBuyOrSellUI(
                                         )
                                         setText(goodsExData.regularlybuyminamount)
                                     }
+                                    }
+
                                 }
                             }
                         }.lparams(matchParent, autoSize(88)) {
@@ -818,8 +828,30 @@ class PlatinumBuyOrSellUI(
                                 orderPrice = orderPrice,
                                 orderQtyOrAmount = orderQtyOrAmount.toString(),
                                 selectPayType = selectPayType
-                            ) {
-                                viewModel.loadingDialogStatus.postValue(TaskUiModel.success(msg = "下单成功"))
+                            ) {isCompleted, data ->
+                                if (isCompleted){
+                                    activity.createWarningDialog {
+                                        setTitle("温馨提示")
+                                        setMessage("下单成功,请前往付款!")
+                                        addAction("取消") { dialog, _ ->
+                                            dialog.dismiss()
+                                        }
+                                        addAction("确定") { dialog, _ ->
+                                            val intent = Intent()
+                                            intent.putExtra("goodsId",data.goodsid)
+                                            intent.putExtra("marketId",data.marketid)
+                                            intent.putExtra("orderNo",data.tradeid)
+                                            intent.putExtra("orderDate",data.tradedate)
+                                            intent.putExtra("paytype","1")
+                                            intent.putExtra("totalAmount",data.payamount)
+                                            intent.putExtra("paylimitedtime",data.paylimitedtime)
+                                            intent.putExtra("orderId","")
+                                            intent.setClass(context, PayActivity::class.java)
+                                            ActivityUtils.startActivity(intent)
+                                            dialog.dismiss()
+                                        }
+                                    }.show()
+                                }
                             }
 //                            commitDealData(
 //                                buyOrSell = buyOrSell,

+ 26 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeViewModel.kt

@@ -408,7 +408,7 @@ class PlatinumTradeViewModel : BaseViewModel() {
         GlobalScope.launch {
             MyApplication.getInstance()?.contractGoodsManager?.orderReq(
                 data = data
-            ) { isCompleted, err ->
+            ) { isCompleted, err,rsp ->
                 if (isCompleted) {
                     loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
                     isSuccess(true)
@@ -642,7 +642,7 @@ class PlatinumTradeViewModel : BaseViewModel() {
         orderQtyOrAmount: String,
         selectPayType: String,
         type: String,
-        isSuccess: (isCompleted: Boolean) -> Unit
+        callback: (isCompleted: Boolean,data : PayOrderData) -> Unit
     ) {
 
         val orderData = OrderData()
@@ -691,10 +691,9 @@ class PlatinumTradeViewModel : BaseViewModel() {
         GlobalScope.launch {
             MyApplication.getInstance()?.contractGoodsManager?.orderReq(
                 data = orderData
-            ) { isCompleted, err ->
+            ) { isCompleted, err ,rsp ->
                 if (isCompleted) {
-                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
-                    isSuccess(true)
+                    queryPayOrder(rsp?.orderID.toString(),callback)
                 } else {
                     loadingDialogStatus.postValue(
                         TaskUiModel.failed(
@@ -709,4 +708,26 @@ class PlatinumTradeViewModel : BaseViewModel() {
 
     }
 
+    /**
+     * 查询下单成功后的待付款单
+     */
+    fun queryPayOrder(orderid : String,callback: (isCompleted: Boolean,data : PayOrderData) -> Unit){
+        val params = mutableMapOf<String,String>().apply {
+            put("accountid",GlobalDataCollection.instance?.accountId?.toString() ?: "0")
+            put("payflag","1")
+
+        }
+        MyApplication.getInstance()?.contractGoodsManager?.queryPayOrder(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                val data = respData?.find { it.buyorderid == orderid }
+                if (data?.tradeid.isNullOrEmpty()){
+                    callback(false, PayOrderData())
+                }else{
+                    callback(true,data ?: PayOrderData())
+                }
+                loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+            }
+        }
+    }
+
 }

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

@@ -9,6 +9,6 @@
     <com.facebook.drawee.view.SimpleDraweeView
         android:id="@+id/sdv_item_fresco_content"
         android:layout_width="match_parent"
-        android:layout_height="240dp"
-        app:placeholderImage="@drawable/holder"/>
+        android:layout_height="match_parent"
+        app:placeholderImage="@mipmap/banner"/>
 </androidx.cardview.widget.CardView>