31/07/2024 - 17h30

master
cherif 2024-07-31 17:34:25 +02:00
parent b5d25d91eb
commit 14d36514ef
8 changed files with 6758 additions and 40 deletions

View File

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="29/07/2024 - 21h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="30/07/2024 - 12h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dashbord_queries/factures_tbd_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/factures_tbd_qries.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_qries.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -77,13 +79,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00313" summary="gdfgdf">
<created>1716732752643</created>
<option name="number" value="00313" />
<option name="presentableId" value="LOCAL-00313" />
<option name="project" value="LOCAL" />
<updated>1716732752644</updated>
</task>
<task id="LOCAL-00314" summary="26/05/2024 - 20h30">
<created>1716748087881</created>
<option name="number" value="00314" />
@ -420,7 +415,14 @@
<option name="project" value="LOCAL" />
<updated>1722279870244</updated>
</task>
<option name="localTasksCounter" value="362" />
<task id="LOCAL-00362" summary="30/07/2024 - 12h">
<created>1722338918391</created>
<option name="number" value="00362" />
<option name="presentableId" value="LOCAL-00362" />
<option name="project" value="LOCAL" />
<updated>1722338918392</updated>
</task>
<option name="localTasksCounter" value="363" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -462,7 +464,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="17/06/2024 - 21h30" />
<MESSAGE value="18/06/2024 - 21h30" />
<MESSAGE value="ss" />
<MESSAGE value="21/06/24 - 22h30" />
@ -487,6 +488,7 @@
<MESSAGE value="26/07/2024 - 12h" />
<MESSAGE value="29/07/2024 - 12h" />
<MESSAGE value="29/07/2024 - 21h" />
<option name="LAST_COMMIT_MESSAGE" value="29/07/2024 - 21h" />
<MESSAGE value="30/07/2024 - 12h" />
<option name="LAST_COMMIT_MESSAGE" value="30/07/2024 - 12h" />
</component>
</project>

View File

