Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sterlite_custom_reports
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
suryakant
sterlite_custom_reports
Commits
01bb1207
Commit
01bb1207
authored
Oct 13, 2023
by
suryakant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Query Update
parent
60eb2c4e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
180 deletions
+165
-180
scripts/constants/__init__.py
scripts/constants/__init__.py
+1
-1
scripts/core/db/postgres/custom_report_query.py
scripts/core/db/postgres/custom_report_query.py
+155
-176
scripts/core/handler/event_handler.py
scripts/core/handler/event_handler.py
+4
-3
scripts/template/sterlite_report_template.py
scripts/template/sterlite_report_template.py
+5
-0
No files found.
scripts/constants/__init__.py
View file @
01bb1207
...
...
@@ -53,7 +53,7 @@ class CommonConstants:
FREQUENCY
=
'D'
START_COLUMN
=
0
START_ROW
=
2
OVERALL_COLUMN_WIDTH
=
2
5
OVERALL_COLUMN_WIDTH
=
2
7
class
ReportType
:
...
...
scripts/core/db/postgres/custom_report_query.py
View file @
01bb1207
This diff is collapsed.
Click to expand it.
scripts/core/handler/event_handler.py
View file @
01bb1207
...
...
@@ -174,7 +174,6 @@ class CustomReportHandler:
logger
.
info
(
"Iterating through each block to create a dataframe"
)
# Iterate through the categories and concatenate their data
# print(input_json)
for
category
,
category_data
in
input_json
.
items
():
data
=
category_data
.
get
(
'data'
,
[])
...
...
@@ -235,8 +234,10 @@ class CustomReportHandler:
start_row
=
CommonConstants
.
START_ROW
total_column
=
0
workbook
=
writer
.
book
sheet_name
=
each_date_range
[
CommonConstants
.
DAY_START_DATE
]
sheet_name
=
datetime
.
strptime
(
each_date_range
[
CommonConstants
.
DAY_START_DATE
],
"
%
Y-
%
m-
%
d"
)
.
\
strftime
(
"
%
d
%
b
%
Y"
)
worksheet
=
None
# Iterating over sterlite json file
...
...
scripts/template/sterlite_report_template.py
View file @
01bb1207
...
...
@@ -177,11 +177,16 @@ class SterliteRefineryTemplate:
"query"
:
{
"AcpCcpcCcp"
:
[
SterliteRefineryQuery
.
AcpCcpcCcp
.
QUERY_1
,
SterliteRefineryQuery
.
AcpCcpcCcp
.
QUERY_2
,
SterliteRefineryQuery
.
AcpCcpcCcp
.
QUERY_3
,
]
},
"data"
:
[],
"data_column"
:
[
"rm_anode_receipt_details"
,
"on_date"
,
"mtd"
,
"ytd"
],
"addition"
:
{
"primary"
:
"rm_anode_receipt_details"
}
},
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment