java静态(static)方法中依赖注入调用Service层

@Component  // 交由spring管理
public class CommonUtil {
 
    @Autowired  // 注入
    private TRUserRoleService trUserRoleService;
 
    // 声明对象
    public static CommonUtil commonUtil;
 
    @PostConstruct // 初始化
    public void init(){
        commonUtil = this;
        commonUtil.trUserRoleService = this.trUserRoleService;
    }
 
 
    public static void getUserRoleList(TRUser user) {
        // 调用
        List userRoleList = commonUtil.trUserRoleService.findByUser(new TRUser(user.getId()));
        // 逻辑处理
    }
}