|  | @@ -0,0 +1,42 @@
 | 
	
		
			
				|  |  | +package thyyxxk.webserver.service.dictionary;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.config.exception.ExceptionEnum;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.dao.his.dictionary.SelectionOptionsDao;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.entity.ResultVo;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.entity.dictionary.CodeName;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.entity.dictionary.ZdSelectionOptions;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.utils.ResultVoUtil;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.utils.StringUtil;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * @ClassName SelectionOptionsService
 | 
	
		
			
				|  |  | + * @Author hsh
 | 
	
		
			
				|  |  | + * @Date 2024/8/21 9:19
 | 
	
		
			
				|  |  | + * @Version 1.0
 | 
	
		
			
				|  |  | + * @Description 字典下拉选
 | 
	
		
			
				|  |  | + **/
 | 
	
		
			
				|  |  | +@Service
 | 
	
		
			
				|  |  | +@Slf4j
 | 
	
		
			
				|  |  | +public class SelectionOptionsService {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private final SelectionOptionsDao dao;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    public SelectionOptionsService(SelectionOptionsDao dao) {
 | 
	
		
			
				|  |  | +        this.dao = dao;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public ResultVo<List<CodeName>> selectDictByCode(String code){
 | 
	
		
			
				|  |  | +        ZdSelectionOptions options = dao.selectionOptionsByCode(code);
 | 
	
		
			
				|  |  | +        if(null == options || StringUtil.isBlank(options.getSql())){
 | 
	
		
			
				|  |  | +            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未查到【" + code + "】相关的字典信息,请检查!");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return ResultVoUtil.success(dao.selectDictByCode(options.getSql()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +}
 |