05/02/2024 -23h
parent
b6b3ba727b
commit
4a5b903e51
|
@ -1,9 +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="04/02/2024 - 21h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="04/02/2024 - 23h">
|
||||
<change afterPath="$PROJECT_DIR$/crm_opportunite.py" 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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -74,13 +77,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00164" summary="07/12/2023 - 11h30">
|
||||
<created>1701945586589</created>
|
||||
<option name="number" value="00164" />
|
||||
<option name="presentableId" value="LOCAL-00164" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1701945586589</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00165" summary="07/12/2023 - 21h30">
|
||||
<created>1701980089273</created>
|
||||
<option name="number" value="00165" />
|
||||
|
@ -417,7 +413,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1707072782514</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="213" />
|
||||
<task id="LOCAL-00213" summary="04/02/2024 - 23h">
|
||||
<created>1707082428610</created>
|
||||
<option name="number" value="00213" />
|
||||
<option name="presentableId" value="LOCAL-00213" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1707082428611</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="214" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -432,7 +435,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="04/01/2024 - 22h30" />
|
||||
<MESSAGE value="5555" />
|
||||
<MESSAGE value="05/01/24 - 20h30" />
|
||||
<MESSAGE value="06/01/24 - 20h30" />
|
||||
|
@ -457,6 +459,7 @@
|
|||
<MESSAGE value="02/02/2024 - 23h" />
|
||||
<MESSAGE value="03/02/2024 - 21h" />
|
||||
<MESSAGE value="04/02/2024 - 21h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="04/02/2024 - 21h" />
|
||||
<MESSAGE value="04/02/2024 - 23h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="04/02/2024 - 23h" />
|
||||
</component>
|
||||
</project>
|
|
@ -1089,6 +1089,11 @@ def UpdateStagiairetoClass(diction):
|
|||
|
||||
elif ( new_status != old_status and diction['status'] == "-1" ):
|
||||
# Il s'agit d'envoyer le message de refus d'une inscription
|
||||
if( "date_du" not in email_data.keys() ):
|
||||
email_data['date_du'] = "--"
|
||||
|
||||
if ("date_au" not in email_data.keys()):
|
||||
email_data['date_au'] = "--"
|
||||
local_status, local_message = email_session.incription_training_refused_mail(email_data)
|
||||
message_for_historic = message_for_historic + " : Email Refus Inscription "
|
||||
|
||||
|
|
1725
Log/log_file.log
1725
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,182 @@
|
|||
"""
|
||||
Ce fichier permet de gerer les opportunités CRM
|
||||
|
||||
"""
|
||||
import bson
|
||||
import pymongo
|
||||
from pymongo import MongoClient
|
||||
import json
|
||||
from bson import ObjectId
|
||||
import re
|
||||
from datetime import datetime
|
||||
import prj_common as mycommon
|
||||
import secrets
|
||||
import inspect
|
||||
import sys, os
|
||||
import csv
|
||||
import pandas as pd
|
||||
from pymongo import ReturnDocument
|
||||
import GlobalVariable as MYSY_GV
|
||||
from math import isnan
|
||||
import GlobalVariable as MYSY_GV
|
||||
import ela_index_bdd_classes as eibdd
|
||||
import email_mgt as email
|
||||
import jinja2
|
||||
from flask import send_file
|
||||
from xhtml2pdf import pisa
|
||||
from email.message import EmailMessage
|
||||
from email.mime.text import MIMEText
|
||||
from email import encoders
|
||||
import smtplib
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from email.mime.base import MIMEBase
|
||||
from email import encoders
|
||||
|
||||
|
||||
"""
|
||||
Fonction d'ajout d'une étape (configuration) d'opportunité
|
||||
"""
|
||||
def Add_CRM_Opportunite_Etape(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'code', 'description', 'rang']
|
||||
|
||||
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', 'code', 'description', 'rang']
|
||||
|
||||
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 qu'il n'y pas deja un étape avec le meme code
|
||||
is_opport_existe_etape = MYSY_GV.dbname['base_partner_opportunite_step'].count_documents({"code":str(diction['code']).lower(),
|
||||
'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide':'1'})
|
||||
|
||||
if( is_opport_existe_etape > 0 ):
|
||||
mycommon.myprint(
|
||||
" Il existe déjà une étape avec le code "+str(diction["code"]))
|
||||
return False, " Il existe déjà une étape avec le code "+str(diction["code"])+" "
|
||||
|
||||
new_data = diction
|
||||
del new_data['token']
|
||||
|
||||
new_data['code'] = str(diction['code']).lower()
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['recid'])
|
||||
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
val = MYSY_GV.dbname['base_partner_opportunite_step'].insert_one(new_data)
|
||||
if( val is None ):
|
||||
mycommon.myprint(
|
||||
" Impossible de créer l'étape (2) ")
|
||||
return False, " Impossible de créer l'étape (2) "
|
||||
|
||||
|
||||
return True, " L'étape a été correctement créé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 créer l'étape "
|
||||
|
||||
|
||||
"""
|
||||
Recuperation de la liste des étapes d'un partenaire
|
||||
"""
|
||||
def Get_CRM_List_Opportunite_Etape(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token']
|
||||
|
||||
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' ]
|
||||
|
||||
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
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
for retval in MYSY_GV.dbname['base_partner_opportunite_step'].find({
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(
|
||||
my_partner['recid'])}).sort([("rang", pymongo.ASCENDING), ]):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
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) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de recuperer les étapes des opportunité "
|
||||
|
35
main.py
35
main.py
|
@ -74,7 +74,7 @@ import purchase_prices as purchase_prices
|
|||
import apprenant_mgt as apprenant_mgt
|
||||
import module_editique as module_editique
|
||||
import attestation_formation as attestation_formation
|
||||
|
||||
import crm_opportunite as crm_opportunite
|
||||
|
||||
app = Flask(__name__)
|
||||
cors = CORS(app, resources={r"/foo": {"origins": "*"}})
|
||||
|
@ -7494,6 +7494,39 @@ def Prepare_and_Send_Attestation_From_Session_By_Email():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API de creation d'une étape d'opportunité CRM
|
||||
"""
|
||||
@app.route('/myclass/api/Add_CRM_Opportunite_Etape/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_CRM_Opportunite_Etape():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_CRM_Opportunite_Etape payload = ",payload)
|
||||
print(request.files)
|
||||
status, retval = crm_opportunite.Add_CRM_Opportunite_Etape(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de récuperation de la liste des étapes d'opportunité CRM
|
||||
"""
|
||||
@app.route('/myclass/api/Get_CRM_List_Opportunite_Etape/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_CRM_List_Opportunite_Etape():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_CRM_List_Opportunite_Etape payload = ",payload)
|
||||
print(request.files)
|
||||
status, retval = crm_opportunite.Get_CRM_List_Opportunite_Etape(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(" debut api")
|
||||
context = SSL.Context(SSL.SSLv23_METHOD)
|
||||
|
|
|
@ -3628,7 +3628,7 @@ def Add_Update_Employee_Login_Pass(diction):
|
|||
count_account = 0
|
||||
for retval in MYSY_GV.dbname['partnair_account'].find({'email': str(email)}):
|
||||
count_account = count_account + 1
|
||||
if (str(retval['ressource_humaine_id']) == str(ressource_humaine_id)):
|
||||
if ("ressource_humaine_id" in retval.keys() and str(retval['ressource_humaine_id']) == str(ressource_humaine_id)):
|
||||
count_existe_with_correct_ressource_humaine_id = True
|
||||
else:
|
||||
count_existe_with_wrong_ressource_humaine_id = True
|
||||
|
|
Loading…
Reference in New Issue