75 lines
2.2 KiB
Java
75 lines
2.2 KiB
Java
package com.engine.salary.util;
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
/**
|
|
* 多语言工具类
|
|
* <p>Copyright: Copyright (c) 2022</p>
|
|
* <p>Company: 泛微软件</p>
|
|
*
|
|
* @author qiantao
|
|
* @version 1.0
|
|
**/
|
|
public class SalaryI18nUtil {
|
|
|
|
/**
|
|
* 获取多语言信息
|
|
*
|
|
* @param labelId 多语言对应的labelId
|
|
* @param defaultLabel 默认中文
|
|
* @return
|
|
*/
|
|
public static String getI18nLabel(int labelId, String defaultLabel) {
|
|
return defaultLabel;
|
|
}
|
|
|
|
/**
|
|
* 获取所语言信息
|
|
*
|
|
* @param labelId 多语言对应的labelId
|
|
* @param languageId 用户语言id
|
|
* @param defaultLabel 默认中文
|
|
* @return
|
|
*/
|
|
public static String getI18nLabel(int languageId, int labelId, String defaultLabel) {
|
|
if(ObjectUtils.isEmpty(labelId) || ObjectUtils.isEmpty(languageId)){
|
|
return defaultLabel;
|
|
}
|
|
String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, languageId);
|
|
if(StringUtils.isBlank(htmlLabelName)){
|
|
return defaultLabel;
|
|
}
|
|
return htmlLabelName;
|
|
}
|
|
|
|
//
|
|
// /**
|
|
// * 获取多语言信息
|
|
// *
|
|
// * @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);
|
|
// return SalaryI18nUtil.getI18nLabel(labelId, languageId, tenantKey, defaultLabel);
|
|
// }
|
|
//
|
|
// /**
|
|
// * 获取多语言信息
|
|
// *
|
|
// * @param simpleEmployee 租户信息
|
|
// * @param labelId 多语言对应的labelId
|
|
// * @param defaultLabel 默认中文
|
|
// * @return
|
|
// */
|
|
// public static String getI18nLabel(DataCollectionEmployee simpleEmployee, int labelId, String defaultLabel) {
|
|
// int languageId = I18nLanguageUtil.getLangId(simpleEmployee.getEmployeeId());
|
|
// return SalaryI18nUtil.getI18nLabel(labelId, languageId, simpleEmployee.getTenantKey(), defaultLabel);
|
|
// }
|
|
}
|