4 Commits

Author SHA1 Message Date
2c5a7f0311 Fixed bugs and cleanup 2026-08-12 20:27:20 +05:30
c308171de5 Migration of Process Panel Done 2026-08-12 20:00:22 +05:30
03dfdd6218 Fixed add case bug 2026-08-12 18:10:39 +05:30
a757799724 Fixed Hourly MIS 2026-08-12 15:40:43 +05:30
75 changed files with 1698 additions and 2154 deletions

2
.vscode/launch.json vendored
View File

@@ -71,7 +71,7 @@
"CYGNUS_LOGIN_PUBLIC_KEY": "file:${workspaceFolder}/config/keys/login-public.pem", "CYGNUS_LOGIN_PUBLIC_KEY": "file:${workspaceFolder}/config/keys/login-public.pem",
"CYGNUS_PAYLOAD_PRIVATE_KEY": "file:${workspaceFolder}/config/keys/case-save-private.pem", "CYGNUS_PAYLOAD_PRIVATE_KEY": "file:${workspaceFolder}/config/keys/case-save-private.pem",
"CYGNUS_PAYLOAD_PUBLIC_KEY": "file:${workspaceFolder}/config/keys/case-save-public.pem", "CYGNUS_PAYLOAD_PUBLIC_KEY": "file:${workspaceFolder}/config/keys/case-save-public.pem",
"CYGNUS_CLOUD_REQUEST_TIMEOUT": "PT10S", "CYGNUS_CLOUD_REQUEST_TIMEOUT": "PT30S",
"CYGNUS_TOKEN_REFRESH_SKEW": "PT30S" "CYGNUS_TOKEN_REFRESH_SKEW": "PT30S"
}, },
"vmArgs": "-Dserver.port=8080 -Djava.awt.headless=true -Dmatrix.webapp=${workspaceFolder}/cygnus-onprem-app/build/WebContent -Dmatrix.classes=${workspaceFolder}/cygnus-onprem-app/target/classes", "vmArgs": "-Dserver.port=8080 -Djava.awt.headless=true -Dmatrix.webapp=${workspaceFolder}/cygnus-onprem-app/build/WebContent -Dmatrix.classes=${workspaceFolder}/cygnus-onprem-app/target/classes",

View File

@@ -11,6 +11,7 @@ import java.time.Clock;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.WebClient;
@@ -18,6 +19,9 @@ import reactor.core.publisher.Mono;
public class CloudIdentityClient { public class CloudIdentityClient {
private static final ParameterizedTypeReference<List<CloudDataItem>> CLOUD_DATA_LIST =
new ParameterizedTypeReference<>() { };
private final WebClient webClient; private final WebClient webClient;
private final MachineTokenProvider tokenProvider; private final MachineTokenProvider tokenProvider;
private final LoginEnvelopeEncryptor encryptor; private final LoginEnvelopeEncryptor encryptor;
@@ -87,8 +91,7 @@ public class CloudIdentityClient {
.accept(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)
.bodyValue(new CloudDataRequest(scope, Map.copyOf(data))) .bodyValue(new CloudDataRequest(scope, Map.copyOf(data)))
.retrieve() .retrieve()
.bodyToFlux(CloudDataItem.class) .bodyToMono(CLOUD_DATA_LIST))
.collectList())
.timeout(properties.requestTimeout()); .timeout(properties.requestTimeout());
} }
} }

View File

@@ -1,4 +1,6 @@
package com.cygnus.client.model; package com.cygnus.client.model;
public record CloudDataItem(Object value, String label, String group) { import java.util.Map;
public record CloudDataItem(Object value, String label, String group, Map<String, Object> data) {
} }

View File

@@ -1,7 +1,10 @@
package com.cygnus.cloud.platform.api; package com.cygnus.cloud.platform.api;
import java.util.Map;
public record ScopedDataItem( public record ScopedDataItem(
Object value, Object value,
String label, String label,
String group) { String group,
Map<String, Object> data) {
} }

View File

@@ -5,6 +5,7 @@ import com.cygnus.cloud.platform.api.ScopedDataItem;
import io.vertx.sqlclient.Row; import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.Tuple; import io.vertx.sqlclient.Tuple;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
@@ -46,6 +47,16 @@ public class ScopedDataRepository {
AND o.description = ANY($5::text[]) AND o.description = ANY($5::text[])
ORDER BY o.description, ov.val_description ORDER BY o.description, ov.val_description
"""; """;
private static final String REPORT_DEFINITION = """
SELECT r.report_key, r.report_title, r.hide_leading_zero_columns,
c.column_key, c.column_label, c.display_order, c.alignment,
c.column_width, c.is_visible, c.is_totalled
FROM platform.report_definition r
JOIN platform.report_column_definition c ON c.report_key = r.report_key
WHERE r.report_key = $1
AND r.enabled = true
ORDER BY c.display_order
""";
private final ReactiveDatabaseClient database; private final ReactiveDatabaseClient database;
@@ -66,6 +77,22 @@ public class ScopedDataRepository {
descriptions.toArray(String[]::new))); descriptions.toArray(String[]::new)));
} }
public Flux<ScopedDataItem> reportDefinition(String reportKey) {
return database.preparedQuery(REPORT_DEFINITION, Tuple.of(reportKey))
.flatMapMany(result -> Flux.fromIterable(result))
.map(row -> new ScopedDataItem(null, null, null, Map.of(
"reportKey", row.getString("report_key"),
"reportTitle", row.getString("report_title"),
"hideLeadingZeroColumns", row.getBoolean("hide_leading_zero_columns"),
"columnKey", row.getString("column_key"),
"columnLabel", row.getString("column_label"),
"displayOrder", row.getInteger("display_order"),
"alignment", row.getString("alignment"),
"columnWidth", row.getInteger("column_width"),
"visible", row.getBoolean("is_visible"),
"totalled", row.getBoolean("is_totalled"))));
}
private Flux<ScopedDataItem> rows(String sql, Tuple parameters) { private Flux<ScopedDataItem> rows(String sql, Tuple parameters) {
return database.preparedQuery(sql, parameters) return database.preparedQuery(sql, parameters)
.flatMapMany(result -> Flux.fromIterable(result)) .flatMapMany(result -> Flux.fromIterable(result))
@@ -74,6 +101,6 @@ public class ScopedDataRepository {
private ScopedDataItem item(Row row) { private ScopedDataItem item(Row row) {
return new ScopedDataItem( return new ScopedDataItem(
row.getValue("value"), row.getString("label"), row.getString("group_name")); row.getValue("value"), row.getString("label"), row.getString("group_name"), Map.of());
} }
} }

View File

@@ -14,6 +14,7 @@ import reactor.core.publisher.Flux;
public class ScopedDataService { public class ScopedDataService {
public static final String COMPANY_OPTIONS = "company-options"; public static final String COMPANY_OPTIONS = "company-options";
public static final String PORTFOLIO_OPTIONS = "portfolio-options"; public static final String PORTFOLIO_OPTIONS = "portfolio-options";
public static final String REPORT_DEFINITION = "report-definition";
private final ScopedDataRepository repository; private final ScopedDataRepository repository;
@@ -23,9 +24,13 @@ public class ScopedDataService {
public Flux<ScopedDataItem> fetch(UUID tenantId, ScopedDataRequest request) { public Flux<ScopedDataItem> fetch(UUID tenantId, ScopedDataRequest request) {
Map<String, Object> data = request.data(); Map<String, Object> data = request.data();
String scope = request.scope().trim().toLowerCase(Locale.ROOT);
if (REPORT_DEFINITION.equals(scope)) {
return repository.reportDefinition(textValue(data, "reportKey"));
}
short companyId = shortValue(data, "companyId"); short companyId = shortValue(data, "companyId");
List<String> descriptions = descriptions(data); List<String> descriptions = descriptions(data);
return switch (request.scope().trim().toLowerCase(Locale.ROOT)) { return switch (scope) {
case COMPANY_OPTIONS -> repository.companyOptions(tenantId, companyId, descriptions); case COMPANY_OPTIONS -> repository.companyOptions(tenantId, companyId, descriptions);
case PORTFOLIO_OPTIONS -> repository.portfolioOptions( case PORTFOLIO_OPTIONS -> repository.portfolioOptions(
tenantId, companyId, shortValue(data, "branchId"), tenantId, companyId, shortValue(data, "branchId"),
@@ -34,6 +39,14 @@ public class ScopedDataService {
}; };
} }
private String textValue(Map<String, Object> data, String name) {
String value = String.valueOf(data.getOrDefault(name, "")).trim();
if (value.isEmpty() || value.length() > 100 || !value.matches("[a-z0-9-]+")) {
throw new ScopedDataException(name + " is invalid");
}
return value;
}
private UUID uuidValue(Map<String, Object> data, String name) { private UUID uuidValue(Map<String, Object> data, String name) {
try { try {
return UUID.fromString(String.valueOf(data.get(name))); return UUID.fromString(String.valueOf(data.get(name)));

View File

@@ -0,0 +1,38 @@
CREATE TABLE IF NOT EXISTS platform.report_definition (
report_key varchar(100) PRIMARY KEY,
report_title varchar(200) NOT NULL,
hide_leading_zero_columns boolean NOT NULL DEFAULT false,
enabled boolean NOT NULL DEFAULT true,
updated_at timestamptz NOT NULL DEFAULT current_timestamp
);
CREATE TABLE IF NOT EXISTS platform.report_column_definition (
report_key varchar(100) NOT NULL REFERENCES platform.report_definition(report_key) ON DELETE CASCADE,
column_key varchar(100) NOT NULL,
column_label varchar(100) NOT NULL,
display_order integer NOT NULL,
alignment varchar(10) NOT NULL DEFAULT 'left',
column_width integer NOT NULL DEFAULT 80,
is_visible boolean NOT NULL DEFAULT true,
is_totalled boolean NOT NULL DEFAULT false,
PRIMARY KEY (report_key, column_key)
);
INSERT INTO platform.report_definition(report_key, report_title, hide_leading_zero_columns)
VALUES ('hourly-mis', 'HOURLY MIS (EDP)', true)
ON CONFLICT (report_key) DO NOTHING;
INSERT INTO platform.report_column_definition
(report_key,column_key,column_label,display_order,alignment,column_width,is_visible,is_totalled)
VALUES ('hourly-mis','date','Date',0,'left',110,true,false),
('hourly-mis','total','Total',25,'center',70,true,true)
ON CONFLICT (report_key,column_key) DO NOTHING;
INSERT INTO platform.report_column_definition
(report_key,column_key,column_label,display_order,alignment,column_width,is_visible,is_totalled)
SELECT 'hourly-mis', 'hour'||hour, hour::text, hour+1, 'center', 55, true, true
FROM generate_series(0,23) hour
ON CONFLICT (report_key,column_key) DO NOTHING;
DELETE FROM platform.application_query
WHERE query_key = 'report-definition';

View File

@@ -0,0 +1,13 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class CutoffPending {
private List<CutoffPendingRecord> pendingList = new ArrayList<>();
private String errMsg;
private String errCode = "1010";
private boolean processFlag;
}

View File

@@ -0,0 +1,20 @@
package lib.models;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class CutoffPendingRecord {
private List<CutoffPendingRecord> sublist = new ArrayList<>();
private String cutoffTime;
private int total;
private String uuid;
private String portfolio;
private String customerName;
private boolean allocation;
private boolean telesheet;
private boolean earlier;
private boolean negative;
private boolean cutoff;
}

View File

@@ -0,0 +1,49 @@
package lib.models;
import java.time.LocalDate;
import java.util.Arrays;
public final class HourlyMisRecord {
private final long userId;
private final String displayName;
private final LocalDate receivedDate;
private final int[] hours = new int[24];
public HourlyMisRecord(long userId, String displayName, LocalDate receivedDate) {
this.userId = userId;
this.displayName = displayName;
this.receivedDate = receivedDate;
}
public long getUserId() { return userId; }
public String getDisplayName() { return displayName; }
public LocalDate getReceivedDate() { return receivedDate; }
public int getHour(int hour) { return hours[hour]; }
public void addCases(int hour, int cases) { hours[hour] += cases; }
public int getTotal() { return Arrays.stream(hours).sum(); }
public int getHour00() { return hours[0]; }
public int getHour01() { return hours[1]; }
public int getHour02() { return hours[2]; }
public int getHour03() { return hours[3]; }
public int getHour04() { return hours[4]; }
public int getHour05() { return hours[5]; }
public int getHour06() { return hours[6]; }
public int getHour07() { return hours[7]; }
public int getHour08() { return hours[8]; }
public int getHour09() { return hours[9]; }
public int getHour10() { return hours[10]; }
public int getHour11() { return hours[11]; }
public int getHour12() { return hours[12]; }
public int getHour13() { return hours[13]; }
public int getHour14() { return hours[14]; }
public int getHour15() { return hours[15]; }
public int getHour16() { return hours[16]; }
public int getHour17() { return hours[17]; }
public int getHour18() { return hours[18]; }
public int getHour19() { return hours[19]; }
public int getHour20() { return hours[20]; }
public int getHour21() { return hours[21]; }
public int getHour22() { return hours[22]; }
public int getHour23() { return hours[23]; }
}

View File

@@ -0,0 +1,6 @@
package lib.models;
public record ReportColumnDefinition(
String columnKey, String label, int displayOrder, String alignment,
int width, boolean visible, boolean totalled) {
}

View File

@@ -0,0 +1,8 @@
package lib.models;
import java.util.List;
public record ReportDefinition(
String reportKey, String title, boolean hideLeadingZeroColumns,
List<ReportColumnDefinition> columns) {
}

View File

@@ -92,7 +92,9 @@
<form:checkbox path="cofflist[${mystatus.index}].sms" id="sms${mystatus.count}" value="true" /> <form:checkbox path="cofflist[${mystatus.index}].sms" id="sms${mystatus.count}" value="true" />
</td> </td>
<td align="center"> <td align="center">
<form:checkbox path="cofflist[${mystatus.index}].telesheet" id="ts${mystatus.count}" value="true" /> <form:checkbox path="cofflist[${mystatus.index}].telesheet" id="ts${mystatus.count}" value="true"
disabled="${record.totrtv le 0 and record.tototv le 0}"
title="${record.totrtv le 0 and record.tototv le 0 ? 'Tele-Sheet requires RTV or OTV' : ''}" />
</td> </td>
<td align="center"> <td align="center">
<form:checkbox path="cofflist[${mystatus.index}].earlier" id="ear${mystatus.count}" value="true" /> <form:checkbox path="cofflist[${mystatus.index}].earlier" id="ear${mystatus.count}" value="true" />

View File

@@ -0,0 +1,98 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" session="true" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Cygnus 1.0 | Cut-Off Pending</title>
<link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet">
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet">
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet">
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet">
<link href="/matrix/css/cutoff-workflows-v1.css?v=4" rel="stylesheet">
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet">
<script src="/matrix/js/lib/notifications.js?ver=1"></script>
<script src="/matrix/js/edp/cutoff/cutoff-pending.js?v=1" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
</head>
<body class="matrix-v2 matrix-shell matrix-tool-workspace matrix-cutoff-workflow matrix-cutoff-pending">
<div id="PageFrame">
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
<main id="formcontainer" class="matrix-tool-workspace__content">
<form:form method="post" id="cutoffpending" modelAttribute="cutoffpending">
<c:if test="${not empty _csrf}"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"></c:if>
<section>
<header class="title">
<img class="matrix-title-icon" src="/matrix/images/cutlist.png" alt="">
<span class="matrix-title-text">Cut-Off Pending</span>
<button type="button" class="matrix-title-action matrix-icon-button" title="Refresh grid"
aria-label="Refresh grid" data-action="refresh">
<img src="/matrix/images/reload.png" alt="">
</button>
</header>
<div class="tableContainer">
<table id="cutlist">
<thead class="thead"><tr>
<th>S.No</th><th>Cut-Off Time</th><th>Allocation</th><th>Tele-Sheet</th>
<th>Earlier</th><th>Negative</th><th>Cut-Off</th>
</tr></thead>
<tbody>
<c:forEach items="${cutoffpending.pendingList}" var="record" varStatus="parentStatus">
<tr class="matrix-parent-row" data-parent-index="${parentStatus.index}">
<td>${parentStatus.count}</td>
<td>
<form:hidden path="pendingList[${parentStatus.index}].cutoffTime"/>
<form:hidden path="pendingList[${parentStatus.index}].total"/>
<button type="button" class="matrix-row-toggle" data-action="toggle" aria-expanded="false">
<span class="matrix-row-toggle__chevron">&#9654;</span>
<span>${fn:escapeXml(record.cutoffTime)} <strong>(${record.total})</strong></span>
</button>
</td>
<td><form:checkbox path="pendingList[${parentStatus.index}].allocation" data-parent-field="allocation"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].telesheet" data-parent-field="telesheet"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].earlier" data-parent-field="earlier"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].negative" data-parent-field="negative"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].cutoff" data-parent-field="cutoff"/></td>
</tr>
<tr class="matrix-expanded-row" data-child-row="${parentStatus.index}" hidden>
<td colspan="7">
<table class="matrix-nested-table">
<thead><tr>
<th>S.No</th><th>Portfolio</th><th>Customer Name</th><th>Allocation</th>
<th>Tele-Sheet</th><th>Earlier</th><th>Negative</th><th>Cut-Off</th>
</tr></thead>
<tbody>
<c:forEach items="${record.sublist}" var="child" varStatus="childStatus">
<tr data-child-index="${childStatus.index}">
<td>${childStatus.count}</td>
<td><form:hidden path="pendingList[${parentStatus.index}].sublist[${childStatus.index}].uuid"/>${fn:escapeXml(child.portfolio)}</td>
<td>${fn:escapeXml(child.customerName)}</td>
<td><form:checkbox path="pendingList[${parentStatus.index}].sublist[${childStatus.index}].allocation" data-child-field="allocation"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].sublist[${childStatus.index}].telesheet" data-child-field="telesheet"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].sublist[${childStatus.index}].earlier" data-child-field="earlier"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].sublist[${childStatus.index}].negative" data-child-field="negative"/></td>
<td><form:checkbox path="pendingList[${parentStatus.index}].sublist[${childStatus.index}].cutoff" data-child-field="cutoff"/></td>
</tr>
</c:forEach>
<c:if test="${empty record.sublist}"><tr><td colspan="8" class="matrix-empty-row">No records found.</td></tr></c:if>
</tbody>
</table>
</td>
</tr>
</c:forEach>
<c:if test="${empty cutoffpending.pendingList}"><tr><td colspan="7" class="matrix-empty-row">No pending cut-offs found.</td></tr></c:if>
</tbody>
</table>
</div>
</section>
<c:if test="${not empty cutoffpending.pendingList}">
<footer class="matrix-workflow-actions"><button type="button" class="button" data-action="save">Save</button></footer>
</c:if>
</form:form>
</main>
</div>
<c:if test="${not empty cutoffpending.errMsg}"><script>CygnusNotifications.showLegacy('${fn:escapeXml(cutoffpending.errMsg)}');</script></c:if>
</body>
</html>

View File

@@ -10,7 +10,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet"> <link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet">
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet"> <link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet">
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet"> <link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet">
<link href="/matrix/css/dedupe-workflows-v1.css?v=3" rel="stylesheet"> <link href="/matrix/css/dedupe-workflows-v1.css?v=12" rel="stylesheet">
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet"> <link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet">
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet"> <link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet">
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script> <script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
@@ -23,7 +23,7 @@
data-context-path="${pageContext.request.contextPath}"> data-context-path="${pageContext.request.contextPath}">
<div id="PageFrame"> <div id="PageFrame">
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %> <%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
<main class="matrix-tool-workspace__content"> <main id="formcontainer" class="matrix-tool-workspace__content">
<form:form method="post" action="${pageContext.request.contextPath}/ver/dedupecaselist" <form:form method="post" action="${pageContext.request.contextPath}/ver/dedupecaselist"
id="dedupeWorkspace" modelAttribute="dedupeWorkspace"> id="dedupeWorkspace" modelAttribute="dedupeWorkspace">
<section class="matrix-dedupe-worklist"> <section class="matrix-dedupe-worklist">

View File

@@ -27,7 +27,7 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" /> <link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/dedupe-workflows-v1.css?v=8" rel="stylesheet" type="text/css" /> <link href="/matrix/css/dedupe-workflows-v1.css?v=12" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script> <script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script> <script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />

View File

@@ -212,7 +212,7 @@
<div id="FormPanel2" class="FormPanel"> <div id="FormPanel2" class="FormPanel">
<table align="center" class="matrix-form-controls" style="width:100%"> <table align="center" class="matrix-form-controls" style="width:100%">
<tr> <tr>
<td><form:textarea path="earremarks" style="width:98%" rows="9" readonly="true" ></form:textarea></td> <td><form:textarea path="earremarks" style="width:98%" rows="8" readonly="true" ></form:textarea></td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -232,7 +232,7 @@
<div id="FormPanel2" class="FormPanel"> <div id="FormPanel2" class="FormPanel">
<table align="center" class="matrix-form-controls" style="width:100%"> <table align="center" class="matrix-form-controls" style="width:100%">
<tr> <tr>
<td><form:textarea path="negremarks" style="width:98%" rows="9" readonly="true" ></form:textarea></td> <td><form:textarea path="negremarks" style="width:98%" rows="8" readonly="true" ></form:textarea></td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@@ -41,11 +41,13 @@
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" /> <link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/punch-workspace-v3.css?v=2" rel="stylesheet" type="text/css" /> <link href="/matrix/css/punch-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/add-cases-v4.css?v=6" rel="stylesheet" type="text/css" /> <link href="/matrix/css/add-cases-v4.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/date-time-input-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script> <script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script> <script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
<script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script> <script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script> <script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
<script src="/matrix/js/lib/date-time-input-v1.js?v=1" defer></script>
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" />
</head> </head>
@@ -219,7 +221,7 @@
DOB DOB
</div> </div>
<div class="inputcontainer"> <div class="inputcontainer">
<input type="text" id="dob" name="dob" maxlength="10" style="width:80px" value="" onkeydown="return addSlashes(this,event)" onblur="validate(this,'f','Date')" /> <input type="text" id="dob" name="dob" class="matrix-date-input" data-date-mode="date" maxlength="10" style="width:80px" value="" autocomplete="off" inputmode="numeric" placeholder="DD/MM/YYYY" onkeydown="return addSlashes(this,event)" onblur="validate(this,'f','Date')" />
</div> </div>
</div> </div>
<div class="widget"> <div class="widget">

View File

@@ -1,168 +0,0 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@page language="java" session="true" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
<script src="/matrix/js/edp/cutoff/cutoff.js?v=1" type="text/javascript"></script>
<script language="javascript" src="/matrix/js/validator.js" type="text/javascript"></script>
<link href="/matrix/css/matrix.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/button.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/div.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/select.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/table.css" rel="stylesheet" type="text/css" />
<title>Cygnus 1.0 | Cutoff Pending</title>
<link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/edp-support-v1.css?v=1" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
<script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" />
</head>
<body class="matrix-v2 matrix-shell matrix-tool-workspace matrix-edp-support matrix-edp-process">
<div id='PageFrame'>
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
<div id="formcontainer" class="matrix-tool-workspace__content" style="max-width:1100px">
<form:form method="post" name="cutoffpending" id="cutoffpending" modelAttribute="cutoffpending" >
<!-- Common Details (Section1) Visible for all portfolios-->
<div>
<!-- Title -->
<div class="title">
<img class="matrix-title-icon" src="/matrix/images/cutlist.png" align="absmiddle" />
<span class="matrix-title-text" align="absmiddle">Cut-Off Pending</span>
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('cutoffpending','_parent','cutoffpending')"/>
</div>
<!-- -->
<div id="TablePanel" class="tableContainer">
<table border="0" cellspacing="0" width="100%" id="cutlist">
<thead class="thead">
<tr title="Row Title">
<td width="6%">S.No</td>
<td width="65%">Cutoff Time</td>
<td>Allocation</td>
<td>Telesheet</td>
<td>Earlier</td>
<td>Negative</td>
<td>CutOff</td>
</tr>
</thead>
<tbody class="scrollContent">
<c:forEach items="${cutoffpending.pendinglist}" var="record" varStatus="mystatus">
<tr title="parent">
<td>${mystatus.count}</td>
<td id="parent${mystatus.count}" onclick="ExpandList(this.id)" >
<form:hidden path="pendinglist[${mystatus.index}].cutofftime" id="cutofftime${mystatus.count}" value="${status.value}"/>
<form:hidden path="pendinglist[${mystatus.index}].total" id="total${mystatus.count}" value="${status.value}"/>
<span class="customLink" style="cursor:pointer">${record.cutofftime} <b>(${record.total})</b></span>
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].allocation" id="chkalloc${mystatus.count}" value="false" onclick="ToggleChecks('chkalloc${mystatus.count}child',this.checked);checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);" />
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].telesheet" id="chktelesheet${mystatus.count}" value="false" onclick="ToggleChecks('chktelesheet${mystatus.count}child',this.checked);checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);" />
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].earlier" id="chkear${mystatus.count}" value="false" onclick="ToggleChecks('chkear${mystatus.count}child',this.checked);checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);" />
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].negative" id="chkneg${mystatus.count}" value="false" onclick="ToggleChecks('chkneg${mystatus.count}child',this.checked);checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);" />
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].cutoff" id="chkcutoff${mystatus.count}" value="false" onclick="ToggleMatrix('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child',this.checked,',');checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);" />
</td>
</tr>
<tr style="display:none" id="parent${mystatus.count}child" >
<c:choose>
<c:when test="${record.total lt 1}">
<td colspan="6" style="text-align:center;font-style: italic;color:#232323;text-transform: capitalize;">There are no Records.</td>
</c:when>
<c:otherwise>
<td colspan="8" align="right">
<table cellspacing="0" cellpadding="0" border="0" width="94%" style="border-color: #49a5df">
<thead class="thead">
<tr title="Heading">
<td width="6%">S.No</td>
<td>Portfolio</td>
<td width="60%">Name</td>
<td>Allocation</td>
<td>Telesheet</td>
<td>Earlier</td>
<td>Negative</td>
<td>Cutoff</td>
</tr>
</thead>
<tbody class="scrollContent">
<c:forEach items="${record.pendingsublist}" var="record1" varStatus="mystatus1">
<tr title="child">
<td>${mystatus1.count}</td>
<td>
<form:hidden path="pendinglist[${mystatus.index}].pendingsublist[${mystatus1.index}].uuid" id="uuid${mystatus1.count}child" value="${status.value}"/>
<span>${record1.portfolio}</span>
</td>
<td>
<span>${record1.customername}</span>
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].pendingsublist[${mystatus1.index}].allocation" id="chkalloc${mystatus.count}child${mystatus1.count}" value="${status.value}" onclick="checkList('chkalloc${mystatus.count}child','chkalloc${mystatus.count}');checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);"/>
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].pendingsublist[${mystatus1.index}].telesheet" id="chktelesheet${mystatus.count}child${mystatus1.count}" value="${status.value}" onclick="checkList('chktelesheet${mystatus.count}child','chktelesheet${mystatus.count}');checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);"/>
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].pendingsublist[${mystatus1.index}].earlier" id="chkear${mystatus.count}child${mystatus1.count}" value="${status.value}" onclick="checkList('chkear${mystatus.count}child','chkear${mystatus.count}');checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);"/>
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].pendingsublist[${mystatus1.index}].negative" id="chkneg${mystatus.count}child${mystatus1.count}" value="${status.value}" onclick="checkList('chkneg${mystatus.count}child','chkneg${mystatus.count}');checkUncheckList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child','chkalloc${mystatus.count},chktelesheet${mystatus.count},chkear${mystatus.count},chkneg${mystatus.count},chkcutoff${mystatus.count}',',',',',${record.total},0);"/>
</td>
<td>
<form:checkbox path="pendinglist[${mystatus.index}].pendingsublist[${mystatus1.index}].cutoff" id="chkcutoff${mystatus.count}child${mystatus1.count}" value="${status.value}" onclick="checkList('chkcutoff${mystatus.count}child','chkcutoff${mystatus.count}');checkRowList('chkalloc${mystatus.count}child,chktelesheet${mystatus.count}child,chkear${mystatus.count}child,chkneg${mystatus.count}child,chkcutoff${mystatus.count}child',',',this.checked,${mystatus1.count});"/>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</td>
</c:otherwise>
</c:choose>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
<input type="button" class="button" name="btnsave" style="margin-top:5px;float:right" value="Save" id="btnsave" accesskey="S" onclick="return SubmitForm('savecutoffpending','_parent','cutoffpending');" />
<form:hidden path="SessUUID" value=""/>
</form:form>
<input type="hidden" id="invalidfields" value="0" />
<input type="hidden" id="selectedports" value="0" />
</div>
</div>
</body>
<!-- Page Load Javascript -->
<script language="javascript" type="text/javascript">
InitPage();
</script>
<!-- Process Message -->
<c:if test="${not empty cutoffpending.getErrMsg()}">
<script language="javascript" type="text/javascript">contentType="html"; CallMessage('${cutoffpending.getErrMsg()}',8000,200,300); </script>
</c:if>
</html>

