|
|
@@ -65,3 +65,47 @@ func CentralKitchenForSchoolInfo(enterpriseId int) (err error, resp md.CentralKi |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func NursingHomePackageInfo(enterpriseId int) (err error, resp md.NursingHomePackageInfoResp) { |
|
|
|
//1、查询`enterprise` |
|
|
|
enterpriseDb := db.EnterpriseDb{} |
|
|
|
enterpriseDb.Set() |
|
|
|
enterprise, err := enterpriseDb.GetEnterprise(enterpriseId) |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|
resp.Name = enterprise.Name |
|
|
|
resp.Memo = enterprise.Memo |
|
|
|
resp.Kind = enterprise.Kind |
|
|
|
resp.State = enterprise.State |
|
|
|
|
|
|
|
//2、查询`central_kitchen_for_school_with_spec` |
|
|
|
centralKitchenForSchoolWithSpec := db.NursingHomeWithSpec{} |
|
|
|
centralKitchenForSchoolWithSpec.Set(enterpriseId) |
|
|
|
spec, err := centralKitchenForSchoolWithSpec.GetNursingHomeWithSpec() |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|
if spec != nil { |
|
|
|
resp.IsOpenBreakfast = spec.IsOpenBreakfast |
|
|
|
resp.IsOpenLunch = spec.IsOpenLunch |
|
|
|
resp.IsOpenDinner = spec.IsOpenDinner |
|
|
|
resp.BreakfastUnitPrice = spec.BreakfastUnitPrice |
|
|
|
resp.LunchUnitPrice = spec.LunchUnitPrice |
|
|
|
resp.DinnerUnitPrice = spec.DinnerUnitPrice |
|
|
|
} |
|
|
|
|
|
|
|
//3、查询`central_kitchen_for_school_set` |
|
|
|
centralKitchenForSchoolSetDb := db.NursingHomeSetDb{} |
|
|
|
centralKitchenForSchoolSetDb.Set(enterpriseId) |
|
|
|
set, err := centralKitchenForSchoolSetDb.GetNursingHomeSet() |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|
if set != nil { |
|
|
|
resp.IsOpenReportMealForDay = set.IsOpenReportMealForDay |
|
|
|
resp.IsOpenReportMealForMonth = set.IsOpenReportMealForMonth |
|
|
|
resp.IsOpenReportMealForYear = set.IsOpenReportMealForYear |
|
|
|
} |
|
|
|
return |
|
|
|
} |