| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springframework.aop.framework.Advised; |
| | | import org.springframework.aop.support.AopUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | Object bean = ApplicationContextProvider.getApplicationContext().getBean(beanName); |
| | | if(bean!=null){ |
| | | CodeSerialAlgorithmVO algorithmVO = new CodeSerialAlgorithmVO(); |
| | | Advised advised = (Advised)bean; |
| | | Class<?> targetClass = advised.getTargetSource().getTargetClass(); |
| | | //Advised advised = (Advised)bean; |
| | | Class<?> targetClass = AopUtils.getTargetClass(bean); |
| | | //Class<?> targetClass = advised.getTargetSource().getTargetClass(); |
| | | algorithmVO.setClassFullName(targetClass.getName()); |
| | | MdmSerialAlgorithm serialAlgorithm = targetClass.getDeclaredAnnotation(MdmSerialAlgorithm.class); |
| | | if(serialAlgorithm==null){ |
| | |
| | | algorithmVO.setName(serialAlgorithm.text()); |
| | | algorithmVO.setDescription(serialAlgorithm.description()); |
| | | algorithmVO.setId(serialAlgorithm.value()); |
| | | algorithmVO.setSerialType(serialAlgorithm.serialType()); |
| | | if(StringUtils.isBlank(algorithmVO.getId())){ |
| | | algorithmVO.setId(beanName); |
| | | } |
| | |
| | | } |
| | | Query query=new Query(); |
| | | IPage<CodeSerialAlgorithmVO> queryIPage =Condition.getPage(query); |
| | | return queryIPage; |
| | | queryIPage.setRecords(voList); |
| | | return queryIPage; |
| | | } |
| | | } |