dengbiao 3 months ago
parent
commit
67b0b76094
6 changed files with 21 additions and 7 deletions
  1. +6
    -0
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +2
    -0
      app/admin/md/md_enterprise_manage.go
  3. +2
    -0
      app/customer/md/md_enterprise.go
  4. +2
    -0
      app/customer/svc/svc_enterprise.go
  5. +2
    -2
      app/customer/svc/svc_pay.go
  6. +7
    -5
      app/db/model/central_kitchen_for_school_set.go

+ 6
- 0
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go View File

@@ -910,6 +910,8 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
set.IsOpenTeacherReportMealForMonth = req.IsOpenTeacherReportMealForMonth
set.IsOpenTeacherReportMealForSemester = req.IsOpenTeacherReportMealForSemester
set.IsOpenLimitOrderFood = req.IsOpenLimitOrderFood
set.OrderFoodStartDate = req.OrderFoodStartDate
set.OrderFoodEndDate = req.OrderFoodEndDate
set.IsOpenLimitTeacherRegister = req.IsOpenLimitTeacherRegister
set.UpdateAt = now.Format("2006-01-02 15:04:05")

@@ -931,6 +933,8 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
IsOpenTeacherReportMealForMonth: req.IsOpenTeacherReportMealForMonth,
IsOpenTeacherReportMealForSemester: req.IsOpenTeacherReportMealForSemester,
IsOpenLimitOrderFood: req.IsOpenLimitOrderFood,
OrderFoodStartDate: req.OrderFoodStartDate,
OrderFoodEndDate: req.OrderFoodEndDate,
IsOpenLimitTeacherRegister: req.IsOpenLimitTeacherRegister,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
@@ -1030,6 +1034,8 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) {
IsOpenTeacherReportMealForMonth: 1,
IsOpenTeacherReportMealForSemester: 1,
IsOpenLimitOrderFood: 2,
OrderFoodStartDate: 1,
OrderFoodEndDate: 31,
IsOpenLimitTeacherRegister: 2,
CreateAt: time.Now().Format("2006-01-02 15:04:05"),
UpdateAt: time.Now().Format("2006-01-02 15:04:05"),


+ 2
- 0
app/admin/md/md_enterprise_manage.go View File

@@ -240,6 +240,8 @@ type SetBasicCentralKitchenForSchoolReq struct {
IsOpenTeacherReportMealForMonth int `json:"is_open_teacher_report_meal_for_month" label:"开启教师按月报餐(1:开启 2:关闭)"`
IsOpenTeacherReportMealForSemester int `json:"is_open_teacher_report_meal_for_semester" label:"开启教师按学期报餐(1:开启 2:关闭)"`
IsOpenLimitOrderFood int `json:"is_open_limit_order_food" label:"是否开启限制订餐(1:开启 2:关闭)"`
OrderFoodStartDate int `json:"order_food_start_date" label:"订餐时间-起始时间"`
OrderFoodEndDate int `json:"order_food_end_date" label:"订餐时间-截止时间"`
IsOpenLimitTeacherRegister int `json:"is_open_limit_teacher_register" label:"是否开启教师注册(1:开启 2:关闭)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" label:"'教师报餐(1:开启 2:关闭)"`
}


+ 2
- 0
app/customer/md/md_enterprise.go View File

@@ -19,6 +19,8 @@ type CentralKitchenForSchoolInfoResp struct {
IsOpenTeacherReportMealForMonth int `json:"is_open_teacher_report_meal_for_month" label:"开启教师按月报餐(1:开启 2:关闭)"`
IsOpenTeacherReportMealForSemester int `json:"is_open_teacher_report_meal_for_semester" label:"开启教师按学期报餐(1:开启 2:关闭)"`
IsOpenLimitOrderFood int `json:"is_open_limit_order_food" label:"是否开启限制订餐(1:开启 2:关闭)"`
OrderFoodStartDate int `json:"order_food_start_date" label:"订餐时间-起始时间"`
OrderFoodEndDate int `json:"order_food_end_date" label:"订餐时间-截止时间"`
IsOpenLimitTeacherRegister int `json:"is_open_limit_teacher_register" label:"是否开启教师注册(1:开启 2:关闭)"`
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐(1:开启 0:关闭)"`
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐(1:开启 0:关闭)"`


+ 2
- 0
app/customer/svc/svc_enterprise.go View File

@@ -80,6 +80,8 @@ func CentralKitchenForSchoolInfo(enterpriseId int) (err error, resp md.CentralKi
resp.IsOpenTeacherReportMealForMonth = set.IsOpenTeacherReportMealForMonth
resp.IsOpenTeacherReportMealForSemester = set.IsOpenTeacherReportMealForSemester
resp.IsOpenLimitOrderFood = set.IsOpenLimitOrderFood
resp.OrderFoodStartDate = set.OrderFoodStartDate
resp.OrderFoodEndDate = set.OrderFoodEndDate
resp.IsOpenLimitTeacherRegister = set.IsOpenLimitTeacherRegister
}
return


+ 2
- 2
app/customer/svc/svc_pay.go View File

@@ -35,8 +35,8 @@ func CheckIsOpenLimitOrderFood(enterpriseId int) (err error) {
if set != nil && set.IsOpenLimitOrderFood == 1 {
//TODO::判断每月25日至最后一日不可以订餐
day := time.Now().Day()
if day >= 25 {
return errors.New("每月25日至最后一日不可以订餐!")
if day >= set.OrderFoodStartDate && day <= set.OrderFoodEndDate {
return errors.New(fmt.Sprintf("每月%d日至%d日可以订餐!", set.OrderFoodStartDate, set.OrderFoodEndDate))
}
}
return


+ 7
- 5
app/db/model/central_kitchen_for_school_set.go View File

@@ -1,16 +1,18 @@
package model

type CentralKitchenForSchoolSet struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('所属单位id') INT(11)"`
Id int `json:"id" xorm:"not null pk autoincr INT"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('所属单位id') INT"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" xorm:"not null default 1 comment('教师报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForDay int `json:"is_open_report_meal_for_day" xorm:"not null default 1 comment('开启学生按天报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForMonth int `json:"is_open_report_meal_for_month" xorm:"not null default 1 comment('开启学生按月报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" xorm:"not null default 1 comment('开启学生按学期报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenTeacherReportMealForDay int `json:"is_open_teacher_report_meal_for_day" xorm:"not null default 1 comment('开启按天教师报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenTeacherReportMealForMonth int `json:"is_open_teacher_report_meal_for_month" xorm:"not null default 1 comment('开启按月教师报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenTeacherReportMealForSemester int `json:"is_open_teacher_report_meal_for_semester" xorm:"not null default 1 comment('开启按学期教师报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenTeacherReportMealForDay int `json:"is_open_teacher_report_meal_for_day" xorm:"not null default 1 comment('开启教师按天报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenTeacherReportMealForMonth int `json:"is_open_teacher_report_meal_for_month" xorm:"not null default 1 comment('开启教师按月报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenTeacherReportMealForSemester int `json:"is_open_teacher_report_meal_for_semester" xorm:"not null default 1 comment('开启教师按学期报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenLimitOrderFood int `json:"is_open_limit_order_food" xorm:"not null default 2 comment('是否开启限制订餐(1:开启 2:关闭)') TINYINT(1)"`
OrderFoodStartDate int `json:"order_food_start_date" xorm:"not null default '1000-01-01' comment('订餐时间-起始时间') DATE"`
OrderFoodEndDate int `json:"order_food_end_date" xorm:"not null default '1000-01-01' comment('订餐时间-截止时间') DATE"`
IsOpenLimitTeacherRegister int `json:"is_open_limit_teacher_register" xorm:"not null default 2 comment('是否开启教师注册(1:开启 2:关闭)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`


Loading…
Cancel
Save