1
This commit is contained in:
121
platformapi/mtwmapi/bill_list.go
Normal file
121
platformapi/mtwmapi/bill_list.go
Normal file
@@ -0,0 +1,121 @@
|
||||
package mtwmapi
|
||||
|
||||
// GetStoreBillList 获取门店的订单账单
|
||||
/*
|
||||
1.金额类字段单位使用“分”
|
||||
2.当日10点前不能查询昨日账单。
|
||||
3.开始日期和结束日期相隔不能超过7天。
|
||||
4.仅支持查询90天内的账单。
|
||||
5.如订单在状态完成之前取消了,则该订单不会记账,本接口不会查询到该订单的账单信息。
|
||||
6.商家如需对接,请按如下流程申请开通接口权限:请商家发送邮件至 MT.lingshou.open@meituan.com邮件标题:【appid+appname】开通日账单接口权限申请 邮件内容:需包括但不限于以下几点:
|
||||
1)需开通账单接口调用权限的应用appid、appname;
|
||||
2)开通的目的或背景;
|
||||
3)想要实现的效果;
|
||||
4)预计开发周期和上线时间;
|
||||
5)商家公司授权开通日账单接口的证明。(点击下载授权证明模板,授权证明以附件形式提供。)*/
|
||||
func (a *API) GetStoreBillList() {
|
||||
|
||||
}
|
||||
|
||||
// StoreBillListReq 门店结算查询条件
|
||||
type StoreBillListReq struct {
|
||||
AppPoiCode string `json:"app_poi_code"` // APP方门店id
|
||||
StartDate int64 `json:"start_date"` // 开始时间
|
||||
EndDate int64 `json:"end_date"` // 结束时间
|
||||
Offset int64 `json:"offset"` // 偏移量
|
||||
Limit int64 `json:"limit"` // 最大返回条数 (200)
|
||||
}
|
||||
|
||||
// StoreBillListRes 门店结算返回值
|
||||
type StoreBillListRes struct {
|
||||
ExtraInfo ExtraInfoData `json:"extra_info"`
|
||||
}
|
||||
|
||||
type ExtraInfoData struct {
|
||||
TotalCount int `json:"total_count"` // 当前查询时间条件下返回的账单数据总条数
|
||||
SettleSum string `json:"settle_sum"` // 当前查询时间条件下返回的账单数据总结算金额(settleMilli汇总),单位分
|
||||
}
|
||||
|
||||
type BillListData struct {
|
||||
Id string `json:"id"` // 账单的唯一标识id
|
||||
WmPoiName string `json:"wmPoiName"` // 门店名称
|
||||
BillChargeType int `json:"billChargeType"` // 结算类型
|
||||
ChargeFeeDesc string `json:"chargeFeeDesc"` // 结算类型描述
|
||||
UserPayType int `json:"userPayType"` // 用户支付方式
|
||||
WmPoiOrderPushDayseq string `json:"wmPoiOrderPushDayseq"` // 订单流水号
|
||||
WmOrderViewId string `json:"wmOrderViewId"` // 订单展示ID
|
||||
OrderTime string `json:"orderTime"` // 下单时间
|
||||
FinishTime string `json:"finishTime"` // 完成时间
|
||||
RefundTime string `json:"refundTime"` // 退款时间
|
||||
OrderState int `json:"orderState"` // 订单当前状态
|
||||
ShippingType int `json:"shippingType"` // 订单配送方式,以订单完成时刻的配送方式为准。参考值:10-商家自配;20-美团快送;30-美团跑腿;40-美团专送;50-代理商配送;60-到店取餐;70-聚合配送;80-企客光速达;90-企客快速达;100-企客及时达;120-企客全城送。
|
||||
ShippingStatus int `json:"shippingStatus"` // 配送状态,参考值:0-未知;1-已推单;10-已抢单;15-已取餐;20-派送中;40-已送达;100-已取消。如为自配送订单,则配送状态默认为0。
|
||||
AccountState int `json:"accountState"` // 结算状态,参考值:0-已入账;1-未入账。
|
||||
DaliyBillDate string `json:"daliyBillDate"` // 账单日期
|
||||
SettleBillDesc string `json:"settleBillDesc"` // 归账日期,返回结算周期。商家在美团平台上建店时,与美团协议约定的门店结算周期(自外卖信息首次发布之日起算)。如订单未入账(accountState=1),此字段返回null。
|
||||
SettleAmount int64 `json:"settleAmount"` // 商家应收款,单位分。
|
||||
TotalFoodAmount int64 `json:"totalFoodAmount"` // 商品总价(不含商品包装盒费),单位分。公式:商品总价=商品原价+赠品原价
|
||||
BoxAmount int64 `json:"boxAmount"` // 商品包装盒费总价,单位分。
|
||||
ActivityPoiAmount int64 `json:"activityPoiAmount"` // 商家活动总支出金额(含赠品成本),单位分。
|
||||
ActivityMeituanAmount int64 `json:"activityMeituanAmount"` // 美团活动补贴总金额,单位分。
|
||||
ActivityAgentAmount int64 `json:"activityAgentAmount"` // 代理商活动承担金额,单位分。
|
||||
PlatformChargeFee int64 `json:"platformChargeFee"` // 平台服务费,单位分。
|
||||
PerformanceServiceFee int64 `json:"performanceServiceFee"` // 订单履约服务费金额,单位分。如订单无履约服务费,则返回0。(订单履约服务费金额=基础价格+距离收费+重量收费+节假日收费+品类收费+时段收费)
|
||||
BaseShippingAmount int64 `json:"baseShippingAmount"` // 履约服务费-基础价格,单位分
|
||||
Distance int64 `json:"distance"` // 履约服务费-导航距离,获取的导航距离,单位米
|
||||
DistanceFee int64 `json:"distanceFee"` // 履约服务费-距离收费,距离加价费用,单位分
|
||||
WeightChargeFee int64 `json:"weightChargeFee"` // 履约服务费-重量收费,重量加价费用,单位分
|
||||
HolidayChargeFee int64 `json:"holidayChargeFee"` // 履约服务费-节假日收费,单位分
|
||||
CategoryChargeFee int64 `json:"categoryChargeFee"` // 履约服务费-品类收费,单位分
|
||||
SlaFee int64 `json:"slaFee"` // 履约服务费-时段收费,时段加价费用,单位分
|
||||
UserPayShippingAmount int64 `json:"userPayShippingAmount"` // 用户支付配送费,为运费优惠前的金额,单位分。
|
||||
UserOnlinePayAmount int64 `json:"userOnlinePayAmount"` // 用户在线支付金额,为用户实际支付的订单总金额,单位分。
|
||||
UserOfflinePayAmount int64 `json:"userOfflinePayAmount"` // 用户线下支付金额,单位分。目前美团订单仅支持在线支付。
|
||||
Rate int64 `json:"rate"` // 平台服务费的费率,单位百分比(%)。是商家在美团平台建店时,与美团协议约定的每单抽佣比例。
|
||||
Bottom int64 `json:"bottom"` // 保底金额,单位元。是商家在美团平台建店时,与美团协议约定的每单保底抽佣金额。
|
||||
RefundId int64 `json:"refund_id"` // 退款id,与订单退款消息接口中退款id的值相对应。 目前只有在结算类型(billChargeType)为:2,6,7,26,27时,该字段会有合法值;其他结算类型下,该字段值无意义。当billChargeType=2时,该字段的取值与订单ID相同。
|
||||
Discount int64 `json:"discount"` // 分成折扣,目前默认返回100。
|
||||
SettleMilli int64 `json:"settleMilli"` // 结算金额,单位毫。
|
||||
SettleSettingId string `json:"settleSettingId"` // 结算id,表示账期等信息的结算设置id。同一门店的结算设置不变的情况下,结算id不变。
|
||||
WmDonationAmount int64 `json:"wmDonationAmount"` // 青山计划-公益捐赠金额,单位分。
|
||||
WmDoggyBagAmount int64 `json:"wmDoggyBagAmount"` // 商超-打包袋金额,单位分。注意,打包袋费用规则为: (1)订单打包袋如由美团提供给商家,费用结算美团平台,则打包袋字段wmDoggyBagAmount为0; (2)订单打包袋如由商家自己提供,费用结算给商家,则打包袋字段wmDoggyBagAmount为商家设置金额。
|
||||
DealTip int64 `json:"dealTip"` // 配送小费,单位分。
|
||||
ProductPreferences float64 `json:"productPreferences"` // 商家活动支出分摊到商品上的优惠总金额,单位分。
|
||||
NotProductPreferences float64 `json:"notProductPreferences"` // 商家活动支出的未分摊到商品上的总金额,单位分。
|
||||
WmAppOrderSkuBenefitDetailList []WmAppOrderSkuBenefitDetailList `json:"wmAppOrderSkuBenefitDetailList"` // 商家承担成本的商品优惠分摊明细,json格式数组。
|
||||
WmAppOrderSkuShippingDetailList []MedicalInsuranceFee `json:"wmAppOrderSkuShippingDetailList"` // 商家承担配送费活动分摊明细。
|
||||
ChargeFeeType int64 `json:"chargeFeeType"` // 用来标识退款是部分退还是退差价,billChargeType为26时,该值为1代表 退差价,0为部分退。billChargeType为其他值得情况,忽略该字段
|
||||
MedicalInsuranceFee string `json:"medicalInsuranceFee"` // 医保报销费用字段(单位分),只有医保报销的商家这个字段有值
|
||||
}
|
||||
|
||||
type WmAppOrderSkuBenefitDetailList struct {
|
||||
AppSpuCode string `json:"app_spu_code"` // (原app_food_code字段)APP方商品的id,即商家中台系统里商品的编码:(1) 同一门店内商品id不允许重复;(2)字段信息限定长度不超过128个字符。
|
||||
Name string `json:"name"` // 商品名称。
|
||||
SkuId string `json:"sku_id"` // 商品sku的规格编码,SKU码/货号。
|
||||
Count int `json:"count"` // 商品数量 注:当字段count=0时,此账单记录为商家发起的按重量退差价,但结算类型仍为“26-闪购品类订单部分退款”(billChargeType=26)。
|
||||
TotalOriginPrice float64 `json:"totalOriginPrice"` // 商品原价总价(含商品包装盒费),单位分。
|
||||
TotalActivityPrice float64 `json:"totalActivityPrice"` //商品优惠总金额,包括商家承担金额和美团承担金额,单位分。
|
||||
TotalReducePrice float64 `json:"totalReducePrice"` // 商品优惠总金额,包括商家承担金额和美团承担金额,单位分。
|
||||
WmAppOrderActDetails []wmAppOrderActDetails // 商品参与活动详情,json格式数组。
|
||||
|
||||
}
|
||||
|
||||
type wmAppOrderActDetails struct {
|
||||
actId int64 `json:"act_id"` // 商品参与活动的活动id
|
||||
MTType int `json:"type"` // 参与活动的活动类型,参考值:1-首单立减;2-满减优惠;4-套餐惠赠优惠;9-美团红包;11-提前下单减优惠;17-折扣商品;18-美团专送再减;20-第二份半价优惠;22-门店新客立减;27-指定商品满减;40-加价购;43-X元M件;46-超值换购;66-会员折扣商品;101-商家代金券优惠;117-商品优惠券;118-商品折扣券;900-首单红包优惠。
|
||||
PoiCharge float64 `json:"poiCharge"` // 本活动id及活动类型下商家承担的金额,单位分。
|
||||
}
|
||||
|
||||
type MedicalInsuranceFee struct {
|
||||
Name string `json:"name"` // 商品名称。
|
||||
SkuId string `json:"sku_id"` // 商品sku的规格编码,SKU码/货号。
|
||||
Count int `json:"count"` // 商品数量 注:当字段count=0时,此账单记录为商家发起的按重量退差价,但结算类型仍为“26-闪购品类订单部分退款”(billChargeType=26)。
|
||||
totalOriginPrice float64 `json:"totalOriginPrice"` // 商品原价总价(含商品包装盒费),单位分。
|
||||
totalPoiCharge float64 `json:"totalPoiCharge"` // 配送费优惠商家承担总金额,单位分。
|
||||
wmAppOrderShippingActDetailList []wmAppOrderShippingActDetailList `json:"wmAppOrderShippingActDetailList"` // sku商品参与的配送费活动详情。
|
||||
}
|
||||
|
||||
type wmAppOrderShippingActDetailList struct {
|
||||
MTType int `json:"type"` // 参与配送费活动的活动类型,参考值:9-美团红包,21-会员免配送费,25-立减配送费,30-满减配送费,36-新人减配送费,54-新客专享减配送费,59-新客专享减配送费,300-商家会员减配送费,302-预订单减配送费,304-减免运费券,101-商家代金券优惠,305-津贴优惠。
|
||||
PoiCharge float64 `json:"poiCharge"` // 商家承担金额,单位分。
|
||||
}
|
||||
@@ -20,13 +20,13 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// 菜市
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
// api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_n4TwqCntWWuvQwAawzxC0w") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
cookieStr := `
|
||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
`
|
||||
|
||||
@@ -45,8 +45,9 @@ func TestPoiSave(t *testing.T) {
|
||||
poiParams := map[string]interface{}{}
|
||||
//utils.FilterMapNilMembers(utils.Struct2FlatMap(result[0]))
|
||||
//poiParams["address"] = "成都市温江区柳城学海路585号"
|
||||
poiParams["pic_url"] = "http://image.jxc4.com/image/5c9fc4fffb4d5ff1aecf85a2d2543e00.jpg"
|
||||
err := api.PoiSave("17218722", poiParams)
|
||||
//poiParams["pic_url"] = "http://image.jxc4.com/image/5c9fc4fffb4d5ff1aecf85a2d2543e00.jpg"
|
||||
poiParams["name"] = "京西到家(犀浦店)"
|
||||
err := api.PoiSave("17371124", poiParams)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user