浏览代码

update

add_mode
DengBiao 1年前
父节点
当前提交
42fc409850
共有 8 个文件被更改,包括 100 次插入70 次删除
  1. +23
    -14
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +10
    -7
      app/admin/hdl/hdl_enterprise.go
  3. +17
    -14
      app/admin/md/md_central_kitchen_for_school.go
  4. +13
    -10
      app/admin/md/md_enterprise_manage.go
  5. +3
    -0
      app/admin/svc/svc_central_kitchen_for_school.go
  6. +20
    -17
      app/customer/md/md_enterprise.go
  7. +3
    -0
      app/customer/svc/svc_enterprise.go
  8. +11
    -8
      app/db/model/central_kitchen_for_school_set.go

+ 23
- 14
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go 查看文件

@@ -510,6 +510,9 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
set.IsOpenReportMealForDay = req.IsOpenReportMealForDay
set.IsOpenReportMealForMonth = req.IsOpenReportMealForMonth
set.IsOpenReportMealForSemester = req.IsOpenReportMealForSemester
set.IsOpenTeacherReportMealForDay = req.IsOpenTeacherReportMealForDay
set.IsOpenTeacherReportMealForMonth = req.IsOpenTeacherReportMealForMonth
set.IsOpenTeacherReportMealForSemester = req.IsOpenTeacherReportMealForSemester
set.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetUpdate(set.Id, set, "is_open_teacher_report_meal", "is_open_report_meal_for_day", "is_open_report_meal_for_month", "is_open_report_meal_for_semester", "update_at")
if err2 != nil {
@@ -518,13 +521,16 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
}
} else {
_, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetInsert(&model.CentralKitchenForSchoolSet{
EnterpriseId: req.EnterpriseId,
IsOpenTeacherReportMeal: req.IsOpenTeacherReportMeal,
IsOpenReportMealForDay: req.IsOpenReportMealForDay,
IsOpenReportMealForMonth: req.IsOpenReportMealForMonth,
IsOpenReportMealForSemester: req.IsOpenReportMealForSemester,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
EnterpriseId: req.EnterpriseId,
IsOpenTeacherReportMeal: req.IsOpenTeacherReportMeal,
IsOpenReportMealForDay: req.IsOpenReportMealForDay,
IsOpenReportMealForMonth: req.IsOpenReportMealForMonth,
IsOpenReportMealForSemester: req.IsOpenReportMealForSemester,
IsOpenTeacherReportMealForDay: req.IsOpenTeacherReportMealForDay,
IsOpenTeacherReportMealForMonth: req.IsOpenTeacherReportMealForMonth,
IsOpenTeacherReportMealForSemester: req.IsOpenTeacherReportMealForSemester,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
@@ -603,13 +609,16 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) {
}
if set == nil {
set = &model.CentralKitchenForSchoolSet{
EnterpriseId: enterpriseId,
IsOpenTeacherReportMeal: 0,
IsOpenReportMealForDay: 0,
IsOpenReportMealForMonth: 0,
IsOpenReportMealForSemester: 0,
CreateAt: time.Now().Format("2006-01-02 15:04:05"),
UpdateAt: time.Now().Format("2006-01-02 15:04:05"),
EnterpriseId: enterpriseId,
IsOpenTeacherReportMeal: 1,
IsOpenReportMealForDay: 1,
IsOpenReportMealForMonth: 1,
IsOpenReportMealForSemester: 1,
IsOpenTeacherReportMealForDay: 1,
IsOpenTeacherReportMealForMonth: 1,
IsOpenTeacherReportMealForSemester: 1,
CreateAt: time.Now().Format("2006-01-02 15:04:05"),
UpdateAt: time.Now().Format("2006-01-02 15:04:05"),
}
_, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetInsert(set)
if err2 != nil {


+ 10
- 7
app/admin/hdl/hdl_enterprise.go 查看文件

@@ -167,13 +167,16 @@ func EnterpriseAdd(c *gin.Context) {
centralKitchenForSchoolSetDb := db.CentralKitchenForSchoolSetDb{}
centralKitchenForSchoolSetDb.Set(enterpriseId)
centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetInsert(&model.CentralKitchenForSchoolSet{
EnterpriseId: enterpriseId,
IsOpenTeacherReportMeal: 1,
IsOpenReportMealForDay: 1,
IsOpenReportMealForMonth: 1,
IsOpenReportMealForSemester: 1,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
EnterpriseId: enterpriseId,
IsOpenTeacherReportMeal: 1,
IsOpenReportMealForDay: 1,
IsOpenReportMealForMonth: 1,
IsOpenReportMealForSemester: 1,
IsOpenTeacherReportMealForDay: 1,
IsOpenTeacherReportMealForMonth: 1,
IsOpenTeacherReportMealForSemester: 1,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})

centralKitchenForSchoolWithSpec := db.CentralKitchenForSchoolWithSpec{}


+ 17
- 14
app/admin/md/md_central_kitchen_for_school.go 查看文件

@@ -1,18 +1,21 @@
package md

type CentralKitchenForSchoolInfoResp struct {
Name string `json:"name" label:"名称"`
Memo string `json:"memo" label:"备注"`
Kind string `json:"kind" label:"种类(1:央厨-学校 2:央厨-工厂 3:自营-学校 4:自营-工厂)"`
State string `json:"state" label:"状态(1:正常 2:冻结)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" 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:关闭)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" label:"开启按学期报餐(1:开启 2:关闭)"`
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐(1:开启 0:关闭)"`
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐(1:开启 0:关闭)"`
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐(1:开启 0:关闭)"`
TeacherNum int64 `json:"teacher_num" label:"教师数量"`
StudentNum int64 `json:"student_num" label:"学生数量"`
ClassNum int64 `json:"class_num" label:"班级数量"`
Name string `json:"name" label:"名称"`
Memo string `json:"memo" label:"备注"`
Kind string `json:"kind" label:"种类(1:央厨-学校 2:央厨-工厂 3:自营-学校 4:自营-工厂)"`
State string `json:"state" label:"状态(1:正常 2:冻结)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" 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:关闭)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" label:"开启按学期报餐(1:开启 2:关闭)"`
IsOpenTeacherReportMealForDay int `json:"is_open_teacher_report_meal_for_day" 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:关闭)"`
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐(1:开启 0:关闭)"`
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐(1:开启 0:关闭)"`
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐(1:开启 0:关闭)"`
TeacherNum int64 `json:"teacher_num" label:"教师数量"`
StudentNum int64 `json:"student_num" label:"学生数量"`
ClassNum int64 `json:"class_num" label:"班级数量"`
}

+ 13
- 10
app/admin/md/md_enterprise_manage.go 查看文件

@@ -169,16 +169,19 @@ type SaveCentralKitchenForSchoolPackageReq struct {
}

type SetBasicCentralKitchenForSchoolReq struct {
EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"`
State int32 `json:"state" label:"状态(1:正常 2:冻结)"`
Name string `json:"name" binding:"required" label:"名称"`
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐"`
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐"`
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐"`
IsOpenReportMealForDay int `json:"is_open_report_meal_for_day" label:"开启按天报餐(1:开启 2:关闭)"`
IsOpenReportMealForMonth int `json:"is_open_report_meal_for_month" label:"开启按月报餐(1:开启 2:关闭)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" label:"开启按学期报餐(1:开启 2:关闭)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" label:"'教师报餐(1:开启 2:关闭)"`
EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"`
State int32 `json:"state" label:"状态(1:正常 2:冻结)"`
Name string `json:"name" binding:"required" label:"名称"`
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐"`
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐"`
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐"`
IsOpenReportMealForDay int `json:"is_open_report_meal_for_day" label:"开启学生按天报餐(1:开启 2:关闭)"`
IsOpenReportMealForMonth int `json:"is_open_report_meal_for_month" label:"开启学生按月报餐(1:开启 2:关闭)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" label:"开启学生按学期报餐(1:开启 2:关闭)"`
IsOpenTeacherReportMealForDay int `json:"is_open_teacher_report_meal_for_day" 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:关闭)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" label:"'教师报餐(1:开启 2:关闭)"`
}

type ListCentralKitchenForSchoolPackageReq struct {


+ 3
- 0
app/admin/svc/svc_central_kitchen_for_school.go 查看文件

@@ -44,6 +44,9 @@ func CentralKitchenForSchoolInfo(enterpriseId int) (err error, resp md.CentralKi
resp.IsOpenReportMealForDay = set.IsOpenReportMealForDay
resp.IsOpenReportMealForMonth = set.IsOpenReportMealForMonth
resp.IsOpenReportMealForSemester = set.IsOpenReportMealForSemester
resp.IsOpenTeacherReportMealForDay = set.IsOpenTeacherReportMealForDay
resp.IsOpenTeacherReportMealForMonth = set.IsOpenTeacherReportMealForMonth
resp.IsOpenTeacherReportMealForSemester = set.IsOpenTeacherReportMealForSemester
}

//4、统计 "教师"、 "学生"、 "班级" 数量


+ 20
- 17
app/customer/md/md_enterprise.go 查看文件

@@ -7,23 +7,26 @@ type EnterpriseListReq struct {
}

type CentralKitchenForSchoolInfoResp struct {
Name string `json:"name" label:"名称"`
Memo string `json:"memo" label:"备注"`
Kind int32 `json:"kind" label:"种类(1:央厨-学校 2:央厨-工厂 3:自营-学校 4:自营-工厂)"`
State int32 `json:"state" label:"状态(1:正常 2:冻结)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" 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:关闭)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" label:"开启按学期报餐(1:开启 2:关闭)"`
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐(1:开启 0:关闭)"`
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐(1:开启 0:关闭)"`
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐(1:开启 0:关闭)"`
BreakfastUnitPrice string `json:"breakfast_unit_price" label:"早餐-单价"`
BreakfastUnitPriceForTeacher string `json:"breakfast_unit_price_for_teacher" label:"教师-早餐-单价"`
LunchUnitPrice string `json:"lunch_unit_price" label:"午餐-单价"`
LunchUnitPriceForTeacher string `json:"lunch_unit_price_for_teacher" label:"教师-午餐-单价"`
DinnerUnitPrice string `json:"dinner_unit_price" label:"晚餐-单价"`
DinnerUnitPriceForTeacher string `json:"dinner_unit_price_for_teacher" label:"教师-晚餐-单价"`
Name string `json:"name" label:"名称"`
Memo string `json:"memo" label:"备注"`
Kind int32 `json:"kind" label:"种类(1:央厨-学校 2:央厨-工厂 3:自营-学校 4:自营-工厂)"`
State int32 `json:"state" label:"状态(1:正常 2:冻结)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" 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:关闭)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" label:"开启按学期报餐(1:开启 2:关闭)"`
IsOpenTeacherReportMealForDay int `json:"is_open_teacher_report_meal_for_day" 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:关闭)"`
IsOpenBreakfast int `json:"is_open_breakfast" label:"是否开启早餐(1:开启 0:关闭)"`
IsOpenLunch int `json:"is_open_lunch" label:"是否开启午餐(1:开启 0:关闭)"`
IsOpenDinner int `json:"is_open_dinner" label:"是否开启晚餐(1:开启 0:关闭)"`
BreakfastUnitPrice string `json:"breakfast_unit_price" label:"早餐-单价"`
BreakfastUnitPriceForTeacher string `json:"breakfast_unit_price_for_teacher" label:"教师-早餐-单价"`
LunchUnitPrice string `json:"lunch_unit_price" label:"午餐-单价"`
LunchUnitPriceForTeacher string `json:"lunch_unit_price_for_teacher" label:"教师-午餐-单价"`
DinnerUnitPrice string `json:"dinner_unit_price" label:"晚餐-单价"`
DinnerUnitPriceForTeacher string `json:"dinner_unit_price_for_teacher" label:"教师-晚餐-单价"`
}

type NursingHomePackageInfoResp struct {


+ 3
- 0
app/customer/svc/svc_enterprise.go 查看文件

@@ -62,6 +62,9 @@ func CentralKitchenForSchoolInfo(enterpriseId int) (err error, resp md.CentralKi
resp.IsOpenReportMealForDay = set.IsOpenReportMealForDay
resp.IsOpenReportMealForMonth = set.IsOpenReportMealForMonth
resp.IsOpenReportMealForSemester = set.IsOpenReportMealForSemester
resp.IsOpenTeacherReportMealForDay = set.IsOpenReportMealForSemester
resp.IsOpenTeacherReportMealForMonth = set.IsOpenTeacherReportMealForMonth
resp.IsOpenTeacherReportMealForSemester = set.IsOpenTeacherReportMealForSemester
}
return
}


+ 11
- 8
app/db/model/central_kitchen_for_school_set.go 查看文件

@@ -1,12 +1,15 @@
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)"`
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)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
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)"`
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)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

正在加载...
取消
保存