浏览代码

添加字典和配置预加载信息变动切面

rengb 3 年之前
父节点
当前提交
3fcaff5770

+ 32 - 0
security-center/src/main/java/com/lantone/security/aop/DictionaryAspect.java

@@ -0,0 +1,32 @@
+package com.lantone.security.aop;
+
+import com.lantone.dblayermbg.facade.DictionaryInfoFacade;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.After;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 系统字典信息变更统一处理切面
+ * @author: rengb
+ * @time: 2021/8/26 10:43
+ */
+@Aspect
+@Component
+public class DictionaryAspect {
+
+    @Autowired
+    private DictionaryInfoFacade dictionaryInfoFacade;
+
+    @Pointcut("execution(public * com.lantone.security.web.DictionaryManagementController.deleteDictionary(..))")
+    public void basicInfoChange() {
+    }
+
+    @After("basicInfoChange()")
+    public void aspectAfter(JoinPoint joinPoint) throws Throwable {
+        dictionaryInfoFacade.initDicMap();
+    }
+
+}

+ 32 - 0
security-center/src/main/java/com/lantone/security/aop/HospitalSetAspect.java

@@ -0,0 +1,32 @@
+package com.lantone.security.aop;
+
+import com.lantone.dblayermbg.facade.HospitalSetFacade;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.After;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 组织机构参数配置信息变更统一处理切面
+ * @author: rengb
+ * @time: 2021/8/26 10:43
+ */
+@Aspect
+@Component
+public class HospitalSetAspect {
+
+    @Autowired
+    private HospitalSetFacade hospitalSetFacade;
+
+    @Pointcut("execution(public * com.lantone.security.web.UserManagementController.login(..))")
+    public void basicInfoChange() {
+    }
+
+    @After("basicInfoChange()")
+    public void aspectAfter(JoinPoint joinPoint) throws Throwable {
+        hospitalSetFacade.initHospitalSetMap();
+    }
+
+}