-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #794 from egovernments/ISTE-44-fix
ISTE-44: Added Table to check the update and create demand from ws-calculator
- Loading branch information
Showing
9 changed files
with
184 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../ws-calculator/src/main/java/org/egov/wscalculation/repository/DemandAuditSeqBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.egov.wscalculation.repository; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.jdbc.core.JdbcTemplate; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Component | ||
@Slf4j | ||
@Repository | ||
public class DemandAuditSeqBuilder { | ||
|
||
@Autowired | ||
private JdbcTemplate jdbcTemplate; | ||
|
||
public static final String SELECT_NEXT_SEQUENCE_USER = "select nextval('seq_eg_ws_demand_auditchange')"; | ||
|
||
public Long getNextSequence() { | ||
return jdbcTemplate.queryForObject(SELECT_NEXT_SEQUENCE_USER, Long.class); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...alculator/src/main/java/org/egov/wscalculation/web/models/WsDemandChangeAuditRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.egov.wscalculation.web.models; | ||
|
||
import lombok.*; | ||
|
||
import java.util.Map; | ||
|
||
import static org.apache.commons.lang3.StringUtils.isNotEmpty; | ||
|
||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
@ToString | ||
public class WsDemandChangeAuditRequest { | ||
private Long id; | ||
private String consumercode; | ||
private String tenant_id; | ||
private String status; | ||
private String action; | ||
private Object data; | ||
private String createdby; | ||
private Long createdtime; | ||
public boolean isValid() { | ||
|
||
return isNotEmpty(consumercode); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...or/src/main/java/org/egov/wscalculation/web/models/WsDemandChangeAuditRequestWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.egov.wscalculation.web.models; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import lombok.*; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
@ToString | ||
public class WsDemandChangeAuditRequestWrapper { | ||
|
||
@JsonProperty("WsDemandChangeAuditRequest") | ||
private WsDemandChangeAuditRequest wsDemandChangeAuditRequest; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...culator/src/main/resources/db/migration/ddl/V202405230601__wc_create_demand_audit_ddl.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE IF NOT EXISTS eg_ws_demand_auditchange ( | ||
id bigint NOT NULL, | ||
consumercode VARCHAR(30) NOT NULL, | ||
tenant_id VARCHAR(50), | ||
status VARCHAR(50), | ||
action VARCHAR(100), | ||
data JSONB, | ||
createdby VARCHAR(250), | ||
createdtime bigint | ||
|
||
); | ||
CREATE SEQUENCE seq_eg_ws_demand_auditchange | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
ALTER TABLE eg_ws_demand_auditchange ADD CONSTRAINT eg_ws_demand_auditchange_pkey PRIMARY KEY (id); |