Merge remote-tracking branch 'origin/main' into lichang

This commit is contained in:
TsMask
2024-04-19 20:06:41 +08:00
34 changed files with 2291 additions and 396 deletions

View File

@@ -319,14 +319,21 @@ func (s *SysJobController) ResetQueueJob(c *gin.Context) {
func (s *SysJobController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
data := s.sysJobService.SelectJobPage(querys)
if data["total"].(int64) == 0 {
// querys := ctx.BodyJSONMap(c)
// data := s.sysJobService.SelectJobPage(querys)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysJob)
rows := s.sysJobService.SelectJobList(model.SysJob{})
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysJob)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysJob) {
@@ -345,10 +352,10 @@ func (s *SysJobController) Export(c *gin.Context) {
"B1": i18n.TKey(language, "job.export.jobName"),
"C1": i18n.TKey(language, "job.export.jobGroupName"),
"D1": i18n.TKey(language, "job.export.invokeTarget"),
"E1": i18n.TKey(language, "job.export.targetParams"),
"F1": i18n.TKey(language, "job.export.cronExpression"),
"G1": i18n.TKey(language, "job.export.status"),
"H1": i18n.TKey(language, "job.export.remark"),
"E1": i18n.TKey(language, "job.export.cronExpression"),
"F1": i18n.TKey(language, "job.export.status"),
"G1": i18n.TKey(language, "job.export.remark"),
// "E1": i18n.TKey(language, "job.export.targetParams"),
}
// 读取任务组名字典数据
dictSysJobGroup := s.sysDictDataService.SelectDictDataByType("sys_job_group")
@@ -375,10 +382,10 @@ func (s *SysJobController) Export(c *gin.Context) {
"B" + idx: row.JobName,
"C" + idx: sysJobGroup,
"D" + idx: row.InvokeTarget,
"E" + idx: row.TargetParams,
"F" + idx: row.CronExpression,
"G" + idx: statusValue,
"H" + idx: row.Remark,
"E" + idx: row.CronExpression,
"F" + idx: statusValue,
"G" + idx: row.Remark,
// "E" + idx: row.TargetParams,
})
}

View File

