weaver-hrm-salary/src/com/engine/salary/util/SalaryI18nUtil.java

75 lines
2.2 KiB
Java
Raw Normal View History

2022-03-01 16:45:57 +08:00
package com.engine.salary.util;
2023-04-13 10:32:06 +08:00
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.systeminfo.SystemEnv;
2022-03-01 16:45:57 +08:00
/**
2022-08-11 10:27:15 +08:00
* 多语言工具类
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
2022-03-01 16:45:57 +08:00
public class SalaryI18nUtil {
2022-03-16 14:29:02 +08:00
/**
* 获取多语言信息
*
* @param labelId 多语言对应的labelId
* @param defaultLabel 默认中文
* @return
*/
public static String getI18nLabel(int labelId, String defaultLabel) {
return defaultLabel;
}
2023-04-13 10:32:06 +08:00
/**
* 获取所语言信息
*
* @param labelId 多语言对应的labelId
* @param languageId 用户语言id
* @param defaultLabel 默认中文
* @return
*/
2023-04-13 10:50:25 +08:00
public static String getI18nLabel(int languageId, int labelId, String defaultLabel) {
2023-04-13 10:32:06 +08:00
if(ObjectUtils.isEmpty(labelId) || ObjectUtils.isEmpty(languageId)){
return defaultLabel;
}
String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, languageId);
if(StringUtils.isBlank(htmlLabelName)){
return defaultLabel;
}
return htmlLabelName;
}
2022-03-01 16:45:57 +08:00
//
// /**
// * 获取多语言信息
// *
// * @param tenantKey 租户key
// * @param employeeId 人员id
// * @param labelId 多语言对应的labelId
// * @param defaultLabel 默认中文
// * @return
// */
// public static String getI18nLabel(String tenantKey, Long employeeId, int labelId, String defaultLabel) {
// int languageId = I18nLanguageUtil.getLangId(employeeId);
2023-04-19 10:15:01 +08:00
// return SalaryI18nUtil.getI18nLabel(labelId, languageId, tenantKey, defaultLabel);
2022-03-01 16:45:57 +08:00
// }
//
// /**
// * 获取多语言信息
// *
// * @param simpleEmployee 租户信息
// * @param labelId 多语言对应的labelId
// * @param defaultLabel 默认中文
// * @return
// */
2023-04-19 10:15:01 +08:00
// public static String getI18nLabel(DataCollectionEmployee simpleEmployee, int labelId, String defaultLabel) {
2022-03-01 16:45:57 +08:00
// int languageId = I18nLanguageUtil.getLangId(simpleEmployee.getEmployeeId());
2023-04-19 10:15:01 +08:00
// return SalaryI18nUtil.getI18nLabel(labelId, languageId, simpleEmployee.getTenantKey(), defaultLabel);
2022-03-01 16:45:57 +08:00
// }
}