|
@@ -135,12 +135,18 @@ public class LogAspect
|
|
|
//插入operId
|
|
//插入operId
|
|
|
String operId = MDC.get("operIds");
|
|
String operId = MDC.get("operIds");
|
|
|
BeanUtils.copyProperties(operLog, operLogScrm);
|
|
BeanUtils.copyProperties(operLog, operLogScrm);
|
|
|
- Long[] operIds = new Long[operId.split(",").length];
|
|
|
|
|
- String[] operIdStrs = operId.split(",");
|
|
|
|
|
- for (int i = 0; i < operIdStrs.length; i++) {
|
|
|
|
|
- operIds[i] = Long.parseLong(operIdStrs[i]);
|
|
|
|
|
|
|
+ // MDC 中 operIds 可能为空(如非标准增删改流程接口),需做 null 判断避免 NPE
|
|
|
|
|
+ if (operId != null && operId.trim().length() > 0) {
|
|
|
|
|
+ String[] operIdStrs = operId.split(",");
|
|
|
|
|
+ Long[] operIds = new Long[operIdStrs.length];
|
|
|
|
|
+ for (int i = 0; i < operIdStrs.length; i++) {
|
|
|
|
|
+ String s = operIdStrs[i].trim();
|
|
|
|
|
+ if (s.length() > 0) {
|
|
|
|
|
+ operIds[i] = Long.parseLong(s);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ operLogScrm.setOperIds(operIds);
|
|
|
}
|
|
}
|
|
|
- operLogScrm.setOperIds(operIds);
|
|
|
|
|
resolveParam((ProceedingJoinPoint)joinPoint,operLogScrm);
|
|
resolveParam((ProceedingJoinPoint)joinPoint,operLogScrm);
|
|
|
AsyncManager.me().execute(AsyncFactory.recordOperScrm(operLogScrm));
|
|
AsyncManager.me().execute(AsyncFactory.recordOperScrm(operLogScrm));
|
|
|
}
|
|
}
|