Ejemplo n.º 1
0
 def __init__(self, request):
     userids, d1, d2 = parse_grid_arg(request)
     from emp_total import GetHead
     self.head = GetHead(userids, d1, d2, reportType=0)
     super(EmpSum, self).__init__()
     self.grid.fields["badgenumber"]["width"] = 70
     self.SetHide("userid")
Ejemplo n.º 2
0
 def MakeData(self,request,**arg):
     userids,d1,d2 = parse_grid_arg(request)
     if userids and d1 and d1:
         params={"userids": ','.join(userids),"st":d1,"et":d2}
         self.grid.sql = sql_utils.get_sql('sql',sqlid='cardtimes',app='att',params=params)
     else:
         self.SetBlank()
Ejemplo n.º 3
0
 def MakeData(self, request, **arg):
     userids, d1, d2 = parse_grid_arg(request)
     self.Paging(arg['offset'], item_count=len(userids))
     userids = userids[self.grid._begin:self.grid._end]
     if userids and d1 and d1:
         from emp_total import ForMakeData
         ForMakeData(self, userids, d1, d2, reportType=0)
     else:
         self.SetBlank()
Ejemplo n.º 4
0
def main(request):
    '''
    考勤计算过程入口
    '''
    from dbapp.utils import getJSResponse
    from mysite.att.report_utils import parse_report_arg, parse_grid_arg, filter_userid
    empids, d1, d2 = parse_grid_arg(request)
    #emp_ids = filter_userid(empids,"isatt=1")
    att_calculate(empids, d1, d2)
    return getJSResponse("result=0;message=%s%s%d sec" %
                         (_(u'计算成功'), _(u'总时间'), 0))
Ejemplo n.º 5
0
    def MakeData(self, request, **arg):
        userids, d1, d2 = parse_grid_arg(request)
        if userids and d1 and d1:
            params = {"userids": ','.join(userids), "st": d1, "et": d2}
            userids_sql = sql_utils.get_sql('sql',
                                            sqlid='exception_emp_ids',
                                            app='att',
                                            params=params)
            rows = sql_utils.p_query(userids_sql)
            if rows:
                userids = [r[0] for r in rows]
            else:
                userids = []

            self.Paging(arg['offset'], item_count=len(userids))
            userids = userids[self.grid._begin:self.grid._end]

            from emp_total import ForMakeDataExcepSum
            ForMakeDataExcepSum(self, userids, d1, d2)
        else:
            self.SetBlank()