05/07/23 - 20h

master
cherif 2023-07-05 19:57:23 +02:00
parent c4e10a85f1
commit 91ed61726d
5 changed files with 2487 additions and 31 deletions

View File

@ -5,6 +5,8 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/data_indexees.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data_indexees.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

File diff suppressed because it is too large Load Diff

View File

@ -82,7 +82,7 @@ def Add_Update_SessionFormation(diction):
if ("class_internal_url" in diction.keys()):
mydata['class_internal_url'] = diction['class_internal_url']
class_internal_url = diction['class_internal_url']
query_key['class_internal_url'] = diction['code_session']
query_key['class_internal_url'] = diction['class_internal_url']
class_source = ""
if ("source" in diction.keys()):
@ -98,7 +98,7 @@ def Add_Update_SessionFormation(diction):
formation_session_id = ""
if ("formation_session_id" in diction.keys()):
mydata['formation_session_id'] = diction['formation_session_id']
session_id = diction['formation_session_id']
formation_session_id = diction['formation_session_id']
if ("date_debut" in diction.keys()):
@ -177,33 +177,33 @@ def Add_Update_SessionFormation(diction):
if (local_status is False):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - Impossible de créer/mettre à jour la session de formation. La date de debut n'est pas au format jj/mm/aaaa ")
3]) + " - Formation : "+str(formation_session_id)+" : Impossible de créer/mettre à jour la session de formation. La date de debut n'est pas au format jj/mm/aaaa ")
return False, " - Impossible de créer/mettre à jour la session de formation. La date de debut n'est pas au format jj/mm/aaaa "
return False, " - Formation : "+str(formation_session_id)+" : Impossible de créer/mettre à jour la session de formation. La date de debut n'est pas au format jj/mm/aaaa "
local_status = mycommon.CheckisDate(str(diction['date_fin'])[0:10])
if (local_status is False):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - Impossible de créer/mettre à jour la session de formation. La date de fin n'est pas au format jj/mm/aaaa ")
3]) + " -Formation : "+str(formation_session_id)+" : Impossible de créer/mettre à jour la session de formation. La date de fin n'est pas au format jj/mm/aaaa ")
return False, " - La date de fin n'est pas au format jj/mm/aaaa "
return False, " -Formation : "+str(formation_session_id)+" : La date de fin n'est pas au format jj/mm/aaaa "
local_status = mycommon.CheckisDate(str(diction['date_debut_inscription'])[0:10])
if (local_status is False):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - Impossible de créer/mettre à jour la session de formation. La date_debut_inscription n'est pas au format jj/mm/aaaa ")
3]) + " - Formation : "+str(formation_session_id)+" : Impossible de créer/mettre à jour la session de formation. La date_debut_inscription n'est pas au format jj/mm/aaaa ")
return False, " - La date de début d'inscription n'est pas au format jj/mm/aaaa "
return False, " -Formation : "+str(formation_session_id)+" : La date de début d'inscription n'est pas au format jj/mm/aaaa "
local_status = mycommon.CheckisDate(str(diction['date_fin_inscription'])[0:10])
if (local_status is False):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - La date de fin d'inscription n'est pas au format jj/mm/aaaa ")
3]) + " -Formation : "+str(formation_session_id)+" : La date de fin d'inscription n'est pas au format jj/mm/aaaa ")
return False, " - La date de fin d'inscription n'est pas au format jj/mm/aaaa "
return False, " - Formation : "+str(formation_session_id)+" :La date de fin d'inscription n'est pas au format jj/mm/aaaa "
@ -211,11 +211,11 @@ def Add_Update_SessionFormation(diction):
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - Impossible de créer/mettre à jour la session de formation : La date debut " + str(
3]) + " Formation : "+str(formation_session_id)+" : La date debut " + str(
diction['date_debut']) +
" est postérieure à la date de fin " + str(diction['date_fin']) )
return False, " Impossible de créer la session de formation : La date debut de formation " + str(diction['date_debut']) + \
return False, " Formation : "+str(formation_session_id)+" : La date debut de formation " + str(diction['date_debut']) + \
" est postérieure à la date de fin de formation " + str(diction['date_fin']) + " "
@ -223,11 +223,11 @@ def Add_Update_SessionFormation(diction):
str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y')):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - Impossible de créer/mettre à jour la session de formation : La date date_debut_inscription " + str(
3]) + " Formation : "+str(formation_session_id)+" : La date date_debut_inscription " + str(
diction['date_debut_inscription']) +
" est postérieure à la date de date_fin_inscription " + str(diction['date_fin_inscription']) )
return False, " Impossible de créer /mettre à jour la session de formation : La date_debut_inscription " + str(diction['date_debut_inscription']) + \
return False, " Formation : "+str(formation_session_id)+" : La date_debut_inscription " + str(diction['date_debut_inscription']) + \
" est postérieure à la date_fin_inscription " + str(diction['date_fin_inscription']) + " "
@ -236,21 +236,21 @@ def Add_Update_SessionFormation(diction):
if (datetime.strptime(str(diction['date_debut_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - La date de debut d'inscription " + str( diction['date_debut_inscription']) + " est postérieure à la date de fin de formation " + str(diction['date_fin']))
str(inspect.stack()[0][3]) + " -Formation : "+str(formation_session_id)+" : La date de debut d'inscription " + str( diction['date_debut_inscription']) + " est postérieure à la date de fin de formation " + str(diction['date_fin']))
return False, " La date de debut d'inscription " + str( diction['date_debut_inscription']) + " est postérieure à la date de fin de formation " + str(diction['date_fin'])+" "
return False, " Formation : "+str(formation_session_id)+" : La date de debut d'inscription " + str( diction['date_debut_inscription']) + " est postérieure à la date de fin de formation " + str(diction['date_fin'])+" "
# Verification : Date de fin inscription n'est pas > date de fin de formation
if (datetime.strptime(str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - La date de fin d'inscription " + str(
diction['date_fin_inscription']) + " est postérieure à la date de fin de formation " + str(
diction['date_fin']))
str(inspect.stack()[0][3]) + " -Formation : "+str(formation_session_id)+" : La date de fin d'inscription " + str(
diction['date_fin_inscription'])[0:10] + " est postérieure à la date de fin de la formation " + str(
diction['date_fin'])[0:10])
return False, " La date de fin d'inscription " + str(
diction['date_fin_inscription']) + " est postérieure à la date de fin de formation " + str(
diction['date_fin']) + " "
return False, " Formation : "+str(formation_session_id)+" : La date de fin d'inscription " + str(
diction['date_fin_inscription'])[0:10] + " est postérieure à la date de fin de la formation " + str(
diction['date_fin'])[0:10] + " "
"""
@ -268,7 +268,7 @@ def Add_Update_SessionFormation(diction):
# Fin Controle de cohérence sur les dates
#print(" ### query_key = ", query_key)
print(" ### query_key = ", query_key)
coll_name = MYSY_GV.dbname['session_formation']
ret_val = coll_name.find_one_and_update(
query_key,
@ -294,7 +294,11 @@ def Add_Update_SessionFormation(diction):
"""
Fonction de recuperation d'une session de formation
Fonction de recuperation d'une session de formation.
/!\ : il ne doit pas y avoir plus d'une session.
si le result > 1 une session, alors erreur d'inchorence d'info.
"""
def GetSessionFormation(diction):
@ -349,10 +353,17 @@ def GetSessionFormation(diction):
print(" ##### myquery = "+str(myquery))
RetObject = []
nb_val = 0
for retval in coll_session.find(myquery):
#print(" ##### retval = " + str(retval))
nb_val = nb_val + 1
RetObject.append(mycommon.JSONEncoder().encode(retval))
# Si le nombre de session trouvé est > 1 alors incohérence, retourner une message d'erreur
if( nb_val > 1 ):
mycommon.myprint(str(inspect.stack()[0][3]) + " - la query "+str(myquery)+" retourne "+str(nb_val)+" session. ceci n'est pas normal. il ne doit pas y avoir plus 1 session")
return False, " Les informations de la session "+str(formation_session_id)+" sont incohérentes. Merci de contacter le support"
return True, RetObject

View File

@ -1,4 +1,4 @@
,index,mots,occurence,moyenne,id_formation,source_field
0,0,donne,1,0.33,MYSY_Demo_001,title
1,1,base,1,0.33,MYSY_Demo_001,title
2,2,gestion,1,0.33,MYSY_Demo_001,title
0,0,integrative,1,0.33,MYSY_Test_AR,title
1,1,aromatherapie,1,0.33,MYSY_Test_AR,title
2,2,praticien,1,0.33,MYSY_Test_AR,title

1 index mots occurence moyenne id_formation source_field
2 0 0 donne integrative 1 0.33 MYSY_Demo_001 MYSY_Test_AR title
3 1 1 base aromatherapie 1 0.33 MYSY_Demo_001 MYSY_Test_AR title
4 2 2 gestion praticien 1 0.33 MYSY_Demo_001 MYSY_Test_AR title

View File

@ -1,4 +1,4 @@
mots occurence moyenne id_formation source_field
0 donne 1 0.33 MYSY_Demo_001 title
1 base 1 0.33 MYSY_Demo_001 title
2 gestion 1 0.33 MYSY_Demo_001 title
mots occurence moyenne id_formation source_field
0 integrative 1 0.33 MYSY_Test_AR title
1 aromatherapie 1 0.33 MYSY_Test_AR title
2 praticien 1 0.33 MYSY_Test_AR title