刘光辉
118 分钟以前 06f314545ac3514d7ce28939920866ae8188d31c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package jnpf.elnService.template;
 
import jnpf.elnService.impl.ElnFieldCodeGenerator;
import org.springframework.stereotype.Service;
 
@Service
public class ElnTemplateCodeAssistService {
 
    public String suggest(String text) {
        if (text == null || text.trim().isEmpty()) {
            throw ElnTemplateOperationException.validation("中文名称不能为空");
        }
        String code = ElnFieldCodeGenerator.suggestSegmentedCode(text.trim());
        if (code.isEmpty()) {
            throw ElnTemplateOperationException.validation("中文名称无法生成有效编码");
        }
        return code;
    }
}