edit
This commit is contained in:
@@ -2186,12 +2186,6 @@ namespace XLAB2
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item.HasTemplate)
|
|
||||||
{
|
|
||||||
skippedWithoutTemplateCount++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var duplicateKey = PsvDocumentLine.BuildDuplicateKey(item.InstrumentType, item.RangeText, item.RegistryNumber, item.SerialNumber);
|
var duplicateKey = PsvDocumentLine.BuildDuplicateKey(item.InstrumentType, item.RangeText, item.RegistryNumber, item.SerialNumber);
|
||||||
if (duplicateKeys.Contains(duplicateKey))
|
if (duplicateKeys.Contains(duplicateKey))
|
||||||
{
|
{
|
||||||
@@ -2282,7 +2276,8 @@ namespace XLAB2
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.TypeItem.HasTemplate)
|
var blockOnMissingEkzmkTemplate = false;
|
||||||
|
if (blockOnMissingEkzmkTemplate && !result.TypeItem.HasTemplate)
|
||||||
{
|
{
|
||||||
_dialogService.ShowWarning("Выбранный тип нельзя добавить: для него не найден шаблон EKZMK, период из TPRMCP или регистрационный период TIPS.");
|
_dialogService.ShowWarning("Выбранный тип нельзя добавить: для него не найден шаблон EKZMK, период из TPRMCP или регистрационный период TIPS.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -3844,30 +3844,26 @@ ORDER BY Priority;";
|
|||||||
private static EkzMkTemplate LoadFallbackTemplate(SqlConnection connection, SqlTransaction transaction, int instrumentId)
|
private static EkzMkTemplate LoadFallbackTemplate(SqlConnection connection, SqlTransaction transaction, int instrumentId)
|
||||||
{
|
{
|
||||||
const string sql = @"
|
const string sql = @"
|
||||||
WITH DefaultLab AS
|
|
||||||
(
|
|
||||||
SELECT
|
|
||||||
CASE WHEN COUNT(DISTINCT m.IDFRPD) = 1 THEN MIN(m.IDFRPD) ELSE NULL END AS DefaultIdFrpd
|
|
||||||
FROM dbo.EKZMK m
|
|
||||||
)
|
|
||||||
SELECT TOP (1)
|
SELECT TOP (1)
|
||||||
COALESCE(periodByInstrument.IDGRSI, periodByType.IDGRSI) AS IDGRSI,
|
COALESCE(periodByInstrument.IDGRSI, periodByType.IDGRSI, verificationSetup.IDGRSI) AS IDGRSI,
|
||||||
COALESCE(periodByInstrument.IDSPVDMC, periodByType.IDSPVDMC) AS IDSPVDMC,
|
COALESCE(periodByInstrument.IDSPVDMC, periodByType.IDSPVDMC) AS IDSPVDMC,
|
||||||
defaultLab.DefaultIdFrpd AS IDFRPD,
|
verificationSetup.IDFRPD AS IDFRPD,
|
||||||
tprz.IDSPKMMK,
|
tprz.IDSPKMMK,
|
||||||
|
verificationSetup.IDSPVDMK AS IDSPVDMK,
|
||||||
|
verificationSetup.IDSPMPOB AS IDSPMPOB,
|
||||||
|
verificationSetup.IDSPVDKL AS IDSPVDKL,
|
||||||
COALESCE(periodByInstrument.PRMK, periodByType.PRMK, tips.PRMKGR) AS PRMK,
|
COALESCE(periodByInstrument.PRMK, periodByType.PRMK, tips.PRMKGR) AS PRMK,
|
||||||
tprz.DPZN AS DPZNmp,
|
tprz.DPZN AS DPZNmp,
|
||||||
tprz.HRTC AS HRTCmp,
|
tprz.HRTC AS HRTCmp,
|
||||||
CAST(
|
CAST(
|
||||||
CASE
|
CASE
|
||||||
WHEN COALESCE(periodByInstrument.PRMK, periodByType.PRMK) IS NOT NULL THEN N'Период из TPRMCP'
|
WHEN COALESCE(periodByInstrument.PRMK, periodByType.PRMK) IS NOT NULL THEN N'Данные TPRMK + период из TPRMCP'
|
||||||
WHEN tips.PRMKGR IS NOT NULL THEN N'Регистрационный период из TIPS'
|
WHEN tips.PRMKGR IS NOT NULL THEN N'Данные TPRMK + регистрационный период из TIPS'
|
||||||
ELSE N''
|
ELSE N''
|
||||||
END AS nvarchar(60)) AS SourceDescription
|
END AS nvarchar(60)) AS SourceDescription
|
||||||
FROM dbo.EKZ z
|
FROM dbo.EKZ z
|
||||||
JOIN dbo.TPRZ tprz ON tprz.IDTPRZ = z.IDTPRZ
|
JOIN dbo.TPRZ tprz ON tprz.IDTPRZ = z.IDTPRZ
|
||||||
JOIN dbo.TIPS tips ON tips.IDTIPS = tprz.IDTIPS
|
JOIN dbo.TIPS tips ON tips.IDTIPS = tprz.IDTIPS
|
||||||
CROSS JOIN DefaultLab defaultLab
|
|
||||||
OUTER APPLY
|
OUTER APPLY
|
||||||
(
|
(
|
||||||
SELECT TOP (1)
|
SELECT TOP (1)
|
||||||
@@ -3889,8 +3885,45 @@ OUTER APPLY
|
|||||||
WHERE t.IDTPRZ = z.IDTPRZ
|
WHERE t.IDTPRZ = z.IDTPRZ
|
||||||
ORDER BY t.IDTPRMCP DESC
|
ORDER BY t.IDTPRMCP DESC
|
||||||
) periodByType
|
) periodByType
|
||||||
|
OUTER APPLY
|
||||||
|
(
|
||||||
|
SELECT TOP (1)
|
||||||
|
mk.IDTPRMK,
|
||||||
|
mk.IDSPVDMK,
|
||||||
|
mk.IDFRPD,
|
||||||
|
mk.IDGRSI,
|
||||||
|
mk.IDSPMPOB,
|
||||||
|
stamp.IDSPVDKL
|
||||||
|
FROM dbo.TPRMK mk
|
||||||
|
LEFT JOIN dbo.SPVDMK verificationType ON verificationType.IDSPVDMK = mk.IDSPVDMK
|
||||||
|
OUTER APPLY
|
||||||
|
(
|
||||||
|
SELECT TOP (1)
|
||||||
|
tp.IDSPVDKL
|
||||||
|
FROM dbo.TPVDKL tp
|
||||||
|
WHERE tp.IDTIPS = tprz.IDTIPS
|
||||||
|
AND tp.IDSPVDMK = mk.IDSPVDMK
|
||||||
|
ORDER BY tp.IDTPVDKL DESC
|
||||||
|
) stamp
|
||||||
|
WHERE mk.IDTPRZ = z.IDTPRZ
|
||||||
|
ORDER BY
|
||||||
|
CASE
|
||||||
|
WHEN UPPER(LTRIM(RTRIM(ISNULL(verificationType.OBVDMK, N'')))) = N'П' THEN 0
|
||||||
|
WHEN UPPER(LTRIM(RTRIM(ISNULL(verificationType.NMVDMK, N'')))) = N'ПОВЕРКА' THEN 1
|
||||||
|
WHEN UPPER(LTRIM(RTRIM(ISNULL(verificationType.NMVDMK, N'')))) LIKE N'ПОВЕРК%' THEN 2
|
||||||
|
WHEN UPPER(LTRIM(RTRIM(ISNULL(verificationType.NMVDMK, N'')))) LIKE N'%ПОВЕРК%' THEN 3
|
||||||
|
ELSE 4
|
||||||
|
END,
|
||||||
|
CASE
|
||||||
|
WHEN COALESCE(periodByInstrument.IDGRSI, periodByType.IDGRSI) IS NOT NULL
|
||||||
|
AND mk.IDGRSI = COALESCE(periodByInstrument.IDGRSI, periodByType.IDGRSI) THEN 0
|
||||||
|
WHEN mk.IDGRSI IS NULL THEN 1
|
||||||
|
ELSE 2
|
||||||
|
END,
|
||||||
|
mk.IDTPRMK DESC
|
||||||
|
) verificationSetup
|
||||||
WHERE z.IDEKZ = @InstrumentId
|
WHERE z.IDEKZ = @InstrumentId
|
||||||
AND defaultLab.DefaultIdFrpd IS NOT NULL
|
AND verificationSetup.IDFRPD IS NOT NULL
|
||||||
AND COALESCE(periodByInstrument.PRMK, periodByType.PRMK, tips.PRMKGR) IS NOT NULL;";
|
AND COALESCE(periodByInstrument.PRMK, periodByType.PRMK, tips.PRMKGR) IS NOT NULL;";
|
||||||
|
|
||||||
using (var command = new SqlCommand(sql, connection, transaction))
|
using (var command = new SqlCommand(sql, connection, transaction))
|
||||||
@@ -3909,13 +3942,13 @@ WHERE z.IDEKZ = @InstrumentId
|
|||||||
IdSpmu = null,
|
IdSpmu = null,
|
||||||
IdGrsi = GetNullableInt32(reader, "IDGRSI"),
|
IdGrsi = GetNullableInt32(reader, "IDGRSI"),
|
||||||
IdKsprl = null,
|
IdKsprl = null,
|
||||||
IdSpvdmk = null,
|
IdSpvdmk = GetNullableInt32(reader, "IDSPVDMK"),
|
||||||
IdSpvdmc = GetNullableInt32(reader, "IDSPVDMC"),
|
IdSpvdmc = GetNullableInt32(reader, "IDSPVDMC"),
|
||||||
IdFrpd = GetInt32(reader, "IDFRPD"),
|
IdFrpd = GetInt32(reader, "IDFRPD"),
|
||||||
IdSpmpob = null,
|
IdSpmpob = GetNullableInt32(reader, "IDSPMPOB"),
|
||||||
IdPrsn = null,
|
IdPrsn = null,
|
||||||
IdSpkmmk = GetNullableInt32(reader, "IDSPKMMK"),
|
IdSpkmmk = GetNullableInt32(reader, "IDSPKMMK"),
|
||||||
IdSpvdkl = null,
|
IdSpvdkl = GetNullableInt32(reader, "IDSPVDKL"),
|
||||||
IdPrsnvd = null,
|
IdPrsnvd = null,
|
||||||
Prmk = GetInt32(reader, "PRMK"),
|
Prmk = GetInt32(reader, "PRMK"),
|
||||||
Stmk = null,
|
Stmk = null,
|
||||||
|
|||||||
BIN
XLAB2/bin-temp-verify-psv-no-template/Azure.Core.dll
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/Azure.Core.dll
Normal file
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/Azure.Identity.dll
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/Azure.Identity.dll
Normal file
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/ClosePsv.docx
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/ClosePsv.docx
Normal file
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/Izv.docx
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/Izv.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/OpenPsv.docx
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/OpenPsv.docx
Normal file
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/Svid.docx
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/Svid.docx
Normal file
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/System.ClientModel.dll
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/System.ClientModel.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/System.Memory.Data.dll
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/System.Memory.Data.dll
Normal file
Binary file not shown.
1007
XLAB2/bin-temp-verify-psv-no-template/XLAB2.deps.json
Normal file
1007
XLAB2/bin-temp-verify-psv-no-template/XLAB2.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
XLAB2/bin-temp-verify-psv-no-template/XLAB2.dll
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/XLAB2.dll
Normal file
Binary file not shown.
BIN
XLAB2/bin-temp-verify-psv-no-template/XLAB2.exe
Normal file
BIN
XLAB2/bin-temp-verify-psv-no-template/XLAB2.exe
Normal file
Binary file not shown.
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net10.0",
|
||||||
|
"frameworks": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "10.0.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "10.0.0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configProperties": {
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false,
|
||||||
|
"CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
XLAB2/bin-temp-verify-psv-no-template/appsettings.json
Normal file
18
XLAB2/bin-temp-verify-psv-no-template/appsettings.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Database": {
|
||||||
|
"ApplicationName": "XLAB2",
|
||||||
|
"CommandTimeoutSeconds": 60,
|
||||||
|
"ConnectRetryCount": 3,
|
||||||
|
"ConnectRetryIntervalSeconds": 10,
|
||||||
|
"ConnectTimeoutSeconds": 15,
|
||||||
|
"Database": "ASUMS",
|
||||||
|
"Encrypt": false,
|
||||||
|
"IntegratedSecurity": true,
|
||||||
|
"MultipleActiveResultSets": true,
|
||||||
|
"Pooling": true,
|
||||||
|
"MaxPoolSize": 100,
|
||||||
|
"MinPoolSize": 0,
|
||||||
|
"Server": "SEVENHILL\\SQLEXPRESS",
|
||||||
|
"TrustServerCertificate": true
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user