Skip to content

Commit

Permalink
Merge branch 'master-tqm-merge' into tqm-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothrallapalli-eGov committed Nov 7, 2024
2 parents c5a65e5 + 292207d commit 976f968
Show file tree
Hide file tree
Showing 117 changed files with 1,871 additions and 630 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ public Integer updateBillStatus(UpdateBillCriteria updateBillCriteria) {

List<Object> preparedStmtList = new ArrayList<>();
String queryStr = billQueryBuilder.getBillStatusUpdateQuery(updateBillCriteria, preparedStmtList);
log.info("Query for expiring bills is"+ queryStr);
log.info("parameters are "+ preparedStmtList.toString());
return jdbcTemplate.update(queryStr, preparedStmtList.toArray());
}

Expand Down
4 changes: 2 additions & 2 deletions core-services/pdf-service/src/utils/externalAPIMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const externalAPIMapping = async function (
//to convert queryparam and uri into properURI

//for PT module
if (pdfKey == "pt-receipt") {
if (pdfKey == "ptt-receipt") {
for (let j = 0; j < externalAPIArray[i].queryParams.length; j++) {
if (externalAPIArray[i].queryParams[j] == "$") {
flag = 1;
Expand Down Expand Up @@ -424,4 +424,4 @@ export const externalAPIMapping = async function (

});

};
};
20 changes: 10 additions & 10 deletions core-services/zuul/src/main/resources/limiter.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ zuul.ratelimit.policy-list.user-otp[0].type[0]=url=/user-otp
zuul.ratelimit.policy-list.user-otp[0].type[1]=origin


zuul.ratelimit.policy-list.filestore[0].limit=15
zuul.ratelimit.policy-list.filestore[0].quota=10000
zuul.ratelimit.policy-list.filestore[0].refresh-interval=60
zuul.ratelimit.policy-list.filestore[0].type[0]=url=/filestore/v1/files/url
zuul.ratelimit.policy-list.filestore[0].type[1]=origin
#zuul.ratelimit.policy-list.filestore[0].limit=60
#zuul.ratelimit.policy-list.filestore[0].quota=10000
#zuul.ratelimit.policy-list.filestore[0].refresh-interval=60
#zuul.ratelimit.policy-list.filestore[0].type[0]=url=/filestore/v1/files/url
#zuul.ratelimit.policy-list.filestore[0].type[1]=origin

#zuul.ratelimit.policy-list.localization[0].limit=10
#zuul.ratelimit.policy-list.localization[0].quota=10000
Expand Down Expand Up @@ -58,8 +58,8 @@ zuul.ratelimit.policy-list.pgr-services[0].refresh-interval=60
zuul.ratelimit.policy-list.pgr-services[0].type[0]=url=/pgr-services/v2/request/_create
zuul.ratelimit.policy-list.pgr-services[0].type[1]=user

zuul.ratelimit.policy-list.user[1].limit=6
zuul.ratelimit.policy-list.user[1].quota=10000
zuul.ratelimit.policy-list.user[1].refresh-interval=60
zuul.ratelimit.policy-list.user[1].type[0]=url=/user/oauth/token
zuul.ratelimit.policy-list.user[1].type[1]=origin
#zuul.ratelimit.policy-list.user[1].limit=8
#zuul.ratelimit.policy-list.user[1].quota=10000
#zuul.ratelimit.policy-list.user[1].refresh-interval=60
#zuul.ratelimit.policy-list.user[1].type[0]=url=/user/oauth/token
#zuul.ratelimit.policy-list.user[1].type[1]=origin
4 changes: 2 additions & 2 deletions edcr/service/egov/egov-edcr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
<url>https://repository.aspose.com/java/repo/</url>
</repository>

</repositories>
Expand Down Expand Up @@ -134,4 +134,4 @@

</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -299,19 +299,19 @@ private void updateFile(Plan pl, EdcrApplication edcrApplication) {

Image objImage = Image.load(filePath);


PdfOptions pdfOptions = new PdfOptions();


CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.setBackgroundColor(Color.getWhite());
rasterizationOptions.setDrawType(CadDrawTypeMode.UseObjectColor);
rasterizationOptions.setBackgroundColor(Color.getWhite()); // Set background color if needed
rasterizationOptions.setDrawType(CadDrawTypeMode.UseObjectColor); // Ensure object colors are used

// Set the page size (A0 size in points)

rasterizationOptions.setPageWidth(3370);
rasterizationOptions.setPageHeight(2384);
rasterizationOptions.setPageHeight(2384);


rasterizationOptions.setAutomaticLayoutsScaling(true);
rasterizationOptions.setNoScaling(false);

Expand All @@ -333,7 +333,7 @@ private void updateFile(Plan pl, EdcrApplication edcrApplication) {
PDPageXYZDestination dest = new PDPageXYZDestination();
dest.setPage(page);


float pageWidth = page.getMediaBox().getWidth();
float pageHeight = page.getMediaBox().getHeight();
int centerX = (int) (pageWidth / 2.0f);
Expand All @@ -343,13 +343,13 @@ private void updateFile(Plan pl, EdcrApplication edcrApplication) {
dest.setTop(centerY);
dest.setZoom(1.0f);


PDDocumentCatalog catalog = document.getDocumentCatalog();
catalog.setOpenAction(dest);

byte[] modifiedPdfBytes;

// Watermark
//watermark
PDPageContentStream contentStream = new PDPageContentStream(document, page,
PDPageContentStream.AppendMode.APPEND, true, true);

Expand All @@ -361,46 +361,44 @@ private void updateFile(Plan pl, EdcrApplication edcrApplication) {
// InputStream imageStream = EdcrApplication.class.getResourceAsStream("/tcpicon.jpg");
// java.awt.image.BufferedImage image1 = ImageIO.read(imageStream);
// PDImageXObject image = LosslessFactory.createFromImage(document, image1);


float scale = 10f;
//
//
// float scale = 10f;
// float watermarkWidth = image.getWidth() * scale;
// float watermarkHeight = image.getHeight() * scale;
// float watermarkXPos = (pageWidth - watermarkWidth) / 2;
// float watermarkYPos = (pageHeight - watermarkHeight) / 2;
// float watermarkXPos = (pageWidth - watermarkWidth) / 2; // Center horizontally
// float watermarkYPos = (pageHeight - watermarkHeight) / 2; // Center vertically
//
//
// contentStream.drawImage(image, watermarkXPos, watermarkYPos, watermarkWidth, watermarkHeight);

//Add timestamp
// Add timestamp
String timestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
contentStream.beginText();
contentStream.setFont(PDType1Font.HELVETICA_BOLD, 200);


float textWidth = (PDType1Font.HELVETICA_BOLD.getStringWidth(timestamp) / 1000) * 200;


float xPos = pageWidth - textWidth - 700;
float yPos = 10;

contentStream.newLineAtOffset(xPos, yPos);

PDExtendedGraphicsState graphicsState1 = new PDExtendedGraphicsState();
graphicsState1.setNonStrokingAlphaConstant(0.7f); // Set text opacity
graphicsState1.setNonStrokingAlphaConstant(0.7f);
contentStream.setGraphicsStateParameters(graphicsState1);

contentStream.showText(timestamp);
contentStream.endText();





contentStream.close();


// Save the modified PDF
ByteArrayOutputStream modifiedPdfStream = new ByteArrayOutputStream();
document.save(modifiedPdfStream);
document.close();


modifiedPdfBytes = modifiedPdfStream.toByteArray();
Expand All @@ -421,8 +419,6 @@ private void updateFile(Plan pl, EdcrApplication edcrApplication) {
LOG.error("Error occurred when processing PDF!!!!!", e);
}
}



@Transactional
public EdcrApplication createRestEdcr(final EdcrApplication edcrApplication){
Expand Down
18 changes: 9 additions & 9 deletions frontend/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
},
"devDependencies": {
"@upyog/digit-ui-module-bills": "1.8.0",
"@upyog/digit-ui-module-common": "1.8.1",
"@upyog/digit-ui-module-common": "1.8.12",
"@upyog/digit-ui-module-engagement": "1.8.0",
"@egovernments/digit-ui-module-fsm": "1.8.4-beta1",
"@upyog/digit-ui-module-mcollect": "1.8.0",
"@upyog/digit-ui-module-fsm": "1.8.19",
"@upyog/digit-ui-module-mcollect": "1.8.8",
"@upyog/digit-ui-module-noc": "1.8.0",
"@upyog/digit-ui-module-obps": "1.8.4",
"@upyog/digit-ui-module-pgr": "1.8.0",
"@upyog/digit-ui-module-pt": "1.8.9",
"@upyog/digit-ui-module-obps": "1.8.16",
"@upyog/digit-ui-module-pgr": "1.8.4",
"@upyog/digit-ui-module-pt": "1.8.17",
"@upyog/digit-ui-module-receipts": "1.8.0",
"@upyog/digit-ui-module-tl": "1.8.3",
"@upyog/digit-ui-module-ws": "1.8.9",
"@upyog/digit-ui-module-commonpt": "1.8.0",
"@upyog/digit-ui-module-tl": "1.8.10",
"@upyog/digit-ui-module-ws": "1.8.16",
"@upyog/digit-ui-module-commonpt": "1.8.1",
"http-proxy-middleware": "1.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<head>
<meta charset="utf-8"/>
<link rel="icon" href="https://cdn.jsdelivr.net/npm/@egovernments/digit-ui-css/img/browser-icon.png"/>
<link rel="stylesheet" href="https://unpkg.com/@upyog-niua/[email protected]/dist/index.css"/>

<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap" rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" content="#00bcd1"/>
Expand Down
20 changes: 12 additions & 8 deletions frontend/micro-ui/web/micro-ui-internals/example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ import { initBillsComponents, BillsModule } from "@upyog/digit-ui-module-bills";
// import { Body, TopBar } from "@upyog/digit-ui-react-components";
import "@upyog-niua/upyog-css/example/index.css";

//import { PTRModule, PTRLinks, PTRComponents } from "@upyog-niua/upyog-ui-module-ptr";

import { PTRModule, PTRLinks, PTRComponents } from "@upyog-niua/upyog-ui-module-ptr";

// import * as comps from "@upyog/digit-ui-react-components";

Expand All @@ -42,6 +41,7 @@ import { pgrCustomizations, pgrComponents } from "./pgr";
var Digit = window.Digit || {};

const enabledModules = [
"Tqm",
"PGR",
"FSM",
"Payment",
Expand All @@ -64,16 +64,17 @@ const enabledModules = [
"BillAmendment",
"FireNoc",
"Birth",
"Death"
"Death",
"PTR",
];

const initTokens = (stateCode) => {
const userType = window.sessionStorage.getItem("userType") || process.env.REACT_APP_USER_TYPE || "CITIZEN";

const token = window.localStorage.getItem("token")|| process.env[`REACT_APP_${userType}_TOKEN`];
const citizenInfo = window.localStorage.getItem("Citizen.user-info")
const token = window.localStorage.getItem("token") || process.env[`REACT_APP_${userType}_TOKEN`];

const citizenInfo = window.localStorage.getItem("Citizen.user-info");

const citizenTenantId = window.localStorage.getItem("Citizen.tenant-id") || stateCode;

const employeeInfo = window.localStorage.getItem("Employee.user-info");
Expand Down Expand Up @@ -107,7 +108,10 @@ const initDigitUI = () => {
MCollectModule,
HRMSModule,
ReceiptsModule,
BillsModule
BillsModule,
PTRModule,
PTRLinks,
...PTRComponents,
// TLModule,
// TLLinks,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ const createProxy = createProxyMiddleware({
// target: process.env.REACT_APP_PROXY_API || "https://qa.digit.org",
target: process.env.REACT_APP_PROXY_API || "https://qa.digit.org",
changeOrigin: true,
secure: false,
});
const assetsProxy = createProxyMiddleware({
target: process.env.REACT_APP_PROXY_ASSETS || "https://qa.digit.org",
changeOrigin: true,
secure: false,
});
module.exports = function (app) {
[
Expand Down Expand Up @@ -69,4 +71,4 @@ module.exports = function (app) {
"/pet-services/pet-registration/_update",
].forEach((location) => app.use(location, createProxy));
["/pb-egov-assets"].forEach((location) => app.use(location, assetsProxy));
};
};
6 changes: 2 additions & 4 deletions frontend/micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
"main": "index.js",
"workspaces": [
"packages/libraries",
"packages/css",
"example",
"packages/react-components",
"packages/modules/*"

],
"license": "MIT",
"private": true,
Expand All @@ -20,7 +18,7 @@
"sprint": "SKIP_PREFLIGHT_CHECK=true run-s start:script",
"start:dev": "run-p dev:**",
"start:script": "./scripts/create.sh",
"dev:css": "cd packages/css && yarn start",
"devD:css": "cd packages/css && yarn start",
"publish:css": "cd packages/css && yarn publish --access public",
"dev:libraries": "cd packages/libraries && yarn start",
"dev:components": "cd packages/react-components && yarn start",
Expand Down Expand Up @@ -52,7 +50,7 @@
"buildD:commonPt": "cd packages/modules/commonPt && yarn build",
"buildD:core": "cd packages/modules/core && yarn build",
"buildD:pgr": "cd packages/modules/pgr && yarn build",
"buildD:fsm": "cd packages/modules/fsm && yarn build",
"build:fsm": "cd packages/modules/fsm && yarn build",
"buildD:dss": "cd packages/modules/dss && yarn build",
"buildD:mcollect": "cd packages/modules/mCollect && yarn build",
"buildD:receipts": "cd packages/modules/receipts && yarn build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { PaymentService } from "../services/elements/Payment";
export const useFetchCitizenBillsForBuissnessService = ({ businessService, ...filters }, config = {}) => {
const queryClient = useQueryClient();
const { mobileNumber, tenantId } = Digit.UserService.getUser()?.info || {};
const tenant = Digit.ULBService.getCitizenCurrentTenant()
const params = { mobileNumber, businessService, ...filters };
if (!params["mobileNumber"]) delete params["mobileNumber"];
const { isLoading, error, isError, data, status } = useQuery(
["citizenBillsForBuisnessService", businessService, { ...params }],
() => Digit.PaymentService.fetchBill(tenantId, { ...params }),
() => Digit.PaymentService.fetchBill(window.location.href.includes("mcollect")?tenant:tenantId, { ...params }),
{
refetchOnMount: true,
retry: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
import { useQuery } from "react-query";

const alphabeticalSortFunctionForTenantsBasedOnName = (firstEl, secondEl) =>{
if (firstEl.name.toUpperCase() < secondEl.name.toUpperCase() ) {
return -1
// Sort function
const alphabeticalSortFunctionForTenantsBasedOnName = (firstEl, secondEl) => {
console.log("firstEl, secondEl", firstEl, secondEl);

// Extract city names for comparison
const firstCityName = firstEl.city.name.toUpperCase();
const secondCityName = secondEl.city.name.toUpperCase();

// Check if either of the cities is "PG"
const isFirstCityPG = firstCityName === "PG";
const isSecondCityPG = secondCityName === "PG";

// If the first city is "PG", it should come after the second city
if (isFirstCityPG && !isSecondCityPG) {
return 1; // firstEl (PG) comes after secondEl
}
if (!isFirstCityPG && isSecondCityPG) {
return -1; // secondEl (PG) comes after firstEl
}

// If both cities are not "PG", sort alphabetically by city name
if (firstCityName < secondCityName) {
return -1; // firstEl comes first
}
if (firstEl.name.toUpperCase() > secondEl.name.toUpperCase() ) {
return 1
if (firstCityName > secondCityName) {
return 1; // secondEl comes first
}
return 0
}

// If both have the same city name, sort alphabetically by tenant name
if (firstEl.name.toUpperCase() < secondEl.name.toUpperCase()) {
return -1;
}
if (firstEl.name.toUpperCase() > secondEl.name.toUpperCase()) {
return 1;
}

return 0; // They are equal
};


export const useTenants = () => useQuery(["ALL_TENANTS"], () => Digit.SessionStorage.get("initData").tenants.sort(alphabeticalSortFunctionForTenantsBasedOnName))
Loading

0 comments on commit 976f968

Please sign in to comment.