|
|
|
@ -73,18 +73,21 @@ public class PermissionClientModulesServiceImpl implements PermissionClientModul
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveMongoLog(JSONObject account, JSONObject oldRecord, JSONObject modifyData, String business) {
|
|
|
|
|
modifyData.remove("id");
|
|
|
|
|
PermissionClientModuleLog mongoRecord = new PermissionClientModuleLog();
|
|
|
|
|
mongoRecord.setBusiness(business);
|
|
|
|
|
mongoRecord.setClientId(oldRecord.getIntValue("client_id"));
|
|
|
|
|
mongoRecord.setClientMoniker(oldRecord.getString("client_moniker"));
|
|
|
|
|
mongoRecord.setCreateTime(new Date());
|
|
|
|
|
mongoRecord.setId(IdUtil.getId());
|
|
|
|
|
mongoRecord.setUserId(account.getString("manager_id"));
|
|
|
|
|
mongoRecord.setUserName(account.getString("display_name"));
|
|
|
|
|
mongoRecord.setNewData(modifyData.toJSONString());
|
|
|
|
|
Map<String, Object> beforeModify = modifyData.keySet().stream().collect(Collectors.toMap(key -> key, oldRecord::get));
|
|
|
|
|
mongoRecord.setOriginData(JSON.toJSONString(beforeModify));
|
|
|
|
|
mongoTemplate.insert(mongoRecord);
|
|
|
|
|
try {
|
|
|
|
|
modifyData.remove("id");
|
|
|
|
|
PermissionClientModuleLog mongoRecord = new PermissionClientModuleLog();
|
|
|
|
|
mongoRecord.setBusiness(business);
|
|
|
|
|
mongoRecord.setClientId(oldRecord.getIntValue("client_id"));
|
|
|
|
|
mongoRecord.setClientMoniker(oldRecord.getString("client_moniker"));
|
|
|
|
|
mongoRecord.setCreateTime(new Date());
|
|
|
|
|
mongoRecord.setId(IdUtil.getId());
|
|
|
|
|
mongoRecord.setUserId(account.getString("manager_id"));
|
|
|
|
|
mongoRecord.setUserName(account.getString("display_name"));
|
|
|
|
|
mongoRecord.setNewData(modifyData.toJSONString());
|
|
|
|
|
Map<String, Object> beforeModify = modifyData.keySet().stream().collect(Collectors.toMap(key -> key, oldRecord::get));
|
|
|
|
|
mongoRecord.setOriginData(JSON.toJSONString(beforeModify));
|
|
|
|
|
mongoTemplate.insert(mongoRecord);
|
|
|
|
|
}catch (Exception ignore){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|