|
|
|
@ -86,8 +86,9 @@ public class LoggerTemplate {
|
|
|
|
|
*/
|
|
|
|
|
public void write(LoggerContext context, boolean isLocal) {
|
|
|
|
|
String elogLocalQueue = ELOG + this.applicationName;
|
|
|
|
|
if (StringUtils.isEmpty(this.localQueue))
|
|
|
|
|
if (StringUtils.isEmpty(this.localQueue)) {
|
|
|
|
|
this.localQueue = (StringUtils.isNotEmpty(this.moduleName) ? this.moduleName : elogLocalQueue) + "LocalQueue" + this.publishkitGroup;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
handleContext(context);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -230,12 +231,15 @@ public class LoggerTemplate {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private void handleContext(LoggerContext context) {
|
|
|
|
|
if (StringUtils.isEmpty(context.getModuleName()))
|
|
|
|
|
if (StringUtils.isEmpty(context.getModuleName())) {
|
|
|
|
|
context.setModuleName(module);
|
|
|
|
|
if (StringUtils.isEmpty(context.getFunctionName()))
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(context.getFunctionName())) {
|
|
|
|
|
context.setFunctionName(function);
|
|
|
|
|
if (!(context.getId() > 0))
|
|
|
|
|
}
|
|
|
|
|
if (!(context.getId() > 0)) {
|
|
|
|
|
context.setId(IdGenerator.generate());
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(context.getUuid())) {
|
|
|
|
|
context.setUuid(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
}
|
|
|
|
@ -278,7 +282,7 @@ public class LoggerTemplate {
|
|
|
|
|
|
|
|
|
|
List<LoggerDetailContext> valueChangeList = new ArrayList<>();
|
|
|
|
|
int showOrder = 0;
|
|
|
|
|
if (changeBeans != null)
|
|
|
|
|
if (changeBeans != null) {
|
|
|
|
|
for (TableChangeBean changeBean : changeBeans) {
|
|
|
|
|
if (changeBean != null && (changeBean.getNewValue() != null || changeBean.getOldValue() != null)) {
|
|
|
|
|
String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
@ -340,7 +344,7 @@ public class LoggerTemplate {
|
|
|
|
|
|
|
|
|
|
valueChangeBean.setNewValue(newJo.getString(field.getName()));
|
|
|
|
|
valueChangeBean.setOldValue(oldJo.getString(field.getName()));
|
|
|
|
|
valueChangeBean.setCreator(-1l);
|
|
|
|
|
valueChangeBean.setCreator(-1L);
|
|
|
|
|
try {
|
|
|
|
|
extracted(newJo, oldJo, field, fieldElogTransform, valueChangeBean);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -371,12 +375,13 @@ public class LoggerTemplate {
|
|
|
|
|
valueChangeBean.setNewValue(newJo.getString(key));
|
|
|
|
|
valueChangeBean.setOldValue(oldJo.getString(key));
|
|
|
|
|
valueChangeBean.setShoworder(showOrder++);
|
|
|
|
|
valueChangeBean.setCreator(-1l);
|
|
|
|
|
valueChangeBean.setCreator(-1L);
|
|
|
|
|
valueChangeList.add(valueChangeBean);
|
|
|
|
|
}
|
|
|
|
|
for (String key : (Set<String>) oldJo.keySet()) {
|
|
|
|
|
if (keys.contains(key))
|
|
|
|
|
if (keys.contains(key)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
keys.add(key);
|
|
|
|
|
if (oldJo.getString(key).equals(newJo.getString(key))) {
|
|
|
|
|
continue;
|
|
|
|
@ -389,15 +394,17 @@ public class LoggerTemplate {
|
|
|
|
|
valueChangeBean.setNewValue(newJo.getString(key));
|
|
|
|
|
valueChangeBean.setOldValue(oldJo.getString(key));
|
|
|
|
|
valueChangeBean.setShoworder(showOrder++);
|
|
|
|
|
valueChangeBean.setCreator(-1l);
|
|
|
|
|
valueChangeBean.setCreator(-1L);
|
|
|
|
|
valueChangeList.add(valueChangeBean);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (valueChangeList.size() > 0)
|
|
|
|
|
if (valueChangeList.size() > 0) {
|
|
|
|
|
context.setDetailContexts(valueChangeList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -455,7 +462,7 @@ public class LoggerTemplate {
|
|
|
|
|
valueChangeBean.setFieldName(allField.getName());
|
|
|
|
|
valueChangeBean.setNewValue(newValue.getString(allField.getName()));
|
|
|
|
|
valueChangeBean.setOldValue(oldValue.getString(allField.getName()));
|
|
|
|
|
valueChangeBean.setCreator(-1l);
|
|
|
|
|
valueChangeBean.setCreator(-1L);
|
|
|
|
|
valueChangeBean.setBelongDataid("");
|
|
|
|
|
valueChangeBean.setDataid(String.valueOf(dataid));
|
|
|
|
|
|
|
|
|
|