Skip to content

Commit

Permalink
Merge pull request #1306 from upyog/Dev-2.0
Browse files Browse the repository at this point in the history
Dev 2.0
  • Loading branch information
sriranjan-s authored Aug 30, 2024
2 parents 7b71ec2 + 80a9db5 commit f61c262
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ eSign.responseurl=https://authenticate.sandbox.emudhra.com/eSignExternal/v2_1/si
eSign.redirecturl= https://upyog-test.niua.org/requester-services-dx/eSign/redirect
eSign.pdf=D:\\env\\eSign\\Acknowledgement.pdf
esign.tempfolder=/tmp/esign-tmp
esign.outputfolder=/tmp/esign-output
esign.outputfolder=/tmp/esign-output
esign.UIURL=https://upyog-test.niua.org/digit-ui/employee/tl/common
#eSign.s3bucket=https:\\upyog-test-assets.s3-ap-south-1.amazonaws.com/pg.citya/pdfgen/August/16
#File Store Id
#egov.filestore.host=http://egov-filestore:8080/
#sw.fileStore.link=filestore/v1/files/url?tenantId=pg&fileStoreIds=$f

Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,27 @@ public Plan process(Plan plan) {

}
}
System.out.println("landnig" + totalLandings);
System.out.println("flights" + totalFlights);

if(flrHt != null) {
BigDecimal riserHeight = flrHt.divide(totalSteps, 2, RoundingMode.HALF_UP);



System.out.println("riserHt====" + riserHeight);

if (riserHeight.compareTo(BigDecimal.valueOf(0.19)) <= 0) {
setReportOutputDetailsFloorStairWise(plan, RULE, "","", "" + 0.19, "" +
riserHeight,

Result.Accepted.getResultVal(), scrutinyDetail4);
} else {
setReportOutputDetailsFloorStairWise(plan, RULE, "", "", "" + 0.19, "" +
riserHeight, Result.Not_Accepted.getResultVal(), scrutinyDetail4);
}}


