Subversion Repositories SmartDukaan

Rev

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

Rev 19457 Rev 19463
Line 34... Line 34...
34
import base64
34
import base64
35
from falcon.util.uri import decode
35
from falcon.util.uri import decode
36
import MySQLdb
36
import MySQLdb
37
from shop2020.clients.CatalogClient import CatalogClient  
37
from shop2020.clients.CatalogClient import CatalogClient  
38
from pyquery import PyQuery as pq
38
from pyquery import PyQuery as pq
-
 
39
import time
39
 
40
 
40
alphalist = list(string.uppercase)
41
alphalist = list(string.uppercase)
41
alphalist.remove('O')
42
alphalist.remove('O')
42
numList = ['1','2','3','4','5','6','7','8','9']
43
numList = ['1','2','3','4','5','6','7','8','9']
43
codesys = [alphalist, alphalist, numList, numList, numList]
44
codesys = [alphalist, alphalist, numList, numList, numList]
Line 2372... Line 2373...
2372
        limit = req.get_param_as_int("limit")
2373
        limit = req.get_param_as_int("limit")
2373
        status = req.get_param("status")
2374
        status = req.get_param("status")
2374
        userRefundDetails = Mongo.fetchCrmRefundUsers(status,offset,limit)
2375
        userRefundDetails = Mongo.fetchCrmRefundUsers(status,offset,limit)
2375
        print userRefundDetails
2376
        print userRefundDetails
2376
        if userRefundDetails is not None:
2377
        if userRefundDetails is not None:
2377
#             json_docs = [json.dumps(doc, default=json_util.default) for doc in userRefundDetails]
-
 
2378
#             print json.dumps(json_docs, encoding='utf-8')
-
 
2379
#             resp.body = json.dumps(json_docs, encoding='utf-8')            
-
 
2380
            resp.body = dumps(userRefundDetails)
2378
            resp.body = dumps(userRefundDetails)
2381
        else:
2379
        else:
2382
            resp.body ="{}"
2380
            resp.body ="{}"
-
 
2381
 
-
 
2382
class RefundWalletStatus():
-
 
2383
    def on_post(self,req,resp):
-
 
2384
        status = req.get_param('status')
-
 
2385
        jsonReq = json.loads(req.stream.read(), encoding='utf-8')
-
 
2386
        print jsonReq
-
 
2387
        print status
-
 
2388
        userId = jsonReq.get('user_id')
-
 
2389
        _id = jsonReq.get('_id')
-
 
2390
        #conn = get_mongo_connection()
-
 
2391
        if status == utils.REFUND_ADJUSTMENT_MAP.get(1):
-
 
2392
            Mongo.updateCrmWalletStatus(status, _id,userId)
-
 
2393
        elif status == utils.REFUND_ADJUSTMENT_MAP.get(2):
-
 
2394
            Mongo.updateCrmWalletStatus(status, _id,userId)
-
 
2395
        
-
 
2396
        resp.body = "{\"result\":\"success\"}"        
2383
                
2397
            
2384
def main():
2398
def main():
2385
    a = RetailerDetail()
2399
    a = RetailerDetail()
2386
    retailer = a.getNotActiveRetailer()
2400
    retailer = a.getNotActiveRetailer()
2387
    otherContacts = [r for r, in session.query(RetailerContacts.mobile_number).filter_by(retailer_id=retailer.id).order_by(RetailerContacts.contact_type).all()]
2401
    otherContacts = [r for r, in session.query(RetailerContacts.mobile_number).filter_by(retailer_id=retailer.id).order_by(RetailerContacts.contact_type).all()]
2388
    print json.dumps(todict(getRetailerObj(retailer, otherContacts, 'fresh')), encoding='utf-8')
2402
    print json.dumps(todict(getRetailerObj(retailer, otherContacts, 'fresh')), encoding='utf-8')