parent
c871574e6a
commit
35db83eb12
|
@ -1,14 +1,13 @@
|
|||
<?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="30/04/2025 - 15h">
|
||||
<change afterPath="$PROJECT_DIR$/base_class_calcul_note.py" afterDir="false" />
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="02/05/2025 - 20h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Collection_Historique.py" beforeDir="false" afterPath="$PROJECT_DIR$/Collection_Historique.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.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$/equipe_team_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/equipe_team_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/base_class_calcul_note.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_class_calcul_note.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/note_evaluation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/note_evaluation_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -85,13 +84,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00401" summary="sdfsd">
|
||||
<created>1727693258457</created>
|
||||
<option name="number" value="00401" />
|
||||
<option name="presentableId" value="LOCAL-00401" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1727693258457</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00402" summary="sdfsdsdsd">
|
||||
<created>1727982203432</created>
|
||||
<option name="number" value="00402" />
|
||||
|
@ -428,7 +420,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1746039183867</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="450" />
|
||||
<task id="LOCAL-00450" summary="02/05/2025 - 20h">
|
||||
<created>1746211624600</created>
|
||||
<option name="number" value="00450" />
|
||||
<option name="presentableId" value="LOCAL-00450" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1746211624601</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="451" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -470,7 +469,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="sdfd" />
|
||||
<MESSAGE value="sdfdd" />
|
||||
<MESSAGE value="31/12/2024 - 12h30" />
|
||||
<MESSAGE value="03/01/2025 - 17h30" />
|
||||
|
@ -495,6 +493,7 @@
|
|||
<MESSAGE value="29/03/2025 - 21h" />
|
||||
<MESSAGE value="25/04/2025 - 15h" />
|
||||
<MESSAGE value="30/04/2025 - 15h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="30/04/2025 - 15h" />
|
||||
<MESSAGE value="02/05/2025 - 20h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="02/05/2025 - 20h" />
|
||||
</component>
|
||||
</project>
|
|
@ -7706,7 +7706,9 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
list_session_id = []
|
||||
if ("code_session" in diction.keys()):
|
||||
filt_code_session = {'code_session': {'$regex': str(diction['code_session']), "$options": "i"}}
|
||||
"""qry_list_session_id = { { '$and' :[ {'code_session': {'$regex': str(diction['code_session']), "$options": "i"}},
|
||||
|
||||
"""
|
||||
qry_list_session_id = { { '$and' :[ {'code_session': {'$regex': str(diction['code_session']), "$options": "i"}},
|
||||
{'partner_owner_recid': str(partner_recid)} ]}, {'_id':1}}
|
||||
"""
|
||||
|
||||
|
@ -7726,6 +7728,9 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
#print(" ### liste des Id des sessions eligible list_session_id = ", list_session_id)
|
||||
filt_session_id = {'session_id': {'$in': list_session_id, }}
|
||||
|
||||
|
||||
#print(" ### filt_session_id zzzzzzzzz = ", filt_session_id)
|
||||
|
||||
filt_class_title = {}
|
||||
if ("class_title" in diction.keys()):
|
||||
filt_class_title = {'title': {'$regex': str(diction['class_title']), "$options": "i"}}
|
||||
|
@ -7749,10 +7754,12 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
if ("client_rattachement_id" in diction.keys()):
|
||||
filt_client_rattachement_id = {'client_rattachement_id': str(diction['client_rattachement_id'])}
|
||||
|
||||
"""
|
||||
filt_session_id = {}
|
||||
if ("session_id" in diction.keys()):
|
||||
filt_session_id = {'session_id': str(diction['session_id'])}
|
||||
|
||||
"""
|
||||
#print(" ### filt_session_id 0222 zzzzzzzzz = ", filt_session_id)
|
||||
# -----
|
||||
|
||||
filt_client_nom = {}
|
||||
|
@ -7807,10 +7814,9 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
|
||||
]}}},
|
||||
], 'as': 'apprenant_collection'}}
|
||||
|
||||
|
||||
]
|
||||
#print("#### Get_Statgaire_List_Partner_with_filter laa 01 : query = ", query)
|
||||
|
||||
print("#### Get_Statgaire_List_Partner_with_filter laa 01 : query = ", query)
|
||||
RetObject = []
|
||||
cpt = 0
|
||||
for retVal in MYSY_GV.dbname['inscription'].aggregate(query):
|
||||
|
|
3556
Log/log_file.log
3556
Log/log_file.log
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
66
main.py
66
main.py
|
@ -10419,6 +10419,18 @@ def Update_Evaluation_Planification():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour Dupliquer une évaluation planifiée
|
||||
"""
|
||||
@app.route('/myclass/api/Duplicate_Evaluation_Planification/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Duplicate_Evaluation_Planification():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Duplicate_Evaluation_Planification payload = ",payload)
|
||||
status, retval = note_evaluation_mgt.Duplicate_Evaluation_Planification(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
@ -12157,15 +12169,59 @@ def Add_Update_Equipe_Team_Membres():
|
|||
|
||||
|
||||
"""
|
||||
API de calcul de la note finale d'une formation avec le model : calcul_mode_1
|
||||
API de PRE PRE PRE calcul de la note finale
|
||||
"""
|
||||
@app.route('/myclass/api/run_calcul_mode_1', methods=['POST','GET'])
|
||||
@app.route('/myclass/api/run_pre_calcul_moyenne_somme', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def run_calcul_mode_1():
|
||||
def run_pre_calcul_moyenne_somme():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary(request.form.to_dict())
|
||||
print(" ### run_calcul_mode_1 : payload = ",payload)
|
||||
localStatus, message= base_class_calcul_note.run_calcul_mode_1(payload)
|
||||
print(" ### run_pre_calcul_moyenne_somme : payload = ",payload)
|
||||
localStatus, message= base_class_calcul_note.run_pre_calcul_moyenne_somme(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API qui retourne les DETAIL de la note finale par type d'evaluation
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Evaluation_Final_Note_Classement_Detail_With_Filter', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Evaluation_Final_Note_Classement_Detail_With_Filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary(request.form.to_dict())
|
||||
print(" ### Get_List_Evaluation_Final_Note_Classement_Detail_With_Filter : payload = ",payload)
|
||||
localStatus, message= base_class_calcul_note.Get_List_Evaluation_Final_Note_Classement_Detail_With_Filter(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API qui retourne la note finale et le classement sur une session de formation
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Evaluation_Final_Note_Classement_With_Filter', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Evaluation_Final_Note_Classement_With_Filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary(request.form.to_dict())
|
||||
print(" ### Get_List_Evaluation_Final_Note_Classement_With_Filter : payload = ",payload)
|
||||
localStatus, message= base_class_calcul_note.Get_List_Evaluation_Final_Note_Classement_With_Filter(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de calcul de la note finale d'une formation avec le model : calcul_mode_1
|
||||
"""
|
||||
@app.route('/myclass/api/Cacul_Note_Finale_For_calcul_mode_1', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Cacul_Note_Finale_For_calcul_mode_1():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary(request.form.to_dict())
|
||||
print(" ### Cacul_Note_Finale_For_calcul_mode_1 : payload = ",payload)
|
||||
localStatus, message= base_class_calcul_note.Cacul_Note_Finale_For_calcul_mode_1(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
|
|
@ -203,8 +203,8 @@ def Add_Evaluation_Planification(diction):
|
|||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
new_data['create_date'] = str(datetime.now())
|
||||
new_data['created_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
inserted_id = MYSY_GV.dbname['note_evaluation'].insert_one(new_data).inserted_id
|
||||
|
@ -222,6 +222,7 @@ def Add_Evaluation_Planification(diction):
|
|||
return False, " Impossible de créer l'évaluation "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Mettre à jour une évaluation planifiée
|
||||
"""
|
||||
|
@ -422,6 +423,163 @@ def Update_Evaluation_Planification(diction):
|
|||
return False, " Impossible de mettre à jour l'évaluation "
|
||||
|
||||
|
||||
"""
|
||||
Dupliquer une évaluation planifiée
|
||||
"""
|
||||
def Duplicate_Evaluation_Planification(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'evaluation_id', ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
|
||||
return False, " Les informations fournies sont incorrectes"
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'evaluation_id', ]
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Les informations fournies sont incorrectes"
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
|
||||
"""
|
||||
Verifier que class_ue_id est valide
|
||||
"""
|
||||
is_evaluation_id_existe_class = MYSY_GV.dbname['note_evaluation'].count_documents({ '_id':ObjectId(str(diction['evaluation_id'])),
|
||||
'partner_owner_recid':my_partner['recid'],
|
||||
'valide': '1',
|
||||
'locked': '0'
|
||||
})
|
||||
|
||||
if (is_evaluation_id_existe_class != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de l'évaluation est invalide ")
|
||||
return False, " L'identifiant de l'évaluation est invalide "
|
||||
"""
|
||||
# Verifier que les element de l'evaluation existent et sont valides. par exmple, la formation, la session, le responsable etc
|
||||
class_id, class_eu_id, type_eval_id, session_id, responsable_id
|
||||
"""
|
||||
evaluation_id_data = MYSY_GV.dbname['note_evaluation'].find_one(
|
||||
{'_id': ObjectId(str(diction['evaluation_id'])),
|
||||
'partner_owner_recid': my_partner['recid'],
|
||||
'valide': '1',
|
||||
'locked': '0'
|
||||
})
|
||||
|
||||
if( evaluation_id_data and "class_id" in evaluation_id_data.keys() and evaluation_id_data['class_id']):
|
||||
is_existe_class_and_class_ue = MYSY_GV.dbname['myclass'].count_documents(
|
||||
{'_id': ObjectId(str(evaluation_id_data['class_id'])),
|
||||
'list_unite_enseignement._id': str(evaluation_id_data['class_eu_id']),
|
||||
'partner_owner_recid': my_partner['recid'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
if (is_existe_class_and_class_ue != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " La formation et l'UE ne sont pas cohérents ")
|
||||
return False, " La formation et l'UE ne sont pas cohérents "
|
||||
|
||||
|
||||
if (evaluation_id_data and "type_eval_id" in evaluation_id_data.keys() and evaluation_id_data['type_eval_id']):
|
||||
is_valide_type_eval = MYSY_GV.dbname['type_evaluation'].count_documents(
|
||||
{'_id': ObjectId(str(evaluation_id_data['type_eval_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
'recid'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
if (is_valide_type_eval != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du type d'évaluation est invalide ")
|
||||
return False, " L'identifiant du type d'évaluation est invalide "
|
||||
|
||||
if (evaluation_id_data and "responsable_id" in evaluation_id_data.keys() and evaluation_id_data['responsable_id']):
|
||||
is_valide_responsable = MYSY_GV.dbname['ressource_humaine'].count_documents(
|
||||
{'_id': ObjectId(str(evaluation_id_data['responsable_id'])),
|
||||
'partner_recid': my_partner[
|
||||
'recid'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
if (is_valide_responsable != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du responsable de l'évaluation est invalide ")
|
||||
return False, " L'identifiant du responsable de l'évaluation est invalide "
|
||||
|
||||
|
||||
if (evaluation_id_data and "session_id" in evaluation_id_data.keys() and evaluation_id_data['session_id']):
|
||||
is_valide_session_id = MYSY_GV.dbname['session_formation'].count_documents(
|
||||
{'_id': ObjectId(str(evaluation_id_data['session_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
'recid'],
|
||||
'valide': '1',
|
||||
})
|
||||
|
||||
if (is_valide_session_id != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de la session (class) est invalide ")
|
||||
return False, " L'identifiant de la session (class) est invalide "
|
||||
|
||||
|
||||
new_data = evaluation_id_data
|
||||
|
||||
del new_data['_id']
|
||||
new_data['code'] = "Dup_"+str(evaluation_id_data['code'])
|
||||
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
new_data['create_date'] = str(datetime.now())
|
||||
new_data['created_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
|
||||
result = MYSY_GV.dbname['note_evaluation'].insert_one(new_data).inserted_id
|
||||
|
||||
|
||||
|
||||
if (result is None ):
|
||||
mycommon.myprint(
|
||||
" Impossible de dupliquer l'évaluation (2) ")
|
||||
return False, " Impossible de mettre à jour l'évaluation (2) "
|
||||
|
||||
|
||||
|
||||
|
||||
return True, " L'évaluation a été correctement dupliquée"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de dupliquer l'évaluation "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperation de la liste des evaluation planifiée
|
||||
"""
|
||||
|
@ -2029,7 +2187,7 @@ def Get_List_Participant_Notes(diction):
|
|||
}
|
||||
|
||||
]
|
||||
print("#### Get_List_Participant_Notes laa 01 : query = ", query)
|
||||
#print("#### Get_List_Participant_Notes laa 01 : query = ", query)
|
||||
for retval in MYSY_GV.dbname['note_evaluation_participant'].aggregate(query):
|
||||
if( "note_evaluation_collection" in retval.keys() ):
|
||||
user = {}
|
||||
|
|
Loading…
Reference in New Issue