From 238121be19655f63a45fc9c9c3d864801eb4471b Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 24 四月 2024 12:44:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeSerialAlgorithmServiceImpl.java | 67 +++++++++++++++++++++++++++++++++
1 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeSerialAlgorithmServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeSerialAlgorithmServiceImpl.java
new file mode 100644
index 0000000..101b634
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeSerialAlgorithmServiceImpl.java
@@ -0,0 +1,67 @@
+package com.vci.ubcs.code.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.vci.ubcs.code.annotation.MdmSerialAlgorithm;
+import com.vci.ubcs.code.service.ICodeSerialAlgorithmService;
+import com.vci.ubcs.code.vo.pagemodel.CodeSerialAlgorithmVO;
+import com.vci.ubcs.starter.web.util.ApplicationContextProvider;
+import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils;
+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;
+import java.util.List;
+
+/**
+ * 娴佹按绠楁硶鐨勬湇鍔�
+ * @author weidy
+ * @date 2022-2-17
+ */
+@Service
+public class CodeSerialAlgorithmServiceImpl implements ICodeSerialAlgorithmService {
+ /**
+ * 鑾峰彇娴佹按绠楁硶鐨勫垪琛�
+ *
+ * @return 娴佹按绠楁硶鐨勪俊鎭�
+ */
+ @Override
+ public IPage<CodeSerialAlgorithmVO> gridSerialAlgorithm() {
+ //浣跨敤涓婚敭鍘绘壂鎻�
+ String[] beanNames = ApplicationContextProvider.getApplicationContext().getBeanNamesForAnnotation(MdmSerialAlgorithm.class);
+ List<CodeSerialAlgorithmVO> voList = new ArrayList<>();
+ if(beanNames!=null && beanNames.length>0){
+ for(String beanName : beanNames){
+ Object bean = ApplicationContextProvider.getApplicationContext().getBean(beanName);
+ if(bean!=null){
+ CodeSerialAlgorithmVO algorithmVO = new CodeSerialAlgorithmVO();
+ //Advised advised = (Advised)bean;
+ Class<?> targetClass = AopUtils.getTargetClass(bean);
+ //Class<?> targetClass = advised.getTargetSource().getTargetClass();
+ algorithmVO.setClassFullName(targetClass.getName());
+ //algorithmVO.setClassFullName(beanName);
+ MdmSerialAlgorithm serialAlgorithm = targetClass.getDeclaredAnnotation(MdmSerialAlgorithm.class);
+ if(serialAlgorithm==null){
+ serialAlgorithm = targetClass.getAnnotation(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);
+ }
+ voList.add(algorithmVO);
+ }
+ }
+ }
+ }
+ Query query=new Query();
+ IPage<CodeSerialAlgorithmVO> queryIPage =Condition.getPage(query);
+ queryIPage.setRecords(voList);
+ return queryIPage;
+ }
+}
--
Gitblit v1.9.3