@ -857,7 +857,7 @@ def Get_Qery_List_Factures_Data_By_Client_V2(diction):
"""
tab_data = []
for retval in MYSY_GV.dbname['partner_invoice_header'].aggregate(pipe_qry):
print(" ### retval ici pipe_qry = ", retval)
#print(" ### retval ici pipe_qry = ", retval)
val_tmp = val_tmp + 1

View File

@ -401,7 +401,7 @@ def Get_Qery_Inscription_By_Session_By_Periode(diction):
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])}, {"valide": '1'},
{"apprenant_id": {"$exists": True}},
{"inscription_validation_date": {"$exists": True}},
{"inscription_validation_date": {"$exists": True, '$ne': ""}},
{"status": "1"},
{'mysy_inscription_validation_date': {'$gte': filt_session_start_date_ISODATE,
'$lte': filt_session_end_date_ISODATE}},
@ -678,7 +678,7 @@ def Get_Qery_Inscription_By_Session_By_Periode_cumule(diction):
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])}, {"valide": '1'},
{"apprenant_id": {"$exists": True}},
{"inscription_validation_date": {"$exists": True}},
{"inscription_validation_date": {"$exists": True, '$ne': ""}},
{"status": "1"},
{'mysy_inscription_validation_date': {'$gte': filt_session_start_date_ISODATE,
'$lte': filt_session_end_date_ISODATE}},
@ -810,7 +810,7 @@ def Get_Qery_Inscription_By_Session_By_Periode_cumule(diction):
},
"""
print(" ### Get_Qery_Inscription_By_Session_By_Periode ici pipe_qry = ", pipe_qry)
print(" ### Get_Qery_Inscription_By_Session_By_Periode_cumule ici pipe_qry = ", pipe_qry)
axis_data = []
cpt = 0
@ -959,7 +959,7 @@ def Get_Qery_Inscription_Group_By_Class(diction):
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])}, {"valide": '1'},
{"apprenant_id": {"$exists": True}},
{"inscription_validation_date": {"$exists": True}},
{"inscription_validation_date": {"$exists": True, '$ne': ""}},
{"status": "1"},
{'mysy_inscription_validation_date': {'$gte': filt_session_start_date_ISODATE,
'$lte': filt_session_end_date_ISODATE}},
@ -1094,7 +1094,7 @@ def Get_Qery_Inscription_Group_By_Class(diction):
},
"""
print(" ### Get_Qery_Inscription_By_Session_By_Periode ici pipe_qry = ", pipe_qry)
print(" ### Get_Qery_Inscription_Group_By_Class ici pipe_qry = ", pipe_qry)
axis_data = []
my_data = []
@ -1245,7 +1245,7 @@ def Get_Qery_Inscription_Group_By_Session(diction):
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])}, {"valide": '1'},
{"apprenant_id": {"$exists": True}},
{"inscription_validation_date": {"$exists": True}},
{"inscription_validation_date": {"$exists": True, '$ne': ""}},
{"status": "1"},
{'mysy_inscription_validation_date': {'$gte': filt_session_start_date_ISODATE,
'$lte': filt_session_end_date_ISODATE}},

View File

@ -7408,8 +7408,11 @@ def Get_Statgaire_List_Partner_with_filter(diction):
'foreignField': 'internal_url',
'pipeline': [{'$match':{ '$and' : [ filt_class_title, filt_class_partner_recid] } }, {'$project': {'title': 1, 'domaine': 1,
'duration': 1,
'duration_unit': 1, '_id':1,
'recyclage_delai':1, 'recyclage_periodicite':1}}],
'duration_unit': 1,
'_id':1,
'recyclage_delai':1,
'recyclage_periodicite':1,
'recyclage_alert':1}}],
'as': 'myclass_collection'
}
},
@ -7644,6 +7647,7 @@ def Get_Statgaire_List_Partner_with_filter(diction):
"""
val['class_recyclage_delai'] = ""
val['class_recyclage_periodicite'] = ""
val['class_recyclage_alert'] = ""
val['nb_jour_avant_recyclage'] = ""
val['warning_recyclage'] = "0"
@ -7657,9 +7661,12 @@ def Get_Statgaire_List_Partner_with_filter(diction):
if ("recyclage_periodicite" in retVal['myclass_collection'][0].keys()):
val['class_recyclage_periodicite'] = retVal['myclass_collection'][0]['recyclage_periodicite']
if ("recyclage_alert" in retVal['myclass_collection'][0].keys()):
val['class_recyclage_alert'] = retVal['myclass_collection'][0]['recyclage_alert']
if (str(val['class_recyclage_delai']) != "" and str(val['class_recyclage_periodicite']) != ""):
if (str(val['class_recyclage_delai']) != "" and str(val['class_recyclage_periodicite']) != "" and str(val['class_recyclage_alert']) != "" ):
session_date_debut = str(session_retval['date_debut'])[0:10]
session_date_debut_datetime = datetime.strptime(str(session_date_debut).strip(), '%d/%m/%Y')
if (str(val['class_recyclage_periodicite']) == "mois"):
@ -7676,9 +7683,9 @@ def Get_Statgaire_List_Partner_with_filter(diction):
local_delta = session_date_debut_datetime - mytoday_datetime
val['nb_jour_avant_recyclage'] = str(local_delta.days)
if( recyclage_warning == "1" ):
if( local_delta.days < mycommon.tryInt(str(recyclage_warning_lead_time)) ):
val['warning_recyclage'] = "1"
if( local_delta.days < mycommon.tryInt(str(val['class_recyclage_alert'])) ):
val['warning_recyclage'] = "1"
@ -7686,7 +7693,8 @@ def Get_Statgaire_List_Partner_with_filter(diction):
/!\ : 28/12/2023 - update
S'il y a de la data dans la collection 'apprenant_collection' cela veut dire qu'il y a un dossier apprenant,
alors on va plutot retourner les info qui sont dans cette collection
"""
/!\ 31/07/2024 - annulation de la recheche de l'apprenant
if ('apprenant_collection' in retVal.keys() and len( retVal['apprenant_collection']) > 0):
if ("civilite" in retVal['apprenant_collection'][0].keys()):
val['civilite'] = str(retVal['apprenant_collection'][0]['civilite']).lower()
@ -7768,11 +7776,11 @@ def Get_Statgaire_List_Partner_with_filter(diction):
else:
val['pays'] = ""
"""
RetObject.append(mycommon.JSONEncoder().encode(val))
print(" ### RetObject = ", str(RetObject))
#print(" ### RetObject = ", str(RetObject))
return True, RetObject
except Exception as e:

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,7 @@ def add_class(diction):
'programme', 'prerequis', 'note', 'cpf', 'certif', 'class_inscription_url', 'pourqui',
'support', 'img_banner_detail_class', 'source', 'lms_class_code', 'formateur_id',
'class_level', 'methode_pedagogique', 'condition_handicape', 'suivi_eval', 'class_id',
'version', 'categorie', 'recyclage_delai', 'recyclage_periodicite']
'version', 'categorie', 'recyclage_delai', 'recyclage_periodicite', 'recyclage_alert']
incom_keys = diction.keys()
for val in incom_keys:
@ -232,6 +232,22 @@ def add_class(diction):
mydata['recyclage_delai'] = str(recyclage_delai)
recyclage_alert = ""
if ("recyclage_alert" in diction.keys()):
if diction['recyclage_alert']:
recyclage_alert = diction['recyclage_alert']
local_status, local_retval = mycommon.IsInt(str(recyclage_alert))
if( local_status is False ):
mycommon.myprint(str(
inspect.stack()[0][
3]) + " Le delai d'alerte de recyclage n'est pas valide ")
return False, " Le delai d'alerte de recyclage n'est pas valide ", False
recyclage_alert = local_retval
mydata['recyclage_alert'] = str(recyclage_alert)
recyclage_periodicite = ""
if ("recyclage_periodicite" in diction.keys()):
if diction['recyclage_periodicite']:
@ -741,7 +757,7 @@ def update_class(diction):
'cpf', 'certif', 'class_inscription_url','pourqui', 'support', 'img_banner_detail_class',
'duration_unit', 'source', 'lms_class_code', 'formateur_id', 'class_level','methode_pedagogique',
'condition_handicape', 'suivi_eval', 'class_id', 'version', 'categorie', 'recyclage_delai',
'recyclage_periodicite']
'recyclage_periodicite', 'recyclage_alert']
incom_keys = diction.keys()
for val in incom_keys:
@ -832,6 +848,20 @@ def update_class(diction):
mydata['recyclage_delai'] = str(recyclage_delai)
if ("recyclage_alert" in diction.keys()):
recyclage_alert = ""
if diction['recyclage_alert']:
recyclage_alert = diction['recyclage_alert']
local_status, local_retval = mycommon.IsInt(str(recyclage_alert))
if (local_status is False):
mycommon.myprint(str(
inspect.stack()[0][
3]) + " Le delai d'alerte de recyclage n'est pas valide ")
return False, " Le delai d'alerte de recyclage n'est pas valide ", False
recyclage_alert = local_retval
mydata['recyclage_alert'] = str(recyclage_alert)
if ("recyclage_periodicite" in diction.keys()):
recyclage_periodicite = ""
@ -2274,6 +2304,9 @@ def get_class(diction):
if( "recyclage_delai" not in user.keys()):
user['recyclage_delai'] = ""
if ("recyclage_alert" not in user.keys()):
user['recyclage_alert'] = ""
if ("recyclage_periodicite" not in user.keys()):
user['recyclage_periodicite'] = ""
@ -2385,6 +2418,9 @@ def get_class_coup_de_coeur(diction):
if ("recyclage_delai" not in user.keys()):
user['recyclage_delai'] = ""
if ("recyclage_alert" not in user.keys()):
user['recyclage_alert'] = ""
if ("recyclage_periodicite" not in user.keys()):
user['recyclage_periodicite'] = ""
@ -2605,6 +2641,9 @@ def get_partner_class(diction):
if ("recyclage_delai" not in retVal.keys()):
retVal['recyclage_delai'] = ""
if ("recyclage_alert" not in retVal.keys()):
retVal['recyclage_alert'] = ""
if ("recyclage_periodicite" not in retVal.keys()):
retVal['recyclage_periodicite'] = ""
@ -2888,6 +2927,10 @@ def find_partner_class_like(diction):
retVal['recyclage_delai'] = ""
if ("recyclage_alert" not in retVal.keys()):
retVal['recyclage_alert'] = ""
if ("recyclage_periodicite" not in retVal.keys()):
retVal['recyclage_periodicite'] = ""
@ -3150,6 +3193,9 @@ def get_partner_class_external_code(diction):
if ("recyclage_delai" not in user.keys()):
user['recyclage_delai'] = ""
if ("recyclage_alert" not in user.keys()):
user['recyclage_alert'] = ""
if ("recyclage_periodicite" not in user.keys()):
user['recyclage_periodicite'] = ""
@ -3306,7 +3352,8 @@ def add_class_mass(file=None, Folder=None, diction=None):
'mots_cle', 'zone_diffusion', 'metier', 'publie', 'img_url',
'objectif', 'programme', 'prerequis', 'formateur', 'note', 'cpf', 'certif',
'class_inscription_url', 'pourqui', 'support', 'img_banner_detail_class', 'formateur_email',
'methode_pedagogique', 'condition_handicape', 'suivi_eval', 'version', 'categorie', 'recyclage_delai', 'recyclage_periodicite']
'methode_pedagogique', 'condition_handicape', 'suivi_eval', 'version', 'categorie', 'recyclage_delai',
'recyclage_periodicite' 'recyclage_alert']
total_rows = len(df)
@ -3486,6 +3533,23 @@ def add_class_mass(file=None, Folder=None, diction=None):
mydata['recyclage_delai'] = str(recyclage_delai)
recyclage_alert = ""
if ("recyclage_alert" in diction.keys()):
if diction['recyclage_alert']:
recyclage_alert = diction['recyclage_alert']
local_status, local_retval = mycommon.IsInt(str(recyclage_alert))
if (local_status is False):
mycommon.myprint(str(
inspect.stack()[0][
3]) + " Le delai d'alerte de recyclage n'est pas valide ")
return False, " Le delai d'alerte de recyclage n'est pas valide "
recyclage_alert = local_retval
mydata['recyclage_alert'] = str(recyclage_alert)
recyclage_periodicite = ""
if ("recyclage_periodicite" in diction.keys()):
if diction['recyclage_periodicite']:
@ -3824,7 +3888,8 @@ def Controle_add_class_mass(saved_file=None, Folder=None, diction=None):
'mots_cle', 'zone_diffusion', 'metier', 'publie', 'img_url',
'objectif', 'programme', 'prerequis', 'formateur', 'note', 'cpf', 'certif',
'class_inscription_url', 'pourqui', 'support', 'img_banner_detail_class', 'formateur_email' ,'methode_pedagogique',
'condition_handicape', 'suivi_eval', 'version', 'categorie', 'recyclage_delai', 'recyclage_periodicite']
'condition_handicape', 'suivi_eval', 'version', 'categorie', 'recyclage_delai',
'recyclage_periodicite', 'recyclage_alert']
total_rows = len(df)
@ -3988,6 +4053,24 @@ def Controle_add_class_mass(saved_file=None, Folder=None, diction=None):
mydata['recyclage_delai'] = str(recyclage_delai)
recyclage_alert = ""
if ("recyclage_alert" in diction.keys()):
if diction['recyclage_alert']:
recyclage_alert = diction['recyclage_alert']
local_status, local_retval = mycommon.IsInt(str(recyclage_alert))
if (local_status is False):
mycommon.myprint(str(
inspect.stack()[0][
3]) + " Le delai d'alerte de recyclage n'est pas valide pour la formation à la ligne " + str(
n + 2) + " .")
return False, " Le delai d'alerte de recyclage n'est pas valide pour la formation à la ligne " + str(
n + 2) + " ."
recyclage_alert = local_retval
mydata['recyclage_alert'] = str(recyclage_alert)
recyclage_periodicite = ""
if ("recyclage_periodicite" in diction.keys()):
if diction['recyclage_periodicite']:
@ -4379,6 +4462,9 @@ def get_class_by_metier(diction):
if ("recyclage_delai" not in user.keys()):
user['recyclage_delai'] = ""
if ("recyclage_alert" not in user.keys()):
user['recyclage_alert'] = ""
if ("recyclage_periodicite" not in user.keys()):
user['recyclage_periodicite'] = ""
@ -5119,6 +5205,9 @@ def get_Class_From_Internal_Url(diction):
if ("recyclage_delai" not in user.keys()):
user['recyclage_delai'] = ""
if ("recyclage_alert" not in user.keys()):
user['recyclage_alert'] = ""
if ("recyclage_periodicite" not in user.keys()):
user['recyclage_periodicite'] = ""
val_tmp = val_tmp + 1
@ -5187,6 +5276,9 @@ def get_Class_From_Url(diction):
if ("recyclage_delai" not in user.keys()):
user['recyclage_delai'] = ""
if ("recyclage_alert" not in user.keys()):
user['recyclage_alert'] = ""
if ("recyclage_periodicite" not in user.keys()):
user['recyclage_periodicite'] = ""
user['id'] = str(val_tmp)

