| Line 23... |
Line 23... |
| 23 |
http://www.bluedart.com/servlet/RoutingServlet?handler=tnt&action=custawbquery&loginid=DEL24119&awb=ref&format=XML&lickey=6265d61bafa6292c5ddfdb1ee335ca80&verno=1.3&scan=1&numbers={variable1} is hard coded
|
23 |
http://www.bluedart.com/servlet/RoutingServlet?handler=tnt&action=custawbquery&loginid=DEL24119&awb=ref&format=XML&lickey=6265d61bafa6292c5ddfdb1ee335ca80&verno=1.3&scan=1&numbers={variable1} is hard coded
|
| 24 |
to track DOA orders and for other orders ConfigClient is called to get bluedart_update_url
|
24 |
to track DOA orders and for other orders ConfigClient is called to get bluedart_update_url
|
| 25 |
|
25 |
|
| 26 |
@author: Phani Kumar
|
26 |
@author: Phani Kumar
|
| 27 |
'''
|
27 |
'''
|
| - |
|
28 |
from shop2020.clients.CRMClient import CRMClient
|
| - |
|
29 |
from shop2020.clients.LogisticsClient import LogisticsClient
|
| - |
|
30 |
from shop2020.clients.TransactionClient import TransactionClient
|
| - |
|
31 |
from shop2020.clients.UserClient import UserClient
|
| - |
|
32 |
from shop2020.config.client.ConfigClient import ConfigClient
|
| - |
|
33 |
from shop2020.model.v1.order.script.LogisticUtils import enqueueMailForFDA
|
| - |
|
34 |
from shop2020.thriftpy.config.ttypes import ConfigException
|
| - |
|
35 |
from shop2020.thriftpy.crm.ttypes import *
|
| - |
|
36 |
from shop2020.thriftpy.model.v1.order.ttypes import TransactionServiceException, \
|
| - |
|
37 |
OrderStatus
|
| - |
|
38 |
from shop2020.utils.EmailAttachmentSender import get_attachment_part, mail
|
| - |
|
39 |
from shop2020.utils.Utils import to_py_date
|
| - |
|
40 |
from xml.etree.ElementTree import parse
|
| 28 |
import time
|
41 |
import csv
|
| 29 |
import datetime
|
42 |
import datetime
|
| 30 |
import optparse
|
43 |
import optparse
|
| 31 |
import sys
|
44 |
import sys
|
| 32 |
import csv
|
45 |
import time
|
| 33 |
import traceback
|
46 |
import traceback
|
| 34 |
import urllib2
|
47 |
import urllib2
|
| 35 |
from xml.etree.ElementTree import parse
|
- |
|
| 36 |
|
48 |
|
| 37 |
if __name__ == '__main__' and __package__ is None:
|
49 |
if __name__ == '__main__' and __package__ is None:
|
| 38 |
import os
|
50 |
import os
|
| 39 |
sys.path.insert(0, os.getcwd())
|
51 |
sys.path.insert(0, os.getcwd())
|
| 40 |
|
52 |
|
| 41 |
from shop2020.clients.LogisticsClient import LogisticsClient
|
- |
|
| 42 |
from shop2020.clients.TransactionClient import TransactionClient
|
- |
|
| 43 |
from shop2020.clients.UserClient import UserClient
|
- |
|
| 44 |
from shop2020.config.client.ConfigClient import ConfigClient
|
- |
|
| 45 |
from shop2020.clients.CRMClient import CRMClient
|
- |
|
| 46 |
from shop2020.thriftpy.config.ttypes import ConfigException
|
- |
|
| 47 |
from shop2020.thriftpy.model.v1.order.ttypes import TransactionServiceException, OrderStatus
|
- |
|
| 48 |
from shop2020.utils.EmailAttachmentSender import get_attachment_part, mail
|
- |
|
| 49 |
from shop2020.utils.Utils import to_py_date
|
- |
|
| 50 |
from shop2020.thriftpy.crm.ttypes import *
|
- |
|
| 51 |
|
53 |
|
| 52 |
try:
|
54 |
try:
|
| 53 |
config_client = ConfigClient()
|
55 |
config_client = ConfigClient()
|
| 54 |
BLUEDART_URL = config_client.get_property("bluedart_update_url")
|
56 |
BLUEDART_URL = config_client.get_property("bluedart_update_url")
|
| 55 |
except ConfigException as cex:
|
57 |
except ConfigException as cex:
|
| Line 684... |
Line 686... |
| 684 |
else:
|
686 |
else:
|
| 685 |
ticket.customerId = user.userId
|
687 |
ticket.customerId = user.userId
|
| 686 |
activity.customerId = user.userId
|
688 |
activity.customerId = user.userId
|
| 687 |
|
689 |
|
| 688 |
crmServiceClient.insertTicket(ticket, activity)
|
690 |
crmServiceClient.insertTicket(ticket, activity)
|
| - |
|
691 |
'''
|
| - |
|
692 |
Inform user about first delivery attempt
|
| - |
|
693 |
'''
|
| - |
|
694 |
enqueueMailForFDA(order)
|
| 689 |
except:
|
695 |
except:
|
| 690 |
print "Some issue while creating crm tickets for orders in FIRST_DELIVERY_ATTEMPT_MADE status"
|
696 |
print "Some issue while creating crm tickets for orders in FIRST_DELIVERY_ATTEMPT_MADE status"
|
| 691 |
traceback.print_exc()
|
697 |
traceback.print_exc()
|
| 692 |
|
698 |
|
| 693 |
def auto_close_crm_tickets_created():
|
699 |
def auto_close_crm_tickets_created():
|