Skip to content

Commit

Permalink
Merge pull request #5312 from bcgov/dev-rook-RQ-sync-dev
Browse files Browse the repository at this point in the history
Sync dev to dev-rook
  • Loading branch information
richard-aot authored Jul 10, 2024
2 parents aeedd7c + 9483857 commit c7743d5
Show file tree
Hide file tree
Showing 67 changed files with 5,292 additions and 1,968 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public AXISRequest GetAXISRequest(string request)
axisRequest.ApplicantLastName = Convert.ToString(row["lastName"]);
axisRequest.BusinessName = Convert.ToString(row["businessName"]);

axisRequest.AXISApplicantID = Convert.ToString(row["axisApplicantID"]);
axisRequest.Address = Convert.ToString(row["address"]);
axisRequest.AddressSecondary = Convert.ToString(row["addressSecondary"]);
axisRequest.City = Convert.ToString(row["city"]);
Expand Down Expand Up @@ -128,7 +129,7 @@ public Dictionary<string, PageCount> GetAXISRequestsPageCount(string[] arrayOfRe
DataTable axisDataTable = GetAxisRequestsPageCount(arrayOfRequestId);

var axisRequestPageCountDict = axisDataTable.AsEnumerable()
.Where(rw => Convert.ToInt32(rw["requestPageCount"]) > 0)
.Where(rw => Convert.ToInt32(rw["requestPageCount"]) > 0 || Convert.ToInt32(rw["lanPageCount"]) > 0)
.ToDictionary(
rw => Convert.ToString(rw["AXISRequestID"]),
rw => new PageCount
Expand All @@ -145,7 +146,7 @@ public Dictionary<string, PageCount> GetAXISRequestsPageCount()
DataTable axisDataTable = GetAxisRequestsPageCount();

var axisRequestPageCountDict = axisDataTable.AsEnumerable()
.Where(rw => Convert.ToInt32(rw["requestPageCount"]) > 0)
.Where(rw => Convert.ToInt32(rw["requestPageCount"]) > 0 || Convert.ToInt32(rw["lanPageCount"]) > 0)
.ToDictionary(
rw => Convert.ToString(rw["AXISRequestID"]),
rw => new PageCount
Expand Down Expand Up @@ -180,7 +181,7 @@ private DataTable GetAxisRequestData(string request)
(SELECT terminology.vcTerminology from tblTerminologyLookup terminology WHERE terminology.iLabelID = deliveryModes.iLabelID and terminology.tiLocaleID = 1) as deliveryMode,
(SELECT terminology.vcTerminology from tblTerminologyLookup terminology WHERE terminology.iLabelID = countries.iLabelID and terminology.tiLocaleID = 1) as country,
(SELECT terminology.vcTerminology from tblTerminologyLookup terminology WHERE terminology.iLabelID = states.iLabelID and terminology.tiLocaleID = 1) as province,
requesters.vcAddress1 as [address], requesters.vcAddress2 as addressSecondary, requesters.vcCity as city, requesters.vcZipCode as postal,
requesters.iRequesterID as axisApplicantID, requesters.vcAddress1 as [address], requesters.vcAddress2 as addressSecondary, requesters.vcCity as city, requesters.vcZipCode as postal,
requesters.vcHome as phonePrimary,
requesters.vcMobile as phoneSecondary,
requesters.vcWork1 as workPhonePrimary,
Expand All @@ -195,7 +196,7 @@ private DataTable GetAxisRequestData(string request)
onbehalf.vcLastName as onbehalfLastName,
onbehalf.vcMiddleName as onbehalfMiddleName,
(SELECT terminology.vcTerminology from tblTerminologyLookup terminology WHERE terminology.iLabelID = requestTypes.iLabelID and terminology.tiLocaleID = 1) as requestType,
sum(distinct case when requests.IREQUESTID = reviewlog.IREQUESTID and reviewlog.IDOCID = documents.IDOCID then documents.SIPAGECOUNT
sum(case when requests.IREQUESTID = reviewlog.IREQUESTID and reviewlog.IDOCID = documents.IDOCID then documents.SIPAGECOUNT
when requests.IREQUESTID = redaction.IREQUESTID and redaction.IDOCID = ldocuments.IDOCID then ldocuments.SIPAGECOUNT
else 0 end) as requestPageCount,
(case when requestfields.CustomField91 > 0 then requestfields.CustomField91 else 0 end ) as lanPageCount,
Expand Down Expand Up @@ -229,7 +230,7 @@ LEFT OUTER JOIN dbo.TBLREQUESTCUSTOMFIELDS requestfields WITH (NOLOCK) ON reques
GROUP BY requests.sdtReceivedDate, requests.sdtTargetDate, requests.sdtOriginalTargetDate, requests.vcDescription,
requests.sdtRqtDescFromdate, requests.sdtRqtDescTodate, requests.sdtRequestedDate, office.OFFICE_CODE, requesterTypes.vcDescription,
receivedModes.iLabelID, deliveryModes.iLabelID, countries.iLabelID, states.iLabelID,
requesters.vcAddress1, requesters.vcAddress2, requesters.vcCity, requesters.vcZipCode,
requesters.iRequesterID, requesters.vcAddress1, requesters.vcAddress2, requesters.vcCity, requesters.vcZipCode,
requesters.vcHome, requesters.vcMobile, requesters.vcWork1, requesters.vcWork2, requesters.vcFirstName, requesters.vcLastName, requesters.vcMiddleName,
requests.iRequestID, requesters.vcCompany, requesters.vcEmailID, onbehalf.vcFirstName, onbehalf.vcLastName, onbehalf.vcMiddleName,
requestTypes.iLabelID, requests.vcVisibleRequestID, requests.tiOfficeID, office.OFFICE_ID,requestorfields.CUSTOMFIELD35,
Expand Down Expand Up @@ -352,7 +353,7 @@ private DataTable GetAxisRequestsPageCount(string[] arrayOfRequestId)
ConnectionString = SettingsManager.ConnectionString;
var inClauseValues = RequestsHelper.GetInClause(arrayOfRequestId);

string query = $@"Select vcVisibleRequestID as axisRequestId, sum(distinct case when requests.IREQUESTID = reviewlog.IREQUESTID and reviewlog.IDOCID = documents.IDOCID then documents.SIPAGECOUNT
string query = $@"Select vcVisibleRequestID as axisRequestId, sum(case when requests.IREQUESTID = reviewlog.IREQUESTID and reviewlog.IDOCID = documents.IDOCID then documents.SIPAGECOUNT
when requests.IREQUESTID = redaction.IREQUESTID and redaction.IDOCID = ldocuments.IDOCID then ldocuments.SIPAGECOUNT
else 0 end) as requestPageCount,
(case when requestfields.CustomField91 > 0 then requestfields.CustomField91 else 0 end ) as lanPageCount
Expand Down Expand Up @@ -393,7 +394,7 @@ private DataTable GetAxisRequestsPageCount()
{
ConnectionString = SettingsManager.ConnectionString;

string query = @"Select vcVisibleRequestID as axisRequestId, sum(distinct case when requests.IREQUESTID = reviewlog.IREQUESTID and reviewlog.IDOCID = documents.IDOCID then documents.SIPAGECOUNT
string query = @"Select vcVisibleRequestID as axisRequestId, sum(case when requests.IREQUESTID = reviewlog.IREQUESTID and reviewlog.IDOCID = documents.IDOCID then documents.SIPAGECOUNT
when requests.IREQUESTID = redaction.IREQUESTID and redaction.IDOCID = ldocuments.IDOCID then ldocuments.SIPAGECOUNT
else 0 end) as requestPageCount,
(case when requestfields.CustomField91 > 0 then requestfields.CustomField91 else 0 end ) as lanPageCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public class AXISRequest
[DataMember(Name = "lastName")]
public string ApplicantLastName { get; set; }


[DataMember(Name = "axisApplicantID")]
public string AXISApplicantID { get; set; }

[DataMember(Name = "businessName")]
public string BusinessName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public ActionResult<string> Post([FromBody] List<string> axisRequestIds)
}
foreach (var requestId in axisRequestIds)
{
_logger.Log(LogLevel.Information, string.Format($"axisRequestId for syncing requestPageCount and LANPages: {requestId}"));
if (!IsValidRequestId(requestId))
{
return BadRequest($"Invalid axisRequestId: {requestId}");
Expand Down
Loading

0 comments on commit c7743d5

Please sign in to comment.