def groundlist(): """所有土地信息列表""" g.__setattr__('action','ground.groundlist') page = int(request.form.get('page',1)) pagesize = int(request.form.get('page_size',10)) action = request.form.get('action','') #查询条件 batch_name = int(request.form.get('batch_name',0)) county = int(request.form.get('county',0)) project_type = int(request.form.get('project_type',0)) industry_type = int(request.form.get('industry_type',0)) used_type = int(request.form.get('used_type',0)) ground_list = Ground.query if batch_name: ground_list = ground_list.filter_by(batch_name=batch_name) if county: ground_list = ground_list.filter_by(county=county) if project_type: ground_list = ground_list.filter_by(project_type=project_type) if industry_type: ground_list = ground_list.filter_by(industry_type=industry_type) if used_type: ground_list = ground_list.filter_by(used_type=used_type) ground_list = ground_list.order_by('id desc').all() # print Ground.query.filter(and_(filter_str)).order_by('id desc') for ground in ground_list: ground.match_target_type = match_target_type_resolution(ground.match_target_type) if action == "export": return redirect(ground_excel_created(ground_list)) print '*'*40,pagesize,page pagination = Pagination(ground_list,page,pagesize) groundlist = pagination.list() return render_template('/ground/groundlist.html', pagination=pagination, page=page, page_size=pagesize, groundlist=groundlist, batchlist = Batch.query.all(), countys=COUNTY_CHOICES, project_types=PROJECT_TYPE_CHOICES, industry_types=INDUSTRY_TYPE_CHOICES, used_types=GROUND_USE_TYPE_CHOICES, _batch_name=batch_name, _county=str(county), _project_type=str(project_type), _industry_type=str(industry_type), _used_type=str(used_type) )
def batchlist(): """所有批次列表""" g.__setattr__('action','batch.batchlist') page = int(request.form.get('page',1)) pagesize = int(request.form.get('page_size',2)) action = request.form.get('action','') #查询条件 _county = int(request.form.get('county',0)) _year = int(request.form.get('year',0)) print "<>"*40,_county,_year batchlist = Batch.query if _county: batchlist = batchlist.filter_by(county=_county) if _year: batchlist = batchlist.filter_by(year=_year) batchlist = batchlist.order_by('id desc').all() print len(batchlist) # print Ground.query.filter(and_(filter_str)).order_by('id desc') if action == "export": return redirect(batch_excel_created(batchlist)) pagination = Pagination(batchlist,page,pagesize) batchlist = pagination.list() print len(batchlist) return render_template('/batch/batchlist.html', pagination=pagination, page=page, page_size=pagesize, batchlist=batchlist, countys=COUNTY_CHOICES, years=YEAR_CHOICES, _county=str(_county), _year=str(_year) )
def firstexalist(): """初审信息列表""" g.__setattr__("action", "examine.firstexalist") page = int(request.form.get("page", 1)) pagesize = int(request.form.get("page_size", 10)) action = request.form.get("action", "") # 查询条件 _county = int(request.form.get("county", 0)) inquirylist = Inquiry.query if _county: inquirylist = inquirylist.filter_by(project_address1=_county) inquirylist = inquirylist.order_by("apply_time desc").all() for inquiry in inquirylist: inquiry.project_address2 = ( COUNTY_CHOICES.__getitem__(inquiry.project_address1 - 1)[1] + "-" + inquiry.project_address2_time.strftime("%Y-%m-%d") ) inquiry.apply_time = inquiry.apply_time.strftime("%Y-%m-%d") if action == "export": return redirect(inquiry_excel_created(inquirylist)) pagination = Pagination(inquirylist, page, pagesize) inquirylist = pagination.list() return render_template( "/examine/inquirylist.html", inquirylist=inquirylist, countys=COUNTY_CHOICES, pagination=pagination, _county=str(_county), page=page, page_size=pagesize, )
def preexalist(): """预审信息""" g.__setattr__("action", "examine.preexalist") page = int(request.form.get("page", 1)) pagesize = int(request.form.get("page_size", 10)) action = request.form.get("action", "") # 查询条件 _county = int(request.form.get("county", 0)) reviewlist = Review.query if _county: reviewlist = reviewlist.filter_by(project_address1=_county) reviewlist = reviewlist.order_by("apply_time desc").all() for review in reviewlist: review.project_address2 = ( COUNTY_CHOICES.__getitem__(review.project_address1 - 1)[1] + "-" + review.project_address2 ) review.examine_time = review.examine_time.strftime("%Y-%m-%d") review.apply_time = review.apply_time.strftime("%Y-%m-%d") if action == "export": return redirect(review_excel_created(reviewlist)) pagination = Pagination(reviewlist, page, pagesize) reviewlist = pagination.list() return render_template( "/examine/reviewlist.html", reviewlist=reviewlist, countys=COUNTY_CHOICES, pagination=pagination, page=page, page_size=pagesize, _county=str(_county), )