View File

@@ -26,12 +26,14 @@
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" /> <link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/mis-filter-v4.css?v=1" rel="stylesheet" type="text/css" /> <link href="/matrix/css/mis-filter-v4.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/date-time-input-v1.css?v=2" rel="stylesheet" type="text/css" />
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script> <script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
<script src="/matrix/js/matrix-shell-v2.js" defer></script> <script src="/matrix/js/matrix-shell-v2.js" defer></script>
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
<script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script> <script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script> <script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
<script src="/matrix/js/lib/date-time-input-v1.js?v=2" defer></script>
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" />
</head> </head>

View File

@@ -17,7 +17,7 @@
<link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet" type="text/css" /> <link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet" type="text/css" />
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" /> <link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" /> <link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
<link href="/matrix/css/mis-output-v1.css?v=1" rel="stylesheet" type="text/css" /> <link href="/matrix/css/mis-output-v1.css?v=7" rel="stylesheet" type="text/css" />
<title>Cygnus 1.0 | ${filter.title }</title> <title>Cygnus 1.0 | ${filter.title }</title>
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script> <script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
@@ -25,7 +25,16 @@
</head> </head>
<body class="matrix-v2 matrix-mis-output"> <body class="matrix-v2 matrix-mis-output">
<form:form method="post" name="filter" id="filter" modelAttribute="filter" > <form:form method="post" name="filter" id="filter" modelAttribute="filter" >
<c:if test="${hourlyJasperReport}">
<div class="matrix-report-actions">
<button type="submit" class="btn btn-primary btn-sm" formaction="${pageContext.request.contextPath}/ver/dtmis/xlsx">Export XLSX</button>
<button type="submit" class="btn btn-outline-primary btn-sm" formaction="${pageContext.request.contextPath}/ver/dtmis/pdf">Export PDF</button>
<button type="submit" class="btn btn-outline-primary btn-sm" formaction="${pageContext.request.contextPath}/ver/dtmis/csv">Export CSV</button>
</div>
</c:if>
<div class="matrix-report-scroll">
${filter.html} ${filter.html}
</div>
<input type="hidden" id="invalidfields" value="0" /> <input type="hidden" id="invalidfields" value="0" />
<form:hidden path="qid" /> <form:hidden path="qid" />
<form:hidden path="title" /> <form:hidden path="title" />

View File

@@ -201,3 +201,62 @@
width: calc(100% - 12px) !important; width: calc(100% - 12px) !important;
} }
} }
.matrix-cutoff-pending .matrix-icon-button {
margin-left: auto !important;
background: transparent;
}
.matrix-cutoff-pending .matrix-icon-button img {
width: 16px;
height: 16px;
display: block;
}
.matrix-cutoff-pending .matrix-parent-row td:not(:nth-child(2)),
.matrix-cutoff-pending .matrix-nested-table td:not(:nth-child(2)):not(:nth-child(3)) {
text-align: center;
}
.matrix-cutoff-pending .matrix-row-toggle {
display: inline-flex;
align-items: center;
gap: 7px;
padding: 0;
border: 0;
color: #245a91;
background: transparent;
font: inherit;
font-weight: 600;
cursor: pointer;
}
.matrix-cutoff-pending .matrix-row-toggle__chevron {
width: 12px;
color: #516c82;
font-size: 9px;
}
.matrix-cutoff-pending .matrix-expanded-row > td {
padding: 8px 10px !important;
background: #dfeaf3 !important;
}
.matrix-cutoff-pending .matrix-nested-table {
width: 100% !important;
margin: 0 !important;
border: 1px solid #9fb2c3 !important;
background: #fff !important;
box-shadow: 0 2px 6px rgba(31, 52, 72, .12);
}
.matrix-cutoff-pending .matrix-nested-table tbody tr:nth-child(even) td {
background: #f1f6fa !important;
}
.matrix-cutoff-pending .matrix-empty-row {
padding: 18px !important;
text-align: center !important;
color: #65798a;
font-style: italic;
}

View File

@@ -0,0 +1,50 @@
.matrix-date-control {
position: relative;
display: flex;
width: 100%;
align-items: stretch;
}
.matrix-date-control > .matrix-date-input {
min-width: 0;
flex: 1 1 auto;
padding-right: 38px !important;
}
.matrix-date-control__button {
position: absolute;
top: 1px;
right: 1px;
bottom: 1px;
display: grid;
width: 34px;
padding: 0;
place-items: center;
border: 0;
border-left: 1px solid #c4d0da;
border-radius: 0 3px 3px 0;
background: #edf3f7;
color: #285f8f;
cursor: pointer;
}
.matrix-date-control__button:hover,
.matrix-date-control__button:focus-visible {
background: #dfeaf3;
outline: 0;
}
.matrix-date-control__picker {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
opacity: 0;
pointer-events: none;
}
.matrix-mis-filter .FormPanel .matrix-date-field {
width: 100%;
min-width: 0;
flex: 0 0 auto;
}

View File

