From 1f8d5e4e25b3ba6b9bb87614b2d6695c942904a6 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Wed, 16 Aug 2023 15:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E7=B2=BE=E5=AF=86=E5=9C=B0=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E8=A3=81=E7=BC=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/riic_report_analysis.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/riic_report_analysis.py b/apps/riic_report_analysis.py index b825c4e..64114af 100644 --- a/apps/riic_report_analysis.py +++ b/apps/riic_report_analysis.py @@ -6,7 +6,7 @@ import os import asyncio import functools import re -from typing import Dict, Optional +from typing import Dict, Optional, Any rapid_ocr = None @@ -162,7 +162,7 @@ class RIICReportAnalysis: output += f"综合钱书比例:{(lmb_avg + external_lmb) / (exp_avg + external_exp):.2f}\n" output += f"钱书总和:{lmb_avg + exp_avg:.0f}\n" output += "\n-----效率算法-----\n" - output += f"贸易效率:{trading_efficiency * 100:.0f}%\n" + output += f"贸易效率:{trading_efficiency:.0%}\n" output += f"等效赤金:{gold_by_e:.0f}\n" output += f"经验调平:{balanced_exp_by_e:.0f}\n" if power_plants == 2: @@ -210,8 +210,8 @@ class RIICReportAnalysis: require_at=False, ) class TailoringCommand: - async def initial(self, sender: CommandSender, arg: Optional[str] = CLIArgument()): - if not arg: + async def initial(self, sender: CommandSender, arg: Optional[Any] = CLIArgument()): + if not arg or not isinstance(arg, str): await sender.reply(Text("请输入效率!")) return if arg.endswith("%"): @@ -224,13 +224,13 @@ class TailoringCommand: if efficiency > 30: efficiency /= 100 total_efficiency = efficiency + 1.1 - equiv_efficiency = total_efficiency * 1.241 - gold_efficiency = total_efficiency * 0.233 - lmb = equiv_efficiency * 24 * 60 / 70.138 * 500 + equiv_efficiency = total_efficiency * 1.2410210128 + gold_efficiency = total_efficiency * (1.2410210128 - 1.0141677) * 1.025 + lmb = equiv_efficiency * 24 * 60 / 70.137931 * 500 gold = gold_efficiency * 24 * 60 / 72 * 500 - output = f"整站效率:{total_efficiency * 100:.0f}%\n" - output += f"等效贸易:{(equiv_efficiency - 1) * 100:.0f}%\n" - output += f"等效制造:{gold_efficiency * 100:.0f}%\n" + output = f"整站效率:{total_efficiency:.0%}\n" + output += f"等效贸易:{equiv_efficiency - 1:.0%}\n" + output += f"等效制造:{gold_efficiency:.0%}\n" output += f"订单收益:{lmb:.0f}\n" output += f"赤金收益:{gold:.0f}" await sender.reply(Text(output))