Subversion Repositories SmartDukaan

Rev

Rev 18860 | Rev 18895 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18860 Rev 18871
Line 19... Line 19...
19
import urllib2
19
import urllib2
20
import urlparse
20
import urlparse
21
from Crypto.Hash import MD5
21
from Crypto.Hash import MD5
22
from Crypto.Cipher import DES
22
from Crypto.Cipher import DES
23
import string
23
import string
24
from shop2020.clients.CRMClient import CRMClient
24
from shop2020.clients.CRMClitiment import CRMClient
25
from shop2020.clients.UserClient import UserClient
25
from shop2020.clients.UserClient import UserClient
26
from shop2020.thriftpy.crm.ttypes import SearchFilter, TicketCategory, Ticket, \
26
from shop2020.thriftpy.crm.ttypes import SearchFilter, TicketCategory, Ticket, \
27
     Activity, TicketPriority, TicketStatus, ActivityType
27
     Activity, TicketPriority, TicketStatus, ActivityType
28
#TODO Need to add messy stuff to conf.
28
#TODO Need to add messy stuff to conf.
29
 
29
 
Line 57... Line 57...
57
PROXY_MESH_GENERAL = "de.proxymesh.com:31280"
57
PROXY_MESH_GENERAL = "de.proxymesh.com:31280"
58
PROXY_FLIPKART = "117.240.187.35:3128"
58
PROXY_FLIPKART = "117.240.187.35:3128"
59
 
59
 
60
PUSH_NOTIFICATION_URL='http://api.profittill.com/admin/users/push'
60
PUSH_NOTIFICATION_URL='http://api.profittill.com/admin/users/push'
61
DTR_API_BASIC_AUTH = base64.encodestring('%s:%s' % ("dtr", "dtr18Feb2015")).replace('\n', '')
61
DTR_API_BASIC_AUTH = base64.encodestring('%s:%s' % ("dtr", "dtr18Feb2015")).replace('\n', '')
62
EMAIL_CRM_PUSH_URL = 'http://api.profittill.com/feedbacks/crm_mail'
62
EMAIL_CRM_PUSH_URL = 'http://staging.profittill.com/feedbacks/crm_mail'
63
statusMap = {1:'Active',2:'EOL',3:'In Process',4:'Exclusive'}
63
statusMap = {1:'Active',2:'EOL',3:'In Process',4:'Exclusive'}
64
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6, 'HOMESHOP18.COM':7}
64
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6, 'HOMESHOP18.COM':7}
65
 
65
 
66
CB_INIT = 'Waiting Confirmation'
66
CB_INIT = 'Waiting Confirmation'
67
CB_PENDING = 'Pending'
67
CB_PENDING = 'Pending'
Line 445... Line 445...
445
 
445
 
446
    ticket.description = 'User Specified Subject :- '+ customerFeedBack.get('subject') + ' | ' +  customerFeedBack.get('message')
446
    ticket.description = 'User Specified Subject :- '+ customerFeedBack.get('subject') + ' | ' +  customerFeedBack.get('message')
447
    ticket.customerEmailId = customerFeedBack.get('email')
447
    ticket.customerEmailId = customerFeedBack.get('email')
448
    if user is not None and user.userId !=-1:
448
    if user is not None and user.userId !=-1:
449
        ticket.customerId = user.userId
449
        ticket.customerId = user.userId
-
 
450
    ticket.assigneeId=57
450
    ticket.status = TicketStatus.OPEN
451
    ticket.status = TicketStatus.OPEN
451
    ticket.openDate = to_java_date(customerFeedBack.get('created'))
452
    ticket.openDate = to_java_date(customerFeedBack.get('created'))
452
    ticket.customerMobileNumber = customerFeedBack.get('mobile_number')
453
    ticket.customerMobileNumber = customerFeedBack.get('mobile_number')
453
    ticket.customerName = customerFeedBack.get('customer_name')  
454
    ticket.customerName = customerFeedBack.get('customer_name')  
454
    activity.creatorId = 1
455
    activity.creatorId = 1
Line 474... Line 475...
474
    ticketId = crmServiceClient.insertTicket(ticket, activity)
475
    ticketId = crmServiceClient.insertTicket(ticket, activity)
475
    
476
    
476
    if ticketId > 0:
477
    if ticketId > 0:
477
        return True
478
        return True
478
    else:
479
    else:
479
        return False    
-
 
480
480
        return False    
-
 
481