@@ -1,6 +1,11 @@
.matrix-tool-workspace.matrix-dedupe-workflow {
padding: 0;
}
.matrix-dedupe-workflow .matrix-tool-workspace__content { .matrix-dedupe-workflow .matrix-tool-workspace__content {
width: calc(100% - 24px) !important; width: calc(100% - 24px) !important;
max-width: 1380px !important; max-width: 1380px !important;
margin: 10px auto 0 !important;
} }
.matrix-dedupe-workflow .title { .matrix-dedupe-workflow .title {
@@ -109,9 +114,10 @@
} }
.matrix-dedupe-worklist__table-wrap { .matrix-dedupe-worklist__table-wrap {
margin: 8px; margin: 0;
border: 1px solid #c3d0da; border: 0;
border-radius: 4px; border-top: 1px solid #c3d0da;
border-radius: 0;
} }
.matrix-dedupe-worklist__table-wrap thead th { .matrix-dedupe-worklist__table-wrap thead th {

View File

@@ -64,25 +64,43 @@
} }
.matrix-mis-filter .FormPanel { .matrix-mis-filter .FormPanel {
padding: 20px 18px; height: auto !important;
min-height: 0 !important;
padding: 16px 18px;
border: 1px solid #c9d4de; border: 1px solid #c9d4de;
border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px;
background: #fff; background: #fff;
} }
.matrix-mis-filter .FormPanel table { .matrix-mis-filter .FormPanel table {
display: block;
width: 100%; width: 100%;
margin: 0; margin: 0;
} }
.matrix-mis-filter .FormPanel table tbody,
.matrix-mis-filter .FormPanel table tr,
.matrix-mis-filter .FormPanel table tr td {
display: block;
width: 100%;
height: auto !important;
}
.matrix-mis-filter .FormPanel table tr td { .matrix-mis-filter .FormPanel table tr td {
display: flex;
flex-wrap: wrap;
align-items: end;
gap: 14px 18px;
padding: 0; padding: 0;
} }
.matrix-mis-filter .FormPanel table tr:first-child td {
display: grid;
gap: 12px;
}
.matrix-mis-filter .FormPanel table tr:last-child td {
display: flex;
justify-content: flex-end;
padding-top: 14px;
}
.matrix-mis-filter .FormPanel .widget { .matrix-mis-filter .FormPanel .widget {
display: flex; display: flex;
min-width: 230px; min-width: 230px;
@@ -124,12 +142,15 @@
} }
.matrix-mis-filter .FormPanel input.button { .matrix-mis-filter .FormPanel input.button {
width: auto !important;
min-width: 96px; min-width: 96px;
min-height: 34px; min-height: 34px;
padding: 6px 14px 6px 30px !important; padding: 6px 14px 6px 30px !important;
border-color: #7f8b96; border-color: #7f8b96;
border-radius: 4px; border-radius: 4px;
background-color: #e5e8eb; background-color: #e5e8eb;
float: none !important;
margin: 0 !important;
} }
.matrix-mis-filter .FormPanel br { .matrix-mis-filter .FormPanel br {

View File

@@ -10,7 +10,7 @@
.matrix-mis-output form { .matrix-mis-output form {
width: 100%; width: 100%;
max-width: 1600px; max-width: none;
margin: 0 auto; margin: 0 auto;
padding: 12px; padding: 12px;
overflow: auto; overflow: auto;
@@ -129,3 +129,43 @@
box-shadow: none; box-shadow: none;
} }
} }
.matrix-report-actions {
display: flex;
justify-content: flex-end;
gap: 6px;
margin: 0 0 0.5rem;
}
.matrix-report-scroll {
width: 100%;
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 6px;
}
.matrix-report-scroll .jrPage {
max-width: none;
}
.matrix-mis-output .jrPage {
margin: 0 auto;
background: #f7fafc;
border: 1px solid #9fb2c3;
box-shadow: 0 2px 8px rgba(38, 66, 89, 0.12);
}
.hourly-mis { width: 100%; box-sizing: border-box; padding: 18px; background: #f7fafc; border: 1px solid #9fb2c3; }
.hourly-mis__header { text-align: center; }
.hourly-mis__header h1 { margin: 0; font-size: 18px; font-weight: 700; }
.hourly-mis__header h2 { margin: 3px 0; font-size: 14px; font-weight: 700; }
.hourly-mis__header p, .hourly-mis__branch { margin: 5px 0; font-size: 14px; }
.hourly-mis__branch { font-weight: 700; }
.hourly-mis__table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; }
.hourly-mis__table th, .hourly-mis__table td { padding: 5px 4px; border: 1px solid #9fb2c3; font-size: 12px; text-align: center; }
.hourly-mis__table thead th { background: #dce7f1; font-weight: 700; }
.hourly-mis__table th:first-child, .hourly-mis__table td:first-child { width: 110px; text-align: left; }
.hourly-mis__operator th { background: #e3e8ed; text-align: left; }
.hourly-mis__operator span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hourly-mis__total th, .hourly-mis__total td { background: #dde8f1; font-weight: 700; }
.hourly-mis__empty { padding: 28px !important; color: #73808b; font-style: italic; text-align: center !important; }

View File

@@ -0,0 +1,61 @@
(() => {
"use strict";
const form = document.getElementById("cutoffpending");
if (!form) return;
const submit = (endpoint) => {
form.action = endpoint;
form.target = "_self";
form.submit();
};
const parentRow = (element) => element.closest("tr[data-parent-index]");
const children = (row) => form.querySelector(`tr[data-child-row="${row.dataset.parentIndex}"]`);
const childInputs = (row, field) => children(row)?.querySelectorAll(`[data-child-field="${field}"]`) || [];
const parentInput = (row, field) => row.querySelector(`[data-parent-field="${field}"]`);
const fields = ["allocation", "telesheet", "earlier", "negative", "cutoff"];
const syncParent = (row, field) => {
const inputs = [...childInputs(row, field)];
parentInput(row, field).checked = inputs.length > 0 && inputs.every((input) => input.checked);
};
form.addEventListener("click", (event) => {
const action = event.target.closest("[data-action]")?.dataset.action;
if (action === "refresh") return submit("cutoffpending");
if (action === "save") return submit("savecutoffpending");
if (action !== "toggle") return;
const button = event.target.closest("[data-action='toggle']");
const detail = children(parentRow(button));
detail.hidden = !detail.hidden;
button.setAttribute("aria-expanded", String(!detail.hidden));
button.querySelector(".matrix-row-toggle__chevron").textContent = detail.hidden ? "▶" : "▼";
});
form.addEventListener("change", (event) => {
const parentField = event.target.dataset.parentField;
if (parentField) {
const row = parentRow(event.target);
const affected = parentField === "cutoff" ? fields : [parentField];
affected.forEach((field) => {
parentInput(row, field).checked = event.target.checked;
childInputs(row, field).forEach((input) => { input.checked = event.target.checked; });
});
return;
}
const childField = event.target.dataset.childField;
if (!childField) return;
const detail = event.target.closest("tr[data-child-row]");
const row = form.querySelector(`tr[data-parent-index="${detail.dataset.childRow}"]`);
if (childField === "cutoff") {
fields.forEach((field) => {
const input = event.target.closest("tr[data-child-index]").querySelector(`[data-child-field="${field}"]`);
input.checked = event.target.checked;
syncParent(row, field);
});
} else {
syncParent(row, childField);
}
});
})();

View File

@@ -0,0 +1,81 @@
(() => {
"use strict";
const pad = (value) => String(value).padStart(2, "0");
const parseDisplayValue = (value, mode) => {
const pattern = mode === "datetime"
? /^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}):(\d{2})$/
: /^(\d{2})\/(\d{2})\/(\d{4})$/;
const match = value.trim().match(pattern);
if (!match) return "";
const [, day, month, year, hour = "00", minute = "00", second = "00"] = match;
const date = new Date(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second));
if (date.getFullYear() !== Number(year) || date.getMonth() !== Number(month) - 1
|| date.getDate() !== Number(day) || date.getHours() !== Number(hour)
|| date.getMinutes() !== Number(minute) || date.getSeconds() !== Number(second)) return "";
const isoDate = `${year}-${month}-${day}`;
return mode === "datetime" ? `${isoDate}T${hour}:${minute}:${second}` : isoDate;
};
const formatPickerValue = (value, mode) => {
if (!value) return "";
const [datePart, timePart = "00:00:00"] = value.split("T");
const [year, month, day] = datePart.split("-");
if (!year || !month || !day) return "";
if (mode === "date") return `${day}/${month}/${year}`;
const [hour = "00", minute = "00", second = "00"] = timePart.split(":");
return `${day}/${month}/${year} ${pad(hour)}:${pad(minute)}:${pad(second)}`;
};
const initialise = (input) => {
if (input.dataset.datePickerReady === "true") return;
input.dataset.datePickerReady = "true";
const mode = input.dataset.dateMode === "date" ? "date" : "datetime";
const wrapper = document.createElement("span");
wrapper.className = "matrix-date-control";
input.parentNode.insertBefore(wrapper, input);
wrapper.appendChild(input);
const picker = document.createElement("input");
picker.type = mode === "datetime" ? "datetime-local" : "date";
picker.className = "matrix-date-control__picker";
picker.tabIndex = -1;
picker.setAttribute("aria-hidden", "true");
if (mode === "datetime") picker.step = "1";
const button = document.createElement("button");
button.type = "button";
button.className = "matrix-date-control__button";
button.setAttribute("aria-label", mode === "datetime" ? "Choose date and time" : "Choose date");
button.innerHTML = "&#128197;";
wrapper.append(picker, button);
input.closest(".widget")?.classList.add("matrix-date-field");
const syncPicker = () => {
const parsed = parseDisplayValue(input.value, mode);
if (parsed) picker.value = parsed;
};
syncPicker();
picker.addEventListener("change", () => {
input.value = formatPickerValue(picker.value, mode);
input.dispatchEvent(new Event("change", { bubbles: true }));
input.focus();
});
input.addEventListener("change", syncPicker);
button.addEventListener("click", () => {
syncPicker();
if (typeof picker.showPicker === "function") picker.showPicker();
else picker.click();
});
};
const initialiseAll = (root = document) => root.querySelectorAll(".matrix-date-input").forEach(initialise);
document.addEventListener("DOMContentLoaded", () => initialiseAll());
window.CygnusDateTimeInputs = { initialise: initialiseAll };
})();

View File

@@ -43,6 +43,17 @@
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>${jasperreports.version}</version>
<exclusions>
<exclusion>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>jakarta.servlet</groupId> <groupId>jakarta.servlet</groupId>

View File

@@ -5,6 +5,7 @@ import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import lib.models.Allocation; import lib.models.Allocation;
import lib.models.CutOffList; import lib.models.CutOffList;
import lib.models.CutoffPending;
import lib.models.ReferenceSheet; import lib.models.ReferenceSheet;
import lib.models.SendToOperation; import lib.models.SendToOperation;
import lib.models.Telesheet; import lib.models.Telesheet;
@@ -48,6 +49,23 @@ public class CutOffController extends AbstractAuthenticatedController {
return "edp/cutoff/cutoff"; return "edp/cutoff/cutoff";
} }
@RequestMapping(value = "cutoffpending", method = RequestMethod.POST)
public String cutoffPending(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("cutoffpending", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("cutoffpending", cutoffService.loadCutoffPending(auth.session()));
return "edp/cutoff/cutoffpending";
}
@RequestMapping(value = "savecutoffpending", method = RequestMethod.POST)
public String saveCutoffPending(@ModelAttribute("cutoffpending") CutoffPending request,
ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("cutoffpending", model, session, response);
if (!auth.isGranted()) return auth.viewName();
model.addAttribute("cutoffpending", cutoffService.saveCutoffPending(auth.session(), request));
return "edp/cutoff/cutoffpending";
}
@RequestMapping(value = "allocation", method = RequestMethod.POST) @RequestMapping(value = "allocation", method = RequestMethod.POST)
public String allocation(ModelMap model, HttpSession session, HttpServletResponse response) { public String allocation(ModelMap model, HttpSession session, HttpServletResponse response) {
PageAuthorization auth = authorizePage("allocation", model, session, response); PageAuthorization auth = authorizePage("allocation", model, session, response);

View File

@@ -1,238 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class Allocation {
private List<CutOffRecord> allocationlist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String AllocTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffRecord> getAllocationlist() {
return allocationlist;
}
public String getAllocTime() {
return AllocTime;
}
public void setAllocTime(String allocTime) {
AllocTime = allocTime;
}
public void setAllocationlist(List<CutOffRecord> allocationlist) {
this.allocationlist = allocationlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public Allocation getAllocList(String CompanyId,String BranchId,String UserId)
{
Allocation AList=new Allocation();
StringFunctions StrFunc=new StringFunctions(getErrCode());
setAllocTime(StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(27, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(28, Vals); //Generating list of portfolios to be allocated
if(DBF.isProcessFlag())
{
String [][] AllocListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<AllocListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(AllocListData[RecCount][0]);
CORec.setPortname(AllocListData[RecCount][1]);
CORec.setTotrv(Integer.parseInt(AllocListData[RecCount][2]));
CORec.setTotov(Integer.parseInt(AllocListData[RecCount][3]));
CORec.setTotpv(Integer.parseInt(AllocListData[RecCount][4]));
CORec.setIslocked(Integer.parseInt(AllocListData[RecCount][5]));
if(CORec.getIslocked()>0)
{
CORec.setAllocation(false);
}
else
{
CORec.setAllocation(Integer.parseInt(AllocListData[RecCount][6])<=0 ? false:true);
}
CORec.setLockedby(AllocListData[RecCount][7]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(29, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotpv(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setLockedby(SubListData[ListCount][8]);
SCORec.setAllocation(Integer.parseInt(SubListData[ListCount][9])<=0 ? false:true);
SCORec.setResiloc(SubListData[ListCount][10]);
SCORec.setOffloc(SubListData[ListCount][11]);
SCORec.setProploc(SubListData[ListCount][12]);
SCORec.setUuid(SubListData[ListCount][13]);
SCORec.setPortgroup(SubListData[ListCount][14]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
AList.setAllocTime(getAllocTime());
AList.setAllocationlist(Record);
AList.setSessUUID(getSessUUID());
AList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
AList.setErrDesc(DBF.getErrDesc());
AList.setErrMsg(DBF.getErrMsg());
AList.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
AList.setErrDesc(DBF.getErrDesc());
AList.setErrMsg(DBF.getErrMsg());
AList.setErrCode(getErrCode());
}
return AList;
}
public void FinalizeAllocation(String UserId,String CompanyId,String BranchId)
{
setProcessFlag(true);
//---> Allocation status
int TotRv=0;
int TotOv=0;
int TotPv=0;
int TotRvAlloc=0;
int TotOvAlloc=0;
int TotPvAlloc=0;
int TotRvFailed=0;
int TotOvFailed=0;
int TotPvFailed=0;
setAllocTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
//<--- Allocation status ends
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getAllocationlist().size();
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord AllocRec=(CutOffRecord)getAllocationlist().get(LIndx);
/*if (AllocRec.getIslocked()==0 && AllocRec.isAllocation())
{*/
String Portfolioid=AllocRec.getPortfolioid();
int SubList=AllocRec.getSublist().size();
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)AllocRec.getSublist().get(SIndx);
if(SubRec.isAllocation())
{
TotRv=TotRv+SubRec.getTotrv();
TotOv=TotOv+SubRec.getTotov();
TotPv=TotPv+SubRec.getTotpv();
}
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isAllocation() ? 1:0)+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getTotrv()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getTotov()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getTotpv()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getResiloc()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getOffloc()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getProploc()+""+GlobalClass.ColDelim;
Query=Query+""+getAllocTime()+""+GlobalClass.ColDelim;
Query=Query+""+CompanyId+""+GlobalClass.ColDelim;
Query=Query+""+BranchId+""+GlobalClass.ColDelim;
Query=Query+""+Portfolioid+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getPortgroup()+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(30, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
if(SubRec.isAllocation())
{
TotRvAlloc=TotRvAlloc+SubRec.getTotrv();
TotOvAlloc=TotOvAlloc+SubRec.getTotov();
TotPvAlloc=TotPvAlloc+SubRec.getTotpv();
}
}
else
{
if(SubRec.isAllocation())
{
TotRvFailed=TotRvFailed+SubRec.getTotrv();;
TotOvFailed=TotOvFailed+SubRec.getTotov();;
TotPvFailed=TotPvFailed+SubRec.getTotpv();;
}
}
}
/*}*/
}
if(TotRvAlloc>0 || TotOvAlloc >0 || TotPvAlloc >0)
{
setErrMsg(getErrCode()+"ALFAIL:Info:Total ("+TotRvAlloc+" / "+TotRv+")-RV, ("+TotOvAlloc+" / "+TotOv+")-OV, ("+TotPvAlloc+" / "+TotPv+")-PV allocated successfully.");
}
else
{
setErrMsg(getErrCode()+"ALFAIL:Error:Allocation failed please try again.");
}
}
}

View File

@@ -1,58 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
public class AutoCutThread extends Thread {
private String uuid;
private String portfolioid;
private String userid;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public void run(){
DBFunctions dbf=new DBFunctions("3600");
dbf.setProcessFlag(true);
String [] Qvals=(getPortfolioid()+GlobalClass.ColDelim+getUuid()+GlobalClass.ColDelim+getUserid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
dbf.FetchRunQuery(475, Qvals);
if(dbf.isProcessFlag())
{
System.out.println(dbf.getProcResult());
}
else
{
System.out.println(dbf.getErrDesc());
}
}
}

View File

@@ -1,196 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class CutOffList {
private List<CutOffRecord> cofflist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String CutoffTime;
private String Batch;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffRecord> getCofflist() {
return cofflist;
}
public void setCofflist(List<CutOffRecord> cofflist) {
this.cofflist = cofflist;
}
public String getCutoffTime() {
return CutoffTime;
}
public void setCutoffTime(String cutoffTime) {
CutoffTime = cutoffTime;
}
public String getBatch() {
return Batch;
}
public void setBatch(String batch) {
Batch = batch;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public CutOffList getCutOffList(String CompanyId,String BranchId,String UserId)
{
CutOffList CList=new CutOffList();
StringFunctions StrFunc=new StringFunctions(getErrCode());
String CutTime=StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CutTime+GlobalClass.ColDelim+CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(17, Vals); //Updating enabled process in cutoff table
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(18, Vals);
if(DBF.isProcessFlag())
{
String [][] COffListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<COffListData.length;RecCount++)
{
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(COffListData[RecCount][0]);
CORec.setPortname(COffListData[RecCount][1]);
CORec.setAllocation(COffListData[RecCount][2].equals("1") ? true:false);
CORec.setSms(COffListData[RecCount][3].equals("1") ? true:false);
CORec.setTelesheet(COffListData[RecCount][4].equals("1") ? true:false);
CORec.setEarlier(COffListData[RecCount][5].equals("1") ? true:false);
CORec.setNegative(COffListData[RecCount][6].equals("1") ? true:false);
CORec.setIslocked(Integer.parseInt(COffListData[RecCount][7]));
CORec.setLockedby(COffListData[RecCount][8]);
CORec.setDocut(CORec.getIslocked()==0 ? true:false);
Record.add(CORec);
}
CList.setCutoffTime(CutTime);
CList.setCofflist(Record);
CList.setSessUUID(getSessUUID());
CList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
return CList;
}
public void FinalizeCutoffList(String UserId,String CompanyId,String BranchId)
{
setProcessFlag(true);
int Listcount=getCofflist().size();
String Query="";
for(int Indx=0;Indx<Listcount;Indx++)
{
CutOffRecord CRec=(CutOffRecord)getCofflist().get(Indx);
if(CRec.isDocut())
{
Query=Query+"update main_operations set ";
Query=Query+"allocation="+(CRec.isAllocation()? "1":"-2")+",";
Query=Query+"sms="+(CRec.isSms()? "1":"-2")+",";
if(!CRec.isSms())
{
Query=Query+"smsby="+UserId+",";
}
Query=Query+"telesheet=(case when telesheet=0 then 0 else "+(CRec.isTelesheet()? "1":"-2")+" end),";
if(!CRec.isTelesheet())
{
Query=Query+"telesheetby="+UserId+",";
}
Query=Query+"earlier="+(CRec.isEarlier()? "1":"-2")+",";
if(!CRec.isEarlier())
{
Query=Query+"earlierby="+UserId+",";
}
Query=Query+"negative="+(CRec.isNegative()? "1":"-2")+",";
if(!CRec.isNegative())
{
Query=Query+"negativeby="+UserId+",";
}
Query=Query+"cutoffby="+UserId+",";
Query=Query+"islocked=0,";
Query=Query+"batch=''"+getBatch()+"'' ";
Query=Query+"where (cutoffby is null or cutoffby=0) and cutoffon=''"+getCutoffTime()+"'' and islocked="+UserId+" ";
Query=Query+"and company_id="+CompanyId+" and branch_id="+BranchId+" and portfolio_id="+CRec.getPortfolioid()+";";
}
else
{
Query=Query+"update main_operations set ";
Query=Query+"cutoffon=NULL,";
Query=Query+"islocked=0 ";
Query=Query+"where (cutoffby is null or cutoffby=0) and cutoffon=''"+getCutoffTime()+"'' and islocked="+UserId+" ";
Query=Query+"and company_id="+CompanyId+" and branch_id="+BranchId+" and portfolio_id="+CRec.getPortfolioid()+";";
}
}
if(Query.length()>0)
{
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
DBF.FetchRunQuery(26, (Query+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
setProcessFlag(true);
setErrMsg(getErrCode()+"STCUT:Info:Cut List is now ready to be processed.");
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
}
else
{
setProcessFlag(false);
setErrMsg(getErrCode()+"STCUT:Info:Please select atleast one portfolio for Cut-Off Process.");
}
}
}

View File

@@ -1,235 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class CutOffRecord {
private List<CutOffRecord> sublist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String portfolioid;
private String portname;
private String customername;
private String apptype;
private String mvcode;
private String applno;
private boolean allocation;
private boolean sms;
private boolean telesheet;
private boolean earlier;
private boolean negative;
private int islocked;
private String lockedby;
private boolean docut;
private int ischanged;
private int totrv;
private int totov;
private int totpv;
private int totrtv;
private int tototv;
private int totref;
private boolean tv;
private boolean oprsend;
private String resiloc;
private String offloc;
private String proploc;
private String uuid;
private String repformat;
private String repfunction;
private String message;
private String portgroup;
public List<CutOffRecord> getSublist() {
return sublist;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getApptype() {
return apptype;
}
public void setApptype(String apptype) {
this.apptype = apptype;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public void setSublist(List<CutOffRecord> sublist) {
this.sublist = sublist;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getPortname() {
return portname;
}
public void setPortname(String portname) {
this.portname = portname;
}
public boolean isAllocation() {
return allocation;
}
public void setAllocation(boolean allocation) {
this.allocation = allocation;
}
public boolean isSms() {
return sms;
}
public void setSms(boolean sms) {
this.sms = sms;
}
public boolean isTelesheet() {
return telesheet;
}
public void setTelesheet(boolean telesheet) {
this.telesheet = telesheet;
}
public boolean isEarlier() {
return earlier;
}
public void setEarlier(boolean earlier) {
this.earlier = earlier;
}
public boolean isNegative() {
return negative;
}
public void setNegative(boolean negative) {
this.negative = negative;
}
public int getIslocked() {
return islocked;
}
public void setIslocked(int islocked) {
this.islocked = islocked;
}
public String getLockedby() {
return lockedby;
}
public void setLockedby(String lockedby) {
this.lockedby = lockedby;
}
public int getIschanged() {
return ischanged;
}
public void setIschanged(int ischanged) {
this.ischanged = ischanged;
}
public boolean isDocut() {
return docut;
}
public void setDocut(boolean docut) {
this.docut = docut;
}
public int getTotrv() {
return totrv;
}
public void setTotrv(int totrv) {
this.totrv = totrv;
}
public int getTotov() {
return totov;
}
public void setTotov(int totov) {
this.totov = totov;
}
public int getTotpv() {
return totpv;
}
public void setTotpv(int totpv) {
this.totpv = totpv;
}
public int getTotrtv() {
return totrtv;
}
public void setTotrtv(int totrtv) {
this.totrtv = totrtv;
}
public int getTototv() {
return tototv;
}
public void setTototv(int tototv) {
this.tototv = tototv;
}
public int getTotref() {
return totref;
}
public void setTotref(int totref) {
this.totref = totref;
}
public boolean isTv() {
return tv;
}
public void setTv(boolean tv) {
this.tv = tv;
}
public boolean isOprsend() {
return oprsend;
}
public void setOprsend(boolean oprsend) {
this.oprsend = oprsend;
}
public String getResiloc() {
return resiloc;
}
public void setResiloc(String resiloc) {
this.resiloc = resiloc;
}
public String getOffloc() {
return offloc;
}
public void setOffloc(String offloc) {
this.offloc = offloc;
}
public String getProploc() {
return proploc;
}
public void setProploc(String proploc) {
this.proploc = proploc;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getRepformat() {
return repformat;
}
public void setRepformat(String repformat) {
this.repformat = repformat;
}
public String getRepfunction() {
return repfunction;
}
public void setRepfunction(String repfunction) {
this.repfunction = repfunction;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getPortgroup() {
return portgroup;
}
public void setPortgroup(String portgroup) {
this.portgroup = portgroup;
}
}

View File

@@ -1,83 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
public class PhotoCases {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String[][] getPhotoCaseList(String BranchId)
{
String [][] CaseList=null;
PhotoCases PC=new PhotoCases();
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(303, (BranchId).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
CaseList=dbf.getResultArray();
}
else
{
setProcessFlag(false);
setErrDesc(dbf.getErrDesc());
setErrMsg(dbf.getErrMsg());
PC.setErrCode(getErrCode());
PC.setErrDesc(getErrDesc());
PC.setErrMsg(getErrMsg());
}
return CaseList;
}
public String FinalizePhotoCaseList(String [] Qvals)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
String Result=dbf.FetchRunQuery(300, Qvals);
if(dbf.isProcessFlag())
{
Result="success";
}
else
{
setProcessFlag(false);
setErrDesc(dbf.getErrDesc());
setErrMsg(dbf.getErrMsg());
Result=getErrMsg();
}
return Result;
}
}

View File

@@ -1,64 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
public class ReferenceSheet {
private List<CutOffRecord> tvrlist = new ArrayList<>();
private String TeleSheetTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
private String TelePDFLink;
public List<CutOffRecord> getTvrlist() {
return tvrlist;
}
public String getTeleSheetTime() {
return TeleSheetTime;
}
public void setTeleSheetTime(String teleSheetTime) {
TeleSheetTime = teleSheetTime;
}
public void setTvrlist(List<CutOffRecord> tvrlist) {
this.tvrlist = tvrlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getTelePDFLink() {
return TelePDFLink;
}
public void setTelePDFLink(String telePDFLink) {
TelePDFLink = telePDFLink;
}
}

View File

@@ -1,187 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class SendToOperation {
private List<CutOffRecord> caselist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String SendTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffRecord> getCaselist() {
return caselist;
}
public String getSendTime() {
return SendTime;
}
public void setSendTime(String sendTime) {
SendTime = sendTime;
}
public void setCaselist(List<CutOffRecord> caselist) {
this.caselist = caselist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public SendToOperation getRecordList(String CompanyId,String BranchId,String UserId)
{
SendToOperation Sopr=new SendToOperation();
StringFunctions StrFunc=new StringFunctions(getErrCode());
setSendTime(StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(44, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(45, Vals); //Generating list of portfolios to be allocated
if(DBF.isProcessFlag())
{
String [][] SendListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<SendListData.length;RecCount++)
{
DBF.setProcessFlag(true);
//mvcode,applno,customername,rv,ov,pv,islocked,lockedby
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(SendListData[RecCount][0]);
CORec.setPortname(SendListData[RecCount][1]);
CORec.setTotrv(Integer.parseInt(SendListData[RecCount][2]));
CORec.setTotov(Integer.parseInt(SendListData[RecCount][3]));
CORec.setTotpv(Integer.parseInt(SendListData[RecCount][4]));
CORec.setTotrtv(Integer.parseInt(SendListData[RecCount][5]));
CORec.setTototv(Integer.parseInt(SendListData[RecCount][6]));
CORec.setTotref(Integer.parseInt(SendListData[RecCount][7]));
CORec.setIslocked(Integer.parseInt(SendListData[RecCount][8]));
if(CORec.getIslocked()>0)
{
CORec.setOprsend(false);
}
else
{
CORec.setOprsend(Integer.parseInt(SendListData[RecCount][9])<=0 ? false:true);
}
CORec.setLockedby(SendListData[RecCount][10]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(46, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotpv(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setTotrtv(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setTototv(Integer.parseInt(SubListData[ListCount][8]));
SCORec.setTotref(Integer.parseInt(SubListData[ListCount][9]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][10]));
SCORec.setLockedby(SubListData[ListCount][11]);
SCORec.setOprsend(Integer.parseInt(SubListData[ListCount][12])<=0 ? false:true);
SCORec.setUuid(SubListData[ListCount][13]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
Sopr.setSendTime(getSendTime());
Sopr.setCaselist(Record);
Sopr.setSessUUID(getSessUUID());
Sopr.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
Sopr.setErrDesc(DBF.getErrDesc());
Sopr.setErrMsg(DBF.getErrMsg());
Sopr.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
Sopr.setErrDesc(DBF.getErrDesc());
Sopr.setErrMsg(DBF.getErrMsg());
Sopr.setErrCode(getErrCode());
}
return Sopr;
}
public void SendToOpr(String UserId,String CompanyId,String BranchId)
{
setProcessFlag(true);
setSendTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getCaselist().size();
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord SendRec=(CutOffRecord)getCaselist().get(LIndx);
String Portfolioid=SendRec.getPortfolioid();
int SubList=SendRec.getSublist().size();
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)SendRec.getSublist().get(SIndx);
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isOprsend() ? 1:0)+""+GlobalClass.ColDelim;
Query=Query+""+getSendTime()+""+GlobalClass.ColDelim;
Query=Query+""+UserId+""+GlobalClass.ColDelim;
Query=Query+""+CompanyId+""+GlobalClass.ColDelim;
Query=Query+""+BranchId+""+GlobalClass.ColDelim;
Query=Query+""+Portfolioid+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(47, Query.split(GlobalClass.ColDelim));
}
}
}
}

View File

@@ -1,261 +0,0 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.edp.output.model.ReportOutput;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class Telesheet {
private List<CutOffRecord> tvrlist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String TeleSheetTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
private String TelePDFLink;
public List<CutOffRecord> getTvrlist() {
return tvrlist;
}
public String getTeleSheetTime() {
return TeleSheetTime;
}
public void setTeleSheetTime(String teleSheetTime) {
TeleSheetTime = teleSheetTime;
}
public void setTvrlist(List<CutOffRecord> tvrlist) {
this.tvrlist = tvrlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getTelePDFLink() {
return TelePDFLink;
}
public void setTelePDFLink(String telePDFLink) {
TelePDFLink = telePDFLink;
}
public Telesheet getTeleList(String CompanyId,String BranchId,String UserId)
{
Telesheet TList=new Telesheet();
StringFunctions StrFunc=new StringFunctions(getErrCode());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(31, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(32, Vals); //Generating list of portfolios those telesheet to be generated
if(DBF.isProcessFlag())
{
String [][] TvrListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<TvrListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(TvrListData[RecCount][0]);
CORec.setPortname(TvrListData[RecCount][1]);
CORec.setTotrv(Integer.parseInt(TvrListData[RecCount][2]));
CORec.setTotov(Integer.parseInt(TvrListData[RecCount][3]));
CORec.setTotref(Integer.parseInt(TvrListData[RecCount][4]));
CORec.setIslocked(Integer.parseInt(TvrListData[RecCount][5]));
if(CORec.getIslocked() > 0)
{
CORec.setTv(false);
}
else
{
CORec.setTv(Integer.parseInt(TvrListData[RecCount][6])<=0 ? false:true);
}
CORec.setLockedby(TvrListData[RecCount][7]);
CORec.setRepformat(TvrListData[RecCount][8]);
CORec.setRepfunction(TvrListData[RecCount][9]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(33, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotref(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setLockedby(SubListData[ListCount][8]);
SCORec.setTv(Integer.parseInt(SubListData[ListCount][9])<=0 ? false:true);
SCORec.setUuid(SubListData[ListCount][10]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
TList.setTvrlist(Record);
TList.setSessUUID(getSessUUID());
TList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
return TList;
}
public void FinalizeTeleSheet(String UserId,String CompanyId,String BranchId,String RootPath)
{
String TeleSheetLink="";
setTelePDFLink("");
setProcessFlag(true);
//---> TeleSheet status
int TotRtv=0;
int TotOtv=0;
int TotRef=0;
int TotRtvGen=0;
int TotOtvGen=0;
int TotRefGen=0;
int TotRtvFailed=0;
int TotOtvFailed=0;
int TotRefFailed=0;
setTeleSheetTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
//<--- TeleSheet status ends
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getTvrlist().size();
String [][] TeleCutList=new String[PortList][6];
int CutListIndx=0;
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord TvrRec=(CutOffRecord)getTvrlist().get(LIndx);
TeleCutList[LIndx][4]="empty";
if (TvrRec.getIslocked()==0 && TvrRec.isTv())
{
int SubList=TvrRec.getSublist().size();
// Filling list of portfolios and their respective tele format
TeleCutList[CutListIndx][0]=TvrRec.getPortfolioid();
TeleCutList[CutListIndx][1]=getTeleSheetTime();
TeleCutList[CutListIndx][2]=TvrRec.getRepformat();
TeleCutList[CutListIndx][3]=UserId;
TeleCutList[CutListIndx][5]=TvrRec.getRepfunction();
//<--- Ends
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)TvrRec.getSublist().get(SIndx);
if(SubRec.isTv())
{
TeleCutList[CutListIndx][4]="notempty";
TotRtv=TotRtv+SubRec.getTotrv();
TotOtv=TotOtv+SubRec.getTotov();
TotRef=TotRef+SubRec.getTotref();
}
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+(SubRec.isTv() ? UserId:0)+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? getTeleSheetTime():"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? UserId:"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(34, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
if(SubRec.isTv())
{
TotRtvGen=TotRtvGen+SubRec.getTotrv();
TotOtvGen=TotOtvGen+SubRec.getTotov();
TotRefGen=TotRefGen+SubRec.getTotref();
}
}
else
{
if(SubRec.isTv())
{
TotRtvFailed=TotRtvFailed+SubRec.getTotrv();;
TotOtvFailed=TotOtvFailed+SubRec.getTotov();;
TotRefFailed=TotRefFailed+SubRec.getTotref();;
}
}
}
CutListIndx=CutListIndx+1;
}
}
if (TotRtvGen > 0 || TotOtvGen>0 || TotRefGen > 0)
{
ReportOutput TS=new ReportOutput();
TS.setProcessFlag(true);
TS.setErrCode(getErrCode());
TeleSheetLink=TS.GenerateCallingSheet(TeleCutList,GlobalClass.getStoragePath(),CompanyId,BranchId,"telesheet");
if(!TS.isProcessFlag())
{
setProcessFlag(false);
setErrMsg(TS.getErrMsg());
setErrDesc(TS.getErrDesc());
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"TSGEN:Info:Telesheet generated successfully. Please use link in a page to open Tele Sheet.");
setTelePDFLink(GlobalClass.DocServer+TeleSheetLink);
DBF.FetchRunQuery(103, (getTeleSheetTime()+GlobalClass.ColDelim+"telesheet"+GlobalClass.ColDelim+TeleSheetLink+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"ETLST:Error:No records found to generate Tele Sheet.");
}
}
}

View File

@@ -1,47 +0,0 @@
package matrix.nimble.edp.punching.model;
public class CaseGrid {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String PortfolioId;
private String CaseID;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getPortfolioId() {
return PortfolioId;
}
public void setPortfolioId(String portfolioId) {
PortfolioId = portfolioId;
}
public String getCaseID() {
return CaseID;
}
public void setCaseID(String caseID) {
CaseID = caseID;
}
}

View File

@@ -1,180 +0,0 @@
package matrix.nimble.edp.punching.model;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class PunchingHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String visiblecontents;
private String dynamicpanel;
private String dynamicsection;
private String dynamicfields;
private String portfolioid;
private String [][] optionvals;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getVisiblecontents() {
return visiblecontents;
}
public void setVisiblecontents(String visiblecontents) {
this.visiblecontents = visiblecontents;
}
public String getDynamicpanel() {
return dynamicpanel;
}
public void setDynamicpanel(String dynamicpanel) {
this.dynamicpanel = dynamicpanel;
}
public String getDynamicsection() {
return dynamicsection;
}
public void setDynamicsection(String dynamicsection) {
this.dynamicsection = dynamicsection;
}
public String getDynamicfields() {
return dynamicfields;
}
public void setDynamicfields(String dynamicfields) {
this.dynamicfields = dynamicfields;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String[][] getOptionvals() {
return optionvals;
}
public void setOptionvals(String[][] optionvals) {
this.optionvals = optionvals;
}
public String GetVisibleSections()
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
setVisiblecontents("");
return dbf.FetchRunQuery(10, ("10"+GlobalClass.ColDelim+getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)).replace(GlobalClass.RowDelim, "");
}
public void GetDDValues(int QueryId,String [] Qvals)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(QueryId, Qvals);
if(dbf.isProcessFlag())
{
setOptionvals(dbf.getResultArray());
}
else
{
setOptionvals(null);
}
}
public void DynamicHtml(String pageId)
{
DBFunctions dbf=new DBFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
setDynamicpanel("");
setDynamicfields("");
dbf.setProcessFlag(true);
String ResultString=dbf.FetchRunQuery(74, (getPortfolioid()+GlobalClass.ColDelim+pageId+GlobalClass.ColDelim+"ADDCASE"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
StrFunc=new StringFunctions(getErrCode());
CommonFunctions Cfunc=new CommonFunctions();
String [][] ResultSet=StrFunc.ConverTo2DArray(ResultString, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(StrFunc.isProcessFlag())
{
if(ResultSet.length > 0)
{
setDynamicsection("section6"+GlobalClass.ColDelim);
Cfunc.setGeneratedHtml("");
Cfunc.setPrevControl("");
Cfunc.setDynamicCtrls("");
for(int indx=0;indx<ResultSet.length;indx++)
{
String ControlVal="";
String secContainer="";
String Temp="";
secContainer=Cfunc.DynamicControls(ResultSet[indx], ControlVal);
if(secContainer.equals("Othersec"))
{
Temp=getDynamicpanel();
if(Temp.endsWith("</select></div></div></div>") && Cfunc.getGeneratedHtml().endsWith("</select></div></div></div>"))
{
if(!Cfunc.getGeneratedHtml().startsWith("<div class='widget'>"))
{
Temp=Temp.substring(0,Temp.lastIndexOf("</select></div></div></div>"));
}
}
setDynamicpanel(Temp+""+Cfunc.getGeneratedHtml());
}
}
setDynamicfields(Cfunc.getDynamicCtrls());
}
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
else
{
setProcessFlag(dbf.getErrMsg().toLowerCase().contains("no records found") ? true:false);
setErrMsg(dbf.getErrMsg().toLowerCase().contains("no records found") ? "" : dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
public String[][] loadCasesForAddrCorrection() {
String [][]resultArray = null;
DBFunctions dbf=new DBFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
setDynamicpanel("");
setDynamicfields("");
dbf.setProcessFlag(true);
dbf.FetchRunQuery(474, (getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
resultArray = dbf.getResultArray();
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
return resultArray;
}
}

View File

@@ -8,7 +8,6 @@ import jakarta.servlet.http.HttpSession;
import matrix.nimble.edp.tools.model.DelCaseGrid; import matrix.nimble.edp.tools.model.DelCaseGrid;
import matrix.nimble.edp.tools.model.EdpToolsHandler; import matrix.nimble.edp.tools.model.EdpToolsHandler;
import matrix.nimble.edp.tools.model.AddEditProduct; import matrix.nimble.edp.tools.model.AddEditProduct;
import matrix.nimble.edp.tools.model.CutoffPending;
import matrix.nimble.model.Session; import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass; import matrix.nimble.utilities.GlobalClass;
@@ -28,50 +27,6 @@ import org.springframework.web.bind.annotation.SessionAttributes;
@SessionAttributes({"Sessvals"}) @SessionAttributes({"Sessvals"})
public class EDPTools public class EDPTools
{ {
@RequestMapping(value="cutoffpending",method=RequestMethod.POST )
public String PendingProcess(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
CutoffPending PList=new CutoffPending();
PList.setErrCode("1010");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
PList.setSessUUID(UUID);
model.addAttribute("cutoffpending", PList.getPList(Sessvals.getCompanyID(), Sessvals.getBranchID(), Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/edpprocesspanel";
}
@RequestMapping(value="savecutoffpending",method=RequestMethod.POST )
public String SavePendingProcess(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="cutoffpending") CutoffPending CPend,HttpSession session)
{
CPend.setErrCode("1010");
if(session.getAttribute("UUID").toString().equals(CPend.getSessUUID()))
{
CPend.FinalizeCutoffPending(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID(),CPend);
}
else
{
CPend.setProcessFlag(true);
CPend.setErrMsg("");
}
if(CPend.isProcessFlag())
{
CutoffPending PList=new CutoffPending();
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
PList.setSessUUID(UUID);
model.addAttribute("cutoffpending", PList.getPList(Sessvals.getCompanyID(), Sessvals.getBranchID(), Sessvals.getUserID()));
PList.setErrCode(CPend.getErrCode());
PList.setErrMsg(CPend.getErrMsg());
model.addAttribute("cutoffpending", PList);
model.addAttribute("Sessvals",Sessvals);
}
else
{
model.addAttribute("cutoffpending",CPend);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/edpprocesspanel";
}
@RequestMapping(value="delcutoffgrid",method=RequestMethod.POST ) @RequestMapping(value="delcutoffgrid",method=RequestMethod.POST )
public String OpenEditGrid(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals) public String OpenEditGrid(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{ {

View File

@@ -1,89 +0,0 @@
package matrix.nimble.edp.tools.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class CutOffPRecord
{
private List<CutOffPRecord> pendingsublist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffPRecord.class));
private String portfolio;
private String customername;
private String cutofftime;
private int total;
private String uuid;
private boolean allocation;
private boolean telesheet;
private boolean earlier;
private boolean negative;
private boolean cutoff;
public String getPortfolio() {
return portfolio;
}
public void setPortfolio(String portfolio) {
this.portfolio = portfolio;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public List<CutOffPRecord> getPendingsublist() {
return pendingsublist;
}
public void setPendingsublist(List<CutOffPRecord> pendingsublist) {
this.pendingsublist = pendingsublist;
}
public String getCutofftime() {
return cutofftime;
}
public void setCutofftime(String cutofftime) {
this.cutofftime = cutofftime;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public boolean isAllocation() {
return allocation;
}
public void setAllocation(boolean allocation) {
this.allocation = allocation;
}
public boolean isTelesheet() {
return telesheet;
}
public void setTelesheet(boolean telesheet) {
this.telesheet = telesheet;
}
public boolean isEarlier() {
return earlier;
}
public void setEarlier(boolean earlier) {
this.earlier = earlier;
}
public boolean isNegative(){
return negative;
}
public void setNegative(boolean negative) {
this.negative = negative;
}
public boolean isCutoff(){
return cutoff;
}
public void setCutoff(boolean cutoff) {
this.cutoff = cutoff;
}
}

View File

@@ -1,226 +0,0 @@
package matrix.nimble.edp.tools.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.edp.cutoff.model.Allocation;
import matrix.nimble.edp.cutoff.model.CutOffRecord;
import matrix.nimble.edp.cutoff.model.Telesheet;
import matrix.nimble.edp.output.model.ReportOutput;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class CutoffPending
{
private List<CutOffPRecord> pendinglist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffPRecord.class));
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffPRecord> getPendinglist()
{
return pendinglist;
}
public void setPendinglist(List<CutOffPRecord> pendinglist)
{
this.pendinglist = pendinglist;
}
public String getErrMsg()
{
return ErrMsg;
}
public void setErrMsg(String errMsg)
{
ErrMsg = errMsg;
}
public String getErrDesc()
{
return ErrDesc;
}
public void setErrDesc(String errDesc)
{
ErrDesc = errDesc;
}
public String getErrCode()
{
return ErrCode;
}
public void setErrCode(String errCode)
{
ErrCode = errCode;
}
public String getSessUUID()
{
return SessUUID;
}
public void setSessUUID(String sessUUID)
{
SessUUID = sessUUID;
}
public boolean isProcessFlag()
{
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag)
{
ProcessFlag = processFlag;
}
public CutoffPending getPList(String CompanyId,String BranchId,String UserId)
{
CutoffPending CPList=new CutoffPending();
StringFunctions StrFunc=new StringFunctions(getErrCode());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData=DBF.FetchRunQuery(49, Vals); //Generating list of portfolios those telesheet to be generated
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(50, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] PListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffPRecord> Record=new ArrayList<CutOffPRecord>();
for(int RecCount=0;RecCount<PListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffPRecord CORec=new CutOffPRecord();
CORec.setCutofftime(PListData[RecCount][0]);
CORec.setTotal(Integer.parseInt(PListData[RecCount][1]));
CORec.setAllocation(false);
CORec.setTelesheet(false);
CORec.setEarlier(false);
CORec.setNegative(false);
CORec.setCutoff(false);
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffPRecord> SubRecord=new ArrayList<CutOffPRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
if(!SubListData[ListCount][3].equals(CORec.getCutofftime()))
{
continue;
}
CutOffPRecord SCORec=new CutOffPRecord();
SCORec.setUuid(SubListData[ListCount][0]);
SCORec.setPortfolio(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setAllocation(false);
SCORec.setTelesheet(false);
SCORec.setEarlier(false);
SCORec.setNegative(false);
SCORec.setCutoff(false);
SubRecord.add(SCORec);
}
CORec.setPendingsublist(SubRecord);
}
Record.add(CORec);
}
CPList.setPendinglist(Record);
CPList.setSessUUID(getSessUUID());
CPList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
CPList.setErrDesc(DBF.getErrDesc());
CPList.setErrMsg(DBF.getErrMsg());
CPList.setErrCode(getErrCode());
}
return CPList;
}
public void FinalizeCutoffPending(String UserId,String CompanyId,String BranchId,CutoffPending CPend)
{
setProcessFlag(true);
int TotBatchSuccess=0;
int TotBatchFailed=0;
int TotEntitySuccess=0;
int TotEntityFailed=0;
String entityFailedMsg="";
String batchFailedMsg="Failed Batches: ";
String msg="";
String Query="";
String Temp="";
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
int PDList=CPend.getPendinglist().size();
for(int LIndx=0;LIndx<PDList;LIndx++)
{
CutOffPRecord MRec=CPend.getPendinglist().get(LIndx);
if(MRec.isCutoff())
{
DBF.setProcessFlag(true);
Query="";
Query=Query+""+GlobalClass.ColDelim;
Query=Query+""+MRec.getCutofftime()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isAllocation()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isTelesheet()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isEarlier()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isNegative()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isCutoff()+""+GlobalClass.ColDelim;
Query=Query+"1"+GlobalClass.ColDelim;
Temp=DBF.FetchRunQuery(51, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
TotBatchSuccess++;
}
else
{
TotBatchFailed++;
entityFailedMsg+="<br/>Type: Batch Cutoff Batch Time: "+MRec.getCutofftime()+" ("+MRec.getTotal()+")";
}
continue;
}
int SBList=MRec.getPendingsublist().size();
for(int SIndx=0;SIndx<SBList;SIndx++)
{
CutOffPRecord SRec=MRec.getPendingsublist().get(SIndx);
DBF.setProcessFlag(true);
Query="";
Query=Query+""+SRec.getUuid()+""+GlobalClass.ColDelim;
Query=Query+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isAllocation()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isTelesheet()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isEarlier()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isNegative()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isCutoff()+""+GlobalClass.ColDelim;
Query=Query+"0"+GlobalClass.ColDelim;
Temp=DBF.FetchRunQuery(51, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
TotEntitySuccess++;
}
else
{
TotEntityFailed++;
entityFailedMsg+="<tr><td>Entity</td><td>"+SRec.getUuid()+"</td></tr>";
}
}
}
if(TotEntityFailed <= 0)
{
CPend.setErrMsg(CPend.getErrCode()+"CPFAIL:Info:Cutoff Pending Successfully...<br/><span align=center>Total Success Entities ("+TotEntitySuccess+") Total Success Batches ("+TotBatchSuccess+")</span>");
}
else
{
msg="<tr><td>Total Failed Entities ("+TotEntityFailed+")</td><td> Total Failed Batches ("+TotBatchFailed+")</td></tr><tr><td>Type</td><td>UUID</td></tr>"+entityFailedMsg;
CPend.setErrMsg(CPend.getErrCode()+"CPFAIL:Error:<table><tr><td>Cutoff Pending Failed </td></tr>"+msg+"</table>");
}
}
}

View File

@@ -8,8 +8,11 @@ import jakarta.servlet.http.HttpSession;
import matrix.nimble.mis.model.Filters; import matrix.nimble.mis.model.Filters;
import matrix.nimble.mis.model.MISHandler; import matrix.nimble.mis.model.MISHandler;
import matrix.nimble.cloud.identity.CloudSessionMapper;
import matrix.nimble.model.Session; import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass; import matrix.nimble.utilities.GlobalClass;
import matrix.services.commons.CommonService;
import matrix.services.mis.HourlyMisService;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
@@ -17,10 +20,41 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@Controller @Controller
@SessionAttributes({"Sessvals"}) @SessionAttributes({"Sessvals"})
public class MIS { public class MIS {
private final HourlyMisService hourlyMisService;
private final CommonService commonService;
private final CloudSessionMapper cloudSessionMapper;
public MIS(
HourlyMisService hourlyMisService,
CommonService commonService,
CloudSessionMapper cloudSessionMapper) {
this.hourlyMisService = hourlyMisService;
this.commonService = commonService;
this.cloudSessionMapper = cloudSessionMapper;
}
@ModelAttribute("Sessvals")
public Session legacySession(HttpSession httpSession) {
Session legacySession = commonService.getSession(httpSession);
if (legacySession != null) {
return legacySession;
}
var userSession = commonService.getUserSession(httpSession);
if (userSession == null) {
return null;
}
legacySession = cloudSessionMapper.toLegacy(userSession);
commonService.storeSession(httpSession, legacySession);
return legacySession;
}
@RequestMapping(value="datetimerange",method=RequestMethod.POST ) @RequestMapping(value="datetimerange",method=RequestMethod.POST )
public String DateRangeFilter(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session) public String DateRangeFilter(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{ {
@@ -84,6 +118,13 @@ public class MIS {
@RequestMapping(value="dtmis",method=RequestMethod.POST ) @RequestMapping(value="dtmis",method=RequestMethod.POST )
public String DateRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session) public String DateRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{ {
if (filter.getQid() == HourlyMisService.QUERY_ID) {
filter.setHtml(hourlyMisService.renderHtml(filter, Sessvals));
model.addAttribute("hourlyJasperReport", true);
model.addAttribute("filter", filter);
model.addAttribute("Sessvals", Sessvals);
return "mis/misreport";
}
MISHandler MH=new MISHandler(); MISHandler MH=new MISHandler();
MH.setProcessFlag(true); MH.setProcessFlag(true);
MH.setErrCode("5101"); MH.setErrCode("5101");
@@ -93,6 +134,49 @@ public class MIS {
model.addAttribute("Sessvals",Sessvals); model.addAttribute("Sessvals",Sessvals);
return "mis/misreport"; return "mis/misreport";
} }
@RequestMapping(value="dtmis/xlsx",method=RequestMethod.POST )
@ResponseBody
public ResponseEntity<byte[]> DateRangeMISXlsx(
@ModelAttribute(value="Sessvals") Session Sessvals,
@ModelAttribute(value="filter") Filters filter) {
if (filter.getQid() != HourlyMisService.QUERY_ID) {
return ResponseEntity.badRequest().build();
}
byte[] report = hourlyMisService.renderXlsx(filter, Sessvals);
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=hourly-mis.xlsx")
.contentType(MediaType.parseMediaType(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))
.body(report);
}
@RequestMapping(value="dtmis/pdf",method=RequestMethod.POST )
@ResponseBody
public ResponseEntity<byte[]> DateRangeMISPdf(
@ModelAttribute(value="Sessvals") Session Sessvals,
@ModelAttribute(value="filter") Filters filter) {
if (filter.getQid() != HourlyMisService.QUERY_ID) return ResponseEntity.badRequest().build();
return download(hourlyMisService.renderPdf(filter, Sessvals), "hourly-mis.pdf",
MediaType.APPLICATION_PDF);
}
@RequestMapping(value="dtmis/csv",method=RequestMethod.POST )
@ResponseBody
public ResponseEntity<byte[]> DateRangeMISCsv(
@ModelAttribute(value="Sessvals") Session Sessvals,
@ModelAttribute(value="filter") Filters filter) {
if (filter.getQid() != HourlyMisService.QUERY_ID) return ResponseEntity.badRequest().build();
return download(hourlyMisService.renderCsv(filter, Sessvals), "hourly-mis.csv",
MediaType.parseMediaType("text/csv"));
}
private ResponseEntity<byte[]> download(byte[] content, String filename, MediaType mediaType) {
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + filename)
.contentType(mediaType)
.body(content);
}
@RequestMapping(value="dtusermis",method=RequestMethod.POST ) @RequestMapping(value="dtusermis",method=RequestMethod.POST )
public String DateRangeUserMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session) public String DateRangeUserMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{ {

View File

@@ -499,13 +499,13 @@ public class MISHandler {
CtrlMTimeRange+="<div class=\"widget\">"; CtrlMTimeRange+="<div class=\"widget\">";
CtrlMTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>"; CtrlMTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlMTimeRange+="<div class=\"inputcontainer\">"; CtrlMTimeRange+="<div class=\"inputcontainer\">";
CtrlMTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+frmdate+" 00:00:00\" />"; CtrlMTimeRange+=dateInput("Fromdate", frmdate + " 00:00:00", "datetime", "DateTime", 19);
CtrlMTimeRange+="</div>"; CtrlMTimeRange+="</div>";
CtrlMTimeRange+="</div>"; CtrlMTimeRange+="</div>";
CtrlMTimeRange+="<div class=\"widget\">"; CtrlMTimeRange+="<div class=\"widget\">";
CtrlMTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>"; CtrlMTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>";
CtrlMTimeRange+="<div class=\"inputcontainer\">"; CtrlMTimeRange+="<div class=\"inputcontainer\">";
CtrlMTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Todate\" name=\"Todate\" value=\""+todate+" 23:59:59\" />"; CtrlMTimeRange+=dateInput("Todate", todate + " 23:59:59", "datetime", "DateTime", 19);
CtrlMTimeRange+="</div>"; CtrlMTimeRange+="</div>";
CtrlMTimeRange+="</div>"; CtrlMTimeRange+="</div>";
return CtrlMTimeRange; return CtrlMTimeRange;
@@ -517,13 +517,13 @@ public class MISHandler {
CtrlDateTimeRange+="<div class=\"widget\">"; CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>"; CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">"; CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+(frmdate+" 00:00:00")+"\" />"; CtrlDateTimeRange+=dateInput("Fromdate", frmdate + " 00:00:00", "datetime", "DateTime", 19);
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="<div class=\"widget\">"; CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>"; CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">"; CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Todate\" name=\"Todate\" value=\""+(frmdate+" 23:59:59")+"\" />"; CtrlDateTimeRange+=dateInput("Todate", frmdate + " 23:59:59", "datetime", "DateTime", 19);
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
return CtrlDateTimeRange; return CtrlDateTimeRange;
@@ -535,17 +535,26 @@ public class MISHandler {
CtrlDateTimeRange+="<div class=\"widget\">"; CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>"; CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">"; CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','Date')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+(frmdate)+"\" />"; CtrlDateTimeRange+=dateInput("Fromdate", frmdate, "date", "Date", 10);
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="<div class=\"widget\">"; CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>"; CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">"; CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','Date')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Todate\" name=\"Todate\" value=\""+(frmdate)+"\" />"; CtrlDateTimeRange+=dateInput("Todate", frmdate, "date", "Date", 10);
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>"; CtrlDateTimeRange+="</div>";
return CtrlDateTimeRange; return CtrlDateTimeRange;
} }
private String dateInput(String id, String value, String mode, String validator, int maxlength)
{
return "<input type=\"text\" class=\"matrix-date-input\" data-date-mode=\"" + mode
+ "\" autocomplete=\"off\" inputmode=\"numeric\" placeholder=\""
+ ("datetime".equals(mode) ? "DD/MM/YYYY HH:MM:SS" : "DD/MM/YYYY")
+ "\" onblur=\"validate(this,'t','" + validator
+ "')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"" + maxlength
+ "\" id=\"" + id + "\" name=\"" + id + "\" value=\"" + value + "\" />";
}
private String FromDateToTimeControl() private String FromDateToTimeControl()
{ {
String frmdate=GlobalClass.DateTime("dd/MM/yyyy", new java.util.Date()); String frmdate=GlobalClass.DateTime("dd/MM/yyyy", new java.util.Date());

View File

@@ -12,18 +12,33 @@ public final class CloudQuerySource implements QuerySource {
@Override @Override
public String fetch(int queryId) { public String fetch(int queryId) {
return client.fetchQuery(queryId) try {
.map(response -> response.query()) return client.fetchQuery(queryId)
.blockOptional() .map(response -> response.query())
.filter(query -> !query.isBlank()) .blockOptional()
.orElseThrow(() -> new QueryProviderException( .filter(query -> !query.isBlank())
"Cloud query was empty: " + queryId)); .orElseThrow(() -> new QueryProviderException(
"Cloud query was empty: " + queryId));
} catch (QueryProviderException exception) {
throw exception;
} catch (RuntimeException exception) {
throw new QueryProviderException(
"Cloud query request failed for query " + queryId, exception);
}
} }
@Override @Override
public String fetch(String queryKey) { public String fetch(String queryKey) {
return client.fetchQuery(queryKey).map(response -> response.query()).blockOptional() try {
.filter(query -> !query.isBlank()) return client.fetchQuery(queryKey).map(response -> response.query()).blockOptional()
.orElseThrow(() -> new QueryProviderException("Cloud query was empty: " + queryKey)); .filter(query -> !query.isBlank())
.orElseThrow(() -> new QueryProviderException(
"Cloud query was empty: " + queryKey));
} catch (QueryProviderException exception) {
throw exception;
} catch (RuntimeException exception) {
throw new QueryProviderException(
"Cloud query request failed for query " + queryKey, exception);
}
} }
} }

View File

@@ -9,6 +9,7 @@ import lib.models.UserSession;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeoutException;
import java.util.Objects; import java.util.Objects;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@@ -151,6 +152,9 @@ public class CommonService {
} }
return cloudIdentityClient.fetchData(scope, data) return cloudIdentityClient.fetchData(scope, data)
.map(items -> items.stream().map(this::option).toList()) .map(items -> items.stream().map(this::option).toList())
.onErrorMap(TimeoutException.class, exception -> new IllegalStateException(
"Cloud platform-data request timed out for scope: " + scope,
exception))
.blockOptional() .blockOptional()
.orElseGet(List::of); .orElseGet(List::of);
} }

View File

@@ -11,6 +11,8 @@ import java.util.Map;
import lib.models.Allocation; import lib.models.Allocation;
import lib.models.CutOffList; import lib.models.CutOffList;
import lib.models.CutOffRecord; import lib.models.CutOffRecord;
import lib.models.CutoffPending;
import lib.models.CutoffPendingRecord;
import lib.models.PhotoCases; import lib.models.PhotoCases;
import lib.models.ReferenceSheet; import lib.models.ReferenceSheet;
import lib.models.SendToOperation; import lib.models.SendToOperation;
@@ -61,6 +63,60 @@ public class CutoffService {
return value; return value;
} }
public CutoffPending loadCutoffPending(UserSession session) {
requireScope(session);
List<RowView> detailRows = dbExecutor.query(50,
new Object[] {session.getCompanyId(), session.getBranchId()});
Map<String, List<CutoffPendingRecord>> grouped = new LinkedHashMap<>();
for (RowView row : detailRows) {
CutoffPendingRecord record = new CutoffPendingRecord();
record.setUuid(text(row.get("uuid")));
record.setPortfolio(text(row.get("portname")));
record.setCustomerName(text(row.get("customername")));
grouped.computeIfAbsent(text(row.get("cutoffon")), ignored -> new ArrayList<>()).add(record);
}
CutoffPending value = new CutoffPending();
value.setPendingList(dbExecutor.query(49,
new Object[] {session.getCompanyId(), session.getBranchId()}).stream().map(row -> {
CutoffPendingRecord record = new CutoffPendingRecord();
record.setCutoffTime(text(row.get("cutoffon")));
record.setTotal(number(row, "total"));
record.setSublist(grouped.getOrDefault(record.getCutoffTime(), List.of()));
return record;
}).toList());
return value;
}
public CutoffPending saveCutoffPending(UserSession session, CutoffPending request) {
requireScope(session);
int changed = 0;
for (CutoffPendingRecord parent : safe(request.getPendingList())) {
if (parent.isCutoff()) {
changed += updatePending(session, parent, null, 1);
continue;
}
for (CutoffPendingRecord child : safe(parent.getSublist())) {
changed += updatePending(session, child, child.getUuid(), 0);
}
}
CutoffPending refreshed = loadCutoffPending(session);
refreshed.setProcessFlag(changed > 0);
refreshed.setErrMsg(changed > 0
? "1010CPDONE:Info:Cut-off pending records updated successfully."
: "1010CPNONE:Error:Please select at least one pending action.");
return refreshed;
}
private int updatePending(UserSession session, CutoffPendingRecord record, String uuid, int mode) {
if (!record.isAllocation() && !record.isTelesheet() && !record.isEarlier()
&& !record.isNegative() && !record.isCutoff()) return 0;
return dbExecutor.update(51, new Object[] {
flag01(record.isAllocation()), flag01(record.isTelesheet()),
flag01(record.isEarlier()), flag01(record.isNegative()), flag01(record.isCutoff()),
mode, uuid, mode, record.getCutoffTime(), session.getCompanyId(), session.getBranchId()
});
}
public Allocation loadAllocation(UserSession session) { public Allocation loadAllocation(UserSession session) {
requireScope(session); requireScope(session);
dbExecutor.update(27, lockParameters(session)); dbExecutor.update(27, lockParameters(session));
@@ -250,7 +306,10 @@ public class CutoffService {
record.setPortname(text(row.get("portname"))); record.setPortname(text(row.get("portname")));
record.setAllocation(booleanValue(row, "allocation")); record.setAllocation(booleanValue(row, "allocation"));
record.setSms(booleanValue(row, "sms")); record.setSms(booleanValue(row, "sms"));
record.setTelesheet(booleanValue(row, "telesheet")); record.setTotrtv(number(row, "rtv"));
record.setTototv(number(row, "otv"));
record.setTelesheet((record.getTotrtv() > 0 || record.getTototv() > 0)
&& booleanValue(row, "telesheet"));
record.setEarlier(booleanValue(row, "earlier")); record.setEarlier(booleanValue(row, "earlier"));
record.setNegative(booleanValue(row, "negative")); record.setNegative(booleanValue(row, "negative"));
record.setIslocked(number(row, "islocked")); record.setIslocked(number(row, "islocked"));

View File

@@ -0,0 +1,405 @@
package matrix.services.mis;
import lib.models.HourlyMisRecord;
import lib.models.ReportColumnDefinition;
import lib.models.ReportDefinition;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.FontFactory;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRPrintElement;
import net.sf.jasperreports.engine.JRPrintPage;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.export.JRCsvExporter;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
import net.sf.jasperreports.export.SimpleExporterInput;
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;
import net.sf.jasperreports.export.SimpleWriterExporterOutput;
import net.sf.jasperreports.export.SimpleXlsxReportConfiguration;
import org.springframework.stereotype.Component;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@Component
public final class HourlyMisReportRenderer {
private static final int DATE_COLUMN_WIDTH = 105;
private static final int HOUR_COLUMN_WIDTH = 55;
private static final int REPORT_CONTENT_WIDTH = 1510;
private static final int FULL_CONTENT_WIDTH = 1690;
private final JasperReport report;
public HourlyMisReportRenderer() {
try (InputStream template = getClass().getResourceAsStream("/reports/hourly-mis.jrxml")) {
if (template == null) throw new IllegalStateException("Hourly MIS template is missing");
report = JasperCompileManager.compileReport(template);
} catch (Exception exception) {
throw new IllegalStateException("Unable to compile Hourly MIS template", exception);
}
}
public String html(List<HourlyMisRecord> rows, Map<String, Object> parameters,
ReportDefinition definition) {
int firstHour = definition.hideLeadingZeroColumns() ? firstActiveHour(rows) : 0;
Map<String, ReportColumnDefinition> columns = definition.columns().stream()
.filter(ReportColumnDefinition::visible)
.collect(java.util.stream.Collectors.toMap(
ReportColumnDefinition::columnKey, column -> column));
int visibleColumns = 1 + (columns.containsKey("total") ? 1 : 0);
for (int hour = firstHour; hour < 24; hour++) {
if (columns.containsKey("hour" + hour)) visibleColumns++;
}
StringBuilder html = new StringBuilder(4096);
html.append("<section class=\"hourly-mis\"><header class=\"hourly-mis__header\"><h1>")
.append(escape(parameters.get("COMPANY_NAME"))).append("</h1><h2>")
.append(escape(definition.title())).append("</h2><p>From: ")
.append(escape(parameters.get("FROM_DATE"))).append(" &nbsp; To: ")
.append(escape(parameters.get("TO_DATE"))).append("</p></header><div class=\"hourly-mis__branch\">Branch: ")
.append(escape(parameters.get("BRANCH_NAME"))).append("</div>")
.append("<table class=\"hourly-mis__table\"><thead><tr><th>")
.append(escape(label(columns, "date", "Date"))).append("</th>");
for (int hour = firstHour; hour < 24; hour++) {
if (columns.containsKey("hour" + hour)) html.append("<th>")
.append(escape(label(columns, "hour" + hour, String.valueOf(hour)))).append("</th>");
}
if (columns.containsKey("total")) html.append("<th>")
.append(escape(label(columns, "total", "Total"))).append("</th>");
html.append("</tr></thead><tbody>");
if (rows.isEmpty()) {
return html.append("<tr><td class=\"hourly-mis__empty\" colspan=\"")
.append(visibleColumns)
.append("\">No Records Found</td></tr></tbody></table></section>")
.toString();
}
String currentUser = null;
int[] totals = new int[24];
int grandTotal = 0;
for (HourlyMisRecord row : rows) {
if (!row.getDisplayName().equals(currentUser)) {
if (currentUser != null) {
appendTotalRow(html, totals, grandTotal, firstHour, columns);
totals = new int[24];
grandTotal = 0;
}
currentUser = row.getDisplayName();
html.append("<tr class=\"hourly-mis__operator\"><th colspan=\"")
.append(visibleColumns).append("\" title=\"")
.append(escape(currentUser)).append("\"><span>")
.append(escape(currentUser)).append("</span></th></tr>");
}
html.append("<tr><td>").append(row.getReceivedDate()).append("</td>");
for (int hour = firstHour; hour < 24; hour++) {
if (!columns.containsKey("hour" + hour)) continue;
int value = row.getHour(hour);
totals[hour] += value;
html.append("<td>").append(value).append("</td>");
}
grandTotal += row.getTotal();
if (columns.containsKey("total")) html.append("<td>").append(row.getTotal()).append("</td>");
html.append("</tr>");
}
appendTotalRow(html, totals, grandTotal, firstHour, columns);
return html.append("</tbody></table></section>").toString();
}
private String label(Map<String, ReportColumnDefinition> columns, String key, String fallback) {
ReportColumnDefinition column = columns.get(key);
return column == null || column.label() == null || column.label().isBlank()
? fallback : column.label();
}
private void appendTotalRow(StringBuilder html, int[] totals, int grandTotal, int firstHour,
Map<String, ReportColumnDefinition> columns) {
html.append("<tr class=\"hourly-mis__total\"><th>Total</th>");
for (int hour = firstHour; hour < 24; hour++) {
if (columns.containsKey("hour" + hour)) html.append("<td>").append(totals[hour]).append("</td>");
}
if (columns.containsKey("total")) html.append("<td>").append(grandTotal).append("</td>");
html.append("</tr>");
}
private String escape(Object value) {
return String.valueOf(value == null ? "" : value).replace("&", "&amp;")
.replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;")
.replace("'", "&#39;");
}
public byte[] xlsx(List<HourlyMisRecord> rows, Map<String, Object> parameters) {
int firstHour = firstActiveHour(rows);
int columnCount = 26 - firstHour;
try (Workbook workbook = new XSSFWorkbook();
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
var sheet = workbook.createSheet("hourly_mis");
CellStyle title = excelStyle(workbook, true, 14, null);
CellStyle subtitle = excelStyle(workbook, true, 11, null);
CellStyle text = excelStyle(workbook, false, 10, null);
CellStyle header = excelStyle(workbook, true, 10, "DCE7F1");
CellStyle group = excelStyle(workbook, true, 10, "E3E8ED");
CellStyle total = excelStyle(workbook, true, 10, "DDE8F1");
mergedCell(sheet, 0, 0, columnCount - 1, parameters.get("COMPANY_NAME"), title);
mergedCell(sheet, 1, 0, columnCount - 1, parameters.get("REPORT_TITLE"), subtitle);
mergedCell(sheet, 2, 0, columnCount - 1,
"From: " + parameters.get("FROM_DATE") + " To: " + parameters.get("TO_DATE"), text);
mergedCell(sheet, 4, 0, columnCount - 1, "Branch: " + parameters.get("BRANCH_NAME"), text);
Row headings = sheet.createRow(5);
excelCell(headings, 0, "Date", header);
int column = 1;
for (int hour = firstHour; hour < 24; hour++) excelCell(headings, column++, hour, header);
excelCell(headings, column, "Total", header);
writeExcelRows(sheet, rows, firstHour, group, text, total);
sheet.setColumnWidth(0, 16 * 256);
for (int index = 1; index < columnCount; index++) sheet.setColumnWidth(index, 9 * 256);
sheet.createFreezePane(1, 6);
workbook.write(output);
return output.toByteArray();
} catch (Exception exception) {
throw new IllegalStateException("Unable to export Hourly MIS", exception);
}
}
public byte[] pdf(List<HourlyMisRecord> rows, Map<String, Object> parameters) {
int firstHour = firstActiveHour(rows);
int columnCount = 26 - firstHour;
try (ByteArrayOutputStream output = new ByteArrayOutputStream()) {
Document document = new Document(PageSize.A3.rotate(), 28, 28, 24, 24);
PdfWriter.getInstance(document, output);
document.open();
document.add(centered(parameters.get("COMPANY_NAME"), 15, true));
document.add(centered(parameters.get("REPORT_TITLE"), 11, true));
document.add(centered("From: " + parameters.get("FROM_DATE") + " To: "
+ parameters.get("TO_DATE"), 9, false));
document.add(new Paragraph("Branch: " + parameters.get("BRANCH_NAME"), pdfFont(9, true)));
document.add(new Paragraph(" ", pdfFont(4, false)));
PdfPTable table = new PdfPTable(columnCount);
table.setWidthPercentage(100);
float[] widths = new float[columnCount];
widths[0] = 1.7f;
java.util.Arrays.fill(widths, 1, columnCount - 1, 1f);
widths[columnCount - 1] = 1.2f;
table.setWidths(widths);
pdfCell(table, "Date", true, "DCE7F1", 1);
for (int hour = firstHour; hour < 24; hour++) pdfCell(table, String.valueOf(hour), true, "DCE7F1", 1);
pdfCell(table, "Total", true, "DCE7F1", 1);
writePdfRows(table, rows, firstHour, columnCount);
document.add(table);
document.close();
return output.toByteArray();
} catch (Exception exception) {
throw new IllegalStateException("Unable to export Hourly MIS as PDF", exception);
}
}
private void writeExcelRows(org.apache.poi.ss.usermodel.Sheet sheet, List<HourlyMisRecord> records,
int firstHour, CellStyle groupStyle, CellStyle rowStyle, CellStyle totalStyle) {
int rowIndex = 6;
String user = null;
int[] totals = new int[24];
int grandTotal = 0;
for (HourlyMisRecord record : records) {
if (!record.getDisplayName().equals(user)) {
if (user != null) rowIndex = excelTotal(sheet, rowIndex, totals, grandTotal, firstHour, totalStyle);
user = record.getDisplayName();
totals = new int[24];
grandTotal = 0;
mergedCell(sheet, rowIndex++, 0, 25 - firstHour, user, groupStyle);
}
Row row = sheet.createRow(rowIndex++);
excelCell(row, 0, record.getReceivedDate().toString(), rowStyle);
int column = 1;
for (int hour = firstHour; hour < 24; hour++) {
int value = record.getHour(hour);
totals[hour] += value;
excelCell(row, column++, value, rowStyle);
}
grandTotal += record.getTotal();
excelCell(row, column, record.getTotal(), rowStyle);
}
if (user != null) excelTotal(sheet, rowIndex, totals, grandTotal, firstHour, totalStyle);
}
private int excelTotal(org.apache.poi.ss.usermodel.Sheet sheet, int rowIndex, int[] totals,
int grandTotal, int firstHour, CellStyle style) {
Row row = sheet.createRow(rowIndex++);
excelCell(row, 0, "Total", style);
int column = 1;
for (int hour = firstHour; hour < 24; hour++) excelCell(row, column++, totals[hour], style);
excelCell(row, column, grandTotal, style);
return rowIndex;
}
private CellStyle excelStyle(Workbook workbook, boolean bold, int fontSize, String color) {
CellStyle style = workbook.createCellStyle();
var font = workbook.createFont();
font.setBold(bold);
font.setFontHeightInPoints((short) fontSize);
style.setFont(font);
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setBorderTop(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
if (color != null) {
style.setFillForegroundColor(org.apache.poi.ss.usermodel.IndexedColors.valueOf(
color.equals("DCE7F1") ? "LIGHT_CORNFLOWER_BLUE" : "PALE_BLUE").getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
}
return style;
}
private void mergedCell(org.apache.poi.ss.usermodel.Sheet sheet, int rowIndex, int firstColumn,
int lastColumn, Object value, CellStyle style) {
Row row = sheet.createRow(rowIndex);
excelCell(row, firstColumn, value, style);
if (lastColumn > firstColumn) sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, firstColumn, lastColumn));
}
private void excelCell(Row row, int column, Object value, CellStyle style) {
Cell cell = row.createCell(column);
if (value instanceof Number number) cell.setCellValue(number.doubleValue());
else cell.setCellValue(String.valueOf(value == null ? "" : value));
cell.setCellStyle(style);
}
private void writePdfRows(PdfPTable table, List<HourlyMisRecord> records, int firstHour,
int columnCount) {
String user = null;
int[] totals = new int[24];
int grandTotal = 0;
for (HourlyMisRecord record : records) {
if (!record.getDisplayName().equals(user)) {
if (user != null) pdfTotal(table, totals, grandTotal, firstHour);
user = record.getDisplayName();
totals = new int[24];
grandTotal = 0;
pdfCell(table, user, true, "E3E8ED", columnCount);
}
pdfCell(table, record.getReceivedDate().toString(), false, null, 1);
for (int hour = firstHour; hour < 24; hour++) {
int value = record.getHour(hour);
totals[hour] += value;
pdfCell(table, String.valueOf(value), false, null, 1);
}
grandTotal += record.getTotal();
pdfCell(table, String.valueOf(record.getTotal()), false, null, 1);
}
if (user != null) pdfTotal(table, totals, grandTotal, firstHour);
}
private void pdfTotal(PdfPTable table, int[] totals, int grandTotal, int firstHour) {
pdfCell(table, "Total", true, "DDE8F1", 1);
for (int hour = firstHour; hour < 24; hour++) pdfCell(table, String.valueOf(totals[hour]), true, "DDE8F1", 1);
pdfCell(table, String.valueOf(grandTotal), true, "DDE8F1", 1);
}
private void pdfCell(PdfPTable table, String value, boolean bold, String background, int colspan) {
PdfPCell cell = new PdfPCell(new Phrase(value == null ? "" : value, pdfFont(8, bold)));
cell.setColspan(colspan);
cell.setHorizontalAlignment(colspan > 1 ? Element.ALIGN_LEFT : Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setPadding(5);
cell.setBorderColor(new BaseColor(159, 178, 195));
if (background != null) cell.setBackgroundColor(new BaseColor(
Integer.parseInt(background.substring(0, 2), 16),
Integer.parseInt(background.substring(2, 4), 16),
Integer.parseInt(background.substring(4, 6), 16)));
table.addCell(cell);
}
private Paragraph centered(Object value, int size, boolean bold) {
Paragraph paragraph = new Paragraph(String.valueOf(value == null ? "" : value), pdfFont(size, bold));
paragraph.setAlignment(Element.ALIGN_CENTER);
paragraph.setSpacingAfter(3);
return paragraph;
}
private Font pdfFont(int size, boolean bold) {
return FontFactory.getFont(FontFactory.HELVETICA, size,
bold ? Font.BOLD : Font.NORMAL, BaseColor.BLACK);
}
public byte[] csv(List<HourlyMisRecord> rows, Map<String, Object> parameters) {
try (ByteArrayOutputStream output = new ByteArrayOutputStream()) {
JRCsvExporter exporter = new JRCsvExporter();
exporter.setExporterInput(new SimpleExporterInput(fill(rows, parameters)));
exporter.setExporterOutput(new SimpleWriterExporterOutput(output));
exporter.exportReport();
return output.toByteArray();
} catch (Exception exception) {
throw new IllegalStateException("Unable to export Hourly MIS as CSV", exception);
}
}
private JasperPrint fill(List<HourlyMisRecord> rows, Map<String, Object> parameters)
throws JRException {
JasperPrint print = JasperFillManager.fillReport(report, new HashMap<>(parameters),
new JRBeanCollectionDataSource(rows, false));
compactLeadingEmptyHours(print, firstActiveHour(rows));
return print;
}
private int firstActiveHour(List<HourlyMisRecord> rows) {
if (rows.isEmpty()) return 0;
HourlyMisRecord first = rows.getFirst();
for (int hour = 0; hour < 24; hour++) {
if (first.getHour(hour) != 0) return hour;
}
return 0;
}
private void compactLeadingEmptyHours(JasperPrint print, int firstHour) {
int hiddenWidth = firstHour * HOUR_COLUMN_WIDTH;
int hiddenEnd = DATE_COLUMN_WIDTH + hiddenWidth;
int visibleTableWidth = REPORT_CONTENT_WIDTH - hiddenWidth;
double widthScale = (double) FULL_CONTENT_WIDTH / visibleTableWidth;
for (JRPrintPage page : print.getPages()) {
Iterator<JRPrintElement> elements = page.getElements().iterator();
while (elements.hasNext()) {
JRPrintElement element = elements.next();
if (element.getX() >= DATE_COLUMN_WIDTH && element.getX() < hiddenEnd) {
elements.remove();
} else if (element.getWidth() <= DATE_COLUMN_WIDTH
&& element.getX() < REPORT_CONTENT_WIDTH) {
int compactedX = element.getX() >= hiddenEnd
? element.getX() - hiddenWidth : element.getX();
element.setX((int) Math.round(compactedX * widthScale));
element.setWidth((int) Math.round(element.getWidth() * widthScale));
}
}
}
}
}

View File

@@ -0,0 +1,93 @@
package matrix.services.mis;
import com.cygnus.db.CygnusDbExecutor;
import com.cygnus.db.RowView;
import lib.models.HourlyMisRecord;
import matrix.nimble.mis.model.Filters;
import matrix.nimble.model.Session;
import org.springframework.stereotype.Service;
import java.sql.Date;
import java.time.LocalDate;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@Service
public class HourlyMisService {
public static final int QUERY_ID = 136;
private static final Set<String> SOURCES = Set.of("edp", "dedupe", "opr", "port", "bopr");
private final CygnusDbExecutor dbExecutor;
private final HourlyMisReportRenderer renderer;
private final ReportDefinitionService definitions;
public HourlyMisService(CygnusDbExecutor dbExecutor, HourlyMisReportRenderer renderer,
ReportDefinitionService definitions) {
this.dbExecutor = dbExecutor;
this.renderer = renderer;
this.definitions = definitions;
}
public String renderHtml(Filters filter, Session session) {
return renderer.html(records(filter, session), parameters(filter, session),
definitions.hourlyMis(filter.getTitle()));
}
public byte[] renderXlsx(Filters filter, Session session) {
return renderer.xlsx(records(filter, session), parameters(filter, session));
}
public byte[] renderPdf(Filters filter, Session session) {
return renderer.pdf(records(filter, session), parameters(filter, session));
}
public byte[] renderCsv(Filters filter, Session session) {
return renderer.csv(records(filter, session), parameters(filter, session));
}
private List<HourlyMisRecord> records(Filters filter, Session session) {
String source = source(filter.getMtype());
List<RowView> rows = dbExecutor.query(QUERY_ID, new Object[] {
source, filter.getFromdate(), filter.getTodate(), session.getCompanyID(),
session.getBranchID()
});
Map<String, HourlyMisRecord> records = new LinkedHashMap<>();
for (RowView row : rows) {
long userId = ((Number) row.get("user_id")).longValue();
LocalDate date = date(row.get("received_date"));
String name = String.valueOf(row.get("display_name"));
String key = userId + "|" + date;
HourlyMisRecord record = records.computeIfAbsent(key,
ignored -> new HourlyMisRecord(userId, name, date));
record.addCases(((Number) row.get("time_period")).intValue(),
((Number) row.get("case_count")).intValue());
}
return List.copyOf(records.values());
}
private Map<String, Object> parameters(Filters filter, Session session) {
return Map.of(
"REPORT_TITLE", filter.getTitle(),
"COMPANY_NAME", session.getCompanyName().toUpperCase(Locale.ROOT),
"BRANCH_NAME", session.getBranchName(),
"FROM_DATE", filter.getFromdate(),
"TO_DATE", filter.getTodate());
}
private String source(String value) {
String source = value == null ? "" : value.toLowerCase(Locale.ROOT);
if (!SOURCES.contains(source)) {
throw new IllegalArgumentException("Unsupported hourly MIS source");
}
return source;
}
private LocalDate date(Object value) {
if (value instanceof LocalDate localDate) return localDate;
if (value instanceof Date date) return date.toLocalDate();
return LocalDate.parse(String.valueOf(value));
}
}

View File

@@ -0,0 +1,62 @@
package matrix.services.mis;
import com.cygnus.client.CloudIdentityClient;
import com.cygnus.client.model.CloudDataItem;
import lib.models.ReportColumnDefinition;
import lib.models.ReportDefinition;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException;
@Service
public class ReportDefinitionService {
private static final String DEFINITION_SCOPE = "report-definition";
private final CloudIdentityClient cloudIdentityClient;
public ReportDefinitionService(CloudIdentityClient cloudIdentityClient) {
this.cloudIdentityClient = cloudIdentityClient;
}
public ReportDefinition hourlyMis(String fallbackTitle) {
try {
List<CloudDataItem> rows = cloudIdentityClient
.fetchData(DEFINITION_SCOPE, Map.of("reportKey", "hourly-mis"))
.onErrorMap(TimeoutException.class,
exception -> new IllegalStateException("Cloud report definition request timed out", exception))
.blockOptional().orElseGet(List::of);
if (rows.isEmpty()) return defaults(fallbackTitle);
Map<String, Object> first = rows.getFirst().data();
List<ReportColumnDefinition> columns = new ArrayList<>(rows.size());
for (CloudDataItem item : rows) {
Map<String, Object> row = item.data();
columns.add(new ReportColumnDefinition(
text(row, "columnKey"), text(row, "columnLabel"),
number(row, "displayOrder"), text(row, "alignment"),
number(row, "columnWidth"), bool(row, "visible"),
bool(row, "totalled")));
}
return new ReportDefinition("hourly-mis", text(first, "reportTitle"),
bool(first, "hideLeadingZeroColumns"), List.copyOf(columns));
} catch (RuntimeException unavailable) {
return defaults(fallbackTitle);
}
}
private ReportDefinition defaults(String title) {
List<ReportColumnDefinition> columns = new ArrayList<>(26);
columns.add(new ReportColumnDefinition("date", "Date", 0, "left", 110, true, false));
for (int hour = 0; hour < 24; hour++) {
columns.add(new ReportColumnDefinition("hour" + hour, String.valueOf(hour),
hour + 1, "center", 55, true, true));
}
columns.add(new ReportColumnDefinition("total", "Total", 25, "center", 70, true, true));
return new ReportDefinition("hourly-mis", title, true, List.copyOf(columns));
}
private String text(Map<String, Object> row, String column) { return String.valueOf(row.get(column)); }
private int number(Map<String, Object> row, String column) { return ((Number) row.get(column)).intValue(); }
private boolean bool(Map<String, Object> row, String column) { return Boolean.TRUE.equals(row.get(column)); }
}

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="hourly_mis" pageWidth="1800" pageHeight="1200" orientation="Landscape" columnWidth="1690" leftMargin="55" rightMargin="55" topMargin="30" bottomMargin="30" whenNoDataType="NoDataSection">
<property name="net.sf.jasperreports.export.xlsx.freeze.row" value="5"/>
<parameter name="REPORT_TITLE" class="java.lang.String"/>
<parameter name="COMPANY_NAME" class="java.lang.String"/>
<parameter name="BRANCH_NAME" class="java.lang.String"/>
<parameter name="FROM_DATE" class="java.lang.String"/>
<parameter name="TO_DATE" class="java.lang.String"/>
<field name="displayName" class="java.lang.String"/>
<field name="receivedDate" class="java.time.LocalDate"/>
<field name="hour00" class="java.lang.Integer"/>
<field name="hour01" class="java.lang.Integer"/>
<field name="hour02" class="java.lang.Integer"/>
<field name="hour03" class="java.lang.Integer"/>
<field name="hour04" class="java.lang.Integer"/>
<field name="hour05" class="java.lang.Integer"/>
<field name="hour06" class="java.lang.Integer"/>
<field name="hour07" class="java.lang.Integer"/>
<field name="hour08" class="java.lang.Integer"/>
<field name="hour09" class="java.lang.Integer"/>
<field name="hour10" class="java.lang.Integer"/>
<field name="hour11" class="java.lang.Integer"/>
<field name="hour12" class="java.lang.Integer"/>
<field name="hour13" class="java.lang.Integer"/>
<field name="hour14" class="java.lang.Integer"/>
<field name="hour15" class="java.lang.Integer"/>
<field name="hour16" class="java.lang.Integer"/>
<field name="hour17" class="java.lang.Integer"/>
<field name="hour18" class="java.lang.Integer"/>
<field name="hour19" class="java.lang.Integer"/>
<field name="hour20" class="java.lang.Integer"/>
<field name="hour21" class="java.lang.Integer"/>
<field name="hour22" class="java.lang.Integer"/>
<field name="hour23" class="java.lang.Integer"/>
<field name="total" class="java.lang.Integer"/>
<variable name="sum_hour00" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour00}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour01" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour01}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour02" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour02}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour03" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour03}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour04" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour04}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour05" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour05}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour06" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour06}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour07" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour07}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour08" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour08}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour09" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour09}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour10" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour10}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour11" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour11}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour12" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour12}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour13" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour13}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour14" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour14}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour15" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour15}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour16" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour16}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour17" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour17}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour18" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour18}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour19" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour19}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour20" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour20}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour21" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour21}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour22" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour22}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_hour23" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{hour23}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<variable name="sum_total" class="java.lang.Integer" resetType="Group" resetGroup="operatorGroup" calculation="Sum"><variableExpression><![CDATA[$F{total}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable>
<group name="operatorGroup">
<groupExpression><![CDATA[$F{displayName}]]></groupExpression>
<groupHeader><band height="25"><textField><reportElement x="0" y="2" width="1690" height="22" backcolor="#E3E8ED" mode="Opaque"/><textElement verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$F{displayName}]]></textFieldExpression></textField></band></groupHeader>
<groupFooter><band height="24"><staticText><reportElement x="0" y="0" width="105" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[Total]]></text></staticText>
<textField><reportElement x="105" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour00}]]></textFieldExpression></textField>
<textField><reportElement x="160" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour01}]]></textFieldExpression></textField>
<textField><reportElement x="215" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour02}]]></textFieldExpression></textField>
<textField><reportElement x="270" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour03}]]></textFieldExpression></textField>
<textField><reportElement x="325" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour04}]]></textFieldExpression></textField>
<textField><reportElement x="380" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour05}]]></textFieldExpression></textField>
<textField><reportElement x="435" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour06}]]></textFieldExpression></textField>
<textField><reportElement x="490" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour07}]]></textFieldExpression></textField>
<textField><reportElement x="545" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour08}]]></textFieldExpression></textField>
<textField><reportElement x="600" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour09}]]></textFieldExpression></textField>
<textField><reportElement x="655" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour10}]]></textFieldExpression></textField>
<textField><reportElement x="710" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour11}]]></textFieldExpression></textField>
<textField><reportElement x="765" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour12}]]></textFieldExpression></textField>
<textField><reportElement x="820" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour13}]]></textFieldExpression></textField>
<textField><reportElement x="875" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour14}]]></textFieldExpression></textField>
<textField><reportElement x="930" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour15}]]></textFieldExpression></textField>
<textField><reportElement x="985" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour16}]]></textFieldExpression></textField>
<textField><reportElement x="1040" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour17}]]></textFieldExpression></textField>
<textField><reportElement x="1095" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour18}]]></textFieldExpression></textField>
<textField><reportElement x="1150" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour19}]]></textFieldExpression></textField>
<textField><reportElement x="1205" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour20}]]></textFieldExpression></textField>
<textField><reportElement x="1260" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour21}]]></textFieldExpression></textField>
<textField><reportElement x="1315" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour22}]]></textFieldExpression></textField>
<textField><reportElement x="1370" y="0" width="55" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_hour23}]]></textFieldExpression></textField>
<textField><reportElement x="1425" y="0" width="85" height="22" backcolor="#DDE8F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{sum_total}]]></textFieldExpression></textField></band></groupFooter>
</group>
<title><band height="82">
<textField><reportElement x="0" y="0" width="1690" height="24"/><textElement textAlignment="Center"><font size="16" isBold="true"/></textElement><textFieldExpression><![CDATA[$P{COMPANY_NAME}]]></textFieldExpression></textField>
<textField><reportElement x="0" y="25" width="1690" height="20"/><textElement textAlignment="Center"><font size="12" isBold="true"/></textElement><textFieldExpression><![CDATA[$P{REPORT_TITLE}]]></textFieldExpression></textField>
<textField><reportElement x="0" y="46" width="1690" height="18"/><textElement textAlignment="Center"><font size="11"/></textElement><textFieldExpression><![CDATA["From: " + $P{FROM_DATE} + " To: " + $P{TO_DATE}]]></textFieldExpression></textField>
<textField><reportElement x="0" y="64" width="1690" height="18"/><textElement><font size="11" isBold="true"/></textElement><textFieldExpression><![CDATA["Branch: " + $P{BRANCH_NAME}]]></textFieldExpression></textField>
</band></title>
<columnHeader><band height="24"><staticText><reportElement x="0" y="0" width="105" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[Date]]></text></staticText>
<staticText><reportElement x="105" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[0]]></text></staticText>
<staticText><reportElement x="160" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[1]]></text></staticText>
<staticText><reportElement x="215" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[2]]></text></staticText>
<staticText><reportElement x="270" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[3]]></text></staticText>
<staticText><reportElement x="325" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[4]]></text></staticText>
<staticText><reportElement x="380" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[5]]></text></staticText>
<staticText><reportElement x="435" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[6]]></text></staticText>
<staticText><reportElement x="490" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[7]]></text></staticText>
<staticText><reportElement x="545" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[8]]></text></staticText>
<staticText><reportElement x="600" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[9]]></text></staticText>
<staticText><reportElement x="655" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[10]]></text></staticText>
<staticText><reportElement x="710" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[11]]></text></staticText>
<staticText><reportElement x="765" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[12]]></text></staticText>
<staticText><reportElement x="820" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[13]]></text></staticText>
<staticText><reportElement x="875" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[14]]></text></staticText>
<staticText><reportElement x="930" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[15]]></text></staticText>
<staticText><reportElement x="985" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[16]]></text></staticText>
<staticText><reportElement x="1040" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[17]]></text></staticText>
<staticText><reportElement x="1095" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[18]]></text></staticText>
<staticText><reportElement x="1150" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[19]]></text></staticText>
<staticText><reportElement x="1205" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[20]]></text></staticText>
<staticText><reportElement x="1260" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[21]]></text></staticText>
<staticText><reportElement x="1315" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[22]]></text></staticText>
<staticText><reportElement x="1370" y="0" width="55" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[23]]></text></staticText>
<staticText><reportElement x="1425" y="0" width="85" height="24" backcolor="#DCE7F1" mode="Opaque"/><box><pen lineWidth="0.5" lineColor="#9FB2C3"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10" isBold="true"/></textElement><text><![CDATA[Total]]></text></staticText></band></columnHeader>
<detail><band height="22"><textField><reportElement x="0" y="0" width="105" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Left" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{receivedDate}]]></textFieldExpression></textField>
<textField><reportElement x="105" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour00}]]></textFieldExpression></textField>
<textField><reportElement x="160" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour01}]]></textFieldExpression></textField>
<textField><reportElement x="215" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour02}]]></textFieldExpression></textField>
<textField><reportElement x="270" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour03}]]></textFieldExpression></textField>
<textField><reportElement x="325" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour04}]]></textFieldExpression></textField>
<textField><reportElement x="380" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour05}]]></textFieldExpression></textField>
<textField><reportElement x="435" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour06}]]></textFieldExpression></textField>
<textField><reportElement x="490" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour07}]]></textFieldExpression></textField>
<textField><reportElement x="545" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour08}]]></textFieldExpression></textField>
<textField><reportElement x="600" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour09}]]></textFieldExpression></textField>
<textField><reportElement x="655" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour10}]]></textFieldExpression></textField>
<textField><reportElement x="710" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour11}]]></textFieldExpression></textField>
<textField><reportElement x="765" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour12}]]></textFieldExpression></textField>
<textField><reportElement x="820" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour13}]]></textFieldExpression></textField>
<textField><reportElement x="875" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour14}]]></textFieldExpression></textField>
<textField><reportElement x="930" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour15}]]></textFieldExpression></textField>
<textField><reportElement x="985" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour16}]]></textFieldExpression></textField>
<textField><reportElement x="1040" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour17}]]></textFieldExpression></textField>
<textField><reportElement x="1095" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour18}]]></textFieldExpression></textField>
<textField><reportElement x="1150" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour19}]]></textFieldExpression></textField>
<textField><reportElement x="1205" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour20}]]></textFieldExpression></textField>
<textField><reportElement x="1260" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour21}]]></textFieldExpression></textField>
<textField><reportElement x="1315" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour22}]]></textFieldExpression></textField>
<textField><reportElement x="1370" y="0" width="55" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{hour23}]]></textFieldExpression></textField>
<textField><reportElement x="1425" y="0" width="85" height="22"/><box><pen lineWidth="0.35" lineColor="#B9C8D5"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font size="10"/></textElement><textFieldExpression><![CDATA[$F{total}]]></textFieldExpression></textField></band></detail>
<noData><band height="80"><staticText><reportElement x="0" y="25" width="1690" height="30"/><textElement textAlignment="Center"><font size="13" isBold="true" isItalic="true"/></textElement><text><![CDATA[No Records Found]]></text></staticText></band></noData>
</jasperReport>

