예제 #1
0
파일: webapp.py 프로젝트: yh2642/SPC_system
def query_batchlist():
	searchdate1 = request.args.get('startdate', '')
	searchdate2 = request.args.get('enddate', '')
	searchmodelID = request.args.get('modelID', '')
	searchbatchID = request.args.get('batchID', '')
	pressure_type = request.args.get('batchtype', '')
	
	if len(searchmodelID) > 0:
		batchtype = sql.get_batchtype(searchmodelID)
		feedback_info = sql.output_model(request.args['modelID'], batchtype)
		
	elif len(searchdate1) > 0 and len(searchdate2) > 0 and pressure_type >0:
		feedback_info = sql.output_history(request.args['startdate'], request.args['enddate'], request.args['batchtype'])	
	elif len(searchbatchID) > 0:
		batchtype = sql.get_batchtype(searchbatchID)
		feedback_info = sql.output_batch(searchbatchID, batchtype)
		
	# data_list = dig_data.dig_data()
	col1 = [u'生产批号', u'生产日期', u'机床压力', u'平均爆破压力(Mpa)', u'标准偏差值', u'波动跨度', 
			u'工序能力指数Cp', u'上限不合格率(>3.6)', u'下限不合格率(<3.0)', u'批次不合格率']
	show_columns = ['batchID', 'date', 'outpressure', 'means', 'stds', 'ranges', 'procedure_index', 'upper_fail_rate', 
					'lower_fail_rate', 'total_fail_rate']
	show_table = feedback_info.reindex(columns = show_columns)
	table_content = show_table.values	
	return render_template('show_batch_list.html', col1 = col1, table_content = table_content, info = info, nav_list = nav_list, nav_url = nav_url)
예제 #2
0
# -*- coding: utf-8 -*-