if (
!stairAbsent.isEmpty()) {
for (String error : stairAbsent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,47 +205,6 @@ const SelectDocument = React.memo(function MyComponent({
e && setfileArray([...fileArray,e.file]);
}

// function getData(e) {
// let key = selectedDocument.code;
// let data,newArr;
// if (e?.length > 0) {
// data = Object.fromEntries(e);
// newArr = Object.values(data);
// newArr = formData?.documents?.documents?.filter((ob) => ob.documentType === selectedDocument.code);
// setnewArray(newArr);
// // const filteredDocumentsByFileStoreId = documents?.filter((item) => item?.fileStoreId !== uploadedFile.fileStoreId) || []
// let newfiles = [];
// e?.map((doc, index) => {
// newfiles.push({
// documentType: selectedDocument?.code,
// additionalDetails:{category:selectedDocument?.code/*.split(".").slice(0,2).join('_')*/},
// fileStoreId: doc?.[1]?.fileStoreId?.fileStoreId,
// documentUid: doc?.[1].fileStoreId?.fileStoreId,
// fileName: doc?.[0] || "",
// id:documents? documents.find(x => x.documentType === selectedDocument?.code)?.id:undefined,
// })
// })
// const __documents = [
// ...documents.filter(e => e.documentType !== key ),
// ...newfiles,
// ]
// setDocuments(__documents)
// }else if(e?.length==0){
// const __documents = [
// ...documents.filter(e => e.documentType !== key ),
// ]
// setDocuments(__documents);
// }

// newArr?.map((ob) => {
// if(!ob?.file){
// ob.file = {}
// }
// ob.file.documentType = key;
// selectfile(ob,key);
// })
// }

function getData(e) {
let key = selectedDocument.code;
let data, newArr;
Expand All @@ -258,8 +217,14 @@ const SelectDocument = React.memo(function MyComponent({
setLatitude(location.latitude);
setLongitude(location.longitude);
{if (doc?.code === "SITEPHOTOGRAPH.ONE"){
if(location.latitude !==null && location.longitude !==null){
sessionStorage.setItem("Latitude",location.latitude)
sessionStorage.setItem("Longitude",location.longitude)
}
else{
sessionStorage.removeItem("Latitude");
sessionStorage.removeItem("Longitude");
}
}}


Expand Down Expand Up @@ -423,20 +388,19 @@ const SelectDocument = React.memo(function MyComponent({
{doc?.uploadedDocuments?.length && <DocumentsPreview isSendBackFlow={true} documents={doc?.uploadedDocuments} />}

{doc?.code === "SITEPHOTOGRAPH.ONE" && (
(sessionStorage.getItem("Latitude") ? true : false ) ? (
<div>
<p>Latitude: {sessionStorage.getItem("Latitude")}</p>
<p>Longitude: {sessionStorage.getItem("Longitude")}</p>
{setIsNextButtonDisabled(false)} {/* Enable the "Next" button */}
</div>
):
(
<div>
<p style={{ color: 'red' }}>Please upload a Photo with Location details.</p>
{setIsNextButtonDisabled(true)} {/* Disable the "Next" button */}
</div>
)
)}
sessionStorage.getItem("Latitude") && sessionStorage.getItem("Longitude") ? (
<div>
<p>Latitude: {sessionStorage.getItem("Latitude")}</p>
<p>Longitude: {sessionStorage.getItem("Longitude")}</p>
{setIsNextButtonDisabled(false)} {/* Enable the "Next" button */}
</div>
) : (
<div>
<p style={{ color: 'red' }}>Please upload a Photo with Location details.</p>
{setIsNextButtonDisabled(true)} {/* Disable the "Next" button */}
</div>
)
)}

</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import Modal from 'react-modal';
import jsPDF from 'jspdf';
import { SubmitBar } from '@upyog/digit-ui-react-components';
import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom";
import Axios from "axios";
import Urls from '../../../../../../libraries/src/services/atoms/urls';




Expand Down Expand Up @@ -44,9 +42,24 @@
const architectid = data?.applicationData?.additionalDetails?.architectid
const architecttype = data?.applicationData?.additionalDetails?.typeOfArchitect
const TimeStamp = otpVerifiedTimestamp;

const ulbselection = data?. applicationData?.additionalDetails?.Ulblisttype === "Municipal Corporation" ? "Commissioner" : "Executive Officer"

const updatedAdditionalDetails = {
...data?.applicationData?.additionalDetails,
TimeStamp: otpVerifiedTimestamp,
};

// Update the entire data object with the new additionalDetails
const updatedData = {
...data,
applicationData: {
...data?.applicationData,
additionalDetails: updatedAdditionalDetails,
},
};




const selfdeclarationform =
`
Expand Down Expand Up @@ -120,7 +133,7 @@
try {
setIsUploading(true); // Set isUploading to true before starting the upload

let result = await Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(), { Bpa: [data] }, "ownerconsent");
let result = await Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(), { Bpa: [updatedData] }, "ownerconsent");

if (result?.filestoreIds[0]?.length > 0) {
alert("File Uploaded Successfully");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
2. jsPDF for downloading the PDF
*/
import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import Modal from 'react-modal';
import { useLocation } from "react-router-dom";
import { SubmitBar } from '@upyog/digit-ui-react-components';
Expand All @@ -32,7 +32,7 @@
const user = Digit.UserService.getUser();
const architecname = user?.info?.name;
const architectmobileNumber = user?.info.mobileNumber
const [params] = Digit.Hooks.useSessionStorage("BUILDING_PERMIT", state?.edcrNumber ? { data: { scrutinyNumber: { edcrNumber: state?.edcrNumber } } } : {});
const [params, setParams] = Digit.Hooks.useSessionStorage("BUILDING_PERMIT", state?.edcrNumber ? { data: { scrutinyNumber: { edcrNumber: state?.edcrNumber } } } : {});
const [isUploading, setIsUploading] = useState(false); // it will check whether the file upload is in process or not
const [isFileUploaded, setIsFileUploaded] = useState(false);
const architectid = params?.additionalDetails?.architectid;
Expand All @@ -49,7 +49,18 @@
const TimeStamp = otpVerifiedTimestamp;



useEffect(() => {
if (params?.additionalDetails && !params.additionalDetails.TimeStamp) {
setParams(prevParams => ({
...prevParams,
additionalDetails: {
...prevParams.additionalDetails,
TimeStamp: otpVerifiedTimestamp
}
}));
}
}, [params, otpVerifiedTimestamp, setParams]);


const selfdeclarationform =
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,13 @@ function selectfile(e) {
<Row className="border-none" label={t(`BPA_BUILDING_STATUS_LABEL`)} text={owners?.buildingStatus?.code || value?.additionalDetails?.buildingStatus || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_CORE_AREA_LABEL`)} text={datafromAPI?.planDetail?.coreArea || value?.additionalDetails?.coreArea || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_PROPOSED_SITE_LABEL`)} text={owners?.proposedSite?.code || value?.additionalDetails?.proposedSite || t("CS_NA")} />
{owners?.schemes?.code === "SCHEME" && (
<React.Fragment>
<Row className="border-none" label={t(`BPA_SCHEME_TYPE_LABEL`)} text={owners?.schemesselection?.value || value?.additionalDetails?.schemesselection || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_SCHEME_NAME_LABEL`)} text={owners?.schemeName || value?.additionalDetails?.schemeName || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_TRANFERRED_SCHEME_LABEL`)} text={owners?.transferredscheme || value?.additionalDetails?.transferredscheme || t("CS_NA")} />
</React.Fragment>
)}
<Row className="border-none" label={t(`BPA_PURCHASED_FAR_LABEL`)} text={owners?.purchasedFAR?.code || value?.additionalDetails?.purchasedFAR || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_MASTER_PLAN_LABEL`)} text={owners?.masterPlan?.code || value?.additionalDetails?.masterPlan || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_GREEN_BUILDING_LABEL`)} text={owners?.greenbuilding?.code || value?.additionalDetails?.greenbuilding || t("CS_NA")} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

@Component
@Slf4j
Expand Down Expand Up @@ -54,11 +56,24 @@ public List<BPA> extractData(ResultSet rs) throws SQLException, DataAccessExcept
Object additionalDetails = new Gson().fromJson(rs.getString("additionalDetails").equals("{}")
|| rs.getString("additionalDetails").equals("null") ? null : rs.getString("additionalDetails"),
Object.class);

AuditDetails auditdetails = AuditDetails.builder().createdBy(rs.getString("bpa_createdBy"))
.createdTime(rs.getLong("bpa_createdTime")).lastModifiedBy(rs.getString("bpa_lastModifiedBy"))
.lastModifiedTime(lastModifiedTime).build();

JsonObject jsonObject = new Gson().fromJson(
rs.getString("additionalDetails").equals("{}") || rs.getString("additionalDetails").equals("null") ? "{}" : rs.getString("additionalDetails"),
JsonObject.class
);

String riskType = null;
if (jsonObject.has("riskType")) {
JsonElement riskTypeElement = jsonObject.get("riskType");
if (riskTypeElement != null && !riskTypeElement.isJsonNull()) {
riskType = riskTypeElement.getAsString();
}
}
//String riskType = new Gson().fromJson(rs.getString("additionalDetails").equals("{}") || rs.getString("additionalDetails").equals("null") ? "{}" : rs.getString("additionalDetails"), JsonObject.class).get("riskType").getAsString();

currentbpa = BPA.builder()
.auditDetails(auditdetails)
Expand All @@ -74,6 +89,7 @@ public List<BPA> extractData(ResultSet rs) throws SQLException, DataAccessExcept
.id(id)
.additionalDetails(additionalDetails)
.businessService(rs.getString("businessService"))
.riskType(riskType)
.build();

buildingMap.put(id, currentbpa);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ else if (!ocBpas.get(0).getStatus().equalsIgnoreCase(BPAConstants.STATUS_APPROVE
criteria.setEdcrNumber(ocBpas.get(0).getEdcrNumber());
ocService.validateAdditionalData(bpaRequest, criteria);
bpaRequest.getBPA().setLandInfo(ocBpas.get(0).getLandInfo());

}
}

Expand Down Expand Up @@ -524,6 +525,7 @@ else if (!bpas.get(0).getStatus().equalsIgnoreCase(BPAConstants.STATUS_APPROVED)
}

additionalDetails.put("landId", bpas.get(0).getLandId());
additionalDetails.put("riskType", bpas.get(0).getRiskType());
criteria.setEdcrNumber(bpas.get(0).getEdcrNumber());
ocService.validateAdditionalData(bpaRequest, criteria);
bpaRequest.getBPA().setLandInfo(bpas.get(0).getLandInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public void enrichBPACreateRequest(BPARequest bpaRequest, Object mdmsData, Map<S
AuditDetails auditDetails = bpaUtil.getAuditDetails(requestInfo.getUserInfo().getUuid(), true);
bpaRequest.getBPA().setAuditDetails(auditDetails);
bpaRequest.getBPA().setId(UUID.randomUUID().toString());
Map<String, String> additionalDetails = bpaRequest.getBPA().getAdditionalDetails() != null
? (Map<String, String>) bpaRequest.getBPA().getAdditionalDetails()
: new HashMap<String, String>();

bpaRequest.getBPA().setAccountId(bpaRequest.getBPA().getAuditDetails().getCreatedBy());
String applicationType = values.get(BPAConstants.APPLICATIONTYPE);
Expand All @@ -116,7 +119,11 @@ public void enrichBPACreateRequest(BPARequest bpaRequest, Object mdmsData, Map<S
if (bpaRequest.getBPA().getLandInfo() != null) {
bpaRequest.getBPA().setLandId(bpaRequest.getBPA().getLandInfo().getId());
}
// BPA Documents
if (bpaRequest.getBPA().getRiskType() != null) {
additionalDetails.put(BPAConstants.RISKTYPE, bpaRequest.getBPA().getRiskType());
}

// BPA Documents
if (!CollectionUtils.isEmpty(bpaRequest.getBPA().getDocuments()))
bpaRequest.getBPA().getDocuments().forEach(document -> {
if (document.getId() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class BPAConstants {
public static final String BPA_BusinessService = "BPA";

public static final String BPA_MODULE_CODE = "BPA";

public static final String RISKTYPE = "riskType";

public static final String BPA_LOW_MODULE_CODE = "BPA_LOW";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ private void setFieldsFromSearch(BPARequest bpaRequest, List<BPA> searchResult,
bpaRequest.getBPA().getAuditDetails()
.setCreatedTime(idToBPAFromSearch.get(bpaRequest.getBPA().getId()).getAuditDetails().getCreatedTime());
bpaRequest.getBPA().setStatus(idToBPAFromSearch.get(bpaRequest.getBPA().getId()).getStatus());

}


Expand Down Expand Up @@ -645,5 +646,9 @@ public void validateApplication(BPARequest bpaRequest)
throw new CustomException(null,"Designer/Supervisor can apply for area less then 500 sq. yards. in self declaration");

}
if (obj.get("riskType")!= null )
{
obj.put("riskType", bpaRequest.getBPA().getRiskType());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public TLRepository(JdbcTemplate jdbcTemplate, TLQueryBuilder queryBuilder, TLRo
public List<TradeLicense> getLicenses(TradeLicenseSearchCriteria criteria) {
List<Object> preparedStmtList = new ArrayList<>();
String query = queryBuilder.getTLSearchQuery(criteria, preparedStmtList,false);
log.info("Query is" +query);
log.info("Prepared Statement List is" +preparedStmtList);
List<TradeLicense> licenses = jdbcTemplate.query(query, preparedStmtList.toArray(), rowMapper);
sortChildObjectsById(licenses);
return licenses;
Expand Down

0 comments on commit f61c262

Please sign in to comment.