package com.kuanzhai.user.network
|
|
import cn.sinata.xldutils.data.ResultData
|
import cn.sinata.xldutils.utils.SPUtils
|
import com.google.gson.JsonObject
|
import com.kuanzhai.user.network.entity.*
|
import com.kuanzhai.user.network.entity.Function
|
import com.kuanzhai.user.utils.Const
|
import com.kuanzhai.user.utils.pay.PayInfo
|
import io.reactivex.Flowable
|
|
object HttpManager {
|
private const val PAGE_SIZE = 20
|
/**
|
* 发起请求方法
|
*/
|
private fun request() =
|
RRetrofit.instance().create(ApiService::class.java)
|
|
private fun getAppId() = SPUtils.instance().getString(Const.User.APP_ID)
|
/**
|
* 获取h5
|
* @param type 1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们
|
*/
|
fun getH5(type:Int): Flowable<ResultData<JsonObject>> {
|
return request().getH5(type)
|
}
|
|
/**
|
* 获取首页电话
|
* @param code 行政区域编号
|
*/
|
fun getPhone(code: String): Flowable<ResultData<ArrayList<Phone>>> {
|
return request().getPhone(code)
|
}
|
|
/**
|
* 包车获取首页电话
|
* @param code 行政区域编号
|
*/
|
fun queryPhones(code: String): Flowable<ResultData<ArrayList<Phone>>> {
|
return request().queryPhones(code)
|
}
|
|
/**
|
* 获取首页轮播消息
|
* @param type 1:轮播消息
|
*/
|
fun queryNotices(type: Int): Flowable<ResultData<ArrayList<Message>>> {
|
return request().queryNotices(type)
|
}
|
|
/**
|
* 获取首页广告
|
* @param type 1:弹窗广告,2:底部广告 3:订单结束弹窗
|
*/
|
fun getAds(type: Int,code: String): Flowable<ResultData<ArrayList<Message>>> {
|
return request().getAds(type,code)
|
}
|
|
/**
|
* 发送验证码
|
* @param type 1=身份验证,2=登录确认,3=用户注册,4=修改密码
|
*/
|
fun sendSms(phone: String,type: Int): Flowable<ResultData<JsonObject>> {
|
return request().getCode(phone,type)
|
}
|
/**
|
* 验证码登录
|
*/
|
fun codeLogin(phone: String,code: String,area: String? = null,ip: String? = null): Flowable<ResultData<JsonObject>> {
|
return request().codeLogin(phone,code,area,ip)
|
}
|
|
/**
|
* 密码登录
|
*/
|
fun pwdLogin(phone: String,code: String): Flowable<ResultData<JsonObject>> {
|
return request().pwdLogin(phone,code)
|
}
|
|
/**
|
* 微信登录
|
*/
|
fun wxLogin(openid: String?, registAreaCode: String, unionid: String?, avatar: String?,nickName: String?,sex: Int?): Flowable<ResultData<JsonObject>> {
|
return request().wxLogin(openid, registAreaCode, unionid,avatar,nickName, sex)
|
}
|
|
/**
|
* 一键登录
|
*/
|
fun oneClickLogin(token: String): Flowable<ResultData<JsonObject>> {
|
return request().oneClickLogin(token)
|
}
|
|
/**
|
* 微信登录绑定手机
|
*/
|
fun bindingPhone(code:String,phone: String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["code"] = code
|
map["phone"] = phone
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.bindingPhone,map)
|
}
|
|
/**
|
* 注销
|
*/
|
fun unregister(): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.cancellation,map)
|
}
|
|
/**
|
* 忘记密码
|
*/
|
fun forgetPassword(code: String,password: String,phone: String): Flowable<ResultData<JsonObject>> {
|
return request().forgetPassword(code, password, phone)
|
}
|
|
/**
|
* 城市是否开通
|
*/
|
fun isOpenCity(code:String): Flowable<ResultData<JsonObject>> {
|
return request().isOpenCity(code)
|
}
|
|
/**
|
* 定位城市功能
|
*/
|
fun queryBusiness(city:String,province:String,district:String): Flowable<ResultData<ArrayList<Function>>> {
|
return request().queryBusiness(city,district, province)
|
}
|
|
/**
|
* 选择城市功能
|
*/
|
fun queryBusinessById(id: Int): Flowable<ResultData<ArrayList<Function>>> {
|
return request().queryBusinessById(id)
|
}
|
|
/**
|
* 开通城市列表
|
*/
|
fun queryOpenCity(): Flowable<ResultData<ArrayList<OpenCity>>> {
|
return request().queryOpenCity()
|
}
|
|
/**
|
* 附近司机数量
|
* @param type:1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车
|
*/
|
fun getDriverNum(lat:Double,lon:Double,type: Int): Flowable<ResultData<JsonObject>> {
|
return request().getDriverNum(lat, lon, type)
|
}
|
|
/**
|
* 查询价格和车型
|
* @param type:1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车
|
*/
|
fun queryServerCarModel(start:String,end:String,type: Int): Flowable<ResultData<ArrayList<CarPrice>>> {
|
return request().queryServerCarModel(start, end, type)
|
}
|
|
/**
|
* 出租车和快车/专车下单
|
* @param orderSource:1:APP下单,2:扫码下单
|
* @param orderType:1=普通,2=预约
|
* @param substitute:是否是代下单(0:否,1:是)
|
* @param type:订单类型(1=普通订单,2=摆渡订单)
|
* @param businessType:业务类型
|
*/
|
fun addTaxiOrder(endAddress: String,endLat: Double,endLon:Double, orderSource:Int,orderType :Int,placementLat :Double,
|
placementLon:Double,startAddress :String,startLat:Double, startLon :Double,substitute :Int,tipMoney:Int,
|
travelTime:String,driverId:Int?, passengers:String?,passengersPhone:String?,serverCarModelId: Int? = 0,
|
rideType: Int? = null,peopleNum: Int? = null,type: Int = 1,
|
businessType: Int = Const.OrderType.TYPE_TAXI): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["endAddress"] = endAddress
|
map["endLat"] = endLat
|
map["endLon"] = endLon
|
map["orderSource"] = orderSource
|
map["orderType"] = orderType
|
map["placementLat"] = placementLat
|
map["placementLon"] = placementLon
|
map["startAddress"] = startAddress
|
map["startLat"] = startLat
|
map["startLon"] = startLon
|
map["substitute"] = substitute
|
map["tipMoney"] = tipMoney
|
map["type"] = type
|
map["travelTime"] = travelTime
|
if (businessType == Const.OrderType.TYPE_SPECIAL){ //快车/专车参数
|
if(serverCarModelId!=null) //车型
|
map["serverCarModelId"] = serverCarModelId
|
if(rideType!=null) //乘车类型(1=独享,2=一口价,3=拼车)
|
map["rideType"] = rideType
|
if(peopleNum!=null) //乘车人数
|
map["peopleNum"] = peopleNum
|
}
|
if (driverId!=null)
|
map["driverId"] = driverId
|
if (passengers!=null)
|
map["passengers"] = passengers
|
if (passengersPhone!=null)
|
map["passengersPhone"] = passengersPhone
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(if (businessType == Const.OrderType.TYPE_TAXI) Apis.addTaxiOrder else Apis.createOrder,map)
|
}
|
|
/**
|
* 摆渡车下单
|
* @param orderSource:1:APP下单,2:扫码下单
|
*/
|
fun saveOrderFerry(endAddress: String,endLat: Double,endLon:Double, orderSource:Int,placementLat :Double,
|
placementLon:Double,startAddress :String,startLat:Double, startLon :Double,
|
travelTime:String, serverCarModelIds:String, crossCityOrderId:Int, place:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["endAddress"] = endAddress
|
map["endLat"] = endLat
|
map["endLon"] = endLon
|
map["orderSource"] = orderSource
|
map["placementLat"] = placementLat
|
map["placementLon"] = placementLon
|
map["startAddress"] = startAddress
|
map["startLat"] = startLat
|
map["startLon"] = startLon
|
map["travelTime"] = travelTime
|
map["serverCarModelIds"] = serverCarModelIds
|
map["crossCityOrderId"] = crossCityOrderId
|
map["place"] = place
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.saveOrderFerry,map)
|
}
|
|
/**
|
* 获取行政区域三级联动数据
|
*/
|
fun queryRegions(id:Int = 0): Flowable<ResultData<ArrayList<City>>> {
|
return request().queryRegions(id)
|
}
|
|
/**
|
* 获取物流单价
|
*/
|
fun queryLogisticsUnitPrice(endAddress: String,startLonLat: String,type: Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["endAddress"] = endAddress
|
map["startLonLat"] = startLonLat
|
map["type"] = type
|
map["appid"] = getAppId()
|
return request().queryLogisticsUnitPrice(endAddress, startLonLat, type,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 获取物流单价
|
*/
|
fun queryPayMoney(endAddress: String,startLonLat: String,num:Int,type: Int): Flowable<ResultData<JsonObject>> {
|
return request().queryPayMoney(endAddress, startLonLat, num,type)
|
}
|
|
/**
|
* 我的订单
|
* @param type 订单类型(1=快车/专车,2=出租车,3=跨城出行)
|
*/
|
fun myOrderList(page:Int,type: Int,size:Int = PAGE_SIZE): Flowable<ResultData<ArrayList<Order>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = page
|
map["size"] = size
|
map["type"] = type
|
map["appid"] = getAppId()
|
return request().myOrderList(page,size, type,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 订单详情
|
* @param type 订单类型(1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
|
*/
|
fun queryOrderInfo(id:Int,type: Int): Flowable<ResultData<Order>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["orderType"] = type
|
map["appid"] = getAppId()
|
return request().queryOrderInfo(id, type,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 取消费用
|
*/
|
fun cancelMoney(id:Int,type: Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["orderType"] = type
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.cancelMoney,map)
|
}
|
|
/**
|
* 继续等待
|
* @param orderType 订单类型(1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
|
*/
|
fun pushOrderTaxi(id:Int,orderType:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.pushOrderTaxi,map)
|
}
|
|
/**
|
* 取消订单
|
* @param orderType 订单类型(1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
|
*/
|
fun cancelOrder(id:Int, orderType:Int, reason:String?=null, remark:String?=null): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["orderType"] = orderType
|
if (reason!=null)
|
map["reason"] = reason
|
if (!remark.isNullOrEmpty())
|
map["remark"] = remark
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.cancelTaxi,map)
|
}
|
|
/**
|
* 投诉司机
|
*/
|
fun complaintService(driverId:Int,description:String,reason:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["driverId"] = driverId
|
if (description.isNotEmpty())
|
map["description"] = description
|
map["reason"] = reason
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.complaintService,map)
|
}
|
|
/**
|
* 余额和优惠券数量
|
*/
|
fun queryBalance(orderId:Int,orderType:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.queryBalance,map)
|
}
|
|
/**
|
* 行程中信息
|
* @param orderType 订单类型(1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
|
*/
|
fun trippingInfo(id:Int,orderType:Int): Flowable<ResultData<TrippingInfo>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
return request().trippingInfo(id,orderType,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 是否有司机接单
|
* @param orderType 订单类型(1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
|
*/
|
fun queryEndPush(id:Int,orderType:Int): Flowable<ResultData<Order>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
return request().queryEndPush(id,orderType,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 司机详情
|
*/
|
fun queryDriverInfo(id:Int): Flowable<ResultData<DriverInfo>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
return request().queryDriverInfo(id,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 司机详情
|
*/
|
fun queryDriverEvaluate(id:Int,page: Int,size: Int = Const.PAGE_SIZE): Flowable<ResultData<ArrayList<Evaluation>>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["pageNum"] = page
|
map["size"] = size
|
map["appid"] = getAppId()
|
return request().queryDriverEvaluate(id,page,size,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 用户详情
|
*/
|
fun queryUserInfo(): Flowable<ResultData<UserInfo>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
return request().queryUserInfo(SignUtil.getSign(map),getAppId())
|
}
|
|
|
/**
|
* 修改用户详情
|
*/
|
fun updateInfo(avatar:String?,birthday:String?,nickname:String?,sex:String?): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
if (avatar!=null)
|
map["avatar"] = avatar
|
if (birthday!=null)
|
map["birthday"] = birthday
|
if (nickname!=null)
|
map["nickname"] = nickname
|
if (sex!=null)
|
map["sex"] = sex
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.updateInfo,map)
|
}
|
|
/**
|
* 解绑亲密账户
|
*/
|
fun unbundleUserUser(id:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.unbundleUserUser,map)
|
}
|
|
/**
|
* 保存亲密账户
|
*/
|
fun addUserUser(content :String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["content"] = content
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.addUserUser,map)
|
}
|
|
/**
|
* 行程支付
|
* @param payType 1=微信,2=支付宝,3=余额
|
*/
|
fun payTaxiOrder(id:Int,payType:Int,orderType:Int,couponId:Int?=null,couponType:Int?=null): Flowable<ResultData<PayInfo>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["payType"] = payType
|
map["type"] = 1
|
map["orderType"] = orderType
|
if (couponId!=null)
|
map["objectId"] = couponId
|
if (couponType!=null)
|
map["objectType"] = couponType
|
map["appid"] = getAppId()
|
return request().payTaxiOrder(id,payType,1,orderType,couponId,couponType,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 小件物流补差价支付
|
* @param payType 1=微信,2=支付宝,3=余额
|
*/
|
fun payOrderLogisticsSpread(id:Int,payType:Int): Flowable<ResultData<PayInfo>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["payType"] = payType
|
map["type"] = 1
|
map["appid"] = getAppId()
|
return request().payOrderLogisticsSpread(id,payType,1,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 打车卡支付
|
* @param payType 1=微信,2=支付宝,3=余额
|
*/
|
fun payTaxiCard(id:Int,payType:Int): Flowable<ResultData<PayInfo>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["payType"] = payType
|
map["type"] = 1
|
map["appid"] = getAppId()
|
return request().payTaxiCard(id,payType,1,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 感谢费支付
|
* @param payType 1=微信,2=支付宝,3=余额
|
*/
|
fun payThankYouFee(money: Double,id:Int,payType:Int,orderType:Int): Flowable<ResultData<PayInfo>> {
|
val map = HashMap<String, Any>()
|
map["money"] = money
|
map["orderId"] = id
|
map["orderType"] = orderType
|
map["payType"] = payType
|
map["type"] = 1
|
map["appid"] = getAppId()
|
return request().payThankYouFee(money,id,payType,orderType,1,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 取消支付
|
* @param payType 1=微信,2=支付宝,3=余额
|
*/
|
fun cancleOrderTaxi(id:Int,payType:Int,cancleId:Int,orderType:Int): Flowable<ResultData<PayInfo>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["payType"] = payType
|
map["type"] = 1
|
map["cancleId"] = cancleId
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
return request().cancleOrderTaxi(id,payType,1,orderType,cancleId,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 评价
|
*/
|
fun orderEvaluate(orderId:Int,fraction:Int,orderType:Int,content:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["fraction"] = fraction
|
map["orderType"] = orderType
|
map["content"] = content
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.orderEvaluate,map)
|
}
|
|
/**
|
* 评价后获取红包金额
|
*/
|
fun queryRedMoney(orderId:Int,orderType:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.queryRedMoney,map)
|
}
|
|
/**
|
* 车载端线下支付
|
*/
|
fun completeOrder(orderId:Int,orderType:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.completeOrder,map)
|
}
|
|
/**
|
* 查询进行中的订单
|
*/
|
fun queryServingOrder(): Flowable<ResultData<ArrayList<Order>>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
return request().queryTripping(SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 查询可用优惠券
|
*/
|
fun queryCoupon(orderId: Int,orderType: Int,page: Int): Flowable<ResultData<ArrayList<Coupon>>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
map["pageNum"] = page
|
map["size"] = PAGE_SIZE
|
map["appid"] = getAppId()
|
return request().queryCoupon(orderId,orderType,page, PAGE_SIZE,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 查询行程路径
|
*/
|
fun queryTrack(orderId: Int,orderType: Int): Flowable<ResultData<ArrayList<Point>>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
return request().queryTrack(orderId,orderType,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 查询行程路径
|
*/
|
fun querySite(orderId: Int,orderType: Int): Flowable<ResultData<ArrayList<Point>>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
map["appid"] = getAppId()
|
return request().queryTrack(orderId,orderType,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 查询优惠券
|
*/
|
fun queryMyCoupons(page: Int,state: Int): Flowable<ResultData<ArrayList<Coupon>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = page
|
map["size"] = PAGE_SIZE
|
map["state"] = state
|
map["appid"] = getAppId()
|
return request().queryMyCoupons(page,PAGE_SIZE,state,SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 实名认证提交
|
*/
|
fun realName(idcode:String,img1:String,img2:String,name:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["idcode"] = idcode
|
map["img1"] = img1
|
map["img2"] = img2
|
map["name"] = name
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.realName,map)
|
}
|
|
/**
|
* 实名认证信息
|
*/
|
fun queryRealName(): Flowable<ResultData<RealName>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
return request().queryRealName(SignUtil.getSign(map),getAppId())
|
}
|
|
/**
|
* 删除优惠券
|
*/
|
fun delMyCoupon(id:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.delMyCoupon,map)
|
}
|
|
/**
|
* 赠送优惠券
|
*/
|
fun giveCoupon(id:Int,userId:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["userId"] = userId
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.giveCoupon,map)
|
}
|
|
/**
|
* 设置紧急联系人
|
*/
|
fun setEmergency(name:String,phone:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["name"] = name
|
map["phone"] = phone
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.setEmergency,map)
|
}
|
|
/**
|
* 根据手机号查询用户信息(赠送优惠券)
|
*/
|
fun queryUser(phone:String): Flowable<ResultData<UserInfo>> {
|
val map = HashMap<String, Any>()
|
map["phone"] = phone
|
map["appid"] = getAppId()
|
return request().queryUser(phone,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 消费记录、提现记录、红包使用记录、积分兑换记录
|
*/
|
fun walletRecord(url:String,page: Int,size: Int = PAGE_SIZE): Flowable<ResultData<ArrayList<WalletRecord>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = page
|
map["size"] = size
|
map["appid"] = getAppId()
|
return request().walletRecord(url,page,size,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 红包列表
|
*/
|
fun queryMyRedEnvelope(page: Int,size: Int = PAGE_SIZE): Flowable<ResultData<ArrayList<WalletRecord>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = page
|
map["size"] = size
|
map["appid"] = getAppId()
|
return request().queryRedEnvelope(page,size,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 提现申请
|
*/
|
fun withdrawal(name:String,code:String,money:Double): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["name"] = name
|
map["code"] = code
|
map["money"] = money
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.withdrawal,map)
|
}
|
|
/**
|
* 反馈
|
*/
|
fun feedback(content:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["content"] = content
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.feedback,map)
|
}
|
|
/**
|
* 留言
|
*/
|
fun leaveMessage(content:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["content"] = content
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.leaveMessage,map)
|
}
|
|
/**
|
* 留言记录
|
*/
|
fun queryProblems(page: Int,size: Int = PAGE_SIZE): Flowable<ResultData<ArrayList<ServiceRecord>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = page
|
map["size"] = size
|
map["appid"] = getAppId()
|
return request().queryProblems(page,size,SignUtil.getSign(map), getAppId())
|
}
|
|
|
/**
|
* 消息中心列表
|
* @param type 1=公告,2=系统消息
|
*/
|
fun msgNotice(type: Int,page: Int,size: Int = PAGE_SIZE): Flowable<ResultData<ArrayList<Message>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = page
|
map["size"] = size
|
map["type"] = type
|
map["appid"] = getAppId()
|
return request().msgNotice(page,size,type,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 客服电话
|
*/
|
fun queryCustomerPhone(code:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["code"] = code
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.queryCustomerPhone,map)
|
}
|
|
/**
|
* 未读数量
|
*/
|
fun queryUnReadNum(): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.queryUnReadNum,map)
|
}
|
|
/**
|
* 验证短信
|
*/
|
fun checkCode(code:String,phone: String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["code"] = code
|
map["phone"] = phone
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.checkCaptcha,map)
|
}
|
|
/**
|
* 修改密码
|
*/
|
fun updatePassword(password:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["password"] = password
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.updatePassword,map)
|
}
|
|
/**
|
* 修改手机号
|
*/
|
fun updatePhone(code:String,phone: String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["code"] = code
|
map["phone"] = phone
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.updatePhone,map)
|
}
|
|
/**
|
* 清空消息
|
*/
|
fun clearSystemNotice(): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.clearSystemNotice,map)
|
}
|
|
/**
|
* 删除消息
|
*/
|
fun delSystemNotice(id:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.delSystemNotice,map)
|
}
|
|
/**
|
* 阅读消息
|
*/
|
fun readSystemNotice(id:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.readSystemNotice,map)
|
}
|
|
/**
|
* 分享得红包
|
*/
|
fun shareRedEnvelope(id:Int,type: Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["orderType"] = type
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.shareRedEnvelope,map)
|
}
|
|
/**
|
* 余额充值
|
* @param payType 1=微信,2=支付宝
|
* @param type 1=用户APP端
|
*/
|
fun depositBalance(payType:Int,money:Double,type:Int = 1): Flowable<ResultData<PayInfo>> {
|
val map = HashMap<String, Any>()
|
map["payType"] = payType
|
map["money"] = money
|
map["type"] = type
|
map["appid"] = getAppId()
|
return request().depositBalance(money,payType,type,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 检查版本
|
*/
|
fun queryNewData(): Flowable<ResultData<VersionData>> {
|
return request().queryNewData()
|
}
|
|
/**
|
* 起终点站点
|
*/
|
fun querySite(type: Int,startId:Int? = null): Flowable<ResultData<ArrayList<City>>> {
|
return request().querySite(type,startId)
|
}
|
|
/**
|
* 线路搜索
|
*/
|
fun queryLines(startId:Int,endId:Int): Flowable<ResultData<ArrayList<Line>>> {
|
return request().queryLines(startId,endId)
|
}
|
|
/**
|
* 班次搜索
|
*/
|
fun queryDriver(day:String,lineId:Int,driverId:Int? = null): Flowable<ResultData<ArrayList<Shift>>> {
|
return request().queryDriver(day,lineId,driverId)
|
}
|
|
/**
|
* 搜索座位
|
*/
|
fun querySeat(id: Int): Flowable<ResultData<SeatInfo>> {
|
return request().querySeat(id)
|
}
|
|
/**
|
* 站点范围
|
*/
|
fun queryLocation(id: Int): Flowable<ResultData<ArrayList<Anchor>>> {
|
return request().queryLocation(id)
|
}
|
|
/**
|
* 站点是否在范围内
|
* */
|
fun areaMonitoring(id: Int,code: String,lonLat:String): Flowable<ResultData<Int>> {
|
return request().areaMonitoring(id,code, lonLat)
|
}
|
|
/**
|
* 查询预估价格
|
*/
|
fun queryOrderMoney(lineId:Int,startLonLat:String,endLonLat:String,peopleNumber:Int, seatNumber:String, travelMode:Int,
|
serverCarModelId:Int, totalSeat:Int): Flowable<ResultData<JsonObject>> {
|
return request().queryOrderMoney(lineId, startLonLat, endLonLat, peopleNumber, seatNumber, travelMode, serverCarModelId, totalSeat)
|
}
|
|
/**
|
* 跨城下单
|
* @param orderSource 订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)
|
* @param travelMode 出行方式(1=拼车,2=包车)
|
*/
|
fun orderCrossCity(carId:Int,lineId:Int,lineShiftDriverId:Int,driverId:Int,distance:Double, orderSource:Int,
|
startLat:Double, startLon:Double,endLat:Double,endLon:Double,travelTime:String,placementLat:Double,
|
placementLon:Double,startAddress:String,endAddress:String,placementAddress:String,
|
remark:String?,peopleNumber:Int,seatNumber:String,travelMode:Int,serverCarModelId:Int,totalSeat:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["carId"] = carId
|
map["lineId"] = lineId
|
map["lineShiftDriverId"] = lineShiftDriverId
|
map["driverId"] = driverId
|
map["distance"] = distance
|
map["orderSource"] = orderSource
|
map["startLat"] = startLat
|
map["startLon"] = startLon
|
map["endLat"] = endLat
|
map["endLon"] = endLon
|
map["travelTime"] = travelTime
|
map["placementLat"] = placementLat
|
map["placementLon"] = placementLon
|
map["startAddress"] = startAddress
|
map["endAddress"] = endAddress
|
map["placementAddress"] = placementAddress
|
if (!remark.isNullOrEmpty())
|
map["remark"] = remark
|
map["peopleNumber"] = peopleNumber
|
map["seatNumber"] = seatNumber
|
map["travelMode"] = travelMode
|
map["serverCarModelId"] = serverCarModelId
|
map["totalSeat"] = totalSeat
|
map["appid"] = getAppId()
|
return request().orderCrossCity(carId,lineId,lineShiftDriverId,driverId,distance, orderSource,
|
startLat, startLon,endLat,endLon,travelTime,placementLat,
|
placementLon,startAddress,endAddress,placementAddress,
|
remark,peopleNumber,seatNumber,travelMode,serverCarModelId,totalSeat,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 查询包车车型
|
*/
|
fun queryServerCarModels(): Flowable<ResultData<ArrayList<CarPrice>>> {
|
return request().queryServerCarModels()
|
}
|
|
/**
|
* 包车下单
|
*/
|
fun orderCharteredCar(carTime:Int, travelTime:String, placeLonLat:String,contactPerson:String, contactPhone:String,
|
modelUse:String, peopleNumber:Int, serverCarModelId:Int): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["carTime"] = carTime
|
map["travelTime"] = travelTime
|
map["placeLonLat"] = placeLonLat
|
map["contactPerson"] = contactPerson
|
map["contactPhone"] = contactPhone
|
map["peopleNumber"] = peopleNumber
|
map["modelUse"] = modelUse
|
map["serverCarModelId"] = serverCarModelId
|
map["appid"] = getAppId()
|
return request().orderCharteredCar(carTime,travelTime,placeLonLat,contactPerson,contactPhone,modelUse,peopleNumber,
|
serverCarModelId,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 物流订单数量
|
*/
|
fun queryLogisticsNumber(): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.queryLogisticsNumber,map)
|
}
|
|
/**
|
* 物流下单
|
*/
|
fun smallLogistics(cargoNumber:Int,cargoType:Int,endAddress:String,placementLat:Double,placementLon:Double,recipient:String,
|
recipientPhone:String,remark:String,startAddress:String,startLat:Double,startLon:Double,tipMoney:Int,
|
travelTime:String,arriveTime:String,type:Int,urgent:Int,userImg:String, orderSource:Int=1): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["cargoNumber"] = cargoNumber
|
map["cargoType"] = cargoType
|
map["endAddress"] = endAddress
|
map["placementLat"] = placementLat
|
map["placementLon"] = placementLon
|
map["recipient"] = recipient
|
map["recipientPhone"] = recipientPhone
|
if (remark.isNotEmpty())
|
map["remark"] = remark
|
map["startAddress"] = startAddress
|
map["startLat"] = startLat
|
map["startLon"] = startLon
|
map["tipMoney"] = tipMoney
|
map["travelTime"] = travelTime
|
map["arriveTime"] = arriveTime
|
map["type"] = type
|
map["urgent"] = urgent
|
map["userImg"] = userImg
|
map["orderSource"] = orderSource
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.smallLogistics,map)
|
}
|
|
/**
|
* 根据起点和终点坐标判断是不是同一个市内
|
*/
|
fun judgingTheCity(endAddress:String,startLonLat:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["endAddress"] = endAddress
|
map["startLonLat"] = startLonLat
|
return request().getBaseResponse(Apis.judgingTheCity,map)
|
}
|
|
/**
|
* 积分礼物列表
|
*/
|
fun queryGoods(page:Int,size: Int = Const.PAGE_SIZE): Flowable<ResultData<ArrayList<Goods>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = page
|
map["size"] = size
|
map["appid"] = getAppId()
|
return request().queryGoods(page,size,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 礼物详情
|
*/
|
fun queryGoodsInfo(id:Int): Flowable<ResultData<Goods>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
return request().queryGoodsInfo(id,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 购卡列表
|
*/
|
fun getTaxiCardList(lat: Double,lon: Double,type: Int): Flowable<ResultData<ArrayList<Card>>> {
|
val map = HashMap<String, Any>()
|
map["lat"] = lat
|
map["lon"] = lon
|
map["type"] = type
|
map["appid"] = getAppId()
|
return request().getTaxiCardList(lat,lon,type,SignUtil.getSign(map), getAppId())
|
}
|
/**
|
* 我的卡列表
|
*/
|
fun getMyTaxiCardList(type: Int): Flowable<ResultData<ArrayList<Card>>> {
|
val map = HashMap<String, Any>()
|
map["type"] = type
|
map["appid"] = getAppId()
|
return request().getMyTaxiCardList(type,SignUtil.getSign(map), getAppId())
|
}
|
/**
|
* 可用卡或者优惠券
|
*/
|
fun queryCouponList(orderId: Int,orderType: Int): Flowable<ResultData<ArrayList<CouponOrCard>>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
map["pageNum"] = 1
|
map["size"] = 1000
|
map["appid"] = getAppId()
|
return request().queryCouponList(orderId,orderType,1,1000,SignUtil.getSign(map), getAppId())
|
}
|
/**
|
* 我的亲密账户列表
|
*/
|
fun getUserUserList(): Flowable<ResultData<ArrayList<CloseAccount>>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
return request().getUserUserList(SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 购卡列表详情
|
*/
|
fun getTaxiCardInfo(id: Int): Flowable<ResultData<Card>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
return request().getTaxiCardInfo(id,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 我的卡列表详情
|
*/
|
fun getMyTaxiCardInfo(id: Int): Flowable<ResultData<Card>> {
|
val map = HashMap<String, Any>()
|
map["id"] = id
|
map["appid"] = getAppId()
|
return request().getMyTaxiCardInfo(id,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 积分兑换
|
*/
|
fun addIntegralOrder(consigneeAddress:String, consigneeName:String,consigneePhone:String, goodsId:Int,
|
remark:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["consigneeAddress"] = consigneeAddress
|
map["consigneeName"] = consigneeName
|
map["consigneePhone"] = consigneePhone
|
map["goodsId"] = goodsId
|
if (remark.isNotEmpty())
|
map["remark"] = remark
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.addIntegralOrder,map)
|
}
|
|
/**
|
* 商家信息
|
*/
|
fun getMerchant(): Flowable<ResultData<BusinessInfo>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
return request().getMerchant(SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 商家优惠券
|
*/
|
fun getMerchantCoupon(type: Int,page: Int): Flowable<ResultData<ArrayList<BusinessCoupon>>> {
|
val map = HashMap<String, Any>()
|
map["type"] = type
|
map["pageNum"] = page
|
map["size"] = Const.PAGE_SIZE
|
map["appid"] = getAppId()
|
return request().getMerchantCoupon(type,page,Const.PAGE_SIZE,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 首页获取商家优惠券
|
*/
|
fun gainMerchantCoupon(): Flowable<ResultData<ArrayList<BusinessCoupon>>> {
|
val map = HashMap<String, Any>()
|
map["appid"] = getAppId()
|
return request().gainMerchantCoupon(SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 订单结束获取商家优惠券
|
*/
|
fun giveAwayMerchantCoupon(type: Int,id: Int): Flowable<ResultData<ArrayList<BusinessCoupon>>> {
|
val map = HashMap<String, Any>()
|
map["orderId"] = id
|
map["orderType"] = type
|
map["appid"] = getAppId()
|
return request().giveAwayMerchantCoupon(type,id,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 我的商家优惠券
|
*/
|
fun getMyMerchantCoupon(type: Int): Flowable<ResultData<ArrayList<BusinessCoupon>>> {
|
val map = HashMap<String, Any>()
|
map["type"] = type
|
map["appid"] = getAppId()
|
return request().getMyMerchantCoupon(type,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 优惠券详情
|
*/
|
fun getUserMerchantCoupon(code: String): Flowable<ResultData<BusinessCoupon>> {
|
val map = HashMap<String, Any>()
|
map["code"] = code
|
map["appid"] = getAppId()
|
return request().getUserMerchantCoupon(code,SignUtil.getSign(map), getAppId())
|
}
|
|
/**
|
* 申请商家入驻
|
*/
|
fun registeredMerchant(address:String, businessLicense:String,contactName:String,contactPhone:String, name:String,
|
headImg:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["address"] = address
|
map["businessLicense"] = businessLicense
|
map["contactName"] = contactName
|
map["contactPhone"] = contactPhone
|
map["name"] = name
|
map["headImg"] = headImg
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.registeredMerchant,map)
|
}
|
|
/**
|
* 核销
|
*/
|
fun writeOffMerchantCoupon(code:String): Flowable<ResultData<JsonObject>> {
|
val map = HashMap<String, Any>()
|
map["code"] = code
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getBaseResponse(Apis.writeOffMerchantCoupon,map)
|
}
|
|
/**
|
* 核销历史
|
*/
|
fun getWriteOffHistory(activityId:String,id: Int,page: Int): Flowable<ResultData<ArrayList<CouponCheckRecord>>> {
|
val map = HashMap<String, Any>()
|
map["activityId"] = activityId
|
map["id"] = id
|
map["pageNum"] = page
|
map["size"] = Const.PAGE_SIZE
|
map["appid"] = getAppId()
|
return request().getWriteOffHistory(activityId,id,page,Const.PAGE_SIZE,SignUtil.getSign(map), getAppId())
|
}
|
|
/*
|
2.0 新增
|
*/
|
/**
|
* 未读消息
|
*/
|
fun getMessNum(): Flowable<ResultData<UnReadBean>> {
|
return request().getMessNum()
|
}
|
/**
|
* 2.0模块控制
|
*/
|
fun getShowModular(): Flowable<ResultData<List<NewFunBean>>> {
|
return request().getShowModular()
|
}
|
/**
|
* 车辆品牌
|
*/
|
fun queryAllBrand(): Flowable<ResultData<List<Brand>>> {
|
return request().queryAllBrand()
|
}
|
/**
|
* 租车
|
*/
|
fun insertOrUpdateCarRental(address: String,brandId:Int,brandName:String,category:String,cityCode:String,cityName:String,contactsName:String,
|
contactsPhone:String,deposit:Double,describe:String?,describeImgUrl:String?,displacement:String,gear:String,
|
imgUrl:String,pickUpCarCarCertificates:String,provinceCode:String,provinceName:String,rentMoney:Double,seat:String,
|
title:String,videoUrl:String?,id:Long = 0): Flowable<ResultData<Any>> {
|
val map = HashMap<String, Any>()
|
map["addres"] = address
|
map["brandId"] = brandId
|
map["brandName"] = brandName
|
map["category"] = category
|
map["cityCode"] = cityCode
|
map["cityName"] = cityName
|
map["contactsName"] = contactsName
|
map["contactsPhone"] = contactsPhone
|
map["displacement"] = displacement
|
map["gear"] = gear
|
map["imgUrl"] = imgUrl
|
map["pickUpCarCarCertificates"] = pickUpCarCarCertificates
|
map["provinceCode"] = provinceCode
|
map["provinceName"] = provinceName
|
map["title"] = title
|
map["seat"] = seat
|
map["deposit"] = deposit
|
map["rentMoney"] = rentMoney
|
if (!describe.isNullOrEmpty())
|
map["describe"] = describe
|
if (!describeImgUrl.isNullOrEmpty())
|
map["describeImgUrl"] = describeImgUrl
|
if (!videoUrl.isNullOrEmpty())
|
map["videoUrl"] = videoUrl
|
if (id!=0L)
|
map["id"] = id
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().insertOrUpdateCarRental(map)
|
}
|
/**
|
* 租车列表
|
*/
|
fun getMyCarRentalList(page: Int): Flowable<ResultData<List<RentBean>>> {
|
return request().getMyCarRentalList(page)
|
}
|
/**
|
* 租车详情
|
*/
|
fun getCarRentalDetail(id: Long): Flowable<ResultData<RentBean>> {
|
return request().getCarRentalDetail(id)
|
}
|
/**
|
* 卖车列表
|
*/
|
fun getMySellingCarList(page: Int): Flowable<ResultData<List<SaleBean>>> {
|
return request().getMySellingCarList(page)
|
}
|
/**
|
* 卖车列表
|
*/
|
fun getSellingCarList(brandId:Int?,serachName:String?,provinceCode:String?,cityCode:String?,transmissionCase:String?,
|
startDisplacement:Double?,endDisplacement:Double?,startMileage:Int?,endMileage:Int?,type:Int?,
|
startTransferPrice:Double?,endTransferPrice:Double?,startLicensingTime:Int?,endLicensingTime:Int?,
|
pageNum: Int,size:Int = Const.PAGE_SIZE): Flowable<ResultData<List<SaleBean>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = pageNum
|
map["size"] = size
|
if (brandId!=null)
|
map["brandId"] = brandId
|
if (serachName!=null)
|
map["serachName"] = serachName
|
if (provinceCode!=null)
|
map["provinceCode"] = provinceCode
|
if (cityCode!=null)
|
map["cityCode"] = cityCode
|
if (transmissionCase!=null)
|
map["transmissionCase"] = transmissionCase
|
if (startDisplacement!=null)
|
map["startDisplacement"] = startDisplacement
|
if (endDisplacement!=null)
|
map["endDisplacement"] = endDisplacement
|
if (startMileage!=null)
|
map["startMileage"] = startMileage
|
if (endMileage!=null)
|
map["endMileage"] = endMileage
|
if (type!=null)
|
map["type"] = type
|
if (startTransferPrice!=null)
|
map["startTransferPrice"] = startTransferPrice
|
if (endTransferPrice!=null)
|
map["endTransferPrice"] = endTransferPrice
|
if (startLicensingTime!=null)
|
map["startLicensingTime"] = startLicensingTime
|
if (endLicensingTime!=null)
|
map["endLicensingTime"] = endLicensingTime
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getSellingCarList(map)
|
}
|
/**
|
* 租车列表
|
*/
|
fun getCarRentalList(brandId:Int?,serachName:String?,provinceCode:String?,cityCode:String?,pickUpCarCarCertificates:String?,
|
type:Int?, startRentMoney:Double?,endRentMoney:Double?, pageNum: Int,size:Int = Const.PAGE_SIZE): Flowable<ResultData<List<RentBean>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = pageNum
|
map["size"] = size
|
if (brandId!=null)
|
map["brandId"] = brandId
|
if (serachName!=null)
|
map["serachName"] = serachName
|
if (provinceCode!=null)
|
map["provinceCode"] = provinceCode
|
if (cityCode!=null)
|
map["cityCode"] = cityCode
|
if (pickUpCarCarCertificates!=null)
|
map["pickUpCarCarCertificates"] = pickUpCarCarCertificates
|
if (type!=null)
|
map["type"] = type
|
if (startRentMoney!=null)
|
map["startRentMoney"] = startRentMoney
|
if (endRentMoney!=null)
|
map["endRentMoney"] = endRentMoney
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getCarRentalList(map)
|
}
|
/**
|
* 招聘列表
|
*/
|
fun getRecruitList(driverType:String?,serachName:String?,welfare:String?, startSalary:Double?,endSalary:Double?, pageNum: Int,
|
size:Int = Const.PAGE_SIZE): Flowable<ResultData<List<WantedBean>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = pageNum
|
map["size"] = size
|
if (driverType!=null)
|
map["driverType"] = driverType
|
if (serachName!=null)
|
map["serachName"] = serachName
|
if (welfare!=null)
|
map["welfare"] = welfare
|
if (startSalary!=null)
|
map["startSalary"] = startSalary
|
if (endSalary!=null)
|
map["endSalary"] = endSalary
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().getRecruitList(map)
|
}
|
/**
|
* 卖车详情
|
*/
|
fun getRecruitDetail(id: Long): Flowable<ResultData<WantedBean>> {
|
return request().getRecruitDetail(id)
|
}
|
/**
|
* 卖车详情
|
*/
|
fun getSellingCarDetail(id: Long): Flowable<ResultData<SaleBean>> {
|
return request().getSellingCarDetail(id)
|
}
|
/**
|
* 删除列表
|
* @param type 1=租车,2=卖车
|
*/
|
fun delete(id:Long,type: Int): Flowable<ResultData<Any>> {
|
return request().delete(id, type)
|
}
|
/**
|
* 删除评论
|
*/
|
fun deleteComment(id:Long): Flowable<ResultData<Any>> {
|
return request().deleteComment(id)
|
}
|
/**
|
* 上下架
|
* @param type 1=租车,2=卖车
|
*/
|
fun operateMenuOrder(isUp:Boolean,id:Long,type: Int): Flowable<ResultData<Any>> {
|
return request().operateMenuOrder(if (isUp) Apis.putOnTheShelf else Apis.offTheShelf,id, type)
|
}
|
|
/**
|
* 卖车
|
*/
|
fun insertOrUpdateSellingCar(address: String,brandId:Int,brandName:String,carColor:String,carIdentificationCode:String,carLicensePlate:String,
|
cityCode:String,cityName:String, contactsName:String, contactsPhone:String,describe:String?,describeImgUrl:String?,
|
displacement:String, dueTimeOfCompulsoryInsurance:String,expirationTimeOfAnnualInspection:String,imgUrl:String,
|
includingTransferFee:Int, installationConfiguration:String,level:String,licensingTime:String,locationOfLicensePlate:String,
|
maturityTimeOfCommercialInsurance:String, mileage:Double,mortgage:Int,newCarPrice:Double?,provinceCode:String,
|
provinceName:String,title:String,transferPrice:Double,transferTimes:Int,transmissionCase:String,
|
videoUrl:String?,id:Long = 0): Flowable<ResultData<Any>> {
|
val map = HashMap<String, Any>()
|
map["addres"] = address
|
map["brandId"] = brandId
|
map["brandName"] = brandName
|
map["carColor"] = carColor
|
map["carIdentificationCode"] = carIdentificationCode
|
map["carLicensePlate"] = carLicensePlate
|
map["cityCode"] = cityCode
|
map["cityName"] = cityName
|
map["contactsName"] = contactsName
|
map["contactsPhone"] = contactsPhone
|
map["displacement"] = displacement
|
map["dueTimeOfCompulsoryInsurance"] = dueTimeOfCompulsoryInsurance
|
map["expirationTimeOfAnnualInspection"] = expirationTimeOfAnnualInspection
|
map["maturityTimeOfCommercialInsurance"] = maturityTimeOfCommercialInsurance
|
map["imgUrl"] = imgUrl
|
map["includingTransferFee"] = includingTransferFee
|
map["installationConfiguration"] = installationConfiguration
|
map["level"] = level
|
map["licensingTime"] = licensingTime
|
map["locationOfLicensePlate"] = locationOfLicensePlate
|
map["mileage"] = mileage
|
map["mortgage"] = mortgage
|
if (newCarPrice != null)
|
map["newCarPrice"] = newCarPrice
|
map["provinceCode"] = provinceCode
|
map["provinceName"] = provinceName
|
map["title"] = title
|
map["transferPrice"] = transferPrice
|
map["transferTimes"] = transferTimes
|
map["transmissionCase"] = transmissionCase
|
if (!describe.isNullOrEmpty())
|
map["describe"] = describe
|
if (!describeImgUrl.isNullOrEmpty())
|
map["describeImgUrl"] = describeImgUrl
|
if (!videoUrl.isNullOrEmpty())
|
map["videoUrl"] = videoUrl
|
if (id!=0L)
|
map["id"] = id
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().insertOrUpdateSellingCar(map)
|
}
|
|
/**
|
* 评论列表
|
* @param type 1=租车,2=卖车,3=招聘
|
*/
|
fun getCommentList(id:Long,type: Int,page: Int): Flowable<ResultData<List<CommentBean>>> {
|
return request().getCommentList(id, type,page,Const.PAGE_SIZE)
|
}
|
|
/**
|
* 评论列表
|
* @param isReply true:我的回复列表 false:我评论的
|
*/
|
fun getMyCommentList(page: Int,isReply:Boolean): Flowable<ResultData<List<CommentBean>>> {
|
return request().getMyCommentList(if (isReply) Apis.getMyReplyCommentList else Apis.getMyCommentList,page,Const.PAGE_SIZE)
|
}
|
|
/**
|
* 评论及回复
|
* @param type 1=租车,2=卖车,3=招聘
|
*/
|
fun insertComment(id:Long,type: Int,content: String,commentId: Long?=null,replyUserId:Long?=null): Flowable<ResultData<Any>> {
|
return request().insertComment(id, type,content, commentId, replyUserId)
|
}
|
|
/**
|
* 开发票
|
* @param type 1=租车,2=卖车,3=招聘
|
*/
|
fun invoicing(type: Int,order: String,name: String,email : String,address: String?,remark: String?,bank: String?,code: String?): Flowable<ResultData<Any>> {
|
val map = HashMap<String, Any>()
|
map["email"] = email
|
map["name"] = name
|
map["order"] = order
|
map["type"] = type
|
if (address!=null)
|
map["address"] = address
|
if (remark!=null)
|
map["remark"] = remark
|
if (bank!=null)
|
map["bank"] = bank
|
if (code!=null)
|
map["code"] = code
|
return request().invoicing(map)
|
}
|
|
/**
|
* 发票订单列表
|
*/
|
fun queryInvoiceOrder(startTime:String?,endTime:String?, startMoney:Double?,endMoney:Double?,type: Int,orderType: Int?, pageNum: Int,
|
size:Int = Const.PAGE_SIZE): Flowable<ResultData<List<TicketOrder>>> {
|
val map = HashMap<String, Any>()
|
map["pageNum"] = pageNum
|
map["size"] = size
|
map["type"] = type
|
if (orderType!=null)
|
map["orderType"] = orderType
|
if (startTime!=null)
|
map["startTime"] = startTime
|
if (endTime!=null)
|
map["endTime"] = endTime
|
if (startMoney!=null)
|
map["startMoney"] = startMoney
|
if (endMoney!=null)
|
map["endMoney"] = endMoney
|
map["appid"] = getAppId()
|
map["sign"] = SignUtil.getSign(map)
|
return request().queryInvoiceOrder(map)
|
}
|
|
/**
|
* 开票列表
|
*/
|
fun queryMyInvoice(pageNum: Int): Flowable<ResultData<List<TicketRecord>>> {
|
return request().queryMyInvoice(pageNum)
|
}
|
|
/**
|
* 获取认证企业信息
|
*/
|
fun queryCompany(): Flowable<ResultData<CompanyInfo>> {
|
return request().queryCompany()
|
}
|
|
/**
|
* 提交认证企业信息
|
*/
|
fun submitCompany(company:String,name: String,phone: String,address: String,code: String,imgUrl: String,mail:String,id:String?): Flowable<ResultData<Any>> {
|
return request().submitCompany(imgUrl,address,code,name,phone,mail,company,id)
|
}
|
|
/**
|
* 员工列表
|
*/
|
fun queryStaffList(page: Int,name:String?): Flowable<ResultData<List<Staff>>> {
|
return request().queryStaffList(page,name)
|
}
|
|
/**
|
* 额度申请列表
|
*/
|
fun getCompanyLimitList(page: Int): Flowable<ResultData<List<CreditApply>>> {
|
return request().getCompanyLimitList(page)
|
}
|
|
/**
|
* 提交额度申请
|
*/
|
fun saveCompanyLimit(money: Double,reason: String): Flowable<ResultData<Any>> {
|
return request().saveCompanyLimit(money,reason)
|
}
|
|
/**
|
* 我的额度列表
|
*/
|
fun getMineLimitList(page: Int): Flowable<ResultData<MyCreditBean>> {
|
return request().getMineLimitList(page)
|
}
|
|
/**
|
* 额度审核
|
*/
|
fun companyLimitApprove(id: String,state: Int,reason: String?): Flowable<ResultData<Any>> {
|
return request().companyLimitApprove(id,state,reason)
|
}
|
}
|