feat(aihitSyncer): В АИХИТ добавлены переносы строк в качестве разделителей. Обновил метод ParseAppsList

This commit is contained in:
Mikhail Trubnikov
2024-08-30 10:17:06 +10:00
parent 1e8d409c77
commit 933bfcbeb1
4 changed files with 25 additions and 103 deletions

View File

@@ -183,7 +183,8 @@ namespace PARR.AIHITSyncer.Services
}
int responseAreaCode = GetResponseAreaCodeFromStr(objFromQuery.ResponseArea) ?? 0;
if (responseAreaCode == 0) {
if (responseAreaCode == 0)
{
logger.LogWarning($"Ошибка при получении ЗО хоста: {objFromQuery.EK}, ЗО: {objFromQuery.ResponseArea}");
return;
}
@@ -286,6 +287,15 @@ namespace PARR.AIHITSyncer.Services
private List<string> ParseAppsList(string appStr)
{
// в АИХИТ стали появляться разделители \r \n находим их и заменяем на ,
if (appStr.Contains("\r") || appStr.Contains("\n"))
{
string orig = appStr;
appStr = appStr.Replace("\r", ",").Replace("\n", ",");
logger.LogDebug($"В строке найдены переносы, заменены на разделители. Исходная строка: {orig}. Результат: {appStr}");
}
var regex = new Regex("\\([^)]*\\)");
if (regex.IsMatch(appStr))