for t in Types: #根据客户类型获取客户数据 cList = Sql().GetAccountByCustomerTypeCode2(t.TypeCode) Log.Log(('客户类型:').decode('utf8') + str(t.TypeCode) + (' 安全天数:').decode('utf8') + str(t.Day) + (' 客户数量:').decode('utf8') + str(len(cList))) #循环客户数据 for c in cList: if c.OwningBusinessUnit != '030-0cb12d9f-c907-4414-8d4a-fca3d01b63da': flag = False if t.TypeCode == 6: Full_Item.AddQianYue(YeWuYuan,c.FullName) #没有联系记录 elif c.ActivityTime != None: #最后一天与当天时间相差天数 if datetime.datetime.now() >= c.ActivityTime: day = dt.datediff(dt,dt.datetostr(c.ActivityTime),dt.datetostr(datetime.datetime.now())) #相差天数集合 listDay = dt.getDays(dt,dt.datetostr(c.ActivityTime),dt.datetostr(datetime.datetime.now())) #判断天数集合中是否存在节假日 jDay = 0 jMsg = '' if c.OwningBusinessUnit == '030-109b440b-b10c-46ee-bebd-176e443223ed': jMsg = '日本客户' jDay = dt.jieJiaRi(dt,listDay,JD) elif c.OwningBusinessUnit == '030-6354f9c0-2057-455d-bd93-871f3808c3a9': jMsg = '中国客户' jDay = dt.jieJiaRi(dt,listDay,CD) else: jMsg = '客户类型异常' if (day - jDay) > t.Day:
# -*- coding: utf-8 -*- import datetime import time from Utility.DateTime_Utility import DateTime_Utility as dt print str(dt.datediff(dt,dt.datetostr('2015-05-29 16:27:20.613000'),dt.datetostr(datetime.datetime.now()))) listA = dt.getDays(dt,dt.datetostr('2015-05-29 16:27:20.613000'),dt.datetostr(datetime.datetime.now())) listB = [(u'2015-05-03',), (u'2015-05-09',), (u'2015-05-10',), (u'2015-05-16',), (u'2015-05-31',), (u'2015-06-06',), (u'2015-06-07',), (u'2015-06-13',), (u'2015-06-14',), (u'2015-06-20',), (u'2015-06-21',), (u'2015-06-27',), (u'2015-06-28',), (u'2015-07-04',), (u'2015-07-05',), (u'2015-07-11',), (u'2015-07-12',), (u'2015-07-18',), (u'2015-07-19',), (u'2015-07-25',), (u'2015-07-26',), (u'2015-08-01',), (u'2015-08-02',), (u'2015-08-08',), (u'2015-08-09',), (u'2015-08-15',), (u'2015-08-16',), (u'2015-08-22',), (u'2015-08-23',), (u'2015-08-29',), (u'2015-08-30',), (u'2015-09-05',), (u'2015-09-06',), (u'2015-09-12',), (u'2015-09-13',), (u'2015-09-19',), (u'2015-09-20',), (u'2015-09-26',), (u'2015-09-27',), (u'2015-10-03',)] print listA print dt.jieJiaRi(dt,listA,listB)