05/03/2025 - 18h

master
cherif 2025-03-05 19:17:34 +01:00
parent e0ec298f25
commit 1a1688df44
5 changed files with 2495 additions and 30 deletions

View File

@ -1,18 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="27/02/2025 - 21h"> <list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="04/03/2025 - 21h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Job_Cron.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Job_Cron.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/formulaire_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/formulaire_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/module_editique.py" beforeDir="false" afterPath="$PROJECT_DIR$/module_editique.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -83,13 +77,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680804787304</updated> <updated>1680804787304</updated>
</task> </task>
<task id="LOCAL-00392" summary="06/09/2024 - 22h">
<created>1725652418352</created>
<option name="number" value="00392" />
<option name="presentableId" value="LOCAL-00392" />
<option name="project" value="LOCAL" />
<updated>1725652418354</updated>
</task>
<task id="LOCAL-00393" summary="08/09/2024 - 21h"> <task id="LOCAL-00393" summary="08/09/2024 - 21h">
<created>1725823501100</created> <created>1725823501100</created>
<option name="number" value="00393" /> <option name="number" value="00393" />
@ -426,7 +413,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1740681801061</updated> <updated>1740681801061</updated>
</task> </task>
<option name="localTasksCounter" value="441" /> <task id="LOCAL-00441" summary="04/03/2025 - 21h">
<created>1741113044248</created>
<option name="number" value="00441" />
<option name="presentableId" value="LOCAL-00441" />
<option name="project" value="LOCAL" />
<updated>1741113044249</updated>
</task>
<option name="localTasksCounter" value="442" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -468,7 +462,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="08/12/2024 - 12h" />
<MESSAGE value="10/12/2024 - 22h" /> <MESSAGE value="10/12/2024 - 22h" />
<MESSAGE value="14/12/2024 - 14h" /> <MESSAGE value="14/12/2024 - 14h" />
<MESSAGE value="24/12/2024 - 22h" /> <MESSAGE value="24/12/2024 - 22h" />
@ -493,6 +486,7 @@
<MESSAGE value="11/02/2025 - 21h" /> <MESSAGE value="11/02/2025 - 21h" />
<MESSAGE value="18/02/2025 - 21h" /> <MESSAGE value="18/02/2025 - 21h" />
<MESSAGE value="27/02/2025 - 21h" /> <MESSAGE value="27/02/2025 - 21h" />
<option name="LAST_COMMIT_MESSAGE" value="27/02/2025 - 21h" /> <MESSAGE value="04/03/2025 - 21h" />
<option name="LAST_COMMIT_MESSAGE" value="04/03/2025 - 21h" />
</component> </component>
</project> </project>

View File

