Bladeren bron

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

Liu.bolan 4 jaren geleden
bovenliggende
commit
270f64b930
15 gewijzigde bestanden met toevoegingen van 1091 en 40 verwijderingen
  1. 8 0
      RMA/app/src/main/AndroidManifest.xml
  2. 4 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsDetailData.kt
  3. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  4. 184 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/HnstMainFragment.kt
  5. 22 17
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java
  6. 173 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/AddBrandActivity.kt
  7. 15 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/AddMiddleGoodsNameActivity.kt
  8. 133 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ChangeGoodsActivity.kt
  9. 217 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ChangeGoodsParameterActivity.kt
  10. 131 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ChangeRateActivity.kt
  11. 75 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ModifyViewModel.kt
  12. 58 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/BrandViewHolder.kt
  13. 50 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/DemoViewHolder.kt
  14. 12 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/AddContractActivity.kt
  15. 7 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/PeriodAssociatedFragment.kt

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

@@ -504,6 +504,14 @@
         <!--    新增商品    -->
         <activity android:name=".view.base.home.commodity.modify.AddGoodsActivity"/>
 
+        <activity android:name=".view.base.home.commodity.modify.AddBrandActivity"/>
+
+        <activity android:name=".view.base.home.commodity.modify.ChangeGoodsActivity"/>
+
+        <activity android:name=".view.base.home.commodity.modify.ChangeGoodsParameterActivity"/>
+
+        <activity android:name=".view.base.home.commodity.modify.ChangeRateActivity"/>
+
     </application>
 
 </manifest>

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

