From e6d33ea173a1eca8c879813272ab07f8f060cbb1 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Sun, 3 Sep 2023 00:25:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A8=B1=E4=B9=90=E6=80=A7=E5=9C=B0=E5=8A=A0?= =?UTF-8?q?=E8=AE=A1=E9=87=8F=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/riic_report_analysis.py | 37 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/apps/riic_report_analysis.py b/apps/riic_report_analysis.py index 64114af..ea0f977 100644 --- a/apps/riic_report_analysis.py +++ b/apps/riic_report_analysis.py @@ -7,6 +7,7 @@ import asyncio import functools import re from typing import Dict, Optional, Any +import math rapid_ocr = None @@ -118,10 +119,10 @@ class RIICReportAnalysis: gold_avg += int(gold_list[i][1]) exp_avg += int(exp_list[i][1]) - # output += f"【{date_list[i][1]}】\n" - # output += f"💵 {lmb_list[2 * i][1]}订单({lmb_list[2 * i + 1][1]})\n" - # output += f"🧈 {gold_list[i][1]}赤金\n" - # output += f"📼 {exp_list[i][1]}经验\n\n" + output += f"【{date_list[i][1]}】\n" + output += f"💵 {lmb_list[2 * i][1]}订单({lmb_list[2 * i + 1][1]})\n" + output += f"🧈 {gold_list[i][1]}赤金\n" + output += f"📼 {exp_list[i][1]}经验\n\n" lmb_avg /= len(date_list) order_avg /= len(date_list) @@ -179,27 +180,33 @@ class RIICReportAnalysis: overflow_gold = gold_avg - balanced_gold more_exp = overflow_gold * 0.8 balanced_exp = exp_avg + more_exp - if power_plants == 2: - lmb_exp_ratio = (lmb_avg + external_lmb) / ( - balanced_exp + external_exp - ) - else: - lmb_exp_ratio = (lmb_avg + external_lmb) / (exp_avg + external_exp) - total = lmb_avg + balanced_exp + lmb_exp_ratio = (lmb_avg + external_lmb) / (balanced_exp + external_exp) + total = (lmb_avg * 0.2 + gold_avg * 0.8 + exp_avg + 4000) / 10000 + gongsun = (lmb_avg * 1.6 + exp_avg) / 10000 + kaltsit = math.ceil((lmb_avg + gold_avg + exp_avg) / 10000) + stupid = (lmb_avg + exp_avg) / 10000 output += "====计算结果====\n" output += f"订单平均:{lmb_avg:.0f}\n" + output += f"赤金平均:{gold_avg:.0f}\n" + output += f"经验平均:{exp_avg:.0f}\n" output += f"经验调平:{balanced_exp:.0f}\n" - output += f"钱书比例:{lmb_exp_ratio:.2f}\n" - output += f"调平总和:{total:.0f}" + output += f"钱书比例:{lmb_exp_ratio:.2f}\n\n" + + output += "======产能======\n" + output += f"{total:.1f}E\n" + output += f"{gongsun:.1f}公\n" + output += f"{kaltsit:.0f}凯\n" + output += f"{stupid:.1f}友\n" await chain.onebot_reply(Text(output.strip())) - except: + except Exception as e: err_msg = "出错啦!\n" err_msg += f"date_list = {date_list}\n" err_msg += f"lmb_list = {lmb_list}\n" err_msg += f"gold_list = {gold_list}\n" - err_msg += f"exp_list = {exp_list}" + err_msg += f"exp_list = {exp_list}\n" + err_msg += str(e) await chain.onebot_reply(Text(err_msg), At("1040110848"))