Explorar o código

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

Liu.bolan %!s(int64=4) %!d(string=hai) anos
pai
achega
028e363d27
Modificáronse 27 ficheiros con 345 adicións e 156 borrados
  1. 31 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  2. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt
  3. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/WarehouseManager.kt
  4. 14 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/BaseGlobalData.java
  5. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsDetailData.kt
  6. 16 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ErmcpRoleFuncMenuData.kt
  7. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/GoodsGroupData.kt
  8. 4 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  9. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/AccountManagerActivity.kt
  10. 56 31
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddSpotGoodsActivity.kt
  11. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/CommodityInformationViewModel.kt
  12. 94 71
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/HedgeSpeciesDetailsActivity.kt
  13. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationActivity.kt
  14. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/NewHedgeSpeciesViewHolder.kt
  15. 24 10
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/ChangeLogViewHolder.kt
  16. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/InsuredVarietyViewHolder.kt
  17. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/AddHedgePlanActivity.kt
  18. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgePlanActivity.kt
  19. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/inventory/inventoryaudit/BuySellInventoryActivity.kt
  20. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddLoginRoleActivity.kt
  21. 15 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddRoleActivity.kt
  22. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewModel.kt
  23. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/ChangePasswordActivity.kt
  24. 10 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/warehouse/AddWareHouseInformationActivity.kt
  25. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/warehouse/WarehouseInformationViewHolder.kt
  26. 42 14
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt
  27. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ContractDetailActivity.kt

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

@@ -17,6 +17,7 @@ import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.protobuf.protoclasses.SystemMI1
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.guard
+import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.base.app.BaseResult
 import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.app.ServiceFunApi