@@ -129,17 +129,24 @@ func (s *SysJobLogController) Clean(c *gin.Context) {
//
// POST /export
func (s *SysJobLogController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
data := s.sysJobLogService.SelectJobLogPage(querys)
if data["total"].(int64) == 0 {
c.JSON(200, result.ErrMsg("Export data record is empty"))
// querys := ctx.BodyJSONMap(c)
// data := s.sysJobLogService.SelectJobLogPage(querys)
// if data["total"].(int64) == 0 {
// c.JSON(200, result.ErrMsg("Export data record is empty"))
// return
// }
// rows := data["rows"].([]model.SysJobLog)
rows := s.sysJobLogService.SelectJobLogList(model.SysJobLog{})
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysJobLog)
// 闭包函数处理多语言
language := ctx.AcceptLanguage(c)
converI18n := func(language string, arr *[]model.SysJobLog) {
for i := range *arr {
(*arr)[i].JobName = i18n.TKey(language, (*arr)[i].JobName)
@@ -155,10 +162,11 @@ func (s *SysJobLogController) Export(c *gin.Context) {
"B1": i18n.TKey(language, "job.export.jobName"),
"C1": i18n.TKey(language, "job.export.jobGroupName"),
"D1": i18n.TKey(language, "job.export.invokeTarget"),
"E1": i18n.TKey(language, "job.export.targetParams"),
"F1": i18n.TKey(language, "job.export.jobID"),
"G1": i18n.TKey(language, "job.export.jobLogStatus"),
"H1": i18n.TKey(language, "job.export.jobLogTime"),
// "E1": i18n.TKey(language, "job.export.targetParams"),
// "F1": i18n.TKey(language, "job.export.jobID"),
"E1": i18n.TKey(language, "job.export.jobLogStatus"),
"F1": i18n.TKey(language, "job.export.jobLogTime"),
"G1": i18n.TKey(language, "log.operate.export.costTime"),
}
// 读取任务组名字典数据
dictSysJobGroup := s.sysDictDataService.SelectDictDataByType("sys_job_group")
@@ -184,10 +192,11 @@ func (s *SysJobLogController) Export(c *gin.Context) {
"B" + idx: row.JobName,
"C" + idx: sysJobGroup,
"D" + idx: row.InvokeTarget,
"E" + idx: row.TargetParams,
"F" + idx: row.JobMsg,
"G" + idx: statusValue,
"H" + idx: date.ParseDateToStr(row.CreateTime, date.YYYY_MM_DD_HH_MM_SS),
// "E" + idx: row.TargetParams,
// "F" + idx: row.JobMsg,
"E" + idx: statusValue,
"F" + idx: date.ParseDateToStr(row.CreateTime, date.YYYY_MM_DD_HH_MM_SS),
"G" + idx: row.CostTime,
})
}

View File

@@ -227,8 +227,10 @@ func (s *SysConfigController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
querys["pageNum"] = 1
querys["pageSize"] = 1000
data := s.sysConfigService.SelectConfigPage(querys)
if data["total"].(int64) == 0 {
if parse.Number(data["total"]) == 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return

View File

@@ -241,14 +241,21 @@ func (s *SysDictDataController) DictType(c *gin.Context) {
func (s *SysDictDataController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
data := s.sysDictDataService.SelectDictDataPage(querys)
if data["total"].(int64) == 0 {
// querys := ctx.BodyJSONMap(c)
// data := s.sysDictDataService.SelectDictDataPage(querys)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysDictData)
rows := s.sysDictDataService.SelectDictDataList(model.SysDictData{})
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysDictData)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysDictData) {
@@ -267,11 +274,10 @@ func (s *SysDictDataController) Export(c *gin.Context) {
// 第一行表头标题
headerCells := map[string]string{
"A1": i18n.TKey(language, "dictData.export.code"),
"B1": i18n.TKey(language, "dictData.export.sort"),
"C1": i18n.TKey(language, "dictData.export.label"),
"D1": i18n.TKey(language, "dictData.export.value"),
"E1": i18n.TKey(language, "dictData.export.type"),
"F1": i18n.TKey(language, "dictData.export.status"),
"B1": i18n.TKey(language, "dictData.export.label"),
"C1": i18n.TKey(language, "dictData.export.value"),
"D1": i18n.TKey(language, "dictData.export.sort"),
"E1": i18n.TKey(language, "dictData.export.status"),
}
// 从第二行开始的数据
dataCells := make([]map[string]any, 0)
@@ -283,11 +289,10 @@ func (s *SysDictDataController) Export(c *gin.Context) {
}
dataCells = append(dataCells, map[string]any{
"A" + idx: row.DictCode,
"B" + idx: row.DictSort,
"C" + idx: row.DictLabel,
"D" + idx: row.DictValue,
"E" + idx: row.DictType,
"F" + idx: statusValue,
"B" + idx: row.DictLabel,
"C" + idx: row.DictValue,
"D" + idx: row.DictSort,
"E" + idx: statusValue,
})
}

View File

@@ -244,14 +244,21 @@ func (s *SysDictTypeController) DictOptionselect(c *gin.Context) {
func (s *SysDictTypeController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
data := s.sysDictTypeService.SelectDictTypePage(querys)
if data["total"].(int64) == 0 {
// querys := ctx.BodyJSONMap(c)
// data := s.sysDictTypeService.SelectDictTypePage(querys)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysDictType)
rows := s.sysDictTypeService.SelectDictTypeList(model.SysDictType{})
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysDictType)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysDictType) {

View File

@@ -121,14 +121,21 @@ func (s *SysLogLoginController) Unlock(c *gin.Context) {
func (s *SysLogLoginController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
data := s.sysLogLoginService.SelectSysLogLoginPage(querys)
if data["total"].(int64) == 0 {
// querys := ctx.BodyJSONMap(c)
// data := s.sysLogLoginService.SelectSysLogLoginPage(querys)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysLogLogin)
rows := s.sysLogLoginService.SelectSysLogLoginList(model.SysLogLogin{})
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysLogLogin)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysLogLogin) {
@@ -147,13 +154,13 @@ func (s *SysLogLoginController) Export(c *gin.Context) {
headerCells := map[string]string{
"A1": i18n.TKey(language, "log.login.export.id"),
"B1": i18n.TKey(language, "log.login.export.userName"),
"C1": i18n.TKey(language, "log.login.export.status"),
"D1": i18n.TKey(language, "log.login.export.ip"),
"E1": i18n.TKey(language, "log.login.export.location"),
"C1": i18n.TKey(language, "log.login.export.ip"),
"D1": i18n.TKey(language, "log.login.export.location"),
"E1": i18n.TKey(language, "log.login.export.os"),
"F1": i18n.TKey(language, "log.login.export.browser"),
"G1": i18n.TKey(language, "log.login.export.os"),
"H1": i18n.TKey(language, "log.login.export.msg"),
"I1": i18n.TKey(language, "log.login.export.time"),
"G1": i18n.TKey(language, "log.login.export.status"),
"H1": i18n.TKey(language, "log.login.export.time"),
"I1": i18n.TKey(language, "log.login.export.msg"),
}
// 从第二行开始的数据
dataCells := make([]map[string]any, 0)
@@ -167,13 +174,13 @@ func (s *SysLogLoginController) Export(c *gin.Context) {
dataCells = append(dataCells, map[string]any{
"A" + idx: row.LoginID,
"B" + idx: row.UserName,
"C" + idx: statusValue,
"D" + idx: row.IPAddr,
"E" + idx: row.LoginLocation,
"C" + idx: row.IPAddr,
"D" + idx: row.LoginLocation,
"E" + idx: row.OS,
"F" + idx: row.Browser,
"G" + idx: row.OS,
"H" + idx: row.Msg,
"I" + idx: date.ParseDateToStr(row.LoginTime, date.YYYY_MM_DD_HH_MM_SS),
"G" + idx: statusValue,
"H" + idx: date.ParseDateToStr(row.LoginTime, date.YYYY_MM_DD_HH_MM_SS),
"I" + idx: row.Msg,
})
}

View File

@@ -102,14 +102,21 @@ func (s *SysLogOperateController) Clean(c *gin.Context) {
func (s *SysLogOperateController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
data := s.SysLogOperateService.SelectSysLogOperatePage(querys)
if data["total"].(int64) == 0 {
// querys := ctx.BodyJSONMap(c)
// data := s.SysLogOperateService.SelectSysLogOperatePage(querys)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysLogOperate)
rows := s.SysLogOperateService.SelectSysLogOperateList(model.SysLogOperate{})
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysLogOperate)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysLogOperate) {
@@ -127,19 +134,12 @@ func (s *SysLogOperateController) Export(c *gin.Context) {
"A1": i18n.TKey(language, "log.operate.export.id"),
"B1": i18n.TKey(language, "log.operate.export.title"),
"C1": i18n.TKey(language, "log.operate.export.businessType"),
"D1": i18n.TKey(language, "log.operate.export.method"),
"E1": i18n.TKey(language, "log.operate.export.requestMethod"),
"F1": i18n.TKey(language, "log.operate.export.operatorType"),
"G1": i18n.TKey(language, "log.operate.export.operName"),
"H1": i18n.TKey(language, "log.operate.export.deptName"),
"I1": i18n.TKey(language, "log.operate.export.url"),
"J1": i18n.TKey(language, "log.operate.export.ip"),
"K1": i18n.TKey(language, "log.operate.export.location"),
"L1": i18n.TKey(language, "log.operate.export.param"),
"M1": i18n.TKey(language, "log.operate.export.msg"),
"N1": i18n.TKey(language, "log.operate.export.status"),
"O1": i18n.TKey(language, "log.operate.export.costTime"),
"P1": i18n.TKey(language, "log.operate.export.operTime"),
"D1": i18n.TKey(language, "log.operate.export.operName"),
"E1": i18n.TKey(language, "log.operate.export.method"),
"F1": i18n.TKey(language, "log.operate.export.ip"),
"G1": i18n.TKey(language, "log.operate.export.status"),
"H1": i18n.TKey(language, "log.operate.export.operTime"),
"I1": i18n.TKey(language, "log.operate.export.costTime"),
}
// 从第二行开始的数据
dataCells := make([]map[string]any, 0)
@@ -147,8 +147,36 @@ func (s *SysLogOperateController) Export(c *gin.Context) {
idx := strconv.Itoa(i + 2)
// 业务类型
businessType := ""
// 操作类别
operatorType := ""
switch row.BusinessType {
case "0":
// 业务操作类型-其它
businessType = i18n.TKey(language, "dictData.operType.other")
case "1":
// 业务操作类型-新增
businessType = i18n.TKey(language, "dictData.operType.add")
case "2":
// 业务操作类型-修改
businessType = i18n.TKey(language, "dictData.operType.edit")
case "3":
// 业务操作类型-删除
businessType = i18n.TKey(language, "dictData.operType.delete")
case "4":
// 业务操作类型-授权
businessType = i18n.TKey(language, "dictData.operType.auth")
case "5":
// 业务操作类型-导出
businessType = i18n.TKey(language, "dictData.operType.export")
case "6":
// 业务操作类型-导入
businessType = i18n.TKey(language, "dictData.operType.import")
case "7":
// 业务操作类型-强退
businessType = i18n.TKey(language, "dictData.operType.forced quit")
case "8":
// 业务操作类型-清空数据
businessType = i18n.TKey(language, "dictData.operType.clear")
}
// 状态
statusValue := i18n.TKey(language, "dictData.fail")
if row.Status == "1" {
@@ -158,19 +186,12 @@ func (s *SysLogOperateController) Export(c *gin.Context) {
"A" + idx: row.OperID,
"B" + idx: row.Title,
"C" + idx: businessType,
"D" + idx: row.Method,
"D" + idx: row.OperName,
"E" + idx: row.RequestMethod,
"F" + idx: operatorType,
"G" + idx: row.OperName,
"H" + idx: row.DeptName,
"I" + idx: row.OperURL,
"J" + idx: row.OperIP,
"K" + idx: row.OperLocation,
"L" + idx: row.OperParam,
"M" + idx: row.OperMsg,
"N" + idx: statusValue,
"O" + idx: row.CostTime,
"P" + idx: date.ParseDateToStr(row.OperTime, date.YYYY_MM_DD_HH_MM_SS),
"F" + idx: row.OperIP,
"G" + idx: statusValue,
"H" + idx: date.ParseDateToStr(row.OperTime, date.YYYY_MM_DD_HH_MM_SS),
"I" + idx: row.CostTime,
})
}

View File

@@ -209,14 +209,21 @@ func (s *SysPostController) Remove(c *gin.Context) {
func (s *SysPostController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
data := s.sysPostService.SelectPostPage(querys)
if data["total"].(int64) == 0 {
// querys := ctx.BodyJSONMap(c)
// data := s.sysPostService.SelectPostPage(querys)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysPost)
rows := s.sysPostService.SelectPostList(model.SysPost{})
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysPost)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysPost) {
@@ -232,8 +239,8 @@ func (s *SysPostController) Export(c *gin.Context) {
// 第一行表头标题
headerCells := map[string]string{
"A1": i18n.TKey(language, "post.export.id"),
"B1": i18n.TKey(language, "post.export.code"),
"C1": i18n.TKey(language, "post.export.name"),
"B1": i18n.TKey(language, "post.export.name"),
"C1": i18n.TKey(language, "post.export.code"),
"D1": i18n.TKey(language, "post.export.sort"),
"E1": i18n.TKey(language, "post.export.status"),
}
@@ -247,8 +254,8 @@ func (s *SysPostController) Export(c *gin.Context) {
}
dataCells = append(dataCells, map[string]any{
"A" + idx: row.PostID,
"B" + idx: row.PostCode,
"C" + idx: row.PostName,
"B" + idx: row.PostName,
"C" + idx: row.PostCode,
"D" + idx: row.PostSort,
"E" + idx: statusValue,
})

View File

@@ -412,15 +412,22 @@ func (s *SysRoleController) AuthUserChecked(c *gin.Context) {
func (s *SysRoleController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
// querys := ctx.BodyJSONMap(c)
dataScopeSQL := ctx.LoginUserToDataScopeSQL(c, "d", "")
data := s.sysRoleService.SelectRolePage(querys, dataScopeSQL)
if data["total"].(int64) == 0 {
// data := s.sysRoleService.SelectRolePage(querys, dataScopeSQL)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysRole)
rows := s.sysRoleService.SelectRoleList(model.SysRole{}, dataScopeSQL)
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysRole)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysRole) {
@@ -439,23 +446,23 @@ func (s *SysRoleController) Export(c *gin.Context) {
"B1": i18n.TKey(language, "role.export.name"),
"C1": i18n.TKey(language, "role.export.key"),
"D1": i18n.TKey(language, "role.export.sort"),
"E1": i18n.TKey(language, "role.export.dataScope"),
"F1": i18n.TKey(language, "role.export.status"),
"E1": i18n.TKey(language, "role.export.status"),
// "F1": i18n.TKey(language, "role.export.dataScope"),
}
// 读取系统角色数据范围字典数据
dictSysRoleDatascope := s.sysDictDataService.SelectDictDataByType("sys_role_datascope")
// dictSysRoleDatascope := s.sysDictDataService.SelectDictDataByType("sys_role_datascope")
// 从第二行开始的数据
dataCells := make([]map[string]any, 0)
for i, row := range rows {
idx := strconv.Itoa(i + 2)
// 数据范围
dataScope := row.DataScope
for _, v := range dictSysRoleDatascope {
if row.DataScope == v.DictValue {
dataScope = i18n.TKey(language, v.DictLabel)
break
}
}
// dataScope := row.DataScope
// for _, v := range dictSysRoleDatascope {
// if row.DataScope == v.DictValue {
// dataScope = i18n.TKey(language, v.DictLabel)
// break
// }
// }
// 角色状态
statusValue := i18n.TKey(language, "dictData.disable")
if row.Status == "1" {
@@ -466,8 +473,8 @@ func (s *SysRoleController) Export(c *gin.Context) {
"B" + idx: row.RoleName,
"C" + idx: row.RoleKey,
"D" + idx: row.RoleSort,
"E" + idx: dataScope,
"F" + idx: statusValue,
"E" + idx: statusValue,
// "F" + idx: dataScope,
})
}

View File

@@ -473,15 +473,22 @@ func (s *SysUserController) Status(c *gin.Context) {
func (s *SysUserController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
querys := ctx.BodyJSONMap(c)
// querys := ctx.BodyJSONMap(c)
dataScopeSQL := ctx.LoginUserToDataScopeSQL(c, "d", "u")
data := s.sysUserService.SelectUserPage(querys, dataScopeSQL)
if data["total"].(int64) == 0 {
// data := s.sysUserService.SelectUserPage(querys, dataScopeSQL)
// if data["total"].(int64) == 0 {
// // 导出数据记录为空
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
// return
// }
// rows := data["rows"].([]model.SysUser)
rows := s.sysUserService.SelectUserList(model.SysUser{}, dataScopeSQL)
if len(rows) <= 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.SysUser)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysUser) {
@@ -503,31 +510,31 @@ func (s *SysUserController) Export(c *gin.Context) {
"A1": i18n.TKey(language, "user.export.id"),
"B1": i18n.TKey(language, "user.export.name"),
"C1": i18n.TKey(language, "user.export.nick"),
"D1": i18n.TKey(language, "user.export.email"),
"E1": i18n.TKey(language, "user.export.phone"),
"F1": i18n.TKey(language, "user.export.sex"),
"G1": i18n.TKey(language, "user.export.status"),
"H1": i18n.TKey(language, "user.export.role"),
"I1": i18n.TKey(language, "user.export.deptID"),
"J1": i18n.TKey(language, "user.export.deptName"),
"K1": i18n.TKey(language, "user.export.deptLeader"),
"L1": i18n.TKey(language, "user.export.loginIP"),
"M1": i18n.TKey(language, "user.export.loginDate"),
"D1": i18n.TKey(language, "user.export.role"),
"E1": i18n.TKey(language, "user.export.deptName"),
"F1": i18n.TKey(language, "user.export.loginIP"),
"G1": i18n.TKey(language, "user.export.loginDate"),
"H1": i18n.TKey(language, "user.export.status"),
// "F1": i18n.TKey(language, "user.export.sex"),
// "E1": i18n.TKey(language, "user.export.phone"),
// "D1": i18n.TKey(language, "user.export.email"),
// "I1": i18n.TKey(language, "user.export.deptID"),
// "K1": i18n.TKey(language, "user.export.deptLeader"),
}
// 读取用户性别字典数据
dictSysUserSex := s.sysDictDataService.SelectDictDataByType("sys_user_sex")
// dictSysUserSex := s.sysDictDataService.SelectDictDataByType("sys_user_sex")
// 从第二行开始的数据
dataCells := make([]map[string]any, 0)
for i, row := range rows {
idx := strconv.Itoa(i + 2)
// 用户性别
sysUserSex := row.Sex
for _, v := range dictSysUserSex {
if row.Sex == v.DictValue {
sysUserSex = i18n.TKey(language, v.DictLabel)
break
}
}
// sysUserSex := row.Sex
// for _, v := range dictSysUserSex {
// if row.Sex == v.DictValue {
// sysUserSex = i18n.TKey(language, v.DictLabel)
// break
// }
// }
// 帐号状态
statusValue := i18n.TKey(language, "dictData.disable")
if row.Status == "1" {
@@ -544,16 +551,16 @@ func (s *SysUserController) Export(c *gin.Context) {
"A" + idx: row.UserID,
"B" + idx: row.UserName,
"C" + idx: row.NickName,
"D" + idx: row.Email,
"E" + idx: row.PhoneNumber,
"F" + idx: sysUserSex,
"G" + idx: statusValue,
"H" + idx: userRole,
"I" + idx: row.Dept.DeptID,
"J" + idx: row.Dept.DeptName,
"K" + idx: row.Dept.Leader,
"L" + idx: row.LoginIP,
"M" + idx: date.ParseDateToStr(row.LoginDate, date.YYYY_MM_DD_HH_MM_SS),
"D" + idx: userRole,
"E" + idx: row.Dept.DeptName,
"F" + idx: row.LoginIP,
"G" + idx: date.ParseDateToStr(row.LoginDate, date.YYYY_MM_DD_HH_MM_SS),
"H" + idx: statusValue,
// "E" + idx: row.PhoneNumber,
// "F" + idx: sysUserSex,
// "D" + idx: row.Email,
// "I" + idx: row.Dept.DeptID,
// "K" + idx: row.Dept.Leader,
})
}

View File

@@ -32,7 +32,7 @@ func (r *SysUserImpl) SelectUserPage(query map[string]any, dataScopeSQL string)
// SelectUserList 根据条件查询用户列表
func (r *SysUserImpl) SelectUserList(sysUser model.SysUser, dataScopeSQL string) []model.SysUser {
return []model.SysUser{}
return r.sysUserRepository.SelectUserList(sysUser, dataScopeSQL)
}
// SelectAllocatedPage 根据条件分页查询分配用户角色列表