Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
5710b1d743
3 changed files with 17 additions and 3 deletions
  1. +7
    -1
      app/admin/hdl/hdl_comm.go
  2. +2
    -2
      app/admin/svc/svc_data_statisstics.go
  3. +8
    -0
      app/db/db_permission_group.go

+ 7
- 1
app/admin/hdl/hdl_comm.go View File

@@ -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,


+ 2
- 2
app/admin/svc/svc_data_statisstics.go View File

@@ -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




+ 8
- 0
app/db/db_permission_group.go View File

@@ -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
}

Loading…
Cancel
Save