@@ -364,6 +365,36 @@ class AccountManager {
     }
 
     /**
+     * 获取企业风管终端权限
+     * loginID 登录id
+     */
+    fun getErmcpRoleFuncMenuLists(
+        responseBack: (isSuccess: Boolean, respData: List<ErmcpRoleFuncMenuData>?, error: Error?) -> Unit
+    ) {
+
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+        }
+
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/GetErmcpRoleFuncMenuLists",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ErmcpRoleFuncMenuData>>>() {
+                override fun onResponse(response: BaseResult<List<ErmcpRoleFuncMenuData>>?, id: Int) {
+                    GlobalDataCollection.instance?.ermcpRoleFuncMenuDataArrayList = response?.data?.toArrayList()
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+    /**
      * 查询业务类型分组(账户管理/账户设置)
      * userid 用户ID
      */

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

@@ -74,7 +74,7 @@ class FutureManager {
     /**
      * 把数据库中的商品信息暂存本地数据中心
      */
-    private fun putGoodsInfoAndQuotesList() {
+    fun putGoodsInfoAndQuotesList() {
         val goodsInfoList = Builder.getDatabase<AppDatabase>().goodsInfoDao.all
         val goodsInfoAndQuotesList = GlobalDataCollection.instance?.goodsInfoAndQuotesList
         goodsInfoList.forEach {

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/WarehouseManager.kt

@@ -55,7 +55,7 @@ class WarehouseManager {
     ) {
         MyOkHttpUtils().query(
             URL = SPUtils.getInstance()
-                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStock",
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryAreaStock",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<AreaStockData>>>() {

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

@@ -5,6 +5,7 @@ import java.util.Date;
 import java.util.List;
 
 import cn.muchinfo.rma.global.data.AccountData;
+import cn.muchinfo.rma.global.data.ErmcpRoleFuncMenuData;
 import cn.muchinfo.rma.global.data.FutureDetailsData;
 import cn.muchinfo.rma.global.data.GoodsInfoAndQuotes;
 import cn.muchinfo.rma.global.data.UserAccountData;
@@ -97,6 +98,19 @@ public class BaseGlobalData {
         return goodsIdList;
     }
 
+    /**
+     * 企业风管终端权限列表
+     */
+    private ArrayList<ErmcpRoleFuncMenuData> ermcpRoleFuncMenuDataArrayList;
+
+    public ArrayList<ErmcpRoleFuncMenuData> getErmcpRoleFuncMenuDataArrayList() {
+        return ermcpRoleFuncMenuDataArrayList;
+    }
+
+    public void setErmcpRoleFuncMenuDataArrayList(ArrayList<ErmcpRoleFuncMenuData> ermcpRoleFuncMenuDataArrayList) {
+        this.ermcpRoleFuncMenuDataArrayList = ermcpRoleFuncMenuDataArrayList;
+    }
+
     public void setGoodsIdList(ArrayList<String> goodsIdList) {
         this.goodsIdList = goodsIdList;
     }

+ 5 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsDetailData.kt

@@ -389,7 +389,8 @@ data class ErmcpMiddleGoodsModel(
     val qtydecimalplace : String? = "",//数量小数位
     val relatedgoodsid : String? = "",//关联交易商品ID
     val relatedgoodstype : String? = "",//关联商品类型 - 1:期货合约 2:现货品种
-    val remark : String? = ""//备注
+    val remark : String? = "",//备注
+    val goodsunitid : String? = ""
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -406,6 +407,7 @@ data class ErmcpMiddleGoodsModel(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -426,6 +428,7 @@ data class ErmcpMiddleGoodsModel(
         parcel.writeString(relatedgoodsid)
         parcel.writeString(relatedgoodstype)
         parcel.writeString(remark)
+        parcel.writeString(goodsunitid)
     }
 
     override fun describeContents(): Int {
@@ -442,6 +445,7 @@ data class ErmcpMiddleGoodsModel(
         }
     }
 
+
 }
 
 data class ErmcpRelatedGoods(

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

@@ -0,0 +1,16 @@
+package cn.muchinfo.rma.global.data
+
+/**
+ * 企业风管终端权限
+ */
+data class ErmcpRoleFuncMenuData(
+    val iconame : String = "",//菜单图标
+    val menutype : String = "",//菜单类型 1-管理端 2-交易端 3-终端权限
+    val parentcode : String = "",//上级资源代码
+    val remark : String = "",//备注
+    val resourcecode : String = "",//资源代码
+    val resourcelevel : String = "",//级别 1-一级 2-二级 3-三级 4-四级
+    val resourcename : String = "",//资源名
+    val sort : String = "",//排序 - 一级时,是所有一级菜单的排序顺序;二级时是所属同一个一级菜单下的排序、三级时是同一个二级菜单下的排序
+    val url : String = ""//URL
+)

+ 2 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/data/GoodsGroupData.kt

@@ -27,5 +27,6 @@ data class GoodsGroupData(
     val outergroupcode: String? = "",//外部商品组代码[通道交易]
     val quoteminunit: String? = "",//行情最小变动单位 [整数,报价小数位一起使用]
     val quotesourcegroupid: String? = "",//所属行情源分组ID[参考行情市场用\通道交易]
-    val syncgoodsqty: String? = ""//同步合约数[通道交易-投资管理用] - 0表示不限
+    val syncgoodsqty: String? = "",//同步合约数[通道交易-投资管理用] - 0表示不限
+    val enumdicname : String? = ""//单位名称
 )

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

@@ -11,7 +11,7 @@ object Constant {
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
 //      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
-    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // shenzhen01  123123
+    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
 
     /**
@@ -145,4 +145,7 @@ object Constant {
     const val UploadMode = "UploadMode"
 
     const val APPID = "muchinfo_mtpclient_5.0.1"
+
+    /** 记录最后一次商品信息请求的时间 **/
+    const val QUERY_GOODS_TIME = "query_goods_time"
 }

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/AccountManagerActivity.kt

@@ -12,6 +12,7 @@ import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.AccMgrLoginUserData
+import cn.muchinfo.rma.global.data.AccMgrRoleData
 import cn.muchinfo.rma.global.data.AccMgrTaaccountData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
@@ -21,6 +22,7 @@ import cn.muchinfo.rma.view.base.home.accountmanager.accountviewholder.FutureMan
 import cn.muchinfo.rma.view.base.home.accountmanager.futureaccount.AddFutureAccountActivity
 import cn.muchinfo.rma.view.base.home.accountmanager.futureset.FutureSetActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.rolemanagement.AddRoleSetActivity
 import cn.muchinfo.rma.view.base.home.rolemanagement.RoleSetActivity
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ConvertUtils
@@ -239,7 +241,11 @@ class LoginAccountManager(
 
                 imageView {
                     onThrottleFirstClick {
-
+                        val intent = Intent()
+                        intent.putExtra("type","1")
+                        intent.putExtra("data", AccMgrRoleData())
+                        intent.setClass(context, AddRoleSetActivity::class.java)
+                        ActivityUtils.startActivity(intent)
                     }
                     imageResource = R.mipmap.rma_account_add
                 }.lparams(autoSize(43), autoSize(43)) {

+ 56 - 31
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddSpotGoodsActivity.kt

@@ -67,15 +67,34 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
     //型号适配/////第三期修改为品类
     private val spotModelAdapter: BaseAdapter<SpotInfoData, AddSpotCategoryViewHolder> =
-        BaseAdapter { _, _ -> AddSpotCategoryViewHolder(this, viewModel,operationType = type ?: "") }
+        BaseAdapter { _, _ ->
+            AddSpotCategoryViewHolder(
+                this,
+                viewModel,
+                operationType = type ?: ""
+            )
+        }
 
     //品牌适配
     private val brandModelAdapter: BaseAdapter<SpotInfoData, SpotModelViewHolder> =
-        BaseAdapter { _, _ -> SpotModelViewHolder(this, viewModel, "2",operationType = type ?: "") }
+        BaseAdapter { _, _ ->
+            SpotModelViewHolder(
+                this,
+                viewModel,
+                "2",
+                operationType = type ?: ""
+            )
+        }
 
     //套保
     private val middleGoodsAdapter: BaseAdapter<SpotInfoData, InsuredVarietyViewHolder> =
-        BaseAdapter { _, _ -> InsuredVarietyViewHolder(this, viewModel,operationType = type ?: "") }
+        BaseAdapter { _, _ ->
+            InsuredVarietyViewHolder(
+                this,
+                viewModel,
+                operationType = type ?: ""
+            )
+        }
 
     /** 选择的单位 **/
     val selectUnitType: MutableLiveData<SelectData> = MutableLiveData()
@@ -105,7 +124,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
             selectUnitType.postValue(
                 SelectData(
                     id = data.data?.goodsunitid ?: "",
-                    value = data?.data?.enumdicname ?: ""
+                    value = data.data?.enumdicname ?: ""
                 )
             )
 //            viewModel.queryWrStandardDetails(data.data?.deliverygoodsid ?: "")
@@ -128,7 +147,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                         text = "停用现货品种"
                     } else if (type == "5") {
                         text = "恢复现货品种"
-                    }else{
+                    } else {
                         text = "现货品种详情"
                     }
                 }
@@ -159,10 +178,10 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
 
                             editText {
-                                if (type == "2" ||  type == "4" || type == "3" || type == "5"){
+                                if (type == "2" || type == "4" || type == "3" || type == "5") {
                                     isEnabled = false
                                     setText(data.data?.deliverygoodsname)
-                                }else{
+                                } else {
                                     isEnabled = true
                                 }
                                 spot_variety_name_edittext = this
@@ -194,10 +213,10 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
 
                             editText {
-                                if (type == "2" || type == "4" || type == "3" || type == "5"){
+                                if (type == "2" || type == "4" || type == "3" || type == "5") {
                                     isEnabled = false
                                     setText(data.data?.deliverygoodscode)
-                                }else{
+                                } else {
                                     isEnabled = true
                                 }
                                 spot_variety_code_edittext = this
@@ -221,7 +240,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
                             onThrottleFirstClick {
                                 //对于修改,停用,复用的操作不能选择
-                                if (type == "4" || type == "3" || type == "5"){
+                                if (type == "4" || type == "3" || type == "5") {
                                     return@onThrottleFirstClick
                                 }
                                 val selectDataList = arrayListOf(
@@ -271,10 +290,10 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
                             textView {
                                 selectUnitType.bindOptional(context) {
-                                    if (it?.value.isNullOrEmpty()){
+                                    if (it?.value.isNullOrEmpty()) {
                                         text = data.data?.enumdicname
                                         textColorInt = R.color.rma_black_33
-                                    }else{
+                                    } else {
                                         text = it?.value
                                         textColorInt = R.color.rma_black_33
                                     }
@@ -313,7 +332,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
                         linearLayout {
                             onThrottleFirstClick {
-                                if (type == "4" || type == "3" || type == "5"){
+                                if (type == "4" || type == "3" || type == "5") {
                                     return@onThrottleFirstClick
                                 }
                                 viewModel.changeSpotModelList(
@@ -354,7 +373,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
                         linearLayout {
                             onThrottleFirstClick {
-                                if (type == "4" || type == "3" || type == "5"){
+                                if (type == "4" || type == "3" || type == "5") {
                                     return@onThrottleFirstClick
                                 }
                                 viewModel.changeBrandModelList(
@@ -403,7 +422,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
                             textView {
                                 onThrottleFirstClick {
-                                    if (type == "4" || type == "3" || type == "5"){
+                                    if (type == "4" || type == "3" || type == "5") {
                                         return@onThrottleFirstClick
                                     }
                                     viewModel.changeMiddleGoodsList(
@@ -433,9 +452,9 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
 
                             editText {
-                                isEnabled = if (type == "4" || type == "3" || type == "5"){
+                                isEnabled = if (type == "4" || type == "3" || type == "5") {
                                     false
-                                }else{
+                                } else {
                                     true
                                 }
                                 remask_edittext = this
@@ -459,9 +478,9 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                     background = resources.getDrawable(R.color.white)
                     gravity = Gravity.CENTER_VERTICAL
 
-                    if (type == "4"){
+                    if (type == "4") {
                         visibility = View.GONE
-                    }else{
+                    } else {
                         visibility = View.VISIBLE
                     }
                     textView {
@@ -482,7 +501,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                 ) {
                                     finish()
                                 }
-                            }else if (type == "2"){//修改
+                            } else if (type == "2") {//修改
                                 viewModel.requestGoodsApply(
                                     deliverygoodscode = spot_variety_code_edittext.text.toString(),
                                     deliverygoodsname = spot_variety_name_edittext.text.toString(),
@@ -496,12 +515,18 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                 ) {
                                     finish()
                                 }
-                            }else if (type == "3"){//停用
-                                viewModel.requestGoodsCancelReq(wrstandardid = data.data?.deliverygoodsid?.toLong() ?: 0,isvalid = 0){
+                            } else if (type == "3") {//停用
+                                viewModel.requestGoodsCancelReq(
+                                    wrstandardid = data.data?.deliverygoodsid?.toLong() ?: 0,
+                                    isvalid = 0
+                                ) {
                                     finish()
                                 }
-                            }else if (type == "5"){//恢复
-                                viewModel.requestGoodsCancelReq(wrstandardid = data.data?.deliverygoodsid?.toLong() ?: 0,isvalid = 1){
+                            } else if (type == "5") {//恢复
+                                viewModel.requestGoodsCancelReq(
+                                    wrstandardid = data.data?.deliverygoodsid?.toLong() ?: 0,
+                                    isvalid = 1
+                                ) {
                                     finish()
                                 }
                             }
@@ -537,14 +562,14 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
      * isAdd 是否是新增
      * @return List<ManageServiceMI2.SpotGoodsModelEx>
      */
-    private fun getSpotModelList(isAdd : Boolean = true): List<ManageServiceMI2.GLDWRStandardEx> {
+    private fun getSpotModelList(isAdd: Boolean = true): List<ManageServiceMI2.GLDWRStandardEx> {
         val spotgoodsmodels = arrayListOf<ManageServiceMI2.GLDWRStandardEx>()
         viewModel.spotModelcacheList.value?.forEach {
             val spotGoodsData = ManageServiceMI2.GLDWRStandardEx.newBuilder()
             spotGoodsData.wrstandardname = it.value
-            if (isAdd){
+            if (isAdd) {
 //                spotGoodsData.wrstandardid = it
-            }else{
+            } else {
                 spotGoodsData.wrstandardid = it.middleGoodsId.toLong()//修改时才加
             }
             spotGoodsData.unitid = it.enumdicnameid.toLong()
@@ -559,15 +584,15 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
      * 品牌列表
      * @return List<ManageServiceMI2.SpotGoodsModelEx>
      */
-    private fun getBrandModelList(isAdd : Boolean = true): List<ManageServiceMI2.GLDDGFactoryItemEx> {
+    private fun getBrandModelList(isAdd: Boolean = true): List<ManageServiceMI2.GLDDGFactoryItemEx> {
         val brandgoodsmodels = arrayListOf<ManageServiceMI2.GLDDGFactoryItemEx>()
         viewModel.brandModelcacheList.value?.forEach {
             val spotGoodsData = ManageServiceMI2.GLDDGFactoryItemEx.newBuilder()
             spotGoodsData.dgfactoryitemvalue = it.value
-            if (isAdd.not()){
+            if (isAdd.not()) {
                 spotGoodsData.dgfactoryitemid = it.middleGoodsId.toLong()
             }
-            LogUtils.eTag("asdhahsdkjahdjka",spotGoodsData.dgfactoryitemid)
+            LogUtils.eTag("asdhahsdkjahdjka", spotGoodsData.dgfactoryitemid)
             brandgoodsmodels.add(spotGoodsData.build())
         }
         return brandgoodsmodels
@@ -577,7 +602,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
      * 套保品牌列表
      * @return List<ManageServiceMI2.SpotGoodsModelEx>
      */
-    private fun getMiddleModelList(isAdd : Boolean = true): List<ManageServiceMI2.WRSConvertDetailEx> {
+    private fun getMiddleModelList(isAdd: Boolean = true): List<ManageServiceMI2.WRSConvertDetailEx> {
         val middlegoodsmodels = arrayListOf<ManageServiceMI2.WRSConvertDetailEx>()
         viewModel.middlegoodCacheList.value?.forEach {
             val spotGoodsData = ManageServiceMI2.WRSConvertDetailEx.newBuilder()

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

@@ -281,7 +281,7 @@ class CommodityInformationViewModel : BaseViewModel() {
                         enumdicname
                     }
                     newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
-                        it.enumdicname
+                        it.enumdicnameid
                     } else {
                         enumdicnameid
                     }
@@ -651,7 +651,7 @@ class CommodityInformationViewModel : BaseViewModel() {
                 SpotInfoData(
                     id = respData.mgList.indexOf(it).plus(1).toString(),
                     value = it.convertratio ?: "",
-                    enumdicnameid = it.mg?.middlegoodscode ?: "",
+                    enumdicnameid = it.mg?.goodsunitid ?: "",
                     middleGoodsId = it.mg?.middlegoodsid ?: "",
                     middleGoodsName = it.mg?.middlegoodsname ?: "",
                     enumdicname = it.mg?.enumdicname ?: ""

+ 94 - 71
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/HedgeSpeciesDetailsActivity.kt

@@ -8,10 +8,7 @@ import androidx.appcompat.app.AppCompatActivity
 import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
-import cn.muchinfo.rma.global.data.ChangeLogData
-import cn.muchinfo.rma.global.data.MiddleGoodsChangeLogData
-import cn.muchinfo.rma.global.data.MiddleGoodsData
-import cn.muchinfo.rma.global.data.WrStandardData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.lifecycle.bindOptional
@@ -30,26 +27,27 @@ import org.jetbrains.anko.support.v4.viewPager
 /**
  * 套保品种详情
  */
-class HedgeSpeciesDetailsActivity : BaseActivity<CommodityInformationViewModel>(){
+class HedgeSpeciesDetailsActivity : BaseActivity<CommodityInformationViewModel>() {
 
     /**
      * 数据
      */
-    val data: MiddleGoodsData by lazy {
-        intent.getParcelableExtra<MiddleGoodsData>("data") as MiddleGoodsData
+    val data: MiddleGoodsDetail by lazy {
+        intent.getParcelableExtra<MiddleGoodsDetail>("data") as MiddleGoodsDetail
     }
 
     lateinit var segment: QMUITabSegment
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
 
-    /** 商品详情 **/
-    private val goodsDetailsUI by lazy { GoodsDetailsUI(this,viewModel,data) }
+//    /** 商品详情 **/
+//    private val goodsDetailsUI by lazy { GoodsDetailsUI(this, viewModel, data) }
+
     /** 变更记录 **/
-    private val changeRecordUI by lazy { ChangeRecordUI(this,viewModel, data) }
+    private val changeRecordUI by lazy { ChangeRecordUI(this, viewModel, data) }
     private val tabsArray: List<String> by lazy {
         arrayListOf(
-            "商品详情", "变更记录"
+           /* "商品详情",*/ "变更记录"
         )
     }
 
@@ -61,21 +59,21 @@ class HedgeSpeciesDetailsActivity : BaseActivity<CommodityInformationViewModel>(
             override fun instantiateItem(container: ViewGroup, position: Int): Any {
                 when (position) {
                     0 -> {
-                        return goodsDetailsUI.root.apply {
+                        return changeRecordUI.root.apply {
                             container.addView(
                                 this,
                                 ViewGroup.LayoutParams(matchParent, matchParent)
                             )
                         }
                     }
-                    1 -> {
+                    /*1 -> {
                         return changeRecordUI.root.apply {
                             container.addView(
                                 this,
                                 ViewGroup.LayoutParams(matchParent, matchParent)
                             )
                         }
-                    }
+                    }*/
                     else -> return super.instantiateItem(container, position)
                 }
             }
@@ -109,19 +107,19 @@ class HedgeSpeciesDetailsActivity : BaseActivity<CommodityInformationViewModel>(
                 background = resources.getDrawable(R.color.rma_pass_status)//rma_pass_status已通过背景色
 
                 imageView {
-                    if (data.isvalid == "1"){
+                    if (data.mg?.isvalid == "1") {
                         imageResource = R.mipmap.rma_pass_status
-                    }else{
+                    } else {
                         imageResource = R.mipmap.rma_wait_status
                     }
                 }.lparams(autoSize(38), autoSize(38)) {
                     marginStart = autoSize(37)
                 }
                 textView {
-                    if (data.isvalid == "1"){
+                    if (data.mg?.isvalid == "1") {
                         textColorInt = R.color.rma_green_color
                         text = "正常"
-                    }else{
+                    } else {
                         textColorInt = R.color.rma_yellow_text_color
                         text = "停用"
                     }
@@ -133,6 +131,7 @@ class HedgeSpeciesDetailsActivity : BaseActivity<CommodityInformationViewModel>(
             }.lparams(matchParent, autoSize(60))
 
             tabSegment {
+                visibility = View.GONE
                 segment = this
                 background = resources.getDrawable(R.color.white)
                 addOnTabSelectedListener(object :
@@ -180,40 +179,50 @@ class HedgeSpeciesDetailsActivity : BaseActivity<CommodityInformationViewModel>(
  * @property root _FrameLayout
  * @constructor
  */
-class GoodsDetailsUI(
-    private val activity : AppCompatActivity,
-    private val viewModel: CommodityInformationViewModel,
-    private val data : MiddleGoodsData
-){
-
-    init {
-        viewModel.queryMiddleGoodsDetailList(data.middlegoodsid ?: "") {
-            viewModel.avalidGoodsDetailsData.postValue(this)
-        }
-    }
-    val root = _FrameLayout(activity).apply {
-        verticalLayout {
-            contentItem(itemTile = "套保品种名称",itemContent = data.middlegoodsname ?: "")
-            viewItemUI()
-            contentItem(itemTile = "套保品种代码",itemContent = data.middlegoodscode ?: "")
-            viewItemUI()
-            contentItem(itemTile = "单位",itemContent = data.enumdicname ?: "")
-            viewItemUI()
-            contentItem(itemTile = "套保比例",itemContent = data.needhedgeratio?.toDouble()?.times(100).toString() ?: "")
-            viewModel.avalidGoodsDetailsData.bindOptional(context){list ->
-                list?.forEach {
-                    viewItemUI()
-                    contentItem(itemTile = "期货品种" + list.indexOf(it).plus(1),itemContent = it.goodsgroupname?.isBlankString() ?: "")
-                    contentItem(itemTile = "期货品种系数" + list.indexOf(it).plus(1),itemContent = it.convertratio ?: "")
-                }
-            }
-            viewItemUI()
-
-            contentItem(itemTile = "备注",itemContent = "--")//TODO 需要加字段
-
-        }
-    }
-}
+//class GoodsDetailsUI(
+//    private val activity: AppCompatActivity,
+//    private val viewModel: CommodityInformationViewModel,
+//    private val data: MiddleGoodsDetail
+//) {
+//
+//    init {
+//        viewModel.queryMiddleGoodsDetailList(data.middlegoodsid ?: "") {
+//            viewModel.avalidGoodsDetailsData.postValue(this)
+//        }
+//    }
+//
+//    val root = _FrameLayout(activity).apply {
+//        verticalLayout {
+//            contentItem(itemTile = "套保品种名称", itemContent = data.middlegoodsname ?: "")
+//            viewItemUI()
+//            contentItem(itemTile = "套保品种代码", itemContent = data.middlegoodscode ?: "")
+//            viewItemUI()
+//            contentItem(itemTile = "单位", itemContent = data.enumdicname ?: "")
+//            viewItemUI()
+//            contentItem(
+//                itemTile = "套保比例",
+//                itemContent = data.needhedgeratio?.toDouble()?.times(100).toString() ?: ""
+//            )
+//            viewModel.avalidGoodsDetailsData.bindOptional(context) { list ->
+//                list?.forEach {
+//                    viewItemUI()
+//                    contentItem(
+//                        itemTile = "期货品种" + list.indexOf(it).plus(1),
+//                        itemContent = it.goodsgroupname?.isBlankString() ?: ""
+//                    )
+//                    contentItem(
+//                        itemTile = "期货品种系数" + list.indexOf(it).plus(1),
+//                        itemContent = it.convertratio ?: ""
+//                    )
+//                }
+//            }
+//            viewItemUI()
+//
+//            contentItem(itemTile = "备注", itemContent = "--")//TODO 需要加字段
+//
+//        }
+//    }
+//}
 
 /**
  * 变更记录
@@ -224,18 +233,19 @@ class GoodsDetailsUI(
  * @constructor
  */
 class ChangeRecordUI(
-    private val activity : AppCompatActivity,
+    private val activity: AppCompatActivity,
     private val viewModel: CommodityInformationViewModel,
-    private val data : MiddleGoodsData
-){
+    private val data: MiddleGoodsDetail
+) {
 
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val spotVarietiesNormalAdapter: BaseAdapter<MiddleGoodsChangeLogData, ChangeLogViewHolder> = BaseAdapter { _, _ -> ChangeLogViewHolder(activity) }
+    private val spotVarietiesNormalAdapter: BaseAdapter<MiddleGoodsChangeLogData, ChangeLogViewHolder> =
+        BaseAdapter { _, _ -> ChangeLogViewHolder(activity) }
 
     init {
-        viewModel.queryMiddleGoodsChangeLog(middlegoodsid = data.middlegoodsid ?: "")
+        viewModel.queryMiddleGoodsChangeLog(middlegoodsid = data.mg?.middlegoodsid ?: "")
     }
 
     val root = _FrameLayout(activity).apply {
@@ -248,18 +258,29 @@ class ChangeRecordUI(
                     textColorInt = R.color.hint_text_color
                     textSizeAuto = 23
                 }.lparams(autoSize(225), autoSize(100))
-                textView {
-                    gravity = Gravity.CENTER
-                    text = "修改前套保比例"
-                    textColorInt = R.color.hint_text_color
-                    textSizeAuto = 23
+
+                verticalLayout {
+                    textView {
+                        gravity = Gravity.CENTER
+                        text = "修改前套保比例"
+                        textColorInt = R.color.hint_text_color
+                        textSizeAuto = 23
+                    }.lparams(wrapContent, wrapContent)
+                    textView {
+                        gravity = Gravity.CENTER
+                        text = "修改后套保比例"
+                        textColorInt = R.color.hint_text_color
+                        textSizeAuto = 23
+                    }.lparams(wrapContent, wrapContent)
                 }.lparams(autoSize(225), autoSize(100))
+
                 textView {
                     gravity = Gravity.CENTER
-                    text = "修改后套保比例"
+                    text = "备注"
                     textColorInt = R.color.hint_text_color
                     textSizeAuto = 23
                 }.lparams(autoSize(225), autoSize(100))
+
                 textView {
                     gravity = Gravity.CENTER
                     text = "修改人"
@@ -276,7 +297,9 @@ class ChangeRecordUI(
                     setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
-                        viewModel.queryMiddleGoodsChangeLog(middlegoodsid = data.middlegoodsid ?: "")
+                        viewModel.queryMiddleGoodsChangeLog(
+                            middlegoodsid = data.mg?.middlegoodsid ?: ""
+                        )
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -289,11 +312,11 @@ class ChangeRecordUI(
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            viewModel.middleChangeLogDataList.bindOptional(context){
-                if (it?.isEmpty() == true || it?.size == 0){
+            viewModel.middleChangeLogDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
-                }else {
-                    if (swipeToLayout.getIsRefreshing()){
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
                         swipeToLayout.finishRefresh()
                     }
                     statusLayout.showSuccess()
@@ -304,7 +327,7 @@ class ChangeRecordUI(
     }
 }
 
-fun _LinearLayout.contentItem(itemTile : String,itemContent : String){
+fun _LinearLayout.contentItem(itemTile: String, itemContent: String) {
     linearLayout {
         gravity = Gravity.CENTER_VERTICAL
         background = resources.getDrawable(R.color.white)
@@ -314,7 +337,7 @@ fun _LinearLayout.contentItem(itemTile : String,itemContent : String){
                 text = itemTile
                 textSizeAuto = 31
                 textColorInt = R.color.rma_gray_color
-            }.lparams(wrapContent, wrapContent){
+            }.lparams(wrapContent, wrapContent) {
                 marginStart = autoSize(35)
             }
         }.lparams(autoSize(250), autoSize(120))
@@ -323,7 +346,7 @@ fun _LinearLayout.contentItem(itemTile : String,itemContent : String){
             text = itemContent
             textSizeAuto = 31
             textColorInt = R.color.rma_black_33
-        }.lparams(wrapContent, wrapContent){
+        }.lparams(wrapContent, wrapContent) {
             marginStart = autoSize(35)
         }
 

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationActivity.kt

@@ -101,6 +101,7 @@ class NewCommodityInformationActivity : BaseActivity<NewCommodityInformationView
         verticalLayout {
 
             linearLayout {
+                background = resources.getDrawable(R.color.main_title_bg_color)
                 gravity = Gravity.CENTER_VERTICAL
                 imageView {
                     imageResource = R.mipmap.back

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/NewHedgeSpeciesViewHolder.kt

@@ -12,6 +12,7 @@ import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.home.commodity.AddHedgeGoodsActivity
 import cn.muchinfo.rma.view.base.home.commodity.AddSpotGoodsActivity
+import cn.muchinfo.rma.view.base.home.commodity.HedgeSpeciesDetailsActivity
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationViewModel
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import com.blankj.utilcode.util.ActivityUtils
@@ -102,9 +103,8 @@ class NewHedgeSpeciesViewHolder(
                 textView {
                     onThrottleFirstClick {
                         val intent = Intent()
-                        intent.putExtra("type","2")
                         intent.putExtra("data",data.value)
-                        intent.setClass(context, AddHedgeGoodsActivity::class.java)
+                        intent.setClass(context, HedgeSpeciesDetailsActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }
                     backgroundResource = R.drawable.rma_item_click_bg

+ 24 - 10
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/ChangeLogViewHolder.kt

@@ -31,24 +31,38 @@ class ChangeLogViewHolder(private val activity: AppCompatActivity) :
                 textColorInt = R.color.hint_text_color
                 textSizeAuto = 31
             }.lparams(autoSize(225), autoSize(100))
-            /**"修改前套保比例"**/
-            textView {
-                gravity = Gravity.CENTER
-                data.bindOptional(context) {
-                    text = it?.beforevalue?.toPercentage()
-                }
-                text = "修改前套保比例"
-                textColorInt = R.color.hint_text_color
-                textSizeAuto = 31
+            verticalLayout {
+                /**"修改前套保比例"**/
+                textView {
+                    gravity = Gravity.CENTER
+                    data.bindOptional(context) {
+                        text = it?.beforevalue?.toPercentage()
+                    }
+                    text = "修改前套保比例"
+                    textColorInt = R.color.hint_text_color
+                    textSizeAuto = 31
+                }.lparams(autoSize(225), autoSize(100))
+                textView {
+                    gravity = Gravity.CENTER
+                    data.bindOptional(context) {
+                        text = it?.aftervalue?.toPercentage()
+                    }
+                    textColorInt = R.color.hint_text_color
+                    textSizeAuto = 31
+                }.lparams(autoSize(225), autoSize(100))
             }.lparams(autoSize(225), autoSize(100))
+
+            //备注
             textView {
                 gravity = Gravity.CENTER
                 data.bindOptional(context) {
-                    text = it?.aftervalue?.toPercentage()
+                    text = it?.logremark?.isBlankString()
                 }
                 textColorInt = R.color.hint_text_color
                 textSizeAuto = 31
             }.lparams(autoSize(225), autoSize(100))
+
+            //修改人
             textView {
                 gravity = Gravity.CENTER
                 data.bindOptional(context) {

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/InsuredVarietyViewHolder.kt

@@ -45,7 +45,7 @@ class InsuredVarietyViewHolder(
                     }
 
                     activity.creatGoodsHedgeBottomSheetDialog("请选择套保品种", viewModel.getRemainingMiddleGoodsList()) {
-                        viewModel.changeMiddleGoodsList(type = "4",id = dataIndex.plus(1).toString(),ano = "",middlegoodsId = this.goodsgroupid ?: "",enumdicnameid = this.goodunitid ?: "",enumdicname = this.goodunitid ?: "" ?: "",middleGoodsName = this.goodsgroupname ?: "")
+                        viewModel.changeMiddleGoodsList(type = "4",id = dataIndex.plus(1).toString(),ano = "",middlegoodsId = this.goodsgroupid ?: "",enumdicnameid = this.goodunitid ?: "",enumdicname = this.enumdicname ?: "" ?: "",middleGoodsName = this.goodsgroupname ?: "")
                     }
                 }
                 textView {

+ 3 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/AddHedgePlanActivity.kt

@@ -110,10 +110,10 @@ class AddHedgePlanActivity : BaseActivity<HedgePlanViewModel>() {
             topBar {
                 commonLeftButton()
                 commonTitle {
-                    if (type == "1"){
-                        text = "新增套保计划"
+                    text = if (type == "1"){
+                        "新增套保计划"
                     }else {
-                        text = "修改套保计划"
+                        "修改套保计划"
                     }
                 }
             }

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

@@ -1,3 +1,5 @@
+@file:Suppress("DEPRECATION")
+
 package cn.muchinfo.rma.view.base.home.hedge
 
 import android.content.Intent
@@ -329,8 +331,6 @@ class ExecutionUI(
     private val viewModel: HedgePlanViewModel,
     private val type: String
 ) {
-
-
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/inventory/inventoryaudit/BuySellInventoryActivity.kt

@@ -104,7 +104,7 @@ class BuySellInventoryActivity : BaseActivity<InventoryAuditViewModel>(){
                             }
                         }.lparams(matchParent, autoSize(60))
                         textView {
-                            text = "合同基本信息:"
+                            text = "登记信息:"
                             textColorInt = R.color.rma_blue_color
                             textSizeAuto = 34
                         }.lparams(wrapContent, wrapContent) {
@@ -257,7 +257,7 @@ class BuySellInventoryActivity : BaseActivity<InventoryAuditViewModel>(){
 
 
                         textView {
-                            text = "审核登记信息:"
+                            text = "审核信息:"
                             textColorInt = R.color.rma_blue_color
                             textSizeAuto = 34
                         }.lparams(wrapContent, wrapContent) {

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

@@ -321,7 +321,7 @@ class AddLoginRoleActivity : BaseActivity<RoleSetViewModel>() {
                             linearLayout {
                                 onThrottleFirstClick {
                                     if (isSalesman.value?.id == "0") {
-                                        isSalesman.postValue(SelectData(id = "23", value = "业务员"))
+                                        isSalesman.postValue(SelectData(id = "22", value = "业务员"))
                                     } else {
                                         isSalesman.postValue(SelectData(id = "0", value = "业务员"))
                                     }
@@ -355,7 +355,7 @@ class AddLoginRoleActivity : BaseActivity<RoleSetViewModel>() {
                                     if (isMerchandiser.value?.id == "0") {
                                         isMerchandiser.postValue(
                                             SelectData(
-                                                id = "22",
+                                                id = "23",
                                                 value = "跟单员"
                                             )
                                         )

+ 15 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddRoleActivity.kt

@@ -278,6 +278,9 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
                 background = resources.getDrawable(R.color.white)
                 gravity = Gravity.CENTER_VERTICAL
                 onThrottleFirstClick {
+                    if (type == "1"){
+                        return@onThrottleFirstClick
+                    }
                     creatBottomSheetDialog("请选择合同类型", getSelectDataList()) {
                         roleTypeSelectData.postValue(this)
                     }
@@ -303,6 +306,7 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
                     roleTypeSelectData.bindOptional(context) {
                         text = it?.value
                     }
+                    text = data.rolename
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
@@ -312,6 +316,11 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
                 emptyView()
 
                 imageView {
+                    if (type == "1"){
+                        visibility = View.GONE
+                    }else{
+                        visibility = View.VISIBLE
+                    }
                     imageResource = R.mipmap.rma_more
                 }.lparams(autoSize(36), autoSize(36)) {
                     marginEnd = autoSize(25)
@@ -373,9 +382,12 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
      */
     fun getSelectDataList(): List<SelectData> {
         val selectList = arrayListOf<SelectData>()
-        seletType.forEach {
-            selectList.add(SelectData(id = it.roleid ?: "", value = it.rolename ?: ""))
-        }
+//        seletType.forEach {
+//            selectList.add(SelectData(id = it.roleid ?: "", value = it.rolename ?: ""))
+//        }
+        selectList.add(SelectData(id = "22",value = "业务员"))
+        selectList.add(SelectData(id = "23",value = "跟单员"))
+        selectList.add(SelectData(id = "24",value = "交易员"))
         return selectList
     }
 

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

@@ -99,7 +99,7 @@ class RoleSetViewModel : BaseViewModel(){
     fun queryAccMgrRoleMenu(roleid : String = ""){
         val params = mutableMapOf<String, String>().apply {
             put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-
+            put("roleid","0")
         }
         MyApplication.getInstance()?.accountManager?.queryAccMgrRoleMenu(params = params){isSuccess, respData, error ->
             if (isSuccess){

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

@@ -43,7 +43,7 @@ class ChangePasswordActivity : BaseActivity<ChangePasswordViewModel>(){
             topBar {
                 commonLeftButton()
                 commonTitle {
-                    text = "修改登密码"
+                    text = "修改登密码"
                 }
             }
 

+ 10 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/warehouse/AddWareHouseInformationActivity.kt

@@ -38,6 +38,13 @@ class AddWareHouseInformationActivity : BaseActivity<WarehouseInformationViewMod
         intent.getStringExtra("type")
     }
 
+    /**
+     * 是通过哪个列表来的 1 是正常列表 2 是停用列表
+     */
+    val isFrom by lazy {
+        intent.getStringExtra("isFrom")
+    }
+
     val data by lazy {
         intent.getParcelableExtra<WarehouseInfoData>("data") as WarehouseInfoData
     }
@@ -157,13 +164,13 @@ class AddWareHouseInformationActivity : BaseActivity<WarehouseInformationViewMod
                                 View.VISIBLE
                             }
                             gravity = Gravity.CENTER_VERTICAL
-                            background = if (type == "2" || type == "4"|| type == "5") {
+                            background = if (isFrom == "1") {
                                 resources.getDrawable(R.color.rma_pass_status)//rma_pass_status已通过背景色
                             } else {
                                 resources.getDrawable(R.color.rma_details_status)//rma_pass_status未通过背景色
                             }
                             imageView {
-                                imageResource = if (type == "2" || type == "4"|| type == "5") {
+                                imageResource = if (isFrom == "1") {
                                     R.mipmap.rma_pass_status
                                 } else {
                                     R.mipmap.rma_wait_status
@@ -173,7 +180,7 @@ class AddWareHouseInformationActivity : BaseActivity<WarehouseInformationViewMod
                                 marginStart = autoSize(37)
                             }
                             textView {
-                                if (type == "2" || type == "4" || type == "5") {
+                                if (isFrom == "1") {
                                     text = "正常"
                                     textColorInt = R.color.rma_green_color
                                 } else {

+ 4 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/warehouse/WarehouseInformationViewHolder.kt

@@ -120,6 +120,7 @@ class WarehouseInformationViewHolder(private val activity : AppCompatActivity,pr
                         val intent = Intent()
                         intent.putExtra("type","5")
                         intent.putExtra("data",data.value)
+                        intent.putExtra("isFrom",type)
                         intent.setClass(context, AddWareHouseInformationActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }
@@ -143,6 +144,7 @@ class WarehouseInformationViewHolder(private val activity : AppCompatActivity,pr
                         val intent = Intent()
                         intent.putExtra("type","3")
                         intent.putExtra("data",data.value)
+                        intent.putExtra("isFrom",type)
                         intent.setClass(context, AddWareHouseInformationActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }
@@ -166,6 +168,7 @@ class WarehouseInformationViewHolder(private val activity : AppCompatActivity,pr
                         val intent = Intent()
                         intent.putExtra("type","2")
                         intent.putExtra("data",data.value)
+                        intent.putExtra("isFrom",type)
                         intent.setClass(context, AddWareHouseInformationActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }
@@ -184,6 +187,7 @@ class WarehouseInformationViewHolder(private val activity : AppCompatActivity,pr
                         val intent = Intent()
                         intent.putExtra("type","4")
                         intent.putExtra("data",data.value)
+                        intent.putExtra("isFrom",type)
                         intent.setClass(context, AddWareHouseInformationActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }

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

@@ -15,6 +15,7 @@ import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.BuildConfig
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.toShowTime
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.update.check.UpdateChecker
@@ -27,10 +28,7 @@ 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.LogUtils
-import com.blankj.utilcode.util.SPUtils
-import com.blankj.utilcode.util.ToastUtils
+import com.blankj.utilcode.util.*
 import com.qmuiteam.qmui.kotlin.onClick
 import com.qmuiteam.qmui.util.QMUIStatusBarHelper
 import com.sfit.ctp.info.DeviceInfoManager
@@ -410,10 +408,8 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                         )
                     return@launch
                 }
+                //请求账户基本信息
                 viewModel.loginQuery { isCompleted, err ->
-//                    run {
-//
-//                    }
                     if (!isCompleted) {
                         viewModel.loadingDialogStatus.value =
                             TaskUiModel.failed(
@@ -424,15 +420,47 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                             )
                         return@loginQuery
                     }
-                    MyApplication.getInstance()?.futureManager?.queryGoodsList { isCompleted, err ->
-                        if (isCompleted) {
-                            viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "登录成功")
-                            goHomePage()
-                        } else {
+                    //请求获取企业风管终端权限
+                    MyApplication.getInstance()?.accountManager?.getErmcpRoleFuncMenuLists(){isSuccess, respData, error ->
+                        if (isSuccess.not()){
                             viewModel.loadingDialogStatus.value =
-                                TaskUiModel.failed(InteractiveException(errorMessage = "商品请求失败"))
+                                TaskUiModel.failed(
+                                    InteractiveException(
+                                        error?.message ?: "查询失败".toShowTime()
+                                    )
+                                )
+                            return@getErmcpRoleFuncMenuLists
+                        }
+                    }
+                    // 商品信息要求每过24小时请求一次
+                    if (SPUtils.getInstance().getLong(Constant.QUERY_GOODS_TIME ,0) == 0L){//如果拿到的记录的商品信息请求时间为空则进行商品信息请求
+                        MyApplication.getInstance()?.futureManager?.queryGoodsList { isCompleted, err ->
+                            if (isCompleted) {
+                                viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "登录成功")
+                                SPUtils.getInstance().put(Constant.QUERY_GOODS_TIME,TimeUtils.getNowMills())
+                                goHomePage()
+                            } else {
+                                viewModel.loadingDialogStatus.value =
+                                    TaskUiModel.failed(InteractiveException(errorMessage = "商品请求失败"))
+                            }
+                        }
+                    }else{//如果记录的时间和当前时间相差超过24小时则进行商品信息请求
+                        if (TimeUtils.getNowMills().minus(SPUtils.getInstance().getLong(Constant.QUERY_GOODS_TIME)) >= 86400000){
+                            MyApplication.getInstance()?.futureManager?.queryGoodsList { isCompleted, err ->
+                                if (isCompleted) {
+                                    viewModel.loadingDialogStatus.value = TaskUiModel.success(msg = "登录成功")
+                                    SPUtils.getInstance().put(Constant.QUERY_GOODS_TIME,TimeUtils.getNowMills())
+                                    goHomePage()
+                                } else {
+                                    viewModel.loadingDialogStatus.value =
+                                        TaskUiModel.failed(InteractiveException(errorMessage = "商品请求失败"))
+                                }
+                            }
+                        }else{
+                            //不请求商品信息时要把本地数据库的商品信息赋值给数据中心
+                            MyApplication.getInstance()?.futureManager?.putGoodsInfoAndQuotesList()
+                            goHomePage()
                         }
-
                     }
                 }
             }

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

@@ -58,9 +58,9 @@ class ContractDetailActivity : BaseActivity<ProcurementViewModel>() {
 
     private val tabsArray: List<String> by lazy {
         if (type == "1") {
-            arrayListOf("合同详情", "点价记", "结算记", "款项记", "发票记","入库记", "变更记录")
+            arrayListOf("合同详情", "点价记", "结算记", "款项记", "发票记","入库记", "变更记录")
         } else {
-            arrayListOf("合同详情", "点价记", "结算记", "款项记", "发票记","出库记", "变更记录")
+            arrayListOf("合同详情", "点价记", "结算记", "款项记", "发票记","出库记", "变更记录")
         }
 
     }