فهرست منبع

风险管理4月1日提交代码-liu.bolan

Liu.bolan 4 سال پیش
والد
کامیت
8e385629c6
42فایلهای تغییر یافته به همراه1977 افزوده شده و 308 حذف شده
  1. 4 0
      RMA/app/src/main/AndroidManifest.xml
  2. 65 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  3. 88 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt
  4. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/contract/adapter/ContractAdapter.kt
  5. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/ViewEnumUtils.kt
  6. 16 0
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/funcode/FunCode.java
  7. 154 154
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java
  8. 26 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/CheckPassword.java
  9. 8 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/calendar/MyCalendarListView.java
  10. 580 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/MainTimeUtils.java
  11. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/NumberUtils.java
  12. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  13. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureContentAdapter.java
  14. 15 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureNumberViewHolder.kt
  15. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureViewModel.kt
  16. 4 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/HistoryExposureViewholder.kt
  17. 6 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldViewModel.kt
  18. 17 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeActivity.kt
  19. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddHedgeGoodsActivity.kt
  20. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/AddContractActivity.kt
  21. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractDataViewHolder.kt
  22. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/PaymentRegistrationActivity.kt
  23. 6 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryActivity.kt
  24. 6 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt
  25. 241 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/ChangePasswordActivity.kt
  26. 58 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/ChangePasswordViewModel.kt
  27. 22 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/PasswordViewModel.kt
  28. 134 64
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/ResetPasswordActivity.kt
  29. 40 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/SettingActivity.kt
  30. 37 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/SettingViewModel.kt
  31. 117 9
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tradingquery/TradingQueryActivity.kt
  32. 20 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tradingquery/TradingQueryViewModel.kt
  33. 101 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/AgreeMentActivity.kt
  34. 137 30
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt
  35. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ProcurementViewModel.kt
  36. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/sale/SaleViewModel.kt
  37. 5 0
      RMA/app/src/main/res/drawable/checkbox_switch_selector.xml
  38. 9 0
      RMA/app/src/main/res/drawable/ic_check_normal.xml
  39. 9 0
      RMA/app/src/main/res/drawable/ic_check_select.xml
  40. 9 0
      RMA/app/src/main/res/drawable/ic_switch_off.xml
  41. 9 0
      RMA/app/src/main/res/drawable/ic_switch_on.xml
  42. 2 2
      RMA/app/src/main/res/drawable/rma_market_item_botton_bg_2.xml

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

@@ -187,6 +187,10 @@
         <activity android:name=".view.base.future.entrusts.EntrustDetailsActivity"/>
 
         <activity android:name=".view.base.home.set.ResetPasswordActivity"/>
+
+        <activity android:name=".view.base.home.set.ChangePasswordActivity"/>
+
+        <activity android:name=".view.base.login.AgreeMentActivity"/>
     </application>
 
 </manifest>

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

@@ -1,6 +1,7 @@
 package cn.muchinfo.rma.business.account
 
 import cn.muchinfo.rma.business.account.adapter.AccountAdapter
+import cn.muchinfo.rma.business.commodity.adapter.CommodityAdapter
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.account.LoginQueryData
 import cn.muchinfo.rma.netManage.base.ResponseCallback
@@ -263,4 +264,68 @@ class AccountManager {
         )
     }
 
+    /**
+     * 修改登陆密码
+     * @param oldpwd String 加密后的老密码
+     * @param newPwd String 加密后的新密码
+     * @param callBack Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun modifyPwd(oldpwd : String,newPwd : String, callback: (isCompleted: Boolean, err: Error?) -> Unit){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = AccountAdapter.modifyPwdRepPacket(
+            oldpwd, newPwd
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FID_ModifyPwdRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = AccountAdapter.analysismodifyPwdRepRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
+     * 用户登出
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun loginOut(callback: (isCompleted: Boolean, err: Error?) -> Unit){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = AccountAdapter.loginOutReqPacket()
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.LOGOUTRSP,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = AccountAdapter.analysisLoginOutRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
 }

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

@@ -106,5 +106,93 @@ class AccountAdapter {
                 Pair(false, Error("装箱失败"))
             }
         }
+
+        /**
+         * 修改登陆密码报文装箱
+         * @param oldpwd String
+         * @param newPwd String
+         * @return Packet50
+         */
+        fun modifyPwdRepPacket(oldpwd : String,newPwd : String) : Packet50{
+            val builder = SystemMI1.ModifyPwdReq.newBuilder()
+            val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+            builder.setNewPwd(newPwd)
+            builder.setOldPwd(oldpwd)
+            builder.setModifyPwdType(1)
+            builder.setModifyPwdID(loginInfo.loginID)
+            builder.setHeader(
+                MessageHeadModel.getHead(
+                    FunCode.FID_ModifyPwdReq,
+                    loginInfo.userID,
+                    GlobalDataCollection.instance?.accountId ?: 0,
+                    0,
+                    18
+                )
+            )
+
+            val arrayOutputStream = ByteArrayOutputStream();
+            builder.build().writeTo(arrayOutputStream)
+            return Packet50(FunCode.FID_ModifyPwdReq, arrayOutputStream.toByteArray())
+
+        }
+
+
+        /**
+         * 修改登陆密码回复报文
+         * @param packet50 Packet50 Token检验回复报文
+         * @return Pair<Boolean, Error?> 是否成功,错误
+         */
+        fun analysismodifyPwdRepRsp(packet50: Packet50): Pair<Boolean, Error?> {
+            return try {
+                val tokenCheckRsp = SystemMI1.ModifyPwdRsp.parseFrom(packet50.content)
+                if (tokenCheckRsp.retCode == 0) {
+                    // Token检验成功
+                    Pair(true, null)
+                } else {
+                    // Token检验失败
+                    Pair(false, Error(tokenCheckRsp.retDesc))
+                }
+            } catch (e: Exception) {
+                // 装箱失败
+                Pair(false, Error("装箱失败"))
+            }
+        }
+
+        /**
+         * 用户登出请求报文装箱
+         * @return Packet50
+         */
+        fun loginOutReqPacket() : Packet50{
+            val builder = SystemMI1.LogoutReq.newBuilder()
+            val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+            builder.setLoginID(loginInfo.loginID)
+            builder.setToken(GlobalDataCollection.instance?.loginRsp?.token)
+            builder.setHeader(MessageHeadModel.getHead(FunCode.LOGOUTREQ, 0, 0, 0, 0))
+            val arrayOutputStream = ByteArrayOutputStream();
+            builder.build().writeTo(arrayOutputStream)
+
+            return Packet50(FunCode.LOGOUTREQ, arrayOutputStream.toByteArray())
+        }
+
+        /**
+         * 用户登出报文解析
+         * @param packet50 Packet50
+         * @return Pair<Boolean, Error?>
+         */
+        fun analysisLoginOutRsp(packet50: Packet50): Pair<Boolean, Error?> {
+            return try {
+                val tokenCheckRsp = SystemMI1.LoginRsp.parseFrom(packet50.content)
+                if (tokenCheckRsp.retCode == 0) {
+                    // Token检验成功
+                    Pair(true, null)
+                } else {
+                    // Token检验失败
+                    Pair(false, Error(tokenCheckRsp.retDesc))
+                }
+            } catch (e: Exception) {
+                // 装箱失败
+                Pair(false, Error("装箱失败"))
+            }
+        }
     }
 }

+ 6 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/contract/adapter/ContractAdapter.kt