@@ -34,7 +34,6 @@ data class DeliveryGoodsDetailData(
     val bdlst : List<Xhnrand>? = arrayListOf(),//品牌列表
     @SerializedName("wdlst")
     val wdlst : List<XhWrstandard>? = arrayListOf(),//品类(现货商品)列表
-
     @SerializedName("hedgeIsSelect")
     var hedgeIsSelect : Int = 1//套保是否展开
 ) : Parcelable{
@@ -212,17 +211,21 @@ data class XhMiddlergoods(
 data class Xhnrand(
     @SerializedName("brandid")
     val brandid : String? = "",//品牌id
+    @SerializedName("isvalid")
+    val isvalid : String? = "",//是否有效  0-无效 1-有效 无效 = 停用 , 有效=启用
     @SerializedName("brandname")
     val brandname : String? = ""//品牌名称
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
         parcel.writeString(brandid)
+        parcel.writeString(isvalid)
         parcel.writeString(brandname)
     }
 

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

@@ -15,9 +15,9 @@ object Constant {
 
 //    const val baseurl = "http://192.168.31.93:8080/cfg?key=test_93"//李倩企业风管 18611112222
 //    const val baseurl = "http://192.168.31.104:8080/cfg?key=test_104"//李倩云融 18611112222
-//    const val baseurl = "http://192.168.31.137:8080/cfg?key=test_137"//李倩云融 18611112222
+    const val baseurl = "http://192.168.31.203:8080/cfg?key=test_203"//李倩云融 18611112222
 //
-    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 190000000001 123456
+//    const val baseurl = "http://192.168.31.204:8080/cfg?key=test_204"// 瑶姐 云融 190000000001 123456
 
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"

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

@@ -282,6 +282,11 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                         }.lparams(matchParent, autoSize(360))
 
                         linearLayout {
+                            if (SPUtils.getInstance().getString(Constant.oem) == "tjmd") {
+                                visibility = View.GONE
+                            } else {
+                                visibility = View.VISIBLE
+                            }
                             verticalLayout {
                                 onThrottleFirstClick {
                                     val intent = Intent()
@@ -449,6 +454,185 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                             }.lparams(0, autoSize(200), 1f)
                         }.lparams(matchParent, autoSize(200))
 
+                        //狗屎一样的设计,,,,,fuck
+                        linearLayout {
+                            if (SPUtils.getInstance().getString(Constant.oem) == "tjmd") {
+                                visibility = View.VISIBLE
+                            } else {
+                                visibility = View.GONE
+                            }
+
+                            verticalLayout {
+                                gravity = Gravity.LEFT
+                                textView {
+                                    if (SPUtils.getInstance().getString(Constant.oem) == "tjmd") {
+                                        text = "净值"
+                                    } else {
+                                        text = "总市值"
+                                    }
+                                    textSizeAuto = 29
+                                    textColorStr = "#A1B1C5"
+                                }.lparams(wrapContent, wrapContent) {
+                                    topMargin = autoSize(36)
+                                    marginStart = autoSize(36)
+                                }
+
+                                textView {
+                                    /**
+                                     * 合约市值
+                                     */
+                                    viewModel.usedAccountData.bindOptional(context) {
+                                        if (isOpenEye.value == true) {
+                                            if (SPUtils.getInstance()
+                                                    .getString(Constant.oem) == "tjmd"
+                                            ) {
+                                                val parmasvalue =
+                                                    GlobalDataCollection.instance?.getSystemParamsValue(
+                                                        "307"
+                                                    )
+                                                if (parmasvalue == "1") {//1.净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
+                                                    text = NumberUtils.roundNum(
+                                                        NumberUtils.doubleDistortion(
+                                                            it?.currentbalance?.plus(
+                                                                it.valueOfposition
+                                                            )
+                                                                ?.plus(it.valueOfposition_keep_watch_profit_and_loss)
+                                                                ?.minus(it.otherfreezemargin)
+                                                                ?.minus(it.outamountfreeze)
+                                                                .toString()
+                                                        ), 2
+                                                    )
+                                                } else {//0.净值=期末余额+市值+浮动盈亏(收益权)
+                                                    text = NumberUtils.roundNum(
+                                                        NumberUtils.doubleDistortion(
+                                                            it?.currentbalance?.plus(
+                                                                it.valueOfposition
+                                                            )
+                                                                ?.plus(it.valueOfposition_keep_watch_profit_and_loss)
+                                                                .toString()
+                                                        ), 2
+                                                    )
+                                                }
+                                            }else{
+                                                text = NumberUtils.roundNum(
+                                                    NumberUtils.doubleDistortion(
+                                                        it?.valueOfposition?.minus(it.raisedAmount)
+                                                            ?.plus(it.currentbalance).toString()
+                                                    ), 2
+                                                )
+                                            }
+                                        } else {
+                                            text = "****"
+                                        }
+                                    }
+                                    textSizeAuto = 34
+                                    textColorStr = "#FF1414"
+                                }.lparams(wrapContent, wrapContent) {
+                                    topMargin = autoSize(10)
+                                    marginStart = autoSize(36)
+                                }
+                            }.lparams(0, autoSize(200), 1f)
+
+                            verticalLayout {
+                                onThrottleFirstClick {
+                                    val intent = Intent()
+                                    intent.setClass(context, RydzAccountActivity::class.java)
+                                    ActivityUtils.startActivity(intent)
+                                }
+                                gravity = Gravity.LEFT
+                                textView {
+                                    text = "余额"
+                                    textSizeAuto = 29
+                                    textColorStr = "#A1B1C5"
+                                }.lparams(wrapContent, wrapContent) {
+                                    marginStart = autoSize(36)
+                                    topMargin = autoSize(36)
+                                }
+
+                                textView {
+                                    /**
+                                     * 金额=总市值-融资额+余额;
+                                     */
+                                    viewModel.usedAccountData.bindOptional(context) {
+                                        if (isOpenEye.value == true) {
+                                            text = NumberUtils.roundNum(
+                                                it?.currentbalance?.toString(),
+                                                2
+                                            )
+                                        } else {
+                                            text = "****"
+                                        }
+
+                                    }
+                                    textSizeAuto = 34
+                                    textColorStr = "#00C280"
+                                }.lparams(wrapContent, wrapContent) {
+                                    marginStart = autoSize(36)
+                                    topMargin = autoSize(10)
+                                }
+                            }.lparams(0, autoSize(200), 1f)
+
+                            verticalLayout {
+                                gravity = Gravity.LEFT
+                                textView {
+                                    text = "可用"
+                                    textSizeAuto = 29
+                                    textColorStr = "#A1B1C5"
+                                }.lparams(wrapContent, wrapContent) {
+                                    topMargin = autoSize(36)
+                                }
+
+                                textView {
+                                    /**
+                                     * 当总盈亏为负时
+                                     * 可用=期末余额+总浮动盈亏-占用-冻结-其他冻结-手续费冻结-出金冻结
+                                     * 当总盈亏为正时
+                                     * 可用=期末余额-占用-冻结-其他冻结-手续费冻结-出金冻结
+                                     */
+                                    viewModel.usedAccountData.bindOptional(context) {
+                                        if (isOpenEye.value == true) {
+                                            if (it?.valueOfposition_keep_watch_profit_and_loss ?: 0.0 > 0) {
+                                                val parmasvalue =
+                                                    GlobalDataCollection.instance?.getSystemParamsValue(
+                                                        "113"
+                                                    )
+                                                if (parmasvalue == "1") {
+                                                    text = NumberUtils.roundNum(
+                                                        NumberUtils.doubleDistortion(
+                                                            it?.canUserAmount?.plus(
+                                                                it.valueOfposition_keep_watch_profit_and_loss
+                                                            )?.toString()
+                                                        ), 2
+                                                    )
+                                                } else if (parmasvalue == "0") {
+                                                    text = NumberUtils.roundNum(
+                                                        NumberUtils.doubleDistortion(it?.canUserAmount?.toString()),
+                                                        2
+                                                    )
+                                                }
+                                            } else {
+                                                text = NumberUtils.roundNum(
+                                                    NumberUtils.doubleDistortion(
+                                                        it?.canUserAmount?.plus(
+                                                            it.valueOfposition_keep_watch_profit_and_loss
+                                                        )?.toString()
+                                                    ), 2
+                                                )
+                                            }
+                                        } else {
+                                            text = "****"
+                                        }
+                                    }
+                                    textSizeAuto = 34
+                                    textColorStr = "#FF1414"
+                                }.lparams(wrapContent, wrapContent) {
+                                    topMargin = autoSize(10)
+                                }
+                            }.lparams(0, autoSize(200), 1f)
+
+
+                        }.lparams(matchParent, autoSize(200))
+
                         linearLayout {
                             if (SPUtils.getInstance().getString(Constant.oem) == "tjmd") {
                                 visibility = View.VISIBLE

+ 22 - 17
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java

@@ -75,18 +75,18 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         notifyDataSetChanged();
     }
 
-    private void setOnItemClick(int position){
+    private void setOnItemClick(int position) {
         List<ContractTradePositionData> newDataList = new ArrayList<>();
-        for (int i = 0;i < datas.size();i++){
-            if (position == i){
+        for (int i = 0; i < datas.size(); i++) {
+            if (position == i) {
                 ContractTradePositionData data1 = datas.get(i);
-                if (data1.isOnClick() == 0){
+                if (data1.isOnClick() == 0) {
                     data1.setOnClick(1);
-                }else {
+                } else {
                     data1.setOnClick(0);
                 }
                 newDataList.add(data1);
-            }else {
+            } else {
                 ContractTradePositionData newData = datas.get(i);
                 newData.setOnClick(0);
                 newDataList.add(newData);
@@ -129,7 +129,7 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         for (int j = 0; j < quotesList.size(); j++) {
             if (data.getMarketid().startsWith("16")) {
                 //日了狗,16市场的用本身的goodscode
-                if (data.getGoodscode().equals(quotesList.get(j).getOutgoodscode())){
+                if (data.getGoodscode().equals(quotesList.get(j).getOutgoodscode())) {
                     quoteDayData = quotesList.get(j).getQuoteDayData();//赋值当前商品的盘面信息
                 }
             } else {
@@ -154,10 +154,10 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         //冻结数量
         rightData.add(data.getFrozenqty());
         //持仓均价
-        if (data.getAverageprice().equals("0")){
+        if (data.getAverageprice().equals("0")) {
             rightData.add("--");
-        }else {
-            rightData.add(NumberUtils.roundNum(data.getAverageprice(),goodsInfo.getDecimalplace()));
+        } else {
+            rightData.add(NumberUtils.roundNum(data.getAverageprice(), goodsInfo.getDecimalplace()));
         }
         if (quoteDayData != null) {
             //现价
@@ -169,13 +169,18 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
             //持仓金额
             rightData.add(NumberUtils.roundNum(data.getCurholderamount(), 2));
             //市值
-            if (quoteDayData.getPrice() == 0.0) {
+            if (data.getTradeproperty().equals("1")) {
+                if (quoteDayData.getPrice() == 0.0) {
+                    rightData.add("--");
+                } else {
+                    rightData.add(NumberUtils.roundNum(Double.valueOf(data.getCurpositionqty()) * Double.valueOf(data.getAgreeunit()) * quoteDayData.getPrice(), 2));
+                }
+            }else {
                 rightData.add("--");
-            } else {
-                rightData.add(NumberUtils.roundNum(Double.valueOf(data.getCurpositionqty()) * Double.valueOf(data.getAgreeunit()) *  quoteDayData.getPrice(),2));
             }
+
             //占用保证金
-            rightData.add(NumberUtils.roundNum(data.getUsedmargin(),2));
+            rightData.add(NumberUtils.roundNum(data.getUsedmargin(), 2));
             //计算成本价
             double closePrice = (Double.parseDouble(data.getAverageprice()));
             //计算出成本价和现价的价差
@@ -267,15 +272,15 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
 
         if (data.getTrademode().equals("46")) {
             if (Double.parseDouble(data.getCurpositionqty()) > 0) {
-                if (GlobalDataCollection.Companion.getInstance().getLoginQueryData().getUserInfo().getUsertype() == 5){
+                if (GlobalDataCollection.Companion.getInstance().getLoginQueryData().getUserInfo().getUsertype() == 5) {
                     itemViewHolder.to_unwind.setVisibility(View.VISIBLE);
-                }else {
+                } else {
                     itemViewHolder.to_unwind.setVisibility(View.GONE);
                 }
 
                 itemViewHolder.agreement_to_unwind.setVisibility(View.VISIBLE);
                 itemViewHolder.warehouse_register.setVisibility(View.GONE);
-            }else {
+            } else {
                 itemViewHolder.to_unwind.setVisibility(View.GONE);
                 itemViewHolder.agreement_to_unwind.setVisibility(View.GONE);
                 itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);

+ 173 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/AddBrandActivity.kt

@@ -0,0 +1,173 @@
+package cn.muchinfo.rma.view.base.home.commodity.modify
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import android.widget.Toast
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.DeliveryGoodsDetailData
+import cn.muchinfo.rma.global.data.Xhnrand
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI3
+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.verticalEmptyView
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+
+/**
+ * 添加品牌页面/修改品牌页面/停用品牌页面/恢复品牌页面
+ */
+class AddBrandActivity : BaseActivity<ModifyViewModel>(){
+
+    //1 是新增 2是修改 3是停用 4是恢复
+    val type by lazy { intent.getStringExtra("type") }
+
+    //传入的商品模型
+    val deliveryGoodsDetailData by lazy { intent.getParcelableExtra<DeliveryGoodsDetailData>("deliveryGoodsDetailData") as DeliveryGoodsDetailData }
+
+    val data by lazy { intent.getParcelableExtra<Xhnrand>("data") as Xhnrand }
+
+    //输入的品牌名称
+    lateinit var brand_input_name : EditText
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    if (type == "1"){
+                        text = "新增品牌"
+                    }else if (type == "2"){
+                        text = "修改品牌"
+                    }else if (type == "3"){
+                        text = "停用品牌"
+                    }else{
+                        text = "恢复品牌"
+                    }
+                }
+            }
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "品种"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = deliveryGoodsDetailData.deliverygoodsname
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "品牌名称"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    if (type == "3" || type == "4"){
+                        isEnabled = false
+                    }
+                    if (type != "1"){
+                        setText(data.brandname)
+                    }
+                    brand_input_name = this
+                    hint = "请输入品牌名称"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            verticalEmptyView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    onThrottleFirstClick {
+                        if (brand_input_name.text.toString().isNullOrEmpty()){
+                            ToastUtils.showLong("品牌名称不能为空")
+                            return@onThrottleFirstClick
+                        }
+                        if (type == "1"){//新增
+                            viewModel.dgFactoryItemOperateCommonReq(type = 1,glddgfactoryItems = getBrandNameData()){
+                                finish()
+                            }
+                        }else if (type == "2"){//修改
+                            viewModel.dgFactoryItemOperateCommonReq(deliverygoodsid = deliveryGoodsDetailData.deliverygoodsid?.toLong() ?: 0,type = 2,glddgfactoryItems = getBrandNameData()){
+                                finish()
+                            }
+                        }else if (type == "3"){//停用
+                            viewModel.dgFactoryItemOperateCommonReq(deliverygoodsid = deliveryGoodsDetailData.deliverygoodsid?.toLong() ?: 0,type = 3,glddgfactoryItems = getBrandNameData()){
+                                finish()
+                            }
+                        }else{//恢复
+                            viewModel.dgFactoryItemOperateCommonReq(deliverygoodsid = deliveryGoodsDetailData.deliverygoodsid?.toLong() ?: 0,type = 4,glddgfactoryItems = getBrandNameData()){
+                                finish()
+                            }
+                        }
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "确定"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(0, autoSize(119),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(144))
+        }
+    }
+
+    /**
+     * 获取品牌信息
+     * @return ManageServiceMI3.GLDDGFactoryItemEx
+     */
+    private fun getBrandNameData() : ManageServiceMI3.GLDDGFactoryItemEx{
+        val spotGoodsData = ManageServiceMI3.GLDDGFactoryItemEx.newBuilder()
+        if (type != "1"){
+            spotGoodsData.dgfactoryitemid = data.brandid?.toLong() ?: 0
+        }
+        spotGoodsData.dgfactoryitemvalue = brand_input_name.text.toString()
+        return spotGoodsData.build()
+    }
+}

+ 15 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/AddMiddleGoodsNameActivity.kt

@@ -36,6 +36,7 @@ class AddMiddleGoodsNameActivity : BaseActivity<ModifyViewModel>(){
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            viewModel.queryMiddleGodsDataList()
             background = resources.getDrawable(R.color.segtabment_bg_color)
             topBar {
                 commonLeftButton()
@@ -87,17 +88,17 @@ class AddMiddleGoodsNameActivity : BaseActivity<ModifyViewModel>(){
                             bottomMargin = autoSize(240)
                         }
 
-//                        viewModel.deliveryDataList.bindOptional(context) {
-//                            if (it?.isEmpty() == true || it?.size == 0) {
-//                                statusLayout.showEmpty()
-//                            } else {
-//                                if (swipeToLayout.getIsRefreshing()) {
-//                                    swipeToLayout.finishRefresh()
-//                                }
-//                                statusLayout.showSuccess()
-//                                deliveryAdapter.setNewData(it)
-//                            }
-//                        }
+                        viewModel.middleGoodsDataList.bindOptional(context) {
+                            if (it?.isEmpty() == true || it?.size == 0) {
+                                statusLayout.showEmpty()
+                            } else {
+                                if (swipeToLayout.getIsRefreshing()) {
+                                    swipeToLayout.finishRefresh()
+                                }
+                                statusLayout.showSuccess()
+                                deliveryAdapter.setNewData(it)
+                            }
+                        }
                     }
                 }
 
@@ -141,6 +142,9 @@ class SelectMiddleGoodsViewHolder(private val activty : AppCompatActivity,privat
     override fun _FrameLayout.createContentView() {
         verticalLayout {
             linearLayout {
+                onThrottleFirstClick {
+                    viewModel.setOnMiddleGoodsNameItemClick(data.value?.middlegoodsid ?: "")
+                }
                 gravity = Gravity.CENTER_VERTICAL
 
                 imageView {

+ 133 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ChangeGoodsActivity.kt

@@ -0,0 +1,133 @@
+package cn.muchinfo.rma.view.base.home.commodity.modify
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import cn.muchinfo.rma.R
+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.verticalEmptyView
+import org.jetbrains.anko.*
+
+/**
+ * 修改商品
+ * @property goods_name EditText
+ */
+class ChangeGoodsActivity : BaseActivity<ModifyViewModel>(){
+
+    //输入的商品名称
+    lateinit var goods_name : EditText
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "修改商品"
+                }
+            }
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "品种"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = "铜"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "品牌名称"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    goods_name = this
+                    hint = "请输入品牌名称"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "单位"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = "吨"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            verticalEmptyView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "确定"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(0, autoSize(119),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(144))
+
+        }
+    }
+
+}

+ 217 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ChangeGoodsParameterActivity.kt

@@ -0,0 +1,217 @@
+package cn.muchinfo.rma.view.base.home.commodity.modify
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.MTPEnums
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import org.jetbrains.anko.*
+
+/**
+ * 修改商品参数页面
+ */
+@Suppress("DEPRECATION")
+class ChangeGoodsParameterActivity : BaseActivity<ModifyViewModel>(){
+
+    val parameterType : MutableLiveData<SelectData> = MutableLiveData()
+
+    //输入的设置值
+    lateinit var set_value : EditText
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "修改商品参数"
+                }
+            }
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "商品名称"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = "铜"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "套保品种"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = "铜"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "单位"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = "吨"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+                    val selectDataList = arrayListOf(
+                        SelectData(
+                            id = "2",
+                            value = "折算系数"
+                        ),
+                        SelectData(
+                            id = "3",
+                            value = "成本权重"
+                        )
+                    )
+                    creatBottomSheetDialog("请选择合同类型", selectDataList) {
+                        parameterType.postValue(this)
+                    }
+                }
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+
+                textView {
+                    text = "参数类别"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                textView {
+                    parameterType.bindOptional(context) {
+                        text = it?.value
+                        textColorInt = R.color.rma_black_33
+                    }
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(80)
+                }
+
+                emptyView()
+
+                imageView {
+                    imageResource = R.mipmap.rma_more
+                }.lparams(autoSize(36), autoSize(36)) {
+                    marginEnd = autoSize(25)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "设置值"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    set_value = this
+                    hint = "请输入设置值"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            verticalEmptyView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "确定"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(0, autoSize(119),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(144))
+        }
+    }
+
+}

+ 131 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ChangeRateActivity.kt

@@ -0,0 +1,131 @@
+package cn.muchinfo.rma.view.base.home.commodity.modify
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import cn.muchinfo.rma.R
+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.verticalEmptyView
+import org.jetbrains.anko.*
+
+/**
+ * 修改税率页面
+ */
+class ChangeRateActivity : BaseActivity<ModifyViewModel>(){
+
+    //输入增值税税率
+    lateinit var rate_input_edittext : EditText
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "修改商品"
+                }
+            }
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "商品名称"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = "铜"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "单位"
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(250), autoSize(132))
+
+                textView {
+                    text = "吨"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "增值税税率%"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    rate_input_edittext = this
+                    hint = "请输入品牌名称"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            verticalEmptyView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "确定"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(0, autoSize(119),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(144))
+        }
+    }
+
+}

+ 75 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/modify/ModifyViewModel.kt

@@ -1,12 +1,87 @@
 package cn.muchinfo.rma.view.base.home.commodity.modify
 
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.MiddleGoodsData
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI3
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 用于商品信息内各种信息修改的viewmodel
  */
 class ModifyViewModel : BaseViewModel(){
 
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
 
+    //可供选择的套保品种
+    val middleGoodsDataList : MutableLiveData<List<MiddleGoodsData>> = MutableLiveData()
+
+    fun queryMiddleGodsDataList(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            put("status","1")
+        }
+        MyApplication.getInstance()?.commodityManager?.queryMiddleGoods(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                middleGoodsDataList.postValue(respData)
+            }
+        }
+    }
+
+    //新增套保品种的列表的点击选择
+    fun setOnMiddleGoodsNameItemClick(middlegoodsid : String){
+        val newDataList = arrayListOf<MiddleGoodsData>()
+        middleGoodsDataList.value?.forEach {
+            if (middlegoodsid == it.middlegoodsid){
+                if (it.isClick == 0){
+                    newDataList.add(it.copy(isClick = 1))
+                }else{
+                    newDataList.add(it.copy(isClick = 0))
+                }
+            }else{
+                newDataList.add(it)
+            }
+        }
+    }
+
+    /**
+     * 现货品牌操作请求
+     */
+    fun dgFactoryItemOperateCommonReq(
+        deliverygoodsid : Long = 0,//交割商品id(修改时有值)
+        type : Int = 0,//类型 1 新增 2 修改 3 停用  4 恢复
+        glddgfactoryItems : ManageServiceMI3.GLDDGFactoryItemEx,//现货商品品牌数据
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.commodityManager?.dgFactoryItemOperateCommonReq(
+                deliverygoodsid = deliverygoodsid,
+                type = type,
+                glddgfactoryItems = glddgfactoryItems
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
 
 }

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

@@ -1,23 +1,80 @@
 package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 
+import android.content.Intent
+import android.graphics.Color
 import android.view.Gravity
+import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.DeliveryGoodsDetailData
 import cn.muchinfo.rma.global.data.Ermcp3Brand
 import cn.muchinfo.rma.global.data.Xhnrand
 import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.ListPopWindow
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.home.commodity.modify.AddBrandActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.registration.InvoiceRegistrationActivity
+import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
-class BrandViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<Xhnrand>(activity){
+class BrandViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel,private val deliveryGoodsDetailData : DeliveryGoodsDetailData): BaseViewHolder<Xhnrand>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
+
+
     override fun _FrameLayout.createContentView() {
         linearLayout {
+            setOnLongClickListener {
+                if (data.value?.isvalid == "0"){
+                    ListPopWindow.Builder(attachView = this,backgroundColor = Color.parseColor("#ffffff"),textColor = "#368FDF",isShowMark = false)
+                        .addMenuItem(ListPopWindow.IconParam( title = "修改", onItemClickListener = {
+                            val intent = Intent()
+                            intent.putExtra("type","2")
+                            intent.putExtra("deliveryGoodsDetailData",deliveryGoodsDetailData)
+                            intent.putExtra("data",data.value)
+                            intent.setClass(context,AddBrandActivity::class.java)
+                            ActivityUtils.startActivity(intent)
+                        }))
+                        .addMenuItem(ListPopWindow.IconParam( title = "恢复", onItemClickListener = {
+                            val intent = Intent()
+                            intent.putExtra("type","4")
+                            intent.putExtra("deliveryGoodsDetailData",deliveryGoodsDetailData)
+                            intent.putExtra("data",data.value)
+                            intent.setClass(context,AddBrandActivity::class.java)
+                            ActivityUtils.startActivity(intent)
+                        }))
+                        .build()
+                        .show()
+                }else{
+                    ListPopWindow.Builder(attachView = this,backgroundColor = Color.parseColor("#ffffff"),textColor = "#368FDF",isShowMark = false)
+                        .addMenuItem(ListPopWindow.IconParam( title = "修改", onItemClickListener = {
+                            val intent = Intent()
+                            intent.putExtra("type","2")
+                            intent.putExtra("deliveryGoodsDetailData",deliveryGoodsDetailData)
+                            intent.putExtra("data",data.value)
+                            intent.setClass(context,AddBrandActivity::class.java)
+                            ActivityUtils.startActivity(intent)
+                        }))
+                        .addMenuItem(ListPopWindow.IconParam( title = "停用", onItemClickListener = {
+                            val intent = Intent()
+                            intent.putExtra("type","3")
+                            intent.putExtra("deliveryGoodsDetailData",deliveryGoodsDetailData)
+                            intent.putExtra("data",data.value)
+                            intent.setClass(context,AddBrandActivity::class.java)
+                            ActivityUtils.startActivity(intent)
+                        }))
+                        .build()
+                        .show()
+                }
+
+                false
+            }
+
             backgroundResource = R.drawable.rma_list_item_bg
             gravity = Gravity.CENTER_VERTICAL
             //品牌名称

+ 50 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/DemoViewHolder.kt

@@ -4,6 +4,7 @@ import android.content.Intent
 import android.view.Gravity
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.RecyclerView
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.*
@@ -13,12 +14,14 @@ 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.CommodityMiddleViewHolder
+import cn.muchinfo.rma.view.base.home.commodity.modify.AddBrandActivity
 import cn.muchinfo.rma.view.base.home.commodity.newspot.NewAddSpotGoodsActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
+import org.jetbrains.anko.recyclerview.v7._RecyclerView
 
 class DemoViewHolder(
     private val activity: AppCompatActivity,
@@ -27,13 +30,15 @@ class DemoViewHolder(
 
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
+    lateinit var brand_RecyclerView: RecyclerView
+
     //品类adapter(商品--第一版就是叫商品,后来改为品类,现在又改回商品,,,,,甚是无语)
     private val spotCategoryAdapter: BaseAdapter<XhWrstandard, SpotCategoryViewHolder> =
         BaseAdapter { _, _ -> SpotCategoryViewHolder(activity, viewModel,dataIndex) }
 
     //品牌adapter
-    private val brandAdapter: BaseAdapter<Xhnrand, BrandViewHolder> =
-        BaseAdapter { _, _ -> BrandViewHolder(activity, viewModel) }
+//    private val brandAdapter: BaseAdapter<Xhnrand, BrandViewHolder> =
+//        BaseAdapter { _, _ -> BrandViewHolder(activity, viewModel) }
 
     override fun _FrameLayout.createContentView() {
         verticalLayout {
@@ -177,7 +182,42 @@ class DemoViewHolder(
                     marginEnd = autoSize(24)
                 }
 
+
                 textView {
+                    visibility = View.GONE
+                    onThrottleFirstClick {
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "添加商品"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    visibility = View.GONE
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","1")
+                        intent.putExtra("deliveryGoodsDetailData",data.value)
+                        intent.putExtra("data",Xhnrand())
+                        intent.setClass(context, AddBrandActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "添加品牌"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(160), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    visibility = View.GONE
                     onThrottleFirstClick {
                         val intent = Intent()
                         intent.putExtra("type","4")
@@ -240,14 +280,18 @@ class DemoViewHolder(
                         } else {
                             visibility = View.VISIBLE
                         }
+                        val brandAdapter: BaseAdapter<Xhnrand, BrandViewHolder> =
+                            BaseAdapter { _, _ -> BrandViewHolder(activity, viewModel,data.value ?: DeliveryGoodsDetailData()) }
+                        adapter = brandAdapter
+                        brandAdapter.setNewData(it?.bdlst)
                     }
                     background = resources.getDrawable(R.color.white)
-                    adapter = brandAdapter
+
                 }.lparams(matchParent, wrapContent)
+//
+//                data.bindOptional(context) {
 
-                data.bindOptional(context) {
-                    brandAdapter.setNewData(it?.bdlst)
-                }
+//                }
 
                 linearLayout {
                     gravity = Gravity.CENTER_VERTICAL

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

@@ -1556,7 +1556,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
                                 }
                             }
                             textView {
-                                visibility = View.INVISIBLE
+
                                 text = "*"
                                 textColorInt = R.color.rma_star_color
                                 textSizeAuto = 31
@@ -1656,7 +1656,7 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
                                 }
                             }
                             textView {
-                                visibility = View.INVISIBLE
+
                                 text = "*"
                                 textColorInt = R.color.rma_star_color
                                 textSizeAuto = 31
@@ -1950,6 +1950,16 @@ class AddContractActivity : BaseActivity<ContractViewModel>() {
             }
         }
 
+        if (selectSalesman.value?.id.isNullOrEmpty()){
+            ToastUtils.showLong("请选择业务员")
+            return false
+        }
+
+        if (selectTradingData.value?.id.isNullOrEmpty()){
+            ToastUtils.showLong("请选择交易员")
+            return false
+        }
+
         if (selelctCurreryId.value?.id.isNullOrEmpty()) {
             ToastUtils.showLong("请选择结算币种")
             return false

+ 7 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/spot/associated/PeriodAssociatedFragment.kt

@@ -398,6 +398,13 @@ class ExternalOrderAssociationUI(
             }.lparams(matchParent, autoSize(100))
 
             statusLayout(contentBlock = {
+                setRetryAction {
+                    viewModel.queryOutTradeLink(
+                        outtradeid = order_in_edittext.text.toString(),
+                        goodsname = code_in_edittext.text.toString(),
+                        hasinnerorder = seleAssociatedType.value?.id ?: "0"
+                    )
+                }
                 statusLayout = this
                 swipeToLoadLayout {
                     swipeToLayout = this