|
|
@@ -829,6 +829,49 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis |
|
|
|
// continue |
|
|
|
//} |
|
|
|
|
|
|
|
//获取当前预定记录下有多少退款记录 |
|
|
|
var state = 1 |
|
|
|
var stateZh = "已支付" |
|
|
|
|
|
|
|
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{} |
|
|
|
centralKitchenForSchoolUserWithDayDb.Set(0) |
|
|
|
count1, err1 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, |
|
|
|
v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) |
|
|
|
if err1 != nil { |
|
|
|
return nil, 0, err1 |
|
|
|
} |
|
|
|
if count1 > 0 { |
|
|
|
state = 2 |
|
|
|
stateZh = "退款中" |
|
|
|
} else { |
|
|
|
count2, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForCancel, |
|
|
|
v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) |
|
|
|
if err1 != nil { |
|
|
|
return nil, 0, err2 |
|
|
|
} |
|
|
|
if count2 > 0 { |
|
|
|
state = 3 |
|
|
|
stateZh = "部分退款" |
|
|
|
|
|
|
|
count3, err3 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForWait, |
|
|
|
v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) |
|
|
|
if err1 != nil { |
|
|
|
return nil, 0, err3 |
|
|
|
} |
|
|
|
if count3 == 0 { |
|
|
|
count4, err4 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForAlready, |
|
|
|
v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) |
|
|
|
if err1 != nil { |
|
|
|
return nil, 0, err4 |
|
|
|
} |
|
|
|
if count4 == 0 { |
|
|
|
state = 4 |
|
|
|
stateZh = "已退款" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resp = append(resp, md.CentralKitchenForSchoolReserveListResp{ |
|
|
|
Id: v.CentralKitchenForSchoolPackageOrdForReserve.Id, |
|
|
|
EnterpriseId: v.UserIdentity.EnterpriseId, |
|
|
@@ -846,6 +889,8 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis |
|
|
|
GradeId: v.Grade.Id, |
|
|
|
Class: v.Class.Name, |
|
|
|
ClassId: v.Class.Id, |
|
|
|
State: state, |
|
|
|
StateZh: stateZh, |
|
|
|
}) |
|
|
|
} |
|
|
|
return |
|
|
|