Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

MDMS-v2 Change for ws-services-calculation #656

Open
wants to merge 2 commits into
base: naljal-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ public class WSCalculationConfiguration {

@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;

@Value("${egov.bill.gen.endpoint}")
private String billGenerateEndpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class MasterDataService {

/**
* Fetches and creates map of all required masters
*
*
* @param requestInfo The calculation request
* @param tenantId Tenant Id
* @param serviceFieldValue Service Field value
Expand Down Expand Up @@ -120,7 +120,7 @@ public List<TaxHeadMaster> getTaxHeadMasterMap(RequestInfo requestInfo, String t
public void setWaterConnectionMasterValues(RequestInfo requestInfo, String tenantId,
Map<String, JSONArray> billingSlabMaster, Map<String, JSONArray> timeBasedExemptionMasterMap) {

MdmsResponse response = mapper.convertValue(repository.fetchResult(calculatorUtils.getMdmsSearchUrl(),
MdmsResponse response = mapper.convertValue(repository.fetchResult(calculatorUtils.getMdmsv2SearchUrl(),
calculatorUtils.getWaterConnectionModuleRequest(requestInfo, tenantId)), MdmsResponse.class);
Map<String, JSONArray> res = response.getMdmsRes().get(WSCalculationConstant.WS_TAX_MODULE);
for (Entry<String, JSONArray> entry : res.entrySet()) {
Expand All @@ -145,7 +145,7 @@ public void setWaterConnectionMasterValues(RequestInfo requestInfo, String tenan
public void loadBillingSlabsAndTimeBasedExemptions(RequestInfo requestInfo, String tenantId,
Map<String, Object> masterMap) {

MdmsResponse response = mapper.convertValue(repository.fetchResult(calculatorUtils.getMdmsSearchUrl(),
MdmsResponse response = mapper.convertValue(repository.fetchResult(calculatorUtils.getMdmsv2SearchUrl(),
calculatorUtils.getWaterConnectionModuleRequest(requestInfo, tenantId)), MdmsResponse.class);
Map<String, JSONArray> res = response.getMdmsRes().get(WSCalculationConstant.WS_TAX_MODULE);
for (Entry<String, JSONArray> entry : res.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public StringBuilder getMdmsSearchUrl() {
return new StringBuilder().append(calculationConfig.getMdmsHost()).append(calculationConfig.getMdmsEndPoint());
}

public StringBuilder getMdmsv2SearchUrl() {
return new StringBuilder().append(calculationConfig.getMdmsv2Host()).append(calculationConfig.getMdmsv2Endpoint());
}

/**
* Prepares and returns Mdms search request with financial master criteria
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ egov.meterservice.createmeterconnection=save-ws-meter
egov.mdms.host=http://localhost:8094/
egov.mdms.search.endpoint=egov-mdms-service/v1/_search

#mdms v2 urls
egov.mdms-v2.host=http://mdms-v2.mgramseva:8080/
egov.mdms-v2.search.endpoint=mdms-v2/v2/_search

# KAFKA SERVER CONFIGURATIONS
kafka.config.bootstrap_server_config=localhost:9092
spring.kafka.consumer.value-deserializer=org.egov.tracer.kafka.deserializer.HashMapDeserializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public class MDMSValidator {
@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;

@Autowired
private MasterDataService masterDataService;

Expand Down Expand Up @@ -98,7 +104,12 @@ public void validateMasterDataForUpdateConnection(WaterConnectionRequest request

public Map<String, List<String>> getAttributeValues(String tenantId, String moduleName, List<String> names,
String filter, String jsonPath, RequestInfo requestInfo) {
StringBuilder uri = new StringBuilder(mdmsHost).append(mdmsEndpoint);
StringBuilder uri= null;
if(moduleName.equals(WCConstants.WS_TAX_MODULE)) {
uri=new StringBuilder(mdmsv2Host).append(mdmsv2Endpoint);
} else {
uri=new StringBuilder(mdmsHost).append(mdmsEndpoint);
}
MdmsCriteriaReq criteriaReq = waterServicesUtil.prepareMdMsRequest(tenantId, moduleName, names, filter,
requestInfo);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ egov.property.searchendpoint=property-services/property/_search
egov.mdms.host=http://localhost:8094/
egov.mdms.search.endpoint=egov-mdms-service/v1/_search

#mdms v2 urls
egov.mdms-v2.host=http://mdms-v2.mgramseva:8080/
egov.mdms-v2.search.endpoint=mdms-v2/v2/_search

# KAFKA SERVER CONFIGURATIONS
kafka.config.bootstrap_server_config=localhost:9092
spring.kafka.consumer.value-deserializer=org.egov.tracer.kafka.deserializer.HashMapDeserializer
Expand Down