Skip to content

Commit

Permalink
Merge pull request #790 from odisha-muktasoft/ifms_adapter_LTS_Upgrade
Browse files Browse the repository at this point in the history
Rebased the code with digit works
  • Loading branch information
manastanmay-eGov authored Dec 11, 2024
2 parents efcdd5f + a6077ea commit 3bbb42f
Show file tree
Hide file tree
Showing 146 changed files with 1,003 additions and 2,831 deletions.
13 changes: 6 additions & 7 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ config:
- work-dir: "reference-adapters/ifms-adapter/src/main/resources/db"
image-name: "ifms-adapter-db"

- name: "builds/mukta_impl/reference-adapters/sms-adapter"
build:
- work-dir: "reference-adapters/sms-adapter"
dockerfile: "build/maven/Dockerfile"
image-name: "sms-adapter"

# mukta
- name: "builds/mukta_impl/mukta/mukta-contracts"
build:
Expand Down Expand Up @@ -313,6 +307,11 @@ config:
build:
- work-dir: "backend/egov-notification-sms"
image-name: "egov-notification-sms"
dockerfile: "build/maven-java17/Dockerfile"
dockerfile: "build/maven-java17/Dockerfile"
- name: "builds/mukta_impl/reference-adapters/sms-adapter"
build:
- work-dir: "reference-adapters/sms-adapter"
dockerfile: "build/maven-java17/Dockerfile"
image-name: "sms-adapter"


54 changes: 21 additions & 33 deletions reference-adapters/ifms-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

<groupId>org.egov</groupId>
<artifactId>ifms-adapter</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>

<properties>
<java.version>1.8</java.version>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<log4j2.version>2.17.1</log4j2.version>
<postgresql.version>42.3.3</postgresql.version>
<lombok.version>1.18.22</lombok.version>
</properties>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.13.RELEASE</version>
<version>3.2.2</version>
</parent>

<dependencies>
Expand Down Expand Up @@ -60,37 +60,28 @@
<dependency>
<groupId>org.egov.services</groupId>
<artifactId>tracer</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.egov.services</groupId>
<artifactId>services-common</artifactId>
<version>1.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.egov.services</groupId>
<artifactId>digit-models</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>2.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.egov</groupId>
<artifactId>mdms-client</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.egov.common</groupId>
<artifactId>health-services-common</artifactId>
<version>1.0.11-SNAPSHOT</version>
<version>2.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.egov.common</groupId>
<artifactId>health-services-models</artifactId>
<version>1.0.6-SNAPSHOT</version>
<version>1.0.22-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
Expand All @@ -100,33 +91,30 @@
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>9.22.3</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<version>1.18.30</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.egov</groupId>
<artifactId>enc-client</artifactId>
<version>2.0.5-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.egov.services</groupId>
<artifactId>tracer</artifactId>
</exclusion>
</exclusions>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.egov.works</groupId>
<artifactId>works-services-common</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package org.egov;

