def yumi(): item = { 'ymkqjc1': ['c-1+请选择', '请选择'], 'ymkqjc2': ['c-1+请选择', '请选择'], 'dfkqjc1': ['cs-1+请选择', '请选择'], 'dfkqjc2': ['cs-1+请选择', '请选择'] } today = str(datetime.datetime.today())[:10] S = SelectDatas() content_item = S.select_data('content_items', 'daily_yumi') content_item = json.loads(content_item) json_items = S.select_data('data_items', 'daily_yumi') json_items = json.loads(json_items) if request.method == 'POST': ymkqjc1 = request.form.get('ymkqjc1').split('+') ymkqjc2 = request.form.get('ymkqjc2').split('+') dfkqjc1 = request.form.get('dfkqjc1').split('+') dfkqjc2 = request.form.get('dfkqjc2').split('+') item['ymkqjc1'] = [ymkqjc1[0] + '+' + ymkqjc1[1], ymkqjc1[1]] item['ymkqjc2'] = [ymkqjc2[0] + '+' + ymkqjc2[1], ymkqjc2[1]] item['dfkqjc1'] = [dfkqjc1[0] + '+' + dfkqjc1[1], dfkqjc1[1]] item['dfkqjc2'] = [dfkqjc2[0] + '+' + dfkqjc2[1], dfkqjc2[1]] YuMi().run(ymkqjc1[0], ymkqjc2[0], dfkqjc1[0], dfkqjc2[0]) print(item) return render_template('daily/yumi.html', item=item, today=today, content=content_item, items=json_items, val1=time.time())
def run(self): logger.info('MAKEING JIACHUN PNG...') self.is_save_dir() S = SelectDatas() json_items = S.select_data('png_items', 'daily_jiachun') json_items = json.loads(json_items) # 基差图 jicha_item = json_items['jicha_data_item'] self.jicha(jicha_item['data1'], self.save_path % 'jicha') # 价差图 jicha_item = json_items['jiacha_data_item'] self.jicha(jicha_item['data1'], self.save_path % 'jiacha') # 净多单图 jdd_data_item = json_items['jdd_data_item'] self.jdd(jdd_data_item['data1'], self.save_path % 'jdd') # 现货图 xhkc_item = json_items['xhkc_data_item'] self.xh(xhkc_item, self.save_path % 'xhkc') # PP利润 pplr_data_item = json_items['pplr_data_item'] self.pplr(pplr_data_item['data1'], self.save_path % 'pplr') # # # 进口利润 jklr_data_item = json_items['jklr_data_item'] self.jicha(jklr_data_item['data1'], self.save_path % 'jklr')
def youzhi(): item = { 'kpztljc1': ['a-1+请选择', '请选择'], 'kpztljc2': ['a-1+请选择', '请选择'], 'pzbj1': ['a-1+请选择', '请选择'], 'pzbj2': ['a-1+请选择', '请选择'] } today = str(datetime.datetime.today())[:10] S = SelectDatas() content_item = S.select_data('content_items', 'daily_youzhi') content_item = json.loads(content_item) json_items = S.select_data('data_items', 'daily_youzhi') json_items = json.loads(json_items) if request.method == 'POST': kpztljc1 = request.form.get('kpztljc1').split('+') kpztljc2 = request.form.get('kpztljc2').split('+') pzbj1 = request.form.get('pzbj1').split('+') pzbj2 = request.form.get('pzbj2').split('+') item['kpztljc1'] = [kpztljc1[0] + '+' + kpztljc1[1], kpztljc1[1]] item['kpztljc2'] = [kpztljc2[0] + '+' + kpztljc2[1], kpztljc2[1]] item['pzbj1'] = [pzbj1[0] + '+' + pzbj1[1], pzbj1[1]] item['pzbj2'] = [pzbj2[0] + '+' + pzbj2[1], pzbj2[1]] YouZhi().run(kpztljc1[0], kpztljc2[0], pzbj1[0], pzbj2[0]) return render_template('daily/youzhi.html', items=json_items, content=content_item, val1=time.time(), today=today, item=item)
def pta(): S= SelectDatas() json_items = S.select_data('data_items','daily_pta') json_items = json.loads(json_items) today = str(datetime.datetime.today())[:10] return render_template('daily/pta.html',today=today,items=json_items,val1=time.time())
def yuanyou(): S= SelectDatas() content_item = S.select_data('content_items','daily_yuanyou') content_item = json.loads(content_item) json_items = S.select_data('data_items','daily_yuanyou') json_items = json.loads(json_items) today = str(datetime.datetime.today())[:10] return render_template('daily/yuanyou.html',today=today,content=content_item,items=json_items,val1=time.time())
def run(self): logger.info('MAKEING SHUHUA PNG...') #try: self.is_save_dir() S = SelectDatas() json_items = S.select_data('png_items', 'daily_shuhua') json_items = json.loads(json_items) self.jdd(json_items['jdd_data_item']) self.jicha(json_items['jicha_data_item']) self.jiacha(json_items['jiacha_data_item'])
def jiachun(): S = SelectDatas() content_item = S.select_data('content_items', 'daily_jiachun') content_item = json.loads(content_item) json_items = S.select_data('data_items', 'daily_jiachun') json_items = json.loads(json_items) today = str(datetime.datetime.today())[:10] return render_template('daily/jiachun.html', items=json_items, content=content_item, today=today, val1=time.time())
def run(self): logger.info('MAKEING GUZHI PNG...') self.is_save_dir() S = SelectDatas() json_items = S.select_data('png_items', 'daily_guzhi') json_items = json.loads(json_items) # 净空单图 jkd_data_item = json_items['jkd_data_item'] self.jkd(jkd_data_item, self.save_path % 'jkd') qxjc_data_item = json_items['qxjc_data_item'] self.jc(qxjc_data_item, self.save_path % 'qxjc') kcjc_data_item = json_items['kcjc_data_item'] self.jc(kcjc_data_item, self.save_path % 'kqjc')
def run(self): logger.info('MAKEING XIANGJIAO PNG...') try: self.is_save_dir() S = SelectDatas() json_items = S.select_data('png_items', 'daily_xiangjiao') json_items = json.loads(json_items) # 现货图 xhjg_item = json_items['xhjg_data_item'] xhkc_item = json_items['xhkc_data_item'] self.xh(xhjg_item, self.save_path % 'xhjg') self.xh(xhkc_item, self.save_path % 'xhkc') # 基差图 jicha_item = json_items['jicha_data_item'] self.jicha(jicha_item['data1'], self.save_path % 'jicha') # 净多单图 jdd_data_item = json_items['jdd_data_item'] self.jdd(jdd_data_item['data1'], self.save_path % 'jdd') # 外盘图 param = json_items['wpqh_data_item'] self.wpqh(param, self.save_path % 'wpqh') except: logger.error('XIANGJIAO ERROR')
def cjcc(): num, result = SelectDatas().select_cjcc() return render_template('datas/cjcc.html', result=result, num=num)