ProductionUiCOrdonel: - generic requirement check
This commit is contained in:
+5
-27
@@ -647,6 +647,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
|
|||||||
/// <remarks date="2025-Jan-21" author="Thomas Wiedebusch">
|
/// <remarks date="2025-Jan-21" author="Thomas Wiedebusch">
|
||||||
/// - New IsSpecialApproved and IsStandardApproved.
|
/// - New IsSpecialApproved and IsStandardApproved.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
/// <remarks date="2025-Jun-18" author="Thomas Wiedebusch">
|
||||||
|
/// - Modified for generic checks.
|
||||||
|
/// </remarks>
|
||||||
private EOLStatus CheckRequirements(out String feedbackMsg)
|
private EOLStatus CheckRequirements(out String feedbackMsg)
|
||||||
{
|
{
|
||||||
feedbackMsg = "";
|
feedbackMsg = "";
|
||||||
@@ -658,26 +661,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
|
|||||||
return EOLStatus.FAIL;
|
return EOLStatus.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if requirement is active (free for production) and approved by a second person. Priority special
|
var statusReturn = GenericChecks.CheckRequirements(ProductionRequirements, out feedbackMsg);
|
||||||
// requirement.
|
if (StatusReturn.Failed == statusReturn)
|
||||||
var isSpecialActive = false;
|
|
||||||
var isStandardActive = false;
|
|
||||||
if (ProductionRequirements.IsSpecialActive != null && (Boolean)ProductionRequirements.IsSpecialActive &&
|
|
||||||
ProductionRequirements.IsSpecialApproved != null && (Boolean)ProductionRequirements.IsSpecialApproved)
|
|
||||||
isSpecialActive = true;
|
|
||||||
if (ProductionRequirements.IsStandardActive != null && (Boolean)ProductionRequirements.IsStandardActive &&
|
|
||||||
ProductionRequirements.IsStandardApproved != null && (Boolean)ProductionRequirements.IsStandardApproved)
|
|
||||||
isStandardActive = true;
|
|
||||||
|
|
||||||
// At least one requirement needs to be active and a requirement number and version has to be set
|
|
||||||
if ((!isStandardActive && !isSpecialActive) ||
|
|
||||||
// The standard Id and version have always to be set even if the special is active
|
|
||||||
ProductionRequirements.StandardId == null || ProductionRequirements.StandardVersion == null ||
|
|
||||||
// If the special is active the version and Id have to be defined
|
|
||||||
(isSpecialActive && (ProductionRequirements.SpecialId == null ||
|
|
||||||
ProductionRequirements.SpecialVersion == null)))
|
|
||||||
{
|
{
|
||||||
feedbackMsg = Resources.StrErrorMsgRequirementInactive;
|
|
||||||
EolProgress.RequirementRequestChecked = EOLStatus.FAIL;
|
EolProgress.RequirementRequestChecked = EOLStatus.FAIL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -689,14 +675,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
|
|||||||
EolProgress.SpecialRequirementId = ProductionRequirements.SpecialId;
|
EolProgress.SpecialRequirementId = ProductionRequirements.SpecialId;
|
||||||
EolProgress.SpecialRequirementVersion = ProductionRequirements.SpecialVersion;
|
EolProgress.SpecialRequirementVersion = ProductionRequirements.SpecialVersion;
|
||||||
|
|
||||||
feedbackMsg = isSpecialActive &&
|
|
||||||
ProductionRequirements.SpecialId != null &&
|
|
||||||
ProductionRequirements.SpecialVersion != null ?
|
|
||||||
Resources.StrWarningMsgSpecialRequirementActive +
|
|
||||||
$" Id.Ver: {ProductionRequirements.SpecialId}.{ProductionRequirements.SpecialVersion}" :
|
|
||||||
Resources.StrSuccessMsgRequirementActive +
|
|
||||||
$" Id.Ver {ProductionRequirements.StandardId}.{ProductionRequirements.StandardVersion}";
|
|
||||||
|
|
||||||
EolProgress.RequirementRequestChecked = EOLStatus.OK;
|
EolProgress.RequirementRequestChecked = EOLStatus.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+61
-1
@@ -3,6 +3,7 @@ using Logic.ProductionToProductMapper.Files.Fw;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Xylem.Common.CommonCore.Configuration;
|
using Xylem.Common.CommonCore.Configuration;
|
||||||
using Xylem.Common.CommonCore.Consts;
|
using Xylem.Common.CommonCore.Consts;
|
||||||
@@ -19,6 +20,65 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
|
|||||||
internal static class GenericChecks
|
internal static class GenericChecks
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Check for requirement permission special or standard or none:
|
||||||
|
/// - If the special requirement is active all fields a filled with the according values from this "special"
|
||||||
|
/// requirement,
|
||||||
|
/// - Else those fields contain the "standard" requirements!
|
||||||
|
///
|
||||||
|
/// Software Requirement Specification:
|
||||||
|
/// [SRS_TBF_PICK_PP_CHECK_PROD_STATE_001]_Check_Requirements
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="productionRequirements"></param>
|
||||||
|
/// <param name="feedbackMsg"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <remarks date="2025-Mai-15" author="Thomas Wiedebusch">
|
||||||
|
/// - Initial.
|
||||||
|
/// </remarks>
|
||||||
|
public static StatusReturn CheckRequirements(CordonelRequirements productionRequirements, out String feedbackMsg)
|
||||||
|
{
|
||||||
|
feedbackMsg = "";
|
||||||
|
if (productionRequirements == null)
|
||||||
|
{
|
||||||
|
feedbackMsg = Resources.StrErrorMsgProductionRequirements;
|
||||||
|
return StatusReturn.Failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if requirement is active (free for production) and approved by a second person. Priority special
|
||||||
|
// requirement.
|
||||||
|
var isSpecialActive = false;
|
||||||
|
var isStandardActive = false;
|
||||||
|
if (productionRequirements.IsSpecialActive != null && (Boolean)productionRequirements.IsSpecialActive &&
|
||||||
|
productionRequirements.IsSpecialApproved != null && (Boolean)productionRequirements.IsSpecialApproved)
|
||||||
|
isSpecialActive = true;
|
||||||
|
if (productionRequirements.IsStandardActive != null && (Boolean)productionRequirements.IsStandardActive &&
|
||||||
|
productionRequirements.IsStandardApproved != null && (Boolean)productionRequirements.IsStandardApproved)
|
||||||
|
isStandardActive = true;
|
||||||
|
|
||||||
|
// At least one requirement needs to be active and a requirement number and version has to be set
|
||||||
|
if ((!isStandardActive && !isSpecialActive) ||
|
||||||
|
// The standard Id and version have always to be set even if the special is active
|
||||||
|
productionRequirements.StandardId == null || productionRequirements.StandardVersion == null ||
|
||||||
|
// If the special is active the version and Id have to be defined
|
||||||
|
(isSpecialActive && (productionRequirements.SpecialId == null ||
|
||||||
|
productionRequirements.SpecialVersion == null)))
|
||||||
|
{
|
||||||
|
feedbackMsg = Resources.StrErrorMsgRequirementInactive;
|
||||||
|
return StatusReturn.Failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
feedbackMsg = isSpecialActive &&
|
||||||
|
productionRequirements.SpecialId != null &&
|
||||||
|
productionRequirements.SpecialVersion != null ?
|
||||||
|
Resources.StrWarningMsgSpecialRequirementActive +
|
||||||
|
$" Id.Ver: {productionRequirements.SpecialId}.{productionRequirements.SpecialVersion}" :
|
||||||
|
Resources.StrSuccessMsgRequirementActive +
|
||||||
|
$" Id.Ver {productionRequirements.StandardId}.{productionRequirements.StandardVersion}";
|
||||||
|
|
||||||
|
|
||||||
|
return StatusReturn.Okay;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// Check the measurements from Kitron for this specific Cordonel if it is an EMEA region.
|
/// Check the measurements from Kitron for this specific Cordonel if it is an EMEA region.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="registerRestorer"></param>
|
/// <param name="registerRestorer"></param>
|
||||||
@@ -61,7 +121,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
|
|||||||
return StatusReturn.Failed;
|
return StatusReturn.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
feedbackMsg = Resources.StrSuccessMsgRadioSignalLevels + ". " + meterInfo;
|
feedbackMsg = Resources.StrSuccessMsgRadioSignalLevels + " - " + meterInfo;
|
||||||
return StatusReturn.Okay;
|
return StatusReturn.Okay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+55
-55
@@ -154,14 +154,14 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Picki
|
|||||||
/// - Remaining run time in years,
|
/// - Remaining run time in years,
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <remarks date="2025-Mai-15" author="Roland Drahbesh">
|
/// <remarks date="2025-Jun-18" author="Thomas Wiedebusch">
|
||||||
/// - Initial.
|
/// - Initial.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public override StatusReturn ExecuteProcess()
|
public override StatusReturn ExecuteProcess()
|
||||||
{
|
{
|
||||||
#region ----------------------------------- Check Requirements --------------------------------------------
|
#region ----------------------------------- Check Requirements --------------------------------------------
|
||||||
|
|
||||||
var statusReturn = CheckRequirements(out var feedbackMsg);
|
var statusReturn = GenericChecks.CheckRequirements(ProductionRequirements, out var feedbackMsg);
|
||||||
if (StatusReturn.Failed == statusReturn)
|
if (StatusReturn.Failed == statusReturn)
|
||||||
{
|
{
|
||||||
ErrorMsgDispatcher(feedbackMsg);
|
ErrorMsgDispatcher(feedbackMsg);
|
||||||
@@ -337,64 +337,64 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Picki
|
|||||||
return StatusReturn.Failed;
|
return StatusReturn.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Check for requirement permission special or standard or none:
|
///// Check for requirement permission special or standard or none:
|
||||||
/// - If the special requirement is active all fields a filled with the according values from this "special"
|
///// - If the special requirement is active all fields a filled with the according values from this "special"
|
||||||
/// requirement,
|
///// requirement,
|
||||||
/// - Else those fields contain the "standard" requirements!
|
///// - Else those fields contain the "standard" requirements!
|
||||||
///
|
/////
|
||||||
/// Software Requirement Specification:
|
///// Software Requirement Specification:
|
||||||
/// [SRS_TBF_PICK_PP_CHECK_PROD_STATE_001]_Check_Requirements
|
///// [SRS_TBF_PICK_PP_CHECK_PROD_STATE_001]_Check_Requirements
|
||||||
///
|
/////
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="feedbackMsg"></param>
|
///// <param name="feedbackMsg"></param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
/// <remarks date="2025-Mai-15" author="Thomas Wiedebusch">
|
///// <remarks date="2025-Mai-15" author="Thomas Wiedebusch">
|
||||||
/// - Initial.
|
///// - Initial.
|
||||||
/// </remarks>
|
///// </remarks>
|
||||||
private StatusReturn CheckRequirements(out String feedbackMsg)
|
//private StatusReturn CheckRequirements(out String feedbackMsg)
|
||||||
{
|
//{
|
||||||
feedbackMsg = "";
|
// feedbackMsg = "";
|
||||||
if (ProductionRequirements == null)
|
// if (ProductionRequirements == null)
|
||||||
{
|
// {
|
||||||
feedbackMsg = Resources.StrErrorMsgProductionRequirements;
|
// feedbackMsg = Resources.StrErrorMsgProductionRequirements;
|
||||||
return StatusReturn.Failed;
|
// return StatusReturn.Failed;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Check if requirement is active (free for production) and approved by a second person. Priority special
|
// // Check if requirement is active (free for production) and approved by a second person. Priority special
|
||||||
// requirement.
|
// // requirement.
|
||||||
var isSpecialActive = false;
|
// var isSpecialActive = false;
|
||||||
var isStandardActive = false;
|
// var isStandardActive = false;
|
||||||
if (ProductionRequirements.IsSpecialActive != null && (Boolean)ProductionRequirements.IsSpecialActive &&
|
// if (ProductionRequirements.IsSpecialActive != null && (Boolean)ProductionRequirements.IsSpecialActive &&
|
||||||
ProductionRequirements.IsSpecialApproved != null && (Boolean)ProductionRequirements.IsSpecialApproved)
|
// ProductionRequirements.IsSpecialApproved != null && (Boolean)ProductionRequirements.IsSpecialApproved)
|
||||||
isSpecialActive = true;
|
// isSpecialActive = true;
|
||||||
if (ProductionRequirements.IsStandardActive != null && (Boolean)ProductionRequirements.IsStandardActive &&
|
// if (ProductionRequirements.IsStandardActive != null && (Boolean)ProductionRequirements.IsStandardActive &&
|
||||||
ProductionRequirements.IsStandardApproved != null && (Boolean)ProductionRequirements.IsStandardApproved)
|
// ProductionRequirements.IsStandardApproved != null && (Boolean)ProductionRequirements.IsStandardApproved)
|
||||||
isStandardActive = true;
|
// isStandardActive = true;
|
||||||
|
|
||||||
// At least one requirement needs to be active and a requirement number and version has to be set
|
// // At least one requirement needs to be active and a requirement number and version has to be set
|
||||||
if ((!isStandardActive && !isSpecialActive) ||
|
// if ((!isStandardActive && !isSpecialActive) ||
|
||||||
// The standard Id and version have always to be set even if the special is active
|
// // The standard Id and version have always to be set even if the special is active
|
||||||
ProductionRequirements.StandardId == null || ProductionRequirements.StandardVersion == null ||
|
// ProductionRequirements.StandardId == null || ProductionRequirements.StandardVersion == null ||
|
||||||
// If the special is active the version and Id have to be defined
|
// // If the special is active the version and Id have to be defined
|
||||||
(isSpecialActive && (ProductionRequirements.SpecialId == null ||
|
// (isSpecialActive && (ProductionRequirements.SpecialId == null ||
|
||||||
ProductionRequirements.SpecialVersion == null)))
|
// ProductionRequirements.SpecialVersion == null)))
|
||||||
{
|
// {
|
||||||
feedbackMsg = Resources.StrErrorMsgRequirementInactive;
|
// feedbackMsg = Resources.StrErrorMsgRequirementInactive;
|
||||||
return StatusReturn.Failed;
|
// return StatusReturn.Failed;
|
||||||
}
|
// }
|
||||||
|
|
||||||
feedbackMsg = isSpecialActive &&
|
// feedbackMsg = isSpecialActive &&
|
||||||
ProductionRequirements.SpecialId != null &&
|
// ProductionRequirements.SpecialId != null &&
|
||||||
ProductionRequirements.SpecialVersion != null ?
|
// ProductionRequirements.SpecialVersion != null ?
|
||||||
Resources.StrWarningMsgSpecialRequirementActive +
|
// Resources.StrWarningMsgSpecialRequirementActive +
|
||||||
$" Id.Ver: {ProductionRequirements.SpecialId}.{ProductionRequirements.SpecialVersion}" :
|
// $" Id.Ver: {ProductionRequirements.SpecialId}.{ProductionRequirements.SpecialVersion}" :
|
||||||
Resources.StrSuccessMsgRequirementActive +
|
// Resources.StrSuccessMsgRequirementActive +
|
||||||
$" Id.Ver {ProductionRequirements.StandardId}.{ProductionRequirements.StandardVersion}";
|
// $" Id.Ver {ProductionRequirements.StandardId}.{ProductionRequirements.StandardVersion}";
|
||||||
|
|
||||||
|
|
||||||
return StatusReturn.Okay;
|
// return StatusReturn.Okay;
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check production order number between meter and requirements.
|
/// Check production order number between meter and requirements.
|
||||||
|
|||||||
Reference in New Issue
Block a user