View File

@@ -367,7 +367,7 @@ class RoleVisibleBatchMigrationTest {
@Test @Test
void edpCutoffAndProductToolsUseResponsiveWorkspaceWithActionsPreserved() throws Exception { void edpCutoffAndProductToolsUseResponsiveWorkspaceWithActionsPreserved() throws Exception {
Path edpTools = Path.of("build/WebContent/WEB-INF/app/edp/tools"); Path edpTools = Path.of("build/WebContent/WEB-INF/app/edp/tools");
for (String page : List.of("delcutoffcases.jsp", "edpprocesspanel.jsp", "addproduct.jsp")) { for (String page : List.of("delcutoffcases.jsp", "addproduct.jsp")) {
String content = Files.readString(edpTools.resolve(page)); String content = Files.readString(edpTools.resolve(page));
assertTrue(content.contains("matrix-shell matrix-tool-workspace"), page); assertTrue(content.contains("matrix-shell matrix-tool-workspace"), page);
assertTrue(content.contains("tool-workspace-v3.css"), page); assertTrue(content.contains("tool-workspace-v3.css"), page);
@@ -381,10 +381,12 @@ class RoleVisibleBatchMigrationTest {
assertTrue(deleteCutoff.contains("setHFList('casetable')")); assertTrue(deleteCutoff.contains("setHFList('casetable')"));
assertTrue(deleteCutoff.contains("SubmitForm('deletecases','_parent','caseGrid')")); assertTrue(deleteCutoff.contains("SubmitForm('deletecases','_parent','caseGrid')"));
String process = Files.readString(edpTools.resolve("edpprocesspanel.jsp")); String process = Files.readString(Path.of(
assertTrue(process.contains("ExpandList(this.id)")); "build/WebContent/WEB-INF/app/edp/cutoff/cutoffpending.jsp"));
assertTrue(process.contains("checkUncheckList(")); assertTrue(process.contains("matrix-cutoff-pending"));
assertTrue(process.contains("SubmitForm('savecutoffpending','_parent','cutoffpending')")); assertTrue(process.contains("matrix-nested-table"));
assertTrue(process.contains("data-action=\"save\""));
assertTrue(process.contains("js/edp/cutoff/cutoff-pending.js"));
String products = Files.readString(edpTools.resolve("addproduct.jsp")); String products = Files.readString(edpTools.resolve("addproduct.jsp"));
assertTrue(products.contains("queueAction(this,${status.count},'remove')")); assertTrue(products.contains("queueAction(this,${status.count},'remove')"));

View File

@@ -9,6 +9,9 @@ public interface CygnusDbExecutor {
<T> List<T> query(int queryId, Object[] parameters, Class<T> responseType); <T> List<T> query(int queryId, Object[] parameters, Class<T> responseType);
<T> List<T> query(int queryId, Object[] parameters, RowMapper<T> mapper); <T> List<T> query(int queryId, Object[] parameters, RowMapper<T> mapper);
List<RowView> query(int queryId, Object[] parameters); List<RowView> query(int queryId, Object[] parameters);
default List<RowView> query(String queryKey, Object[] parameters) {
throw new UnsupportedOperationException("Query keys are not supported by this executor");
}
<T> Optional<T> queryOne(int queryId, Object[] parameters, Class<T> responseType); <T> Optional<T> queryOne(int queryId, Object[] parameters, Class<T> responseType);
int insert(int queryId, Object[] parameters); int insert(int queryId, Object[] parameters);
<K> K insert(int queryId, Object[] parameters, Class<K> generatedKeyType); <K> K insert(int queryId, Object[] parameters, Class<K> generatedKeyType);

View File

@@ -63,6 +63,15 @@ public final class JdbcCygnusDbExecutor implements CygnusDbExecutor {
return query(queryId, parameters, RowView.class); return query(queryId, parameters, RowView.class);
} }
@Override
public List<RowView> query(String queryKey, Object[] parameters) {
QueryDefinition definition = queryProvider.get(queryKey);
if (definition.type() != QueryType.SELECT) throw new QueryDefinitionException(
"Query " + queryKey + " is " + definition.type() + ", not " + QueryType.SELECT);
return withReadConnection(definition.queryId(), connection -> query(
connection, definition, parameters, RowView.class));
}
@Override @Override
public <T> Optional<T> queryOne(int queryId, Object[] parameters, Class<T> responseType) { public <T> Optional<T> queryOne(int queryId, Object[] parameters, Class<T> responseType) {
List<T> rows = query(queryId, parameters, responseType); List<T> rows = query(queryId, parameters, responseType);

View File

@@ -23,10 +23,10 @@ UPDATE platform.application_query SET query_text=
'update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=? FROM main m WHERE m.case_id=mo.case_id AND m.isdeleted=0 AND mo.sdone=0 AND mo.cutoffby>0 AND (mo.islocked=0 OR mo.islocked=?) AND coalesce(mo.telesheetby,0)=0 AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1', ismigrated=true WHERE query_id=31; 'update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=? FROM main m WHERE m.case_id=mo.case_id AND m.isdeleted=0 AND mo.sdone=0 AND mo.cutoffby>0 AND (mo.islocked=0 OR mo.islocked=?) AND coalesce(mo.telesheetby,0)=0 AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1', ismigrated=true WHERE query_id=31;
UPDATE platform.application_query SET query_text= UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,p.portname||'' <b>(''||count(*)||'')</b>'' portname,sum(m.rtv) rtv,sum(m.otv) otv,sum(m.refv) refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,mo.telesheet,coalesce(mo.lockedbyuser,'''') lockedby,pf.tsformat outputformat,pf.tsfunction outputfunction FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id JOIN process_formats pf ON pf.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0 AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1 AND (m.rtv>0 OR m.otv>0) GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.telesheet,mo.lockedbyuser,pf.tsformat,pf.tsfunction ORDER BY p.portname', ismigrated=true WHERE query_id=32; 'select!C0L!SELECT m.portfolio_id,p.portname||'' <b>(''||count(*)||'')</b>'' portname,sum(m.rtv) rtv,sum(m.otv) otv,sum(m.refv) refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,mo.telesheet,coalesce(mo.lockedbyuser,'''') lockedby,ts.docformat outputformat,ts.docfunction outputfunction FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id LEFT JOIN bankreport_mapping pf ON pf.portfolio_id=m.portfolio_id LEFT JOIN bankreport ts ON ts.format_id=pf.telesheet WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0 AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1 GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.telesheet,mo.lockedbyuser,ts.docformat,ts.docfunction ORDER BY p.portname', ismigrated=true WHERE query_id=32;
UPDATE platform.application_query SET query_text= UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.rtv,m.otv,m.refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,mo.telesheet,m.uuid FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1 AND (m.rtv=1 OR m.otv=1) ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=33; 'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.rtv,m.otv,m.refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,mo.telesheet,m.uuid FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1 ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=33;
UPDATE platform.application_query SET query_text='update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=CASE WHEN ?>0 THEN ? ELSE NULL END,telesheeton=CASE WHEN ?>0 THEN ?::timestamp ELSE NULL END,telesheetby=? FROM main m WHERE m.case_id=mo.case_id AND m.uuid::text=? AND m.company_id=? AND m.branch_id=?', ismigrated=true WHERE query_id=34; UPDATE platform.application_query SET query_text='update!C0L!UPDATE main_operations mo SET islocked=?, lockedbyuser=CASE WHEN ?>0 THEN ? ELSE NULL END,telesheeton=CASE WHEN ?>0 THEN ?::timestamp ELSE NULL END,telesheetby=? FROM main m WHERE m.case_id=mo.case_id AND m.uuid::text=? AND m.company_id=? AND m.branch_id=?', ismigrated=true WHERE query_id=34;
@@ -39,7 +39,7 @@ UPDATE platform.application_query SET query_text=
UPDATE platform.application_query SET query_text= UPDATE platform.application_query SET query_text=
'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.rv,m.ov,m.pv,m.rtv,m.otv,m.refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,1 oprsend,m.uuid FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.oprsendby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.oprsend<>1 AND ((mo.allocation=1 AND mo.allocatedby>0) OR mo.allocation<>1 OR (m.rv=0 AND m.ov=0 AND m.pv=0 AND mo.allocation=1)) AND ((mo.telesheet=1 AND mo.telesheetby>0) OR mo.telesheet<>1) AND (m.rv=1 OR m.ov=1 OR m.pv=1 OR m.rtv=1 OR m.otv=1) ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=46; 'select!C0L!SELECT m.portfolio_id,m.mvcode,m.applno,m.customername,m.apptype,m.rv,m.ov,m.pv,m.rtv,m.otv,m.refv,CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked,coalesce(mo.lockedbyuser,'''') lockedby,1 oprsend,m.uuid FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.oprsendby,0)=0 AND mo.cutoffby>0 AND mo.islocked=? AND m.company_id=? AND m.branch_id=? AND mo.oprsend<>1 AND ((mo.allocation=1 AND mo.allocatedby>0) OR mo.allocation<>1 OR (m.rv=0 AND m.ov=0 AND m.pv=0 AND mo.allocation=1)) AND ((mo.telesheet=1 AND mo.telesheetby>0) OR mo.telesheet<>1) AND (m.rv=1 OR m.ov=1 OR m.pv=1 OR m.rtv=1 OR m.otv=1) ORDER BY m.portfolio_id,m.applno,m.apptype', ismigrated=true WHERE query_id=46;
UPDATE platform.application_query SET query_text='procedure!C0L!SELECT CASE WHEN EXISTS (SELECT 1 FROM main m WHERE m.uuid::text=x.uniqueid::text AND m.company_id=x.companyid AND m.branch_id=x.branchid AND m.portfolio_id=x.portfolioid AND m.isdeleted=0) THEN sendtooperation(x.uniqueid,x.selected,x.processedon,x.userid,x.companyid,x.branchid,x.portfolioid) ELSE ''error:Access denied'' END FROM (SELECT ?::bpchar uniqueid,?::integer selected,?::bpchar processedon,?::integer userid,?::integer companyid,?::integer branchid,?::integer portfolioid) x', ismigrated=true WHERE query_id=47; UPDATE platform.application_query SET query_text='procedure!C0L!SELECT CASE WHEN NOT EXISTS (SELECT 1 FROM main m WHERE m.uuid::text=x.uniqueid::text AND m.company_id=x.companyid AND m.branch_id=x.branchid AND m.portfolio_id=x.portfolioid AND m.isdeleted=0) THEN ''error:Access denied'' WHEN EXISTS (SELECT 1 FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.uuid::text=x.uniqueid::text AND m.company_id=x.companyid AND m.branch_id=x.branchid AND m.portfolio_id=x.portfolioid AND (mo.oprsend=1 OR coalesce(mo.oprsendby,0)>0)) THEN ''success:Already sent'' ELSE coalesce(sendtooperation(x.uniqueid,x.selected,x.processedon,x.userid,x.companyid,x.branchid,x.portfolioid),''success:Sent to operations'') END FROM (SELECT ?::bpchar uniqueid,?::integer selected,?::bpchar processedon,?::integer userid,?::integer companyid,?::integer branchid,?::integer portfolioid) x', ismigrated=true WHERE query_id=47;
UPDATE platform.application_query SET query_text='insert!C0L!INSERT INTO app_documents (processtime,process,documenturl,branch_id) VALUES (?::timestamp,?,?,?)', ismigrated=true WHERE query_id=103; UPDATE platform.application_query SET query_text='insert!C0L!INSERT INTO app_documents (processtime,process,documenturl,branch_id) VALUES (?::timestamp,?,?,?)', ismigrated=true WHERE query_id=103;

View File

@@ -0,0 +1,6 @@
-- Structured Hourly MIS dataset used by JasperReports. The legacy hourlymis()
-- function is retained temporarily for rollback, but query 136 no longer calls it.
UPDATE platform.application_query
SET query_text = 'select!C0L!WITH args AS (SELECT ?::text AS source, ?::timestamp AS from_date, ?::timestamp AS to_date, ?::integer AS company_id, ?::integer AS branch_id), hourly_data AS (SELECT m.addedby::bigint AS user_id, COALESCE(NULLIF(m.addedbyuser, ''''), u.displayname) AS display_name, m.receivedate::date AS received_date, EXTRACT(HOUR FROM m.addedon)::integer AS time_period FROM main m CROSS JOIN args a LEFT JOIN app_user u ON u.user_id=m.addedby WHERE a.source=''edp'' AND m.company_id=a.company_id AND m.branch_id=a.branch_id AND m.addedon BETWEEN a.from_date AND a.to_date UNION ALL SELECT d.deduperunby::bigint, u.displayname, m.receivedate::date, EXTRACT(HOUR FROM d.deduperunon)::integer FROM main_mainopr m JOIN dedupe d ON d.uuid=m.uuid CROSS JOIN args a LEFT JOIN app_user u ON u.user_id=d.deduperunby WHERE a.source=''dedupe'' AND m.company_id=a.company_id AND m.branch_id=a.branch_id AND m.isdeleted=0 AND d.deduperunon BETWEEN a.from_date AND a.to_date UNION ALL SELECT r.opruser::bigint, u.displayname, r.oprtime::date, EXTRACT(HOUR FROM r.oprtime)::integer FROM main_mainopr m JOIN riskalerts r ON r.uuid=m.uuid CROSS JOIN args a LEFT JOIN app_user u ON u.user_id=r.opruser WHERE a.source=''opr'' AND m.company_id=a.company_id AND m.branch_id=a.branch_id AND r.oprtime BETWEEN a.from_date AND a.to_date UNION ALL SELECT p.portfolio_id::bigint, p.portname, m.sdoneon::date, EXTRACT(HOUR FROM m.sdoneon)::integer FROM main_mainopr m JOIN portfolio p ON p.portfolio_id=m.portfolio_id CROSS JOIN args a WHERE a.source=''port'' AND m.company_id=a.company_id AND m.branch_id=a.branch_id AND m.sdone=1 AND m.sdoneon BETWEEN a.from_date AND a.to_date UNION ALL SELECT CASE r.visit WHEN ''RESI'' THEN m.rbksoftupdtdby WHEN ''OFFICE'' THEN m.obksoftupdtdby ELSE m.pbksoftupdtdby END::bigint, u.displayname, CASE r.visit WHEN ''RESI'' THEN m.rbksoftupdtdon WHEN ''OFFICE'' THEN m.obksoftupdtdon ELSE m.pbksoftupdtdon END::date, EXTRACT(HOUR FROM CASE r.visit WHEN ''RESI'' THEN m.rbksoftupdtdon WHEN ''OFFICE'' THEN m.obksoftupdtdon ELSE m.pbksoftupdtdon END)::integer FROM main_mainopr m JOIN riskalerts r ON r.uuid=m.uuid CROSS JOIN args a LEFT JOIN app_user u ON u.user_id=CASE r.visit WHEN ''RESI'' THEN m.rbksoftupdtdby WHEN ''OFFICE'' THEN m.obksoftupdtdby ELSE m.pbksoftupdtdby END WHERE a.source=''bopr'' AND m.company_id=a.company_id AND m.branch_id=a.branch_id AND CASE r.visit WHEN ''RESI'' THEN m.rbksoftupdtdon WHEN ''OFFICE'' THEN m.obksoftupdtdon ELSE m.pbksoftupdtdon END BETWEEN a.from_date AND a.to_date) SELECT user_id, COALESCE(display_name, ''Unknown'') AS display_name, received_date, time_period, COUNT(*)::integer AS case_count FROM hourly_data GROUP BY user_id, display_name, received_date, time_period ORDER BY display_name, received_date, time_period',
ismigrated = true
WHERE query_id = 136;

View File

@@ -39,10 +39,10 @@ SELECT m.portfolio_id,p.portname||' <b>('||count(*)||')</b>' portname,
FROM main m FROM main m
JOIN main_operations mo ON mo.case_id=m.case_id JOIN main_operations mo ON mo.case_id=m.case_id
JOIN portfolio p ON p.portfolio_id=m.portfolio_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id
JOIN bankreport_mapping pf ON pf.portfolio_id=m.portfolio_id LEFT JOIN bankreport_mapping pf ON pf.portfolio_id=m.portfolio_id
JOIN bankreport ts ON ts.format_id=pf.telesheet LEFT JOIN bankreport ts ON ts.format_id=pf.telesheet
WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0 WHERE m.isdeleted=0 AND mo.sdone=0 AND coalesce(mo.telesheetby,0)=0 AND mo.cutoffby>0
AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1 AND (m.rtv>0 OR m.otv>0) AND m.company_id=? AND m.branch_id=? AND mo.telesheet=1
GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.telesheet,mo.lockedbyuser,ts.docformat,ts.docfunction GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.telesheet,mo.lockedbyuser,ts.docformat,ts.docfunction
ORDER BY p.portname$query$, ORDER BY p.portname$query$,
ismigrated = true ismigrated = true

View File

@@ -0,0 +1,18 @@
BEGIN;
UPDATE platform.application_query
SET query_text = 'select!C0L!SELECT mo.cutoffon,count(m.case_id) total FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.isdeleted=0 AND mo.sdone=0 AND mo.oprsend<>1 AND mo.cutoffby>0 AND m.company_id=? AND m.branch_id=? GROUP BY mo.cutoffon ORDER BY mo.cutoffon',
ismigrated = true
WHERE query_id = 49;
UPDATE platform.application_query
SET query_text = 'select!C0L!SELECT m.uuid,p.portname,m.customername,mo.cutoffon FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND mo.oprsend<>1 AND mo.cutoffby>0 AND m.company_id=? AND m.branch_id=? ORDER BY mo.cutoffon,p.portname,m.customername',
ismigrated = true
WHERE query_id = 50;
UPDATE platform.application_query
SET query_text = 'update!C0L!UPDATE main_operations mo SET allocatedby=CASE WHEN mo.allocatedby>0 AND ?::integer=1 THEN NULL ELSE mo.allocatedby END,telesheetby=CASE WHEN mo.telesheetby>0 AND ?::integer=1 THEN NULL ELSE mo.telesheetby END,earlierby=CASE WHEN mo.earlierby>0 AND ?::integer=1 THEN NULL ELSE mo.earlierby END,negativeby=CASE WHEN mo.negativeby>0 AND ?::integer=1 THEN NULL ELSE mo.negativeby END,cutoffby=CASE WHEN mo.cutoffby>0 AND ?::integer=1 THEN 0 ELSE mo.cutoffby END FROM main m WHERE m.case_id=mo.case_id AND ((?::integer=0 AND m.uuid::text=?) OR (?::integer=1 AND mo.cutoffon=?::timestamp)) AND m.company_id=? AND m.branch_id=? AND m.isdeleted=0 AND mo.sdone=0',
ismigrated = true
WHERE query_id = 51;
COMMIT;

View File

@@ -0,0 +1,13 @@
BEGIN;
UPDATE platform.application_query
SET query_text = replace(query_text, ' AND (m.rtv>0 OR m.otv>0)', ''),
ismigrated = true
WHERE query_id = 32;
UPDATE platform.application_query
SET query_text = replace(query_text, ' AND (m.rtv=1 OR m.otv=1)', ''),
ismigrated = true
WHERE query_id = 33;
COMMIT;

View File

@@ -0,0 +1,13 @@
BEGIN;
UPDATE platform.application_query
SET query_text = replace(
replace(query_text,
'JOIN bankreport_mapping pf ON pf.portfolio_id=m.portfolio_id',
'LEFT JOIN bankreport_mapping pf ON pf.portfolio_id=m.portfolio_id'),
'JOIN bankreport ts ON ts.format_id=pf.telesheet',
'LEFT JOIN bankreport ts ON ts.format_id=pf.telesheet'),
ismigrated = true
WHERE query_id = 32;
COMMIT;

View File

@@ -0,0 +1,16 @@
-- Tele-Sheet is available only when at least one RTV or OTV visit is required.
UPDATE platform.application_query SET query_text =
'select!C0L!SELECT m.portfolio_id, p.portname||'' <b>(''||count(*)||'')</b>'' portname, CASE WHEN sum(mo.allocation)<=0 THEN -1 ELSE 1 END allocation, CASE WHEN sum(mo.sms)<=0 THEN -1 ELSE 1 END sms, CASE WHEN sum(mo.telesheet)>=1 THEN 1 ELSE 0 END telesheet, sum(m.rtv) rtv, sum(m.otv) otv, CASE WHEN sum(mo.earlier)<=0 THEN -1 ELSE 1 END earlier, CASE WHEN sum(mo.negative)<=0 THEN -1 ELSE 1 END negative, CASE WHEN mo.islocked<>? THEN 1 ELSE 0 END islocked, coalesce(mo.lockedbyuser,'''') lockedby FROM main m JOIN main_operations mo ON mo.case_id=m.case_id JOIN portfolio p ON p.portfolio_id=m.portfolio_id WHERE m.isdeleted=0 AND mo.sdone=0 AND (mo.cutoffby IS NULL OR mo.cutoffby=0) AND m.addedby<>0 AND m.company_id=? AND m.branch_id=? GROUP BY m.portfolio_id,p.portname,mo.islocked,mo.lockedbyuser ORDER BY p.portname', ismigrated=true WHERE query_id=18;
UPDATE platform.application_query SET query_text =
'update!C0L!UPDATE main_operations mo SET allocation=CASE WHEN x.selected THEN x.allocation ELSE mo.allocation END,sms=CASE WHEN x.selected THEN x.sms ELSE mo.sms END,smsby=CASE WHEN x.selected AND x.sms<0 THEN x.user_id ELSE mo.smsby END,telesheet=CASE WHEN x.selected THEN CASE WHEN (m.rtv<=0 AND m.otv<=0) OR mo.telesheet=0 THEN 0 ELSE x.telesheet END ELSE mo.telesheet END,telesheetby=CASE WHEN x.selected AND (m.rtv>0 OR m.otv>0) AND x.telesheet<0 THEN x.user_id ELSE mo.telesheetby END,earlier=CASE WHEN x.selected THEN x.earlier ELSE mo.earlier END,earlierby=CASE WHEN x.selected AND x.earlier<0 THEN x.user_id ELSE mo.earlierby END,negative=CASE WHEN x.selected THEN x.negative ELSE mo.negative END,negativeby=CASE WHEN x.selected AND x.negative<0 THEN x.user_id ELSE mo.negativeby END,cutoffby=CASE WHEN x.selected THEN x.user_id ELSE mo.cutoffby END,cutoffbyuser=CASE WHEN x.selected THEN x.audit_user ELSE mo.cutoffbyuser END,islocked=0,lockedbyuser=NULL,batch=CASE WHEN x.selected THEN x.batch ELSE mo.batch END,cutoffon=CASE WHEN x.selected THEN mo.cutoffon ELSE NULL END FROM main m,(SELECT ?::boolean selected,?::smallint allocation,?::smallint sms,?::smallint telesheet,?::smallint earlier,?::smallint negative,?::integer user_id,?::text audit_user,?::text batch) x WHERE m.case_id=mo.case_id AND m.company_id=? AND m.branch_id=? AND m.portfolio_id=? AND mo.cutoffon=?::timestamp AND mo.islocked=? AND (mo.cutoffby IS NULL OR mo.cutoffby=0)', ismigrated=true WHERE query_id=26;
UPDATE platform.application_query SET query_text = regexp_replace(query_text,
' AND mo\.telesheet=1 GROUP BY',
' AND mo.telesheet=1 AND (m.rtv>0 OR m.otv>0) GROUP BY')
WHERE query_id=32 AND query_text NOT LIKE '%(m.rtv>0 OR m.otv>0)%';
UPDATE platform.application_query SET query_text = regexp_replace(query_text,
' AND mo\.telesheet=1 ORDER BY',
' AND mo.telesheet=1 AND (m.rtv=1 OR m.otv=1) ORDER BY')
WHERE query_id=33 AND query_text NOT LIKE '%(m.rtv=1 OR m.otv=1)%';

View File

@@ -0,0 +1,7 @@
-- Preserve the legacy SECURITY DEFINER function. Normalize its NULL success
-- result and avoid invoking it again after the case has already been sent.
UPDATE platform.application_query
SET query_text =
'procedure!C0L!SELECT CASE WHEN NOT EXISTS (SELECT 1 FROM main m WHERE m.uuid::text=x.uniqueid::text AND m.company_id=x.companyid AND m.branch_id=x.branchid AND m.portfolio_id=x.portfolioid AND m.isdeleted=0) THEN ''error:Access denied'' WHEN EXISTS (SELECT 1 FROM main m JOIN main_operations mo ON mo.case_id=m.case_id WHERE m.uuid::text=x.uniqueid::text AND m.company_id=x.companyid AND m.branch_id=x.branchid AND m.portfolio_id=x.portfolioid AND (mo.oprsend=1 OR coalesce(mo.oprsendby,0)>0)) THEN ''success:Already sent'' ELSE coalesce(sendtooperation(x.uniqueid,x.selected,x.processedon,x.userid,x.companyid,x.branchid,x.portfolioid),''success:Sent to operations'') END FROM (SELECT ?::bpchar uniqueid,?::integer selected,?::bpchar processedon,?::integer userid,?::integer companyid,?::integer branchid,?::integer portfolioid) x',
ismigrated = true
WHERE query_id = 47;

View File

@@ -0,0 +1,11 @@
-- Remove artifacts made obsolete by the migrated Punching/Cut-Off workflows.
UPDATE platform.application_query
SET query_text = 'SELECT m.uuid AS document_case_id, m.mvcode AS mv_code, UPPER(m.applno) AS file_number, UPPER(m.customername) AS customer_name, UPPER(m.apptype) AS application_type, UPPER(m.product) AS product, TO_CHAR(COALESCE(m.addedon, m.lasteditedon), ''DD-MON-YYYY HH24:MI:SS'') AS received_on, COALESCE(NULLIF(m.lasteditedbyuser, ''''), m.addedbyuser, '''') AS punched_by, b.bkbranchcode AS branch_code, m.portfolio_id FROM main m JOIN main_operations mo ON mo.case_id = m.case_id JOIN portfolio_bank_branch b ON b.portbranch_id = m.bank_branch_id WHERE mo.oprsend = 1 AND mo.sdone = 0 AND m.isdeleted = 0 AND m.portfolio_id = ? AND m.company_id = ? AND m.branch_id = ? ORDER BY COALESCE(m.addedon, m.lasteditedon), m.applno, m.apptype',
ismigrated = TRUE
WHERE query_id = 23;
DELETE FROM platform.application_query
WHERE query_id = 475;
DROP VIEW IF EXISTS public.editcasesgrid;

File diff suppressed because one or more lines are too long

View File

@@ -40,5 +40,6 @@
<reactor.netty.version>1.2.8</reactor.netty.version> <reactor.netty.version>1.2.8</reactor.netty.version>
<nimbus.version>10.4</nimbus.version> <nimbus.version>10.4</nimbus.version>
<lombok.version>1.18.46</lombok.version> <lombok.version>1.18.46</lombok.version>
<jasperreports.version>6.21.5</jasperreports.version>
</properties> </properties>
</project> </project>