Skip to content

Commit

Permalink
Develop to master works v1.1 (#1776)
Browse files Browse the repository at this point in the history
* set limit to null (#1748)

* set limit to null

* removed workflow util

* revert pagination limit

* set limit to null in bank accounts

* Updated coderabit config for develop (#1754)

Co-authored-by: Shailesh Pandey <[email protected]>

* PFM-5342 muster roll cherry pick (#1739)

* PFM-5342 muster roll changes for sor migration

* PFM-5342 added mdmsV2 host

* PFM-4167-Rate analysis pdf (#1765)

* PFM-4167-Rate analysis pdf transformation

* added code for pdf

* Added logic for pdf creation

* changed host

* Update config.js

* changed end points

* changed name

* changed context path

* c

* added sorting of data for pdf

* added sorting of data for pdf

* added sorting of data for pdf

* added not null tenant id criteria

* added round off in amount

* added round off in amount

* added round off in amount

* added round off in amount

* added round off in amount

* Pfm 4167 rate analysis pdf (#1766)

* PFM-4167-Rate analysis pdf transformation

* added code for pdf

* Added logic for pdf creation

* changed host

* Update config.js

* changed end points

* changed name

* changed context path

* c

* added sorting of data for pdf

* added sorting of data for pdf

* added sorting of data for pdf

* added not null tenant id criteria

* added round off in amount

* added round off in amount

* added round off in amount

* added round off in amount

* added round off in amount

* added localization modules

* Pfm 5343 labour migration cherry pick (#1740)

* PFM-5343 Service changes to fetch rate from sor

* PFM-5343 Changes rate details as a list in sor details

* PFM-5343 added exceptions

* PFM-5343 added mdms v2 host

* changed validation time to string

* PFM-5342 worflow model change

* Updated version for works 1.1 relese (#1774)

Co-authored-by: shailesh-egov <[email protected]>

* Master to develop sync (#1775)

* HLM-5539, 5361: updated attendance module, updated individual search … (#1746)

* HLM-5539, 5361: updated attendance module, updated individual search parameters

* Update CHANGELOG.md

* Update pom.xml

* Update CHANGELOG.md

---------

Co-authored-by: kavi_elrey@1993 <[email protected]>

* added rate analysis (#1747)

* added redis config in disbursement (#1736)

* added redis config in disbursement

* added redis config in disbursement

* added redis config in disbursement

* added already created validation in consumer

* Update DisbursementService.java

Added functionality of saving pi in db beffore sending it to jit

* Fixed shown disburement amount in pi

Fixed shown disburement amount in pi

* Update RedisService.java

Added some log for redis

* Update DisbursementService.java

saved pi details before calling to JIT

* added caching to check weather payment is already processed

* added caching to check weather payment is already processed

* Added test payment create and added better error handling in ifms

* Added test payment create and added better error handling in ifms

* Fixed issue of on disburse

* rollback ifms service

* added caching to check weather payment is already processed

* removed ssl certification

* removed ssl

* added caching to check weather payment is already processed

* Added error queue in ifms adapter.

* fixed sort order in disburse query

* Added queue for error

* fixed disburse enrich

* fixed on-disburse

* fixed on-disburse

* fixed disburse mukta ref id

* fixed pi search

* fixed disburse search

* fixed disburse search

* fixed disburse search

---------

Co-authored-by: Shailesh Pandey <[email protected]>

* Update build-config.yml (#1751)

* Updated coderabit config for master (#1753)

Co-authored-by: Shailesh Pandey <[email protected]>

* HLM lts updated flyway for health attendance (#1749)

* HLM 2.9lts updated flyway for health attendance

* Update pom.xml

* Updated CHANGELOG.md

* Updated CHANGELOG.md, added flyway migration update changelog

* Update backend/attendance/CHANGELOG.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: kavi_elrey@1993 <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Hcm lts master flyway imageupdate (#1764)

* HLM 2.9lts updated flyway for health attendance

* Update pom.xml

* Updated CHANGELOG.md

* Updated CHANGELOG.md, added flyway migration update changelog

* HLM added first staff insert check to validate the attendee for hcm use case

---------

Co-authored-by: kavi_elrey@1993 <[email protected]>

---------

Co-authored-by: kanishq-egov <[email protected]>
Co-authored-by: kavi_elrey@1993 <[email protected]>
Co-authored-by: ansh-egov <[email protected]>
Co-authored-by: Shailesh Pandey <[email protected]>
Co-authored-by: manastanmay-eGov <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Lokendra-egov <[email protected]>
Co-authored-by: ansh-egov <[email protected]>
Co-authored-by: Shailesh Pandey <[email protected]>
Co-authored-by: shailesh-egov <[email protected]>
Co-authored-by: kanishq-egov <[email protected]>
Co-authored-by: kavi_elrey@1993 <[email protected]>
Co-authored-by: manastanmay-eGov <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
9 people authored Jul 25, 2024
1 parent c20992b commit 3292733
Show file tree
Hide file tree
Showing 28 changed files with 947 additions and 405 deletions.
2 changes: 1 addition & 1 deletion backend/bankaccounts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>bankaccounts</artifactId>
<packaging>jar</packaging>
<name>bankaccounts</name>
<version>0.1.3</version>
<version>0.1.4</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
177 changes: 0 additions & 177 deletions backend/bankaccounts/src/main/java/org/egov/util/WorkflowUtil.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
public class Pagination {

@JsonProperty("limit")
@DecimalMax("100")
private Double limit = 10d;
// @DecimalMax("100")
private Double limit = null;

@JsonProperty("offSet")
private Double offSet = 0d;
Expand Down
2 changes: 1 addition & 1 deletion backend/expense-calculator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<artifactId>expense-calculator</artifactId>
<packaging>jar</packaging>
<name>expense-calculator</name>
<version>2.0.0</version>
<version>2.0.1</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public class ExpenseCalculatorConfiguration {
@Value("${egov.mdms.search.endpoint}")
private String mdmsEndPoint;

@Value("${egov.mdms.v2.host}")
private String mdmsV2Host;

@Value("${egov.mdms.v2.search.endpoint}")
private String mdmsV2EndPoint;

// MusterRoll
@Value("${egov.musterroll.host}")
private String musterRollHost;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,7 @@
import org.egov.digit.expense.calculator.util.MdmsUtils;
import org.egov.digit.expense.calculator.util.ProjectUtil;
import org.egov.digit.expense.calculator.validator.ExpenseCalculatorServiceValidator;
import org.egov.digit.expense.calculator.web.models.ApplicableCharge;
import org.egov.digit.expense.calculator.web.models.Bill;
import org.egov.digit.expense.calculator.web.models.BillMapper;
import org.egov.digit.expense.calculator.web.models.BillMetaRecords;
import org.egov.digit.expense.calculator.web.models.BillResponse;
import org.egov.digit.expense.calculator.web.models.BusinessService;
import org.egov.digit.expense.calculator.web.models.Calculation;
import org.egov.digit.expense.calculator.web.models.CalculationRequest;
import org.egov.digit.expense.calculator.web.models.CalculatorSearchCriteria;
import org.egov.digit.expense.calculator.web.models.CalculatorSearchRequest;
import org.egov.digit.expense.calculator.web.models.Contract;
import org.egov.digit.expense.calculator.web.models.Criteria;
import org.egov.digit.expense.calculator.web.models.HeadCode;
import org.egov.digit.expense.calculator.web.models.LabourCharge;
import org.egov.digit.expense.calculator.web.models.MusterRoll;
import org.egov.digit.expense.calculator.web.models.MusterRollRequest;
import org.egov.digit.expense.calculator.web.models.Payer;
import org.egov.digit.expense.calculator.web.models.PurchaseBill;
import org.egov.digit.expense.calculator.web.models.PurchaseBillRequest;
import org.egov.digit.expense.calculator.web.models.Workflow;
import org.egov.digit.expense.calculator.web.models.CalcEstimate;
import org.egov.digit.expense.calculator.web.models.*;
import org.egov.tracer.model.CustomException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -100,11 +80,11 @@ public Calculation calculateEstimates(CalculationRequest calculationRequest) {
Criteria criteria = calculationRequest.getCriteria();

if (criteria.getMusterRollId() != null && !criteria.getMusterRollId().isEmpty()) {
// Fetch wage seeker skills from MDMS
List<LabourCharge> labourCharges = fetchMDMSDataForLabourCharges(requestInfo, criteria.getTenantId());
// Fetch all the approved muster rolls for provided muster Ids
List<MusterRoll> musterRolls = fetchApprovedMusterRolls(requestInfo, criteria, false);
return wageSeekerBillGeneratorService.calculateEstimates(requestInfo, criteria.getTenantId(), musterRolls, labourCharges);
// Fetch wage seeker skills from MDMS
List<SorDetail> sorDetails = fetchMDMSDataForLabourCharges(requestInfo, criteria.getTenantId(), musterRolls);
return wageSeekerBillGeneratorService.calculateEstimates(requestInfo, criteria.getTenantId(), musterRolls, sorDetails);
} else {
List<Bill> bills = fetchBills(requestInfo, criteria.getTenantId(), criteria.getContractId());
//TODO: Add check for empty bill list here and send back a response
Expand Down Expand Up @@ -235,14 +215,15 @@ public List<Bill> createWageOrSupervisionBills(CalculationRequest calculationReq

private List<Bill> createWageBill(RequestInfo requestInfo, Criteria criteria, Map<String, String> metaInfo) {
log.info("Create wage bill for musterRollIds :"+criteria.getMusterRollId() );
// Fetch wage seeker skills from MDMS
List<LabourCharge> labourCharges = fetchMDMSDataForLabourCharges(requestInfo, criteria.getTenantId());
// Fetch musterRolls for given muster roll IDs
List<MusterRoll> musterRolls = fetchApprovedMusterRolls(requestInfo,criteria,true);
// Fetch wage seeker skills from MDMS
// List<LabourCharge> labourCharges = fetchMDMSDataForLabourCharges(requestInfo, criteria.getTenantId(), musterRolls);
List<SorDetail> sorDetails = fetchMDMSDataForLabourCharges(requestInfo, criteria.getTenantId(), musterRolls);
// Contract project mapping
Map<String, String> contractProjectMapping = getContractProjectMapping(musterRolls);
metaInfo.putAll(contractProjectMapping);
return wageSeekerBillGeneratorService.createWageSeekerBills(requestInfo,musterRolls,labourCharges,metaInfo);
return wageSeekerBillGeneratorService.createWageSeekerBills(requestInfo,musterRolls,sorDetails,metaInfo);
}

private List<Bill> createSupervisionBill(RequestInfo requestInfo, Criteria criteria, Map<String, String> metaInfo) {
Expand Down Expand Up @@ -304,8 +285,8 @@ public void createAndPostWageSeekerBill(MusterRollRequest musterRollRequest){
Map<String, String> context = new HashMap<>();
context.putAll(contractProjectMapping);
// Fetch wage seeker skills from MDMS
List<LabourCharge> labourCharges = fetchMDMSDataForLabourCharges(requestInfo, musterRoll.getTenantId());
List<Bill> wageSeekerBills = wageSeekerBillGeneratorService.createWageSeekerBills(requestInfo,Collections.singletonList(musterRoll),labourCharges,context);
List<SorDetail> sorDetails = fetchMDMSDataForLabourCharges(requestInfo, musterRoll.getTenantId(), Collections.singletonList(musterRoll));
List<Bill> wageSeekerBills = wageSeekerBillGeneratorService.createWageSeekerBills(requestInfo,Collections.singletonList(musterRoll),sorDetails,context);
BillResponse billResponse = null;
Workflow workflow = Workflow.builder()
.action(WF_SUBMIT_ACTION_CONSTANT)
Expand Down Expand Up @@ -343,17 +324,51 @@ private BillResponse postUpdateBill(RequestInfo requestInfo, Bill bill, Workflow
return billUtils.postUpdateBill(requestInfo, bill, workflow);
}

private List<LabourCharge> fetchMDMSDataForLabourCharges(RequestInfo requestInfo, String tenantId){
private List<SorDetail> fetchMDMSDataForLabourCharges(RequestInfo requestInfo, String tenantId, List<MusterRoll> musterRolls){
log.info("Fetch wage seeker skills MDMS");
Object mdmsData = mdmsUtils.fetchMDMSDataForLabourCharges(requestInfo, tenantId);
List<Object> labourChargesJson = commonUtil.readJSONPathValue(mdmsData, JSON_PATH_FOR_LABOUR_CHARGES);
List<LabourCharge> labourCharges = new ArrayList<>();
for(Object obj : labourChargesJson){
LabourCharge labourCharge = mapper.convertValue(obj, LabourCharge.class);
labourCharges.add(labourCharge);
// Object mdmsData = mdmsUtils.fetchMDMSDataForLabourCharges(requestInfo, tenantId);
List<String> sorList = getLabourSorFromMusterRolls(musterRolls);
if (sorList.isEmpty()) {
throw new CustomException("SOR_NOT_FOUND", "No sor found in additional details of muster roll");
}
Object sorFromMDMSV2 = mdmsUtils.getLabourSorFromMDMSV2(requestInfo, tenantId, sorList, false);
List<Object> sorListJson = commonUtil.readJSONPathValue(sorFromMDMSV2, JSON_PATH_FOR_SOR);
List<SorDetail> sorDetails = new ArrayList<>();
for(Object obj : sorListJson){
SorDetail sorDetail = mapper.convertValue(obj, SorDetail.class);
sorDetails.add(sorDetail);
}
List<String> sorIds = sorDetails.stream().map(SorDetail::getId).collect(Collectors.toList());
if (sorIds.isEmpty()) {
throw new CustomException("NO_SOR_FOUND", "No sor found in mdms");
}
Object ratesFromMDMV2 = mdmsUtils.getLabourSorFromMDMSV2(requestInfo, tenantId, sorIds, true);
List<Object> rateListJson = commonUtil.readJSONPathValue(ratesFromMDMV2, JSON_PATH_FOR_RATES);
List<RateDetail> rateDetails = new ArrayList<>();
for(Object obj : rateListJson){
RateDetail rateDetail = mapper.convertValue(obj, RateDetail.class);
rateDetails.add(rateDetail);
}
for (RateDetail rateDetail : rateDetails) {
for (SorDetail sorDetail : sorDetails) {
if (rateDetail.getSorId().equalsIgnoreCase(sorDetail.getId())) {
if (sorDetail.getRateDetails() == null) {
sorDetail.setRateDetails(new ArrayList<>());
sorDetail.getRateDetails().add(rateDetail);
} else {
sorDetail.getRateDetails().add(rateDetail);
}
}
}
}
// List<Object> labourChargesJson = commonUtil.readJSONPathValue(mdmsData, JSON_PATH_FOR_LABOUR_CHARGES);
// List<LabourCharge> labourCharges = new ArrayList<>();
// for(Object obj : labourChargesJson){
// LabourCharge labourCharge = mapper.convertValue(obj, LabourCharge.class);
// labourCharges.add(labourCharge);
// }
log.info("Wage seeker skills fetched from MDMS");
return labourCharges;
return sorDetails;
}

public List<MusterRoll> fetchApprovedMusterRolls(RequestInfo requestInfo, Criteria criteria, boolean onlyApproved) {
Expand Down Expand Up @@ -444,5 +459,20 @@ private List<BusinessService> fetchMDMSDataForBusinessService(RequestInfo reques
log.info("Business Service fetched from MDMS");
return businessServices;
}

private List<String> getLabourSorFromMusterRolls (List<MusterRoll> musterRolls) {
List<IndividualEntry> individualEntries = musterRolls.stream().map(musterRoll -> musterRoll.getIndividualEntries()).flatMap(List::stream).collect(Collectors.toList());
// List<String> sorList = individualEntries.stream().filter(individualEntries -> individualEntries.getAdditionalDetails() != null && individualEntries.getAdditionalDetails().get("sor") != null).map(individualEntries -> (String) individualEntries.getAdditionalDetails().get("sor")).collect(Collectors.toList());
return individualEntries.stream() // Stream<IndividualEntry>
.filter(entry -> {
Map<String, Object> additionalDetails = (Map<String, Object>) entry.getAdditionalDetails(); // Cast to Map<String, Object>
return additionalDetails != null && additionalDetails.get("skillCode") != null;
})
.map(entry -> {
Map<String, Object> additionalDetails = (Map<String, Object>) entry.getAdditionalDetails(); // Cast to Map<String, Object>
return (String) additionalDetails.get("skillCode");
})
.collect(Collectors.toList());
}

}
Loading

0 comments on commit 3292733

Please sign in to comment.