05/03/2025 - 18h
parent
e0ec298f25
commit
1a1688df44
|
@ -1,18 +1,12 @@
|
|||
<?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="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$/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_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$/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>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -83,13 +77,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</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">
|
||||
<created>1725823501100</created>
|
||||
<option name="number" value="00393" />
|
||||
|
@ -426,7 +413,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1740681801061</updated>
|
||||
</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 />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -468,7 +462,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="08/12/2024 - 12h" />
|
||||
<MESSAGE value="10/12/2024 - 22h" />
|
||||
<MESSAGE value="14/12/2024 - 14h" />
|
||||
<MESSAGE value="24/12/2024 - 22h" />
|
||||
|
@ -493,6 +486,7 @@
|
|||
<MESSAGE value="11/02/2025 - 21h" />
|
||||
<MESSAGE value="18/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>
|
||||
</project>
|
31
Job_Cron.py
31
Job_Cron.py
|
@ -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"):
|
||||
|
||||
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(" # Date du jour = ", str(todays_date))
|
||||
|
||||
|
@ -1174,19 +1175,33 @@ def Cron_Daily_Automatic_Qualiopi_Documents():
|
|||
continue
|
||||
|
||||
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_start_date_added_nb_jour_action_formated = str(local_session_start_date_added_nb_jour_action.strftime("%d/%m/%Y"))
|
||||
local_session_end_date = datetime.strptime(str(my_session['date_fin']).strip(), '%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') = ",
|
||||
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 ")
|
||||
|
||||
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 ")
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
|
@ -1203,12 +1218,12 @@ def Cron_Daily_Automatic_Qualiopi_Documents():
|
|||
|
||||
node_notification = {}
|
||||
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'])
|
||||
node_notification['status'] = "Warning "
|
||||
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
|
||||
|
|
|
@ -1675,8 +1675,6 @@ def Cron_Send_Survey_TabIds(diction):
|
|||
"params": convention_dictionnary_data
|
||||
}
|
||||
|
||||
|
||||
|
||||
html = contenu_doc_Template.render(params=body["params"])
|
||||
|
||||
subject_doc_Template = jinja2.Template(str(courrier_template_data['sujet']))
|
||||
|
|
2447
Log/log_file.log
2447
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
# 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()
|
||||
for val in incom_keys:
|
||||
|
@ -13984,7 +13985,8 @@ def Update_SessionFormation_Doc_Automatic_Setup(diction):
|
|||
"""
|
||||
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:
|
||||
if val not in diction:
|
||||
|
@ -14015,12 +14017,19 @@ def Update_SessionFormation_Doc_Automatic_Setup(diction):
|
|||
3]) + " 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}
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(data_for_check_connexion)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
|
||||
"""
|
||||
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].date_update': str(datetime.now()),
|
||||
'automatic_traitement.$[xxx].update_by': str(my_partner['_id']),
|
||||
'automatic_traitement.$[xxx].action_target_date': str(action_target_date),
|
||||
|
||||
}
|
||||
},
|
||||
upsert=False,
|
||||
|
|
Loading…
Reference in New Issue