import org.egov.tracer.config.TracerConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@Import({TracerConfiguration.class})
@SpringBootApplication
//@ComponentScan(basePackages = {"org.egov.config", "org.egov.kafka", "org.egov", "org.egov.web"})
public class IFMSAdapterMain {

public static void main(String args[]) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package org.egov.config;

import jakarta.annotation.PostConstruct;
import lombok.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;


@Configuration
@Component
@Data
Expand Down Expand Up @@ -48,6 +51,16 @@ public class IfmsAdapterConfig {
@Value("${egov.mdms.search.endpoint}")
private String mdmsEndPoint;

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

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

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

// bill
@Value("${egov.bill.host}")
private String billHost;
Expand Down Expand Up @@ -166,4 +179,31 @@ public class IfmsAdapterConfig {

@Value("${ifix.adapter.es.error.queue.topic}")
private String ifixAdapterESErrorQueueTopic;

@Value("${ifms.jit.mock.enabled}")
private Boolean ifmsJitMockEnabled;

@Value("${ifms.jit.mock.mdms.master.name}")
private String ifmsJitMockMdmsMasterName;

@Value("${ifms.jit.mock.enabled.tenants}")
private String ifmsJitMockEnabledTenants;

private String[] ifmsMockEnabledTenantsIds;

@Value("${original.pi.expire.days}")
private Integer originalExpireDays;

@Value("${original.pi.expire.financial.year.date}")
private Integer originalExpireFinancialYearDate;

@Value("${original.pi.expire.financial.year.month}")
private Integer originalExpireFinancialYearMonth;

@PostConstruct
public void init() {
if (ifmsJitMockEnabled && !StringUtils.isEmpty(ifmsJitMockEnabledTenants)) {
ifmsMockEnabledTenantsIds = ifmsJitMockEnabledTenants.split(",");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,25 @@

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

import org.egov.tracer.config.TracerConfiguration;
import org.egov.tracer.config.TracerProperties;
import org.egov.tracer.http.RestTemplateLoggingInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.http.client.*;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.util.CollectionUtils;

import org.springframework.web.client.RestTemplate;

import javax.annotation.PostConstruct;
import javax.net.ssl.*;
import java.net.HttpURLConnection;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;

import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import java.util.TimeZone;

@Slf4j
Expand All @@ -54,15 +43,6 @@ public ObjectMapper ifmsObjectMapper() {
return objectMapper;
}

// @Bean
// @Primary
// public RestTemplate restTemplate(TracerProperties tracerProperties) {
// SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
// requestFactory.setOutputStreaming(false);
// RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory));
// restTemplate.setInterceptors(Collections.singletonList(new RestTemplateLoggingInterceptor(tracerProperties)));
// return restTemplate;
// }

/**
* It will disable ssl certification check
Expand Down Expand Up @@ -112,4 +92,4 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM
converter.setObjectMapper(objectMapper);
return converter;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import digit.models.coremodels.AuditDetails;
import lombok.extern.slf4j.Slf4j;
import net.minidev.json.JSONArray;
import org.egov.common.contract.models.AuditDetails;
import org.egov.common.contract.request.RequestInfo;
import org.egov.common.contract.request.User;
import org.egov.common.models.individual.Individual;
Expand All @@ -17,11 +17,15 @@
import org.egov.utils.*;
import org.egov.web.models.Disbursement;
import org.egov.web.models.DisbursementRequest;
import org.egov.web.models.bankaccount.BankAccount;
import org.egov.web.models.bill.*;
import org.egov.web.models.bill.PaymentRequest;
import org.egov.web.models.enums.*;
import org.egov.web.models.jit.*;
import org.egov.web.models.organisation.Organisation;
import org.egov.works.services.common.models.bankaccounts.BankAccount;
import org.egov.works.services.common.models.expense.Bill;
import org.egov.works.services.common.models.expense.BillDetail;
import org.egov.works.services.common.models.expense.LineItem;
import org.egov.works.services.common.models.expense.Party;
import org.egov.works.services.common.models.organization.Organisation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand Down Expand Up @@ -331,21 +335,6 @@ private JSONArray sortHoaList(JSONArray hoaList) {
return hoaList;
}

private List<Beneficiary> getBeneficiaryListFromBill(Bill bill) {
List<Beneficiary> piBeneficiaryList = new ArrayList<>();
for (BillDetail billDetail: bill.getBillDetails()) {
for (LineItem lineItem: billDetail.getPayableLineItems()) {
if (lineItem.getStatus().equals(Status.ACTIVE)) {
Beneficiary piBeneficiary = Beneficiary.builder()
.benefId(billDetail.getPayee().getIdentifier())
.benfAmount(lineItem.getAmount().toString())
.build();
piBeneficiaryList.add(piBeneficiary);
}
}
}
return piBeneficiaryList;
}

public void enrichBankaccountOnBeneficiary(List<Beneficiary> beneficiaryList, List<BankAccount> bankAccounts, List<Individual> individuals, List<Organisation> organisations) {
log.info("Started executing enrichBankaccountOnBeneficiary");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import digit.models.coremodels.AuditDetails;
import lombok.extern.slf4j.Slf4j;
import org.egov.common.contract.models.AuditDetails;
import org.egov.common.contract.request.RequestInfo;
import org.egov.utils.HelperUtil;
import org.egov.web.models.Allocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,20 @@
import org.egov.repository.querybuilder.PIQueryBuilder;
import org.egov.repository.rowmapper.PIRowMapper;
import org.egov.utils.HelperUtil;
import org.egov.web.models.Pagination;
import org.egov.web.models.enums.PIStatus;
import org.egov.web.models.enums.PaymentStatus;
import org.egov.web.models.jit.*;
import org.egov.works.services.common.models.expense.enums.PaymentStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;

import static org.egov.repository.querybuilder.PIQueryBuilder.*;

@Repository
@Slf4j
public class PIRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import digit.models.coremodels.AuditDetails;
import lombok.extern.slf4j.Slf4j;
import org.egov.common.contract.models.AuditDetails;
import org.egov.tracer.model.CustomException;
import org.egov.web.models.jit.ExecutedVALog;
import org.postgresql.util.PGobject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import digit.models.coremodels.AuditDetails;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.egov.common.contract.models.AuditDetails;
import org.egov.tracer.model.CustomException;
import org.egov.web.models.enums.BeneficiaryPaymentStatus;
import org.egov.web.models.enums.BeneficiaryType;
Expand Down
Loading

0 comments on commit 3bbb42f

Please sign in to comment.