This commit is contained in:
邹宗楠
2025-09-03 09:52:03 +08:00
parent 708a336c72
commit 1a15fa7452
3 changed files with 15 additions and 15 deletions

View File

@@ -52,22 +52,22 @@ func (a *API) GetStoreBillList(param *Bill) (map[string]*SettleOrderList, []*Bil
return nil, nil, 0, err
}
for _, v := range data.Data {
for i := 0; i < len(data.Data); i++ {
if settleID == 0 {
settleID = utils.Str2Int64(v.SettleSettingId)
settleID = utils.Str2Int64(data.Data[i].SettleSettingId)
}
settle, ok := orderSettle[v.WmOrderViewId]
settle, ok := orderSettle[data.Data[i].WmOrderViewId]
if !ok {
settle = &SettleOrderList{OrderId: v.WmOrderViewId}
settle = &SettleOrderList{OrderId: data.Data[i].WmOrderViewId}
}
switch v.BillChargeType {
switch data.Data[i].BillChargeType {
case BillChargeTypeOrder: // 平台结算
settle.PlatformSettlement = v.SettleAmount
settle.PlatformSettlement = data.Data[i].SettleAmount
case BillChargeTypeWayBillFee: // 运费
settle.DeliveryFee = v.SettleAmount
settle.DeliveryFee = data.Data[i].SettleAmount
case BillChargeTypeTimingFee: // 定时宝
settle.TimingFee = v.SettleAmount
settle.TimingFee = data.Data[i].SettleAmount
case 110, 117, 137, 168, 172, 173, 21:
//"110": "违约金",
//"117": "聚合配送商罚款",
@@ -76,11 +76,11 @@ func (a *API) GetStoreBillList(param *Bill) (map[string]*SettleOrderList, []*Bil
//"172": "订单取消跑腿罚款",
//"173": "订单取消跑腿罚款退款",
//"21": "推广账户充值",
fineList = append(fineList, &v)
fineList = append(fineList, &data.Data[i])
default:
continue
}
orderSettle[v.WmOrderViewId] = settle
orderSettle[data.Data[i].WmOrderViewId] = settle
}
if int64(data.ExtraInfo.TotalCount) >= (param.Offset * param.Limit) {

View File

@@ -8,10 +8,10 @@ import (
func TestBillList(t *testing.T) {
now := time.Now()
from := time.Date(now.Year(), now.Month(), now.Day()-15, 0, 0, 0, 0, time.Local)
to := time.Date(now.Year(), now.Month(), now.Day()-15, 23, 59, 59, 59, time.Local)
from := time.Date(now.Year(), now.Month(), now.Day()-2, 0, 0, 0, 0, time.Local)
to := time.Date(now.Year(), now.Month(), now.Day()-2, 23, 59, 59, 59, time.Local)
param := &Bill{
AppPoiCode: "8694203",
AppPoiCode: "4418003",
StartDate: from.Unix(),
EndDate: to.Unix(),
Offset: 0,

View File

@@ -20,10 +20,10 @@ func init() {
baseapi.Init(sugarLogger)
// 菜市
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
// 果园
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
//商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nld07Y5m8rEQZJMMrvZGmA")