@@ -14,7 +14,7 @@ func MenuList(c *gin.Context) { | |||||
admin := svc.GetUser(c) | admin := svc.GetUser(c) | ||||
qrcodeWithBatchRecordsDb := db.PermissionGroupDb{} | qrcodeWithBatchRecordsDb := db.PermissionGroupDb{} | ||||
qrcodeWithBatchRecordsDb.Set() | qrcodeWithBatchRecordsDb.Set() | ||||
groupList, err := qrcodeWithBatchRecordsDb.FindPermissionGroup() | |||||
groupList, err := qrcodeWithBatchRecordsDb.FindPermissionGroupV2() | |||||
if err != nil { | if err != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | e.OutErr(c, e.ERR_DB_ORM, err.Error()) | ||||
return | return | ||||
@@ -46,6 +46,7 @@ func MenuList(c *gin.Context) { | |||||
var tempRespMap = map[string]*md.PermissionGroupListResp{} | var tempRespMap = map[string]*md.PermissionGroupListResp{} | ||||
var tempRespMapKeys []string | var tempRespMapKeys []string | ||||
for _, v := range *groupList { | for _, v := range *groupList { | ||||
var isCheck bool | var isCheck bool | ||||
if admin.IsSuperAdministrator == enum.IsSuperAdministratorTure { | if admin.IsSuperAdministrator == enum.IsSuperAdministratorTure { | ||||
isCheck = true | isCheck = true | ||||
@@ -56,6 +57,11 @@ func MenuList(c *gin.Context) { | |||||
if utils.InArr(utils.IntToStr(v.Id), adminHasPermissionGroupIds) { | if utils.InArr(utils.IntToStr(v.Id), adminHasPermissionGroupIds) { | ||||
isCheck = true | isCheck = true | ||||
} | } | ||||
if v.State == enum.PermissionGroupStateForNormal { | |||||
isCheck = false | |||||
} | |||||
tempRespMap[utils.IntToStr(v.Id)] = &md.PermissionGroupListResp{ | tempRespMap[utils.IntToStr(v.Id)] = &md.PermissionGroupListResp{ | ||||
Id: v.Id, | Id: v.Id, | ||||
Name: v.Name, | Name: v.Name, | ||||
@@ -224,7 +224,7 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta | |||||
switch req.Kind { | switch req.Kind { | ||||
case 1: | case 1: | ||||
//教师消费统计表 | //教师消费统计表 | ||||
xlsx, _ := excelize.OpenFile("./static/upload/自营学校(教师消费统计表).xlsx") | |||||
xlsx, _ := excelize.OpenFile("./static/template/自营学校(教师消费统计表).xlsx") | |||||
fileName = "教师消费统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" | fileName = "教师消费统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" | ||||
downloadPath = "/export/self_support_for_school/" + fileName | downloadPath = "/export/self_support_for_school/" + fileName | ||||
@@ -301,7 +301,7 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta | |||||
break | break | ||||
case 2: | case 2: | ||||
//商家分餐数据统计表 | //商家分餐数据统计表 | ||||
xlsx, _ := excelize.OpenFile("./static/upload/自营学校(商家分餐数据统计表).xlsx") | |||||
xlsx, _ := excelize.OpenFile("./static/template/自营学校(商家分餐数据统计表).xlsx") | |||||
fileName = "商家分餐数据统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" | fileName = "商家分餐数据统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" | ||||
downloadPath = "/export/self_support_for_school/" + fileName | downloadPath = "/export/self_support_for_school/" + fileName | ||||
@@ -22,3 +22,11 @@ func (permissionGroupDb *PermissionGroupDb) FindPermissionGroup() (*[]model.Perm | |||||
} | } | ||||
return &m, nil | return &m, nil | ||||
} | } | ||||
func (permissionGroupDb *PermissionGroupDb) FindPermissionGroupV2() (*[]model.PermissionGroup, error) { | |||||
var m []model.PermissionGroup | |||||
if err := permissionGroupDb.Db.Asc("id").Find(&m); err != nil { | |||||
return nil, logx.Error(err) | |||||
} | |||||
return &m, nil | |||||
} |