From e67fc86dbb5e5a43277f0d54502a47f814709bda Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 18 Jul 2025 16:52:36 +0800 Subject: [PATCH] =?UTF-8?q?v3.3.3=20|=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E6=96=B9=E6=B7=BB=E5=8A=A0=E5=AE=A1=E8=AE=A1=20=E7=BE=8E?= =?UTF-8?q?=E5=8C=96=E9=83=A8=E5=88=86=E5=AE=A1=E8=AE=A1=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appsrc/appconfig/basic/zappversion.hpp | 2 +- appsrc/service/app/disinfection_ctrl_service_ext.cpp | 6 +++--- appsrc/service/setting_mgr_service.cpp | 19 ++++++++++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/appsrc/appconfig/basic/zappversion.hpp b/appsrc/appconfig/basic/zappversion.hpp index e104544..a3eab0a 100644 --- a/appsrc/appconfig/basic/zappversion.hpp +++ b/appsrc/appconfig/basic/zappversion.hpp @@ -1,3 +1,3 @@ #pragma once -#define VERSION "3.3.2" +#define VERSION "3.3.3" #define PROJECT_NAME "TRANSMIT_DM" \ No newline at end of file diff --git a/appsrc/service/app/disinfection_ctrl_service_ext.cpp b/appsrc/service/app/disinfection_ctrl_service_ext.cpp index 62a150b..92d81f8 100644 --- a/appsrc/service/app/disinfection_ctrl_service_ext.cpp +++ b/appsrc/service/app/disinfection_ctrl_service_ext.cpp @@ -77,14 +77,14 @@ void DisinfectionCtrlServiceExt::start(shared_ptr cxt, string // 从setting中获取实时参数 int level = atoi(loglevel.c_str()); dcs->start(level); - ADD_USER_BEHAVIOR(ds->getLoginName(), fmt::format("开始消毒Log{}", level)); + ADD_USER_BEHAVIOR(ds->getLoginName(), fmt::format("开始消毒 Log{}", level)); // m_state = DisinfectionState::preheat; if (stateUpdateThread) stateUpdateThread->wake(); } void DisinfectionCtrlServiceExt::startWithFormula(shared_ptr cxt, string formulaid) { // json formula = dcs->startWithFormula(formulaid); string logLevel = formula[SettingId::toString(SettingId::kloglevel)]; - ADD_USER_BEHAVIOR(ds->getLoginName(), fmt::format("启动配置方{}Log{}", formula["name"], logLevel)); + ADD_USER_BEHAVIOR(ds->getLoginName(), fmt::format("启动配方 {}, Log{}", formula["name"], logLevel)); if (stateUpdateThread) stateUpdateThread->wake(); } void DisinfectionCtrlServiceExt::stop(shared_ptr cxt) { @@ -103,7 +103,7 @@ void DisinfectionCtrlServiceExt::getRealtimeConfig(shared_ptr void DisinfectionCtrlServiceExt::updateTargetLogLevel(shared_ptr cxt, float loglevel) { auto tLog = dcs->getTlog(); dcs->updateTargetLogLevel(loglevel); - ADD_USER_BEHAVIOR(ds->getLoginName(), fmt::format("实时修改LOG{}->{}", int(tLog + 0.5), (int)(loglevel + 0.5))); + ADD_USER_BEHAVIOR(ds->getLoginName(), fmt::format("实时修改 Log{}->Log{}", int(tLog + 0.5), (int)(loglevel + 0.5))); } void DisinfectionCtrlServiceExt::setRealtimeConfig(shared_ptr cxt, string key, string val) { diff --git a/appsrc/service/setting_mgr_service.cpp b/appsrc/service/setting_mgr_service.cpp index 0056d10..bf408ae 100644 --- a/appsrc/service/setting_mgr_service.cpp +++ b/appsrc/service/setting_mgr_service.cpp @@ -30,7 +30,7 @@ void SettingMgrService::setSettingVal(shared_ptr cxt, Setting APPCHECK(suc, err::kappe_db_operate_error, "setSettingVal failed"); auto setting = SETTING_DB->getSetting(settingName.toString()); - ADD_USER_BEHAVIOR(DS->getLoginName(), fmt::format("设置{}为{}", setting ? setting->name_ch : settingName.toString(), settingVal)); + ADD_USER_BEHAVIOR(DS->getLoginName(), fmt::format("设置 {} 为 {}", setting ? setting->name_ch : settingName.toString(), settingVal)); } void SettingMgrService::getAllFormula(shared_ptr cxt) { cxt->rely = FORMULA_DB->getAllFormula(); } @@ -62,6 +62,22 @@ void SettingMgrService::updateFormula(shared_ptr cxt, string } FORMULA_DB->updateFormula(formula_id, formula); + + string formulaName; + try { + formulaName = formula["name"]; + } catch (const std::exception& e) { + } + + string formulaContent = formula.dump(0); + //替换 { 为 | } 为 | + replace(formulaContent.begin(), formulaContent.end(), '{', '|'); + replace(formulaContent.begin(), formulaContent.end(), '}', '|'); + //替换" 为 空格 + replace(formulaContent.begin(), formulaContent.end(), '"', ' '); + + + ADD_USER_BEHAVIOR(DS->getLoginName(), fmt::format("更新配方 {} {}", formulaName, formula.dump())); return; } void SettingMgrService::updateFormulaIterm(shared_ptr cxt, string formula_id, string itemName, string val) { @@ -73,3 +89,4 @@ void SettingMgrService::factoryResetSettings(shared_ptr cxt) ADD_USER_BEHAVIOR(DS->getLoginName(), fmt::format("恢复出厂设置")); cxt->rely = SETTING_DB->getAllSetting(); } +