@@ -100,6 +100,12 @@ object ContractAdapter {
             if (it.Price != 0.0) {
                 contractInfobuilder.price = it.Price
             }
+            if (it.SpotGoodsModelID != 0){
+                contractInfobuilder.spotGoodsModelID = it.SpotGoodsModelID
+            }
+            if (it.SpotGoodsBrandID != 0){
+                contractInfobuilder.spotGoodsBrandID = it.SpotGoodsBrandID
+            }
             if (it.PriceMove != 0.0) {
                 contractInfobuilder.priceMove = it.PriceMove
             }

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/ViewEnumUtils.kt

@@ -22,7 +22,7 @@ object ViewEnumUtils {
                 outString = "执行中"
             }
             "3" -> {
-                outString = "正常完结"
+                outString = "已完成"
             }
             "4" -> {
                 outString = "审核拒绝"

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

@@ -26,6 +26,22 @@ public class FunCode {
      */
     public static final int TokenCheckRsp = 65542;
     /**
+     * 修改账户密码请求
+     */
+    public static final int FID_ModifyPwdReq = 65543;
+    /**
+     * 修改账户密码应答
+     */
+    public static final int FID_ModifyPwdRsp = 65544;
+    /**
+     * 用户登出请求
+     */
+    public static final int LOGOUTREQ = 65539;//
+    /**
+     * 用户登出应答
+     */
+    public static final int LOGOUTRSP = 65540;//
+    /**
      * 通用错误通知(0, 2, 1)
      */
     public static final int ErrorNtf = 131073;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 154 - 154
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java


+ 26 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/CheckPassword.java

@@ -0,0 +1,26 @@
+package cn.muchinfo.rma.view.autoWidget;
+
+public class CheckPassword {
+    //数字
+    public static final String REG_NUMBER = ".*\\d+.*";
+    //小写字母
+    public static final String REG_UPPERCASE = ".*[A-Z]+.*";
+    //大写字母
+    public static final String REG_LOWERCASE = ".*[a-z]+.*";
+    //特殊符号
+    public static final String REG_SYMBOL = ".*[~!@#$%^&*()_+|<>,.?/:;'\\[\\]{}\"]+.*";
+
+    public static boolean checkPasswordRule(String password) {
+        //密码为空或者长度小于8位则返回false
+        if (password == null || password.length() < 8) return false;
+        int i = 0;
+        if (password.matches(REG_NUMBER)) i++;
+        if (password.matches(REG_LOWERCASE)) i++;
+        if (password.matches(REG_UPPERCASE)) i++;
+        if (password.matches(REG_SYMBOL)) i++;
+
+        if (i < 3) return false;
+
+        return true;
+    }
+}

+ 8 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/calendar/MyCalendarListView.java

@@ -118,7 +118,15 @@ public class MyCalendarListView extends FrameLayout {
 
             //如果当前点击的结束日期跟开始日期一致 则不做操作
             if (startDate == dateBean){
+                //修改为可选择当天
+                endDate = dateBean;
+                endDate.setItemState(DateBean.ITEM_STATE_END_DATE);
+//                setState();//选中中间的日期
 
+                if(onDateSelected!=null){
+                    onDateSelected.hasSelect(true);
+                    onDateSelected.selected(simpleDateFormat.format(startDate.getDate()),simpleDateFormat.format(endDate.getDate()));
+                }
             }else if (dateBean.getDate().getTime() < startDate.getDate().getTime()){
                 //如果当前点选的日期小于当前选中的开始日期,则本次操作重新选中开始日期
                 startDate.setItemState(DateBean.ITEM_STATE_NORMAL);

+ 580 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/MainTimeUtils.java

@@ -0,0 +1,580 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ * Created by cxl on 2018/3/19.
+ */
+
+public class MainTimeUtils {
+    /**
+     * 获取相对时区的UTC时间
+     *
+     * @param calendar
+     *            时间参数,这里是带了时区的
+     * @return
+     */
+    public static int getZoneUTCSeconds(Calendar calendar) {
+        if (calendar == null) {
+            return 0;
+        }
+        return (int) (calendar.getTimeInMillis() / 1000);
+    }
+
+    /**
+     * @return
+     */
+    public static long getHMS(long mins) {
+        Date date = new Date(mins);
+        String strs = "";
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("HH-mm-ss");
+            strs = sdf.format(date);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        SimpleDateFormat formatter = new SimpleDateFormat("HH-mm-ss");
+        try {
+            date = formatter.parse(strs);
+            return date.getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return 0;
+    }
+
+    public static String getNowTime() {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// HH:mm:ss
+//获取当前时间
+        Date date = new Date(System.currentTimeMillis());
+        return simpleDateFormat.format(date);
+    }
+
+    public static String getNowTime(String format) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);// HH:mm:ss
+//获取当前时间
+        Date date = new Date(System.currentTimeMillis());
+        return simpleDateFormat.format(date);
+    }
+
+    /**
+     * 我们的服务格式有点牛逼  这里处理一下(lbl:我看到这种操作都惊呆了,实在是吊的一批的服务格式)
+     *
+     * @param time
+     * @return
+     */
+    public static String formatTime(String time, String outFormat) {
+        Date dates = null;
+        SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            dates = simpleDateFormat2.parse(time.replace("\\.0", ""));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(outFormat);
+        return simpleDateFormat.format(dates);
+    }
+
+
+    /**
+     * 比较两个日期的大小,日期格式为yyyy-MM-dd
+     *
+     * @param str1 the first date
+     * @param str2 the second date
+     * @return true <br/>false
+     */
+    public static boolean isDateOneBigger(String str1, String str2) {
+        boolean isBigger = false;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        Date dt1 = null;
+        Date dt2 = null;
+        try {
+            dt1 = sdf.parse(str1);
+            dt2 = sdf.parse(str2);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (dt1.getTime() > dt2.getTime()) {
+            isBigger = true;
+        } else if (dt1.getTime() < dt2.getTime()) {
+            isBigger = false;
+        }
+        return isBigger;
+    }
+
+    /**
+     * 比较两个日期的大小,日期格式为yyyy-MM-dd
+     *
+     * @param str1 the first date
+     * @param str2 the second date
+     * @return true <br/>false
+     */
+    public static boolean isDateOneBigger(String str1, String str2, String format) {
+        boolean isBigger = false;
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        Date dt1 = null;
+        Date dt2 = null;
+        try {
+            dt1 = sdf.parse(str1);
+            dt2 = sdf.parse(str2);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (dt1.getTime() > dt2.getTime()) {
+            isBigger = true;
+        } else if (dt1.getTime() < dt2.getTime()) {
+            isBigger = false;
+        }
+        return isBigger;
+    }
+
+    /**
+     * @param str1
+     * @param str2
+     * @param format
+     * @return 0:相等  1: 大于 2 小于
+     */
+    public static int checkTimeBigAndSmall(String str1, String str2, String format) {
+        int isBigger = 0;
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        Date dt1 = null;
+        Date dt2 = null;
+        try {
+            dt1 = sdf.parse(str1);
+            dt2 = sdf.parse(str2);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (dt1.getTime() > dt2.getTime()) {
+            isBigger = 1;
+        } else if (dt1.getTime() < dt2.getTime()) {
+            isBigger = 2;
+        }
+        return isBigger;
+    }
+
+
+    /*
+     * 将时间转换为时间戳
+     */
+    public static String dateToStamp(String s) throws ParseException {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = simpleDateFormat.parse(s);
+        long ts = date.getTime();
+        res = String.valueOf(ts);
+        return res;
+    }
+
+    /*
+     * 将时间转换为时间戳
+     */
+    public static long dateToStamp(String s, String format) {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
+        Date date = null;
+        try {
+            date = simpleDateFormat.parse(s);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        long ts = date.getTime();
+        return ts;
+    }
+
+    /**
+     * 判断是否为今天(效率比较高)
+     *
+     * @param day 传入的 时间  "2016-06-28 10:10:30" "2016-06-28" 都可以
+     * @return true今天 false不是
+     * @throws ParseException
+     */
+    public static boolean IsYesterday(String day) throws ParseException {
+
+        Calendar pre = Calendar.getInstance();
+        Date predate = new Date(System.currentTimeMillis());
+        pre.setTime(predate);
+
+        Calendar cal = Calendar.getInstance();
+        Date date = getDateFormat().parse(day);
+        cal.setTime(date);
+
+        if (cal.get(Calendar.YEAR) == (pre.get(Calendar.YEAR))) {
+            int diffDay = cal.get(Calendar.DAY_OF_YEAR)
+                    - pre.get(Calendar.DAY_OF_YEAR);
+
+            return diffDay == 0;
+        }
+        return false;
+    }
+
+    public static boolean IsYesterday(String day, String nowTime) throws ParseException {
+        Calendar pre = Calendar.getInstance();
+        Date predate = getDateFormat().parse(nowTime);
+        pre.setTime(predate);
+
+        Calendar cal = Calendar.getInstance();
+        Date date = getDateFormat().parse(day);
+        cal.setTime(date);
+
+        if (cal.get(Calendar.YEAR) == (pre.get(Calendar.YEAR))) {
+            int diffDay = cal.get(Calendar.DAY_OF_YEAR)
+                    - pre.get(Calendar.DAY_OF_YEAR);
+
+            return diffDay == 0;
+        }
+        return false;
+    }
+
+
+    /**
+     * 判断是否为昨天(效率比较高)
+     *
+     * @param day 传入的 时间  "2016-06-28 10:10:30" "2016-06-28" 都可以
+     * @return true今天 false不是
+     * @throws ParseException
+     */
+    public static boolean IsYesterday(String day, String NowTime, String format) throws ParseException {
+
+        Calendar pre = Calendar.getInstance();
+        Date predate = new Date(System.currentTimeMillis());
+        pre.setTime(predate);
+
+        Calendar cal = Calendar.getInstance();
+        Date date = getDateFormat(format).parse(day);
+        cal.setTime(date);
+
+        if (cal.get(Calendar.YEAR) == (pre.get(Calendar.YEAR))) {
+            int diffDay = cal.get(Calendar.DAY_OF_YEAR)
+                    - pre.get(Calendar.DAY_OF_YEAR);
+
+            return diffDay == 0;
+        }
+        return false;
+    }
+
+
+    private static ThreadLocal<SimpleDateFormat> DateLocal = new ThreadLocal<SimpleDateFormat>();
+
+    public static SimpleDateFormat getDateFormat() {
+        if (null == DateLocal.get()) {
+            DateLocal.set(new SimpleDateFormat("yyyyMMdd", Locale.CHINA));
+        }
+        return DateLocal.get();
+    }
+
+    public static SimpleDateFormat getDateFormat(String format) {
+        if (null == DateLocal.get()) {
+            DateLocal.set(new SimpleDateFormat(format, Locale.CHINA));
+        }
+        return DateLocal.get();
+    }
+
+    // currentTime要转换的long类型的时间
+    // formatType要转换的string类型的时间格式
+    public static String longToString(long currentTime, String formatType)
+            throws ParseException {
+        Date date = longToDate(currentTime, formatType); // long类型转成Date类型
+        String strTime = dateToString(date, formatType); // date类型转成String
+        return strTime;
+    }
+
+    // currentTime要转换的long类型的时间
+    // formatType要转换的时间格式yyyy-MM-dd HH:mm:ss//yyyy年MM月dd日 HH时mm分ss秒
+    public static Date longToDate(long currentTime, String formatType)
+            throws ParseException {
+        Date dateOld = new Date(currentTime); // 根据long类型的毫秒数生命一个date类型的时间
+        String sDateTime = dateToString(dateOld, formatType); // 把date类型的时间转换为string
+        Date date = stringToDate(sDateTime, formatType); // 把String类型转换为Date类型
+        return date;
+    }
+
+    // strTime要转换的string类型的时间,formatType要转换的格式yyyy-MM-dd HH:mm:ss//yyyy年MM月dd日
+    // HH时mm分ss秒,
+    // strTime的时间格式必须要与formatType的时间格式相同
+    public static Date stringToDate(String strTime, String formatType)
+            throws ParseException {
+        SimpleDateFormat formatter = new SimpleDateFormat(formatType);
+        Date date = null;
+        date = formatter.parse(strTime);
+        return date;
+    }
+
+    // formatType格式为yyyy-MM-dd HH:mm:ss//yyyy年MM月dd日 HH时mm分ss秒
+    // data Date类型的时间
+    public static String dateToString(Date data, String formatType) {
+        return new SimpleDateFormat(formatType).format(data);
+    }
+
+    /**
+     * 比较两个时间  相差几天
+     *
+     * @param startTime
+     * @param endTime
+     * @param format
+     * @return
+     */
+    public static long dateDiff(String startTime, String endTime, String format) {
+        // 按照传入的格式生成一个simpledateformate对象
+        SimpleDateFormat sd = new SimpleDateFormat(format);
+        long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
+        long nh = 1000 * 60 * 60;// 一小时的毫秒数
+        long nm = 1000 * 60;// 一分钟的毫秒数
+        long ns = 1000;// 一秒钟的毫秒数
+        long diff;
+        long day = 0;
+        try {
+            // 获得两个时间的毫秒时间差异
+            diff = sd.parse(endTime).getTime()
+                    - sd.parse(startTime).getTime();
+            day = diff / nd;// 计算差多少天
+            long hour = diff % nd / nh;// 计算差多少小时
+            long min = diff % nd % nh / nm;// 计算差多少分钟
+            long sec = diff % nd % nh % nm / ns;// 计算差多少秒
+            // 输出结果
+//            System.out.println("时间相差:" + day + "天" + hour + "小时" + min
+//                    + "分钟" + sec + "秒。");
+            if (day >= 1) {
+                return day;
+            } else {
+                if (day == 0) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+
+            }
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return 0;
+
+    }
+
+    public static String formatDate(String str) {
+        SimpleDateFormat sf1 = new SimpleDateFormat("yyyyMMdd");
+        SimpleDateFormat sf2 = new SimpleDateFormat("yyyy-MM-dd");
+        String sfstr = "";
+        try {
+            sfstr = sf2.format(sf1.parse(str));
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return sfstr;
+    }
+
+
+    /**
+     * 根据当前日期获得是星期几
+     *
+     * @return
+     */
+    public static int getWeek(String time, String formats) {
+        String Week = "";
+        SimpleDateFormat format = new SimpleDateFormat(formats);
+        Calendar c = Calendar.getInstance();
+        try {
+            c.setTime(format.parse(time));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (c.get(Calendar.DAY_OF_WEEK) == 1) {
+            Week += "周天";
+            return 0;
+        }
+        if (c.get(Calendar.DAY_OF_WEEK) == 2) {
+            Week += "周一";
+            return 1;
+        }
+        if (c.get(Calendar.DAY_OF_WEEK) == 3) {
+            Week += "周二";
+            return 2;
+        }
+        if (c.get(Calendar.DAY_OF_WEEK) == 4) {
+            Week += "周三";
+            return 3;
+        }
+        if (c.get(Calendar.DAY_OF_WEEK) == 5) {
+            Week += "周四";
+            return 4;
+        }
+        if (c.get(Calendar.DAY_OF_WEEK) == 6) {
+            Week += "周五";
+            return 5;
+        }
+        if (c.get(Calendar.DAY_OF_WEEK) == 7) {
+            Week += "周六";
+            return 6;
+        }
+        return -1;
+    }
+
+    /**
+     * 判断2个时间大小
+     * yyyy-MM-dd HH:mm 格式(自己可以修改成想要的时间格式)
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    public static int getTimeCompareSize(String startTime, String endTime, String formats){
+        int i=0;
+        SimpleDateFormat dateFormat = new SimpleDateFormat(formats);//年-月-日 时-分
+        try {
+            Date date1 = dateFormat.parse(startTime);//开始时间
+            Date date2 = dateFormat.parse(endTime);//结束时间
+            // 1 结束时间小于开始时间 2 开始时间与结束时间相同 3 结束时间大于开始时间
+            if (date2.getTime()<date1.getTime()){
+                i= 1;
+            }else if (date2.getTime()==date1.getTime()){
+                i= 2;
+            }else if (date2.getTime()>date1.getTime()){
+                //正常情况下的逻辑操作.
+                i= 3;
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return  i;
+    }
+
+    /**
+     * 则证明是是要倒退一天
+     * @param time
+     * @return true:时间没问题  false:
+     */
+    public static boolean checkTimeIs23(String time){
+        //减了一个小时后 如果 :前面的是23 则证明是是要倒退一天
+        String[] times = null;
+        times = time.split(":");
+        if(times.length == 2){
+            return times[0].equals("23");
+        }else{
+            return false;
+        }
+    }
+
+    /**
+     * 输入格式 和输出格式 转换一下
+     * @param time
+     * @param inFormat
+     * @param outFormat
+     * @return
+     */
+    public static String formatTime(String time, String inFormat, String outFormat) {
+        Date dates = null;
+        SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat(inFormat);
+        try {
+            dates = simpleDateFormat2.parse(time.replace("\\.0", ""));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(outFormat);
+        return simpleDateFormat.format(dates);
+    }
+
+    /**
+     * 小时补0
+     * @param hours
+     * @return
+     */
+    public static String hourAddZero(String hours){
+        if(hours.length() == 1){
+            return "0"+ hours;
+        }else{
+            return hours;
+        }
+    }
+
+
+    public static boolean isSameDate(String date1, String date2) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddd HHmmss", Locale.CHINA);
+        Calendar calendar = Calendar.getInstance();
+        Calendar calendar1 = Calendar.getInstance();
+        try {
+            calendar.setTime(sdf.parse(date1));
+            calendar1.setTime(sdf.parse(date1));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        return false;
+    }
+
+    public static void main(String[] args) {
+        isSameDate("2020-05-08", "20200508");
+    }
+
+
+    public static String covnDate(String dateTime) {
+        DateFormat df2 = null;
+        Date date1 = null;
+        try {
+            DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
+            Date date = df.parse(dateTime);
+            SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
+            date1 = df1.parse(date.toString());
+            df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return df2.format(date1);
+    }
+
+    public static String covnDate3(String dateTime) {
+        DateFormat df2 = null;
+        Date date1 = null;
+        try {
+            DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
+            Date date = df.parse(dateTime);
+            SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
+            date1 = df1.parse(date.toString());
+            df2 = new SimpleDateFormat("MM-dd");
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return df2.format(date1);
+    }
+
+
+    public static String covnDate2(String dateTime) {
+        DateFormat df2 = null;
+        Date date1 = null;
+        try {
+            DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
+            Date date = df.parse(dateTime);
+            SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
+            date1 = df1.parse(date.toString());
+            df2 = new SimpleDateFormat("yyyy-MM-dd");
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return df2.format(date1);
+    }
+
+    public static String covnDate4(String dateTime) {
+        DateFormat df2 = null;
+        Date date1 = null;
+        try {
+            DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
+            Date date = df.parse(dateTime);
+            SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
+            date1 = df1.parse(date.toString());
+            df2 = new SimpleDateFormat("yyyy.MM.dd");
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return df2.format(date1);
+    }
+}

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/NumberUtils.java

@@ -168,7 +168,7 @@ public class NumberUtils {
 
         String s = getZeroPatternString(num);
         DecimalFormat decimalFormat = new DecimalFormat(s);
-        return decimalFormat.format(Double.parseDouble(string));
+        return decimalFormat.format(Double.parseDouble(doubleDistortion(string)));
     }
 
     public static String getDecimalPlace(int place) {

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

@@ -107,4 +107,7 @@ object Constant {
 
     /** 自选的商品id ***/
     const val OPTIONAL_GOODS_ID = "OPTIONAL_GOODS_ID"
+
+    /** 是否已勾选阅读用户协议 */
+    const val READ_AGREEMENT = "READ_AGREEMENT"
 }

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureContentAdapter.java

@@ -21,6 +21,7 @@ import java.util.List;
 import cn.muchinfo.rma.R;
 import cn.muchinfo.rma.global.data.RealExposureData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
 
 /**
@@ -121,7 +122,11 @@ public class ExposureContentAdapter extends RecyclerView.Adapter<ExposureContent
         });
         //下单
         itemViewHolder.place_the_order.setOnClickListener(view -> {
-            ToastUtils.showLong("下单");
+            Intent intent = new Intent();
+            intent.putExtra("goodsId", "");
+            intent.putExtra("outGoodsCode", "");
+            intent.setClass(context, GoodsTradeActivity.class);
+            ActivityUtils.startActivity(intent);
         });
 
         itemViewHolder.exposure_horItemScrollview.setEventListener(event -> {

+ 15 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureNumberViewHolder.kt

@@ -5,6 +5,7 @@ import android.view.Gravity
 import androidx.fragment.app.Fragment
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.NumberSpotData
+import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
@@ -45,9 +46,12 @@ class ExposureNumberViewHolder(
                  textView {
                      data.bindOptional(context){
                          text = if (type == "1"){
-                             it?.wrstandardname
+                             it?.wrstandardname?.isBlankString()
                          }else{
-                             it?.goodsname
+                             if (it?.goodsname?.length ?: 0 > 6){
+                                 textSizeAuto = 21
+                             }
+                             it?.goodsname?.isBlankString()
                          }
                      }
                      textSizeAuto = 31
@@ -59,9 +63,9 @@ class ExposureNumberViewHolder(
                  textView {
                      data.bindOptional(context){
                          text = if (type == "1"){
-                             it?.wrstandardcode
+                             it?.wrstandardcode?.isBlankString()
                          }else{
-                             it?.goodscode
+                             it?.goodscode?.isBlankString()
                          }
                      }
                      textSizeAuto = 31
@@ -101,10 +105,14 @@ class ExposureNumberViewHolder(
                 }.lparams(wrapContent, wrapContent)
                  textView {
                       data.bindOptional(context){
-                        text = if (type == "1"){
-                            it?.decreaseqty
+                       if (type == "1"){
+                            if (it?.decreaseqty == "-0"){
+                                text = "0"
+                            } else{
+                                text = it?.decreaseqty
+                            }
                         }else{
-                            it?.decreaseqty + "手"
+                           text = it?.decreaseqty + "手"
                         }
                      }
                      textSizeAuto = 31

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

@@ -198,8 +198,8 @@ class ExposureViewModel : BaseViewModel(){
             newRightData.add(NumberUtils.roundNum(it.TotalNeedHedgeQty,2) + it.ENUMDICNAME + "\n" + NumberUtils.roundNum(it.TotalFutureQty,2) + it.ENUMDICNAME)
             newRightData.add(NumberUtils.roundNum(it.NeedHedgeExposoure,2) + it.ENUMDICNAME + "\n" + it.NeedHedgeRatio?.toPercentage())
             newRightData.add(NumberUtils.roundNum(it.TotalExposure,2) + it.ENUMDICNAME + "\n" +it.TotalHedgeRatio?.toPercentage())
-            newRightData.add(NumberUtils.roundNum(it.OriTotalSpotQty,2) + it.ENUMDICNAME + "\n" + NumberUtils.roundNum(it.DiffSpotQty,2) + it.ENUMDICNAME)
-            newRightData.add(NumberUtils.roundNum(it.OriTotalFutuQty,2) + it.ENUMDICNAME + "\n" + NumberUtils.roundNum(it.DiffFutuQty,2) + it.ENUMDICNAME)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.OriTotalSpotQty),2) + it.ENUMDICNAME + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.DiffSpotQty),2) + it.ENUMDICNAME)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.OriTotalFutuQty),2) + it.ENUMDICNAME + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.DiffFutuQty),2) + it.ENUMDICNAME)
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }

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

@@ -38,7 +38,9 @@ class HistoryExposureViewholder(
                     }
                     textSizeAuto = 34
                     textColorInt = R.color.rma_blue_color
-                }.lparams(wrapContent, wrapContent)
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(30)
+                }
             }.lparams(matchParent, autoSize(84))
 
             chartview {
@@ -71,6 +73,7 @@ class HistoryExposureViewholder(
                         .name("应套保敞口")
                         .step(true)
                         .data(list.map { it.needhedgeexposoure }.toTypedArray())
+                    aaChartModel  .tooltipValueSuffix(resp.enumdicname)
                     aaChartModel.categories(list.map { it.reckondate }.toTypedArray())
                     aaChartModel.series(arrayOf(totalexposureelement,needhedgeexposoureelement))
                     aa_drawChartWithChartModel(aaChartModel)

+ 6 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldViewModel.kt

@@ -211,27 +211,27 @@ class HoldViewModel : BaseViewModel() {
                 if (quoteData != null) {
                     itemData?.calculate()
                     holder.idZPl?.text =
-                        NumberUtils.roundNum(itemData?.positionpl.toString(), 2)
+                        NumberUtils.roundNum(NumberUtils.doubleDistortion(itemData?.positionpl.toString()), 2)
                     holder.idPlp?.text =
                         itemData?.positionplrate?.times(100.0)
                             ?.let { NumberUtils.roundNum(it, 2) + "%" }
                     holder.id_pl?.text =
-                        NumberUtils.roundNum(itemData?.openpl.toString(), 2)
+                        NumberUtils.roundNum(NumberUtils.doubleDistortion(itemData?.openpl.toString()), 2)
                 } else {
                     holder.idZPl?.text =
-                        NumberUtils.roundNum(itemData?.positionpl.toString(), 2)
+                        NumberUtils.roundNum(NumberUtils.doubleDistortion(itemData?.positionpl.toString()), 2)
                     holder.idPlp?.text = itemData?.positionplrate?.times(100.0)
                         ?.let { NumberUtils.roundNum(it, 2) + "%" }
                     holder.id_pl?.text =
-                        NumberUtils.roundNum(itemData?.openpl.toString(), 2)
+                        NumberUtils.roundNum(NumberUtils.doubleDistortion(itemData?.openpl.toString()), 2)
                 }
             } else {//第一次请求则直接拿go服务给的值
                 holder.idZPl?.text =
-                    NumberUtils.roundNum(itemData?.positionpl.toString(), 2)
+                    NumberUtils.roundNum(NumberUtils.doubleDistortion(itemData?.positionpl.toString()), 2)
                 holder.idPlp?.text = itemData?.positionplrate?.times(100.0)
                     ?.let { NumberUtils.roundNum(it, 2) + "%" }
                 holder.id_pl?.text =
-                    NumberUtils.roundNum(itemData?.openpl.toString(), 2)
+                    NumberUtils.roundNum(NumberUtils.doubleDistortion(itemData?.openpl.toString()), 2)
             }
 
             if (itemData?.positionpl == 0.0) {

+ 17 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeActivity.kt

@@ -259,7 +259,10 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
         /**
          * 页面ui
          */
-        initData(goodsId = goodsId ?: "0", outGoodsCode = outGoodsCode ?: "")
+        if (goodsId.isNullOrEmpty().not()){
+            initData(goodsId = goodsId ?: "0", outGoodsCode = outGoodsCode ?: "")
+        }
+
         viewModel.calculateMoney()
         EventBus.getDefault().register(this)
         verticalLayout {
@@ -365,9 +368,10 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                         goodsInfoData.bindOptional(context) {
                                             text = it?.goodsname
                                         }
+                                        text = "请选择商品"
                                         textSizeAuto = 34
                                         textColorInt = R.color.rma_black_33
-                                    }
+                                    }.lparams(wrapContent, wrapContent)
 
                                     emptyView()
 
@@ -386,6 +390,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                         viewModel.quoteDayData.bindOptional(context) {
                                             text = it?.getPrice().toString()
                                         }
+                                        text = "0.0"
                                         textSizeAuto = 31
                                         textColorInt = R.color.rma_red_color
                                     }.lparams(wrapContent, wrapContent) {
@@ -398,6 +403,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                         viewModel.quoteDayData.bindOptional(context) {
                                             text = it?.getPrice()?.minus(it.preclose).toString()
                                         }
+                                        text = "0.0"
                                         textSizeAuto = 31
                                         textColorInt = R.color.rma_red_color
                                     }.lparams(wrapContent, wrapContent)
@@ -411,6 +417,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                                     .toString().toPercentage()
                                             }
                                         }
+                                        text = "0"
                                         textSizeAuto = 31
                                         textColorInt = R.color.rma_red_color
                                     }.lparams(wrapContent, wrapContent) {
@@ -548,6 +555,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                                     goodsInfoData.value?.decimalplace ?: 2
                                                 )
                                             }
+                                            text = "0.0"
                                             textSizeAuto = 31
                                             textColorInt = R.color.rma_red_color
                                         }.lparams(wrapContent, wrapContent) {
@@ -587,6 +595,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                                     goodsInfoData.value?.decimalplace ?: 2
                                                 )
                                             }
+                                            text = "0.0"
                                             textSizeAuto = 31
                                             textColorInt = R.color.rma_green_color
                                         }.lparams(wrapContent, wrapContent) {
@@ -626,6 +635,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                             viewModel.quoteDayData.bindOptional(context) {
                                                 text = it?.lastvolume.toString()
                                             }
+                                            text = "0"
                                             textSizeAuto = 31
                                             textColorInt = R.color.rma_black_33
                                         }.lparams(wrapContent, wrapContent) {
@@ -648,6 +658,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                             viewModel.quoteDayData.bindOptional(context) {
                                                 text = it?.limitup.toString()
                                             }
+                                            text = "0.0"
                                             textSizeAuto = 31
                                             textColorInt = R.color.rma_red_color
                                         }.lparams(wrapContent, wrapContent) {
@@ -670,6 +681,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                             viewModel.quoteDayData.bindOptional(context) {
                                                 text = it?.limitdown.toString()
                                             }
+                                            text = "0.0"
                                             textSizeAuto = 31
                                             textColorInt = R.color.rma_green_color
                                         }.lparams(wrapContent, wrapContent) {
@@ -789,7 +801,9 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                             }
                                             textSizeAuto = 38
                                             textColorInt = R.color.white
+                                            text = "0.0"
                                         }.lparams(wrapContent, wrapContent)
+
                                     }.lparams(matchParent, autoSize(71))
                                     view {
                                         background = resources.getDrawable(R.color.white)
@@ -832,6 +846,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                                     linearLayout {
                                         gravity = Gravity.CENTER
                                         textView {
+                                            text = "0.0"
                                             sort_selling_text = this
                                             //行情变化后根据不同的价格类型分别对赋值
                                             viewModel.quoteDayData.bindOptional(context) {

+ 2 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddHedgeGoodsActivity.kt

@@ -339,6 +339,8 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                     needhedgeratio = hedge_ratio_edtittext.text.toString()
                                         .toDouble().div(100),
                                     goodsgroupid = data.goodsgroupid?.toLong() ?: 0,
+                                    modifierid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
+                                        ?: 0,
                                     areauserid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
                                         ?: 0,
                                     remark = remask_edittext.text.toString()

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

@@ -1461,7 +1461,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
         contractInfo.ProductType = selectProductType.value?.id?.toInt()!!
         contractInfo.ConvertFactor = coefficientWarehouse.text.toString().toDouble()
         contractInfo.SpotGoodsModelID = selectWrStandModel.value?.id?.toInt()!!
-        contractInfo.PriceType = viewModel.pricingType.value?.id?.toInt()!!
+        contractInfo.PriceType = viewModel.pricingType.value?.id?.toInt()!!//定价类型
         contractInfo.Qty = number_Edittext.text.toString().toDouble()
 
 
@@ -1471,6 +1471,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
                 .times(number_Edittext.text.toString().toDouble())
         } else if (viewModel.pricingType.value?.id == "3") {//暂定价时price为暂定价
             contractInfo.Price = temperary_edittext.text.toString().toDouble()
+            contractInfo.Amount = temperary_edittext.text.toString().toDouble().times(number_Edittext.text.toString().toDouble())
             contractInfo.GoodsID = selectGoodsList.value?.id?.toInt() ?: 0//点价合约在点价和暂定价是需要传值
         } else {
             contractInfo.GoodsID = selectGoodsList.value?.id?.toInt() ?: 0//暂时写死一个

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

@@ -152,7 +152,7 @@ class ContractDataViewHolder(
                         data.bindOptional(context) {
                             when (it?.producttype) {
                                 "1" -> {
-                                    text = "标准"
+                                    text = "标准仓单"
                                 }
                                 "2" -> {
                                     text = "等标"

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/PaymentRegistrationActivity.kt

@@ -165,7 +165,12 @@ class PaymentRegistrationActivity : BaseActivity<RegistrationViewModel>() {
                                     linearLayout {
                                         emptyView()
                                         textView {
-                                            text = data.loanamount + "元"
+                                            if (data.pricetype == "3"){
+                                                text = data.loanamount + "元"
+                                            }else{
+                                                text = "0元"
+                                            }
+
                                             textSizeAuto = 29
                                             textColorInt = R.color.rma_black_33
                                         }.lparams(wrapContent, wrapContent) {

+ 6 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryActivity.kt

@@ -189,7 +189,7 @@ class FinancialReportUI(
     /**
      * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
      */
-    var tradedate: String = TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd"))
+    var tradedate: String = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
 
     /** 查询时间textview **/
     lateinit var tradedatetextview: TextView
@@ -300,7 +300,7 @@ class FinancialReportUI(
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
                         tradedatetextview = this
-                        text = TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd"))
+                        text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
                         textColorInt = R.color.rma_hint_text_color_ccc
                         textSizeAuto = 31
                     }.lparams(wrapContent, wrapContent) {
@@ -656,7 +656,7 @@ class ExposureReportUI(
     /**
      * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
      */
-    var tradedate: String = TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd"))
+    var tradedate: String = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
 
     /** 查询时间textview **/
     lateinit var tradedatetextview: TextView
@@ -701,7 +701,7 @@ class ExposureReportUI(
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
                         tradedatetextview = this
-                        text = TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd"))
+                        text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
                         textColorInt = R.color.rma_hint_text_color_ccc
                         textSizeAuto = 31
                     }.lparams(wrapContent, wrapContent) {
@@ -965,7 +965,7 @@ class SpotReportUI(
     /**
      * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
      */
-    var tradedate: String = TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd"))
+    var tradedate: String = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
 
     /** 查询时间textview **/
     lateinit var tradedatetextview: TextView
@@ -1022,7 +1022,7 @@ class SpotReportUI(
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
                         tradedatetextview = this
-                        text = TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd"))
+                        text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400000),SimpleDateFormat("yyyy-MM-dd"))
                         textColorInt = R.color.rma_hint_text_color_ccc
                         textSizeAuto = 31
                     }.lparams(wrapContent, wrapContent) {

+ 6 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt

@@ -290,12 +290,12 @@ class ReportQueryViewModel : BaseViewModel(){
         val newList = arrayListOf<ExposureReportData>()
         respData.forEach {
             val newRightData = arrayListOf<String>()
-            newRightData.add(NumberUtils.roundNum(it.totalspotqty,2) + it.enumdicname + "\n" + it.middlegoodshedgeratio?.toPercentage())
-            newRightData.add(NumberUtils.roundNum(it.totalneedhedgeqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.totalfutureqty,2) + it.enumdicname)
-            newRightData.add(NumberUtils.roundNum(it.needhedgeexposoure,2) + it.enumdicname + "\n" + it.needhedgeratio?.toPercentage())
-            newRightData.add(NumberUtils.roundNum(it.totalexposure,2) + it.enumdicname + "\n" +it.totalhedgeratio?.toPercentage())
-            newRightData.add(NumberUtils.roundNum(it.oriTotalSpotQty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffSpotQty,2) + it.enumdicname)
-            newRightData.add(NumberUtils.roundNum(it.oriTotalFutuQty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffFutuQty,2) + it.enumdicname)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalspotqty),2) + it.enumdicname + "\n" + it.middlegoodshedgeratio?.toPercentage())
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalneedhedgeqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.totalfutureqty,2) + it.enumdicname)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.needhedgeexposoure),2) + it.enumdicname + "\n" + it.needhedgeratio?.toPercentage())
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalexposure),2) + it.enumdicname + "\n" +it.totalhedgeratio?.toPercentage())
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.oriTotalSpotQty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffSpotQty),2) + it.enumdicname)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.oriTotalFutuQty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffFutuQty),2) + it.enumdicname)
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }

+ 241 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/ChangePasswordActivity.kt

@@ -0,0 +1,241 @@
+package cn.muchinfo.rma.view.base.home.set
+
+import android.app.Dialog
+import android.os.Bundle
+import android.text.InputType
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
+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 com.blankj.utilcode.util.AppUtils
+import com.blankj.utilcode.util.LogUtils
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.dialog.createWarningDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+
+/**
+ * 修改密码
+ */
+class ChangePasswordActivity : BaseActivity<ChangePasswordViewModel>(){
+
+
+    lateinit var oldPaw  : EditText
+    lateinit var newPsw : EditText
+    lateinit var againNewPsw : EditText
+
+    var loadingDialog: Dialog? = null
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            loadingDialog = createLoadingDialog(hintStr = "请求中..")
+            loadingDialog?.bindTaskStatus(context, viewModel.loadingDialogStatus)
+            val marpadding = autoSize(32)
+            background = resources.getDrawable(R.color.white)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "修改登陆密码"
+                }
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                background = resources.getDrawable(R.color.p_global_write_color)
+                textView {
+                    text = "*"
+                    visibility = View.INVISIBLE
+                    textColorInt = R.color.rma_red_color
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                textView {
+                    text = "登陆账号:"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                emptyView()
+
+                textView {
+                    text = GlobalDataCollection.instance?.loginQueryData?.username
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginEnd = marpadding
+                }
+            }.lparams(matchParent, autoSize(120))
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                background = resources.getDrawable(R.color.p_global_write_color)
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_red_color
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                textView {
+                    text = "原密码:"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                editText {
+                    hint = "请输入原密码"
+                    oldPaw = this
+                    inputType = EditorInfo.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
+                    gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
+                    hintColorStr = "#cccccc"
+                    background = null
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(0, matchParent, 1f) {
+                    marginEnd = marpadding
+                }
+            }.lparams(matchParent, autoSize(120))
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                background = resources.getDrawable(R.color.p_global_write_color)
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_red_color
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                textView {
+                    text = "新密码:"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                editText {
+                    hint = "请输入8-20个字符的新密码"
+                    newPsw = this
+                    inputType = EditorInfo.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
+                    gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
+                    hintColorStr = "#cccccc"
+                    background = null
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(0, matchParent, 1f) {
+                    marginEnd = marpadding
+                }
+            }.lparams(matchParent, autoSize(120))
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                background = resources.getDrawable(R.color.p_global_write_color)
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_red_color
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                textView {
+                    text = "确认新密码:"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = marpadding
+                }
+
+                editText {
+                    hint = "请再次确认新密码"
+                    againNewPsw = this
+                    inputType = EditorInfo.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
+                    gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
+                    hintColorStr = "#cccccc"
+                    background = null
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(0, matchParent, 1f) {
+                    marginEnd = marpadding
+                }
+            }.lparams(matchParent, autoSize(120))
+            itemView()
+
+            textView {
+                onThrottleFirstClick {
+
+
+
+                    if (oldPaw.text.toString().isNullOrEmpty()){
+                        ToastUtils.showLong("请输入原密码")
+                        return@onThrottleFirstClick
+                    }
+
+                    if (newPsw.text.toString().isNullOrEmpty()){
+                        ToastUtils.showLong("请输入新密码")
+                        return@onThrottleFirstClick
+                    }
+
+//                    if (CheckPassword.checkPasswordRule(newPsw.text.toString()).not()){
+//                        ToastUtils.showLong("密码格式错误")
+//                        return@onThrottleFirstClick
+//                    }
+
+                    if (againNewPsw.text.toString().isNullOrEmpty()){
+                        ToastUtils.showLong("请再次确认输入新密码")
+                        return@onThrottleFirstClick
+                    }
+
+                    if (oldPaw.text.toString() == newPsw.text.toString()){
+                        ToastUtils.showLong("新密码不能与原密码相同")
+                        return@onThrottleFirstClick
+                    }
+
+                    if (newPsw.text.toString() != againNewPsw.text.toString()){
+                        ToastUtils.showLong("两次新密码输入不一致")
+                        return@onThrottleFirstClick
+                    }
+
+
+                    viewModel.modifyPwd(oldpwd = oldPaw.text.toString(),newPwd = newPsw.text.toString()){
+                        if (it){
+                            ToastUtils.showLong("密码修改成功,请重新登录!")
+                            AppUtils.relaunchApp()
+                        }
+                    }
+
+                }
+                gravity = Gravity.CENTER
+                backgroundResource = R.drawable.rma_market_item_botton_bg_2
+                textSizeAuto = 34
+                textColorInt = R.color.white
+                text = "提交"
+            }.lparams(matchParent, autoSize(100)){
+                topMargin = autoSize(80)
+                marginStart = marpadding
+                marginEnd = marpadding
+            }
+        }
+    }
+
+}

+ 58 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/ChangePasswordViewModel.kt

@@ -0,0 +1,58 @@
+package cn.muchinfo.rma.view.base.home.set
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.netcore.crypto.SHA256Encrypt
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.base.BaseViewModel
+import com.blankj.utilcode.util.LogUtils
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
+
+class ChangePasswordViewModel : BaseViewModel() {
+
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
+     * 改完密码后,服务会断开链接,导致我们一直尝试重连进而页面显示错乱,在这里加个锁,在成功后就不再接收断网重连的提示
+     */
+    var isCallBack : Boolean = false
+
+    /**
+     * 修改密码
+     * @param oldpwd String
+     * @param newPwd String
+     * @param isSuccess Function1<[@kotlin.ParameterName] Boolean, Unit>
+     */
+    fun modifyPwd(
+        oldpwd: String, newPwd: String,
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        val sha256Encrypt = SHA256Encrypt()
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.accountManager?.modifyPwd(oldpwd = sha256Encrypt.getEncryptString(sha256Encrypt.encrypt(
+                GlobalDataCollection.instance?.loginRsp?.loginID.toString() + oldpwd)).toLowerCase(),newPwd = sha256Encrypt.getEncryptString(sha256Encrypt.encrypt(
+                GlobalDataCollection.instance?.loginRsp?.loginID.toString() + newPwd)).toLowerCase()){isCompleted, err ->
+                if (isCallBack.not()){
+                    if (isCompleted){
+                        isCallBack = true
+                        loadingDialogStatus.postValue(TaskUiModel.success("密码修改成功"))
+                        isSuccess.invoke(true)
+                    }else{
+                        loadingDialogStatus.postValue(TaskUiModel.failed(InteractiveException(errorMessage = err?.message ?: "修改密码失败")))
+                        isSuccess.invoke(false)
+                    }
+                }
+
+            }
+        }
+
+    }
+
+}

+ 22 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/PasswordViewModel.kt

@@ -8,6 +8,7 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.LoginInfoData
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.netcore.crypto.SHA256Encrypt
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.tool.DesTools
 import cn.muchinfo.rma.view.base.BaseViewModel
 import cn.muchinfo.rma.view.base.app.Constant
@@ -56,7 +57,7 @@ class PasswordViewModel : BaseViewModel(){
 //        json["cardnum"] = idcardNum
         //请求验证码
         OkHttpUtils.postString()
-                .url(SPUtils.getInstance().getString(Constant.MANAGE_URL_KEY) + "/tradeoperation/querylogininfo")
+                .url(SPUtils.getInstance().getString(Constant.commSearchUrl) + "/tradeoperation/querylogininfo")
                 .content(json.toJSONString())
                 .mediaType(MediaType.parse("application/json; charset=utf-8"))
                 //                .addParams("mobile",DesTools.myServiceAddPass(area_code.getText().toString().trim() + phone_text.getText().toString().trim()))
@@ -89,17 +90,34 @@ class PasswordViewModel : BaseViewModel(){
     val resetPasswordSuccess : MutableLiveData<Boolean> = MutableLiveData<Boolean>().apply { value = false }
 
 
-    fun resetPassword(idcardNum: String,phone : String,areaCode : String,vcode : String,newPassword : String,activity: Context){
+    /**
+     * 通过输入的账号查询loginid
+     * @param account String
+     */
+    fun loginidQuery(account : String){
+        MyApplication.getInstance()?.accountManager?.queryLoginID(code = account){isCompleted, err, loginID ->
+            if (isCompleted){
+                loadingDialogStatus.value = TaskUiModel.success()
+                backgroundVerfifySuccess.value = true
+                loginInfoAccount.value = loginID
+            }
+        }
+    }
+
+
+    fun resetPassword(phone : String,vcode : String,newPassword : String,logincode : String){
         val sha256Encrypt = SHA256Encrypt()
         val json = JSONObject()
         json["mobile"] = DesTools.myServiceAddPass(phone)
         json["vcode"] = vcode
-        json["cardnum"] = idcardNum
+        json["logincode"] = logincode
+//        json["cardnum"] = idcardNum
         json["password"] = sha256Encrypt.getEncryptString(sha256Encrypt.encrypt(
                 loginInfoAccount.value + newPassword)).toLowerCase()
 
         OkHttpUtils.postString()
-                .url(SPUtils.getInstance().getString(Constant.MANAGE_URL_KEY) + "/tradeoperation/resetpwdbycardnum")
+                .url(SPUtils.getInstance().getString(Constant.commSearchUrl) + "/tradeoperation/resetpwdbylogincode")
+//                .url("http://192.168.30.52:8280/mtp2_search" + "/tradeoperation/resetpwdbycardnum")
                 .content(json.toJSONString())
                 .mediaType(MediaType.parse("application/json; charset=utf-8"))
                 //                .addParams("mobile",DesTools.myServiceAddPass(area_code.getText().toString().trim() + phone_text.getText().toString().trim()))

+ 134 - 64
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/ResetPasswordActivity.kt

@@ -12,6 +12,7 @@ import android.view.inputmethod.EditorInfo
 import android.widget.EditText
 import android.widget.TextView
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.IdentifyData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.netManage.base.InteractiveException
@@ -24,6 +25,8 @@ import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import com.alibaba.fastjson.JSON
 import com.alibaba.fastjson.JSONObject
+import com.blankj.utilcode.util.AppUtils
+import com.blankj.utilcode.util.LogUtils
 import com.blankj.utilcode.util.SPUtils
 import com.blankj.utilcode.util.ToastUtils
 import com.luozm.captcha.Captcha
@@ -45,6 +48,7 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
 
     lateinit var captcha: Captcha
     lateinit var profitEdittext: EditText
+    lateinit var login_account: EditText
     lateinit var verfify: EditText
     lateinit var idCard: EditText
     lateinit var areaCodeText: TextView
@@ -60,16 +64,15 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
-            viewModel.getphoneList()
 
             loadingDialog = createLoadingDialog()
             loadingDialog?.bindTaskStatus(context, viewModel.loadingDialogStatus)
             val marpadding = autoSize(32)
-            background = resources.getDrawable(R.color.rma_hint_title_text_color)
+            background = resources.getDrawable(R.color.white)
             topBar {
                 commonLeftButton()
                 commonTitle {
-                    text = "修改密码"
+                    text = "重置密码"
                 }
             }
 
@@ -81,18 +84,20 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                         visibility = View.VISIBLE
                     }
                 }
+
                 linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
                     background = resources.getDrawable(R.color.p_global_write_color)
-                    imageView {
-                        imageResource = R.drawable.__picker_photo_bg
-                    }.lparams(autoSize(60), autoSize(60)) {
+                    textView {
+                        text = "*"
+                        textColorInt = R.color.rma_red_color
+                        textSizeAuto = 34
+                    }.lparams(wrapContent, wrapContent) {
                         marginStart = marpadding
-                        gravity = Gravity.CENTER_VERTICAL
                     }
 
                     textView {
-                        areaCodeText = this
-                        text = "手机号码"
+                        text = "登陆账号"
                         textColorInt = R.color.rma_black_33
                         textSizeAuto = 34
                     }.lparams(wrapContent, wrapContent) {
@@ -100,9 +105,9 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                     }
 
                     editText {
-                        hint = "请输入手机号码"
-                        profitEdittext = this
-                        inputType = EditorInfo.TYPE_CLASS_NUMBER
+                        hint = "请输入登陆账号"
+                        login_account = this
+                        inputType = EditorInfo.TYPE_CLASS_TEXT
                         gravity = Gravity.CENTER_VERTICAL
                         hintColorStr = "#cccccc"
                         background = null
@@ -112,24 +117,32 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                         marginStart = marpadding
                     }
 
-                }.lparams(matchParent, autoSize(120)) {
-                    gravity = Gravity.CENTER_VERTICAL
-                }
-
+                }.lparams(matchParent, autoSize(120))
                 itemView()
 
                 linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
                     background = resources.getDrawable(R.color.p_global_write_color)
-                    imageView {
-                        imageResource = R.drawable.ic_hn_message
-                    }.lparams(autoSize(60), autoSize(60)) {
+                    textView {
+                        text = "*"
+                        textColorInt = R.color.rma_red_color
+                        textSizeAuto = 34
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = marpadding
+                    }
+
+                    textView {
+                        areaCodeText = this
+                        text = "手机号码"
+                        textColorInt = R.color.rma_black_33
+                        textSizeAuto = 34
+                    }.lparams(wrapContent, wrapContent) {
                         marginStart = marpadding
-                        gravity = Gravity.CENTER_VERTICAL
                     }
 
                     editText {
-                        verfify = this
-                        hint = "请输入短信验证码"
+                        hint = "请输入手机号码"
+                        profitEdittext = this
                         inputType = EditorInfo.TYPE_CLASS_NUMBER
                         gravity = Gravity.CENTER_VERTICAL
                         hintColorStr = "#cccccc"
@@ -152,6 +165,45 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                     }.lparams(wrapContent, wrapContent) {
                         marginEnd = marpadding
                     }
+
+                }.lparams(matchParent, autoSize(120))
+
+                itemView()
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    background = resources.getDrawable(R.color.p_global_write_color)
+                    textView {
+                        text = "*"
+                        textColorInt = R.color.rma_red_color
+                        textSizeAuto = 34
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = marpadding
+                    }
+
+                    textView {
+                        text = "短信验证码"
+                        textColorInt = R.color.rma_black_33
+                        textSizeAuto = 34
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = marpadding
+                    }
+
+
+                    editText {
+                        verfify = this
+                        hint = "请输入短信验证码"
+                        inputType = EditorInfo.TYPE_CLASS_NUMBER
+                        gravity = Gravity.CENTER_VERTICAL
+                        hintColorStr = "#cccccc"
+                        background = null
+                        textColorInt = R.color.rma_black_33
+                        textSizeAuto = 34
+                    }.lparams(0, matchParent, 1f) {
+                        marginStart = marpadding
+                    }
+
+
                 }.lparams(matchParent, autoSize(120)) {
                     gravity = Gravity.CENTER_VERTICAL
                 }
@@ -244,19 +296,23 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
 
             viewModel.successVerfify.bindOptional(context) {
                 if (it == true) {
-                    if (areaCodeText.getText().toString().trim { it <= ' ' } == "+86") {
-                        if (!NumberUtils.isTelePhoneNoLong(profitEdittext.getText().toString())) {  //是否是手机号
-                            ToastUtils.showLong("请输入正确的手机号码")
-                            return@bindOptional
-                        }
+                    if (!NumberUtils.isTelePhoneNoLong(
+                            profitEdittext.getText().toString()
+                        )
+                    ) {  //是否是手机号
+                        ToastUtils.showLong("请输入正确的手机号码")
+                        return@bindOptional
                     }
-                    sendVerfifyCode(phone = profitEdittext.text.toString(), areaCode = areaCodeText.text.toString())
+                    sendVerfifyCode(
+                        phone = profitEdittext.text.toString(),
+                        areaCode = areaCodeText.text.toString()
+                    )
                 }
             }
 
             viewModel.getVcode.bindOptional(context) {
                 if (it == true) {
-                    val utils = IdentifyTextUtils(mail_btn,context)  //初始化计时器
+                    val utils = IdentifyTextUtils(mail_btn, context)  //初始化计时器
                     utils.startTimer()
                 }
             }
@@ -267,6 +323,11 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                 onThrottleFirstClick {
                     if (viewModel.backgroundVerfifySuccess.value == false) {
 
+                        if (login_account.text.toString().isNullOrEmpty()){
+                            ToastUtils.showLong("请输入登陆账号")
+                            return@onThrottleFirstClick
+                        }
+
                         if (profitEdittext.text.toString().isEmpty()) {
                             ToastUtils.showLong("请输入手机号")
                             return@onThrottleFirstClick
@@ -277,6 +338,7 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                             return@onThrottleFirstClick
                         }
 
+
 //                        if (verfify.text.toString() != viewModule.backgroundVcode.value){
 //                            ToastUtils.showLong(R.string.please_input_right_vcode)
 //                            return@onThrottleFirstClick
@@ -287,7 +349,9 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
 //                            return@onThrottleFirstClick
 //                        }
 
-                        viewModel.verfifyIdCardNum(activity = context, phone = profitEdittext.text.toString(), areaCode = areaCodeText.text.toString(), vcode = verfify.text.toString())
+                        viewModel.loginidQuery(
+                            account = login_account.text.toString()
+                        )
                     } else {
                         // TODO 重置密码
 
@@ -301,7 +365,7 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                             return@onThrottleFirstClick
                         }
 
-                        if (newPassword.text.toString().length < 6 || newPassword.text.toString().length > 20){
+                        if (newPassword.text.toString().length < 6 || newPassword.text.toString().length > 20) {
                             ToastUtils.showLong("请输入6-20位的新密码")
                             return@onThrottleFirstClick
                         }
@@ -311,8 +375,12 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                             return@onThrottleFirstClick
                         }
 
-                        viewModel.resetPassword(idcardNum = idCard.text.toString(), phone = profitEdittext.text.toString(), areaCode = areaCodeText.text.toString(), vcode = verfify.text.toString(),
-                                newPassword = newPassword.text.toString(), activity = context)
+                        viewModel.resetPassword(
+                            phone = profitEdittext.text.toString(),
+                            vcode = verfify.text.toString(),
+                            newPassword = newPassword.text.toString(),
+                            logincode = login_account.text.toString()
+                        )
                     }
                 }
                 viewModel.backgroundVerfifySuccess.bindOptional(context) {
@@ -332,6 +400,7 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                             addAction(resources.getString(R.string.__picker_yes)) { dialog1, _ ->
                                 dialog1.dismiss()
                                 finish()
+                                AppUtils.relaunchApp()
                             }
                         }.show()
                     }
@@ -347,7 +416,7 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
 
                 textSizeAuto = 34
                 textColorInt = R.color.white
-            }.lparams(matchParent, autoSize(100)){
+            }.lparams(matchParent, autoSize(100)) {
                 marginStart = autoSize(32)
                 marginEnd = autoSize(32)
                 bottomMargin = autoSize(60)
@@ -361,36 +430,37 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
         json["mobile"] = DesTools.myServiceAddPass(phone)
         //请求验证码
         OkHttpUtils.postString()
-                .url(SPUtils.getInstance().getString(Constant.MANAGE_URL_KEY) + "/user/smsvcode")
-                .content(json.toJSONString())
-                .mediaType(MediaType.parse("application/json; charset=utf-8"))
-                //                .addParams("mobile",DesTools.myServiceAddPass(area_code.getText().toString().trim() + phone_text.getText().toString().trim()))
-                .build()
-                .execute(object : StringCallback() {
-                    override fun onError(call: Call, e: Exception, id: Int) {
-                        viewModel.loadingDialogStatus.value = TaskUiModel.failed(Throwable(message = "手机验证码请求失败"))
+            .url(SPUtils.getInstance().getString(Constant.commSearchUrl) + "/user/smsvcode")
+            .content(json.toJSONString())
+            .mediaType(MediaType.parse("application/json; charset=utf-8"))
+            //                .addParams("mobile",DesTools.myServiceAddPass(area_code.getText().toString().trim() + phone_text.getText().toString().trim()))
+            .build()
+            .execute(object : StringCallback() {
+                override fun onError(call: Call, e: Exception, id: Int) {
+                    viewModel.loadingDialogStatus.value =
+                        TaskUiModel.failed(Throwable(message = "手机验证码请求失败"))
 //                        Toast.makeText(this@ResetPasswordActivity, resources.getString(R.string.identify_request_error), Toast.LENGTH_LONG).show()
-                    }
+                }
 
-                    override fun onResponse(response: String, id: Int) {
-
-                        //这里也要加个判断
-                        val identifyData = JSON.parseObject(response, IdentifyData::class.java)
-                        if (identifyData != null) {
-                            if (identifyData.success == "true") {
-                                viewModel.loadingDialogStatus.value = TaskUiModel.success()
-                                viewModel.backgroundVcode.value = identifyData.vcode
-                                viewModel.getVcode.value = true
-                                ToastUtils.showLong("验证码发送成功")
-                            } else {
-                                viewModel.loadingDialogStatus.value = TaskUiModel.failed(
-                                    InteractiveException("手机验证码请求失败")
-                                )
-                            }
+                override fun onResponse(response: String, id: Int) {
+                    LogUtils.eTag("手机验证码",response)
+                    //这里也要加个判断
+                    val identifyData = JSON.parseObject(response, IdentifyData::class.java)
+                    if (identifyData != null) {
+                        if (identifyData.success == "true") {
+                            viewModel.loadingDialogStatus.value = TaskUiModel.success()
+                            viewModel.backgroundVcode.value = identifyData.vcode
+                            viewModel.getVcode.value = true
+                            ToastUtils.showLong("验证码发送成功")
+                        } else {
+                            viewModel.loadingDialogStatus.value = TaskUiModel.failed(
+                                InteractiveException("手机验证码请求失败")
+                            )
                         }
-
                     }
-                })
+
+                }
+            })
     }
 
 
@@ -430,7 +500,7 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                         override fun onAccess(time: Long): String {
                             createWarningDialog {
                                 setTitle(resources.getString(R.string.hint))
-                                setMessage("验证用时" + NumberUtils.roundNum(time / 1000.0,1) + "s")
+                                setMessage("验证用时" + NumberUtils.roundNum(time / 1000.0, 1) + "s")
                                 addAction(resources.getString(R.string.__picker_yes)) { dialog1, _ ->
                                     viewModel.successVerfify.value = true
                                     dialog.dismiss()
@@ -445,10 +515,10 @@ class ResetPasswordActivity : BaseActivity<PasswordViewModel>() {
                         }
 
                     })
-                    viewModel.verfifyImage.bindOptional(context){
-                        if (it ?: 0 < 50){
+                    viewModel.verfifyImage.bindOptional(context) {
+                        if (it ?: 0 < 50) {
                             setBitmap(R.mipmap.verfify_image_one)
-                        }else{
+                        } else {
                             setBitmap(R.mipmap.verfify_image_two)
                         }
                     }

+ 40 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/SettingActivity.kt

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.home.set
 
+import android.app.Dialog
 import android.content.Intent
 import android.os.Bundle
 import android.view.Gravity
@@ -9,15 +10,21 @@ import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.AppUtils
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 class SettingActivity : BaseActivity<SettingViewModel>(){
-
+    var loadingDialog: Dialog? = null
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
-            background = resources.getDrawable(R.color.segtabment_bg_color)
+            loadingDialog = createLoadingDialog(hintStr = "登出中..")
+            loadingDialog?.bindTaskStatus(context, viewModel.loadingDialogStatus)
+            background = resources.getDrawable(R.color.main_tab_color)
             //头部标题
             topBar {
                 commonLeftButton()
@@ -27,13 +34,14 @@ class SettingActivity : BaseActivity<SettingViewModel>(){
             }
 
             linearLayout {
+                background = resources.getDrawable(R.color.segtabment_bg_color)
                 onThrottleFirstClick {
                     val intent = Intent()
-                    intent.setClass(context,ResetPasswordActivity::class.java)
+                    intent.setClass(context,ChangePasswordActivity::class.java)
                     ActivityUtils.startActivity(intent)
                 }
                 gravity = Gravity.CENTER_VERTICAL
-                imageButton {
+                imageView {
                     imageResource = R.mipmap.rma_rechange_password
                 }.lparams(autoSize(40), autoSize(40)){
                     marginStart = autoSize(30)
@@ -59,10 +67,16 @@ class SettingActivity : BaseActivity<SettingViewModel>(){
             itemView()
 
             linearLayout {
+                background = resources.getDrawable(R.color.segtabment_bg_color)
                 gravity = Gravity.CENTER_VERTICAL
-                imageButton {
+                onThrottleFirstClick {
+                    val intent = Intent()
+                    intent.setClass(context,ResetPasswordActivity::class.java)
+                    ActivityUtils.startActivity(intent)
+                }
+                imageView {
                     imageResource = R.mipmap.rma_reset_password
-                }.lparams(autoSize(54), autoSize(54)){
+                }.lparams(autoSize(40), autoSize(40)){
                     marginStart = autoSize(30)
                 }
                 textView {
@@ -82,6 +96,26 @@ class SettingActivity : BaseActivity<SettingViewModel>(){
                 }
 
             }.lparams(matchParent, autoSize(110))
+
+
+            textView {
+                onThrottleFirstClick {
+                    viewModel.loginOut {
+                        if (it){
+                            AppUtils.relaunchApp()
+                        }
+                    }
+                }
+                gravity = Gravity.CENTER
+                backgroundResource = R.drawable.rma_market_item_botton_bg_2
+                textSizeAuto = 34
+                textColorInt = R.color.white
+                text = "退出登陆"
+            }.lparams(matchParent, autoSize(100)){
+                topMargin = autoSize(200)
+                marginStart = autoSize(36)
+                marginEnd =  autoSize(36)
+            }
         }
     }
 

+ 37 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/SettingViewModel.kt

@@ -1,9 +1,45 @@
 package cn.muchinfo.rma.view.base.home.set
 
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
-class SettingViewModel : BaseViewModel(){
+class SettingViewModel : BaseViewModel() {
 
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
 
+    /**
+     * 登出
+     * @param isSuccess Function1<[@kotlin.ParameterName] Boolean, Unit>
+     */
+    fun loginOut(isSuccess: (isCompleted: Boolean) -> Unit) {
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.accountManager?.loginOut() { isCompleted, err ->
+
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success("登出成功"))
+                    isSuccess.invoke(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message ?: "登出失败"
+                            )
+                        )
+                    )
+                    isSuccess.invoke(false)
+                }
+
+            }
+        }
+    }
 
 }

+ 117 - 9
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tradingquery/TradingQueryActivity.kt

@@ -23,17 +23,25 @@ import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.viewItemUI
 import cn.muchinfo.rma.view.base.home.financial.InvoiceRegisterActivity
+import cn.muchinfo.rma.view.base.home.set.SettingActivity
+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.TimeUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.creatSelectAccountDialog
 import mtp.polymer.com.autowidget.dialog.createLoadingDialog
 import mtp.polymer.com.autowidget.dialog.showDataSelectDialog
 import mtp.polymer.com.autowidget.utils.TaskUiModel
 import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.viewPager
 import java.text.SimpleDateFormat
@@ -105,24 +113,93 @@ class TradingQueryActivity : BaseActivity<TradingQueryViewModel>() {
         }
     }
 
+    //通用的消息更新通知
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMessageEvent(messageEvent: MessageEvent) {
+        if (messageEvent.messageType == EventConstent.USERACCOUNTCHANGE) {//接到通知更新当前的资金账号
+            viewModel.initAccountData()
+            historyCommissionedUI.onRefrash()
+            historyDealUI.onRefrash()
+            moneyFlowingUI.onRefrash()
+        }
+    }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        EventBus.getDefault().unregister(this)
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
+        EventBus.getDefault().register(this)
         verticalLayout {
 //            createLoadingDialog(hintStr = "数据请求中").bindTaskStatus(
 //                context,
 //                viewModel.loadingDialogStatus
 //            )
-            topBar {
-                commonLeftButton()
-                commonTitle {
-                    text = "交易查询"
+            viewModel.initAccountData()//进页面初始化资金账户
+            linearLayout {
+                background = resources.getDrawable(R.color.main_title_bg_color)
+
+                imageView {
+                    onThrottleFirstClick {
+                        finish()
+                    }
+                    imageResource = R.mipmap.back
+                }.lparams(autoSize(45), autoSize(45)) {
+                    marginStart = autoSize(32)
+                    topMargin = autoSize(20)
                 }
-                commonMenuButton(R.mipmap.rma_search) {
-                    val intent = Intent()
-                    intent.setClass(context, InvoiceRegisterActivity::class.java)
-                    ActivityUtils.startActivity(intent)
+                emptyView()
+                verticalLayout {
+                    gravity = Gravity.CENTER_HORIZONTAL
+                    /** 资金账户选择  s首页不能进行资金选择**/
+                    onThrottleFirstClick {
+                        creatSelectAccountDialog {
+                            EventBus.getDefault()
+                                .post(MessageEvent(EventConstent.USERACCOUNTCHANGE))
+                            viewModel.usedAccountData.postValue(this)
+                        }.show()
+                    }
+                    textView {
+                        text = "交易查询"
+                        textColorInt = R.color.white
+                        textSizeAuto = 36
+                    }.lparams(wrapContent, wrapContent) {
+                        gravity = Gravity.CENTER_HORIZONTAL
+                    }
+                    textView {
+                        viewModel.usedAccountData.bindOptional(context!!) {
+                            text = viewModel.getAccountInfo(it)
+                        }
+                        textColorStr = "#AED6F0"
+                        textSizeAuto = 29
+                    }.lparams(wrapContent, wrapContent) {
+                        gravity = Gravity.CENTER_HORIZONTAL
+                    }
+                }.lparams(wrapContent, autoSize(90))
+
+                imageView {
+                    imageResource = R.mipmap.rma_down
+                }.lparams(autoSize(40), autoSize(40)) {
+
+                    topMargin = autoSize(20)
                 }
-            }
+
+                emptyView()
+
+            }.lparams(matchParent, autoSize(120))
+//            topBar {
+//                commonLeftButton()
+//                commonTitle {
+//                    text = "交易查询"
+//                }
+//                commonMenuButton(R.mipmap.rma_search) {
+//                    val intent = Intent()
+//                    intent.setClass(context, InvoiceRegisterActivity::class.java)
+//                    ActivityUtils.startActivity(intent)
+//                }
+//            }
 
             tabSegment {
                 segment = this
@@ -192,6 +269,16 @@ class HistoryCommissionedUI(
     private val historyCommissionedAdapter: BaseAdapter<FutureEntrustData, EntrustHistoryViewHolder> =
         BaseAdapter { _, _ -> EntrustHistoryViewHolder(activity, viewModel) }
 
+    /**
+     * 用于上层控制刷新
+     */
+    fun onRefrash(){
+        viewModel.queryErmcpHisEntrustDetails(
+            startDate = startTime.value ?: "",
+            endDate = endTime.value ?: ""
+        )
+    }
+
     @RequiresApi(Build.VERSION_CODES.N)
     val root = _FrameLayout(activity).apply {
         verticalLayout {
@@ -427,6 +514,16 @@ class HistoryDealUI(
         initTime()
     }
 
+    /**
+     * 用于上层控制刷新
+     */
+    fun onRefrash(){
+        viewModel.queryErmcpHisTradeDetails(
+            startDate = startTime.value ?: "",
+            endDate = endTime.value ?: ""
+        )
+    }
+
     @RequiresApi(Build.VERSION_CODES.N)
     val root = _FrameLayout(activity).apply {
         verticalLayout {
@@ -647,6 +744,17 @@ class MoneyFlowingUI(
         initTime()
     }
 
+
+    /**
+     * 用于上层控制刷新
+     */
+    fun onRefrash(){
+        viewModel.queryHisAmountLog(
+            startDate = startTime.value ?: "",
+            endDate = endTime.value ?: ""
+        )
+    }
+
     private val moneyFlowingdAdapter: BaseAdapter<AmountLogData, MoneyFlowingViewHolder> =
         BaseAdapter { _, _ -> MoneyFlowingViewHolder(activity, viewModel) }
 

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

@@ -2,6 +2,7 @@ package cn.muchinfo.rma.view.base.home.tradingquery
 
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.AccountData
 import cn.muchinfo.rma.global.data.AmountLogData
 import cn.muchinfo.rma.global.data.FinancialManageData
 import cn.muchinfo.rma.global.data.futureOrders.DealOrderData
@@ -146,5 +147,24 @@ class TradingQueryViewModel : BaseViewModel() {
         return sdf1.format(sdf.parse(time)!!)
     }
 
+    /**
+     * 使用的当前的资金账户信息
+     */
+    val usedAccountData : MutableLiveData<AccountData> = MutableLiveData()
+
+    /**
+     * 更新交易下单的account
+     */
+    fun initAccountData(){
+        val accountDataList = GlobalDataCollection.instance?.accountDataList
+        if (accountDataList.isNullOrEmpty().not()){
+            usedAccountData.postValue(GlobalDataCollection.instance?.accountData)
+        }
+    }
+
+    fun getAccountInfo(accountInfo: AccountData?): String {
+        return accountInfo?.accountname + "(" + accountInfo?.accountid + ")"
+    }
+
 
 }

+ 101 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/AgreeMentActivity.kt

@@ -0,0 +1,101 @@
+package cn.muchinfo.rma.view.base.login
+
+import android.os.Bundle
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import org.jetbrains.anko.*
+
+class AgreeMentActivity : BaseActivity<LoginViewModel>(){
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.white)
+            //头部标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "用户协议"
+                }
+            }
+
+            scrollView {
+                verticalLayout {
+                    textView {
+                        textColorInt = R.color.rma_black_33
+                        textSizeAuto = 31
+                        text =
+                            "在此特别提醒您(用户)在注册成为用户之前,请认真阅读本《用户协议》(以下简称“协议”),确保您充分理解本协议中各条款。请您审慎阅读并选择接受或不接受本协议。您的注册、登录、使用等行为将视为对本协议的接受,并同意接受本协议各项条款的约束。本协议约定深圳市多元世纪信息技术股份有限公司(以下简称“多元”)与用户之间关于“风管云”软件服务(以下简称“服务“)的权利义务。“用户”是指注册、登录、使用本服务的个人。本协议可由多元随时更新,更新后的协议条款一旦公布即代替原来的协议条款,恕不再另行通知,用户可在本APP中查阅最新版协议条款。在修改协议条款后,如果用户不接受修改后的条款,请立即停止使用喵小瞳提供的服务,用户继续使用服务将被视为接受修改后的协议。\n" +
+                                    " \n" +
+                                    "一、账号注册\n" +
+                                    "1、用户在使用本服务前需要注册一个“多元”账号。“多元”账号应当使用手机号码绑定注册,请用户使用尚未与“多元”账号绑定的手机号码,以及未被服务根据本协议封禁的手机号码注册“多元”账号。服务可以根据用户需求或产品需要对账号注册和绑定的方式进行变更,而无须事先通知用户。\n" +
+                                    "2、“多元”系基于“风管云“的APP产品,用户注册时应当授权多元及使用其个人信息方可成功注册“多元”账号。故用户完成注册即表明用户同意服务提取、公开及使用用户的信息。\n" +
+                                    "3、鉴于“多元”账号的绑定注册方式,您同意服务在注册时将允许您的手机号码及手机设备识别码等信息用于注册。\n" +
+                                    "4、在用户注册及使用本服务时,多元需要搜集能识别用户身份的个人信息以便服务可以在必要时联系用户,或为用户提供更好的使用体验。多元搜集的信息包括但不限于用户的姓名、地址;多元同意对这些信息的使用将受限于第三条用户个人隐私信息保护的约束。\n" +
+                                    " \n" +
+                                    "二、用户个人隐私信息保护\n" +
+                                    "1、如果多元发现或收到他人举报或投诉用户违反本协议约定的,多元有权不经通知随时对相关内容,包括但不限于用户资料、发贴记录进行审查、删除,并视情节轻重对违规账号处以包括但不限于警告、账号封禁 、设备封禁 、功能封禁 的处罚,且通知用户处理结果。\n" +
+                                    "2、因违反用户协议被封禁的用户,可以自行与多元联系。其中,被实施功能封禁的用户会在封禁期届满后自动恢复被封禁功能。被封禁用户可提交申诉,多元将对申诉进行审查,并自行合理判断决定是否变更处罚措施。\n" +
+                                    "3、用户理解并同意,多元有权依合理判断对违反有关法律法规或本协议规定的行为进行处罚,对违法违规的任何用户采取适当的法律行动,并依据法律法规保存有关信息向有关部门报告等,用户应承担由此而产生的一切法律责任。\n" +
+                                    "4、用户理解并同意,因用户违反本协议约定,导致或产生的任何第三方主张的任何索赔、要求或损失,包括合理的律师费,用户应当赔偿多元与合作公司、关联公司,并使之免受损害。\n" +
+                                    " \n" +
+                                    "三、用户发布内容规范\n" +
+                                    "1、本条所述内容是指用户使用服务的过程中所制作、上载、复制、发布、传播的任何内容,包括但不限于账号头像、名称、用户说明等注册信息及认证资料,或文字、语音、图片、视频、图文等发送、回复或自动回复消息和相关链接页面,以及其他使用账号或本服务所产生的内容。\n" +
+                                    "2、用户不得利用“多元”账号或本服务制作、上载、复制、发布、传播如下法律、法规和政策禁止的内容:\n" +
+                                    "(1) 反对宪法所确定的基本原则的;\n" +
+                                    "(2) 危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;\n" +
+                                    "(3) 损害国家荣誉和利益的;\n" +
+                                    "(4) 煽动民族仇恨、民族歧视,破坏民族团结的;\n" +
+                                    "(5) 破坏国家宗教政策,宣扬邪教和封建迷信的;\n" +
+                                    "(6) 散布谣言,扰乱社会秩序,破坏社会稳定的;\n" +
+                                    "(7) 散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;\n" +
+                                    "(8) 侮辱或者诽谤他人,侵害他人合法权益的;\n" +
+                                    "(9) 含有法律、行政法规禁止的其他内容的信息。\n" +
+                                    "3、用户不得利用“多元”账号或本服务制作、上载、复制、发布、传播如下干扰“服务”正常运营,以及侵犯其他用户或第三方合法权益的内容:\n" +
+                                    "(1) 含有任何性或性暗示的;\n" +
+                                    "(2) 含有辱骂、恐吓、威胁内容的;\n" +
+                                    "(3) 含有骚扰、垃圾广告、恶意信息、诱骗信息的;\n" +
+                                    "(4) 涉及他人隐私、个人信息或资料的;\n" +
+                                    "(5) 侵害他人名誉权、肖像权、知识产权、商业秘密等合法权利的;\n" +
+                                    "(6) 含有其他干扰本服务正常运营和侵犯其他用户或第三方合法权益内容的信息。\n" +
+                                    " \n" +
+                                    "四、使用规则\n" +
+                                    "1、用户在本服务中或通过本服务所传送、发布的任何内容并不反映或代表,也不得被视为反映或代表多元的观点、立场或政策,多元对此不承担任何责任。\n" +
+                                    "2、用户不得利用“多元”账号或本服务进行如下行为:\n" +
+                                    "(1) 提交、发布虚假信息,或盗用他人头像或资料,冒充、利用他人名义的;\n" +
+                                    "(2) 强制、诱导其他用户关注、点击链接页面或分享信息的;\n" +
+                                    "(3) 虚构事实、隐瞒真相以误导、欺骗他人的;\n" +
+                                    "(4) 利用技术手段批量建立虚假账号的;\n" +
+                                    "(5) 利用“多元”账号或本服务从事任何违法犯罪活动的;\n" +
+                                    "(6) 制作、发布与以上行为相关的方法、工具,或对此类方法、工具进行运营或传播,无论这些行为是否为商业目的;\n" +
+                                    "(7) 其他违反法律法规规定、侵犯其他用户合法权益、干扰“多元”正常运营或服务未明示授权的行为。\n" +
+                                    "3、用户须对利用“多元”账号或本服务传送信息的真实性、合法性、无害性、准确性、有效性等全权负责,与用户所传播的信息相关的任何法律责任由用户自行承担,与多元无关。\n" +
+                                    "如因此给多元或第三方造成损害的,用户应当依法予以赔偿。\n" +
+                                    "4、多元提供的服务中可能包括广告,用户同意在使用过程中显示多元和第三方供应商、合作伙伴提供的广告。除法律法规明确规定外,用户应自行对依该广告信息进行的交易负责,\n" +
+                                    "对用户因依该广告信息进行的交易或前述广告商提供的内容而遭受的损失或损害,多元不承担任何责任。\n" +
+                                    " \n" +
+                                    "五、其他\n" +
+                                    "1、多元郑重提醒用户注意本协议中免除多元责任和限制用户权利的条款,请用户仔细阅读,自主考虑风险。未成年人应在法定监护人的陪同下阅读本协议。\n" +
+                                    "2、本协议的效力、解释及纠纷的解决,适用于中华人民共和国法律。若用户和多元之间发生任何纠纷或争议,首先应友好协商解决,协商不成的,用户同意将纠纷或争议提交多元住所地有管辖权的人民法院管辖。\n" +
+                                    "3、本协议的任何条款无论因何种原因无效或不具可执行性,其余条款仍有效,对双方具有约束力。\n" +
+                                    "\n" +
+                                    "\n" +
+                                    "\n" +
+                                    "本《协议》版权由多元所有,多元保留一切对本《协议》解释的权利。"
+                    }.lparams(wrapContent, wrapContent) {
+                        topMargin = autoSize(25)
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(32)
+                        bottomMargin = autoSize(100)
+                    }
+
+                    view {
+
+                    }.lparams(matchParent, autoSize(100))
+                }
+            }
+        }
+    }
+}

+ 137 - 30
RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt

@@ -1,21 +1,29 @@
 package cn.muchinfo.rma.view.base.login
 
+import android.annotation.SuppressLint
 import android.content.Intent
 import android.os.Bundle
 import android.text.InputType.*
 import android.view.Gravity
 import android.widget.EditText
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.BuildConfig
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.business.commodity.CommodityManager
 import cn.muchinfo.rma.business.future.FutureManager
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MainActivity
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.set.ResetPasswordActivity
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.SPUtils
 import com.blankj.utilcode.util.ToastUtils
@@ -34,12 +42,25 @@ class LoginActivity : BaseActivity<LoginViewModel>() {
     private var loginPwdEditText: EditText? = null
     private val dialog by lazy { createLoadingDialog(hintStr = "登录中...") }
 
+    //是否选择记住密码
+    var isRememberPsw = false
+
+    //是否已勾选阅读用户协议
+    val isReadAgreement: MutableLiveData<Boolean> =
+        MutableLiveData<Boolean>().apply { value = false }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
 
         buildView()
+        initData()
+    }
+
+    fun initData() {
+        isReadAgreement.postValue(SPUtils.getInstance().getBoolean(Constant.READ_AGREEMENT, false))
     }
 
+    @SuppressLint("SetTextI18n")
     private fun buildView() {
         // 沉浸式状态栏
         QMUIStatusBarHelper.translucent(this)
@@ -78,14 +99,14 @@ class LoginActivity : BaseActivity<LoginViewModel>() {
                 }
 
             }.lparams(matchParent, autoSize(100)) {
-                setMargins(autoSize(108), autoSize(60), autoSize(108), 0)
+                setMargins(autoSize(36), autoSize(30), autoSize(36), 0)
             }
 
             view {
                 backgroundColorResource = R.color.rma_blue_color
             }.lparams(matchParent, autoSize(1)) {
-                leftMargin = autoSize(108)
-                rightMargin = autoSize(108)
+                leftMargin = autoSize(36)
+                rightMargin = autoSize(36)
             }
 
             // 密码
@@ -109,56 +130,135 @@ class LoginActivity : BaseActivity<LoginViewModel>() {
                 }
 
             }.lparams(matchParent, autoSize(100)) {
-                setMargins(autoSize(108), autoSize(60), autoSize(108), 0)
+                setMargins(autoSize(36), autoSize(60), autoSize(36), 0)
             }
 
             view {
                 backgroundColor = R.color.rma_blue_color
             }.lparams(matchParent, autoSize(1)) {
-                leftMargin = autoSize(108)
-                rightMargin = autoSize(108)
+                leftMargin = autoSize(36)
+                rightMargin = autoSize(36)
             }
 
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                checkBox {
+                    buttonDrawable = null
+                    background = resources.getDrawable(R.drawable.checkbox_switch_selector)
+                    setOnCheckedChangeListener { _, b ->
+                        isRememberPsw = b
+                    }
+                }.lparams(autoSize(100), autoSize(100)) {
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = "记住密码"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(20)
+                }
+
+                emptyView()
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.setClass(context, ResetPasswordActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    text = "忘记密码?"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginEnd = autoSize(20)
+                }
+
+            }.lparams(matchParent, autoSize(120))
+
             button {
                 gravity = Gravity.CENTER_HORIZONTAL
                 text = "登录"
                 textSizeAuto = 40
                 textColorInt = R.color.white
                 backgroundResource = R.mipmap.login_btn
-            }.lparams(autoSize(721), autoSize(143)) {
+            }.lparams(autoSize(820), autoSize(143)) {
                 gravity = Gravity.CENTER_HORIZONTAL
-                topMargin = autoSize(85)
+                topMargin = autoSize(25)
             }.onClick {
                 // 开始登录
                 login()
             }
 
             linearLayout {
-                button {
-                    text = "注册账号"
-                    textSizeAuto = 31
-                    textColorInt = R.color.rma_gray_color
-                    background = null
+                gravity = Gravity.CENTER_VERTICAL
+
+
+                onThrottleFirstClick {
+                    isReadAgreement.postValue(isReadAgreement.value?.not())
+                    SPUtils.getInstance()
+                        .put(Constant.READ_AGREEMENT, isReadAgreement.value?.not() ?: false)
                 }
+                emptyView()
+
+                imageView {
+                    isReadAgreement.bindOptional(context) {
+                        if (it == true) {
+                            imageResource = R.drawable.ic_check_select
+                        } else {
+                            imageResource = R.drawable.ic_check_normal
+                        }
+                    }
+                    imageResource = R.drawable.ic_check_normal
+                }.lparams(autoSize(35), autoSize(35))
 
-                view {
-                    backgroundColor = R.color.rma_hint_text_color_ccc
-                }.lparams(autoSize(1), autoSize(43)) {
-                    gravity = Gravity.CENTER_VERTICAL
-                    leftMargin = autoSize(65)
+                textView {
+                    text = "我已阅读并同意"
+                    textSizeAuto = 31
+                    textColorInt = R.color.text_hint_color_two
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(15)
                 }
 
-                button {
-                    text = "忘记密码?"
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.setClass(context, AgreeMentActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    text = "《用户协议》"
                     textSizeAuto = 31
-                    textColorInt = R.color.rma_gray_color
-                    background = null
-                }.lparams() {
-                    leftMargin = autoSize(65)
+                    textColorInt = R.color.rma_blue_color
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(15)
                 }
-            }.lparams(wrapContent, wrapContent) {
+
+                emptyView()
+
+            }.lparams(matchParent, autoSize(100))
+
+            emptyView()
+
+            linearLayout {
                 gravity = Gravity.CENTER_HORIZONTAL
-                topMargin = autoSize(34)
+                textView {
+                    text = "Copyright © 2021 Muchinfo. All rights reserved."
+                    textSizeAuto = 26
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, wrapContent)
+
+            linearLayout {
+                gravity = Gravity.CENTER_HORIZONTAL
+                textView {
+                    text = "版本号:V" + BuildConfig.VERSION_NAME
+                    textSizeAuto = 20
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, wrapContent) {
+                topMargin = autoSize(10)
+                bottomMargin = autoSize(40)
             }
         }
     }
@@ -190,7 +290,13 @@ class LoginActivity : BaseActivity<LoginViewModel>() {
             GlobalScope.launch(Dispatchers.Main) {
                 if (!isCompleted) {
                     viewModel.loadingDialogStatus.value =
-                        TaskUiModel.failed(InteractiveException(GlobalDataCollection.instance?.getErrorString(err?.message ?: "") ?: "") )
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                GlobalDataCollection.instance?.getErrorString(
+                                    err?.message ?: ""
+                                ) ?: ""
+                            )
+                        )
                     return@launch
                 }
                 viewModel.loginQuery { isCompleted, err ->
@@ -208,11 +314,12 @@ class LoginActivity : BaseActivity<LoginViewModel>() {
                         return@loginQuery
                     }
                     MyApplication.getInstance()?.futureManager?.queryGoodsList { isCompleted, err ->
-                        if (isCompleted){
+                        if (isCompleted) {
                             viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "登录成功")
                             goHomePage()
-                        }else{
-                            viewModel.loadingDialogStatus.value = TaskUiModel.failed(InteractiveException(errorMessage = "商品请求失败"))
+                        } else {
+                            viewModel.loadingDialogStatus.value =
+                                TaskUiModel.failed(InteractiveException(errorMessage = "商品请求失败"))
                         }
 
                     }

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

@@ -213,7 +213,7 @@ class ProcurementViewModel : BaseViewModel() {
             if (it.contracctstatus == "2" || it?.contracctstatus == "3"){
                 val newRightData = arrayListOf<String>()
                 newRightData.add(ViewEnumUtils.getContractStatus(it.contracctstatus ?: ""))
-                newRightData.add(it.deliverygoodsname + "\n" + it.spotgoodsdesc)
+                newRightData.add(it.wrstandardname + "\n" + it.wrstandardcode)
                 newRightData.add(it.goodsname + "\n" + it.pricemove)
                 newRightData.add(
                     it.convertfactor + "\n" + ViewEnumUtils.getContractStatus(

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

@@ -186,7 +186,7 @@ class SaleViewModel : BaseViewModel(){
             if (it.contracctstatus == "2" || it.contracctstatus == "3"){
                 val newRightData = arrayListOf<String>()
                 newRightData.add(ViewEnumUtils.getContractStatus(it.contracctstatus ?: ""))
-                newRightData.add(it.deliverygoodsname + "\n" + it.spotgoodsdesc)
+                newRightData.add(it.wrstandardname + "\n" + it.wrstandardcode)
                 newRightData.add(it.goodsname + "\n" + it.pricemove)
                 newRightData.add(
                     it.convertfactor + "\n" + ViewEnumUtils.getContractStatus(

+ 5 - 0
RMA/app/src/main/res/drawable/checkbox_switch_selector.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+    <item android:state_checked="true" android:drawable="@drawable/ic_switch_on"/>
+    <item android:drawable="@drawable/ic_switch_off"/>
+</selector>

+ 9 - 0
RMA/app/src/main/res/drawable/ic_check_normal.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="200dp"
+    android:height="200dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024">
+  <path
+      android:fillColor="#888888"
+      android:pathData="M512,64C264.58,64 64,264.58 64,512s200.58,448 448,448 448,-200.58 448,-448S759.42,64 512,64zM813.26,397.24L493.64,716.87c-0.13,0.13 -0.25,0.26 -0.37,0.39 -12.5,12.5 -28.88,18.75 -45.26,18.75 -16.38,0 -32.76,-6.25 -45.26,-18.75 -0.13,-0.13 -0.25,-0.26 -0.37,-0.39L210.74,525.24c-24.99,-24.99 -24.99,-65.52 0,-90.51 24.99,-24.99 65.52,-24.99 90.51,0L448,581.49l274.76,-274.76c24.99,-24.99 65.52,-24.99 90.51,0 24.99,24.99 24.99,65.52 -0,90.51z"/>
+</vector>

+ 9 - 0
RMA/app/src/main/res/drawable/ic_check_select.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="200dp"
+    android:height="200dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024">
+  <path
+      android:fillColor="#378FDF"
+      android:pathData="M512,64C264.58,64 64,264.58 64,512s200.58,448 448,448 448,-200.58 448,-448S759.42,64 512,64zM813.26,397.24L493.64,716.87c-0.13,0.13 -0.25,0.26 -0.37,0.39 -12.5,12.5 -28.88,18.75 -45.26,18.75 -16.38,0 -32.76,-6.25 -45.26,-18.75 -0.13,-0.13 -0.25,-0.26 -0.37,-0.39L210.74,525.24c-24.99,-24.99 -24.99,-65.52 0,-90.51 24.99,-24.99 65.52,-24.99 90.51,0L448,581.49l274.76,-274.76c24.99,-24.99 65.52,-24.99 90.51,0 24.99,24.99 24.99,65.52 -0,90.51z"/>
+</vector>

+ 9 - 0
RMA/app/src/main/res/drawable/ic_switch_off.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="200dp"
+    android:height="200dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024">
+  <path
+      android:fillColor="#378FDF"
+      android:pathData="M764,252H260C116.4,252 0,368.4 0,512s116.4,260 260,260h504c143.6,0 260,-116.4 260,-260S907.6,252 764,252zM260,736C136.3,736 36,635.7 36,512s100.3,-224 224,-224 224,100.3 224,224 -100.3,224 -224,224z"/>
+</vector>

+ 9 - 0
RMA/app/src/main/res/drawable/ic_switch_on.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="200dp"
+    android:height="200dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024">
+  <path
+      android:fillColor="#378FDF"
+      android:pathData="M764,252L260,252C116.4,252 0,368.4 0,512s116.4,260 260,260h504c143.6,0 260,-116.4 260,-260S907.6,252 764,252zM764,736c-123.7,0 -224,-100.3 -224,-224s100.3,-224 224,-224 224,100.3 224,224 -100.3,224 -224,224z"/>
+</vector>

+ 2 - 2
RMA/app/src/main/res/drawable/rma_market_item_botton_bg_2.xml

@@ -4,8 +4,8 @@
     <!--left to right-->
     <gradient
         android:angle="180"
-        android:endColor="#8eeae4"
-        android:startColor="#72aee2" />
+        android:endColor="#FF5C6F"
+        android:startColor="#FF2F2C" />
     <corners
         android:topRightRadius="31dp"
         android:topLeftRadius="31dp"

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است