mifosx329 updated
This commit is contained in:
+15
-5
@@ -187,8 +187,13 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
|||||||
if (commandAsJsonMap.containsKey("officeId")) {
|
if (commandAsJsonMap.containsKey("officeId")) {
|
||||||
|
|
||||||
Object officeIdObj = commandAsJsonMap.get("officeId");
|
Object officeIdObj = commandAsJsonMap.get("officeId");
|
||||||
if (officeIdObj instanceof Double) {
|
Integer officeId = -1;
|
||||||
Integer officeId = ((Double) officeIdObj).intValue();
|
if (officeIdObj instanceof Integer) {
|
||||||
|
officeId = (Integer)officeIdObj;
|
||||||
|
} else if (officeIdObj instanceof Double) {
|
||||||
|
officeId = ((Double) officeIdObj).intValue();
|
||||||
|
}
|
||||||
|
if (officeId > -1) {
|
||||||
sql = " SELECT name FROM m_office WHERE id = " + officeId;
|
sql = " SELECT name FROM m_office WHERE id = " + officeId;
|
||||||
String officeName = this.jdbcTemplate.queryForObject(sql, String.class);
|
String officeName = this.jdbcTemplate.queryForObject(sql, String.class);
|
||||||
String regex = "\"officeId\":\\s\\d+";
|
String regex = "\"officeId\":\\s\\d+";
|
||||||
@@ -199,9 +204,14 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
|||||||
if (commandAsJsonMap.containsKey("clientId")) {
|
if (commandAsJsonMap.containsKey("clientId")) {
|
||||||
|
|
||||||
Object clientIdObj = commandAsJsonMap.get("clientId");
|
Object clientIdObj = commandAsJsonMap.get("clientId");
|
||||||
if (clientIdObj instanceof Double) {
|
Integer clientId = -1;
|
||||||
Integer officeId = ((Double) clientIdObj).intValue();
|
if (clientIdObj instanceof Integer) {
|
||||||
sql = " SELECT display_name FROM m_client WHERE id = " + officeId;
|
clientId = (Integer)clientIdObj;
|
||||||
|
} else if (clientIdObj instanceof Double) {
|
||||||
|
clientId = ((Double) clientIdObj).intValue();
|
||||||
|
}
|
||||||
|
if (clientId > -1) {
|
||||||
|
sql = " SELECT display_name FROM m_client WHERE id = " + clientId;
|
||||||
String clientName = this.jdbcTemplate.queryForObject(sql, String.class);
|
String clientName = this.jdbcTemplate.queryForObject(sql, String.class);
|
||||||
String regex = "\"clientId\":\\s\\d+";
|
String regex = "\"clientId\":\\s\\d+";
|
||||||
commandAsJson = commandAsJson.replaceAll(regex, "\"clientName\": \""+clientName+"\"");
|
commandAsJson = commandAsJson.replaceAll(regex, "\"clientName\": \""+clientName+"\"");
|
||||||
|
|||||||
Reference in New Issue
Block a user