@@ -910,6 +910,7 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) { | |||||
set.IsOpenTeacherReportMealForMonth = req.IsOpenTeacherReportMealForMonth | set.IsOpenTeacherReportMealForMonth = req.IsOpenTeacherReportMealForMonth | ||||
set.IsOpenTeacherReportMealForSemester = req.IsOpenTeacherReportMealForSemester | set.IsOpenTeacherReportMealForSemester = req.IsOpenTeacherReportMealForSemester | ||||
set.IsOpenLimitOrderFood = req.IsOpenLimitOrderFood | set.IsOpenLimitOrderFood = req.IsOpenLimitOrderFood | ||||
set.IsOpenLimitTeacherRegister = req.IsOpenLimitTeacherRegister | |||||
set.UpdateAt = now.Format("2006-01-02 15:04:05") | set.UpdateAt = now.Format("2006-01-02 15:04:05") | ||||
_, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetUpdate(set.Id, set, | _, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetUpdate(set.Id, set, | ||||
@@ -930,6 +931,7 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) { | |||||
IsOpenTeacherReportMealForMonth: req.IsOpenTeacherReportMealForMonth, | IsOpenTeacherReportMealForMonth: req.IsOpenTeacherReportMealForMonth, | ||||
IsOpenTeacherReportMealForSemester: req.IsOpenTeacherReportMealForSemester, | IsOpenTeacherReportMealForSemester: req.IsOpenTeacherReportMealForSemester, | ||||
IsOpenLimitOrderFood: req.IsOpenLimitOrderFood, | IsOpenLimitOrderFood: req.IsOpenLimitOrderFood, | ||||
IsOpenLimitTeacherRegister: req.IsOpenLimitTeacherRegister, | |||||
CreateAt: now.Format("2006-01-02 15:04:05"), | CreateAt: now.Format("2006-01-02 15:04:05"), | ||||
UpdateAt: now.Format("2006-01-02 15:04:05"), | UpdateAt: now.Format("2006-01-02 15:04:05"), | ||||
}) | }) | ||||
@@ -1028,6 +1030,7 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) { | |||||
IsOpenTeacherReportMealForMonth: 1, | IsOpenTeacherReportMealForMonth: 1, | ||||
IsOpenTeacherReportMealForSemester: 1, | IsOpenTeacherReportMealForSemester: 1, | ||||
IsOpenLimitOrderFood: 2, | IsOpenLimitOrderFood: 2, | ||||
IsOpenLimitTeacherRegister: 2, | |||||
CreateAt: time.Now().Format("2006-01-02 15:04:05"), | CreateAt: time.Now().Format("2006-01-02 15:04:05"), | ||||
UpdateAt: time.Now().Format("2006-01-02 15:04:05"), | UpdateAt: time.Now().Format("2006-01-02 15:04:05"), | ||||
} | } | ||||
@@ -240,6 +240,7 @@ type SetBasicCentralKitchenForSchoolReq struct { | |||||
IsOpenTeacherReportMealForMonth int `json:"is_open_teacher_report_meal_for_month" label:"开启教师按月报餐(1:开启 2:关闭)"` | 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:关闭)"` | IsOpenTeacherReportMealForSemester int `json:"is_open_teacher_report_meal_for_semester" label:"开启教师按学期报餐(1:开启 2:关闭)"` | ||||
IsOpenLimitOrderFood int `json:"is_open_limit_order_food" label:"是否开启限制订餐(1:开启 2:关闭)"` | IsOpenLimitOrderFood int `json:"is_open_limit_order_food" label:"是否开启限制订餐(1:开启 2:关闭)"` | ||||
IsOpenLimitTeacherRegister int `json:"is_open_limit_teacher_register" label:"是否开启教师注册(1:开启 2:关闭)"` | |||||
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" label:"'教师报餐(1:开启 2:关闭)"` | IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" label:"'教师报餐(1:开启 2:关闭)"` | ||||
} | } | ||||
@@ -39,10 +39,18 @@ func SaveCentralKitchenForSchoolUserIdentity(c *gin.Context) { | |||||
now := time.Now() | now := time.Now() | ||||
if isHasUserIdentity == nil { | if isHasUserIdentity == nil { | ||||
if identity != enum.UserIdentityForCentralKitchenForStudent { | |||||
centralKitchenForSchoolSetDb := db.CentralKitchenForSchoolSetDb{} | |||||
centralKitchenForSchoolSetDb.Set(req.EnterpriseId) | |||||
set, err := centralKitchenForSchoolSetDb.GetCentralKitchenForSchoolSet() | |||||
if err != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||||
return | |||||
} | |||||
if identity != enum.UserIdentityForCentralKitchenForStudent && set.IsOpenLimitTeacherRegister == 1 { | |||||
e.OutErr(c, e.ERR_NO_DATA, "当前身份信息不存在") | e.OutErr(c, e.ERR_NO_DATA, "当前身份信息不存在") | ||||
return | return | ||||
} | } | ||||
//2、新增身份信息 | //2、新增身份信息 | ||||
userIdentity := &model.UserIdentity{ | userIdentity := &model.UserIdentity{ | ||||
Uid: user.Id, | Uid: user.Id, | ||||
@@ -19,6 +19,7 @@ type CentralKitchenForSchoolInfoResp struct { | |||||
IsOpenTeacherReportMealForMonth int `json:"is_open_teacher_report_meal_for_month" label:"开启教师按月报餐(1:开启 2:关闭)"` | 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:关闭)"` | IsOpenTeacherReportMealForSemester int `json:"is_open_teacher_report_meal_for_semester" label:"开启教师按学期报餐(1:开启 2:关闭)"` | ||||
IsOpenLimitOrderFood int `json:"is_open_limit_order_food" label:"是否开启限制订餐(1:开启 2:关闭)"` | IsOpenLimitOrderFood int `json:"is_open_limit_order_food" label:"是否开启限制订餐(1:开启 2:关闭)"` | ||||
IsOpenLimitTeacherRegister int `json:"is_open_limit_teacher_register" label:"是否开启教师注册(1:开启 2:关闭)"` | |||||
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐(1:开启 0:关闭)"` | IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐(1:开启 0:关闭)"` | ||||
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐(1:开启 0:关闭)"` | IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐(1:开启 0:关闭)"` | ||||
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐(1:开启 0:关闭)"` | IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐(1:开启 0:关闭)"` | ||||
@@ -80,6 +80,7 @@ func CentralKitchenForSchoolInfo(enterpriseId int) (err error, resp md.CentralKi | |||||
resp.IsOpenTeacherReportMealForMonth = set.IsOpenTeacherReportMealForMonth | resp.IsOpenTeacherReportMealForMonth = set.IsOpenTeacherReportMealForMonth | ||||
resp.IsOpenTeacherReportMealForSemester = set.IsOpenTeacherReportMealForSemester | resp.IsOpenTeacherReportMealForSemester = set.IsOpenTeacherReportMealForSemester | ||||
resp.IsOpenLimitOrderFood = set.IsOpenLimitOrderFood | resp.IsOpenLimitOrderFood = set.IsOpenLimitOrderFood | ||||
resp.IsOpenLimitTeacherRegister = set.IsOpenLimitTeacherRegister | |||||
} | } | ||||
return | return | ||||
} | } | ||||
@@ -11,6 +11,7 @@ type CentralKitchenForSchoolSet struct { | |||||
IsOpenTeacherReportMealForMonth int `json:"is_open_teacher_report_meal_for_month" 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)"` | 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)"` | IsOpenLimitOrderFood int `json:"is_open_limit_order_food" xorm:"not null default 2 comment('是否开启限制订餐(1:开启 2:关闭)') TINYINT(1)"` | ||||
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"` | CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
} | } |