17/08/23 - 17h
parent
50dc603832
commit
655b740fc9
|
@ -1,11 +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="15/08/23 - 20h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="16/08/23 - 22h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Activite.py" beforeDir="false" afterPath="$PROJECT_DIR$/Activite.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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.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$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -69,13 +71,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00022" summary="15/05/23 - 23h">
|
||||
<created>1684182658305</created>
|
||||
<option name="number" value="00022" />
|
||||
<option name="presentableId" value="LOCAL-00022" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1684182658305</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00023" summary="21/05/23 - 10h">
|
||||
<created>1684655964597</created>
|
||||
<option name="number" value="00023" />
|
||||
|
@ -412,7 +407,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1692122709241</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="71" />
|
||||
<task id="LOCAL-00071" summary="16/08/23 - 22h">
|
||||
<created>1692218985020</created>
|
||||
<option name="number" value="00071" />
|
||||
<option name="presentableId" value="LOCAL-00071" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1692218985021</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="72" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -427,7 +429,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="16/07/23 - 21h" />
|
||||
<MESSAGE value="16/07/23 - 22h" />
|
||||
<MESSAGE value="22/07/2023 - 17h" />
|
||||
<MESSAGE value="23/07/2023 - 21h" />
|
||||
|
@ -452,6 +453,7 @@
|
|||
<MESSAGE value="14/08/23 - 16h30" />
|
||||
<MESSAGE value="15/08/23 -14h" />
|
||||
<MESSAGE value="15/08/23 - 20h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="15/08/23 - 20h" />
|
||||
<MESSAGE value="16/08/23 - 22h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="16/08/23 - 22h" />
|
||||
</component>
|
||||
</project>
|
|
@ -3330,3 +3330,187 @@ def DeleteImage_Stagiaire_v2(diction=None):
|
|||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, "IMPOSSIBLE D'ENREGISTRER L'IMAGE "
|
||||
|
||||
"""
|
||||
Cette fonction recuperer la liste des stagiaire d'un partenaire.
|
||||
On y ajoute la formation concernée
|
||||
"""
|
||||
def Get_Statgaire_List_Partner_with_filter(diction):
|
||||
try:
|
||||
field_list = ['token', 'class_internal_url', 'session_id', 'status']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
mycommon.myprint(str(inspect.stack()[0][
|
||||
3]) + " - Creation partner account : Le champ '" + val + "' n'est pas autorisé, Creation partenaire annulée")
|
||||
return False, "de recuperer la liste des stagiaires . Toutes les informations fournies ne sont pas valables"
|
||||
|
||||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token']
|
||||
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, "Impossible de recuperer la liste des stagiaires, Toutes les informations necessaires n'ont pas été fournies"
|
||||
|
||||
# Recuperation du recid du partner
|
||||
mydata = {}
|
||||
mytoken = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
mytoken = diction['token']
|
||||
|
||||
# Verifier la validité du token
|
||||
retval = mycommon.check_partner_token_validity("", mytoken)
|
||||
if retval is False:
|
||||
return "Err_Connexion", " La session de connexion n'est pas valide"
|
||||
|
||||
|
||||
partner_recid = mycommon.get_parnter_recid_from_token(mytoken)
|
||||
if (partner_recid is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer la liste des stagiaires, ")
|
||||
return False, "Impossible de recuperer la liste des stagiaires, Les informations d'identification sont incorrectes "
|
||||
|
||||
|
||||
filter_qry = {}
|
||||
class_internal_url = ""
|
||||
if ("class_internal_url" in diction.keys()):
|
||||
filter_qry['class_internal_url'] = diction['class_internal_url']
|
||||
|
||||
session_id = ""
|
||||
if ("session_id" in diction.keys()):
|
||||
filter_qry['session_id'] = diction['session_id']
|
||||
|
||||
|
||||
status = ""
|
||||
if ("status" in diction.keys()):
|
||||
filter_qry['status'] = diction['status']
|
||||
|
||||
|
||||
filt_class_partner_recid = {'partner_owner_recid': str(partner_recid)}
|
||||
|
||||
query = [{'$match':filter_qry },
|
||||
{'$lookup':
|
||||
{
|
||||
'from': 'myclass',
|
||||
'localField': 'class_internal_url',
|
||||
'foreignField': 'internal_url',
|
||||
'pipeline': [{'$match': filt_class_partner_recid}, {'$project': {'title': 1, 'domaine': 1,
|
||||
'duration': 1,
|
||||
'duration_unit': 1}}],
|
||||
'as': 'myclass_collection'
|
||||
}
|
||||
}
|
||||
]
|
||||
print("#### query = ", query)
|
||||
RetObject = []
|
||||
cpt = 1
|
||||
for retVal in MYSY_GV.dbname['inscription'].aggregate(query):
|
||||
if ('myclass_collection' in retVal.keys() and len(retVal['myclass_collection']) > 0):
|
||||
val = {}
|
||||
val['id'] = str(cpt)
|
||||
cpt = cpt + 1
|
||||
val['session_id'] = retVal['session_id']
|
||||
val['class_internal_url'] = retVal['class_internal_url']
|
||||
|
||||
val['nom'] = retVal['nom']
|
||||
val['prenom'] = retVal['prenom']
|
||||
|
||||
val['email'] = retVal['email']
|
||||
|
||||
if( "modefinancement" in retVal.keys()):
|
||||
val['modefinancement'] = retVal['modefinancement']
|
||||
else:
|
||||
val['modefinancement'] = ""
|
||||
|
||||
if ("opco" in retVal.keys()):
|
||||
val['opco'] = retVal['opco']
|
||||
else:
|
||||
val['opco'] = ""
|
||||
|
||||
|
||||
|
||||
if ("employeur" in retVal.keys()):
|
||||
val['employeur'] = retVal['employeur']
|
||||
else:
|
||||
val['employeur'] = ""
|
||||
|
||||
if ("telephone" in retVal.keys()):
|
||||
val['telephone'] = retVal['telephone']
|
||||
else:
|
||||
val['telephone'] = ""
|
||||
|
||||
|
||||
val['status'] = retVal['status']
|
||||
|
||||
val['title'] = retVal['myclass_collection'][0]['title']
|
||||
val['domaine'] = retVal['myclass_collection'][0]['domaine']
|
||||
|
||||
# Recuperation des informations de la session
|
||||
local_qry = {'class_internal_url':str(retVal['class_internal_url']), 'code_session':str(retVal['session_id']), 'valide':'1'}
|
||||
|
||||
count_session = MYSY_GV.dbname['session_formation'].count_documents(local_qry)
|
||||
|
||||
if(count_session != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Impossible de recuperer la liste des stagiaires, Il y a une incohérence sur la session : " + str(
|
||||
retVal['session_id']))
|
||||
return False, "Impossible de recuperer la liste des stagiaires, Les informations d'identification sont incorrectes. Il y a une incohérence sur la session : " + str(
|
||||
retVal['session_id'])
|
||||
|
||||
|
||||
#qry2 = {'class_internal_url':str(retVal['class_internal_url']), 'code_session':str(retVal['session_id']), 'valide':'1'}
|
||||
#print(" ### qry 2 =", qry2)
|
||||
session_retval = MYSY_GV.dbname['session_formation'].find_one({'class_internal_url':str(retVal['class_internal_url']),
|
||||
'code_session':str(retVal['session_id']), 'valide':'1'})
|
||||
|
||||
|
||||
if ("date_debut" in session_retval.keys()):
|
||||
val['date_du'] = str(session_retval['date_debut'])[0:10]
|
||||
else:
|
||||
val['date_du'] = ""
|
||||
|
||||
if ("date_fin" in session_retval.keys()):
|
||||
val['date_au'] = str(session_retval['date_fin'])[0:10]
|
||||
else:
|
||||
val['date_au'] = ""
|
||||
|
||||
if ("code_postal" in session_retval.keys()):
|
||||
val['code_postal'] = session_retval['code_postal']
|
||||
else:
|
||||
val['code_postal'] = ""
|
||||
|
||||
if ("prix_session" in session_retval.keys()):
|
||||
val['price'] = session_retval['prix_session']
|
||||
else:
|
||||
val['price'] = ""
|
||||
|
||||
if ("presentiel" in session_retval.keys()):
|
||||
val['presentiel'] = session_retval['presentiel']
|
||||
else:
|
||||
val['presentiel'] = "0"
|
||||
|
||||
if ("distantiel" in session_retval.keys()):
|
||||
val['distantiel'] = session_retval['distantiel']
|
||||
else:
|
||||
val['distantiel'] = "0"
|
||||
|
||||
if ("session_ondemande" in session_retval.keys()):
|
||||
val['session_ondemande'] = session_retval['session_ondemande']
|
||||
else:
|
||||
val['session_ondemande'] = "0"
|
||||
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(val))
|
||||
|
||||
|
||||
return True, RetObject
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, "Impossible de recuperer la liste des stagiaires"
|
||||
|
||||
|
||||
|
|
4650
Log/log_file.log
4650
Log/log_file.log
File diff suppressed because it is too large
Load Diff
13
class_mgt.py
13
class_mgt.py
|
@ -2374,12 +2374,11 @@ def find_partner_class_like(diction):
|
|||
filt_internal_url = {'internal_url': {'$regex': str(diction['internal_url']), "$options": "i"}}
|
||||
# print(" filt_internal_url GRRRRRRRRRRRRRRRRRRRRrr "+str(filt_internal_url))
|
||||
|
||||
print(
|
||||
" ATTTTENNTION : GESTION DU CAS OU LA PERSONNE QUI CHERCHE LE COURS EST UN UTILISATEUR : PB avec : partner_owner_recid ")
|
||||
print(" #### avant requete get partner_owner_recid =" + str(user_recid) +
|
||||
" filt_external_code = " + str(filt_external_code) +
|
||||
" filt_internal_url = " + str(filt_internal_url) +
|
||||
" filt_title = " + str(filt_title))
|
||||
find_partner_class_like_local_qry = {"$and": [{'valide': '1'}, {'locked': '0'},
|
||||
{'partner_owner_recid': user_recid},
|
||||
filt_external_code, filt_title, filt_internal_url]}
|
||||
|
||||
print(" ##### find_partner_class_like_local_qry = ", find_partner_class_like_local_qry)
|
||||
|
||||
val_tmp = 1
|
||||
for retVal in coll_name.find({"$and": [{'valide': '1'}, {'locked': '0'},
|
||||
|
@ -2408,7 +2407,7 @@ def find_partner_class_like(diction):
|
|||
RetObject.append(JSONEncoder().encode(user))
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
# print(str(RetObject))
|
||||
print(" #### return find_partner_class_like = : ", str(RetObject))
|
||||
return True, RetObject
|
||||
|
||||
|
||||
|
|
13
main.py
13
main.py
|
@ -3586,6 +3586,19 @@ def DeleteImage_Stagiaire_v2():
|
|||
status, retval = inscription.DeleteImage_Stagiaire_v2(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
"""
|
||||
API qui recupere la liste complete des stagaire d'un partener
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Statgaire_List_Partner_with_filter/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
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)
|
||||
status, retval = inscription.Get_Statgaire_List_Partner_with_filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(" debut api")
|
||||
|
|
|
@ -776,6 +776,7 @@ def Get_Partner_List_Partner_Client(diction):
|
|||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
print(" ### Get_Partner_List_Partner_Client data_cle = ", data_cle)
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue