mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-05-06 15:54:42 +08:00
feat(国际化): 新增国际化
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.fastbee.system.convert;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fastbee.system.domain.AppLanguage;
|
||||
import com.fastbee.system.domain.vo.AppLanguageVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app语言Convert转换类
|
||||
*
|
||||
* @author zhuangpeng.li
|
||||
* @date 2024-11-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppLanguageConvert
|
||||
{
|
||||
|
||||
AppLanguageConvert INSTANCE = Mappers.getMapper(AppLanguageConvert.class);
|
||||
|
||||
/**
|
||||
* 实体类转换为VO类
|
||||
*
|
||||
* @param appLanguage
|
||||
* @return app语言集合
|
||||
*/
|
||||
AppLanguageVO convertAppLanguageVO(AppLanguage appLanguage);
|
||||
|
||||
/**
|
||||
* VO类转换为实体类集合
|
||||
*
|
||||
* @param appLanguageVO
|
||||
* @return app语言集合
|
||||
*/
|
||||
AppLanguage convertAppLanguage(AppLanguageVO appLanguageVO);
|
||||
|
||||
/**
|
||||
* 实体类转换为VO类集合
|
||||
*
|
||||
* @param appLanguageList
|
||||
* @return app语言集合
|
||||
*/
|
||||
List<AppLanguageVO> convertAppLanguageVOList(List<AppLanguage> appLanguageList);
|
||||
|
||||
/**
|
||||
* VO类转换为实体类
|
||||
*
|
||||
* @param appLanguageVOList
|
||||
* @return app语言集合
|
||||
*/
|
||||
List<AppLanguage> convertAppLanguageList(List<AppLanguageVO> appLanguageVOList);
|
||||
|
||||
/**
|
||||
* 实体类转换为VO类分页
|
||||
*
|
||||
* @param appLanguagePage
|
||||
* @return app语言分页
|
||||
*/
|
||||
Page<AppLanguageVO> convertAppLanguageVOPage(Page<AppLanguage> appLanguagePage);
|
||||
|
||||
/**
|
||||
* VO类转换为实体类
|
||||
*
|
||||
* @param appLanguageVOPage
|
||||
* @return app语言分页
|
||||
*/
|
||||
Page<AppLanguage> convertAppLanguagePage(Page<AppLanguageVO> appLanguageVOPage);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.fastbee.system.convert;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fastbee.system.domain.AppPreferences;
|
||||
import com.fastbee.system.domain.vo.AppPreferencesVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP用户偏好设置Convert转换类
|
||||
*
|
||||
* @author fastbee
|
||||
* @date 2024-12-03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppPreferencesConvert
|
||||
{
|
||||
|
||||
AppPreferencesConvert INSTANCE = Mappers.getMapper(AppPreferencesConvert.class);
|
||||
|
||||
/**
|
||||
* 实体类转换为VO类
|
||||
*
|
||||
* @param appPreferences
|
||||
* @return APP用户偏好设置集合
|
||||
*/
|
||||
AppPreferencesVO convertAppPreferencesVO(AppPreferences appPreferences);
|
||||
|
||||
/**
|
||||
* VO类转换为实体类集合
|
||||
*
|
||||
* @param appPreferencesVO
|
||||
* @return APP用户偏好设置集合
|
||||
*/
|
||||
AppPreferences convertAppPreferences(AppPreferencesVO appPreferencesVO);
|
||||
|
||||
/**
|
||||
* 实体类转换为VO类集合
|
||||
*
|
||||
* @param appPreferencesList
|
||||
* @return APP用户偏好设置集合
|
||||
*/
|
||||
List<AppPreferencesVO> convertAppPreferencesVOList(List<AppPreferences> appPreferencesList);
|
||||
|
||||
/**
|
||||
* VO类转换为实体类
|
||||
*
|
||||
* @param appPreferencesVOList
|
||||
* @return APP用户偏好设置集合
|
||||
*/
|
||||
List<AppPreferences> convertAppPreferencesList(List<AppPreferencesVO> appPreferencesVOList);
|
||||
|
||||
/**
|
||||
* 实体类转换为VO类分页
|
||||
*
|
||||
* @param appPreferencesPage
|
||||
* @return APP用户偏好设置分页
|
||||
*/
|
||||
Page<AppPreferencesVO> convertAppPreferencesVOPage(Page<AppPreferences> appPreferencesPage);
|
||||
|
||||
/**
|
||||
* VO类转换为实体类
|
||||
*
|
||||
* @param appPreferencesVOPage
|
||||
* @return APP用户偏好设置分页
|
||||
*/
|
||||
Page<AppPreferences> convertAppPreferencesPage(Page<AppPreferencesVO> appPreferencesVOPage);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.fastbee.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fastbee.common.core.domain.PageEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* app语言对象 app_language
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "AppLanguage", description = "app语言 app_language")
|
||||
@Data
|
||||
@TableName("app_language" )
|
||||
public class AppLanguage extends PageEntity implements Serializable {
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
/** 语言 */
|
||||
@ApiModelProperty("语言")
|
||||
private String language;
|
||||
|
||||
/** 国家 */
|
||||
@ApiModelProperty("国家")
|
||||
private String country;
|
||||
|
||||
/** 时区 */
|
||||
@ApiModelProperty("时区")
|
||||
private String timeZone;
|
||||
|
||||
/** 创建者 */
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/** 语言名称 */
|
||||
@ApiModelProperty("语言名称")
|
||||
private String langName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.fastbee.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* APP用户偏好设置对象 app_preferences
|
||||
*
|
||||
* @author fastbee
|
||||
* @date 2024-12-03
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "AppPreferences", description = "APP用户偏好设置 app_preferences")
|
||||
@Data
|
||||
@TableName("app_preferences" )
|
||||
public class AppPreferences extends BaseEntity implements Serializable{
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键id */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
/** 用户 */
|
||||
@ApiModelProperty("用户")
|
||||
private Long userId;
|
||||
|
||||
/** 语言 */
|
||||
@ApiModelProperty("语言")
|
||||
private String language;
|
||||
|
||||
/** 时区 */
|
||||
@ApiModelProperty("时区")
|
||||
private String timeZone;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.fastbee.system.domain;
|
||||
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 翻译对象 sys_translate
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Data
|
||||
public class SysTranslate extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
@Excel(name = "ID")
|
||||
private Long id;
|
||||
|
||||
/** zh_CN */
|
||||
@Excel(name = "zh-CN")
|
||||
private String zh_CN;
|
||||
|
||||
/** en_US */
|
||||
@Excel(name = "en-US")
|
||||
private String en_US;
|
||||
|
||||
/** 物模型翻译表使用 */
|
||||
private Long productId;
|
||||
|
||||
private String tableName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.fastbee.system.domain.vo;
|
||||
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* app语言对象 app_language
|
||||
*
|
||||
* @author zhuangpeng.li
|
||||
* @date 2024-11-25
|
||||
*/
|
||||
|
||||
@ApiModel(value = "AppLanguageVO", description = "app语言 app_language")
|
||||
@Data
|
||||
public class AppLanguageVO {
|
||||
|
||||
/** 主键ID */
|
||||
@Excel(name = "主键ID")
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
/** 语言 */
|
||||
@Excel(name = "语言")
|
||||
@ApiModelProperty("语言")
|
||||
private String language;
|
||||
|
||||
/** 国家 */
|
||||
@Excel(name = "国家")
|
||||
@ApiModelProperty("国家")
|
||||
private String country;
|
||||
|
||||
/** 时区 */
|
||||
@Excel(name = "时区")
|
||||
@ApiModelProperty("时区")
|
||||
private String timeZone;
|
||||
|
||||
/** 创建者 */
|
||||
@Excel(name = "创建者")
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
@Excel(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/** 语言名称 */
|
||||
@Excel(name = "语言名称")
|
||||
@ApiModelProperty("语言名称")
|
||||
private String langName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.fastbee.system.domain.vo;
|
||||
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* APP用户偏好设置对象 app_preferences
|
||||
*
|
||||
* @author fastbee
|
||||
* @date 2024-12-03
|
||||
*/
|
||||
|
||||
@ApiModel(value = "AppPreferencesVO", description = "APP用户偏好设置 app_preferences")
|
||||
@Data
|
||||
public class AppPreferencesVO {
|
||||
|
||||
/** 主键id */
|
||||
@Excel(name = "主键id")
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
/** 用户 */
|
||||
@Excel(name = "用户")
|
||||
@ApiModelProperty("用户")
|
||||
private Long userId;
|
||||
|
||||
/** 语言 */
|
||||
@Excel(name = "语言")
|
||||
@ApiModelProperty("语言")
|
||||
private String language;
|
||||
|
||||
/** 时区 */
|
||||
@Excel(name = "时区")
|
||||
@ApiModelProperty("时区")
|
||||
private String timeZone;
|
||||
|
||||
/** 创建者 */
|
||||
@Excel(name = "创建者")
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
@Excel(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@Excel(name = "更新者")
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("更新时间")
|
||||
@Excel(name = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.fastbee.system.mapper;
|
||||
|
||||
|
||||
import com.fastbee.common.mybatis.mapper.BaseMapperX;
|
||||
import com.fastbee.system.domain.AppLanguage;
|
||||
|
||||
/**
|
||||
* app语言Mapper接口
|
||||
*/
|
||||
public interface AppLanguageMapper extends BaseMapperX<AppLanguage>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.fastbee.system.mapper;
|
||||
|
||||
|
||||
import com.fastbee.common.mybatis.mapper.BaseMapperX;
|
||||
import com.fastbee.system.domain.AppPreferences;
|
||||
|
||||
/**
|
||||
* APP用户偏好设置Mapper接口
|
||||
*/
|
||||
public interface AppPreferencesMapper extends BaseMapperX<AppPreferences>
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -42,7 +42,15 @@ public interface SysDictDataMapper
|
||||
* @param dictCode 字典数据ID
|
||||
* @return 字典数据
|
||||
*/
|
||||
public SysDictData selectDictDataById(Long dictCode);
|
||||
public SysDictData selectDictDataById(@Param("dictCode") Long dictCode, @Param("language") String language);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询字典数据--返回所有语言
|
||||
*
|
||||
* @param dictData 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataListAll(SysDictData dictData);
|
||||
|
||||
/**
|
||||
* 查询字典数据
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.fastbee.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fastbee.common.core.domain.entity.SysDictData;
|
||||
import com.fastbee.common.core.domain.entity.SysDictType;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 字典表 数据层
|
||||
@@ -23,7 +26,7 @@ public interface SysDictTypeMapper
|
||||
*
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
public List<SysDictType> selectDictTypeAll();
|
||||
public List<SysDictType> selectDictTypeAll(@Param("language") String language);
|
||||
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
@@ -31,7 +34,7 @@ public interface SysDictTypeMapper
|
||||
* @param dictId 字典类型ID
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeById(Long dictId);
|
||||
public SysDictType selectDictTypeById(@Param("dictId") Long dictId, @Param("language") String language);
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
@@ -39,7 +42,7 @@ public interface SysDictTypeMapper
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeByType(String dictType);
|
||||
public SysDictType selectDictTypeByType(@Param("dictType") String dictType, @Param("language") String language);
|
||||
|
||||
/**
|
||||
* 通过字典ID删除字典信息
|
||||
@@ -79,5 +82,5 @@ public interface SysDictTypeMapper
|
||||
* @param dictType 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public SysDictType checkDictTypeUnique(String dictType);
|
||||
public List<SysDictType> checkDictTypeUnique(@Param("dictType") String dictType, @Param("language") String language);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public interface SysMenuMapper
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeAll();
|
||||
public List<SysMenu> selectMenuTreeAll(@Param("language") String language);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
@@ -63,7 +63,7 @@ public interface SysMenuMapper
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
public List<SysMenu> selectMenuTreeByUserId(@Param("userId") Long userId, @Param("language") String language);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询菜单树信息
|
||||
@@ -80,7 +80,7 @@ public interface SysMenuMapper
|
||||
* @param menuId 菜单ID
|
||||
* @return 菜单信息
|
||||
*/
|
||||
public SysMenu selectMenuById(Long menuId);
|
||||
public SysMenu selectMenuById(@Param("menuId") Long menuId, @Param("language") String language);
|
||||
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.fastbee.system.mapper;
|
||||
|
||||
import com.fastbee.common.mybatis.mapper.BaseMapperX;
|
||||
import com.fastbee.system.domain.SysTranslate;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 翻译Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysTranslateMapper extends BaseMapperX<SysTranslate>
|
||||
{
|
||||
|
||||
/**
|
||||
* 新增或修改翻译
|
||||
*
|
||||
* @param sysTranslate 翻译
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysTranslate(SysTranslate sysTranslate);
|
||||
|
||||
/**
|
||||
* 查询翻译列表
|
||||
*
|
||||
* @param sysTranslate 翻译
|
||||
* @return 翻译集合
|
||||
*/
|
||||
public List<SysTranslate> selectSysTranslateList(SysTranslate sysTranslate);
|
||||
|
||||
/**
|
||||
* 查询原表数据列表
|
||||
*
|
||||
* @param tableName 表名
|
||||
* @param idColumn id列名
|
||||
* @param nameColumn 名称列名
|
||||
* @return 翻译集合
|
||||
*/
|
||||
public List<SysTranslate> selectSourceList(@Param("tableName") String tableName, @Param("idColumn") String idColumn, @Param("nameColumn") String nameColumn, @Param("productId") Long productId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.fastbee.system.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fastbee.system.domain.AppLanguage;
|
||||
import com.fastbee.system.domain.vo.AppLanguageVO;
|
||||
|
||||
/**
|
||||
* app语言Service接口
|
||||
*/
|
||||
public interface IAppLanguageService extends IService<AppLanguage>
|
||||
{
|
||||
/**
|
||||
* 查询app语言
|
||||
*
|
||||
* @param id app语言主键
|
||||
* @return app语言
|
||||
*/
|
||||
public AppLanguage selectAppLanguageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询app语言列表
|
||||
*
|
||||
* @param appLanguage app语言
|
||||
* @return app语言分页集合
|
||||
*/
|
||||
Page<AppLanguageVO> pageAppLanguageVO(AppLanguage appLanguage);
|
||||
|
||||
/**
|
||||
* 新增app语言
|
||||
*
|
||||
* @param appLanguage app语言
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppLanguage(AppLanguage appLanguage);
|
||||
|
||||
/**
|
||||
* 修改app语言
|
||||
*
|
||||
* @param appLanguage app语言
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppLanguage(AppLanguage appLanguage);
|
||||
|
||||
/**
|
||||
* 批量删除app语言
|
||||
*
|
||||
* @param ids 需要删除的app语言主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppLanguageByIds(Long[] ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.fastbee.system.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fastbee.system.domain.AppPreferences;
|
||||
import com.fastbee.system.domain.vo.AppPreferencesVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP用户偏好设置Service接口
|
||||
*/
|
||||
public interface IAppPreferencesService extends IService<AppPreferences>
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询APP用户偏好设置列表
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return APP用户偏好设置分页集合
|
||||
*/
|
||||
Page<AppPreferencesVO> pageAppPreferencesVO(AppPreferences appPreferences);
|
||||
|
||||
/**
|
||||
* 查询APP用户偏好设置
|
||||
*
|
||||
* @param userId APP用户偏好设置主键
|
||||
* @return APP用户偏好设置
|
||||
*/
|
||||
public AppPreferences selectAppPreferencesByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询APP用户偏好设置列表
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return APP用户偏好设置集合
|
||||
*/
|
||||
List<AppPreferencesVO> listAppPreferencesVO(AppPreferences appPreferences);
|
||||
|
||||
/**
|
||||
* 新增APP用户偏好设置
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppPreferences(AppPreferences appPreferences);
|
||||
|
||||
/**
|
||||
* 修改APP用户偏好设置
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppPreferences(AppPreferences appPreferences);
|
||||
|
||||
/**
|
||||
* 批量删除APP用户偏好设置
|
||||
*
|
||||
* @param userIds 需要删除的APP用户偏好设置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppPreferencesByUserIds(Long[] userIds);
|
||||
|
||||
/**
|
||||
* 删除APP用户偏好设置信息
|
||||
*
|
||||
* @param userId APP用户偏好设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppPreferencesByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 新增或者更新用户偏好设置
|
||||
* @param appPreferences
|
||||
* @return
|
||||
*/
|
||||
public int addOrUpdate(AppPreferences appPreferences);
|
||||
|
||||
/**
|
||||
* 获取用户偏好语言
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public String getLanguage(Long userId);
|
||||
}
|
||||
@@ -50,9 +50,10 @@ public interface ISysMenuService
|
||||
* 根据用户ID查询菜单树信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param language 语言
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId, String language);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询菜单树信息
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.fastbee.system.service;
|
||||
|
||||
|
||||
import com.fastbee.system.domain.SysTranslate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 翻译Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
public interface ISysTranslateService
|
||||
{
|
||||
/**
|
||||
* 导入翻译列表
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public void importSysTranslate(List<SysTranslate> list, String type, Long productId);
|
||||
|
||||
/**
|
||||
* 查询翻译列表
|
||||
* @param sysTranslate 翻译类
|
||||
* @return 翻译列表
|
||||
*/
|
||||
public List<SysTranslate> selectSysTranslateList(SysTranslate sysTranslate, String type);
|
||||
|
||||
/**
|
||||
* 查询原表数据列表
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public List<SysTranslate> selectSourceList(String type, Long productId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.fastbee.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fastbee.common.utils.StringUtils;
|
||||
import com.fastbee.system.convert.AppLanguageConvert;
|
||||
import com.fastbee.system.domain.AppLanguage;
|
||||
import com.fastbee.system.domain.vo.AppLanguageVO;
|
||||
import com.fastbee.system.mapper.AppLanguageMapper;
|
||||
import com.fastbee.system.service.IAppLanguageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* app语言Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class AppLanguageServiceImpl extends ServiceImpl<AppLanguageMapper,AppLanguage> implements IAppLanguageService
|
||||
{
|
||||
@Resource
|
||||
private AppLanguageMapper appLanguageMapper;
|
||||
|
||||
/**
|
||||
* 查询app语言
|
||||
*
|
||||
* @param id app语言主键
|
||||
* @return app语言
|
||||
*/
|
||||
@Override
|
||||
public AppLanguage selectAppLanguageById(Long id)
|
||||
{
|
||||
return appLanguageMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询app语言分页列表
|
||||
*
|
||||
* @param appLanguage app语言
|
||||
* @return app语言
|
||||
*/
|
||||
@Override
|
||||
public Page<AppLanguageVO> pageAppLanguageVO(AppLanguage appLanguage) {
|
||||
LambdaQueryWrapper<AppLanguage> lqw = buildQueryWrapper(appLanguage);
|
||||
Page<AppLanguage> appLanguagePage = baseMapper.selectPage(new Page<>(appLanguage.getPageNum(), appLanguage.getPageSize()), lqw);
|
||||
return AppLanguageConvert.INSTANCE.convertAppLanguageVOPage(appLanguagePage);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<AppLanguage> buildQueryWrapper(AppLanguage query) {
|
||||
Map<String, Object> params = query.getParams();
|
||||
LambdaQueryWrapper<AppLanguage> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(query.getLanguage()), AppLanguage::getLanguage, query.getLanguage());
|
||||
lqw.eq(StringUtils.isNotBlank(query.getCountry()), AppLanguage::getCountry, query.getCountry());
|
||||
lqw.eq(StringUtils.isNotBlank(query.getTimeZone()), AppLanguage::getTimeZone, query.getTimeZone());
|
||||
lqw.like(StringUtils.isNotBlank(query.getLangName()), AppLanguage::getLangName, query.getLangName());
|
||||
|
||||
if (!Objects.isNull(params.get("beginTime")) &&
|
||||
!Objects.isNull(params.get("endTime"))) {
|
||||
lqw.between(AppLanguage::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增app语言
|
||||
*
|
||||
* @param appLanguage app语言
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppLanguage(AppLanguage appLanguage)
|
||||
{
|
||||
return appLanguageMapper.insert(appLanguage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app语言
|
||||
*
|
||||
* @param appLanguage app语言
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppLanguage(AppLanguage appLanguage)
|
||||
{
|
||||
return appLanguageMapper.updateById(appLanguage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除app语言
|
||||
*
|
||||
* @param ids 需要删除的app语言主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppLanguageByIds(Long[] ids)
|
||||
{
|
||||
return appLanguageMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.fastbee.system.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fastbee.common.enums.Language;
|
||||
import com.fastbee.common.utils.SecurityUtils;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.common.utils.StringUtils;
|
||||
import com.fastbee.system.convert.AppPreferencesConvert;
|
||||
import com.fastbee.system.domain.AppPreferences;
|
||||
import com.fastbee.system.domain.vo.AppPreferencesVO;
|
||||
import com.fastbee.system.mapper.AppPreferencesMapper;
|
||||
import com.fastbee.system.service.IAppPreferencesService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APP用户偏好设置Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class AppPreferencesServiceImpl extends ServiceImpl<AppPreferencesMapper,AppPreferences> implements IAppPreferencesService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询APP用户偏好设置分页列表
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return APP用户偏好设置
|
||||
*/
|
||||
@Override
|
||||
public Page<AppPreferencesVO> pageAppPreferencesVO(AppPreferences appPreferences) {
|
||||
LambdaQueryWrapper<AppPreferences> lqw = buildQueryWrapper(appPreferences);
|
||||
Page<AppPreferences> appPreferencesPage = baseMapper.selectPage(new Page<>(appPreferences.getPageNum(), appPreferences.getPageSize()), lqw);
|
||||
return AppPreferencesConvert.INSTANCE.convertAppPreferencesVOPage(appPreferencesPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询APP用户偏好设置
|
||||
*
|
||||
* @param userId APP用户偏好设置主键
|
||||
* @return APP用户偏好设置
|
||||
*/
|
||||
@Override
|
||||
public AppPreferences selectAppPreferencesByUserId(Long userId)
|
||||
{
|
||||
LambdaQueryWrapper<AppPreferences> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AppPreferences::getUserId, userId);
|
||||
AppPreferences appPreferences = baseMapper.selectOne(queryWrapper);
|
||||
if (appPreferences == null){
|
||||
appPreferences = new AppPreferences();
|
||||
}
|
||||
// 设置默认语言
|
||||
if (StringUtils.isEmpty(appPreferences.getLanguage())) {
|
||||
appPreferences.setLanguage(Language.DEFAULT.getValue());
|
||||
}
|
||||
return appPreferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询APP用户偏好设置列表
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return APP用户偏好设置
|
||||
*/
|
||||
@Override
|
||||
public List<AppPreferencesVO> listAppPreferencesVO(AppPreferences appPreferences) {
|
||||
LambdaQueryWrapper<AppPreferences> lqw = buildQueryWrapper(appPreferences);
|
||||
List<AppPreferences> appPreferencesList = baseMapper.selectList(lqw);
|
||||
return AppPreferencesConvert.INSTANCE.convertAppPreferencesVOList(appPreferencesList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增APP用户偏好设置
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppPreferences(AppPreferences appPreferences)
|
||||
{
|
||||
appPreferences.setCreateTime(DateUtils.getNowDate());
|
||||
return baseMapper.insert(appPreferences);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改APP用户偏好设置
|
||||
*
|
||||
* @param appPreferences APP用户偏好设置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppPreferences(AppPreferences appPreferences)
|
||||
{
|
||||
appPreferences.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseMapper.updateById(appPreferences);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除APP用户偏好设置
|
||||
*
|
||||
* @param userIds 需要删除的APP用户偏好设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppPreferencesByUserIds(Long[] userIds)
|
||||
{
|
||||
LambdaUpdateWrapper<AppPreferences> query = new LambdaUpdateWrapper<>();
|
||||
query.in(AppPreferences::getUserId, Arrays.asList(userIds));
|
||||
return baseMapper.delete(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除APP用户偏好设置信息
|
||||
*
|
||||
* @param userId APP用户偏好设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppPreferencesByUserId(Long userId)
|
||||
{
|
||||
LambdaUpdateWrapper<AppPreferences> query = new LambdaUpdateWrapper<>();
|
||||
query.eq(AppPreferences::getUserId, userId);
|
||||
return baseMapper.delete(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者更新用户偏好设置
|
||||
* @param appPreferences
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int addOrUpdate(AppPreferences appPreferences)
|
||||
{
|
||||
if (Objects.isNull(appPreferences.getId())){
|
||||
appPreferences.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
AppPreferences preferences = this.selectAppPreferencesByUserId(SecurityUtils.getUserId());
|
||||
if (!Objects.isNull(preferences)){
|
||||
return baseMapper.updateById(appPreferences);
|
||||
} else {
|
||||
return baseMapper.insert(appPreferences);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户偏好语言
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getLanguage(Long userId) {
|
||||
AppPreferences appPreferences = selectAppPreferencesByUserId(userId);
|
||||
return appPreferences.getLanguage();
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<AppPreferences> buildQueryWrapper(AppPreferences query) {
|
||||
Map<String, Object> params = query.getParams();
|
||||
LambdaQueryWrapper<AppPreferences> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(query.getUserId() != null, AppPreferences::getUserId, query.getUserId());
|
||||
lqw.eq(StringUtils.isNotBlank(query.getLanguage()), AppPreferences::getLanguage, query.getLanguage());
|
||||
lqw.eq(StringUtils.isNotBlank(query.getTimeZone()), AppPreferences::getTimeZone, query.getTimeZone());
|
||||
|
||||
if (!Objects.isNull(params.get("beginTime")) &&
|
||||
!Objects.isNull(params.get("endTime"))) {
|
||||
lqw.between(AppPreferences::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.fastbee.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fastbee.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.common.core.domain.entity.SysDictData;
|
||||
@@ -28,6 +30,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData)
|
||||
{
|
||||
dictData.setLanguage(SecurityUtils.getLanguage());
|
||||
return dictDataMapper.selectDictDataList(dictData);
|
||||
}
|
||||
|
||||
@@ -53,7 +56,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
@Override
|
||||
public SysDictData selectDictDataById(Long dictCode)
|
||||
{
|
||||
return dictDataMapper.selectDictDataById(dictCode);
|
||||
return dictDataMapper.selectDictDataById(dictCode, SecurityUtils.getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,13 +12,16 @@ import com.fastbee.system.service.ISysDictTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.fastbee.common.utils.SecurityUtils;
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.fastbee.common.constant.Constants.EN_US;
|
||||
import static com.fastbee.common.constant.Constants.ZH_CN;
|
||||
|
||||
/**
|
||||
* 字典 业务层处理
|
||||
*
|
||||
@@ -51,6 +54,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType)
|
||||
{
|
||||
dictType.setLanguage(SecurityUtils.getLanguage());
|
||||
return dictTypeMapper.selectDictTypeList(dictType);
|
||||
}
|
||||
|
||||
@@ -62,7 +66,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeAll()
|
||||
{
|
||||
return dictTypeMapper.selectDictTypeAll();
|
||||
return dictTypeMapper.selectDictTypeAll(SecurityUtils.getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,12 +81,14 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||
if (StringUtils.isNotEmpty(dictDatas))
|
||||
{
|
||||
convertDictLabel(dictDatas, SecurityUtils.getLanguage());
|
||||
return dictDatas;
|
||||
}
|
||||
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
||||
if (StringUtils.isNotEmpty(dictDatas))
|
||||
{
|
||||
DictUtils.setDictCache(dictType, dictDatas);
|
||||
convertDictLabel(dictDatas, SecurityUtils.getLanguage());
|
||||
return dictDatas;
|
||||
}
|
||||
return null;
|
||||
@@ -97,7 +103,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
@Override
|
||||
public SysDictType selectDictTypeById(Long dictId)
|
||||
{
|
||||
return dictTypeMapper.selectDictTypeById(dictId);
|
||||
return dictTypeMapper.selectDictTypeById(dictId, SecurityUtils.getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,7 +115,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
@Override
|
||||
public SysDictType selectDictTypeByType(String dictType)
|
||||
{
|
||||
return dictTypeMapper.selectDictTypeByType(dictType);
|
||||
return dictTypeMapper.selectDictTypeByType(dictType, SecurityUtils.getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +146,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
{
|
||||
SysDictData dictData = new SysDictData();
|
||||
dictData.setStatus("0");
|
||||
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
|
||||
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataListAll(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
|
||||
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
|
||||
{
|
||||
DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
|
||||
@@ -193,7 +199,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
@Transactional
|
||||
public int updateDictType(SysDictType dict)
|
||||
{
|
||||
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
|
||||
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId(), SecurityUtils.getLanguage());
|
||||
dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
|
||||
int row = dictTypeMapper.updateDictType(dict);
|
||||
if (row > 0)
|
||||
@@ -214,11 +220,32 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
public boolean checkDictTypeUnique(SysDictType dict)
|
||||
{
|
||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
|
||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
|
||||
List<SysDictType> dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType(), SecurityUtils.getLanguage());
|
||||
if (!dictType.isEmpty() && dictType.get(0).getDictId().longValue() != dictId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 多语言转换
|
||||
* @param list
|
||||
* @param language
|
||||
* @return
|
||||
*/
|
||||
public static void convertDictLabel(List<SysDictData> list, String language) {
|
||||
switch (language) {
|
||||
case EN_US:
|
||||
for (SysDictData data : list) {
|
||||
data.setDictLabel(data.getDictLabel_en_US());
|
||||
}
|
||||
break;
|
||||
case ZH_CN:
|
||||
for (SysDictData data : list) {
|
||||
data.setDictLabel(data.getDictLabel_zh_CN());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
@Override
|
||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
|
||||
{
|
||||
menu.setLanguage(SecurityUtils.getLanguage());
|
||||
List<SysMenu> menuList = null;
|
||||
// 管理员显示所有菜单信息
|
||||
if (SysUser.isAdmin(userId))
|
||||
@@ -128,16 +129,16 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId)
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId, String language)
|
||||
{
|
||||
List<SysMenu> menus = null;
|
||||
if (SecurityUtils.isAdmin(userId))
|
||||
{
|
||||
menus = menuMapper.selectMenuTreeAll();
|
||||
menus = menuMapper.selectMenuTreeAll(language);
|
||||
}
|
||||
else
|
||||
{
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId);
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId, language);
|
||||
}
|
||||
return getChildPerms(menus, 0);
|
||||
}
|
||||
@@ -263,7 +264,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
@Override
|
||||
public SysMenu selectMenuById(Long menuId)
|
||||
{
|
||||
return menuMapper.selectMenuById(menuId);
|
||||
return menuMapper.selectMenuById(menuId, SecurityUtils.getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.fastbee.system.service.impl;
|
||||
|
||||
import com.fastbee.common.enums.TranslateType;
|
||||
import com.fastbee.system.domain.SysTranslate;
|
||||
import com.fastbee.system.mapper.SysTranslateMapper;
|
||||
import com.fastbee.system.service.ISysTranslateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static com.fastbee.common.constant.Constants.*;
|
||||
|
||||
/**
|
||||
* 翻译Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
@Service
|
||||
public class SysTranslateServiceImpl implements ISysTranslateService
|
||||
{
|
||||
@Resource
|
||||
private SysTranslateMapper sysTranslateMapper;
|
||||
|
||||
/**
|
||||
* 导入翻译列表
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public void importSysTranslate(List<SysTranslate> list, String type, Long productId) {
|
||||
TranslateType translateType = matchTranslateType(type);
|
||||
if (translateType == null) {
|
||||
return;
|
||||
}
|
||||
for (SysTranslate sysTranslate : list) {
|
||||
sysTranslate.setTableName(translateType.getTranslateTable());
|
||||
sysTranslate.setProductId(productId);
|
||||
sysTranslateMapper.insertSysTranslate(sysTranslate);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询翻译列表
|
||||
* @param sysTranslate 翻译类
|
||||
* @return 翻译列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysTranslate> selectSysTranslateList(SysTranslate sysTranslate, String type)
|
||||
{
|
||||
TranslateType translateType = matchTranslateType(type);
|
||||
if (translateType == null) {
|
||||
return null;
|
||||
}
|
||||
sysTranslate.setTableName(translateType.getTranslateTable());
|
||||
return sysTranslateMapper.selectSysTranslateList(sysTranslate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原表数据列表
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SysTranslate> selectSourceList(String type, Long productId) {
|
||||
TranslateType translateType = matchTranslateType(type);
|
||||
if (translateType == null) {
|
||||
return null;
|
||||
}
|
||||
return sysTranslateMapper.selectSourceList(translateType.getSourceTable(), translateType.getIdColumn(), translateType.getNameColumn(), productId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据type匹配对应的翻译类型
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public TranslateType matchTranslateType(String type) {
|
||||
switch (type) {
|
||||
case MENU:
|
||||
return TranslateType.MENU_TYPE;
|
||||
case DICT_DATA:
|
||||
return TranslateType.DICT_DATA_TYPE;
|
||||
case DICT_TYPE:
|
||||
return TranslateType.DICT_TYPE_TYPE;
|
||||
case THINGS_MODEL:
|
||||
return TranslateType.THINGS_MODEL_TYPE;
|
||||
case THINGS_MODEL_TEMPLATE:
|
||||
return TranslateType.THINGS_MODEL_TEMPLATE_TYPE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fastbee.system.mapper.AppLanguageMapper">
|
||||
|
||||
<resultMap type="com.fastbee.system.domain.AppLanguage" id="AppLanguageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="language" column="language" />
|
||||
<result property="country" column="country" />
|
||||
<result property="timeZone" column="time_zone" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="langName" column="lang_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppLanguageVo">
|
||||
select id, language, country, time_zone, create_by, create_time, lang_name from app_language
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fastbee.system.mapper.AppPreferencesMapper">
|
||||
|
||||
<resultMap type="com.fastbee.system.domain.AppPreferences" id="AppPreferencesResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="language" column="language" />
|
||||
<result property="timeZone" column="time_zone" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppPreferencesVo">
|
||||
select id, user_id, language, time_zone, create_by, create_time, update_by, update_time, remark from app_preferences
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@@ -52,8 +52,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
select d.dict_code, d.dict_sort,
|
||||
case
|
||||
when #{language} = 'zh-CN' then d.dict_label
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else d.dict_label
|
||||
end as dict_label,
|
||||
d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark
|
||||
from sys_dict_data d
|
||||
left join sys_dict_data_translate t on d.dict_code = t.id
|
||||
where d.dict_code = #{dictCode}
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataListAll" parameterType="com.fastbee.common.core.domain.entity.SysDictData" resultMap="SysDictDataResult">
|
||||
select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us,
|
||||
d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark
|
||||
from sys_dict_data d
|
||||
left join sys_dict_data_translate t on d.dict_code = t.id
|
||||
<where>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND d.dict_type = #{dictType}
|
||||
</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">
|
||||
AND d.dict_label like concat('%', #{dictLabel}, '%')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND d.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by d.dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="countDictDataByType" resultType="Integer">
|
||||
|
||||
@@ -21,7 +21,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
select d.dict_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then d.dict_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else d.dict_name
|
||||
end as dict_name,
|
||||
d.dict_type, d.status, d.create_by, d.create_time, d.remark
|
||||
from sys_dict_type d
|
||||
left join sys_dict_type_translate t on d.dict_id = t.id
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name like concat('%', #{dictName}, '%')
|
||||
@@ -42,22 +50,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
select d.dict_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then d.dict_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else d.dict_name
|
||||
end as dict_name,
|
||||
d.dict_type, d.status, d.create_by, d.create_time, d.remark
|
||||
from sys_dict_type d
|
||||
left join sys_dict_type_translate t on d.dict_id = t.id
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
select d.dict_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then d.dict_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else d.dict_name
|
||||
end as dict_name,
|
||||
d.dict_type, d.status, d.create_by, d.create_time, d.remark
|
||||
from sys_dict_type d
|
||||
left join sys_dict_type_translate t on d.dict_id = t.id
|
||||
where d.dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
select d.dict_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then d.dict_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else d.dict_name
|
||||
end as dict_name,
|
||||
d.dict_type, d.status, d.create_by, d.create_time, d.remark
|
||||
from sys_dict_type d
|
||||
left join sys_dict_type_translate t on d.dict_id = t.id
|
||||
where d.dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType} limit 1
|
||||
select d.dict_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then d.dict_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else d.dict_name
|
||||
end as dict_name,
|
||||
d.dict_type, d.status, d.create_by, d.create_time, d.remark
|
||||
from sys_dict_type d
|
||||
left join sys_dict_type_translate t on d.dict_id = t.id
|
||||
where d.dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
|
||||
@@ -33,7 +33,15 @@
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
select distinct m.menu_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then m.menu_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else m.menu_name
|
||||
end as menu_name,
|
||||
m.parent_id, m.order_num, m.path, m.component, m.query, m.is_frame, m.is_cache, m.menu_type, m.visible, m.status, ifnull(m.perms,'') as perms, m.icon, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_menu_translate t on m.menu_id = t.id
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND menu_name like concat('%', #{menuName}, '%')
|
||||
@@ -49,17 +57,33 @@
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
||||
select distinct m.menu_id, m.parent_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then m.menu_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else m.menu_name
|
||||
end as menu_name,
|
||||
m.menu_name as zn_ch,t.en_us,
|
||||
m.path, m.component, m.query, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_menu_translate t on m.menu_id = t.id
|
||||
where m.menu_type in ('M', 'C') and m.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
select distinct m.menu_id, m.parent_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then m.menu_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else m.menu_name
|
||||
end as menu_name,
|
||||
m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
left join sys_menu_translate t on m.menu_id = t.id
|
||||
where ur.user_id = #{params.userId}
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND m.menu_name like concat('%', #{menuName}, '%')
|
||||
@@ -74,12 +98,20 @@
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
select distinct m.menu_id, m.parent_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then m.menu_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else m.menu_name
|
||||
end as menu_name,
|
||||
m.menu_name as zn_ch,t.en_us,
|
||||
m.path, m.component, m.query, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
left join sys_user u on ur.user_id = u.user_id
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
left join sys_user u on ur.user_id = u.user_id
|
||||
left join sys_menu_translate t on m.menu_id = t.id
|
||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
@@ -119,8 +151,17 @@
|
||||
</select>
|
||||
|
||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_id = #{menuId}
|
||||
select distinct m.menu_id,
|
||||
case
|
||||
when #{language} = 'zh-CN' then m.menu_name
|
||||
when #{language} = 'en-US' then t.en_us
|
||||
else m.menu_name
|
||||
end as menu_name,
|
||||
m.menu_name as zn_ch,t.en_us,
|
||||
m.parent_id, m.order_num, m.path, m.component, m.query, m.is_frame, m.is_cache, m.menu_type, m.visible, m.status, COALESCE(m.perms, '') as perms, m.icon, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_menu_translate t on m.menu_id = t.id
|
||||
where m.menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="hasChildByMenuId" resultType="Integer">
|
||||
@@ -128,7 +169,8 @@
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
select distinct menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
||||
from sys_menu
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fastbee.system.mapper.SysTranslateMapper">
|
||||
|
||||
<resultMap type="com.fastbee.system.domain.SysTranslate" id="SysTranslateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="zh_CN" column="zh_cn" />
|
||||
<result property="en_US" column="en_us" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertSysTranslate" parameterType="com.fastbee.system.domain.SysTranslate">
|
||||
insert into ${tableName}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="zh_CN != null">zh_cn,</if>
|
||||
<if test="en_US != null">en_us</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="zh_CN != null">#{zh_CN},</if>
|
||||
<if test="en_US != null">#{en_US}</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="zh_CN != null">zh_cn = #{zh_CN},</if>
|
||||
<if test="en_US != null">en_us = #{en_US}</if>
|
||||
</insert>
|
||||
|
||||
<select id="selectSysTranslateList" parameterType="com.fastbee.system.domain.SysTranslate" resultMap="SysTranslateResult">
|
||||
select id, zh_cn, en_us from ${tableName}
|
||||
<where>
|
||||
<if test="zh_CN != null and zh_CN != ''"> and zh_cn = #{zh_CN}</if>
|
||||
<if test="en_US != null and en_US != ''"> and en_us = #{en_US}</if>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSourceList" resultType="com.fastbee.system.domain.SysTranslate" resultMap="SysTranslateResult">
|
||||
select ${idColumn} as id, ${nameColumn} as zh_cn from ${tableName}
|
||||
<where>
|
||||
<if test="productId != null">product_id = #{productId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -23,6 +23,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="language" column="language"/>
|
||||
<result property="timeZone" column="time_zone"/>
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
@@ -47,14 +49,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
|
||||
ap.language,ap.time_zone
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
left join app_preferences ap on u.user_id = ap.user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
|
||||
Reference in New Issue
Block a user