optimize and add new service of get report and download report.

This commit is contained in:
2026-04-03 12:10:47 +05:30
parent 0b72adef7d
commit 73cd97f3c8
27 changed files with 1416 additions and 1292 deletions

View File

@@ -0,0 +1,30 @@
class GeneralUse:
data=[]
@staticmethod
def execute_sp(cursor, proc_name, params=[], fetch_one=False):
cursor.callproc(proc_name, params)
return (
GeneralUse.fetch_one_result(cursor)
if fetch_one else
GeneralUse.fetch_all_results(cursor)
)
@staticmethod
def fetch_all_results(cursor):
data = []
for result in cursor.stored_results():
data = result.fetchall()
return data
@staticmethod
def fetch_one_result(cursor):
data = None
for result in cursor.stored_results():
data = result.fetchone()
return data