Browse Source

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

Liu.bolan 4 years ago
parent
commit
87fdb02bb4

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

@@ -1,10 +1,15 @@
 package cn.muchinfo.rma.business.warehouse
 
-import cn.muchinfo.rma.global.data.AreaStockData
-import cn.muchinfo.rma.global.data.BusinessData
-import cn.muchinfo.rma.global.data.WarehouseInfoData
+import cn.muchinfo.rma.business.contract.adapter.ContractAdapter
+import cn.muchinfo.rma.business.warehouse.adapter.WarehouseAdapter
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
+import cn.muchinfo.rma.netcore.packet.Packet50
+import cn.muchinfo.rma.netcore.socket.Callback
+import cn.muchinfo.rma.protobuf.funcode.FunCode
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.guard
 import cn.muchinfo.rma.view.base.app.BaseResult
 import cn.muchinfo.rma.view.base.app.Constant
 import com.blankj.utilcode.util.SPUtils
@@ -67,4 +72,352 @@ class WarehouseManager {
     }
 
 
+    /**
+     * 查询库存申请(出入库记录|库存审核)
+     * @param params Map<String, String>
+     *     userid 用户ID
+     *     inouttype 出入库类型(可多项,逗号隔开) 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+     *     spotcontractid 合同ID
+     *     wrstandardid 现货商品ID
+     *     spotgoodsbrandid 品牌ID
+     *     spotgoodsmodelid 型号ID
+     *     warehouseinfoid 仓库ID
+     *     applystatus 申请状态(可多项,逗号隔开)1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<BusinessData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryAreaStockApply(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AreaStockApplyData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockApply",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AreaStockApplyData>>>() {
+                override fun onResponse(response: BaseResult<List<AreaStockApplyData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+
+    /**
+     * 查询已登记出入库信息(入库登记/已入库信息 | 出库登记/已出库信息)
+     * @param params Map<String, String>
+     *     spotcontractid 合同ID
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<BusinessData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryAreaStockApplySum(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AreaStockApplySumData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockApplySum",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AreaStockApplySumData>>>() {
+                override fun onResponse(
+                    response: BaseResult<List<AreaStockApplySumData>>?,
+                    id: Int
+                ) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+
+    /**
+     * 查询库存报表
+     * @param params Map<String, String>
+     *     userid 用户ID
+     *     querytype 查询类型 1-日报表 2-月报表
+     *     querydate 查询日期(格式 日报表YYYYMMDD, 月报表YYYYMM)
+     *     wrstandardid 现货商品ID
+     *     spotgoodsbrandid 品牌ID
+     *     spotgoodsmodelid 型号ID
+     *     warehouseinfoid 仓库ID
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<BusinessData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryAreaStockReport(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AreaStockReportData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockReport",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AreaStockReportData>>>() {
+                override fun onResponse(response: BaseResult<List<AreaStockReportData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+
+    /**
+     * 查询已登记出入库信息(入库登记/已入库信息 | 出库登记/已出库信息)
+     * @param params Map<String, String>
+     *     userid 用户ID
+     *     querytype 查询类型 1-日报表明细 2-月报表明细
+     *     detailtype 明细类型 1:入库明细(采购入库+生产入库) 2:出库明细(销售出库+生产出库)
+     *     querydate 查询日期(格式 日报表YYYYMMDD, 月报表YYYYMM)
+     *     wrstandardid 现货商品ID
+     *     spotgoodsbrandid 品牌ID
+     *     spotgoodsmodelid 型号ID
+     *     warehouseinfoid 仓库ID
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<BusinessData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryAreaStockReportDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AreaStockReportDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAreaStockReportDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AreaStockReportDetailData>>>() {
+                override fun onResponse(
+                    response: BaseResult<List<AreaStockReportDetailData>>?,
+                    id: Int
+                ) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+    /**
+     * 机构出入库申请请求
+     * @param InOutType Int int32 出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+     * @param WRStandardID Long uint64 现货商品ID
+     * @param SpotGoodsModelID Long uint64 现货型号ID
+     * @param SpotGoodsBrandID Long uint64 现货品牌ID
+     * @param DeliveryGoodsID Long uint64 现货品种ID
+     * @param SpotContractID Long uint64 关联现货合同ID [1:采购入库 2:销售出库 ](1,2状态必填)
+     * @param WarehouseInfo Long uint64 现货仓库ID
+     * @param Qty Double double 数量
+     * @param ApplyId Long uint64 申请人
+     * @param ApplyRemark String string 申请备注
+     */
+    fun areaInOutStockApplyReq(
+        InOutType: Int = 0,
+        WRStandardID: Long = 0L,
+        SpotGoodsModelID: Long = 0L,
+        SpotGoodsBrandID: Long = 0L,
+        DeliveryGoodsID: Long = 0L,
+        SpotContractID: Long = 0L,
+        WarehouseInfo: Long = 0L,
+        Qty: Double,
+        ApplyId: Long,
+        ApplyRemark: String = "",
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ) {
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = WarehouseAdapter.getAreaInOutStockApplyReqInfo(
+            InOutType,
+            WRStandardID,
+            SpotGoodsModelID,
+            SpotGoodsBrandID,
+            DeliveryGoodsID,
+            SpotContractID,
+            WarehouseInfo,
+            Qty,
+            ApplyId,
+            ApplyRemark
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.SpotContractOperateRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = WarehouseAdapter.analysisAreaInOutStockApplyRsq(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
+     * 机构出入库申请审核拒绝撤回请求报文装箱
+     * @param InOutApplyID Long uint64 申请ID
+     * @param AuditID Long uint64 审核人
+     * @param AuditRemark String string 审核备注
+     * @param AuditTradeDate String string 审核交易日(yyyyMMdd)
+     * @param ApplyStatus Int int32 审核状态:3-审核拒绝 5-已撤回
+     */
+    fun auditAreaInOutStockApplyReq(
+        InOutApplyID: Long,
+        AuditID: Long,
+        AuditRemark: String = "",
+        AuditTradeDate: String = "",
+        ApplyStatus: Int,
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ) {
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+
+        val reqPacket = WarehouseAdapter.getAuditAreaInOutStockApplyReqInfo(
+            InOutApplyID,
+            AuditID,
+            AuditRemark,
+            AuditTradeDate,
+            ApplyStatus
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.SpotContractOperateRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = WarehouseAdapter.analysisAuditAreaInOutStockApplyRsq(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
+     * 仓库申请请求
+     * @param type Int int32 类型 1 新增 2 修改
+     * @param warehouseid Long uint64 仓库ID
+     * @param warehousecode String string 仓库代码
+     * @param warehousename String string 仓库名称
+     * @param warehousetype Int int32 仓库类型 - 1 厂库  2 自有库  3 合作库
+     * @param provinceid Long uint64 省
+     * @param cityid Long uint64 市
+     * @param districtid Int int32 区
+     * @param address String string 详细地址
+     * @param contactname String string 联系人
+     * @param contactnum String string 联系电话
+     * @return Packet50
+     */
+    fun warehouseApplyReq(
+        type: Int,
+        warehouseid: Long,
+        warehousecode: String,
+        warehousename: String,
+        warehousetype: Int,
+        provinceid: Long = 0L,
+        cityid: Long = 0L,
+        districtid: Int = 0,
+        address: String = "",
+        contactname: String = "",
+        contactnum: String = "",
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ) {
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+        val reqPacket = WarehouseAdapter.getWarehouseApplyReqInfo(
+            type,
+            warehouseid,
+            warehousecode,
+            warehousename,
+            warehousetype,
+            provinceid,
+            cityid,
+            districtid,
+            address,
+            contactname,
+            contactnum
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.SpotContractOperateRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = WarehouseAdapter.analysisWarehouseApplyRsq(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+
+    }
+
+    /**
+     * 仓库状态修改请求
+     * @param warehouseid Long uint64 仓库ID
+     * @param warehousestatus Int int32 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+     * @return Packet50
+     */
+    fun warehouseStateChangeReq(
+        warehouseid : Long,
+        warehousestatus : Int,
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ){
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+        val reqPacket = WarehouseAdapter.getWarehouseStateChangeReqInfo(warehouseid, warehousestatus)
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.SpotContractOperateRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = WarehouseAdapter.analysisWarehouseStateChangeRsq(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+
 }

+ 310 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/adapter/WarehouseAdapter.kt

@@ -0,0 +1,310 @@
+package cn.muchinfo.rma.business.warehouse.adapter
+
+import cn.muchinfo.rma.business.global.MessageHeadModel
+import cn.muchinfo.rma.global.ErrorMessageUtils
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.netcore.packet.Packet50
+import cn.muchinfo.rma.protobuf.funcode.FunCode
+import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
+import com.google.common.math.IntMath
+import java.io.ByteArrayOutputStream
+import java.lang.Exception
+
+object WarehouseAdapter {
+
+    /**
+     * 机构出入库申请请求报文装箱
+     * @param InOutType Int int32 出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+     * @param WRStandardID Long uint64 现货商品ID
+     * @param SpotGoodsModelID Long uint64 现货型号ID
+     * @param SpotGoodsBrandID Long uint64 现货品牌ID
+     * @param DeliveryGoodsID Long uint64 现货品种ID
+     * @param SpotContractID Long uint64 关联现货合同ID [1:采购入库 2:销售出库 ](1,2状态必填)
+     * @param WarehouseInfo Long uint64 现货仓库ID
+     * @param Qty Double double 数量
+     * @param ApplyId Long uint64 申请人
+     * @param ApplyRemark String string 申请备注
+     */
+    fun getAreaInOutStockApplyReqInfo(
+        InOutType : Int = 0,
+        WRStandardID : Long = 0L,
+        SpotGoodsModelID : Long = 0L,
+        SpotGoodsBrandID : Long = 0L,
+        DeliveryGoodsID : Long = 0L,
+        SpotContractID : Long = 0L,
+        WarehouseInfo : Long = 0L,
+        Qty : Double,
+        ApplyId : Long,
+        ApplyRemark : String = ""
+    ) : Packet50{
+
+        val builder = ManageServiceMI2.ERMCPAreaInOutStockApplyReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        // TODO 这里的funcode需要更新相应的操作
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.ContractOperateApplyReq,
+                loginInfo.userID,
+                GlobalDataCollection.instance?.accountId ?: 0,
+                0,
+                18
+            )
+        )
+        builder.userID = loginInfo.userID.toLong()
+        if (InOutType != 0){
+            builder.inOutType = InOutType
+        }
+        if (WRStandardID != 0L){
+            builder.wrStandardID = WRStandardID
+        }
+        if (SpotGoodsModelID != 0L){
+            builder.spotGoodsModelID = SpotGoodsModelID
+        }
+
+        if (SpotGoodsBrandID != 0L){
+            builder.spotGoodsBrandID = SpotGoodsBrandID
+        }
+
+        if (DeliveryGoodsID != 0L){
+            builder.deliveryGoodsID = DeliveryGoodsID
+        }
+        if (SpotContractID != 0L){
+            builder.spotContractID = SpotContractID
+        }
+        if (WarehouseInfo != 0L){
+            builder.warehouseInfo = WarehouseInfo
+        }
+        builder.qty = Qty
+        builder.applyId = ApplyId
+        builder.applyRemark = ApplyRemark
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.ContractOperateApplyReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 机构出入库申请请求报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ERMCPAreaInOutStockApplyRsp?>
+     */
+    fun analysisAreaInOutStockApplyRsq(packet50: Packet50) : Triple<Boolean, Error?, ManageServiceMI2.ERMCPAreaInOutStockApplyRsp?> {
+
+        return try {
+            val loginRsp = ManageServiceMI2.ERMCPAreaInOutStockApplyRsp.parseFrom(packet50.content)
+            if (loginRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, loginRsp)
+            } else {
+                // 操作失败
+                Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
+
+    /**
+     * 机构出入库申请审核拒绝撤回请求报文装箱
+     * @param InOutApplyID Long uint64 申请ID
+     * @param AuditID Long uint64 审核人
+     * @param AuditRemark String string 审核备注
+     * @param AuditTradeDate String string 审核交易日(yyyyMMdd)
+     * @param ApplyStatus Int int32 审核状态:3-审核拒绝 5-已撤回
+     */
+    fun getAuditAreaInOutStockApplyReqInfo(
+        InOutApplyID : Long,
+        AuditID : Long,
+        AuditRemark : String = "",
+        AuditTradeDate : String = "",
+        ApplyStatus : Int
+    ) : Packet50{
+        val builder = ManageServiceMI2.AuditERMCPAreaInOutStockApplyReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        // TODO 这里的funcode需要更新相应的操作
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.ContractOperateApplyReq,
+                loginInfo.userID,
+                GlobalDataCollection.instance?.accountId ?: 0,
+                0,
+                18
+            )
+        )
+        builder.inOutApplyID = InOutApplyID
+        builder.auditID = AuditID
+        builder.auditRemark = AuditRemark
+        builder.auditTradeDate = AuditTradeDate
+        builder.applyStatus = ApplyStatus
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.ContractOperateApplyReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 机构出入库申请审核拒绝撤回请求报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ERMCPAreaInOutStockApplyRsp?>
+     */
+    fun analysisAuditAreaInOutStockApplyRsq(packet50: Packet50) : Triple<Boolean, Error?, ManageServiceMI2.AuditERMCPAreaInOutStockApplyRsp?> {
+
+        return try {
+            val loginRsp = ManageServiceMI2.AuditERMCPAreaInOutStockApplyRsp.parseFrom(packet50.content)
+            if (loginRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, loginRsp)
+            } else {
+                // 操作失败
+                Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
+
+    /**
+     * 仓库申请请求报文装箱
+     * @param type Int int32 类型 1 新增 2 修改
+     * @param warehouseid Long uint64 仓库ID
+     * @param warehousecode String string 仓库代码
+     * @param warehousename String string 仓库名称
+     * @param warehousetype Int int32 仓库类型 - 1 厂库  2 自有库  3 合作库
+     * @param provinceid Long uint64 省
+     * @param cityid Long uint64 市
+     * @param districtid Int int32 区
+     * @param address String string 详细地址
+     * @param contactname String string 联系人
+     * @param contactnum String string 联系电话
+     * @return Packet50
+     */
+    fun getWarehouseApplyReqInfo(
+        type : Int,
+        warehouseid : Long,
+        warehousecode : String,
+        warehousename : String,
+        warehousetype : Int,
+        provinceid : Long = 0L,
+        cityid : Long = 0L,
+        districtid : Int = 0,
+        address : String = "",
+        contactname : String = "",
+        contactnum : String = ""
+    ) : Packet50{
+
+        val builder = ManageServiceMI2.WarehouseApplyReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        // TODO 这里的funcode需要更新相应的操作
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.ContractOperateApplyReq,
+                loginInfo.userID,
+                GlobalDataCollection.instance?.accountId ?: 0,
+                0,
+                18
+            )
+        )
+        builder.type = type
+        builder.warehouseid = warehouseid
+        builder.warehousecode = warehousecode
+        builder.warehousename = warehousename
+        builder.warehousetype = warehousetype
+
+        if (provinceid != 0L){
+            builder.provinceid = provinceid
+        }
+        if (cityid != 0L){
+            builder.cityid = cityid
+        }
+        if (districtid != 0){
+            builder.districtid = districtid
+        }
+        if (address.isNotEmpty()){
+            builder.address = address
+        }
+        if (contactname.isNotEmpty()){
+            builder.contactname = contactname
+        }
+        if (contactnum.isNotEmpty()){
+            builder.contactnum = contactnum
+        }
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.ContractOperateApplyReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 仓库申请请求报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.AuditERMCPAreaInOutStockApplyRsp?>
+     */
+    fun analysisWarehouseApplyRsq(packet50: Packet50) : Triple<Boolean, Error?, ManageServiceMI2.WarehouseApplyRsp?> {
+
+        return try {
+            val loginRsp = ManageServiceMI2.WarehouseApplyRsp.parseFrom(packet50.content)
+            if (loginRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, loginRsp)
+            } else {
+                // 操作失败
+                Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
+
+    /**
+     * 仓库状态修改请求报文装箱
+     * @param warehouseid Long uint64 仓库ID
+     * @param warehousestatus Int int32 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+     * @return Packet50
+     */
+    fun getWarehouseStateChangeReqInfo(
+        warehouseid : Long,
+        warehousestatus : Int
+    ) : Packet50{
+        val builder = ManageServiceMI2.WarehouseStateChangeReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        // TODO 这里的funcode需要更新相应的操作
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.ContractOperateApplyReq,
+                loginInfo.userID,
+                GlobalDataCollection.instance?.accountId ?: 0,
+                0,
+                18
+            )
+        )
+        builder.warehouseid = warehouseid
+        builder.warehousestatus = warehousestatus
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.ContractOperateApplyReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 仓库状态修改请求报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.WarehouseStateChangeRsp?>
+     */
+    fun analysisWarehouseStateChangeRsq(packet50: Packet50) : Triple<Boolean, Error?, ManageServiceMI2.WarehouseStateChangeRsp?> {
+
+        return try {
+            val loginRsp = ManageServiceMI2.WarehouseStateChangeRsp.parseFrom(packet50.content)
+            if (loginRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, loginRsp)
+            } else {
+                // 操作失败
+                Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
+
+}

+ 186 - 40
RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaStockApplyData.kt

@@ -1,43 +1,189 @@
 package cn.muchinfo.rma.global.data
 
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 查询库存申请(出入库记录|库存审核)实体
+ * @property applyid String?
+ * @property applyname String?
+ * @property applyremark String?
+ * @property applysrc String?
+ * @property applystatus String?
+ * @property applytime String?
+ * @property auditid String?
+ * @property auditname String?
+ * @property auditremark String?
+ * @property auditsrc String?
+ * @property audittime String?
+ * @property audittradedate String?
+ * @property brandname String?
+ * @property buyuserid String?
+ * @property buyusername String?
+ * @property contractno String?
+ * @property contractqty String?
+ * @property contracttype String?
+ * @property deliverygoodsid String?
+ * @property enumdicname String?
+ * @property inoutapplyid String?
+ * @property inouttype String?
+ * @property modelname String?
+ * @property pricetype String?
+ * @property qty String?
+ * @property selluserid String?
+ * @property sellusername String?
+ * @property spotcontractid String?
+ * @property spotgoodsbrandid String?
+ * @property spotgoodsmodelid String?
+ * @property unitid String?
+ * @property userid String?
+ * @property warehousecode String?
+ * @property warehouseinfoid String?
+ * @property warehousename String?
+ * @property warehousetype String?
+ * @property wrstandardcode String?
+ * @property wrstandardid String?
+ * @property wrstandardname String?
+ * @constructor
+ */
 data class AreaStockApplyData(
-    val applyid : String? = "",
-    val applyname : String? = "",
-    val applyremark : String? = "",
-    val applysrc : String? = "",
-    val applystatus : String? = "",
-    val applytime : String? = "",
-    val auditid : String? = "",
-    val auditname : String? = "",
-    val auditremark : String? = "",
-    val auditsrc : String? = "",
-    val audittime : String? = "",
-    val audittradedate : String? = "",
-    val brandname : String? = "",
-    val buyuserid : String? = "",
-    val buyusername : String? = "",
-    val contractno : String? = "",
-    val contractqty : String? = "",
-    val contracttype : String? = "",
-    val deliverygoodsid : String? = "",
-    val enumdicname : String? = "",
-    val inoutapplyid : String? = "",
-    val inouttype : String? = "",
-    val modelname : String? = "",
-    val pricetype : String? = "",
-    val qty : String? = "",
-    val selluserid : String? = "",
-    val sellusername : String? = "",
-    val spotcontractid : String? = "",
-    val spotgoodsbrandid : String? = "",
-    val spotgoodsmodelid : String? = "",
-    val unitid : String? = "",
-    val userid : String? = "",
-    val warehousecode : String? = "",
-    val warehouseinfoid : String? = "",
-    val warehousename : String? = "",
-    val warehousetype : String? = "",
-    val wrstandardcode : String? = "",
-    val wrstandardid : String? = "",
-    val wrstandardname : String? = ""
-)
+    val applyid : String? = "",//申请人
+    val applyname : String? = "",//申请人名称
+    val applyremark : String? = "",//申请备注
+    val applysrc : String? = "",//申请来源 - 1:管理端 2:终端
+    val applystatus : String? = "",//申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+    val applytime : String? = "",//申请时间
+    val auditid : String? = "",//审核人
+    val auditname : String? = "",//审核人名称
+    val auditremark : String? = "",//审核备注
+    val auditsrc : String? = "",//审核来源 - 1:管理端 2:终端
+    val audittime : String? = "",//审核时间
+    val audittradedate : String? = "",//审核交易日(yyyyMMdd)
+    val brandname : String? = "",//品牌名称
+    val buyuserid : String? = "",//采购方userid
+    val buyusername : String? = "",//采购方名称
+    val contractno : String? = "",//合同编号
+    val contractqty : String? = "",//合同量
+    val contracttype : String? = "",//现货合同类型 - 1:采购 -1:销售
+    val deliverygoodsid : String? = "",//现货品种ID
+    val enumdicname : String? = "",//现货商品单位名称
+    val inoutapplyid : String? = "",//申请ID(607+Unix秒时间戳(10位)+xxxxxx)
+    val inouttype : String? = "",//出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+    val modelname : String? = "",//型号名称
+    val pricetype : String? = "",//定价类型 - 1:一口价 2:点价 3:暂定价
+    val qty : String? = "",//数量
+    val selluserid : String? = "",//销售方userid
+    val sellusername : String? = "",//销售方名称
+    val spotcontractid : String? = "",//关联现货合同ID
+    val spotgoodsbrandid : String? = "",//现货品牌ID
+    val spotgoodsmodelid : String? = "",//现货型号ID
+    val unitid : String? = "",//单位id
+    val userid : String? = "",//机构ID
+    val warehousecode : String? = "",//仓库代码
+    val warehouseinfoid : String? = "",//现货仓库ID
+    val warehousename : String? = "",//仓库名称
+    val warehousetype : String? = "",//仓库类型 - 1 厂库 2 自有库 3 合作库
+    val wrstandardcode : String? = "",//现货商品代码
+    val wrstandardid : String? = "",//现货商品ID
+    val wrstandardname : String? = ""//现货商品名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(applyid)
+        parcel.writeString(applyname)
+        parcel.writeString(applyremark)
+        parcel.writeString(applysrc)
+        parcel.writeString(applystatus)
+        parcel.writeString(applytime)
+        parcel.writeString(auditid)
+        parcel.writeString(auditname)
+        parcel.writeString(auditremark)
+        parcel.writeString(auditsrc)
+        parcel.writeString(audittime)
+        parcel.writeString(audittradedate)
+        parcel.writeString(brandname)
+        parcel.writeString(buyuserid)
+        parcel.writeString(buyusername)
+        parcel.writeString(contractno)
+        parcel.writeString(contractqty)
+        parcel.writeString(contracttype)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(enumdicname)
+        parcel.writeString(inoutapplyid)
+        parcel.writeString(inouttype)
+        parcel.writeString(modelname)
+        parcel.writeString(pricetype)
+        parcel.writeString(qty)
+        parcel.writeString(selluserid)
+        parcel.writeString(sellusername)
+        parcel.writeString(spotcontractid)
+        parcel.writeString(spotgoodsbrandid)
+        parcel.writeString(spotgoodsmodelid)
+        parcel.writeString(unitid)
+        parcel.writeString(userid)
+        parcel.writeString(warehousecode)
+        parcel.writeString(warehouseinfoid)
+        parcel.writeString(warehousename)
+        parcel.writeString(warehousetype)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AreaStockApplyData> {
+        override fun createFromParcel(parcel: Parcel): AreaStockApplyData {
+            return AreaStockApplyData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AreaStockApplyData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,53 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 查询已登记出入库信息(入库登记/已入库信息 | 出库登记/已出库信息)实体
+ */
+data class AreaStockApplySumData(
+    val brandname : String? = "",//品牌名称
+    val inouttype : String? = "",//出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+    val modelname : String? = "",//型号名称
+    val spotcontractid : String? = "",//关联现货合同ID
+    val spotgoodsbrandid : String? = "",//品牌id
+    val spotgoodsmodelid : String? = "",//型号id
+    val totalqty : String? = ""//总数量
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(brandname)
+        parcel.writeString(inouttype)
+        parcel.writeString(modelname)
+        parcel.writeString(spotcontractid)
+        parcel.writeString(spotgoodsbrandid)
+        parcel.writeString(spotgoodsmodelid)
+        parcel.writeString(totalqty)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AreaStockApplySumData> {
+        override fun createFromParcel(parcel: Parcel): AreaStockApplySumData {
+            return AreaStockApplySumData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AreaStockApplySumData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,101 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 库存报表实体
+ */
+data class AreaStockReportData(
+    val brandname : String? = "",//品牌名称
+    val curstock : String? = "",//期末库存量
+    val deliverygoodsid : String? = "",//现货品种ID
+    val enumdicname : String? = "",//单位名称
+    val modelname : String? = "",//型号名称
+    val oristock : String? = "",//期初库存量
+    val spotgoodsbrandid : String? = "",//现货品牌ID
+    val spotgoodsmodelid : String? = "",//现货型号ID
+    val todaybuyinqty : String? = "",//今日采购入库量
+    val todayproduceinqty : String? = "",//今日生产入库量
+    val todayproduceoutqty : String? = "",//今日生产出库量
+    val todayselloutqty : String? = "",//今日销售出库量
+    val unitid : String? = "",//单位id
+    val updatetime : String? = "",//更新时间
+    val userid : String? = "",//机构ID
+    val username : String? = "",//机构名称
+    val warehousecode : String? = "",//仓库代码
+    val warehouseinfoid : String? = "",//仓库ID
+    val warehousename : String? = "",//仓库名称
+    val warehousetype : String? = "",//仓库类型 - 1 厂库 2 自有库 3 合作库
+    val wrstandardcode : String? = "",//现货商品代码
+    val wrstandardid : String? = "",//现货商品ID
+    val wrstandardname : String? = ""//现货商品名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(brandname)
+        parcel.writeString(curstock)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(enumdicname)
+        parcel.writeString(modelname)
+        parcel.writeString(oristock)
+        parcel.writeString(spotgoodsbrandid)
+        parcel.writeString(spotgoodsmodelid)
+        parcel.writeString(todaybuyinqty)
+        parcel.writeString(todayproduceinqty)
+        parcel.writeString(todayproduceoutqty)
+        parcel.writeString(todayselloutqty)
+        parcel.writeString(unitid)
+        parcel.writeString(updatetime)
+        parcel.writeString(userid)
+        parcel.writeString(username)
+        parcel.writeString(warehousecode)
+        parcel.writeString(warehouseinfoid)
+        parcel.writeString(warehousename)
+        parcel.writeString(warehousetype)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AreaStockReportData> {
+        override fun createFromParcel(parcel: Parcel): AreaStockReportData {
+            return AreaStockReportData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AreaStockReportData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,149 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 库存报表明细实体
+ */
+data class AreaStockReportDetailData(
+    val applyid : String? = "",//申请人
+    val applyname : String? = "",//申请人名称
+    val applyremark : String? = "",//申请备注
+    val applysrc : String? = "",//申请来源 - 1:管理端 2:终端
+    val applystatus : String? = "",////申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+    val applytime : String? = "",//申请时间
+    val auditid : String? = "",//审核人
+    val auditname : String? = "",//审核人名称
+    val auditremark : String? = "",//审核备注
+    val auditsrc : String? = "",//审核来源 - 1:管理端 2:终端
+    val audittime : String? = "",//审核时间
+    val audittradedate : String? = "",//审核交易日(yyyyMMdd)
+    val brandname : String? = "",//品牌名称
+    val buyuserid : String? = "",//采购方userid
+    val buyusername : String? = "",//采购方名称
+    val contractno : String? = "",//合同编号
+    val contractqty : String? = "",//合同量
+    val contracttype : String? = "",//现货合同类型 - 1:采购 -1:销售
+    val deliverygoodsid : String? = "",//现货品种ID
+    val enumdicname : String? = "",//现货商品单位名称
+    val inoutapplyid : String? = "",//申请ID(607+Unix秒时间戳(10位)+xxxxxx)
+    val inouttype : String? = "",//出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+    val modelname : String? = "",//型号名称
+    val pricetype : String? = "",//定价类型 - 1:一口价 2:点价 3:暂定价
+    val qty : String? = "",//数量
+    val selluserid : String? = "",//销售方userid
+    val sellusername : String? = "",//销售方名称
+    val spotcontractid : String? = "",//关联现货合同ID
+    val spotgoodsbrandid : String? = "",//现货品牌ID
+    val spotgoodsmodelid : String? = "",//现货型号ID
+    val unitid : String? = "",//单位id
+    val userid : String? = "",//机构ID
+    val warehousecode : String? = "",//仓库代码
+    val warehouseinfoid : String? = "",//现货仓库ID
+    val warehousename : String? = "",//仓库名称
+    val warehousetype : String? = "",//仓库类型 - 1 厂库 2 自有库 3 合作库
+    val wrstandardcode : String? = "",//现货商品代码
+    val wrstandardid : String? = "",//现货商品ID
+    val wrstandardname : String? = ""//现货商品名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(applyid)
+        parcel.writeString(applyname)
+        parcel.writeString(applyremark)
+        parcel.writeString(applysrc)
+        parcel.writeString(applystatus)
+        parcel.writeString(applytime)
+        parcel.writeString(auditid)
+        parcel.writeString(auditname)
+        parcel.writeString(auditremark)
+        parcel.writeString(auditsrc)
+        parcel.writeString(audittime)
+        parcel.writeString(audittradedate)
+        parcel.writeString(brandname)
+        parcel.writeString(buyuserid)
+        parcel.writeString(buyusername)
+        parcel.writeString(contractno)
+        parcel.writeString(contractqty)
+        parcel.writeString(contracttype)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(enumdicname)
+        parcel.writeString(inoutapplyid)
+        parcel.writeString(inouttype)
+        parcel.writeString(modelname)
+        parcel.writeString(pricetype)
+        parcel.writeString(qty)
+        parcel.writeString(selluserid)
+        parcel.writeString(sellusername)
+        parcel.writeString(spotcontractid)
+        parcel.writeString(spotgoodsbrandid)
+        parcel.writeString(spotgoodsmodelid)
+        parcel.writeString(unitid)
+        parcel.writeString(userid)
+        parcel.writeString(warehousecode)
+        parcel.writeString(warehouseinfoid)
+        parcel.writeString(warehousename)
+        parcel.writeString(warehousetype)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AreaStockReportDetailData> {
+        override fun createFromParcel(parcel: Parcel): AreaStockReportDetailData {
+            return AreaStockReportDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AreaStockReportDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 8 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarket.kt

@@ -71,13 +71,14 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
             val goodsgroupid = GlobalDataCollection.instance?.loginQueryData?.goodsgroups?.find {
                 it.exexchangeid == data.autoid
             }?.goodsgroupid
-            if (Builder.getDatabase<AppDatabase>().goodsInfoDao.getGoodsGroups(
-                    goodsgroupid ?: 0
-                ).isNotEmpty()){
-                val item = builder?.setText(data.exexchangename)?.build(context)
-                idFutureTab?.addTab(item)
-                tabFragments.add(MarketFragment.getInstance(data))
-            }
+            val item = builder?.setText(data.exexchangename)?.build(context)
+            idFutureTab?.addTab(item)
+            tabFragments.add(MarketFragment.getInstance(data))
+//            if (Builder.getDatabase<AppDatabase>().goodsInfoDao.getGoodsGroups(
+//                    goodsgroupid ?: 0
+//                ).isNotEmpty()){
+//
+//            }
         }
 
 

+ 398 - 335
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/HomeFragment.kt

@@ -5,10 +5,7 @@ import android.content.Intent
 import android.graphics.Rect
 import android.net.Uri
 import android.os.Bundle
-import android.view.Gravity
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
+import android.view.*
 import android.widget.ImageView
 import androidx.appcompat.app.AppCompatActivity
 import androidx.cardview.widget.CardView
@@ -70,6 +67,8 @@ class HomeFragment : BaseFragment<HomeViewModel>() {
     private val researchReportUI: ResearchReportUI by lazy { ResearchReportUI(this, viewModel) }//研报
     private val informationUI: InformationUI by lazy { InformationUI(this, viewModel) }//咨讯
 
+    var isScrollIndexX = 0.0//记录首页导航菜单滚动的位置
+
     /**
      * 用户未读标识
      */
@@ -258,354 +257,418 @@ class HomeFragment : BaseFragment<HomeViewModel>() {
 
                             }.lparams(matchParent, autoSize(400))
 
-                            linearLayout {
-                                relativeLayout {
-
-                                    verticalLayout {
-                                        onThrottleFirstClick {
-                                            val intent = Intent()
-                                            intent.setClass(
-                                                context,
-                                                CustomerDataActivity::class.java
-                                            )
-                                            ActivityUtils.startActivity(intent)
-                                        }
-                                        imageView {
-//                                        userImage = this
-//                                        userqBadgeView.bindTarget(userImage).setBadgeBackground(resources.getDrawable(R.drawable.hn_main_cercle_red_bg)).setBadgeGravity(Gravity.TOP or Gravity.END).setGravityOffset(80f,0f,false).setBadgeText("10")
-                                            imageResource = R.mipmap.main_business_1
-                                        }.lparams(autoSize(72), autoSize(72)) {
-                                            gravity = Gravity.CENTER_HORIZONTAL
-                                        }
-
-                                        textView {
-                                            text = "客户资料"
-                                            textColorInt = R.color.black
-                                            textSizeAuto = 26
-                                        }.lparams(wrapContent, wrapContent) {
-                                            topMargin = autoSize(20)
-                                            gravity = Gravity.CENTER_HORIZONTAL
-                                        }
-                                    }.lparams(matchParent, matchParent)
-
-                                    textView {
-                                        visibility = View.GONE
-                                        viewModel.pendingAudit.bindOptional(context) {
-                                            if (it?.userqty?.toInt() ?: 0 > 99){
-                                                text = "99+"
-                                            }else{
-                                                text = it?.userqty.toString()
-                                            }
-                                            if (it?.userqty?.toInt() == 0) {
-                                                visibility = View.GONE
-                                            } else {
-                                                visibility = View.VISIBLE
-                                            }
-                                        }
-                                        textColorInt = R.color.p_global_write_color
-                                        textSizeAuto = 15
-                                        setPadding(
-                                            autoSize(10),
-                                            autoSize(6),
-                                            autoSize(10),
-                                            autoSize(6)
-                                        )
-                                        backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
-                                    }.lparams(wrapContent, wrapContent) {
-                                        marginStart = autoSize(130)
-                                    }
-                                }.lparams(0, matchParent, 1f)
-
-
-                                verticalLayout {
-                                    onThrottleFirstClick {
-                                        val intent = Intent()
-                                        intent.setClass(
-                                            context,
-                                            CommodityInformationActivity::class.java
-                                        )
-                                        ActivityUtils.startActivity(intent)
-                                    }
-                                    imageView {
-                                        imageResource = R.mipmap.main_business_2
-                                    }.lparams(autoSize(72), autoSize(72)) {
-                                        gravity = Gravity.CENTER_HORIZONTAL
-                                    }
+                            var startX = 0f
+                            var endX = 0f
+
+                            horizontalScrollView {
+                                setOnScrollChangeListener(object : View.OnScrollChangeListener {
+                                    override fun onScrollChange(
+                                        p0: View?,
+                                        p1: Int,
+                                        p2: Int,
+                                        p3: Int,
+                                        p4: Int
+                                    ) {
+                                        val scrollRect = Rect()
+                                        getHitRect(scrollRect)
+                                        LogUtils.eTag("adakhsfkjahsfa11111111", "x = " + p1 + "y = " + p2)
 
-                                    textView {
-                                        text = "商品信息"
-                                        textColorInt = R.color.black
-                                        textSizeAuto = 26
-                                    }.lparams(wrapContent, wrapContent) {
-                                        topMargin = autoSize(20)
-                                        gravity = Gravity.CENTER_HORIZONTAL
                                     }
-                                }.lparams(0, matchParent, 1f)
+                                })
 
-                                relativeLayout {
-                                    verticalLayout {
-                                        onThrottleFirstClick {
-                                            val intent = Intent()
-                                            intent.setClass(context, ContractActivity::class.java)
-                                            ActivityUtils.startActivity(intent)
-                                        }
-                                        imageView {
-                                            imageResource = R.mipmap.main_business_3
-                                        }.lparams(autoSize(72), autoSize(72)) {
-                                            gravity = Gravity.CENTER_HORIZONTAL
+                                setOnTouchListener(object : View.OnTouchListener{
+                                    override fun onTouch(p0: View?, p1: MotionEvent?): Boolean {
+                                        if (p1?.action == MotionEvent.ACTION_DOWN){
+                                            startX = p1.x
+                                        }else if (p1?.action == MotionEvent.ACTION_UP){
+                                            endX = p1.x
                                         }
 
-                                        textView {
-                                            text = "现货合同"
-                                            textColorInt = R.color.black
-                                            textSizeAuto = 26
-                                        }.lparams(wrapContent, wrapContent) {
-                                            gravity = Gravity.CENTER_HORIZONTAL
-                                            topMargin = autoSize(20)
-                                        }
-                                    }.lparams(matchParent, matchParent)
-
-                                    textView {
-                                        visibility = View.GONE
-                                        viewModel.pendingAudit.bindOptional(context) {
-                                            if (it?.spotcontractqty?.toInt() ?: 0 > 99){
-                                                text = "99+"
-                                            }else{
-                                                text = it?.spotcontractqty.toString()
-                                            }
-
-                                            if (it?.spotcontractqty?.toInt() == 0) {
-                                                visibility = View.GONE
-                                            } else {
-                                                visibility = View.VISIBLE
-                                            }
-                                        }
-                                        textColorInt = R.color.p_global_write_color
-                                        textSizeAuto = 15
-                                        setPadding(
-                                            autoSize(10),
-                                            autoSize(6),
-                                            autoSize(10),
-                                            autoSize(6)
-                                        )
-                                        backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
-                                    }.lparams(wrapContent, wrapContent) {
-
-                                        marginStart = autoSize(130)
-                                    }
-                                }.lparams(0, matchParent, 1f)
-
-                                relativeLayout {
-                                    verticalLayout {
-                                        onThrottleFirstClick {
-                                            val intent = Intent()
-                                            intent.setClass(context, HedgePlanActivity::class.java)
-                                            ActivityUtils.startActivity(intent)
-                                        }
-                                        imageView {
-                                            imageResource = R.mipmap.main_business_4
-                                        }.lparams(autoSize(72), autoSize(72)) {
-                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        if (startX.minus(endX) > 50){
+                                            LogUtils.eTag("asdhakjhfskjahsdjkas","右滑动" )
+                                        }else if (startX.minus(endX) < -50){
+                                            LogUtils.eTag("asdhakjhfskjahsdjkas","左滑动" )
                                         }
 
-                                        textView {
-                                            text = "套保计划"
-                                            textColorInt = R.color.black
-                                            textSizeAuto = 26
-                                        }.lparams(wrapContent, wrapContent) {
-                                            gravity = Gravity.CENTER_HORIZONTAL
-                                            topMargin = autoSize(20)
-                                        }
-                                    }.lparams(matchParent, matchParent)
-
-                                    textView {
-                                        visibility = View.GONE
-                                        viewModel.pendingAudit.bindOptional(context) {
-
-                                            if (it?.hedgeplanqty?.toInt() ?: 0 > 99){
-                                                text = "99+"
-                                            }else{
-                                                text = it?.hedgeplanqty.toString()
-                                            }
-                                            if (it?.hedgeplanqty?.toInt() == 0) {
-                                                visibility = View.GONE
-                                            } else {
-                                                visibility = View.VISIBLE
-                                            }
-                                        }
-                                        textColorInt = R.color.p_global_write_color
-                                        textSizeAuto = 15
-                                        setPadding(
-                                            autoSize(10),
-                                            autoSize(6),
-                                            autoSize(10),
-                                            autoSize(6)
-                                        )
-                                        backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
-                                    }.lparams(wrapContent, wrapContent) {
-                                        marginStart = autoSize(130)
+                                        return false
                                     }
-                                }.lparams(0, matchParent, 1f)
-
-                            }.lparams(matchParent, autoSize(140)) {
-                                topMargin = autoSize(40)
-                            }
-
-                            linearLayout {
-                                relativeLayout {
+                                })
+                                linearLayout {
                                     verticalLayout {
-                                        onThrottleFirstClick {
-                                            val intent = Intent()
-                                            intent.setClass(
-                                                context,
-                                                BusinessManagementActivity::class.java
-                                            )
-                                            ActivityUtils.startActivity(intent)
-                                        }
-                                        imageView {
-                                            imageResource = R.mipmap.main_business_5
-                                        }.lparams(autoSize(72), autoSize(72)) {
-                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        linearLayout {
+                                            relativeLayout {
+
+                                                verticalLayout {
+                                                    onThrottleFirstClick {
+                                                        val intent = Intent()
+                                                        intent.setClass(
+                                                            context,
+                                                            CustomerDataActivity::class.java
+                                                        )
+                                                        ActivityUtils.startActivity(intent)
+                                                    }
+                                                    imageView {
+                                                        imageResource = R.mipmap.main_business_1
+                                                    }.lparams(autoSize(72), autoSize(72)) {
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+
+                                                    textView {
+                                                        text = "客户资料"
+                                                        textColorInt = R.color.black
+                                                        textSizeAuto = 26
+                                                    }.lparams(wrapContent, wrapContent) {
+                                                        topMargin = autoSize(20)
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+                                                }.lparams(matchParent, matchParent)
+
+                                                textView {
+                                                    visibility = View.GONE
+                                                    viewModel.pendingAudit.bindOptional(context) {
+                                                        if (it?.userqty?.toInt() ?: 0 > 99) {
+                                                            text = "99+"
+                                                        } else {
+                                                            text = it?.userqty.toString()
+                                                        }
+                                                        if (it?.userqty?.toInt() == 0) {
+                                                            visibility = View.GONE
+                                                        } else {
+                                                            visibility = View.VISIBLE
+                                                        }
+                                                    }
+                                                    textColorInt = R.color.p_global_write_color
+                                                    textSizeAuto = 15
+                                                    setPadding(
+                                                        autoSize(10),
+                                                        autoSize(6),
+                                                        autoSize(10),
+                                                        autoSize(6)
+                                                    )
+                                                    backgroundDrawable =
+                                                        createRoundRectDrawable("#fe671a", 45)
+                                                }.lparams(wrapContent, wrapContent) {
+                                                    marginStart = autoSize(130)
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+
+
+                                            verticalLayout {
+                                                onThrottleFirstClick {
+                                                    val intent = Intent()
+                                                    intent.setClass(
+                                                        context,
+                                                        CommodityInformationActivity::class.java
+                                                    )
+                                                    ActivityUtils.startActivity(intent)
+                                                }
+                                                imageView {
+                                                    imageResource = R.mipmap.main_business_2
+                                                }.lparams(autoSize(72), autoSize(72)) {
+                                                    gravity = Gravity.CENTER_HORIZONTAL
+                                                }
+
+                                                textView {
+                                                    text = "商品信息"
+                                                    textColorInt = R.color.black
+                                                    textSizeAuto = 26
+                                                }.lparams(wrapContent, wrapContent) {
+                                                    topMargin = autoSize(20)
+                                                    gravity = Gravity.CENTER_HORIZONTAL
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+
+                                            relativeLayout {
+                                                verticalLayout {
+                                                    onThrottleFirstClick {
+                                                        val intent = Intent()
+                                                        intent.setClass(
+                                                            context,
+                                                            ContractActivity::class.java
+                                                        )
+                                                        ActivityUtils.startActivity(intent)
+                                                    }
+                                                    imageView {
+                                                        imageResource = R.mipmap.main_business_3
+                                                    }.lparams(autoSize(72), autoSize(72)) {
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+
+                                                    textView {
+                                                        text = "现货合同"
+                                                        textColorInt = R.color.black
+                                                        textSizeAuto = 26
+                                                    }.lparams(wrapContent, wrapContent) {
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                        topMargin = autoSize(20)
+                                                    }
+                                                }.lparams(matchParent, matchParent)
+
+                                                textView {
+                                                    visibility = View.GONE
+                                                    viewModel.pendingAudit.bindOptional(context) {
+                                                        if (it?.spotcontractqty?.toInt() ?: 0 > 99) {
+                                                            text = "99+"
+                                                        } else {
+                                                            text = it?.spotcontractqty.toString()
+                                                        }
+
+                                                        if (it?.spotcontractqty?.toInt() == 0) {
+                                                            visibility = View.GONE
+                                                        } else {
+                                                            visibility = View.VISIBLE
+                                                        }
+                                                    }
+                                                    textColorInt = R.color.p_global_write_color
+                                                    textSizeAuto = 15
+                                                    setPadding(
+                                                        autoSize(10),
+                                                        autoSize(6),
+                                                        autoSize(10),
+                                                        autoSize(6)
+                                                    )
+                                                    backgroundDrawable =
+                                                        createRoundRectDrawable("#fe671a", 45)
+                                                }.lparams(wrapContent, wrapContent) {
+
+                                                    marginStart = autoSize(130)
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+
+                                            relativeLayout {
+                                                verticalLayout {
+                                                    onThrottleFirstClick {
+                                                        val intent = Intent()
+                                                        intent.setClass(
+                                                            context,
+                                                            HedgePlanActivity::class.java
+                                                        )
+                                                        ActivityUtils.startActivity(intent)
+                                                    }
+                                                    imageView {
+                                                        imageResource = R.mipmap.main_business_4
+                                                    }.lparams(autoSize(72), autoSize(72)) {
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+
+                                                    textView {
+                                                        text = "套保计划"
+                                                        textColorInt = R.color.black
+                                                        textSizeAuto = 26
+                                                    }.lparams(wrapContent, wrapContent) {
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                        topMargin = autoSize(20)
+                                                    }
+                                                }.lparams(matchParent, matchParent)
+
+                                                textView {
+                                                    visibility = View.GONE
+                                                    viewModel.pendingAudit.bindOptional(context) {
+
+                                                        if (it?.hedgeplanqty?.toInt() ?: 0 > 99) {
+                                                            text = "99+"
+                                                        } else {
+                                                            text = it?.hedgeplanqty.toString()
+                                                        }
+                                                        if (it?.hedgeplanqty?.toInt() == 0) {
+                                                            visibility = View.GONE
+                                                        } else {
+                                                            visibility = View.VISIBLE
+                                                        }
+                                                    }
+                                                    textColorInt = R.color.p_global_write_color
+                                                    textSizeAuto = 15
+                                                    setPadding(
+                                                        autoSize(10),
+                                                        autoSize(6),
+                                                        autoSize(10),
+                                                        autoSize(6)
+                                                    )
+                                                    backgroundDrawable =
+                                                        createRoundRectDrawable("#fe671a", 45)
+                                                }.lparams(wrapContent, wrapContent) {
+                                                    marginStart = autoSize(130)
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+
+                                        }.lparams(matchParent, autoSize(140)) {
+                                            topMargin = autoSize(40)
                                         }
 
-                                        textView {
-                                            text = "业务审核"
-                                            textColorInt = R.color.black
-                                            textSizeAuto = 26
-                                        }.lparams(wrapContent, wrapContent) {
+                                        linearLayout {
+                                            relativeLayout {
+                                                verticalLayout {
+                                                    onThrottleFirstClick {
+                                                        val intent = Intent()
+                                                        intent.setClass(
+                                                            context,
+                                                            BusinessManagementActivity::class.java
+                                                        )
+                                                        ActivityUtils.startActivity(intent)
+                                                    }
+                                                    imageView {
+                                                        imageResource = R.mipmap.main_business_5
+                                                    }.lparams(autoSize(72), autoSize(72)) {
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+
+                                                    textView {
+                                                        text = "业务审核"
+                                                        textColorInt = R.color.black
+                                                        textSizeAuto = 26
+                                                    }.lparams(wrapContent, wrapContent) {
+                                                        topMargin = autoSize(20)
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+                                                }.lparams(matchParent, matchParent)
+
+                                                textView {
+                                                    visibility = View.GONE
+                                                    viewModel.pendingAudit.bindOptional(context) {
+                                                        val pty = it?.businessdjqty?.toInt()
+                                                            ?.plus(it.businessjsqty.toInt())
+                                                        if (pty ?: 0 > 99) {
+                                                            text = "99+"
+                                                        } else {
+                                                            text = pty.toString()
+                                                        }
+                                                        if (pty == 0) {
+                                                            visibility = View.GONE
+                                                        } else {
+                                                            visibility = View.VISIBLE
+                                                        }
+                                                    }
+                                                    textColorInt = R.color.p_global_write_color
+                                                    textSizeAuto = 15
+                                                    setPadding(
+                                                        autoSize(10),
+                                                        autoSize(6),
+                                                        autoSize(10),
+                                                        autoSize(6)
+                                                    )
+                                                    backgroundDrawable =
+                                                        createRoundRectDrawable("#fe671a", 45)
+                                                }.lparams(wrapContent, wrapContent) {
+                                                    marginStart = autoSize(130)
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+
+                                            relativeLayout {
+                                                verticalLayout {
+                                                    onThrottleFirstClick {
+                                                        val intent = Intent()
+                                                        intent.setClass(
+                                                            context,
+                                                            FinancialActivity::class.java
+                                                        )
+                                                        ActivityUtils.startActivity(intent)
+                                                    }
+                                                    imageView {
+                                                        imageResource = R.mipmap.main_business_6
+                                                    }.lparams(autoSize(72), autoSize(72)) {
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+
+                                                    textView {
+                                                        text = "财务审核"
+                                                        textColorInt = R.color.black
+                                                        textSizeAuto = 26
+                                                    }.lparams(wrapContent, wrapContent) {
+                                                        topMargin = autoSize(20)
+                                                        gravity = Gravity.CENTER_HORIZONTAL
+                                                    }
+                                                }.lparams(matchParent, matchParent)
+
+                                                textView {
+                                                    visibility = View.GONE
+                                                    viewModel.pendingAudit.bindOptional(context) {
+                                                        val pty = it?.businessfpqty?.toInt()
+                                                            ?.plus(it.businesskxqty.toInt())
+                                                        if (pty ?: 0 > 99) {
+                                                            text = "99+"
+                                                        } else {
+                                                            text = pty.toString()
+                                                        }
+                                                        if (pty == 0) {
+                                                            visibility = View.GONE
+                                                        } else {
+                                                            visibility = View.VISIBLE
+                                                        }
+                                                    }
+                                                    textColorInt = R.color.p_global_write_color
+                                                    textSizeAuto = 15
+                                                    setPadding(
+                                                        autoSize(10),
+                                                        autoSize(6),
+                                                        autoSize(10),
+                                                        autoSize(6)
+                                                    )
+                                                    backgroundDrawable =
+                                                        createRoundRectDrawable("#fe671a", 45)
+                                                }.lparams(wrapContent, wrapContent) {
+                                                    marginStart = autoSize(130)
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+
+                                            verticalLayout {
+                                                onThrottleFirstClick {
+                                                    val intent = Intent()
+                                                    intent.setClass(
+                                                        context,
+                                                        TradingQueryActivity::class.java
+                                                    )
+                                                    ActivityUtils.startActivity(intent)
+                                                }
+                                                imageView {
+                                                    imageResource = R.mipmap.main_business_7
+                                                }.lparams(autoSize(72), autoSize(72)) {
+                                                    gravity = Gravity.CENTER_HORIZONTAL
+                                                }
+
+                                                textView {
+                                                    text = "交易查询"
+                                                    textColorInt = R.color.black
+                                                    textSizeAuto = 26
+                                                }.lparams(wrapContent, wrapContent) {
+                                                    gravity = Gravity.CENTER_HORIZONTAL
+                                                    topMargin = autoSize(20)
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+                                            verticalLayout {
+                                                onThrottleFirstClick {
+                                                    val intent = Intent()
+                                                    intent.setClass(
+                                                        context,
+                                                        ReportQueryActivity::class.java
+                                                    )
+                                                    ActivityUtils.startActivity(intent)
+                                                }
+                                                imageView {
+                                                    imageResource = R.mipmap.main_business_8
+                                                }.lparams(autoSize(72), autoSize(72)) {
+                                                    gravity = Gravity.CENTER_HORIZONTAL
+                                                }
+
+                                                textView {
+                                                    text = "报表查询"
+                                                    textColorInt = R.color.black
+                                                    textSizeAuto = 26
+                                                }.lparams(wrapContent, wrapContent) {
+                                                    gravity = Gravity.CENTER_HORIZONTAL
+                                                    topMargin = autoSize(20)
+                                                }
+                                            }.lparams(0, matchParent, 1f)
+                                        }.lparams(matchParent, autoSize(140)) {
                                             topMargin = autoSize(20)
-                                            gravity = Gravity.CENTER_HORIZONTAL
                                         }
-                                    }.lparams(matchParent, matchParent)
-
-                                    textView {
-                                        visibility = View.GONE
-                                        viewModel.pendingAudit.bindOptional(context) {
-                                            val pty = it?.businessdjqty?.toInt()
-                                                ?.plus(it.businessjsqty.toInt())
-                                            if (pty ?: 0 > 99){
-                                                text = "99+"
-                                            }else{
-                                                text = pty.toString()
-                                            }
-                                            if (pty == 0) {
-                                                visibility = View.GONE
-                                            } else {
-                                                visibility = View.VISIBLE
-                                            }
-                                        }
-                                        textColorInt = R.color.p_global_write_color
-                                        textSizeAuto = 15
-                                        setPadding(
-                                            autoSize(10),
-                                            autoSize(6),
-                                            autoSize(10),
-                                            autoSize(6)
-                                        )
-                                        backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
-                                    }.lparams(wrapContent, wrapContent) {
-                                        marginStart = autoSize(130)
-                                    }
-                                }.lparams(0, matchParent, 1f)
-
-                                relativeLayout {
+                                    }.lparams(autoSize(900), autoSize(340))
                                     verticalLayout {
-                                        onThrottleFirstClick {
-                                            val intent = Intent()
-                                            intent.setClass(context, FinancialActivity::class.java)
-                                            ActivityUtils.startActivity(intent)
-                                        }
-                                        imageView {
-                                            imageResource = R.mipmap.main_business_6
-                                        }.lparams(autoSize(72), autoSize(72)) {
-                                            gravity = Gravity.CENTER_HORIZONTAL
-                                        }
 
-                                        textView {
-                                            text = "财务审核"
-                                            textColorInt = R.color.black
-                                            textSizeAuto = 26
-                                        }.lparams(wrapContent, wrapContent) {
-                                            topMargin = autoSize(20)
-                                            gravity = Gravity.CENTER_HORIZONTAL
-                                        }
-                                    }.lparams(matchParent, matchParent)
-
-                                    textView {
-                                        visibility = View.GONE
-                                        viewModel.pendingAudit.bindOptional(context) {
-                                            val pty = it?.businessfpqty?.toInt()
-                                                ?.plus(it.businesskxqty.toInt())
-                                            if (pty ?: 0 > 99){
-                                                text = "99+"
-                                            }else{
-                                                text = pty.toString()
-                                            }
-                                            if (pty == 0) {
-                                                visibility = View.GONE
-                                            } else {
-                                                visibility = View.VISIBLE
-                                            }
-                                        }
-                                        textColorInt = R.color.p_global_write_color
-                                        textSizeAuto = 15
-                                        setPadding(
-                                            autoSize(10),
-                                            autoSize(6),
-                                            autoSize(10),
-                                            autoSize(6)
-                                        )
-                                        backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
-                                    }.lparams(wrapContent, wrapContent) {
-                                        marginStart = autoSize(130)
-                                    }
-                                }.lparams(0, matchParent, 1f)
-
-                                verticalLayout {
-                                    onThrottleFirstClick {
-                                        val intent = Intent()
-                                        intent.setClass(context, TradingQueryActivity::class.java)
-                                        ActivityUtils.startActivity(intent)
-                                    }
-                                    imageView {
-                                        imageResource = R.mipmap.main_business_7
-                                    }.lparams(autoSize(72), autoSize(72)) {
-                                        gravity = Gravity.CENTER_HORIZONTAL
-                                    }
+                                    }.lparams(autoSize(900), autoSize(340))
+                                }
+                            }.lparams(matchParent, autoSize(340))
 
-                                    textView {
-                                        text = "交易查询"
-                                        textColorInt = R.color.black
-                                        textSizeAuto = 26
-                                    }.lparams(wrapContent, wrapContent) {
-                                        gravity = Gravity.CENTER_HORIZONTAL
-                                        topMargin = autoSize(20)
-                                    }
-                                }.lparams(0, matchParent, 1f)
-                                verticalLayout {
-                                    onThrottleFirstClick {
-                                        val intent = Intent()
-                                        intent.setClass(context, ReportQueryActivity::class.java)
-                                        ActivityUtils.startActivity(intent)
-                                    }
-                                    imageView {
-                                        imageResource = R.mipmap.main_business_8
-                                    }.lparams(autoSize(72), autoSize(72)) {
-                                        gravity = Gravity.CENTER_HORIZONTAL
-                                    }
 
-                                    textView {
-                                        text = "报表查询"
-                                        textColorInt = R.color.black
-                                        textSizeAuto = 26
-                                    }.lparams(wrapContent, wrapContent) {
-                                        gravity = Gravity.CENTER_HORIZONTAL
-                                        topMargin = autoSize(20)
-                                    }
-                                }.lparams(0, matchParent, 1f)
-                            }.lparams(matchParent, autoSize(140)) {
-                                topMargin = autoSize(20)
-                            }
 
                             view {
                                 background = resources.getDrawable(R.color.main_hit_bg_color)

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

@@ -10,6 +10,7 @@ import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.UserInfoData
+import cn.muchinfo.rma.global.data.WarehouseInfoData
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.home.customerdata.CustomerDataViewHolder
@@ -157,7 +158,7 @@ class WarehouseNormalUI(
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val unSubmitAdapter: BaseAdapter<String, WarehouseInformationViewHolder> = BaseAdapter { _, _ -> WarehouseInformationViewHolder(activity, viewModel) }
+    private val unSubmitAdapter: BaseAdapter<WarehouseInfoData, WarehouseInformationViewHolder> = BaseAdapter { _, _ -> WarehouseInformationViewHolder(activity, viewModel) }
 
 
     val root = _FrameLayout(activity).apply {
@@ -249,7 +250,7 @@ class WarehouseDisableUI(
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val unSubmitAdapter: BaseAdapter<String, WarehouseInformationViewHolder> = BaseAdapter { _, _ -> WarehouseInformationViewHolder(activity, viewModel) }
+    private val unSubmitAdapter: BaseAdapter<WarehouseInfoData, WarehouseInformationViewHolder> = BaseAdapter { _, _ -> WarehouseInformationViewHolder(activity, viewModel) }
 
 
 

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

@@ -5,6 +5,7 @@ import android.view.Gravity
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WarehouseInfoData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
@@ -24,7 +25,7 @@ import org.jetbrains.anko.*
  * @property itemSize IntArray
  * @constructor
  */
-class WarehouseInformationViewHolder(private val activity : AppCompatActivity,private val viewModel : WarehouseInformationViewModel) : BaseViewHolder<String>(activity){
+class WarehouseInformationViewHolder(private val activity : AppCompatActivity,private val viewModel : WarehouseInformationViewModel) : BaseViewHolder<WarehouseInfoData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     override fun _FrameLayout.createContentView() {