From 485cb5a08cbb66dd67b19c5778d51c0c0213b7af Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 11 Sep 2023 20:29:28 +0800 Subject: [PATCH] update --- app/admin/md/md_enterprise_manage.go | 17 +++-- .../svc_enterprise_manage.go | 76 ++++++++++--------- ...chen_for_school_package_ord_for_reserve.go | 1 + 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/app/admin/md/md_enterprise_manage.go b/app/admin/md/md_enterprise_manage.go index 74d2caf..1529ca9 100644 --- a/app/admin/md/md_enterprise_manage.go +++ b/app/admin/md/md_enterprise_manage.go @@ -21,14 +21,15 @@ type EnterpriseUserListByCentralKitchenForSchoolStruct struct { IsTeacher int `json:"is_teacher" label:"是否教师"` CreateAt string `json:"create_at" label:"创建时间"` UserIdentities []struct { - Id int `json:"id" label:"身份id"` - IdNo string `json:"id_no" label:"身份证号"` - SchoolName string `json:"school_name" label:"学校名"` - Name string `json:"name" label:"姓名"` - Grade string `json:"grade" label:"年级"` - GradeId int `json:"grade_id" label:"年级id"` - Class string `json:"class" label:"班级"` - ClassId int `json:"class_id" label:"班级id"` + Id int `json:"id" label:"身份id"` + EnterpriseId int `json:"enterprise_id" label:"企业id"` + IdNo string `json:"id_no" label:"身份证号"` + SchoolName string `json:"school_name" label:"学校名"` + Name string `json:"name" label:"姓名"` + Grade string `json:"grade" label:"年级"` + GradeId int `json:"grade_id" label:"年级id"` + Class string `json:"class" label:"班级"` + ClassId int `json:"class_id" label:"班级id"` } `json:"user_identities" label:"身份列表"` } diff --git a/app/admin/svc/enterprise_manage/svc_enterprise_manage.go b/app/admin/svc/enterprise_manage/svc_enterprise_manage.go index cc10c52..79d2638 100644 --- a/app/admin/svc/enterprise_manage/svc_enterprise_manage.go +++ b/app/admin/svc/enterprise_manage/svc_enterprise_manage.go @@ -68,15 +68,16 @@ func EnterpriseUserListByCentralKitchenForSchool(req md.EnterpriseUserListReq) ( //TODO::判断是否为老师 if v1.Identity == enum2.UserIdentityForCentralKitchenForTeacher { temp.UserIdentities = append(temp.UserIdentities, struct { - Id int `json:"id" label:"身份id"` - IdNo string `json:"id_no" label:"身份证号"` - SchoolName string `json:"school_name" label:"学校名"` - Name string `json:"name" label:"姓名"` - Grade string `json:"grade" label:"年级"` - GradeId int `json:"grade_id" label:"年级id"` - Class string `json:"class" label:"班级"` - ClassId int `json:"class_id" label:"班级id"` - }{Id: v1.Id, IdNo: v1.IdNo, SchoolName: "教师", Name: v1.Name, Grade: "教师", Class: "教师", GradeId: 0, ClassId: 0}) + Id int `json:"id" label:"身份id"` + EnterpriseId int `json:"enterprise_id" label:"企业id"` + IdNo string `json:"id_no" label:"身份证号"` + SchoolName string `json:"school_name" label:"学校名"` + Name string `json:"name" label:"姓名"` + Grade string `json:"grade" label:"年级"` + GradeId int `json:"grade_id" label:"年级id"` + Class string `json:"class" label:"班级"` + ClassId int `json:"class_id" label:"班级id"` + }{Id: v1.Id, EnterpriseId: v1.EnterpriseId, IdNo: v1.IdNo, SchoolName: "教师", Name: v1.Name, Grade: "教师", Class: "教师", GradeId: 0, ClassId: 0}) temp.IsTeacher = 1 } else { data, err2 := classWithUserDb.GetInfoByUserIdentityId(v1.Id) @@ -87,15 +88,16 @@ func EnterpriseUserListByCentralKitchenForSchool(req md.EnterpriseUserListReq) ( continue } temp.UserIdentities = append(temp.UserIdentities, struct { - Id int `json:"id" label:"身份id"` - IdNo string `json:"id_no" label:"身份证号"` - SchoolName string `json:"school_name" label:"学校名"` - Name string `json:"name" label:"姓名"` - Grade string `json:"grade" label:"年级"` - GradeId int `json:"grade_id" label:"年级id"` - Class string `json:"class" label:"班级"` - ClassId int `json:"class_id" label:"班级id"` - }{Id: v1.Id, IdNo: data.UserIdentity.IdNo, SchoolName: data.Enterprise.Name, Name: data.UserIdentity.Name, Grade: data.Grade.Name, Class: data.Class.Name, GradeId: data.Grade.Id, ClassId: data.Class.Id}) + Id int `json:"id" label:"身份id"` + EnterpriseId int `json:"enterprise_id" label:"企业id"` + IdNo string `json:"id_no" label:"身份证号"` + SchoolName string `json:"school_name" label:"学校名"` + Name string `json:"name" label:"姓名"` + Grade string `json:"grade" label:"年级"` + GradeId int `json:"grade_id" label:"年级id"` + Class string `json:"class" label:"班级"` + ClassId int `json:"class_id" label:"班级id"` + }{Id: v1.Id, EnterpriseId: v1.EnterpriseId, IdNo: data.UserIdentity.IdNo, SchoolName: data.Enterprise.Name, Name: data.UserIdentity.Name, Grade: data.Grade.Name, Class: data.Class.Name, GradeId: data.Grade.Id, ClassId: data.Class.Id}) } } resp.List = append(resp.List, temp) @@ -212,28 +214,30 @@ func EnterpriseUserListByCentralKitchenForSchoolV2(req md.EnterpriseUserListReq) //TODO::判断是否为老师 if v1.Identity == enum2.UserIdentityForCentralKitchenForTeacher { temp.UserIdentities = append(temp.UserIdentities, struct { - Id int `json:"id" label:"身份id"` - IdNo string `json:"id_no" label:"身份证号"` - SchoolName string `json:"school_name" label:"学校名"` - Name string `json:"name" label:"姓名"` - Grade string `json:"grade" label:"年级"` - GradeId int `json:"grade_id" label:"年级id"` - Class string `json:"class" label:"班级"` - ClassId int `json:"class_id" label:"班级id"` - }{Id: v1.UserIdentity.Id, IdNo: v1.IdNo, SchoolName: "教师", Name: v1.UserIdentity.Name, Grade: "教师", Class: "教师", GradeId: 0, ClassId: 0}) + Id int `json:"id" label:"身份id"` + EnterpriseId int `json:"enterprise_id" label:"企业id"` + IdNo string `json:"id_no" label:"身份证号"` + SchoolName string `json:"school_name" label:"学校名"` + Name string `json:"name" label:"姓名"` + Grade string `json:"grade" label:"年级"` + GradeId int `json:"grade_id" label:"年级id"` + Class string `json:"class" label:"班级"` + ClassId int `json:"class_id" label:"班级id"` + }{Id: v1.UserIdentity.Id, EnterpriseId: v1.UserIdentity.EnterpriseId, IdNo: v1.IdNo, SchoolName: "教师", Name: v1.UserIdentity.Name, Grade: "教师", Class: "教师", GradeId: 0, ClassId: 0}) temp.IsTeacher = 1 } if v1.Identity == enum2.UserIdentityForCentralKitchenForStudent { temp.UserIdentities = append(temp.UserIdentities, struct { - Id int `json:"id" label:"身份id"` - IdNo string `json:"id_no" label:"身份证号"` - SchoolName string `json:"school_name" label:"学校名"` - Name string `json:"name" label:"姓名"` - Grade string `json:"grade" label:"年级"` - GradeId int `json:"grade_id" label:"年级id"` - Class string `json:"class" label:"班级"` - ClassId int `json:"class_id" label:"班级id"` - }{Id: v1.UserIdentity.Id, IdNo: v1.UserIdentity.IdNo, SchoolName: v1.Enterprise.Name, Name: v1.UserIdentity.Name, Grade: v1.Grade.Name, Class: v1.Class.Name, GradeId: v1.Grade.Id, ClassId: v1.Class.Id}) + Id int `json:"id" label:"身份id"` + EnterpriseId int `json:"enterprise_id" label:"企业id"` + IdNo string `json:"id_no" label:"身份证号"` + SchoolName string `json:"school_name" label:"学校名"` + Name string `json:"name" label:"姓名"` + Grade string `json:"grade" label:"年级"` + GradeId int `json:"grade_id" label:"年级id"` + Class string `json:"class" label:"班级"` + ClassId int `json:"class_id" label:"班级id"` + }{Id: v1.UserIdentity.Id, EnterpriseId: v1.UserIdentity.EnterpriseId, IdNo: v1.UserIdentity.IdNo, SchoolName: v1.Enterprise.Name, Name: v1.UserIdentity.Name, Grade: v1.Grade.Name, Class: v1.Class.Name, GradeId: v1.Grade.Id, ClassId: v1.Class.Id}) } } resp.List = append(resp.List, temp) diff --git a/app/db/model/central_kitchen_for_school_package_ord_for_reserve.go b/app/db/model/central_kitchen_for_school_package_ord_for_reserve.go index fff3b80..c8283c7 100644 --- a/app/db/model/central_kitchen_for_school_package_ord_for_reserve.go +++ b/app/db/model/central_kitchen_for_school_package_ord_for_reserve.go @@ -11,6 +11,7 @@ type CentralKitchenForSchoolPackageOrdForReserve struct { ReserveMonth string `json:"reserve_month" xorm:"not null default '' comment('预定月份') CHAR(50)"` MealTimeStart string `json:"meal_time_start" xorm:"not null default '0000-00-00' comment('就餐时间-开始') CHAR(50)"` MealTimeEnd string `json:"meal_time_end" xorm:"not null default '0000-00-00' comment('就餐时间-截止') CHAR(50)"` + TotalPrice string `json:"total_price" xorm:"not null default 0.00 comment('总金额') DECIMAL(8,2)"` CreateAt string `json:"create_at" xorm:"not null pk default 'CURRENT_TIMESTAMP' DATETIME"` UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` }