|
@@ -1,9 +1,9 @@
|
|
package com.lantone.qc.kernel.util;
|
|
package com.lantone.qc.kernel.util;
|
|
|
|
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
import net.sf.cglib.proxy.MethodInterceptor;
|
|
import net.sf.cglib.proxy.MethodInterceptor;
|
|
import net.sf.cglib.proxy.MethodProxy;
|
|
import net.sf.cglib.proxy.MethodProxy;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Method;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -18,13 +18,27 @@ public class DiagMethodInterceptor implements MethodInterceptor {
|
|
@Override
|
|
@Override
|
|
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
|
|
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
|
|
if (method.getName().equals("setName")) {
|
|
if (method.getName().equals("setName")) {
|
|
- RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
|
|
|
|
- Map<String, String> diagRedisMap = (Map<String, String>) redisUtil.get(KernelConstants.CONCEPT_DIAG_HOSPITAL_REFLECT);
|
|
|
|
- String hospitalDiagName = args[0].toString();
|
|
|
|
- args[0] = diagRedisMap.get(hospitalDiagName) == null ? "" : diagRedisMap.get(hospitalDiagName);
|
|
|
|
|
|
+ String hospitalDiagName = (String) args[0];
|
|
|
|
+ if (StringUtil.isNotBlank(hospitalDiagName)) {
|
|
|
|
+ RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
|
|
|
|
+ Map<String, Map<String, String>> hospitalDiagHuazMap = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_HUAZ_MAP);
|
|
|
|
+ Map<String, Map<String, String>> lantoneDiagHuazMap = redisUtil.getJsonStringValue(KernelConstants.LANTONE_DIAG_HUAZ_MAP);
|
|
|
|
+ if (hospitalDiagHuazMap != null && lantoneDiagHuazMap != null) {
|
|
|
|
+ Map<String, String> huazDiagMap = hospitalDiagHuazMap.get(hospitalDiagName);
|
|
|
|
+ if (huazDiagMap != null) {
|
|
|
|
+ String huazDiagName = huazDiagMap.get("name");
|
|
|
|
+ if (StringUtil.isNotBlank(huazDiagName)) {
|
|
|
|
+ Map<String, String> lantoneDiagMap = lantoneDiagHuazMap.get(huazDiagName);
|
|
|
|
+ if (lantoneDiagMap != null) {
|
|
|
|
+ args[0] = lantoneDiagMap.get("name");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else if (method.getName().equals("setHospitalDiagName")) {
|
|
} else if (method.getName().equals("setHospitalDiagName")) {
|
|
Diag diag = (Diag) obj;
|
|
Diag diag = (Diag) obj;
|
|
- diag.setName(args[0].toString());
|
|
|
|
|
|
+ diag.setName((String) args[0]);
|
|
}
|
|
}
|
|
Object object = proxy.invokeSuper(obj, args);
|
|
Object object = proxy.invokeSuper(obj, args);
|
|
return object;
|
|
return object;
|