1、外部实体类引用service层
ApplicationContext appCtx = SpringContextUtil.getApplicationContext();
XXXService xxxService = appCtx.getBean(XXXService.class);//要调用的service
2、@Component类中引用service层
XXXService xxxService = ApplicationContextProvider.getBean(XXXService.class);
XXXService为要调用的service名称