|
@ -59,11 +59,11 @@ static string format_zsystem_tp(zsystem_tp tp) { |
|
|
time_t time = system_clock().to_time_t(tp); |
|
|
time_t time = system_clock().to_time_t(tp); |
|
|
struct tm tm = {0}; |
|
|
struct tm tm = {0}; |
|
|
localtime_r(&time, &tm); |
|
|
localtime_r(&time, &tm); |
|
|
return fmt::format("{:0>4}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}", tm.tm_year + 1900, //
|
|
|
|
|
|
tm.tm_mon + 1, //
|
|
|
|
|
|
tm.tm_mday, //
|
|
|
|
|
|
tm.tm_hour, //
|
|
|
|
|
|
tm.tm_min, tm.tm_sec); |
|
|
|
|
|
|
|
|
return fmt::format("{:0>4}-{:0>2}-{:0>2} {:0>2}:{:0>2}", tm.tm_year + 1900, //
|
|
|
|
|
|
tm.tm_mon + 1, //
|
|
|
|
|
|
tm.tm_mday, //
|
|
|
|
|
|
tm.tm_hour, //
|
|
|
|
|
|
tm.tm_min); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static void listDirCSVFile(string path, vector<string>& sv) { |
|
|
static void listDirCSVFile(string path, vector<string>& sv) { |
|
@ -347,6 +347,7 @@ void DisinfectionLogsService::dumpDisinfectionToPrinterLog(string sessionId, lis |
|
|
|
|
|
|
|
|
content += fmt::format("= = = = = = = = = = = = = = = \n"); |
|
|
content += fmt::format("= = = = = = = = = = = = = = = \n"); |
|
|
content += fmt::format(" 全思美特 \n"); |
|
|
content += fmt::format(" 全思美特 \n"); |
|
|
|
|
|
content += fmt::format("消毒ID: {}\n", sessionId); |
|
|
content += fmt::format("操作人员: {}\n", GET_SERVICE(DeviceStateService)->getLoginUid()); |
|
|
content += fmt::format("操作人员: {}\n", GET_SERVICE(DeviceStateService)->getLoginUid()); |
|
|
content += fmt::format("开始时间: {}\n", format_zsystem_tp(m_statistics->start_tp)); |
|
|
content += fmt::format("开始时间: {}\n", format_zsystem_tp(m_statistics->start_tp)); |
|
|
content += fmt::format("结束时间: {}\n", format_zsystem_tp(m_statistics->complete_tp)); |
|
|
content += fmt::format("结束时间: {}\n", format_zsystem_tp(m_statistics->complete_tp)); |
|
@ -382,23 +383,28 @@ void DisinfectionLogsService::dumpDisinfectionToPrinterLog(string sessionId, lis |
|
|
if (state == DisinfectionState::disinfection) { |
|
|
if (state == DisinfectionState::disinfection) { |
|
|
content += fmt::format("{}\n", format_zsystem_tp(snapshot->time)); |
|
|
content += fmt::format("{}\n", format_zsystem_tp(snapshot->time)); |
|
|
if (stateChanged) content += fmt::format("{}\n", m_dmStateDict.getChName(snapshot->state)); |
|
|
if (stateChanged) content += fmt::format("{}\n", m_dmStateDict.getChName(snapshot->state)); |
|
|
content += fmt::format("LOG: {}\n", snapshot->nlog); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (snapshot->nlog > snapshot->tlog) { |
|
|
|
|
|
content += fmt::format("LOG: {:.2f}\n", snapshot->tlog); |
|
|
|
|
|
} else { |
|
|
|
|
|
content += fmt::format("LOG: {:.2f}\n", snapshot->nlog); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
auto h2o2data = snapshot->h2o2Snapshot; |
|
|
auto h2o2data = snapshot->h2o2Snapshot; |
|
|
for (int i = 0; i < h2o2data->getSensorDataNum(); i++) { |
|
|
for (int i = 0; i < h2o2data->getSensorDataNum(); i++) { |
|
|
if (i == 0) { |
|
|
if (i == 0) { |
|
|
content += fmt::format(" [S0] {}(ppm) {}(%RS) {}(%RH) \n", h2o2data->isExpired[0] ? "N/A" : formatSensorVal(h2o2data->h2o2[0]), //
|
|
|
content += fmt::format(" [S0] {}(ppm) {}(%RS) {}(%RH) \n", h2o2data->isExpired[0] ? "N/A" : formatSensorVal(h2o2data->h2o2[0]), //
|
|
|
h2o2data->isExpired[0] ? "N/A" : formatSensorVal(h2o2data->rs[0]), //
|
|
|
|
|
|
|
|
|
h2o2data->isExpired[0] ? "N/A" : formatSensorVal(h2o2data->rs[0]), //
|
|
|
h2o2data->isExpired[0] ? "N/A" : formatSensorVal(h2o2data->rh[0])); |
|
|
h2o2data->isExpired[0] ? "N/A" : formatSensorVal(h2o2data->rh[0])); |
|
|
} |
|
|
} |
|
|
if (i == 1 && !h2o2data->isExpired[1]) { |
|
|
if (i == 1 && !h2o2data->isExpired[1]) { |
|
|
content += fmt::format(" [S1] {}(ppm) {}(%RS) {}(%RH) \n", formatSensorVal(h2o2data->h2o2[1]), //
|
|
|
content += fmt::format(" [S1] {}(ppm) {}(%RS) {}(%RH) \n", formatSensorVal(h2o2data->h2o2[1]), //
|
|
|
formatSensorVal(h2o2data->rs[1]), //
|
|
|
|
|
|
|
|
|
formatSensorVal(h2o2data->rs[1]), //
|
|
|
formatSensorVal(h2o2data->rh[1])); |
|
|
formatSensorVal(h2o2data->rh[1])); |
|
|
} |
|
|
} |
|
|
if (i == 2 && !h2o2data->isExpired[2]) { |
|
|
if (i == 2 && !h2o2data->isExpired[2]) { |
|
|
content += fmt::format(" [S2] {}(ppm) {}(%RS) {}(%RH) \n", formatSensorVal(h2o2data->h2o2[2]), //
|
|
|
content += fmt::format(" [S2] {}(ppm) {}(%RS) {}(%RH) \n", formatSensorVal(h2o2data->h2o2[2]), //
|
|
|
formatSensorVal(h2o2data->rs[2]), //
|
|
|
|
|
|
|
|
|
formatSensorVal(h2o2data->rs[2]), //
|
|
|
formatSensorVal(h2o2data->rh[2])); |
|
|
formatSensorVal(h2o2data->rh[2])); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -570,9 +576,7 @@ void DisinfectionLogsService::getRecord(shared_ptr<MsgProcessContext> cxt, strin |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void DisinfectionLogsService::deleteReport(shared_ptr<MsgProcessContext> cxt, string logName) { |
|
|
|
|
|
deleteRecordFile(logName); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void DisinfectionLogsService::deleteReport(shared_ptr<MsgProcessContext> cxt, string logName) { deleteRecordFile(logName); } |
|
|
|
|
|
|
|
|
void DisinfectionLogsService::exportRecord(shared_ptr<MsgProcessContext> cxt, vector<string> logNames) { |
|
|
void DisinfectionLogsService::exportRecord(shared_ptr<MsgProcessContext> cxt, vector<string> logNames) { |
|
|
vector<string> files; |
|
|
vector<string> files; |
|
@ -585,7 +589,7 @@ void DisinfectionLogsService::exportRecord(shared_ptr<MsgProcessContext> cxt, ve |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
void DisinfectionLogsService::printRecord(shared_ptr<MsgProcessContext> cxt,string logName) { |
|
|
|
|
|
|
|
|
void DisinfectionLogsService::printRecord(shared_ptr<MsgProcessContext> cxt, string logName) { |
|
|
//
|
|
|
//
|
|
|
printRecordFile(logName); |
|
|
printRecordFile(logName); |
|
|
} |
|
|
} |
|
|