@ -1162,6 +1162,7 @@ def Cron_Daily_Automatic_Qualiopi_Documents():
if (data_automatic_traitement["actif"] == "1" and data_automatic_traitement["valide"] == "1" and data_automatic_traitement["statut"] != "2"): if (data_automatic_traitement["actif"] == "1" and data_automatic_traitement["valide"] == "1" and data_automatic_traitement["statut"] != "2"):
print(" # Analyse Document = ", str(data_automatic_traitement['nom_document'])) print(" # Analyse Document = ", str(data_automatic_traitement['nom_document']))
print(" # Target Date = ", data_automatic_traitement['action_target_date'])
print(" # Nb jour action = ", data_automatic_traitement['nb_jour_action']) print(" # Nb jour action = ", data_automatic_traitement['nb_jour_action'])
print(" # Date du jour = ", str(todays_date)) print(" # Date du jour = ", str(todays_date))
@ -1174,19 +1175,33 @@ def Cron_Daily_Automatic_Qualiopi_Documents():
continue continue
local_session_start_date = datetime.strptime(str(my_session['date_debut']).strip(), '%d/%m/%Y') local_session_start_date = datetime.strptime(str(my_session['date_debut']).strip(), '%d/%m/%Y')
local_session_start_date_added_nb_jour_action = local_session_start_date + timedelta(days=nb_jour_action_Int) local_session_end_date = datetime.strptime(str(my_session['date_fin']).strip(), '%d/%m/%Y')
local_session_start_date_added_nb_jour_action_formated = str(local_session_start_date_added_nb_jour_action.strftime("%d/%m/%Y")) local_session_target_date_added_nb_jour_action = ""
local_session_target_date_added_nb_jour_action_formated = ""
print(" ### CMP 1 local_session_start_date_added_nb_jour_action = ", local_session_start_date_added_nb_jour_action)
if( data_automatic_traitement['action_target_date'] == "start_session"):
local_session_target_date_added_nb_jour_action = local_session_start_date + timedelta(days=nb_jour_action_Int)
local_session_target_date_added_nb_jour_action_formated = str(local_session_target_date_added_nb_jour_action.strftime("%d/%m/%Y"))
elif( data_automatic_traitement['action_target_date'] == "end_session"):
local_session_target_date_added_nb_jour_action = local_session_end_date + timedelta(days=nb_jour_action_Int)
local_session_target_date_added_nb_jour_action_formated = str(local_session_target_date_added_nb_jour_action.strftime("%d/%m/%Y"))
print(" ### CMP 1 local_session_target_date_added_nb_jour_action = ", local_session_target_date_added_nb_jour_action)
print(" ### CMP 2 datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') = ", print(" ### CMP 2 datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') = ",
datetime.strptime(str(todays_date).strip(), '%d/%m/%Y')) datetime.strptime(str(todays_date).strip(), '%d/%m/%Y'))
print(" ### delta day = ", datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') - local_session_start_date ) if (data_automatic_traitement['action_target_date'] == "start_session"):
print(" ### delta day (start_session) = ", datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') - local_session_start_date )
if (data_automatic_traitement['action_target_date'] == "end_session"):
print(" ### delta day (end_session) = ", datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') - local_session_end_date )
if (local_session_start_date_added_nb_jour_action > datetime.strptime(str(todays_date).strip(), '%d/%m/%Y')): if (local_session_target_date_added_nb_jour_action > datetime.strptime(str(todays_date).strip(), '%d/%m/%Y')):
print(" ### SUPPPPPP : Action à faire dans le futur ") print(" ### SUPPPPPP : Action à faire dans le futur ")
elif (local_session_start_date_added_nb_jour_action < datetime.strptime(str(todays_date).strip(), '%d/%m/%Y')): elif (local_session_target_date_added_nb_jour_action < datetime.strptime(str(todays_date).strip(), '%d/%m/%Y')):
print(" ### INFFFFFF : Alert il y a un pb sur une action non realiser ") print(" ### INFFFFFF : Alert il y a un pb sur une action non realiser ")
mycommon.myprint(str( mycommon.myprint(str(
inspect.stack()[0][ inspect.stack()[0][
@ -1203,12 +1218,12 @@ def Cron_Daily_Automatic_Qualiopi_Documents():
node_notification = {} node_notification = {}
node_notification['message'] = "Warning : Il y a une tâche automatique qui n'a pas été exécutée " \ node_notification['message'] = "Warning : Il y a une tâche automatique qui n'a pas été exécutée " \
" Date Initialement prévue "+str(local_session_start_date_added_nb_jour_action_formated)+ " -- " \ " Date Initialement prévue "+str(local_session_target_date_added_nb_jour_action_formated)+ " -- " \
" Action : "+str(courrier_template_type_document_data['ref_interne']) " Action : "+str(courrier_template_type_document_data['ref_interne'])
node_notification['status'] = "Warning " node_notification['status'] = "Warning "
diction_for_notification_email['tab_message'].append(node_notification) diction_for_notification_email['tab_message'].append(node_notification)
elif (local_session_start_date_added_nb_jour_action == datetime.strptime(str(todays_date).strip(), '%d/%m/%Y')): elif (local_session_target_date_added_nb_jour_action == datetime.strptime(str(todays_date).strip(), '%d/%m/%Y')):
""" """
Effectuer l'action Effectuer l'action

View File

@ -1675,8 +1675,6 @@ def Cron_Send_Survey_TabIds(diction):
"params": convention_dictionnary_data "params": convention_dictionnary_data
} }
html = contenu_doc_Template.render(params=body["params"]) html = contenu_doc_Template.render(params=body["params"])
subject_doc_Template = jinja2.Template(str(courrier_template_data['sujet'])) subject_doc_Template = jinja2.Template(str(courrier_template_data['sujet']))

File diff suppressed because it is too large Load Diff

View File

@ -13972,7 +13972,8 @@ def Update_SessionFormation_Doc_Automatic_Setup(diction):
# Ici on doit mettre tous les champs possible (obligatoire ou non) de la BDD dans la liste # Ici on doit mettre tous les champs possible (obligatoire ou non) de la BDD dans la liste
# field_list. # field_list.
''' '''
field_list = ['token', '_id', 'nb_jour_action', 'actif', 'courrier_template_type_document_id'] field_list = ['token', '_id', 'nb_jour_action', 'actif', 'courrier_template_type_document_id',
'action_target_date']
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
@ -13984,7 +13985,8 @@ def Update_SessionFormation_Doc_Automatic_Setup(diction):
""" """
Verification de la liste des champs obligatoires Verification de la liste des champs obligatoires
""" """
field_list_obligatoire = ['token', '_id', 'nb_jour_action', 'actif', 'courrier_template_type_document_id'] field_list_obligatoire = ['token', '_id', 'nb_jour_action', 'actif', 'courrier_template_type_document_id',
'action_target_date']
for val in field_list_obligatoire: for val in field_list_obligatoire:
if val not in diction: if val not in diction:
@ -14015,12 +14017,19 @@ def Update_SessionFormation_Doc_Automatic_Setup(diction):
3]) + " Le status (actif/inactif) est invalide ") 3]) + " Le status (actif/inactif) est invalide ")
return False, " Le status (actif/inactif) est invalide " return False, " Le status (actif/inactif) est invalide "
action_target_date = diction['action_target_date']
if (action_target_date not in ['start_session', 'end_session']):
mycommon.myprint(str(
inspect.stack()[0][
3]) + " La valeur du champ 'action_target_date' est invalide ")
return False, " La valeur du champ 'action_target_date' est invalide "
data_for_check_connexion = {'token': my_token} data_for_check_connexion = {'token': my_token}
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(data_for_check_connexion) local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(data_for_check_connexion)
if (local_status is not True): if (local_status is not True):
return local_status, my_partner return local_status, my_partner
""" """
Verifier la valididé de la session de formation Verifier la valididé de la session de formation
""" """
@ -14082,6 +14091,8 @@ def Update_SessionFormation_Doc_Automatic_Setup(diction):
'automatic_traitement.$[xxx].nb_jour_action': str(nb_jour_action), 'automatic_traitement.$[xxx].nb_jour_action': str(nb_jour_action),
'automatic_traitement.$[xxx].date_update': str(datetime.now()), 'automatic_traitement.$[xxx].date_update': str(datetime.now()),
'automatic_traitement.$[xxx].update_by': str(my_partner['_id']), 'automatic_traitement.$[xxx].update_by': str(my_partner['_id']),
'automatic_traitement.$[xxx].action_target_date': str(action_target_date),
} }
}, },
upsert=False, upsert=False,