多语言支持
This commit is contained in:
parent
554b3b75df
commit
31b9267493
|
|
@ -29,10 +29,10 @@ public class SingleDeptTreeVO {
|
|||
//@TableTitle(labelId = 547118, title = "编号", dataIndex = "departmentCode", key = "departmentCode")
|
||||
//private String departmentCode;
|
||||
|
||||
@TableTitle(title = "部门名称", dataIndex = "departmentMark", key = "departmentMark")
|
||||
@TableTitle(labelId = 547598, title = "部门名称", dataIndex = "departmentMark", key = "departmentMark")
|
||||
private String departmentMark;
|
||||
|
||||
@TableTitle(title = "部门简称", dataIndex = "departmentName", key = "departmentName")
|
||||
@TableTitle(labelId = 547599, title = "部门简称", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import lombok.NoArgsConstructor;
|
|||
)
|
||||
public class JobBrowserVO {
|
||||
|
||||
@OrganizationTableColumn(text = "标识", width = "25%", column = "id", display = false)
|
||||
@OrganizationTableColumn(labelId = 547597, text = "标识", width = "25%", column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
@OrganizationTableColumn(labelId = 547118, text = "编号", width = "25%", column = "job_no")
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
|
|||
public Map<String, Object> hasRight() {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
// TODO
|
||||
resultMap.put("hasRight", true);
|
||||
resultMap.put("hasRight", hasRight);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||
import weaver.general.Util;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -236,19 +237,21 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|||
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
|
||||
.build()).collect(Collectors.toList());
|
||||
|
||||
int language = user.getLanguage();
|
||||
String languageStr = String.valueOf(language);
|
||||
// 1.工作簿名称
|
||||
String sheetName = HrmI18nUtil.getI18nLabel(85368, "部门档案数据");
|
||||
String sheetName = HrmI18nUtil.getI18nLabel(85368, language, "部门档案数据");
|
||||
// 2.表头(后面动态获取)
|
||||
List<List<Object>> excelSheetData = new ArrayList<>();
|
||||
|
||||
String[] header = {
|
||||
HrmI18nUtil.getI18nLabel( -93270, "部门名称"),
|
||||
HrmI18nUtil.getI18nLabel( -93272, "编号"),
|
||||
HrmI18nUtil.getI18nLabel( -93274, "部门简称"),
|
||||
HrmI18nUtil.getI18nLabel( -93275, "所属分部"),
|
||||
HrmI18nUtil.getI18nLabel( -93278, "上级部门"),
|
||||
HrmI18nUtil.getI18nLabel( -93279, "部门负责人"),
|
||||
HrmI18nUtil.getI18nLabel( -93280, "启用状态")
|
||||
HrmI18nUtil.getI18nLabel(547598, language, "部门名称"),
|
||||
HrmI18nUtil.getI18nLabel(547118, language, "编号"),
|
||||
HrmI18nUtil.getI18nLabel(547599, language, "部门简称"),
|
||||
HrmI18nUtil.getI18nLabel(547128, language, "所属分部"),
|
||||
HrmI18nUtil.getI18nLabel(547189, language, "上级部门"),
|
||||
HrmI18nUtil.getI18nLabel(547190, language, "部门负责人"),
|
||||
HrmI18nUtil.getI18nLabel(547607, language, "启用状态")
|
||||
};
|
||||
excelSheetData.add(Arrays.asList(header));
|
||||
|
||||
|
|
@ -256,13 +259,13 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|||
List<List<Object>> rows = new LinkedList<>();
|
||||
for (DepartmentListDTO vo : dtoList) {
|
||||
List<Object> row = new LinkedList<>();
|
||||
row.add(vo.getDepartmentName());
|
||||
row.add(vo.getDepartmentCode());
|
||||
row.add(vo.getDepartmentMark());
|
||||
row.add(vo.getSubCompanyName());
|
||||
row.add(vo.getSupDepName());
|
||||
row.add(vo.getBmfzr());
|
||||
row.add(vo.getCanceled() == 0 ? "启用" : "未启用");
|
||||
row.add(Util.formatMultiLang(vo.getDepartmentName(), languageStr));
|
||||
row.add(Util.formatMultiLang(vo.getDepartmentCode(), languageStr));
|
||||
row.add(Util.formatMultiLang(vo.getDepartmentMark(), languageStr));
|
||||
row.add(Util.formatMultiLang(vo.getSubCompanyName(), languageStr));
|
||||
row.add(Util.formatMultiLang(vo.getSupDepName(), languageStr));
|
||||
row.add(Util.formatMultiLang(vo.getBmfzr(), languageStr));
|
||||
row.add(vo.getCanceled() == 0 ? SystemEnv.getHtmlLabelName(547186, language) : SystemEnv.getHtmlLabelName(547608,user.getLanguage()));
|
||||
rows.add(row);
|
||||
}
|
||||
excelSheetData.addAll(rows);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.engine.organization.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @description: 多语言工具类
|
||||
|
|
@ -18,6 +21,14 @@ public class HrmI18nUtil {
|
|||
public static String getI18nLabel(int labelId, String defaultLabel) {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public static String getI18nLabel(int labelId, int language, String defaultLabel) {
|
||||
if (labelId < 0) {
|
||||
return defaultLabel;
|
||||
}
|
||||
String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, labelId);
|
||||
return StringUtils.isNotBlank(htmlLabelName) ? htmlLabelName : defaultLabel;
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 获取多语言信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue