Quellcode durchsuchen

update

add_mode
DengBiao vor 1 Jahr
Ursprung
Commit
8e743be4d8
3 geänderte Dateien mit 76 neuen und 64 gelöschten Zeilen
  1. +4
    -2
      app/admin/svc/svc_data_statisstics.go
  2. +63
    -54
      app/customer/svc/svc_central_kitchen_for_school_package.go
  3. +9
    -8
      app/db/model/central_kitchen_for_school_user_with_day.go

+ 4
- 2
app/admin/svc/svc_data_statisstics.go Datei anzeigen

@@ -1038,7 +1038,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
return
}

titleList = []string{"学校名称", "预定总费用", "退款总计"}
titleList = []string{"学校名称", "预定总费用", "退款总计", "实收费用", "预估费率"}
xlsx.SetSheetRow("Sheet1", "A1", &titleList)
j := 2 //表头被第一行用了,只能从第二行开始
for _, v := range m {
@@ -1078,7 +1078,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
refund = mapArr2[0]["total"]
}
}
xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.Name, income, refund})
realityAmount := utils.StrToFloat64(income) - utils.StrToFloat64(refund)
rateFee := realityAmount * 0.0038
xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.Name, income, refund, realityAmount, rateFee})
j++
}
//将文件保存至服务器


+ 63
- 54
app/customer/svc/svc_central_kitchen_for_school_package.go Datei anzeigen

@@ -71,12 +71,13 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq)
}
totalPrice += utils.StrToFloat64(amount)
data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
}

@@ -90,12 +91,13 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq)
totalPrice += utils.StrToFloat64(amount)

data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForLunch,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForLunch,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
}

@@ -108,12 +110,13 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq)
}
totalPrice += utils.StrToFloat64(amount)
data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForDinner,
Date: v1.Date,
Amount: amount,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForDinner,
Date: v1.Date,
Amount: amount,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
}
}
@@ -181,12 +184,13 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota

totalPrice += utils.StrToFloat64(amount)
data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
}

@@ -200,12 +204,13 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota
totalPrice += utils.StrToFloat64(amount)

data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForLunch,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Amount: amount,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForLunch,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
}

@@ -218,12 +223,13 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota
}
totalPrice += utils.StrToFloat64(amount)
data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForDinner,
Amount: amount,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForDinner,
Amount: amount,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
}
}
@@ -276,12 +282,13 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP
}

data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
Date: v1.Date,
Amount: amount,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
Date: v1.Date,
Amount: amount,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
totalPrice += utils.StrToFloat64(amount)
}
@@ -295,12 +302,13 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP
}
totalPrice += utils.StrToFloat64(amount)
data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForLunch,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Amount: amount,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForLunch,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Amount: amount,
})
}

@@ -313,12 +321,13 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP
}
totalPrice += utils.StrToFloat64(amount)
data = append(data, &model.CentralKitchenForSchoolUserWithDay{
Uid: uid,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForDinner,
Amount: amount,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
Uid: uid,
EnterpriseId: buyPackageReq.EnterpriseId,
IdentityId: buyPackageReq.UserIdentityId,
Kind: enum.CentralKitchenForSchoolUserWithDayKindForDinner,
Amount: amount,
Date: v1.Date,
State: enum.CentralKitchenForSchoolUserWithDayStateForWait,
})
}
}


+ 9
- 8
app/db/model/central_kitchen_for_school_user_with_day.go Datei anzeigen

@@ -1,12 +1,13 @@
package model

type CentralKitchenForSchoolUserWithDay struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
OrdNo string `json:"ord_no" xorm:"not null default '' comment('订单号') VARCHAR(50)"`
Uid int `json:"uid" xorm:"not null default 0 comment('用户id') INT(11)"`
IdentityId int `json:"identity_id" xorm:"not null default 0 comment('身份id') INT(11)"`
Kind int `json:"kind" xorm:"not null default 1 comment('就餐类型(1:早餐 2:午餐 3:晚餐)') TINYINT(1)"`
Amount string `json:"amount" xorm:"not null default '' comment('金额') CHAR(50)"`
Date string `json:"date" xorm:"not null default '0000-00-00' comment('日期') CHAR(50)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:待就餐 2:已就餐 3:退款中 4:已退款)') TINYINT(1)"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
OrdNo string `json:"ord_no" xorm:"not null default '' comment('订单号') VARCHAR(50)"`
Uid int `json:"uid" xorm:"not null default 0 comment('用户id') INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('校企id') INT(11)"`
IdentityId int `json:"identity_id" xorm:"not null default 0 comment('身份id') INT(11)"`
Kind int `json:"kind" xorm:"not null default 1 comment('就餐类型(1:早餐 2:午餐 3:晚餐)') TINYINT(1)"`
Amount string `json:"amount" xorm:"not null default '' comment('金额') CHAR(50)"`
Date string `json:"date" xorm:"not null default '0000-00-00' comment('日期') CHAR(50)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:待就餐 2:已就餐 3:退款中 4:已退款)') TINYINT(1)"`
}

Laden…
Abbrechen
Speichern