@@ -111,15 +111,15 @@ func SetNursingHomeWithSpec(c *gin.Context) { | |||||
now := time.Now() | now := time.Now() | ||||
if spec != nil { | if spec != nil { | ||||
insertConfirm, err1 := nursingHomeWithSpec.NursingHomeWithSpecInsert(&model.NursingHomeWithSpec{ | insertConfirm, err1 := nursingHomeWithSpec.NursingHomeWithSpecInsert(&model.NursingHomeWithSpec{ | ||||
IsOpenBreakfast: spec.IsOpenBreakfast, | |||||
IsOpenLunch: spec.IsOpenLunch, | |||||
IsOpenDinner: spec.IsOpenDinner, | |||||
EnterpriseId: req.EnterpriseId, | |||||
BreakfastUnitPrice: req.BreakfastUnitPrice, | |||||
LunchUnitPrice: req.LunchUnitPrice, | |||||
DinnerUnitPrice: req.DinnerUnitPrice, | |||||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||||
IsOpenBreakfast: spec.IsOpenBreakfast, | |||||
IsOpenLunch: spec.IsOpenLunch, | |||||
IsOpenDinner: spec.IsOpenDinner, | |||||
EnterpriseId: req.EnterpriseId, | |||||
BreakfastUnitPrice: req.BreakfastUnitPrice, | |||||
LunchUnitPrice: req.LunchUnitPrice, | |||||
DinnerUnitPrice: req.DinnerUnitPrice, | |||||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||||
}) | }) | ||||
if err1 != nil { | if err1 != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | ||||
@@ -131,12 +131,12 @@ func SetNursingHomeWithSpec(c *gin.Context) { | |||||
} | } | ||||
} else { | } else { | ||||
insertConfirm, err1 := nursingHomeWithSpec.NursingHomeWithSpecInsert(&model.NursingHomeWithSpec{ | insertConfirm, err1 := nursingHomeWithSpec.NursingHomeWithSpecInsert(&model.NursingHomeWithSpec{ | ||||
EnterpriseId: req.EnterpriseId, | |||||
BreakfastUnitPrice: req.BreakfastUnitPrice, | |||||
LunchUnitPrice: req.LunchUnitPrice, | |||||
DinnerUnitPrice: req.DinnerUnitPrice, | |||||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||||
EnterpriseId: req.EnterpriseId, | |||||
BreakfastUnitPrice: req.BreakfastUnitPrice, | |||||
LunchUnitPrice: req.LunchUnitPrice, | |||||
DinnerUnitPrice: req.DinnerUnitPrice, | |||||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||||
}) | }) | ||||
if err1 != nil { | if err1 != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | ||||
@@ -453,7 +453,7 @@ func NursingHomeOrdList(c *gin.Context) { | |||||
"total": total, | "total": total, | ||||
"kind_list": []map[string]string{ | "kind_list": []map[string]string{ | ||||
{ | { | ||||
"name": "按学期购买", | |||||
"name": "按年购买", | |||||
"value": "1", | "value": "1", | ||||
}, | }, | ||||
{ | { | ||||
@@ -71,6 +71,10 @@ func UserList(c *gin.Context) { | |||||
"name": enum.EnterprisePvd.String(enum.EnterprisePvdBySelfSupportForFactory), | "name": enum.EnterprisePvd.String(enum.EnterprisePvdBySelfSupportForFactory), | ||||
"value": enum.EnterprisePvdBySelfSupportForFactory, | "value": enum.EnterprisePvdBySelfSupportForFactory, | ||||
}, | }, | ||||
{ | |||||
"name": enum.EnterprisePvd.String(enum.EnterprisePvdByNursingHome), | |||||
"value": enum.EnterprisePvdByNursingHome, | |||||
}, | |||||
}, | }, | ||||
}, nil) | }, nil) | ||||
return | return | ||||
@@ -598,17 +598,14 @@ type SetBasicNursingHomeReq struct { | |||||
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐"` | IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐"` | ||||
IsOpenReportMealForDay int `json:"is_open_report_meal_for_day" label:"开启按天报餐(1:开启 2:关闭)"` | IsOpenReportMealForDay int `json:"is_open_report_meal_for_day" label:"开启按天报餐(1:开启 2:关闭)"` | ||||
IsOpenReportMealForMonth int `json:"is_open_report_meal_for_month" label:"开启按月报餐(1:开启 2:关闭)"` | IsOpenReportMealForMonth int `json:"is_open_report_meal_for_month" label:"开启按月报餐(1:开启 2:关闭)"` | ||||
IsOpenReportMealForYear int `json:"is_open_report_meal_for_semester" label:"开启按年报餐(1:开启 2:关闭)"` | |||||
IsOpenReportMealForYear int `json:"is_open_report_meal_for_year" label:"开启按年报餐(1:开启 2:关闭)"` | |||||
} | } | ||||
type SetNursingHomeWithSpecReq struct { | type SetNursingHomeWithSpecReq struct { | ||||
EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"` | |||||
BreakfastUnitPrice string `json:"breakfast_unit_price" binding:"required" label:"早餐-单价"` | |||||
BreakfastUnitPriceForTeacher string `json:"breakfast_unit_price_for_teacher" binding:"required" label:"教师-早餐-单价"` | |||||
LunchUnitPrice string `json:"lunch_unit_price" binding:"required" label:"午餐-单价"` | |||||
LunchUnitPriceForTeacher string `json:"lunch_unit_price_for_teacher" binding:"required" label:"教师-午餐-单价"` | |||||
DinnerUnitPrice string `json:"dinner_unit_price" binding:"required" label:"晚餐-单价"` | |||||
DinnerUnitPriceForTeacher string `json:"dinner_unit_price_for_teacher" binding:"required" label:"教师-晚餐-单价"` | |||||
EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"` | |||||
BreakfastUnitPrice string `json:"breakfast_unit_price" binding:"required" label:"早餐-单价"` | |||||
LunchUnitPrice string `json:"lunch_unit_price" binding:"required" label:"午餐-单价"` | |||||
DinnerUnitPrice string `json:"dinner_unit_price" binding:"required" label:"晚餐-单价"` | |||||
} | } | ||||
type SaveNursingHomePackageReq struct { | type SaveNursingHomePackageReq struct { | ||||
@@ -626,4 +623,4 @@ type SaveNursingHomePackageReq struct { | |||||
IsOpenDinner int32 `json:"is_open_dinner"` | IsOpenDinner int32 `json:"is_open_dinner"` | ||||
IsOpenReplenish int32 `json:"is_open_replenish"` | IsOpenReplenish int32 `json:"is_open_replenish"` | ||||
} `json:"date_list" binding:"required" label:"日期"` | } `json:"date_list" binding:"required" label:"日期"` | ||||
} | |||||
} |
@@ -113,6 +113,10 @@ func EnterpriseInfo(c *gin.Context) { | |||||
"name": enum.EnterprisePvd.String(enum.EnterprisePvdBySelfSupportForFactory), | "name": enum.EnterprisePvd.String(enum.EnterprisePvdBySelfSupportForFactory), | ||||
"value": enum.EnterprisePvdBySelfSupportForFactory, | "value": enum.EnterprisePvdBySelfSupportForFactory, | ||||
}, | }, | ||||
{ | |||||
"name": enum.EnterprisePvd.String(enum.EnterprisePvdByNursingHome), | |||||
"value": enum.EnterprisePvdByNursingHome, | |||||
}, | |||||
}, | }, | ||||
}, nil) | }, nil) | ||||
return | return | ||||
@@ -65,7 +65,7 @@ func NursingHomeOrderList(c *gin.Context) { | |||||
}, | }, | ||||
"kind_list": []map[string]string{ | "kind_list": []map[string]string{ | ||||
{ | { | ||||
"name": "按学期购买", | |||||
"name": "按年购买", | |||||
"value": "1", | "value": "1", | ||||
}, | }, | ||||
{ | { | ||||
@@ -162,7 +162,7 @@ func NursingHomeOrderDetail(c *gin.Context) { | |||||
}, | }, | ||||
"kind_list": []map[string]string{ | "kind_list": []map[string]string{ | ||||
{ | { | ||||
"name": "按学期购买", | |||||
"name": "按年购买", | |||||
"value": "1", | "value": "1", | ||||
}, | }, | ||||
{ | { | ||||
@@ -22,7 +22,7 @@ type NursingHomeBuyPackageReq struct { | |||||
UserIdentityId int `json:"user_identity_id" binding:"required" label:"用户身份id"` | UserIdentityId int `json:"user_identity_id" binding:"required" label:"用户身份id"` | ||||
PackageId int `json:"package_id" label:"套餐ID"` | PackageId int `json:"package_id" label:"套餐ID"` | ||||
PackageIds []int `json:"package_ids" label:"套餐ID"` | PackageIds []int `json:"package_ids" label:"套餐ID"` | ||||
Kind int `json:"kind" binding:"required" label:"购买类型(1:按学期购买 2:按月购买 3:按天购买 4:补餐)"` | |||||
Kind int `json:"kind" binding:"required" label:"购买类型(1:按年购买 2:按月购买 3:按天购买 4:补餐)"` | |||||
IsBuyBreakfast int `json:"is_buy_breakfast" label:"是否购买早餐(1:是 2:否)"` | IsBuyBreakfast int `json:"is_buy_breakfast" label:"是否购买早餐(1:是 2:否)"` | ||||
IsBuyLunch int `json:"is_buy_lunch" label:"是否购买午餐(1:是 2:否)"` | IsBuyLunch int `json:"is_buy_lunch" label:"是否购买午餐(1:是 2:否)"` | ||||
IsBuyDinner int `json:"is_buy_dinner" label:"是否购买晚餐(1:是 2:否)"` | IsBuyDinner int `json:"is_buy_dinner" label:"是否购买晚餐(1:是 2:否)"` | ||||
@@ -144,7 +144,7 @@ func NursingHomeBuyPackageReq(c *gin.Context, req md.NursingHomeBuyPackageReq) ( | |||||
return | return | ||||
} | } | ||||
//1、计算数据(1:按学期购买 2:按月购买 3:按天购买 4:补餐) | |||||
//1、计算数据(1:按年购买 2:按月购买 3:按天购买 4:补餐) | |||||
var totalPrice float64 | var totalPrice float64 | ||||
var data []*model.NursingHomeUserWithDay | var data []*model.NursingHomeUserWithDay | ||||
if req.Kind == 1 { | if req.Kind == 1 { | ||||