View File

@ -351,7 +351,7 @@ def update_user_account():
def create_class():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ",payload)
print(" ### create_class payload = ",payload)
status, retval, class_id = cm.add_class(payload)
return jsonify(status=status, message=retval, class_id=class_id)
@ -463,7 +463,7 @@ def update_class():
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### update_class payload = ",payload)
status, retval, class_id = cm.update_class(payload)
print(" ### class_id = ", class_id)
return jsonify(status=status, message=retval, class_id=class_id)
@ -4557,7 +4557,7 @@ API qui recupere la liste complete des stagaire d'un partener
def Get_Statgaire_List_Partner_with_filter():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Get_Statgaire_List_Partner payload = ",payload)
print(" ### Get_Statgaire_List_Partner_with_filter payload = ",payload)
status, retval = inscription.Get_Statgaire_List_Partner_with_filter(payload)
return jsonify(status=status, message=retval)

View File

@ -3161,7 +3161,7 @@ def GetAttendeeDetail_perSession(diction):
])
print(" ### GetAttendeeDetail_perSession ici pipe_qry = ",pipe_qry)
#print(" ### GetAttendeeDetail_perSession ici pipe_qry = ",pipe_qry)
# Recuperation des infos de la formation
"""local_Insc_retval = MYSY_GV.dbname['inscription'].find_one({'session_id':str(diction['session_id']),
'email':str(diction['attendee_email']),
@ -3171,7 +3171,7 @@ def GetAttendeeDetail_perSession(diction):
for local_Insc_retval in MYSY_GV.dbname['inscription'].aggregate(pipe_qry) :
print(" ### local_Insc_retval laa== ", local_Insc_retval)
#print(" ### local_Insc_retval laa== ", local_Insc_retval)
if( local_Insc_retval is None):
myprint(str(inspect.stack()[0][3]) + " - Impossible de récupérer le recid du partenaire (2)")
@ -3514,7 +3514,7 @@ def GetAttendeeDetail_perSession(diction):
S'il y a de la data dans la collection 'apprenant_collection' cela veut dire qu'il y a un dossier apprenant,
alors on va plutot retourner les info qui sont dans cette collection
"""
"""
if ('apprenant_collection' in local_Insc_retval.keys() and len( local_Insc_retval['apprenant_collection']) > 0):
print(" ### apprenant_collection = ", str(local_Insc_retval['apprenant_collection'][0]) )
if ("civilite" in local_Insc_retval['apprenant_collection'][0].keys()):
@ -3697,7 +3697,7 @@ def GetAttendeeDetail_perSession(diction):
else:
my_retrun_dict['tuteur2_include_com'] = ""
"""
RetObject.append(JSONEncoder().encode(my_retrun_dict))
return True, RetObject