车间能级提升-智能设备管理系统
zhuguifei
2025-02-24 8a545b65a8d29961543a8d66bab2dbec58e5f89c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.dromara.common.translation.core.impl;
 
import lombok.AllArgsConstructor;
import org.dromara.common.core.service.FixtureTypeService;
import org.dromara.common.translation.annotation.TranslationType;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.common.translation.core.TranslationInterface;
 
/**
 * 工具类型名称翻译实现
 *
 * @author zhuguifei
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.FIXTURE_TYPE_ID_TO_NAME)
public class FixtureTypeNameTranslationImpl implements TranslationInterface<String> {
 
    private final FixtureTypeService fixtureTypeService;
 
    @Override
    public String translation(Object key, String other) {
        if (key instanceof String ids) {
            return fixtureTypeService.selectFixtureTypeNameByIds(ids);
        } else if (key instanceof Long id) {
            return fixtureTypeService.selectFixtureTypeNameByIds(id.toString());
        }
        return null;
    }
}