Ran formatting through code
This commit is contained in:
parent
ba6d7b19e7
commit
8d65b82af6
268
.editorconfig
268
.editorconfig
@ -0,0 +1,268 @@
|
|||||||
|
[*.cs]
|
||||||
|
csharp_indent_block_contents = true
|
||||||
|
csharp_indent_braces = false
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_case_contents_when_block = true
|
||||||
|
csharp_indent_labels = one_less_than_current
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
csharp_new_line_before_catch = true
|
||||||
|
csharp_new_line_before_else = true
|
||||||
|
csharp_new_line_before_finally = true
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = all
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
csharp_prefer_braces = false:silent
|
||||||
|
csharp_prefer_qualified_reference = true:error
|
||||||
|
csharp_prefer_simple_default_expression = true:warning
|
||||||
|
csharp_prefer_simple_using_statement = true:warning
|
||||||
|
csharp_prefer_static_local_function = true:warning
|
||||||
|
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = false
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = false
|
||||||
|
csharp_space_before_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_before_comma = false
|
||||||
|
csharp_space_before_dot = false
|
||||||
|
csharp_space_before_open_square_brackets = false
|
||||||
|
csharp_space_before_semicolon_in_for_statement = false
|
||||||
|
csharp_space_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||||
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_parentheses = false
|
||||||
|
csharp_space_between_square_brackets = false
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
csharp_style_conditional_delegate_call = true
|
||||||
|
csharp_style_deconstructed_variable_declaration = false
|
||||||
|
csharp_style_expression_bodied_accessors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_constructors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_indexers = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_methods = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_operators = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_properties = when_on_single_line:warning
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
|
||||||
|
csharp_style_inlined_variable_declaration = false
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
csharp_style_pattern_local_over_anonymous_function = true:warning
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:warning
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||||
|
csharp_style_prefer_index_operator = true:warning
|
||||||
|
csharp_style_prefer_not_pattern = true:warning
|
||||||
|
csharp_style_prefer_null_check_over_type_check = true:suggestion
|
||||||
|
csharp_style_prefer_pattern_matching = true:warning
|
||||||
|
csharp_style_prefer_range_operator = true:warning
|
||||||
|
csharp_style_prefer_switch_expression = true:warning
|
||||||
|
csharp_style_throw_expression = true:suggestion
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable:warning
|
||||||
|
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
|
||||||
|
csharp_style_var_elsewhere = false:warning
|
||||||
|
csharp_style_var_for_built_in_types = false:warning
|
||||||
|
csharp_style_var_when_type_is_apparent = false:warning
|
||||||
|
csharp_using_directive_placement = outside_namespace:silent
|
||||||
|
dotnet_code_quality_unused_parameters = all
|
||||||
|
dotnet_code_quality_unused_parameters = non_public # IDE0060: Remove unused parameter
|
||||||
|
dotnet_code_quality.CAXXXX.api_surface = private, internal
|
||||||
|
dotnet_diagnostic.CA1825.severity = warning # CA1823: Avoid zero-length array allocations
|
||||||
|
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
|
||||||
|
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
|
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||||
|
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||||
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||||
|
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary
|
||||||
|
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||||
|
dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed
|
||||||
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||||
|
dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.symbols = class
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.symbols = event
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.symbols = property
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||||
|
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||||
|
dotnet_naming_style.begins_with_i.required_suffix =
|
||||||
|
dotnet_naming_style.begins_with_i.word_separator =
|
||||||
|
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.pascal_case.required_prefix =
|
||||||
|
dotnet_naming_style.pascal_case.required_suffix =
|
||||||
|
dotnet_naming_style.pascal_case.word_separator =
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_prefix = _
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_suffix =
|
||||||
|
dotnet_naming_style.private_of_internal_field.word_separator =
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.abstract_method.required_modifiers = abstract
|
||||||
|
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.class.applicable_kinds = class
|
||||||
|
dotnet_naming_symbols.class.required_modifiers =
|
||||||
|
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.delegate.applicable_kinds = delegate
|
||||||
|
dotnet_naming_symbols.delegate.required_modifiers =
|
||||||
|
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.enum.applicable_kinds = enum
|
||||||
|
dotnet_naming_symbols.enum.required_modifiers =
|
||||||
|
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.event.applicable_kinds = event
|
||||||
|
dotnet_naming_symbols.event.required_modifiers =
|
||||||
|
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||||
|
dotnet_naming_symbols.interface.required_modifiers =
|
||||||
|
dotnet_naming_symbols.method.applicable_accessibilities = public
|
||||||
|
dotnet_naming_symbols.method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||||
|
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_method.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.private_method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.property.applicable_kinds = property
|
||||||
|
dotnet_naming_symbols.property.required_modifiers =
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.static_method.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.struct.applicable_kinds = struct
|
||||||
|
dotnet_naming_symbols.struct.required_modifiers =
|
||||||
|
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
|
dotnet_remove_unnecessary_suppression_exclusions = 0
|
||||||
|
dotnet_separate_import_directive_groups = false
|
||||||
|
dotnet_sort_system_directives_first = false
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
|
dotnet_style_coalesce_expression = true
|
||||||
|
dotnet_style_collection_initializer = true:warning
|
||||||
|
dotnet_style_explicit_tuple_names = true:warning
|
||||||
|
dotnet_style_namespace_match_folder = true
|
||||||
|
dotnet_style_null_propagation = true:warning
|
||||||
|
dotnet_style_object_initializer = true:warning
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:warning
|
||||||
|
dotnet_style_prefer_auto_properties = true:warning
|
||||||
|
dotnet_style_prefer_compound_assignment = true:warning
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = false
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = false
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:warning
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true
|
||||||
|
dotnet_style_qualification_for_event = false:error
|
||||||
|
dotnet_style_qualification_for_field = false
|
||||||
|
dotnet_style_qualification_for_method = false:error
|
||||||
|
dotnet_style_qualification_for_property = false:error
|
||||||
|
dotnet_style_readonly_field = true:warning
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 4
|
||||||
|
csharp_style_prefer_method_group_conversion = true:silent
|
||||||
|
csharp_style_prefer_top_level_statements = true:silent
|
||||||
|
csharp_style_prefer_local_over_anonymous_function = true:suggestion
|
||||||
|
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
||||||
|
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
||||||
|
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
||||||
|
[*.{cs,vb}]
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
tab_width = 4
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = crlf
|
||||||
|
dotnet_style_coalesce_expression = true:suggestion
|
||||||
|
dotnet_style_null_propagation = true:warning
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||||
|
dotnet_style_prefer_auto_properties = true:warning
|
||||||
|
dotnet_style_object_initializer = true:warning
|
||||||
|
dotnet_style_collection_initializer = true:warning
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = false:silent
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = false:silent
|
||||||
|
dotnet_style_explicit_tuple_names = true:warning
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:warning
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
|
||||||
|
dotnet_style_prefer_compound_assignment = true:warning
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true:suggestion
|
||||||
|
dotnet_style_namespace_match_folder = true:suggestion
|
@ -2,92 +2,57 @@
|
|||||||
using ReportingServices.Shared.Models.PlanningReport;
|
using ReportingServices.Shared.Models.PlanningReport;
|
||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
using ReportingServices.Shared.Repositories;
|
using ReportingServices.Shared.Repositories;
|
||||||
using ReportingServices.Shared.ViewModels.ProductionReport;
|
|
||||||
|
|
||||||
namespace ReportingServices.API.Controllers
|
namespace ReportingServices.API.Controllers;
|
||||||
|
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class ScrapeDBController : ControllerBase
|
||||||
{
|
{
|
||||||
[Route("api/[controller]")]
|
private readonly IScrapeDatabaseRepository _scrapeDBRepository;
|
||||||
[ApiController]
|
|
||||||
public class ScrapeDBController : ControllerBase
|
public ScrapeDBController(IScrapeDatabaseRepository scrapeDBRepository) => _scrapeDBRepository = scrapeDBRepository;
|
||||||
|
|
||||||
|
[HttpGet("ReactorOuts")]
|
||||||
|
public YieldInformation GetReactorOuts(string startDate, string endDate)
|
||||||
{
|
{
|
||||||
private readonly IScrapeDatabaseRepository _scrapeDBRepository;
|
List<ReactorOutsByRDS> outs = _scrapeDBRepository.GetRDSRunBetweenDates(startDate, endDate);
|
||||||
|
YieldInformation yieldInformation = new()
|
||||||
public ScrapeDBController(IScrapeDatabaseRepository scrapeDBRepository)
|
|
||||||
{
|
{
|
||||||
_scrapeDBRepository = scrapeDBRepository;
|
Outs = outs,
|
||||||
}
|
Scrap = _scrapeDBRepository.GetScrapByDay(outs)
|
||||||
|
};
|
||||||
|
|
||||||
[HttpGet("ReactorOuts")]
|
return yieldInformation;
|
||||||
public YieldInformation GetReactorOuts(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
List<ReactorOutsByRDS> outs = _scrapeDBRepository.GetRDSRunBetweenDates(startDate, endDate);
|
|
||||||
YieldInformation yieldInformation = new()
|
|
||||||
{
|
|
||||||
Outs = outs,
|
|
||||||
Scrap = _scrapeDBRepository.GetScrapByDay(outs)
|
|
||||||
};
|
|
||||||
|
|
||||||
return yieldInformation;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("PSNWO")]
|
|
||||||
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetReactorPSNWORuns(startDate, endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("PartChanges")]
|
|
||||||
public int GetNumberOfPartChanges(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetNumberOfPartChanges(startDate, endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Targets")]
|
|
||||||
public QuarterlyTargets GetQuarterlyTargets()
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetQuarterlyTargets();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Reactors")]
|
|
||||||
public List<Reactor> GetReactors()
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetReactors();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("RDS")]
|
|
||||||
public List<RDS> GetRDSForLastDay(string date)
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetRDSForLastDay(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("ReactorEvents")]
|
|
||||||
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber)
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetReactorEvents(startDate, endDate, reactorNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("GetLastUpTransaction")]
|
|
||||||
public int GetLastUpTransaction(string reactorNumber)
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetLastUpTransaction(reactorNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("ToolEvents")]
|
|
||||||
public ToolEvent GetLatestToolEvent(string toolID)
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetLatestToolEvent(toolID);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("GetOutsAndScrapTotals")]
|
|
||||||
public OutsAndScrapTotal GetOutsAndScrapTotal(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetOutsAndScrapTotals(startDate, endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("GetQuarterStartDate")]
|
|
||||||
public DateTime GetQuarterStartDate()
|
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetQuarterStartDate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
[HttpGet("PSNWO")]
|
||||||
|
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate) => _scrapeDBRepository.GetReactorPSNWORuns(startDate, endDate);
|
||||||
|
|
||||||
|
[HttpGet("PartChanges")]
|
||||||
|
public int GetNumberOfPartChanges(string startDate, string endDate) => _scrapeDBRepository.GetNumberOfPartChanges(startDate, endDate);
|
||||||
|
|
||||||
|
[HttpGet("Targets")]
|
||||||
|
public QuarterlyTargets GetQuarterlyTargets() => _scrapeDBRepository.GetQuarterlyTargets();
|
||||||
|
|
||||||
|
[HttpGet("Reactors")]
|
||||||
|
public List<Reactor> GetReactors() => _scrapeDBRepository.GetReactors();
|
||||||
|
|
||||||
|
[HttpGet("RDS")]
|
||||||
|
public List<RDS> GetRDSForLastDay(string date) => _scrapeDBRepository.GetRDSForLastDay(date);
|
||||||
|
|
||||||
|
[HttpGet("ReactorEvents")]
|
||||||
|
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber) => _scrapeDBRepository.GetReactorEvents(startDate, endDate, reactorNumber);
|
||||||
|
|
||||||
|
[HttpGet("GetLastUpTransaction")]
|
||||||
|
public int GetLastUpTransaction(string reactorNumber) => _scrapeDBRepository.GetLastUpTransaction(reactorNumber);
|
||||||
|
|
||||||
|
[HttpGet("ToolEvents")]
|
||||||
|
public ToolEvent GetLatestToolEvent(string toolID) => _scrapeDBRepository.GetLatestToolEvent(toolID);
|
||||||
|
|
||||||
|
[HttpGet("GetOutsAndScrapTotals")]
|
||||||
|
public OutsAndScrapTotal GetOutsAndScrapTotal(string startDate, string endDate) => _scrapeDBRepository.GetOutsAndScrapTotals(startDate, endDate);
|
||||||
|
|
||||||
|
[HttpGet("GetQuarterStartDate")]
|
||||||
|
public DateTime GetQuarterStartDate() => _scrapeDBRepository.GetQuarterStartDate();
|
||||||
|
}
|
@ -1,47 +1,53 @@
|
|||||||
using ReportingServices.Shared.Repositories;
|
using ReportingServices.Shared.Repositories;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
LoggerConfiguration loggerConfiguration = new();
|
internal class Program
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
|
||||||
Environment.SetEnvironmentVariable("workingDirectory", "D:\\tmp\\logging\\MesaReportingServices\\API");
|
|
||||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, builder.Configuration);
|
|
||||||
_ = SerilogHostBuilderExtensions.UseSerilog(builder.Host);
|
|
||||||
Log.Logger = loggerConfiguration.CreateLogger();
|
|
||||||
Serilog.ILogger log = Log.ForContext<Program>();
|
|
||||||
// Add services to the container.
|
|
||||||
builder.Services.AddControllers();
|
|
||||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
|
||||||
builder.Services.AddSwaggerGen();
|
|
||||||
builder.Services.AddScoped<IScrapeDatabaseRepository, ScrapeDatabaseRepository>();
|
|
||||||
|
|
||||||
var app = builder.Build();
|
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
|
||||||
if (app.Environment.IsDevelopment())
|
|
||||||
{
|
{
|
||||||
app.UseSwagger();
|
private static void Main(string[] args)
|
||||||
app.UseSwaggerUI();
|
{
|
||||||
}
|
LoggerConfiguration loggerConfiguration = new();
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||||
|
Environment.SetEnvironmentVariable("workingDirectory", "D:\\tmp\\logging\\MesaReportingServices\\API");
|
||||||
|
_ = loggerConfiguration.ReadFrom.Configuration(builder.Configuration);
|
||||||
|
_ = builder.Host.UseSerilog();
|
||||||
|
Log.Logger = loggerConfiguration.CreateLogger();
|
||||||
|
Serilog.ILogger log = Log.ForContext<Program>();
|
||||||
|
// Add services to the container.
|
||||||
|
_ = builder.Services.AddControllers();
|
||||||
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||||
|
_ = builder.Services.AddEndpointsApiExplorer();
|
||||||
|
_ = builder.Services.AddSwaggerGen();
|
||||||
|
_ = builder.Services.AddScoped<IScrapeDatabaseRepository, ScrapeDatabaseRepository>();
|
||||||
|
|
||||||
app.UseAuthorization();
|
WebApplication app = builder.Build();
|
||||||
|
|
||||||
app.MapControllers();
|
// Configure the HTTP request pipeline.
|
||||||
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
if (app.Environment.IsDevelopment())
|
||||||
log.Information("Starting Web APIs");
|
{
|
||||||
|
_ = app.UseSwagger();
|
||||||
|
_ = app.UseSwaggerUI();
|
||||||
|
}
|
||||||
|
|
||||||
try
|
_ = app.UseHttpsRedirection();
|
||||||
{
|
|
||||||
app.Run();
|
_ = app.UseAuthorization();
|
||||||
}
|
|
||||||
catch (Exception ex)
|
_ = app.MapControllers();
|
||||||
{
|
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
||||||
log.Fatal(ex, "Host terminated unexpectedly");
|
log.Information("Starting Web APIs");
|
||||||
}
|
|
||||||
finally
|
try
|
||||||
{
|
{
|
||||||
Log.CloseAndFlush();
|
app.Run();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Fatal(ex, "Host terminated unexpectedly");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,56 +1,53 @@
|
|||||||
using System.Web;
|
namespace ReportingServices.Shared.HelperClasses;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.HelperClasses
|
public static class APIHelperFunctions
|
||||||
{
|
{
|
||||||
public static class APIHelperFunctions
|
public static string GetBeginningOfWeekAsAPIString()
|
||||||
{
|
{
|
||||||
public static string GetBeginningOfWeekAsAPIString()
|
DateTime date = DateTime.Now;
|
||||||
|
|
||||||
|
int dayOfWeek = (int)date.DayOfWeek;
|
||||||
|
|
||||||
|
date = dayOfWeek switch
|
||||||
{
|
{
|
||||||
DateTime date = DateTime.Now;
|
0 => date.AddDays(-6),
|
||||||
|
1 => date,
|
||||||
|
_ => date.AddDays(1 - dayOfWeek)
|
||||||
|
};
|
||||||
|
|
||||||
int dayOfWeek = (int)date.DayOfWeek;
|
return GetDateTimeAsAPIString(date.ToString(), false);
|
||||||
|
|
||||||
date = dayOfWeek switch
|
|
||||||
{
|
|
||||||
0 => date.AddDays(-6),
|
|
||||||
1 => date,
|
|
||||||
_ => date.AddDays(1 - dayOfWeek)
|
|
||||||
};
|
|
||||||
|
|
||||||
return GetDateTimeAsAPIString(date.ToString(), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetDateWithOffsetAsAPIString(string dateString, float offset)
|
|
||||||
{
|
|
||||||
DateTime date = DateTime.Parse(dateString);
|
|
||||||
|
|
||||||
date = date.AddHours(offset);
|
|
||||||
|
|
||||||
return GetDateTimeAsAPIString(date.ToString(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetDateTimeAsAPIString(string dateString, bool fullDateTime)
|
|
||||||
{
|
|
||||||
DateTime date = DateTime.Parse(dateString);
|
|
||||||
|
|
||||||
if (fullDateTime)
|
|
||||||
dateString = date.ToString("yyyy-M-d HH:mm:ss");
|
|
||||||
else
|
|
||||||
dateString = date.Year + "-" + date.Month + "-" + date.Day + " 0:0:0";
|
|
||||||
|
|
||||||
return dateString;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<T> ReverseList<T>(List<T> inputList)
|
|
||||||
{
|
|
||||||
List<T> temp = new();
|
|
||||||
|
|
||||||
for (int i = inputList.Count - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
temp.Add(inputList[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return temp;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static string GetDateWithOffsetAsAPIString(string dateString, float offset)
|
||||||
|
{
|
||||||
|
DateTime date = DateTime.Parse(dateString);
|
||||||
|
|
||||||
|
date = date.AddHours(offset);
|
||||||
|
|
||||||
|
return GetDateTimeAsAPIString(date.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetDateTimeAsAPIString(string dateString, bool fullDateTime)
|
||||||
|
{
|
||||||
|
DateTime date = DateTime.Parse(dateString);
|
||||||
|
|
||||||
|
if (fullDateTime)
|
||||||
|
dateString = date.ToString("yyyy-M-d HH:mm:ss");
|
||||||
|
else
|
||||||
|
dateString = date.Year + "-" + date.Month + "-" + date.Day + " 0:0:0";
|
||||||
|
|
||||||
|
return dateString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<T> ReverseList<T>(List<T> inputList)
|
||||||
|
{
|
||||||
|
List<T> temp = new();
|
||||||
|
|
||||||
|
for (int i = inputList.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
temp.Add(inputList[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
}
|
@ -1,22 +1,19 @@
|
|||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using System.Text.Json;
|
||||||
using System.Net.Http.Json;
|
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace ReportingServices.Shared.HelperClasses
|
namespace ReportingServices.Shared.HelperClasses;
|
||||||
|
|
||||||
|
public static class ApiCaller
|
||||||
{
|
{
|
||||||
public static class ApiCaller
|
public static async Task<T> GetApi<T>(string url)
|
||||||
{
|
{
|
||||||
public static async Task<T> GetApi<T>(string url)
|
T deserializedJson = default;
|
||||||
|
|
||||||
|
using (HttpClient client = new())
|
||||||
{
|
{
|
||||||
T deserializedJson = default(T);
|
string apiResponse = await client.GetStringAsync(url);
|
||||||
|
deserializedJson = JsonSerializer.Deserialize<T>(apiResponse);
|
||||||
using (HttpClient client = new())
|
|
||||||
{
|
|
||||||
string apiResponse = await client.GetStringAsync(url);
|
|
||||||
deserializedJson = JsonSerializer.Deserialize<T>(apiResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
return deserializedJson;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return deserializedJson;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,181 +2,180 @@
|
|||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
using ReportingServices.Shared.ViewModels.ProductionReport;
|
using ReportingServices.Shared.ViewModels.ProductionReport;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.HelperClasses
|
namespace ReportingServices.Shared.HelperClasses;
|
||||||
|
|
||||||
|
public static class DailyReportHelper
|
||||||
{
|
{
|
||||||
public static class DailyReportHelper
|
private static readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
||||||
|
private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.json";
|
||||||
|
|
||||||
|
public static DailyReport SetUpDailyReport(ILogger logger, string baseUrlScrapeDb)
|
||||||
{
|
{
|
||||||
private static readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
DailyReport report = new();
|
||||||
private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.json";
|
|
||||||
|
|
||||||
public static DailyReport SetUpDailyReport(ILogger logger, string baseUrlScrapeDb)
|
try
|
||||||
{
|
{
|
||||||
DailyReport report = new();
|
report.SLLTools = JsonFileHandler.LoadJSONFile<List<SLLTool>>(_SLLFilePath);
|
||||||
|
report.ManualReportEntries = JsonFileHandler.LoadJSONFile<ManualReportEntries>(_dailyRptFilePath);
|
||||||
|
|
||||||
try
|
}
|
||||||
{
|
catch (Exception ex)
|
||||||
report.SLLTools = JsonFileHandler.LoadJSONFile<List<SLLTool>>(_SLLFilePath);
|
{
|
||||||
report.ManualReportEntries = JsonFileHandler.LoadJSONFile<ManualReportEntries>(_dailyRptFilePath);
|
logger.LogError(ex, "Failed to load JsonFiles.");
|
||||||
|
logger.LogInformation("SLL File Path: {path}", _SLLFilePath);
|
||||||
}
|
logger.LogInformation("Manual Report Entries File Path: {path}", _dailyRptFilePath);
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
logger.LogError(ex, "Failed to load JsonFiles.");
|
|
||||||
logger.LogInformation("SLL File Path: {path}", _SLLFilePath);
|
|
||||||
logger.LogInformation("Manual Report Entries File Path: {path}", _dailyRptFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<string> cleanTools = new()
|
|
||||||
{
|
|
||||||
"AHPS",
|
|
||||||
"AKRION1",
|
|
||||||
"CB3",
|
|
||||||
"MES",
|
|
||||||
"SRD 1",
|
|
||||||
"SRD 2"
|
|
||||||
};
|
|
||||||
|
|
||||||
List<string> metrologyTools = new()
|
|
||||||
{
|
|
||||||
"ASET",
|
|
||||||
"BIORAD2",
|
|
||||||
"BIORAD3",
|
|
||||||
"BIORAD4",
|
|
||||||
"BIORAD5",
|
|
||||||
"CDE2",
|
|
||||||
"CDE3",
|
|
||||||
"CDE5",
|
|
||||||
"FLEXUS",
|
|
||||||
"HGCV1",
|
|
||||||
"HGCV2",
|
|
||||||
"HGCV3",
|
|
||||||
"SRP"
|
|
||||||
};
|
|
||||||
|
|
||||||
List<Reactor> reactors = new();
|
|
||||||
Dictionary<string, Task<int>> lastUpTransactions = new();
|
|
||||||
List<Task<List<ReactorEvent>>> toolEvents = new();
|
|
||||||
List<Task<ToolEvent>> cleanEvents = new();
|
|
||||||
List<Task<ToolEvent>> metrologyEvents = new();
|
|
||||||
|
|
||||||
Task<YieldInformation> task1 = null;
|
|
||||||
Task<YieldInformation> task2 = null;
|
|
||||||
Task<QuarterlyTargets> targets = null;
|
|
||||||
Task<List<RDS>> rds = null;
|
|
||||||
Task<DateTime> task3 = null;
|
|
||||||
Task<OutsAndScrapTotal> task4 = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
reactors = ApiCaller.GetApi<List<Reactor>>(baseUrlScrapeDb + "Reactors").Result;
|
|
||||||
|
|
||||||
foreach (Reactor reactor in reactors)
|
|
||||||
{
|
|
||||||
toolEvents.Add(ApiCaller.GetApi<List<ReactorEvent>>(baseUrlScrapeDb + "ReactorEvents?startDate=" + report.StartDate.ToString() +
|
|
||||||
"&endDate=" + DateTime.Now.ToString() + "&reactorNumber=" + reactor.ReactorNumber + "&reactorType=" + reactor.Type));
|
|
||||||
|
|
||||||
lastUpTransactions.Add(reactor.ReactorNumber.ToString(),
|
|
||||||
ApiCaller.GetApi<int>(baseUrlScrapeDb + "GetLastUpTransaction?reactorNumber=" + reactor.ReactorNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string tool in cleanTools)
|
|
||||||
{
|
|
||||||
cleanEvents.Add(ApiCaller.GetApi<ToolEvent>(baseUrlScrapeDb + "ToolEvents?toolID=" + tool));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string tool in metrologyTools)
|
|
||||||
{
|
|
||||||
metrologyEvents.Add(ApiCaller.GetApi<ToolEvent>(baseUrlScrapeDb + "ToolEvents?toolID=" + tool));
|
|
||||||
}
|
|
||||||
|
|
||||||
task1 = ApiCaller.GetApi<YieldInformation>(baseUrlScrapeDb + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString());
|
|
||||||
task2 = ApiCaller.GetApi<YieldInformation>(baseUrlScrapeDb + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString());
|
|
||||||
task3 = ApiCaller.GetApi<DateTime>(baseUrlScrapeDb + "GetQuarterStartDate");
|
|
||||||
targets = ApiCaller.GetApi<QuarterlyTargets>(baseUrlScrapeDb + "Targets");
|
|
||||||
|
|
||||||
rds = ApiCaller.GetApi<List<RDS>>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString());
|
|
||||||
task4 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + DateTime.Now.ToString());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
logger.LogCritical(ex, "Failed to send get requests to scrapedb endpoints.");
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
report.QuarterlyTargets = targets.Result;
|
|
||||||
report.SetRDSInfo(rds.Result);
|
|
||||||
report.SetReactorInfo(reactors, GetUnscheduledReactors(report));
|
|
||||||
|
|
||||||
foreach (var task in toolEvents)
|
|
||||||
{
|
|
||||||
ToolEventView toolEvent = new(task.Result,
|
|
||||||
report.StartDate.ToString(), DateTime.Now.ToString(), task.Result[0].REACT_NO,
|
|
||||||
reactors.FirstOrDefault(x => x.ReactorNumber == int.Parse(task.Result[0].REACT_NO)).Type);
|
|
||||||
|
|
||||||
toolEvent.SetDowntime(lastUpTransactions[toolEvent.Reactor].Result);
|
|
||||||
|
|
||||||
report.ToolEvents.Add(toolEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
report.ToolEvents = report.ToolEvents
|
|
||||||
.Where(x => x.Reactor != "100" && x.Reactor != "101" && x.Reactor != "47")
|
|
||||||
.OrderBy(x => x.Reactor)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
foreach (Task<ToolEvent> task in cleanEvents)
|
|
||||||
report.CleanEvents.Add(task.Result);
|
|
||||||
|
|
||||||
foreach (Task<ToolEvent> task in metrologyEvents)
|
|
||||||
report.MetrologyEvents.Add(task.Result);
|
|
||||||
|
|
||||||
report.CleanEvents = report.CleanEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList();
|
|
||||||
report.MetrologyEvents = report.MetrologyEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList();
|
|
||||||
|
|
||||||
report.CurrentWeek.SetYieldInformation(task1.Result, report.QuarterlyTargets);
|
|
||||||
report.PreviousWeek.SetYieldInformation(task2.Result, report.QuarterlyTargets);
|
|
||||||
|
|
||||||
report.QuarterStartDate = task3.Result;
|
|
||||||
|
|
||||||
report.CurrentWeek.QTDOutsAndScrap = task4.Result;
|
|
||||||
report.PreviousWeek.QTDOutsAndScrap = task4.Result;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
logger.LogCritical(ex, "Failed to retrieve data back from Scrape DB endpoints.");
|
|
||||||
}
|
|
||||||
|
|
||||||
report.ReverseLists();
|
|
||||||
|
|
||||||
ManualReportEntries entries = report.ManualReportEntries;
|
|
||||||
List<SLLTool> sll = report.SLLTools;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
JsonFileHandler.SaveJSONFile(entries, _dailyRptFilePath);
|
|
||||||
JsonFileHandler.SaveJSONFile(sll, _SLLFilePath);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
logger.LogCritical(ex, "Failed to save data back to JSON files.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return report;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<int> GetUnscheduledReactors(DailyReport report)
|
List<string> cleanTools = new()
|
||||||
{
|
{
|
||||||
List<int> reactors = new();
|
"AHPS",
|
||||||
|
"AKRION1",
|
||||||
|
"CB3",
|
||||||
|
"MES",
|
||||||
|
"SRD 1",
|
||||||
|
"SRD 2"
|
||||||
|
};
|
||||||
|
|
||||||
foreach (ToolEventView tool in report.ToolEvents)
|
List<string> metrologyTools = new()
|
||||||
|
{
|
||||||
|
"ASET",
|
||||||
|
"BIORAD2",
|
||||||
|
"BIORAD3",
|
||||||
|
"BIORAD4",
|
||||||
|
"BIORAD5",
|
||||||
|
"CDE2",
|
||||||
|
"CDE3",
|
||||||
|
"CDE5",
|
||||||
|
"FLEXUS",
|
||||||
|
"HGCV1",
|
||||||
|
"HGCV2",
|
||||||
|
"HGCV3",
|
||||||
|
"SRP"
|
||||||
|
};
|
||||||
|
|
||||||
|
List<Reactor> reactors = new();
|
||||||
|
Dictionary<string, Task<int>> lastUpTransactions = new();
|
||||||
|
List<Task<List<ReactorEvent>>> toolEvents = new();
|
||||||
|
List<Task<ToolEvent>> cleanEvents = new();
|
||||||
|
List<Task<ToolEvent>> metrologyEvents = new();
|
||||||
|
|
||||||
|
Task<YieldInformation> task1 = null;
|
||||||
|
Task<YieldInformation> task2 = null;
|
||||||
|
Task<QuarterlyTargets> targets = null;
|
||||||
|
Task<List<RDS>> rds = null;
|
||||||
|
Task<DateTime> task3 = null;
|
||||||
|
Task<OutsAndScrapTotal> task4 = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
reactors = ApiCaller.GetApi<List<Reactor>>(baseUrlScrapeDb + "Reactors").Result;
|
||||||
|
|
||||||
|
foreach (Reactor reactor in reactors)
|
||||||
{
|
{
|
||||||
if (!tool.IsInProduction)
|
toolEvents.Add(ApiCaller.GetApi<List<ReactorEvent>>(baseUrlScrapeDb + "ReactorEvents?startDate=" + report.StartDate.ToString() +
|
||||||
{
|
"&endDate=" + DateTime.Now.ToString() + "&reactorNumber=" + reactor.ReactorNumber + "&reactorType=" + reactor.Type));
|
||||||
reactors.Add(int.Parse(tool.Reactor));
|
|
||||||
}
|
lastUpTransactions.Add(reactor.ReactorNumber.ToString(),
|
||||||
|
ApiCaller.GetApi<int>(baseUrlScrapeDb + "GetLastUpTransaction?reactorNumber=" + reactor.ReactorNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
return reactors;
|
foreach (string tool in cleanTools)
|
||||||
|
{
|
||||||
|
cleanEvents.Add(ApiCaller.GetApi<ToolEvent>(baseUrlScrapeDb + "ToolEvents?toolID=" + tool));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string tool in metrologyTools)
|
||||||
|
{
|
||||||
|
metrologyEvents.Add(ApiCaller.GetApi<ToolEvent>(baseUrlScrapeDb + "ToolEvents?toolID=" + tool));
|
||||||
|
}
|
||||||
|
|
||||||
|
task1 = ApiCaller.GetApi<YieldInformation>(baseUrlScrapeDb + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString());
|
||||||
|
task2 = ApiCaller.GetApi<YieldInformation>(baseUrlScrapeDb + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString());
|
||||||
|
task3 = ApiCaller.GetApi<DateTime>(baseUrlScrapeDb + "GetQuarterStartDate");
|
||||||
|
targets = ApiCaller.GetApi<QuarterlyTargets>(baseUrlScrapeDb + "Targets");
|
||||||
|
|
||||||
|
rds = ApiCaller.GetApi<List<RDS>>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString());
|
||||||
|
task4 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + DateTime.Now.ToString());
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
logger.LogCritical(ex, "Failed to send get requests to scrapedb endpoints.");
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
report.QuarterlyTargets = targets.Result;
|
||||||
|
report.SetRDSInfo(rds.Result);
|
||||||
|
report.SetReactorInfo(reactors, GetUnscheduledReactors(report));
|
||||||
|
|
||||||
|
foreach (Task<List<ReactorEvent>> task in toolEvents)
|
||||||
|
{
|
||||||
|
ToolEventView toolEvent = new(task.Result,
|
||||||
|
report.StartDate.ToString(), DateTime.Now.ToString(), task.Result[0].REACT_NO,
|
||||||
|
reactors.FirstOrDefault(x => x.ReactorNumber == int.Parse(task.Result[0].REACT_NO)).Type);
|
||||||
|
|
||||||
|
toolEvent.SetDowntime(lastUpTransactions[toolEvent.Reactor].Result);
|
||||||
|
|
||||||
|
report.ToolEvents.Add(toolEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
report.ToolEvents = report.ToolEvents
|
||||||
|
.Where(x => x.Reactor is not "100" and not "101" and not "47")
|
||||||
|
.OrderBy(x => x.Reactor)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (Task<ToolEvent> task in cleanEvents)
|
||||||
|
report.CleanEvents.Add(task.Result);
|
||||||
|
|
||||||
|
foreach (Task<ToolEvent> task in metrologyEvents)
|
||||||
|
report.MetrologyEvents.Add(task.Result);
|
||||||
|
|
||||||
|
report.CleanEvents = report.CleanEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList();
|
||||||
|
report.MetrologyEvents = report.MetrologyEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList();
|
||||||
|
|
||||||
|
report.CurrentWeek.SetYieldInformation(task1.Result, report.QuarterlyTargets);
|
||||||
|
report.PreviousWeek.SetYieldInformation(task2.Result, report.QuarterlyTargets);
|
||||||
|
|
||||||
|
report.QuarterStartDate = task3.Result;
|
||||||
|
|
||||||
|
report.CurrentWeek.QTDOutsAndScrap = task4.Result;
|
||||||
|
report.PreviousWeek.QTDOutsAndScrap = task4.Result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
logger.LogCritical(ex, "Failed to retrieve data back from Scrape DB endpoints.");
|
||||||
|
}
|
||||||
|
|
||||||
|
report.ReverseLists();
|
||||||
|
|
||||||
|
ManualReportEntries entries = report.ManualReportEntries;
|
||||||
|
List<SLLTool> sll = report.SLLTools;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
JsonFileHandler.SaveJSONFile(entries, _dailyRptFilePath);
|
||||||
|
JsonFileHandler.SaveJSONFile(sll, _SLLFilePath);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
logger.LogCritical(ex, "Failed to save data back to JSON files.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return report;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static List<int> GetUnscheduledReactors(DailyReport report)
|
||||||
|
{
|
||||||
|
List<int> reactors = new();
|
||||||
|
|
||||||
|
foreach (ToolEventView tool in report.ToolEvents)
|
||||||
|
{
|
||||||
|
if (!tool.IsInProduction)
|
||||||
|
{
|
||||||
|
reactors.Add(int.Parse(tool.Reactor));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return reactors;
|
||||||
|
}
|
||||||
|
}
|
@ -1,19 +1,18 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.HelperClasses
|
namespace ReportingServices.Shared.HelperClasses;
|
||||||
{
|
|
||||||
public static class JsonFileHandler
|
|
||||||
{
|
|
||||||
public static T LoadJSONFile<T>(string file)
|
|
||||||
{
|
|
||||||
string json = File.ReadAllText(file);
|
|
||||||
return JsonSerializer.Deserialize<T>(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SaveJSONFile<T>(T obj, string file)
|
public static class JsonFileHandler
|
||||||
{
|
{
|
||||||
string json = JsonSerializer.Serialize(obj);
|
public static T LoadJSONFile<T>(string file)
|
||||||
File.WriteAllText(file, json);
|
{
|
||||||
}
|
string json = File.ReadAllText(file);
|
||||||
|
return JsonSerializer.Deserialize<T>(json);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static void SaveJSONFile<T>(T obj, string file)
|
||||||
|
{
|
||||||
|
string json = JsonSerializer.Serialize(obj);
|
||||||
|
File.WriteAllText(file, json);
|
||||||
|
}
|
||||||
|
}
|
@ -1,14 +1,13 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.PlanningReport
|
namespace ReportingServices.Shared.Models.PlanningReport;
|
||||||
|
|
||||||
|
public class ReactorPSNWORuns
|
||||||
{
|
{
|
||||||
public class ReactorPSNWORuns
|
[JsonPropertyName("REACTOR")]
|
||||||
{
|
public string REACTOR { get; set; }
|
||||||
[JsonPropertyName("REACTOR")]
|
[JsonPropertyName("PSN")]
|
||||||
public string REACTOR { get; set; }
|
public string PSN { get; set; }
|
||||||
[JsonPropertyName("PSN")]
|
[JsonPropertyName("WO_COUNT")]
|
||||||
public string PSN { get; set; }
|
public int WO_COUNT { get; set; }
|
||||||
[JsonPropertyName("WO_COUNT")]
|
}
|
||||||
public int WO_COUNT { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +1,9 @@
|
|||||||
namespace ReportingServices.Shared.Models.PlanningReport
|
namespace ReportingServices.Shared.Models.PlanningReport;
|
||||||
|
|
||||||
|
public class WeeklyPartChanges
|
||||||
{
|
{
|
||||||
public class WeeklyPartChanges
|
public int TotalPartChanges { get; set; }
|
||||||
{
|
public string StartDate { get; set; }
|
||||||
public int TotalPartChanges { get; set; }
|
public string EndDate { get; set; }
|
||||||
public string StartDate { get; set; }
|
public List<ReactorPSNWORuns> ReactorPSNWORuns { get; set; }
|
||||||
public string EndDate { get; set; }
|
}
|
||||||
public List<ReactorPSNWORuns> ReactorPSNWORuns { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +1,20 @@
|
|||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ManualReportEntries
|
||||||
{
|
{
|
||||||
public class ManualReportEntries
|
public int OperatorHeadcountDays { get; set; }
|
||||||
{
|
public int OperatorHeadcountNights { get; set; }
|
||||||
public int OperatorHeadcountDays { get; set; }
|
public int OperatorCallOutsDays { get; set; }
|
||||||
public int OperatorHeadcountNights { get; set; }
|
public int OperatorCallOutsNights { get; set; }
|
||||||
public int OperatorCallOutsDays { get; set; }
|
public int EngineeringHeadcountDays { get; set; }
|
||||||
public int OperatorCallOutsNights { get; set; }
|
public int EngineeringHeadcountNights { get; set; }
|
||||||
public int EngineeringHeadcountDays { get; set; }
|
public int EngineeringCallOutsDays { get; set; }
|
||||||
public int EngineeringHeadcountNights { get; set; }
|
public int EngineeringCallOutsNights { get; set; }
|
||||||
public int EngineeringCallOutsDays { get; set; }
|
public int MaintenanceHeadcountDays { get; set; }
|
||||||
public int EngineeringCallOutsNights { get; set; }
|
public int MaintenanceHeadcountNights { get; set; }
|
||||||
public int MaintenanceHeadcountDays { get; set; }
|
public int MaintenanceCallOutsDays { get; set; }
|
||||||
public int MaintenanceHeadcountNights { get; set; }
|
public int MaintenanceCallOutsNights { get; set; }
|
||||||
public int MaintenanceCallOutsDays { get; set; }
|
public string BottleChanges { get; set; }
|
||||||
public int MaintenanceCallOutsNights { get; set; }
|
public string DailyPartChanges { get; set; }
|
||||||
public string BottleChanges { get; set; }
|
public string WeeklyPartChanges { get; set; }
|
||||||
public string DailyPartChanges { get; set; }
|
}
|
||||||
public string WeeklyPartChanges { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +1,15 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class OutsAndScrapTotal
|
||||||
{
|
{
|
||||||
public class OutsAndScrapTotal
|
[JsonPropertyName("Outs")]
|
||||||
{
|
public int Outs { get; set; }
|
||||||
[JsonPropertyName("Outs")]
|
[JsonPropertyName("CustomerScrap")]
|
||||||
public int Outs { get; set; }
|
public int CustomerScrap { get; set; }
|
||||||
[JsonPropertyName("CustomerScrap")]
|
[JsonPropertyName("ManufacturingScrap")]
|
||||||
public int CustomerScrap { get; set; }
|
public int ManufacturingScrap { get; set; }
|
||||||
[JsonPropertyName("ManufacturingScrap")]
|
[JsonPropertyName("ProductionScrap")]
|
||||||
public int ManufacturingScrap { get; set; }
|
public int ProductionScrap { get; set; }
|
||||||
[JsonPropertyName("ProductionScrap")]
|
}
|
||||||
public int ProductionScrap { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +1,17 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class QuarterlyTargets
|
||||||
{
|
{
|
||||||
public class QuarterlyTargets
|
[JsonPropertyName("Reactor_Outs")]
|
||||||
{
|
public int Reactor_Outs { get; set; }
|
||||||
[JsonPropertyName("Reactor_Outs")]
|
[JsonPropertyName("Yield_Outs")]
|
||||||
public int Reactor_Outs { get; set; }
|
public int Yield_Outs { get; set; }
|
||||||
[JsonPropertyName("Yield_Outs")]
|
[JsonPropertyName("IFX_Scrap")]
|
||||||
public int Yield_Outs { get; set; }
|
public int IFX_Scrap { get; set; }
|
||||||
[JsonPropertyName("IFX_Scrap")]
|
[JsonPropertyName("Yield")]
|
||||||
public int IFX_Scrap { get; set; }
|
public float Yield { get; set; }
|
||||||
[JsonPropertyName("Yield")]
|
[JsonPropertyName("PlanWorkingDays")]
|
||||||
public float Yield { get; set; }
|
public int PlanWorkingDays { get; set; }
|
||||||
[JsonPropertyName("PlanWorkingDays")]
|
}
|
||||||
public int PlanWorkingDays { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +1,17 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class RDS
|
||||||
{
|
{
|
||||||
public class RDS
|
[JsonPropertyName("Reactor")]
|
||||||
{
|
public int Reactor { get; set; }
|
||||||
[JsonPropertyName("Reactor")]
|
[JsonPropertyName("ReactorType")]
|
||||||
public int Reactor { get; set; }
|
public string ReactorType { get; set; }
|
||||||
[JsonPropertyName("ReactorType")]
|
[JsonPropertyName("DateOut")]
|
||||||
public string ReactorType { get; set; }
|
public DateTime DateOut { get; set; }
|
||||||
[JsonPropertyName("DateOut")]
|
[JsonPropertyName("UnloadTemp")]
|
||||||
public DateTime DateOut { get; set; }
|
public int UnloadTemp { get; set; }
|
||||||
[JsonPropertyName("UnloadTemp")]
|
[JsonPropertyName("LayerType")]
|
||||||
public int UnloadTemp { get; set; }
|
public string LayerType { get; set; }
|
||||||
[JsonPropertyName("LayerType")]
|
}
|
||||||
public string LayerType { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +1,15 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class Reactor
|
||||||
{
|
{
|
||||||
public class Reactor
|
[JsonPropertyName("ReactorNumber")]
|
||||||
{
|
public int ReactorNumber { get; set; }
|
||||||
[JsonPropertyName("ReactorNumber")]
|
[JsonPropertyName("Type")]
|
||||||
public int ReactorNumber { get; set; }
|
public string Type { get; set; }
|
||||||
[JsonPropertyName("Type")]
|
[JsonPropertyName("PocketSize")]
|
||||||
public string Type { get; set; }
|
public string PocketSize { get; set; }
|
||||||
[JsonPropertyName("PocketSize")]
|
[JsonPropertyName("HasDisabledLoadLock")]
|
||||||
public string PocketSize { get; set; }
|
public bool HasDisabledLoadlock { get; set; }
|
||||||
[JsonPropertyName("HasDisabledLoadLock")]
|
}
|
||||||
public bool HasDisabledLoadlock { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +1,15 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ReactorEvent
|
||||||
{
|
{
|
||||||
public class ReactorEvent
|
[JsonPropertyName("REACT_NO")]
|
||||||
{
|
public string REACT_NO { get; set; }
|
||||||
[JsonPropertyName("REACT_NO")]
|
[JsonPropertyName("EVENT_DTM")]
|
||||||
public string REACT_NO { get; set; }
|
public string EVENT_DTM { get; set; }
|
||||||
[JsonPropertyName("EVENT_DTM")]
|
[JsonPropertyName("COMMENT")]
|
||||||
public string EVENT_DTM { get; set; }
|
public string COMMENT { get; set; }
|
||||||
[JsonPropertyName("COMMENT")]
|
[JsonPropertyName("REACT_MODE")]
|
||||||
public string COMMENT { get; set; }
|
public string REACT_MODE { get; set; }
|
||||||
[JsonPropertyName("REACT_MODE")]
|
}
|
||||||
public string REACT_MODE { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ReactorOutsByDay
|
||||||
{
|
{
|
||||||
public class ReactorOutsByDay
|
public string StartDate { get; set; }
|
||||||
{
|
public int TotalWafers { get; set; }
|
||||||
public string StartDate { get; set; }
|
}
|
||||||
public int TotalWafers { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +1,13 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ReactorOutsByRDS
|
||||||
{
|
{
|
||||||
public class ReactorOutsByRDS
|
[JsonPropertyName("RDS_NO")]
|
||||||
{
|
public string RDS_NO { get; set; }
|
||||||
[JsonPropertyName("RDS_NO")]
|
[JsonPropertyName("Units")]
|
||||||
public string RDS_NO { get; set; }
|
public string Units { get; set; }
|
||||||
[JsonPropertyName("Units")]
|
[JsonPropertyName("EndProcessTime")]
|
||||||
public string Units { get; set; }
|
public string EndProcessTime { get; set; }
|
||||||
[JsonPropertyName("EndProcessTime")]
|
}
|
||||||
public string EndProcessTime { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +1,17 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ScrapByDay
|
||||||
{
|
{
|
||||||
public class ScrapByDay
|
[JsonPropertyName("StartDate")]
|
||||||
{
|
public string StartDate { get; set; }
|
||||||
[JsonPropertyName("StartDate")]
|
[JsonPropertyName("TW_PROD")]
|
||||||
public string StartDate { get; set; }
|
public int TW_PROD { get; set; }
|
||||||
[JsonPropertyName("TW_PROD")]
|
[JsonPropertyName("TOT_REJ_CUST")]
|
||||||
public int TW_PROD { get; set; }
|
public int TOT_REJ_CUST { get; set; }
|
||||||
[JsonPropertyName("TOT_REJ_CUST")]
|
[JsonPropertyName("TOT_REJ_MANU")]
|
||||||
public int TOT_REJ_CUST { get; set; }
|
public int TOT_REJ_MANU { get; set; }
|
||||||
[JsonPropertyName("TOT_REJ_MANU")]
|
[JsonPropertyName("TOT_REJ_WFRS")]
|
||||||
public int TOT_REJ_MANU { get; set; }
|
public int TOT_REJ_WFRS { get; set; }
|
||||||
[JsonPropertyName("TOT_REJ_WFRS")]
|
}
|
||||||
public int TOT_REJ_WFRS { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +1,15 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ToolEvent
|
||||||
{
|
{
|
||||||
public class ToolEvent
|
[JsonPropertyName("TOOL_ID")]
|
||||||
{
|
public string TOOL_ID { get; set; }
|
||||||
[JsonPropertyName("TOOL_ID")]
|
[JsonPropertyName("START_DTM")]
|
||||||
public string TOOL_ID { get; set; }
|
public string START_DTM { get; set; }
|
||||||
[JsonPropertyName("START_DTM")]
|
[JsonPropertyName("TOOL_MODE")]
|
||||||
public string START_DTM { get; set; }
|
public string TOOL_MODE { get; set; }
|
||||||
[JsonPropertyName("TOOL_MODE")]
|
[JsonPropertyName("TOOL_MODE_DESC")]
|
||||||
public string TOOL_MODE { get; set; }
|
public string TOOL_MODE_DESC { get; set; }
|
||||||
[JsonPropertyName("TOOL_MODE_DESC")]
|
}
|
||||||
public string TOOL_MODE_DESC { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ToolUptimeData
|
||||||
{
|
{
|
||||||
public class ToolUptimeData
|
public string Date { get; set; }
|
||||||
{
|
public double UptimePercentage { get; set; }
|
||||||
public string Date { get; set; }
|
}
|
||||||
public double UptimePercentage { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +1,11 @@
|
|||||||
using System;
|
using System.Text.Json.Serialization;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class YieldInformation
|
||||||
{
|
{
|
||||||
public class YieldInformation
|
[JsonPropertyName("Outs")]
|
||||||
{
|
public List<ReactorOutsByRDS> Outs { get; set; }
|
||||||
[JsonPropertyName("Outs")]
|
[JsonPropertyName("Scrap")]
|
||||||
public List<ReactorOutsByRDS> Outs { get; set; }
|
public List<ScrapByDay> Scrap { get; set; }
|
||||||
[JsonPropertyName("Scrap")]
|
}
|
||||||
public List<ScrapByDay> Scrap { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,499 +1,493 @@
|
|||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
using ReportingServices.Shared.Models.PlanningReport;
|
using ReportingServices.Shared.Models.PlanningReport;
|
||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Repositories
|
namespace ReportingServices.Shared.Repositories;
|
||||||
|
|
||||||
|
public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
|
||||||
{
|
{
|
||||||
public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
|
private SqlConnection _connection;
|
||||||
|
private readonly string _connectionString;
|
||||||
|
|
||||||
|
public ScrapeDatabaseRepository() => _connectionString = "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true";
|
||||||
|
|
||||||
|
public void OpenConnection()
|
||||||
{
|
{
|
||||||
private SqlConnection _connection;
|
_connection ??= new SqlConnection(_connectionString);
|
||||||
private readonly string _connectionString;
|
|
||||||
|
|
||||||
public ScrapeDatabaseRepository()
|
if (_connection.State != ConnectionState.Open)
|
||||||
{
|
_connection.Open();
|
||||||
_connectionString = "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OpenConnection()
|
|
||||||
{
|
|
||||||
if (_connection == null)
|
|
||||||
_connection = new SqlConnection(_connectionString);
|
|
||||||
|
|
||||||
if (_connection.State != ConnectionState.Open)
|
|
||||||
_connection.Open();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CloseConnection()
|
|
||||||
{
|
|
||||||
if (_connection.State != ConnectionState.Closed)
|
|
||||||
_connection.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int GetNumberOfPartChanges(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
int result = 0;
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT COUNT(*) FROM " +
|
|
||||||
"(SELECT REACTOR, COUNT(PROD_SPEC_ID) - 1 AS PCHANGE FROM " +
|
|
||||||
"(SELECT REACTOR, PROD_SPEC_ID, COUNT(WO) AS PSN_COUNT FROM RDS WHERE DATE_OUT BETWEEN @startDate AND @endDate GROUP BY REACTOR, PROD_SPEC_ID) AS t " +
|
|
||||||
"GROUP BY REACTOR) AS l WHERE PCHANGE > 0";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
reader.Read();
|
|
||||||
|
|
||||||
result = int.Parse(reader[0].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs)
|
|
||||||
{
|
|
||||||
List<ScrapByDay> scrap = new();
|
|
||||||
string rdsNumbers = "";
|
|
||||||
|
|
||||||
foreach (ReactorOutsByRDS rout in outs)
|
|
||||||
rdsNumbers = rdsNumbers + "'" + rout.RDS_NO + "', ";
|
|
||||||
|
|
||||||
rdsNumbers = rdsNumbers.Substring(0, rdsNumbers.Length - 2);
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT " +
|
|
||||||
" DATE_OUT," +
|
|
||||||
" SUM(CUST_TOT_REJ) AS TOT_REJ_CUST," +
|
|
||||||
" SUM(LSL_TOT_REJ) AS TOT_REJ_MANU," +
|
|
||||||
" SUM(TW_PROD) AS TW_PROD " +
|
|
||||||
"FROM RDS " +
|
|
||||||
"WHERE SEQ IN (" + rdsNumbers + ") " +
|
|
||||||
"GROUP BY DATE_OUT " +
|
|
||||||
"ORDER BY 1 DESC";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read() && reader[0].ToString() != "1/1/1900 12:00:00 AM")
|
|
||||||
scrap.Add(new ScrapByDay
|
|
||||||
{
|
|
||||||
StartDate = reader[0].ToString(),
|
|
||||||
TW_PROD = int.Parse(reader[3].ToString()),
|
|
||||||
TOT_REJ_CUST = int.Parse(reader[1].ToString()),
|
|
||||||
TOT_REJ_MANU = int.Parse(reader[2].ToString()),
|
|
||||||
TOT_REJ_WFRS =
|
|
||||||
int.Parse(reader[1].ToString()) + int.Parse(reader[2].ToString())
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return scrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
List<ReactorPSNWORuns> weeklyPartChanges = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT REACTOR, PROD_SPEC_ID, COUNT(WO) FROM RDS " +
|
|
||||||
"WHERE DATE_OUT BETWEEN @startDate AND @endDate " +
|
|
||||||
"GROUP BY REACTOR, PROD_SPEC_ID " +
|
|
||||||
"ORDER BY 1";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
weeklyPartChanges.Add(new ReactorPSNWORuns
|
|
||||||
{
|
|
||||||
REACTOR = reader[0].ToString(),
|
|
||||||
PSN = reader[1].ToString(),
|
|
||||||
WO_COUNT = int.Parse(reader[2].ToString())
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return weeklyPartChanges;
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuarterlyTargets GetQuarterlyTargets()
|
|
||||||
{
|
|
||||||
Dictionary<string, float> targets = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT THRU_TARGET, THRU_QTY, THRU_PCNT FROM FISCAL_QTR_TARGETS " +
|
|
||||||
" WHERE THRU_GROUP = 'TOT' " +
|
|
||||||
" AND FISCAL_YR = " +
|
|
||||||
" (SELECT FISCAL_YR FROM FISCAL_QTR " +
|
|
||||||
" WHERE START_DT < SYSDATETIME() " +
|
|
||||||
" AND END_DT > SYSDATETIME()) " +
|
|
||||||
" AND FISCAL_QTR = " +
|
|
||||||
" (SELECT FISCAL_QTR FROM FISCAL_QTR " +
|
|
||||||
" WHERE START_DT < SYSDATETIME() " +
|
|
||||||
" AND END_DT > SYSDATETIME()) " +
|
|
||||||
"UNION " +
|
|
||||||
"SELECT 'PlanWorkingDays' As THRU_TARGET," +
|
|
||||||
" PLAN_WORKING_DAYS AS THRU_QTY," +
|
|
||||||
" NULL AS THRU_PCNT" +
|
|
||||||
" FROM FISCAL_QTR " +
|
|
||||||
" WHERE SYSDATETIME() BETWEEN START_DT AND END_DT";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while(reader.Read())
|
|
||||||
{
|
|
||||||
if (reader[0].ToString().ToUpper() == "YIELD")
|
|
||||||
targets.Add(reader[0].ToString(), float.Parse(reader[2].ToString()));
|
|
||||||
else if (!string.IsNullOrEmpty(reader[1].ToString()))
|
|
||||||
targets.Add(reader[0].ToString(), int.Parse(reader[1].ToString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
QuarterlyTargets quarterlyTargets = new()
|
|
||||||
{
|
|
||||||
Reactor_Outs = (int)targets["Reactor_Outs"],
|
|
||||||
Yield_Outs = (int)targets["Yield_Outs"],
|
|
||||||
IFX_Scrap = (int)targets["IFX_Scrap"],
|
|
||||||
Yield = targets["Yield"],
|
|
||||||
PlanWorkingDays = (int)targets["PlanWorkingDays"]
|
|
||||||
};
|
|
||||||
|
|
||||||
return quarterlyTargets;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Reactor> GetReactors()
|
|
||||||
{
|
|
||||||
List<Reactor> reactors = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT " +
|
|
||||||
" REACT_NO, REACT_TYPE, SUSC_POCKET_SIZE, CASE WHEN ACTIVE_LL_DISABLED <> '' THEN 'TRUE' ELSE 'FALSE' END AS \"LL_DISABLED\" " +
|
|
||||||
" FROM REACTOR " +
|
|
||||||
" WHERE REACT_ASSIGNMENT IS NOT NULL " +
|
|
||||||
" AND REACT_ASSIGNMENT <> 'Out of Service' " +
|
|
||||||
" AND REACT_ASSIGNMENT<> ''";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
reactors.Add(new Reactor
|
|
||||||
{
|
|
||||||
ReactorNumber = int.Parse(reader[0].ToString()),
|
|
||||||
Type = reader[1].ToString(),
|
|
||||||
PocketSize = reader[2].ToString(),
|
|
||||||
HasDisabledLoadlock = bool.Parse(reader[3].ToString())
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return reactors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<RDS> GetRDSForLastDay(string date)
|
|
||||||
{
|
|
||||||
List<RDS> rdsList = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT rds.REACTOR, rds.REACTOR_TYPE, rds.DATE_OUT, " +
|
|
||||||
"CASE WHEN lay.UL_TEMP IS NULL THEN '1000' ELSE lay.UL_TEMP END, psn.LAYER_TYPE FROM RDS " +
|
|
||||||
"INNER JOIN RDS_LAYER lay ON lay.RDS_NO = SEQ " +
|
|
||||||
"INNER JOIN PROD_SPEC psn ON rds.PROD_SPEC_ID = psn.SEQ " +
|
|
||||||
"WHERE DATE_OUT >= @date";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@date", date);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
rdsList.Add(new RDS
|
|
||||||
{
|
|
||||||
Reactor = int.Parse(reader[0].ToString()),
|
|
||||||
ReactorType = reader[1].ToString(),
|
|
||||||
DateOut = DateTime.Parse(reader[2].ToString()),
|
|
||||||
UnloadTemp = int.Parse(reader[3].ToString()),
|
|
||||||
LayerType = reader[4].ToString()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return rdsList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ReactorOutsByRDS> GetRDSRunBetweenDates(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
List<ReactorOutsByRDS> outs = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT SEQ, WFRS_OUT, DATE_OUT " +
|
|
||||||
" FROM RDS " +
|
|
||||||
" WHERE DATE_OUT >= @startDate " +
|
|
||||||
" AND DATE_OUT < @endDate " +
|
|
||||||
"ORDER BY DATE_OUT ASC";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
outs.Add(new ReactorOutsByRDS
|
|
||||||
{
|
|
||||||
RDS_NO = reader[0].ToString(),
|
|
||||||
Units = reader[1].ToString(),
|
|
||||||
EndProcessTime = reader[2].ToString()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return outs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber)
|
|
||||||
{
|
|
||||||
List<ReactorEvent> events = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT " +
|
|
||||||
" REACT_NO, " +
|
|
||||||
" EVENT_DTM, " +
|
|
||||||
" COMMENT, " +
|
|
||||||
" REACT_MODE " +
|
|
||||||
" FROM REACT_EVENT " +
|
|
||||||
" WHERE EVENT_DTM > @startDate " +
|
|
||||||
" AND EVENT_DTM < @endDate " +
|
|
||||||
" AND REACT_NO = @reactorNumber " +
|
|
||||||
"UNION ALL " +
|
|
||||||
"SELECT " +
|
|
||||||
" REACT_NO, " +
|
|
||||||
" EVENT_DTM, " +
|
|
||||||
" COMMENT, " +
|
|
||||||
" REACT_MODE " +
|
|
||||||
" FROM " +
|
|
||||||
" (SELECT TOP 1 * FROM REACT_EVENT " +
|
|
||||||
" WHERE EVENT_DTM < @startDate " +
|
|
||||||
" AND REACT_NO = @reactorNumber ORDER BY EVENT_DTM DESC) AS tbl1 " +
|
|
||||||
"ORDER BY EVENT_DTM ASC";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
|
||||||
cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
events.Add(new ReactorEvent
|
|
||||||
{
|
|
||||||
REACT_NO = reader[0].ToString(),
|
|
||||||
EVENT_DTM = reader[1].ToString(),
|
|
||||||
COMMENT = reader[2].ToString(),
|
|
||||||
REACT_MODE = reader[3].ToString()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return events;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ToolEvent GetLatestToolEvent(string toolID)
|
|
||||||
{
|
|
||||||
ToolEvent evnt = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT TOP 1 " +
|
|
||||||
" TOOL_ID, " +
|
|
||||||
" START_DTM, " +
|
|
||||||
" TOOL_MODE, " +
|
|
||||||
" TOOL_MODE_DESC " +
|
|
||||||
" FROM TOOL_LOG " +
|
|
||||||
" WHERE TOOL_ID = @toolID " +
|
|
||||||
"ORDER BY START_DTM DESC";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@toolID", toolID);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
evnt = new ToolEvent
|
|
||||||
{
|
|
||||||
TOOL_ID = reader[0].ToString(),
|
|
||||||
START_DTM = reader[1].ToString(),
|
|
||||||
TOOL_MODE = reader[2].ToString(),
|
|
||||||
TOOL_MODE_DESC = reader[3].ToString()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return evnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int GetLastUpTransaction(string reactorNumber)
|
|
||||||
{
|
|
||||||
int lastTransaction = 0;
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT TOP 1 DATEDIFF(MINUTE,START_DTM,SYSDATETIME()) " +
|
|
||||||
" FROM REACT_MODE " +
|
|
||||||
" WHERE REACT_NO = @reactorNumber " +
|
|
||||||
" AND (MODE = 'UP' OR MODE = 'UP_WITH_INCREASED_SAMPLING') " +
|
|
||||||
"ORDER BY START_DTM DESC";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
lastTransaction = int.Parse(reader[0].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return lastTransaction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate)
|
|
||||||
{
|
|
||||||
OutsAndScrapTotal totals = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT SUM(WFRS_OUT) AS OUTS, " +
|
|
||||||
" SUM(CUST_TOT_REJ) AS CUST, " +
|
|
||||||
" SUM(LSL_TOT_REJ) AS MANU, " +
|
|
||||||
" SUM(TW_PROD) AS PROD " +
|
|
||||||
" FROM RDS " +
|
|
||||||
" WHERE DATE_OUT >= @startDate " +
|
|
||||||
" AND DATE_OUT <= @endDate";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
totals = new()
|
|
||||||
{
|
|
||||||
Outs = int.Parse(reader[0].ToString()),
|
|
||||||
CustomerScrap = int.Parse(reader[1].ToString()),
|
|
||||||
ManufacturingScrap = int.Parse(reader[2].ToString()),
|
|
||||||
ProductionScrap = int.Parse(reader[3].ToString()),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return totals;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DateTime GetQuarterStartDate()
|
|
||||||
{
|
|
||||||
DateTime date = new();
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT START_DT " +
|
|
||||||
" FROM FISCAL_QTR " +
|
|
||||||
" WHERE START_DT < SYSDATETIME() " +
|
|
||||||
" AND END_DT > SYSDATETIME()";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
date = DateTime.Parse(reader[0].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public void CloseConnection()
|
||||||
|
{
|
||||||
|
if (_connection.State != ConnectionState.Closed)
|
||||||
|
_connection.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetNumberOfPartChanges(string startDate, string endDate)
|
||||||
|
{
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT COUNT(*) FROM " +
|
||||||
|
"(SELECT REACTOR, COUNT(PROD_SPEC_ID) - 1 AS PCHANGE FROM " +
|
||||||
|
"(SELECT REACTOR, PROD_SPEC_ID, COUNT(WO) AS PSN_COUNT FROM RDS WHERE DATE_OUT BETWEEN @startDate AND @endDate GROUP BY REACTOR, PROD_SPEC_ID) AS t " +
|
||||||
|
"GROUP BY REACTOR) AS l WHERE PCHANGE > 0";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
_ = reader.Read();
|
||||||
|
|
||||||
|
result = int.Parse(reader[0].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs)
|
||||||
|
{
|
||||||
|
List<ScrapByDay> scrap = new();
|
||||||
|
string rdsNumbers = "";
|
||||||
|
|
||||||
|
foreach (ReactorOutsByRDS rout in outs)
|
||||||
|
rdsNumbers = rdsNumbers + "'" + rout.RDS_NO + "', ";
|
||||||
|
|
||||||
|
rdsNumbers = rdsNumbers[..^2];
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT " +
|
||||||
|
" DATE_OUT," +
|
||||||
|
" SUM(CUST_TOT_REJ) AS TOT_REJ_CUST," +
|
||||||
|
" SUM(LSL_TOT_REJ) AS TOT_REJ_MANU," +
|
||||||
|
" SUM(TW_PROD) AS TW_PROD " +
|
||||||
|
"FROM RDS " +
|
||||||
|
"WHERE SEQ IN (" + rdsNumbers + ") " +
|
||||||
|
"GROUP BY DATE_OUT " +
|
||||||
|
"ORDER BY 1 DESC";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read() && reader[0].ToString() != "1/1/1900 12:00:00 AM")
|
||||||
|
scrap.Add(new ScrapByDay
|
||||||
|
{
|
||||||
|
StartDate = reader[0].ToString(),
|
||||||
|
TW_PROD = int.Parse(reader[3].ToString()),
|
||||||
|
TOT_REJ_CUST = int.Parse(reader[1].ToString()),
|
||||||
|
TOT_REJ_MANU = int.Parse(reader[2].ToString()),
|
||||||
|
TOT_REJ_WFRS =
|
||||||
|
int.Parse(reader[1].ToString()) + int.Parse(reader[2].ToString())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return scrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate)
|
||||||
|
{
|
||||||
|
List<ReactorPSNWORuns> weeklyPartChanges = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT REACTOR, PROD_SPEC_ID, COUNT(WO) FROM RDS " +
|
||||||
|
"WHERE DATE_OUT BETWEEN @startDate AND @endDate " +
|
||||||
|
"GROUP BY REACTOR, PROD_SPEC_ID " +
|
||||||
|
"ORDER BY 1";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
weeklyPartChanges.Add(new ReactorPSNWORuns
|
||||||
|
{
|
||||||
|
REACTOR = reader[0].ToString(),
|
||||||
|
PSN = reader[1].ToString(),
|
||||||
|
WO_COUNT = int.Parse(reader[2].ToString())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return weeklyPartChanges;
|
||||||
|
}
|
||||||
|
|
||||||
|
public QuarterlyTargets GetQuarterlyTargets()
|
||||||
|
{
|
||||||
|
Dictionary<string, float> targets = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT THRU_TARGET, THRU_QTY, THRU_PCNT FROM FISCAL_QTR_TARGETS " +
|
||||||
|
" WHERE THRU_GROUP = 'TOT' " +
|
||||||
|
" AND FISCAL_YR = " +
|
||||||
|
" (SELECT FISCAL_YR FROM FISCAL_QTR " +
|
||||||
|
" WHERE START_DT < SYSDATETIME() " +
|
||||||
|
" AND END_DT > SYSDATETIME()) " +
|
||||||
|
" AND FISCAL_QTR = " +
|
||||||
|
" (SELECT FISCAL_QTR FROM FISCAL_QTR " +
|
||||||
|
" WHERE START_DT < SYSDATETIME() " +
|
||||||
|
" AND END_DT > SYSDATETIME()) " +
|
||||||
|
"UNION " +
|
||||||
|
"SELECT 'PlanWorkingDays' As THRU_TARGET," +
|
||||||
|
" PLAN_WORKING_DAYS AS THRU_QTY," +
|
||||||
|
" NULL AS THRU_PCNT" +
|
||||||
|
" FROM FISCAL_QTR " +
|
||||||
|
" WHERE SYSDATETIME() BETWEEN START_DT AND END_DT";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
if (reader[0].ToString().ToUpper() == "YIELD")
|
||||||
|
targets.Add(reader[0].ToString(), float.Parse(reader[2].ToString()));
|
||||||
|
else if (!string.IsNullOrEmpty(reader[1].ToString()))
|
||||||
|
targets.Add(reader[0].ToString(), int.Parse(reader[1].ToString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
QuarterlyTargets quarterlyTargets = new()
|
||||||
|
{
|
||||||
|
Reactor_Outs = (int)targets["Reactor_Outs"],
|
||||||
|
Yield_Outs = (int)targets["Yield_Outs"],
|
||||||
|
IFX_Scrap = (int)targets["IFX_Scrap"],
|
||||||
|
Yield = targets["Yield"],
|
||||||
|
PlanWorkingDays = (int)targets["PlanWorkingDays"]
|
||||||
|
};
|
||||||
|
|
||||||
|
return quarterlyTargets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Reactor> GetReactors()
|
||||||
|
{
|
||||||
|
List<Reactor> reactors = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT " +
|
||||||
|
" REACT_NO, REACT_TYPE, SUSC_POCKET_SIZE, CASE WHEN ACTIVE_LL_DISABLED <> '' THEN 'TRUE' ELSE 'FALSE' END AS \"LL_DISABLED\" " +
|
||||||
|
" FROM REACTOR " +
|
||||||
|
" WHERE REACT_ASSIGNMENT IS NOT NULL " +
|
||||||
|
" AND REACT_ASSIGNMENT <> 'Out of Service' " +
|
||||||
|
" AND REACT_ASSIGNMENT<> ''";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
reactors.Add(new Reactor
|
||||||
|
{
|
||||||
|
ReactorNumber = int.Parse(reader[0].ToString()),
|
||||||
|
Type = reader[1].ToString(),
|
||||||
|
PocketSize = reader[2].ToString(),
|
||||||
|
HasDisabledLoadlock = bool.Parse(reader[3].ToString())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return reactors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RDS> GetRDSForLastDay(string date)
|
||||||
|
{
|
||||||
|
List<RDS> rdsList = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT rds.REACTOR, rds.REACTOR_TYPE, rds.DATE_OUT, " +
|
||||||
|
"CASE WHEN lay.UL_TEMP IS NULL THEN '1000' ELSE lay.UL_TEMP END, psn.LAYER_TYPE FROM RDS " +
|
||||||
|
"INNER JOIN RDS_LAYER lay ON lay.RDS_NO = SEQ " +
|
||||||
|
"INNER JOIN PROD_SPEC psn ON rds.PROD_SPEC_ID = psn.SEQ " +
|
||||||
|
"WHERE DATE_OUT >= @date";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@date", date);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
rdsList.Add(new RDS
|
||||||
|
{
|
||||||
|
Reactor = int.Parse(reader[0].ToString()),
|
||||||
|
ReactorType = reader[1].ToString(),
|
||||||
|
DateOut = DateTime.Parse(reader[2].ToString()),
|
||||||
|
UnloadTemp = int.Parse(reader[3].ToString()),
|
||||||
|
LayerType = reader[4].ToString()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return rdsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReactorOutsByRDS> GetRDSRunBetweenDates(string startDate, string endDate)
|
||||||
|
{
|
||||||
|
List<ReactorOutsByRDS> outs = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT SEQ, WFRS_OUT, DATE_OUT " +
|
||||||
|
" FROM RDS " +
|
||||||
|
" WHERE DATE_OUT >= @startDate " +
|
||||||
|
" AND DATE_OUT < @endDate " +
|
||||||
|
"ORDER BY DATE_OUT ASC";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
outs.Add(new ReactorOutsByRDS
|
||||||
|
{
|
||||||
|
RDS_NO = reader[0].ToString(),
|
||||||
|
Units = reader[1].ToString(),
|
||||||
|
EndProcessTime = reader[2].ToString()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return outs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber)
|
||||||
|
{
|
||||||
|
List<ReactorEvent> events = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT " +
|
||||||
|
" REACT_NO, " +
|
||||||
|
" EVENT_DTM, " +
|
||||||
|
" COMMENT, " +
|
||||||
|
" REACT_MODE " +
|
||||||
|
" FROM REACT_EVENT " +
|
||||||
|
" WHERE EVENT_DTM > @startDate " +
|
||||||
|
" AND EVENT_DTM < @endDate " +
|
||||||
|
" AND REACT_NO = @reactorNumber " +
|
||||||
|
"UNION ALL " +
|
||||||
|
"SELECT " +
|
||||||
|
" REACT_NO, " +
|
||||||
|
" EVENT_DTM, " +
|
||||||
|
" COMMENT, " +
|
||||||
|
" REACT_MODE " +
|
||||||
|
" FROM " +
|
||||||
|
" (SELECT TOP 1 * FROM REACT_EVENT " +
|
||||||
|
" WHERE EVENT_DTM < @startDate " +
|
||||||
|
" AND REACT_NO = @reactorNumber ORDER BY EVENT_DTM DESC) AS tbl1 " +
|
||||||
|
"ORDER BY EVENT_DTM ASC";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
_ = cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
events.Add(new ReactorEvent
|
||||||
|
{
|
||||||
|
REACT_NO = reader[0].ToString(),
|
||||||
|
EVENT_DTM = reader[1].ToString(),
|
||||||
|
COMMENT = reader[2].ToString(),
|
||||||
|
REACT_MODE = reader[3].ToString()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return events;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ToolEvent GetLatestToolEvent(string toolID)
|
||||||
|
{
|
||||||
|
ToolEvent evnt = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT TOP 1 " +
|
||||||
|
" TOOL_ID, " +
|
||||||
|
" START_DTM, " +
|
||||||
|
" TOOL_MODE, " +
|
||||||
|
" TOOL_MODE_DESC " +
|
||||||
|
" FROM TOOL_LOG " +
|
||||||
|
" WHERE TOOL_ID = @toolID " +
|
||||||
|
"ORDER BY START_DTM DESC";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@toolID", toolID);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
evnt = new ToolEvent
|
||||||
|
{
|
||||||
|
TOOL_ID = reader[0].ToString(),
|
||||||
|
START_DTM = reader[1].ToString(),
|
||||||
|
TOOL_MODE = reader[2].ToString(),
|
||||||
|
TOOL_MODE_DESC = reader[3].ToString()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return evnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetLastUpTransaction(string reactorNumber)
|
||||||
|
{
|
||||||
|
int lastTransaction = 0;
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT TOP 1 DATEDIFF(MINUTE,START_DTM,SYSDATETIME()) " +
|
||||||
|
" FROM REACT_MODE " +
|
||||||
|
" WHERE REACT_NO = @reactorNumber " +
|
||||||
|
" AND (MODE = 'UP' OR MODE = 'UP_WITH_INCREASED_SAMPLING') " +
|
||||||
|
"ORDER BY START_DTM DESC";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
lastTransaction = int.Parse(reader[0].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return lastTransaction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate)
|
||||||
|
{
|
||||||
|
OutsAndScrapTotal totals = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT SUM(WFRS_OUT) AS OUTS, " +
|
||||||
|
" SUM(CUST_TOT_REJ) AS CUST, " +
|
||||||
|
" SUM(LSL_TOT_REJ) AS MANU, " +
|
||||||
|
" SUM(TW_PROD) AS PROD " +
|
||||||
|
" FROM RDS " +
|
||||||
|
" WHERE DATE_OUT >= @startDate " +
|
||||||
|
" AND DATE_OUT <= @endDate";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
totals = new()
|
||||||
|
{
|
||||||
|
Outs = int.Parse(reader[0].ToString()),
|
||||||
|
CustomerScrap = int.Parse(reader[1].ToString()),
|
||||||
|
ManufacturingScrap = int.Parse(reader[2].ToString()),
|
||||||
|
ProductionScrap = int.Parse(reader[3].ToString()),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return totals;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime GetQuarterStartDate()
|
||||||
|
{
|
||||||
|
DateTime date = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT START_DT " +
|
||||||
|
" FROM FISCAL_QTR " +
|
||||||
|
" WHERE START_DT < SYSDATETIME() " +
|
||||||
|
" AND END_DT > SYSDATETIME()";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
date = DateTime.Parse(reader[0].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
}
|
@ -1,23 +1,22 @@
|
|||||||
using ReportingServices.Shared.Models.PlanningReport;
|
using ReportingServices.Shared.Models.PlanningReport;
|
||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.Repositories
|
namespace ReportingServices.Shared.Repositories;
|
||||||
|
|
||||||
|
public interface IScrapeDatabaseRepository
|
||||||
{
|
{
|
||||||
public interface IScrapeDatabaseRepository
|
public void OpenConnection();
|
||||||
{
|
public void CloseConnection();
|
||||||
public void OpenConnection();
|
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs);
|
||||||
public void CloseConnection();
|
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate);
|
||||||
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs);
|
public int GetNumberOfPartChanges(string startDate, string endDate);
|
||||||
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate);
|
public QuarterlyTargets GetQuarterlyTargets();
|
||||||
public int GetNumberOfPartChanges(string startDate, string endDate);
|
public List<Reactor> GetReactors();
|
||||||
public QuarterlyTargets GetQuarterlyTargets();
|
public List<RDS> GetRDSForLastDay(string date);
|
||||||
public List<Reactor> GetReactors();
|
public List<ReactorOutsByRDS> GetRDSRunBetweenDates(string startDate, string endDate);
|
||||||
public List<RDS> GetRDSForLastDay(string date);
|
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber);
|
||||||
public List<ReactorOutsByRDS> GetRDSRunBetweenDates(string startDate, string endDate);
|
public ToolEvent GetLatestToolEvent(string toolID);
|
||||||
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber);
|
public int GetLastUpTransaction(string reactorNumber);
|
||||||
public ToolEvent GetLatestToolEvent(string toolID);
|
public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate);
|
||||||
public int GetLastUpTransaction(string reactorNumber);
|
public DateTime GetQuarterStartDate();
|
||||||
public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate);
|
}
|
||||||
public DateTime GetQuarterStartDate();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,131 +1,130 @@
|
|||||||
using ReportingServices.Shared.HelperClasses;
|
using ReportingServices.Shared.HelperClasses;
|
||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.ViewModels.ProductionReport
|
namespace ReportingServices.Shared.ViewModels.ProductionReport;
|
||||||
|
|
||||||
|
public class DailyReport
|
||||||
{
|
{
|
||||||
public class DailyReport
|
public DateTime StartDate { get; set; }
|
||||||
|
public DateTime QuarterStartDate { get; set; }
|
||||||
|
public YieldStatistics CurrentWeek { get; set; }
|
||||||
|
public YieldStatistics PreviousWeek { get; set; }
|
||||||
|
public List<ToolEventView> ToolEvents { get; set; }
|
||||||
|
public List<ToolEvent> CleanEvents { get; set; }
|
||||||
|
public List<ToolEvent> MetrologyEvents { get; set; }
|
||||||
|
public Dictionary<string, List<string>> ToolStatesByOwner { get; set; }
|
||||||
|
public Dictionary<string, List<int>> DualLayerReactors { get; set; }
|
||||||
|
public ManualReportEntries ManualReportEntries { get; set; }
|
||||||
|
public List<UnloadTempsByDay> UnloadTempsByDay { get; set; }
|
||||||
|
public List<SLLTool> SLLTools { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize6IN { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize8IN { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize6INScheduled { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize8INScheduled { get; set; }
|
||||||
|
public QuarterlyTargets QuarterlyTargets { get; set; }
|
||||||
|
|
||||||
|
public DailyReport()
|
||||||
{
|
{
|
||||||
public DateTime StartDate { get; set; }
|
CleanEvents = new();
|
||||||
public DateTime QuarterStartDate { get; set; }
|
MetrologyEvents = new();
|
||||||
public YieldStatistics CurrentWeek { get; set; }
|
DualLayerReactors = new();
|
||||||
public YieldStatistics PreviousWeek { get; set; }
|
UnloadTempsByDay = new();
|
||||||
public List<ToolEventView> ToolEvents { get; set; }
|
ToolEvents = new();
|
||||||
public List<ToolEvent> CleanEvents { get; set; }
|
StartDate = DateTime.Parse(APIHelperFunctions.GetBeginningOfWeekAsAPIString());
|
||||||
public List<ToolEvent> MetrologyEvents { get; set; }
|
CurrentWeek = new(StartDate, true);
|
||||||
public Dictionary<string, List<string>> ToolStatesByOwner { get; set; }
|
PreviousWeek = new(StartDate.AddDays(-7), false);
|
||||||
public Dictionary<string, List<int>> DualLayerReactors { get; set; }
|
}
|
||||||
public ManualReportEntries ManualReportEntries { get; set; }
|
|
||||||
public List<UnloadTempsByDay> UnloadTempsByDay { get; set; }
|
|
||||||
public List<SLLTool> SLLTools { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize6IN { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize8IN { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize6INScheduled { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize8INScheduled { get; set; }
|
|
||||||
public QuarterlyTargets QuarterlyTargets { get; set; }
|
|
||||||
|
|
||||||
public DailyReport()
|
public void SetReactorInfo(List<Reactor> reactors, List<int> unscheduledReactors)
|
||||||
|
{
|
||||||
|
SetToolsByPocketSize(reactors, unscheduledReactors);
|
||||||
|
SetDisabledLoadlocks(reactors);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetRDSInfo(List<RDS> rdsList)
|
||||||
|
{
|
||||||
|
SetDualLayerReactors(rdsList);
|
||||||
|
SetUnloadTempsLessThan700(rdsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetToolsByPocketSize(List<Reactor> reactors, List<int> unscheduledReactors)
|
||||||
|
{
|
||||||
|
NumberOfToolsWaferSize6IN = reactors.Where(react => react.PocketSize.Contains("150")).Count();
|
||||||
|
NumberOfToolsWaferSize8IN = reactors.Where(react => react.PocketSize.Contains("200")).Count();
|
||||||
|
|
||||||
|
NumberOfToolsWaferSize6INScheduled =
|
||||||
|
reactors.Where(react => !unscheduledReactors.Contains(react.ReactorNumber)
|
||||||
|
&& react.PocketSize.Contains("150")).Count();
|
||||||
|
NumberOfToolsWaferSize8INScheduled =
|
||||||
|
reactors.Where(react => !unscheduledReactors.Contains(react.ReactorNumber)
|
||||||
|
&& react.PocketSize.Contains("200")).Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetDisabledLoadlocks(List<Reactor> reactors)
|
||||||
|
{
|
||||||
|
List<Reactor> reactorsWithDisabledLoadlocks = reactors.Where(react => react.HasDisabledLoadlock).ToList();
|
||||||
|
|
||||||
|
int singleLoadlockASM = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("ASM")).Count();
|
||||||
|
int singleLoadlockHTR = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("HTR")).Count();
|
||||||
|
|
||||||
|
foreach (SLLTool sll in SLLTools)
|
||||||
{
|
{
|
||||||
CleanEvents = new();
|
if (sll.Date.Date == DateTime.Now.Date)
|
||||||
MetrologyEvents = new();
|
|
||||||
DualLayerReactors = new();
|
|
||||||
UnloadTempsByDay = new();
|
|
||||||
ToolEvents = new();
|
|
||||||
StartDate = DateTime.Parse(APIHelperFunctions.GetBeginningOfWeekAsAPIString());
|
|
||||||
CurrentWeek = new(StartDate, true);
|
|
||||||
PreviousWeek = new(StartDate.AddDays(-7), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetReactorInfo(List<Reactor> reactors, List<int> unscheduledReactors)
|
|
||||||
{
|
|
||||||
SetToolsByPocketSize(reactors, unscheduledReactors);
|
|
||||||
SetDisabledLoadlocks(reactors);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetRDSInfo(List<RDS> rdsList)
|
|
||||||
{
|
|
||||||
SetDualLayerReactors(rdsList);
|
|
||||||
SetUnloadTempsLessThan700(rdsList);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetToolsByPocketSize(List<Reactor> reactors, List<int> unscheduledReactors)
|
|
||||||
{
|
|
||||||
NumberOfToolsWaferSize6IN = reactors.Where(react => react.PocketSize.Contains("150")).Count();
|
|
||||||
NumberOfToolsWaferSize8IN = reactors.Where(react => react.PocketSize.Contains("200")).Count();
|
|
||||||
|
|
||||||
NumberOfToolsWaferSize6INScheduled =
|
|
||||||
reactors.Where(react => !unscheduledReactors.Contains(react.ReactorNumber)
|
|
||||||
&& react.PocketSize.Contains("150")).Count();
|
|
||||||
NumberOfToolsWaferSize8INScheduled =
|
|
||||||
reactors.Where(react => !unscheduledReactors.Contains(react.ReactorNumber)
|
|
||||||
&& react.PocketSize.Contains("200")).Count();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetDisabledLoadlocks(List<Reactor> reactors)
|
|
||||||
{
|
|
||||||
List<Reactor> reactorsWithDisabledLoadlocks = reactors.Where(react => react.HasDisabledLoadlock).ToList();
|
|
||||||
|
|
||||||
int singleLoadlockASM = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("ASM")).Count();
|
|
||||||
int singleLoadlockHTR = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("HTR")).Count();
|
|
||||||
|
|
||||||
foreach (SLLTool sll in SLLTools)
|
|
||||||
{
|
{
|
||||||
if (sll.Date.Date == DateTime.Now.Date)
|
sll.ASM = singleLoadlockASM;
|
||||||
{
|
sll.HTR = singleLoadlockHTR;
|
||||||
sll.ASM = singleLoadlockASM;
|
return;
|
||||||
sll.HTR = singleLoadlockHTR;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SLLTools.Add(new SLLTool
|
SLLTools.Add(new SLLTool
|
||||||
|
{
|
||||||
|
Date = DateTime.Now.Date,
|
||||||
|
ASM = singleLoadlockASM,
|
||||||
|
HTR = singleLoadlockHTR
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetDualLayerReactors(List<RDS> rdsList)
|
||||||
|
{
|
||||||
|
DateTime compareDate = DateTime.Now.Date;
|
||||||
|
List<RDS> rdsWithDualLayerPSN = rdsList.Where(rds => rds.LayerType.Contains("2 Layer") && rds.DateOut == compareDate).ToList();
|
||||||
|
|
||||||
|
DualLayerReactors.Add("ASM", rdsWithDualLayerPSN.
|
||||||
|
Where(rds => rds.ReactorType.Contains("ASM")).
|
||||||
|
OrderBy(rds => rds.Reactor).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().ToList());
|
||||||
|
DualLayerReactors.Add("HTR", rdsWithDualLayerPSN.
|
||||||
|
Where(rds => rds.ReactorType.Contains("HTR")).
|
||||||
|
OrderBy(rds => rds.Reactor).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().ToList());
|
||||||
|
DualLayerReactors.Add("EPP", rdsWithDualLayerPSN.
|
||||||
|
Where(rds => rds.ReactorType.Contains("EPP")).
|
||||||
|
OrderBy(rds => rds.Reactor).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetUnloadTempsLessThan700(List<RDS> rdsList)
|
||||||
|
{
|
||||||
|
IEnumerable<IGrouping<DateTime, RDS>> rdsWithTempsLessThan700 = rdsList.Where(rds => rds.UnloadTemp < 700).GroupBy(rds => rds.DateOut);
|
||||||
|
|
||||||
|
foreach (IGrouping<DateTime, RDS> group in rdsWithTempsLessThan700)
|
||||||
|
{
|
||||||
|
UnloadTempsByDay.Add(new UnloadTempsByDay
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.Date,
|
Date = group.Key,
|
||||||
ASM = singleLoadlockASM,
|
ASMUnloadsBelow700 = group.Where(rds => rds.ReactorType.Contains("ASM")).Select(rds => rds.Reactor).Distinct().Count(),
|
||||||
HTR = singleLoadlockHTR
|
HTRUnloadsBelow700 = group.Where(rds => rds.ReactorType.Contains("HTR")).Select(rds => rds.Reactor).Distinct().Count()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetDualLayerReactors(List<RDS> rdsList)
|
|
||||||
{
|
|
||||||
DateTime compareDate = DateTime.Now.Date;
|
|
||||||
List<RDS> rdsWithDualLayerPSN = rdsList.Where(rds => rds.LayerType.Contains("2 Layer") && rds.DateOut == compareDate).ToList();
|
|
||||||
|
|
||||||
DualLayerReactors.Add("ASM", rdsWithDualLayerPSN.
|
|
||||||
Where(rds => rds.ReactorType.Contains("ASM")).
|
|
||||||
OrderBy(rds => rds.Reactor).
|
|
||||||
Select(rds => rds.Reactor).
|
|
||||||
Distinct().ToList());
|
|
||||||
DualLayerReactors.Add("HTR", rdsWithDualLayerPSN.
|
|
||||||
Where(rds => rds.ReactorType.Contains("HTR")).
|
|
||||||
OrderBy(rds => rds.Reactor).
|
|
||||||
Select(rds => rds.Reactor).
|
|
||||||
Distinct().ToList());
|
|
||||||
DualLayerReactors.Add("EPP", rdsWithDualLayerPSN.
|
|
||||||
Where(rds => rds.ReactorType.Contains("EPP")).
|
|
||||||
OrderBy(rds => rds.Reactor).
|
|
||||||
Select(rds => rds.Reactor).
|
|
||||||
Distinct().ToList());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetUnloadTempsLessThan700(List<RDS> rdsList)
|
|
||||||
{
|
|
||||||
var rdsWithTempsLessThan700 = rdsList.Where(rds => rds.UnloadTemp < 700).GroupBy(rds => rds.DateOut);
|
|
||||||
|
|
||||||
foreach (var group in rdsWithTempsLessThan700)
|
|
||||||
{
|
|
||||||
UnloadTempsByDay.Add(new UnloadTempsByDay
|
|
||||||
{
|
|
||||||
Date = group.Key,
|
|
||||||
ASMUnloadsBelow700 = group.Where(rds => rds.ReactorType.Contains("ASM")).Select(rds => rds.Reactor).Distinct().Count(),
|
|
||||||
HTRUnloadsBelow700 = group.Where(rds => rds.ReactorType.Contains("HTR")).Select(rds => rds.Reactor).Distinct().Count()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ReverseLists()
|
|
||||||
{
|
|
||||||
CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay);
|
|
||||||
PreviousWeek.ScrapByDay = APIHelperFunctions.ReverseList(PreviousWeek.ScrapByDay);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public void ReverseLists()
|
||||||
|
{
|
||||||
|
CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay);
|
||||||
|
PreviousWeek.ScrapByDay = APIHelperFunctions.ReverseList(PreviousWeek.ScrapByDay);
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,8 @@
|
|||||||
namespace ReportingServices.Shared.ViewModels.ProductionReport
|
namespace ReportingServices.Shared.ViewModels.ProductionReport;
|
||||||
|
|
||||||
|
public class SLLTool
|
||||||
{
|
{
|
||||||
public class SLLTool
|
public DateTime Date { get; set; }
|
||||||
{
|
public int ASM { get; set; }
|
||||||
public DateTime Date { get; set; }
|
public int HTR { get; set; }
|
||||||
public int ASM { get; set; }
|
}
|
||||||
public int HTR { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,71 +1,93 @@
|
|||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
using System.Data;
|
|
||||||
|
|
||||||
namespace ReportingServices.Shared.ViewModels.ProductionReport
|
namespace ReportingServices.Shared.ViewModels.ProductionReport;
|
||||||
|
|
||||||
|
public class ToolEventView
|
||||||
{
|
{
|
||||||
public class ToolEventView
|
public string Reactor { get; set; }
|
||||||
|
public string Type { get; set; }
|
||||||
|
public string StartDate { get; set; }
|
||||||
|
public string EndDate { get; set; }
|
||||||
|
public double Downtime { get; set; }
|
||||||
|
public bool IsInProduction { get; set; }
|
||||||
|
public List<ReactorEvent> Events { get; set; }
|
||||||
|
public ReactorEvent MostRecentEvent { get; set; }
|
||||||
|
public List<ToolUptimeData> Uptime { get; set; }
|
||||||
|
|
||||||
|
public ToolEventView(List<ReactorEvent> events, string startDate, string endDate, string reactor, string type)
|
||||||
{
|
{
|
||||||
public string Reactor { get; set; }
|
Events = events;
|
||||||
public string Type { get; set; }
|
StartDate = startDate;
|
||||||
public string StartDate { get; set; }
|
EndDate = endDate;
|
||||||
public string EndDate { get; set; }
|
Reactor = reactor;
|
||||||
public double Downtime { get; set; }
|
Type = type;
|
||||||
public bool IsInProduction { get; set; }
|
MostRecentEvent = events[^1];
|
||||||
public List<ReactorEvent> Events { get; set; }
|
IsInProduction = EventIsProduction(MostRecentEvent.REACT_MODE);
|
||||||
public ReactorEvent MostRecentEvent { get; set; }
|
Uptime = DetermineToolUptimeData();
|
||||||
public List<ToolUptimeData> Uptime { get; set; }
|
}
|
||||||
|
|
||||||
public ToolEventView(List<ReactorEvent> events, string startDate, string endDate, string reactor, string type)
|
public void SetDowntime(int timeSinceLastUpTransaction)
|
||||||
|
{
|
||||||
|
if (IsInProduction)
|
||||||
|
Downtime = 0;
|
||||||
|
else
|
||||||
|
Downtime = (double)timeSinceLastUpTransaction / 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ToolUptimeData> DetermineToolUptimeData()
|
||||||
|
{
|
||||||
|
List<ToolUptimeData> data = new();
|
||||||
|
|
||||||
|
bool currentModeIsUp;
|
||||||
|
double uptime = 0;
|
||||||
|
DateTime compareDate = DateTime.Parse(StartDate).Date;
|
||||||
|
DateTime previousTransaction = DateTime.Parse(StartDate).Date;
|
||||||
|
|
||||||
|
currentModeIsUp = EventIsProduction(Events[0].REACT_MODE);
|
||||||
|
|
||||||
|
if (Events.Count == 1)
|
||||||
|
data = LoadUptimeData(currentModeIsUp);
|
||||||
|
|
||||||
|
for (int i = 1; i < Events.Count; i++)
|
||||||
{
|
{
|
||||||
Events = events;
|
DateTime currentTransaction = DateTime.Parse(Events[i].EVENT_DTM);
|
||||||
StartDate = startDate;
|
|
||||||
EndDate = endDate;
|
|
||||||
Reactor = reactor;
|
|
||||||
Type = type;
|
|
||||||
MostRecentEvent = events[events.Count - 1];
|
|
||||||
IsInProduction = EventIsProduction(MostRecentEvent.REACT_MODE);
|
|
||||||
Uptime = DetermineToolUptimeData();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetDowntime(int timeSinceLastUpTransaction)
|
if (currentTransaction.Date == compareDate)
|
||||||
{
|
|
||||||
if (IsInProduction)
|
|
||||||
Downtime = 0;
|
|
||||||
else
|
|
||||||
Downtime = (double)timeSinceLastUpTransaction / 60;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ToolUptimeData> DetermineToolUptimeData()
|
|
||||||
{
|
|
||||||
List<ToolUptimeData> data = new();
|
|
||||||
|
|
||||||
bool currentModeIsUp;
|
|
||||||
double uptime = 0;
|
|
||||||
DateTime compareDate = DateTime.Parse(StartDate).Date;
|
|
||||||
DateTime previousTransaction = DateTime.Parse(StartDate).Date;
|
|
||||||
|
|
||||||
currentModeIsUp = EventIsProduction(Events[0].REACT_MODE);
|
|
||||||
|
|
||||||
if (Events.Count == 1)
|
|
||||||
data = LoadUptimeData(currentModeIsUp);
|
|
||||||
|
|
||||||
for (int i = 1; i < Events.Count; i++)
|
|
||||||
{
|
{
|
||||||
DateTime currentTransaction = DateTime.Parse(Events[i].EVENT_DTM);
|
if (currentModeIsUp)
|
||||||
|
uptime += (DateTime.Parse(Events[i].EVENT_DTM) - previousTransaction).TotalMinutes;
|
||||||
|
|
||||||
if (currentTransaction.Date == compareDate)
|
currentModeIsUp = EventIsProduction(Events[i].REACT_MODE);
|
||||||
|
previousTransaction = DateTime.Parse(Events[i].EVENT_DTM);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((currentTransaction.Date - compareDate).TotalHours == 24)
|
||||||
|
{
|
||||||
|
if (currentModeIsUp)
|
||||||
|
uptime += (currentTransaction.Date - previousTransaction).TotalMinutes;
|
||||||
|
|
||||||
|
data.Add(new ToolUptimeData
|
||||||
|
{
|
||||||
|
Date = compareDate.ToString(),
|
||||||
|
UptimePercentage = uptime / 1440
|
||||||
|
});
|
||||||
|
|
||||||
|
if (currentModeIsUp)
|
||||||
|
uptime = (currentTransaction - currentTransaction.Date).TotalMinutes;
|
||||||
|
else
|
||||||
|
uptime = 0;
|
||||||
|
|
||||||
|
compareDate = compareDate.AddDays(1);
|
||||||
|
currentModeIsUp = EventIsProduction(Events[i].REACT_MODE);
|
||||||
|
previousTransaction = DateTime.Parse(Events[i].EVENT_DTM);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((currentTransaction.Date - compareDate).TotalHours > 24)
|
||||||
|
{
|
||||||
|
while (currentTransaction.Date != compareDate)
|
||||||
{
|
{
|
||||||
if (currentModeIsUp)
|
if (currentModeIsUp)
|
||||||
uptime += (DateTime.Parse(Events[i].EVENT_DTM) - previousTransaction).TotalMinutes;
|
uptime += (compareDate.AddDays(1) - previousTransaction).TotalMinutes;
|
||||||
|
|
||||||
currentModeIsUp = EventIsProduction(Events[i].REACT_MODE);
|
|
||||||
previousTransaction = DateTime.Parse(Events[i].EVENT_DTM);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((currentTransaction.Date - compareDate).TotalHours == 24)
|
|
||||||
{
|
|
||||||
if (currentModeIsUp)
|
|
||||||
uptime += (currentTransaction.Date - previousTransaction).TotalMinutes;
|
|
||||||
|
|
||||||
data.Add(new ToolUptimeData
|
data.Add(new ToolUptimeData
|
||||||
{
|
{
|
||||||
@ -73,19 +95,18 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
UptimePercentage = uptime / 1440
|
UptimePercentage = uptime / 1440
|
||||||
});
|
});
|
||||||
|
|
||||||
if (currentModeIsUp)
|
uptime = 0;
|
||||||
uptime = (currentTransaction - currentTransaction.Date).TotalMinutes;
|
|
||||||
else
|
|
||||||
uptime = 0;
|
|
||||||
|
|
||||||
compareDate = compareDate.AddDays(1);
|
compareDate = compareDate.AddDays(1);
|
||||||
currentModeIsUp = EventIsProduction(Events[i].REACT_MODE);
|
previousTransaction = compareDate;
|
||||||
previousTransaction = DateTime.Parse(Events[i].EVENT_DTM);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ((currentTransaction.Date - compareDate).TotalHours > 24)
|
|
||||||
|
if (i == Events.Count - 1)
|
||||||
|
{
|
||||||
|
if (DateTime.Parse(EndDate).Date != compareDate)
|
||||||
{
|
{
|
||||||
while (currentTransaction.Date != compareDate)
|
while (DateTime.Parse(EndDate).Date != compareDate)
|
||||||
{
|
{
|
||||||
if (currentModeIsUp)
|
if (currentModeIsUp)
|
||||||
uptime += (compareDate.AddDays(1) - previousTransaction).TotalMinutes;
|
uptime += (compareDate.AddDays(1) - previousTransaction).TotalMinutes;
|
||||||
@ -103,71 +124,48 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == Events.Count - 1)
|
if (currentModeIsUp)
|
||||||
{
|
uptime += (DateTime.Parse(EndDate) - previousTransaction).TotalMinutes;
|
||||||
if ((DateTime.Parse(EndDate).Date != compareDate))
|
|
||||||
{
|
|
||||||
while (DateTime.Parse(EndDate).Date != compareDate)
|
|
||||||
{
|
|
||||||
if (currentModeIsUp)
|
|
||||||
uptime += (compareDate.AddDays(1) - previousTransaction).TotalMinutes;
|
|
||||||
|
|
||||||
data.Add(new ToolUptimeData
|
|
||||||
{
|
|
||||||
Date = compareDate.ToString(),
|
|
||||||
UptimePercentage = uptime / 1440
|
|
||||||
});
|
|
||||||
|
|
||||||
uptime = 0;
|
|
||||||
|
|
||||||
compareDate = compareDate.AddDays(1);
|
|
||||||
previousTransaction = compareDate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentModeIsUp)
|
|
||||||
uptime += (DateTime.Parse(EndDate) - previousTransaction).TotalMinutes;
|
|
||||||
|
|
||||||
data.Add(new ToolUptimeData
|
|
||||||
{
|
|
||||||
Date = DateTime.Now.Date.ToString(),
|
|
||||||
UptimePercentage = uptime / (DateTime.Parse(EndDate) - DateTime.Parse(EndDate).Date).TotalMinutes
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<ToolUptimeData> LoadUptimeData(bool currentModeIsUp)
|
|
||||||
{
|
|
||||||
List<ToolUptimeData> data = new();
|
|
||||||
|
|
||||||
double days = (DateTime.Parse(EndDate) - DateTime.Parse(StartDate)).TotalDays;
|
|
||||||
|
|
||||||
for (int i = 0; i < days; i++)
|
|
||||||
{
|
|
||||||
data.Add(new ToolUptimeData
|
data.Add(new ToolUptimeData
|
||||||
{
|
{
|
||||||
Date = DateTime.Parse(StartDate).Date.AddDays(i).ToString(),
|
Date = DateTime.Now.Date.ToString(),
|
||||||
UptimePercentage = currentModeIsUp ? 1 : 0
|
UptimePercentage = uptime / (DateTime.Parse(EndDate) - DateTime.Parse(EndDate).Date).TotalMinutes
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool EventIsProduction(string evnt)
|
|
||||||
{
|
|
||||||
if (evnt.ToUpper() == "UP")
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (evnt.ToUpper() == "UP_WITH_INCREASED_SAMPLING")
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private List<ToolUptimeData> LoadUptimeData(bool currentModeIsUp)
|
||||||
|
{
|
||||||
|
List<ToolUptimeData> data = new();
|
||||||
|
|
||||||
|
double days = (DateTime.Parse(EndDate) - DateTime.Parse(StartDate)).TotalDays;
|
||||||
|
|
||||||
|
for (int i = 0; i < days; i++)
|
||||||
|
{
|
||||||
|
data.Add(new ToolUptimeData
|
||||||
|
{
|
||||||
|
Date = DateTime.Parse(StartDate).Date.AddDays(i).ToString(),
|
||||||
|
UptimePercentage = currentModeIsUp ? 1 : 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool EventIsProduction(string evnt)
|
||||||
|
{
|
||||||
|
if (evnt.ToUpper() == "UP")
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (evnt.ToUpper() == "UP_WITH_INCREASED_SAMPLING")
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,8 @@
|
|||||||
namespace ReportingServices.Shared.ViewModels.ProductionReport
|
namespace ReportingServices.Shared.ViewModels.ProductionReport;
|
||||||
|
|
||||||
|
public class UnloadTempsByDay
|
||||||
{
|
{
|
||||||
public class UnloadTempsByDay
|
public DateTime Date { get; set; }
|
||||||
{
|
public int ASMUnloadsBelow700 { get; set; }
|
||||||
public DateTime Date { get; set; }
|
public int HTRUnloadsBelow700 { get; set; }
|
||||||
public int ASMUnloadsBelow700 { get; set; }
|
}
|
||||||
public int HTRUnloadsBelow700 { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +1,61 @@
|
|||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.ViewModels.ProductionReport
|
namespace ReportingServices.Shared.ViewModels.ProductionReport;
|
||||||
|
|
||||||
|
public class YieldStatistics
|
||||||
{
|
{
|
||||||
public class YieldStatistics
|
public DateTime StartDate { get; set; }
|
||||||
|
public List<ReactorOutsByDay> OutsByDay { get; set; }
|
||||||
|
public List<ScrapByDay> ScrapByDay { get; set; }
|
||||||
|
public OutsAndScrapTotal QTDOutsAndScrap { get; set; }
|
||||||
|
public int DailyPlanWafers { get; set; }
|
||||||
|
public bool IsCurrentWeek { get; set; }
|
||||||
|
|
||||||
|
public YieldStatistics(DateTime startDate, bool isCurrentWeek)
|
||||||
{
|
{
|
||||||
public DateTime StartDate { get; set; }
|
StartDate = startDate;
|
||||||
public List<ReactorOutsByDay> OutsByDay { get; set; }
|
IsCurrentWeek = isCurrentWeek;
|
||||||
public List<ScrapByDay> ScrapByDay { get; set; }
|
}
|
||||||
public OutsAndScrapTotal QTDOutsAndScrap { get; set; }
|
|
||||||
public int DailyPlanWafers { get; set; }
|
|
||||||
public bool IsCurrentWeek { get; set; }
|
|
||||||
|
|
||||||
public YieldStatistics(DateTime startDate, bool isCurrentWeek)
|
public void SetYieldInformation(YieldInformation yieldInformation, QuarterlyTargets targets)
|
||||||
|
{
|
||||||
|
OutsByDay = GetReactorOutsByDay(yieldInformation.Outs);
|
||||||
|
ScrapByDay = yieldInformation.Scrap;
|
||||||
|
DailyPlanWafers = targets.Yield_Outs / targets.PlanWorkingDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<string> GetDistinctDatesFromReactorOuts(List<ReactorOutsByRDS> outs)
|
||||||
|
{
|
||||||
|
List<string> dates = new();
|
||||||
|
|
||||||
|
foreach (ReactorOutsByRDS rout in outs)
|
||||||
{
|
{
|
||||||
StartDate = startDate;
|
if (!dates.Contains(DateTime.Parse(rout.EndProcessTime).Date.ToString()))
|
||||||
IsCurrentWeek = isCurrentWeek;
|
dates.Add(DateTime.Parse(rout.EndProcessTime).Date.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetYieldInformation(YieldInformation yieldInformation, QuarterlyTargets targets)
|
return dates;
|
||||||
{
|
}
|
||||||
OutsByDay = GetReactorOutsByDay(yieldInformation.Outs);
|
|
||||||
ScrapByDay = yieldInformation.Scrap;
|
|
||||||
DailyPlanWafers = targets.Yield_Outs / targets.PlanWorkingDays;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<string> GetDistinctDatesFromReactorOuts(List<ReactorOutsByRDS> outs)
|
public static List<ReactorOutsByDay> GetReactorOutsByDay(List<ReactorOutsByRDS> outs)
|
||||||
|
{
|
||||||
|
List<ReactorOutsByDay> outsByDay = new();
|
||||||
|
|
||||||
|
List<string> dates = GetDistinctDatesFromReactorOuts(outs);
|
||||||
|
|
||||||
|
foreach (string date in dates)
|
||||||
{
|
{
|
||||||
List<string> dates = new();
|
int waferCount = 0;
|
||||||
|
|
||||||
foreach (ReactorOutsByRDS rout in outs)
|
foreach (ReactorOutsByRDS rout in outs)
|
||||||
{
|
{
|
||||||
if (!dates.Contains(DateTime.Parse(rout.EndProcessTime).Date.ToString()))
|
if (DateTime.Parse(rout.EndProcessTime).Date.ToString() == date)
|
||||||
dates.Add(DateTime.Parse(rout.EndProcessTime).Date.ToString());
|
waferCount += (int)float.Parse(rout.Units);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dates;
|
outsByDay.Add(new ReactorOutsByDay { StartDate = date, TotalWafers = waferCount });
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ReactorOutsByDay> GetReactorOutsByDay(List<ReactorOutsByRDS> outs)
|
return outsByDay;
|
||||||
{
|
|
||||||
List<ReactorOutsByDay> outsByDay = new();
|
|
||||||
|
|
||||||
List<string> dates = GetDistinctDatesFromReactorOuts(outs);
|
|
||||||
|
|
||||||
foreach (string date in dates)
|
|
||||||
{
|
|
||||||
int waferCount = 0;
|
|
||||||
|
|
||||||
foreach (ReactorOutsByRDS rout in outs)
|
|
||||||
{
|
|
||||||
if (DateTime.Parse(rout.EndProcessTime).Date.ToString() == date)
|
|
||||||
waferCount += (int)float.Parse(rout.Units);
|
|
||||||
}
|
|
||||||
|
|
||||||
outsByDay.Add(new ReactorOutsByDay { StartDate = date, TotalWafers = waferCount });
|
|
||||||
}
|
|
||||||
|
|
||||||
return outsByDay;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,88 +1,88 @@
|
|||||||
using ReportingServices.Shared.HelperClasses;
|
using ReportingServices.Shared.HelperClasses;
|
||||||
|
|
||||||
namespace ReportingServices.Test
|
namespace ReportingServices.Test;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class APIHelperTester
|
||||||
{
|
{
|
||||||
[TestClass]
|
[TestMethod]
|
||||||
public class APIHelperTester
|
public void CheckShortDateWithPassedInDate()
|
||||||
{
|
{
|
||||||
[TestMethod]
|
// Arrange
|
||||||
public void CheckShortDateWithPassedInDate()
|
string date = DateTime.Now.ToString("yyyy-M-d") + " 0:0:0";
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
string date = DateTime.Now.ToString("yyyy-M-d") + " 0:0:0";
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
string callerDate = APIHelperFunctions.GetDateTimeAsAPIString(DateTime.Now.ToString(), false);
|
string callerDate = APIHelperFunctions.GetDateTimeAsAPIString(DateTime.Now.ToString(), false);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(date, callerDate);
|
Assert.AreEqual(date, callerDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void CheckFullDateWithPassedInDate()
|
public void CheckFullDateWithPassedInDate()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
string date = DateTime.Now.ToString("yyyy-M-d HH:mm:ss");
|
string date = DateTime.Now.ToString("yyyy-M-d HH:mm:ss");
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
string callerDate = APIHelperFunctions.GetDateTimeAsAPIString(DateTime.Now.ToString(), true);
|
string callerDate = APIHelperFunctions.GetDateTimeAsAPIString(DateTime.Now.ToString(), true);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(date, callerDate);
|
Assert.AreEqual(date, callerDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void CheckStartDateForWeekNow()
|
public void CheckStartDateForWeekNow()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
string date = DetermineDate();
|
string date = DetermineDate();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
string callerDate = APIHelperFunctions.GetBeginningOfWeekAsAPIString();
|
string callerDate = APIHelperFunctions.GetBeginningOfWeekAsAPIString();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(date, callerDate);
|
Assert.AreEqual(date, callerDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void CheckStartDateForDayPassedInAndHoursAdded()
|
public void CheckStartDateForDayPassedInAndHoursAdded()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
string date = "2022-11-23 00:00:00";
|
string date = "2022-11-23 00:00:00";
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
string callerDate = APIHelperFunctions.GetDateWithOffsetAsAPIString("11/23/2022 12:30 PM", -12.5f);
|
string callerDate = APIHelperFunctions.GetDateWithOffsetAsAPIString("11/23/2022 12:30 PM", -12.5f);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(date, callerDate);
|
Assert.AreEqual(date, callerDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string DetermineDate()
|
private string DetermineDate()
|
||||||
{
|
{
|
||||||
DateTime date = DateTime.Now;
|
DateTime date = DateTime.Now;
|
||||||
|
|
||||||
if (date.DayOfWeek == DayOfWeek.Monday)
|
if (date.DayOfWeek == DayOfWeek.Monday)
|
||||||
date = date.AddDays(-7);
|
date = date.AddDays(-7);
|
||||||
|
|
||||||
if (date.DayOfWeek == DayOfWeek.Tuesday)
|
if (date.DayOfWeek == DayOfWeek.Tuesday)
|
||||||
date = date.AddDays(-1);
|
date = date.AddDays(-1);
|
||||||
|
|
||||||
if (date.DayOfWeek == DayOfWeek.Wednesday)
|
if (date.DayOfWeek == DayOfWeek.Wednesday)
|
||||||
date = date.AddDays(-2);
|
date = date.AddDays(-2);
|
||||||
|
|
||||||
if (date.DayOfWeek == DayOfWeek.Thursday)
|
if (date.DayOfWeek == DayOfWeek.Thursday)
|
||||||
date = date.AddDays(-3);
|
date = date.AddDays(-3);
|
||||||
|
|
||||||
if (date.DayOfWeek == DayOfWeek.Friday)
|
if (date.DayOfWeek == DayOfWeek.Friday)
|
||||||
date = date.AddDays(-4);
|
date = date.AddDays(-4);
|
||||||
|
|
||||||
if (date.DayOfWeek == DayOfWeek.Saturday)
|
if (date.DayOfWeek == DayOfWeek.Saturday)
|
||||||
date = date.AddDays(-5);
|
date = date.AddDays(-5);
|
||||||
|
|
||||||
if (date.DayOfWeek == DayOfWeek.Sunday)
|
if (date.DayOfWeek == DayOfWeek.Sunday)
|
||||||
date = date.AddDays(-6);
|
date = date.AddDays(-6);
|
||||||
|
|
||||||
return date.Year + "-" + date.Month + "-" + date.Day + " 0:0:0"; ;
|
return date.Year + "-" + date.Month + "-" + date.Day + " 0:0:0";
|
||||||
}
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,67 +1,64 @@
|
|||||||
using ReportingServices.Shared.ViewModels.ProductionReport;
|
namespace ReportingServices.Test;
|
||||||
|
|
||||||
namespace ReportingServices.Test
|
[TestClass]
|
||||||
|
public class DailyReportTester
|
||||||
{
|
{
|
||||||
[TestClass]
|
[TestMethod]
|
||||||
public class DailyReportTester
|
public void SetRDSInfo_InputData_CalculatedAndStoresCorrectly()
|
||||||
{
|
{
|
||||||
[TestMethod]
|
/*
|
||||||
public void SetRDSInfo_InputData_CalculatedAndStoresCorrectly()
|
// Arrange
|
||||||
|
DailyReport rpt = new()
|
||||||
{
|
{
|
||||||
/*
|
CurrentEntries = TestingClass.ManualReportEntries
|
||||||
// Arrange
|
};
|
||||||
DailyReport rpt = new()
|
Dictionary<string, List<int>> dualLayerReactors = new()
|
||||||
{
|
|
||||||
CurrentEntries = TestingClass.ManualReportEntries
|
|
||||||
};
|
|
||||||
Dictionary<string, List<int>> dualLayerReactors = new()
|
|
||||||
{
|
|
||||||
{ "ASM", new List<int>() { 24, 62 } },
|
|
||||||
{ "HTR", new List<int>() { } },
|
|
||||||
{ "EPP", new List<int>() { 40, 42, 44, 46 } },
|
|
||||||
};
|
|
||||||
int asmUnloadTempsLessThan700 = 3;
|
|
||||||
int htrUnloadTempsLessThan700 = 3;
|
|
||||||
|
|
||||||
// Act
|
|
||||||
rpt.SetRDSInfo(TestingClass.RDSList);
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
CollectionAssert.AreEqual(dualLayerReactors["ASM"].ToList(), rpt.DualLayerReactors["ASM"].ToList());
|
|
||||||
CollectionAssert.AreEqual(dualLayerReactors["HTR"].ToList(), rpt.DualLayerReactors["HTR"].ToList());
|
|
||||||
CollectionAssert.AreEqual(dualLayerReactors["EPP"].ToList(), rpt.DualLayerReactors["EPP"].ToList());
|
|
||||||
Assert.AreEqual(asmUnloadTempsLessThan700, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMUnloadTempsLessThan700);
|
|
||||||
Assert.AreEqual(htrUnloadTempsLessThan700, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRUnloadTempsLessThan700);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void SetReactorInfo_InputData_CalculatedAndStoresCorrectly()
|
|
||||||
{
|
{
|
||||||
/*
|
{ "ASM", new List<int>() { 24, 62 } },
|
||||||
// Arrange
|
{ "HTR", new List<int>() { } },
|
||||||
DailyReport rpt = new()
|
{ "EPP", new List<int>() { 40, 42, 44, 46 } },
|
||||||
{
|
};
|
||||||
CurrentEntries = TestingClass.ManualReportEntries
|
int asmUnloadTempsLessThan700 = 3;
|
||||||
};
|
int htrUnloadTempsLessThan700 = 3;
|
||||||
int numberOfToolsWaferSize6IN = 11;
|
|
||||||
int numberOfToolsWaferSize8IN = 46;
|
|
||||||
int numberOfToolsWaferSize6INScheduled = 9;
|
|
||||||
int numberOfToolsWaferSize8INScheduled = 39;
|
|
||||||
int singleLoadLockASM = 5;
|
|
||||||
int singleLoadLockHTR = 14;
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
rpt.SetReactorInfo(TestingClass.Reactors, TestingClass.UnscheduledReactors);
|
rpt.SetRDSInfo(TestingClass.RDSList);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(numberOfToolsWaferSize6IN, rpt.NumberOfToolsWaferSize6IN);
|
CollectionAssert.AreEqual(dualLayerReactors["ASM"].ToList(), rpt.DualLayerReactors["ASM"].ToList());
|
||||||
Assert.AreEqual(numberOfToolsWaferSize8IN, rpt.NumberOfToolsWaferSize8IN);
|
CollectionAssert.AreEqual(dualLayerReactors["HTR"].ToList(), rpt.DualLayerReactors["HTR"].ToList());
|
||||||
Assert.AreEqual(numberOfToolsWaferSize6INScheduled, rpt.NumberOfToolsWaferSize6INScheduled);
|
CollectionAssert.AreEqual(dualLayerReactors["EPP"].ToList(), rpt.DualLayerReactors["EPP"].ToList());
|
||||||
Assert.AreEqual(numberOfToolsWaferSize8INScheduled, rpt.NumberOfToolsWaferSize8INScheduled);
|
Assert.AreEqual(asmUnloadTempsLessThan700, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMUnloadTempsLessThan700);
|
||||||
Assert.AreEqual(singleLoadLockASM, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMSingleLoadLock);
|
Assert.AreEqual(htrUnloadTempsLessThan700, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRUnloadTempsLessThan700);
|
||||||
Assert.AreEqual(singleLoadLockHTR, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRSingleLoadLock);
|
*/
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
[TestMethod]
|
||||||
|
public void SetReactorInfo_InputData_CalculatedAndStoresCorrectly()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
// Arrange
|
||||||
|
DailyReport rpt = new()
|
||||||
|
{
|
||||||
|
CurrentEntries = TestingClass.ManualReportEntries
|
||||||
|
};
|
||||||
|
int numberOfToolsWaferSize6IN = 11;
|
||||||
|
int numberOfToolsWaferSize8IN = 46;
|
||||||
|
int numberOfToolsWaferSize6INScheduled = 9;
|
||||||
|
int numberOfToolsWaferSize8INScheduled = 39;
|
||||||
|
int singleLoadLockASM = 5;
|
||||||
|
int singleLoadLockHTR = 14;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
rpt.SetReactorInfo(TestingClass.Reactors, TestingClass.UnscheduledReactors);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize6IN, rpt.NumberOfToolsWaferSize6IN);
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize8IN, rpt.NumberOfToolsWaferSize8IN);
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize6INScheduled, rpt.NumberOfToolsWaferSize6INScheduled);
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize8INScheduled, rpt.NumberOfToolsWaferSize8INScheduled);
|
||||||
|
Assert.AreEqual(singleLoadLockASM, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMSingleLoadLock);
|
||||||
|
Assert.AreEqual(singleLoadLockHTR, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRSingleLoadLock);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
@ -1,186 +1,185 @@
|
|||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
namespace ReportingServices.Test
|
namespace ReportingServices.Test;
|
||||||
|
|
||||||
|
internal static class TestingClass
|
||||||
{
|
{
|
||||||
internal static class TestingClass
|
public static readonly List<RDS> RDSList = new()
|
||||||
{
|
{
|
||||||
public static readonly List<RDS> RDSList = new()
|
new RDS { Reactor = 79, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 600, LayerType = "Standard 1 Layer" },
|
||||||
{
|
new RDS { Reactor = 45, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 79, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 600, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 62, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 45, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 62, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 62, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 62, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 62, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 24, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 62, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 24, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 24, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 24, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 24, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 66, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 24, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 28, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 66, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 28, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 28, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 63, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 28, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 63, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 63, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 23, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 63, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 23, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 23, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 32, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 23, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 58, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 650, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 32, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 77, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 58, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 650, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 77, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 77, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 57, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 77, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 57, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 57, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 20, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 57, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 20, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 20, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 43, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 20, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 43, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 43, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 29, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 43, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 25, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 29, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 25, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 38, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 38, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 38, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 64, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 38, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 64, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 64, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 32, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 64, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 37, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 32, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 37, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 37, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 30, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 37, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 31, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 30, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 33, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 31, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 33, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 33, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 33, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 33, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 55, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 33, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 55, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 55, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 55, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 55, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 36, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 55, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 21, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 36, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 21, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 21, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 73, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 21, ReactorType = "ASM", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 75, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 73, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 75, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 75, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 75, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 750, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 53, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 51, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 53, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 53, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 35, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 53, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 35, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 35, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 35, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 35, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 36, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 35, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 68, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 36, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 68, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 68, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 68, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 68, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 41, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 68, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 41, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 41, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 41, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 41, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 41, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 74, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 70, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 74, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 74, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 74, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 74, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 61, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 74, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 700, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 61, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 61, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 49, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 61, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 800, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 49, ReactorType = "HTR", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 550, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 52, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 48, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 52, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 54, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 48, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 50, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 54, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 40, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 50, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 40, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 40, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 40, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 44, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 42, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 44, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 44, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 44, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
||||||
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 48, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 46, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 2 Layer" },
|
new RDS { Reactor = 50, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 48, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 52, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 50, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 54, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 52, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 48, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
||||||
new RDS { Reactor = 54, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
new RDS { Reactor = 52, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" }
|
||||||
new RDS { Reactor = 48, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" },
|
};
|
||||||
new RDS { Reactor = 52, ReactorType = "EPP", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 1000, LayerType = "Standard 1 Layer" }
|
|
||||||
};
|
|
||||||
|
|
||||||
public static readonly List<Reactor> Reactors = new()
|
public static readonly List<Reactor> Reactors = new()
|
||||||
{
|
{
|
||||||
new Reactor { ReactorNumber = 20, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 20, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 21, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 21, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 22, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 22, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 23, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 23, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 24, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 24, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 25, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 25, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 26, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 26, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 27, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 27, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 28, Type = "ASM", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 28, Type = "ASM", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 29, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 29, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 30, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 30, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 31, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 31, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 32, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 32, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 33, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 33, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 34, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 34, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 35, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 35, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 36, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 36, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 37, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 37, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 38, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 38, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 39, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 39, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 40, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 40, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 41, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 41, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 42, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 42, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 43, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 43, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 44, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 44, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 45, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 45, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 46, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 46, Type = "EPP", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 47, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 47, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 48, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 48, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 49, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 49, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 50, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 50, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 51, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 51, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 52, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 52, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 53, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 53, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 54, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 54, Type = "EPP", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 55, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 55, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 56, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 56, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 57, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 57, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 58, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 58, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 59, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 59, Type = "ASM", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 60, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 60, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 61, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 61, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 62, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 62, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 63, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 63, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 64, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 64, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 65, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 65, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 66, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 66, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 68, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 68, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 70, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 70, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 72, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
new Reactor { ReactorNumber = 72, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = true },
|
||||||
new Reactor { ReactorNumber = 73, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 73, Type = "HTR", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 74, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 74, Type = "HTR", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 75, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 75, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 77, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 77, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 79, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 79, Type = "ASM+", PocketSize = "200 mm 8 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 100, Type = "ASM", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
new Reactor { ReactorNumber = 100, Type = "ASM", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false },
|
||||||
new Reactor { ReactorNumber = 101, Type = "ASM", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false }
|
new Reactor { ReactorNumber = 101, Type = "ASM", PocketSize = "150 mm 6 in", HasDisabledLoadlock = false }
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly List<int> UnscheduledReactors = new()
|
public static readonly List<int> UnscheduledReactors = new()
|
||||||
{
|
{
|
||||||
20, 25, 30, 32, 49, 55, 59, 67, 69, 70, 74
|
20, 25, 30, 32, 49, 55, 59, 67, 69, 70, 74
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly List<ManualReportEntries> ManualReportEntries = new()
|
public static readonly List<ManualReportEntries> ManualReportEntries = new()
|
||||||
{
|
{
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
@ -2,27 +2,20 @@
|
|||||||
using ReportingServices.UI.Models;
|
using ReportingServices.UI.Models;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace ReportingServices.UI.Controllers
|
namespace ReportingServices.UI.Controllers;
|
||||||
|
|
||||||
|
public class HomeController : Controller
|
||||||
{
|
{
|
||||||
public class HomeController : Controller
|
private readonly ILogger<HomeController> _logger;
|
||||||
|
|
||||||
|
public HomeController(ILogger<HomeController> logger) => _logger = logger;
|
||||||
|
|
||||||
|
public IActionResult Index()
|
||||||
{
|
{
|
||||||
private readonly ILogger<HomeController> _logger;
|
_logger.LogInformation("Starting Index Page");
|
||||||
|
return View();
|
||||||
public HomeController(ILogger<HomeController> logger)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IActionResult Index()
|
|
||||||
{
|
|
||||||
_logger.LogInformation("Starting Index Page");
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
||||||
public IActionResult Error()
|
|
||||||
{
|
|
||||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
|
public IActionResult Error() => View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||||
}
|
}
|
@ -1,55 +1,50 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ReportingServices.Shared.Models.PlanningReport;
|
|
||||||
using ReportingServices.Shared.HelperClasses;
|
using ReportingServices.Shared.HelperClasses;
|
||||||
|
using ReportingServices.Shared.Models.PlanningReport;
|
||||||
|
|
||||||
namespace ReportingServices.UI.Controllers
|
namespace ReportingServices.UI.Controllers;
|
||||||
|
|
||||||
|
public class PlanningReportController : Controller
|
||||||
{
|
{
|
||||||
public class PlanningReportController : Controller
|
private readonly ILogger<PlanningReportController> _logger;
|
||||||
|
private readonly string _baseUrl;
|
||||||
|
|
||||||
|
public PlanningReportController(ILogger<PlanningReportController> logger)
|
||||||
{
|
{
|
||||||
private readonly ILogger<PlanningReportController> _logger;
|
_logger = logger;
|
||||||
private readonly string _baseUrl;
|
_baseUrl = "http://localhost:50201/api/" + "ScrapeDB/";
|
||||||
|
|
||||||
public PlanningReportController(ILogger<PlanningReportController> logger)
|
_logger.LogInformation("Base API Address: {baseUrl}", _baseUrl);
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
_baseUrl = "http://localhost:50201/api/" + "ScrapeDB/";
|
|
||||||
|
|
||||||
_logger.LogInformation("Base API Address: {baseUrl}", _baseUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IActionResult Index()
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IActionResult> WeeklyPartChangesReport(DateTime startDate, DateTime endDate)
|
|
||||||
{
|
|
||||||
string partChangeUrl = _baseUrl + "PartChanges?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString();
|
|
||||||
string psnwoRunsUrl = _baseUrl + "PSNWO?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString();
|
|
||||||
|
|
||||||
_logger.LogInformation("Part Change URL: {url}", partChangeUrl);
|
|
||||||
_logger.LogInformation("PSN WO Runs URL: {url}", psnwoRunsUrl);
|
|
||||||
|
|
||||||
WeeklyPartChanges weeklyPartChanges = new();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int numberOfPartChanges = await ApiCaller.GetApi<int>(partChangeUrl);
|
|
||||||
List<ReactorPSNWORuns> reactorPSNWORuns = await ApiCaller.GetApi<List<ReactorPSNWORuns>>(psnwoRunsUrl);
|
|
||||||
|
|
||||||
weeklyPartChanges.TotalPartChanges = numberOfPartChanges;
|
|
||||||
weeklyPartChanges.StartDate = startDate.ToShortDateString();
|
|
||||||
weeklyPartChanges.EndDate = endDate.ToShortDateString();
|
|
||||||
weeklyPartChanges.ReactorPSNWORuns = reactorPSNWORuns;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogCritical(ex, "Failed to get a response from API calls.");
|
|
||||||
RedirectToAction("Error");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return View(weeklyPartChanges);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public IActionResult Index() => View();
|
||||||
|
|
||||||
|
public async Task<IActionResult> WeeklyPartChangesReport(DateTime startDate, DateTime endDate)
|
||||||
|
{
|
||||||
|
string partChangeUrl = _baseUrl + "PartChanges?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString();
|
||||||
|
string psnwoRunsUrl = _baseUrl + "PSNWO?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString();
|
||||||
|
|
||||||
|
_logger.LogInformation("Part Change URL: {url}", partChangeUrl);
|
||||||
|
_logger.LogInformation("PSN WO Runs URL: {url}", psnwoRunsUrl);
|
||||||
|
|
||||||
|
WeeklyPartChanges weeklyPartChanges = new();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int numberOfPartChanges = await ApiCaller.GetApi<int>(partChangeUrl);
|
||||||
|
List<ReactorPSNWORuns> reactorPSNWORuns = await ApiCaller.GetApi<List<ReactorPSNWORuns>>(psnwoRunsUrl);
|
||||||
|
|
||||||
|
weeklyPartChanges.TotalPartChanges = numberOfPartChanges;
|
||||||
|
weeklyPartChanges.StartDate = startDate.ToShortDateString();
|
||||||
|
weeklyPartChanges.EndDate = endDate.ToShortDateString();
|
||||||
|
weeklyPartChanges.ReactorPSNWORuns = reactorPSNWORuns;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogCritical(ex, "Failed to get a response from API calls.");
|
||||||
|
_ = RedirectToAction("Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(weeklyPartChanges);
|
||||||
|
}
|
||||||
|
}
|
@ -3,62 +3,57 @@ using ReportingServices.Shared.HelperClasses;
|
|||||||
using ReportingServices.Shared.Models.ProductionReport;
|
using ReportingServices.Shared.Models.ProductionReport;
|
||||||
using ReportingServices.Shared.ViewModels.ProductionReport;
|
using ReportingServices.Shared.ViewModels.ProductionReport;
|
||||||
|
|
||||||
namespace ReportingServices.UI.Controllers
|
namespace ReportingServices.UI.Controllers;
|
||||||
|
|
||||||
|
public class ProductionReportController : Controller
|
||||||
{
|
{
|
||||||
public class ProductionReportController : Controller
|
private readonly ILogger<ProductionReportController> _logger;
|
||||||
|
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
||||||
|
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
|
||||||
|
private readonly string _baseDBUrl;
|
||||||
|
|
||||||
|
public ProductionReportController(ILogger<ProductionReportController> logger)
|
||||||
{
|
{
|
||||||
private readonly ILogger<ProductionReportController> _logger;
|
_logger = logger;
|
||||||
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
_baseDBUrl = "http://localhost:50201/api/";
|
||||||
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
|
|
||||||
private readonly string _baseDBUrl;
|
|
||||||
|
|
||||||
public ProductionReportController(ILogger<ProductionReportController> logger)
|
_logger.LogInformation("Base Database Address: {baseUrl}", _baseDBUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IActionResult Index() => View();
|
||||||
|
|
||||||
|
public IActionResult DailyReport()
|
||||||
|
{
|
||||||
|
string baseScrapeDbUrl = _baseDBUrl + "ScrapeDB/";
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_logger = logger;
|
DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(_logger, baseScrapeDbUrl);
|
||||||
_baseDBUrl = "http://localhost:50201/api/";
|
Dictionary<string, List<string>> toolStateOwners = JsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath);
|
||||||
|
|
||||||
_logger.LogInformation("Base Database Address: {baseUrl}", _baseDBUrl);
|
dailyReport.ToolStatesByOwner = toolStateOwners;
|
||||||
|
|
||||||
|
return View(dailyReport);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
|
||||||
public IActionResult Index()
|
|
||||||
{
|
{
|
||||||
|
_logger.LogCritical(ex, "Failed to load report");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IActionResult DailyReport()
|
|
||||||
{
|
|
||||||
string baseScrapeDbUrl = _baseDBUrl + "ScrapeDB/";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(_logger, baseScrapeDbUrl);
|
|
||||||
Dictionary<string, List<string>> toolStateOwners = JsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath);
|
|
||||||
|
|
||||||
dailyReport.ToolStatesByOwner = toolStateOwners;
|
|
||||||
|
|
||||||
return View(dailyReport);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogCritical(ex, "Failed to load report");
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IActionResult EditDailyReport()
|
|
||||||
{
|
|
||||||
ManualReportEntries entries = JsonFileHandler.LoadJSONFile<ManualReportEntries>(_dailyRptFilePath);
|
|
||||||
|
|
||||||
return View(entries);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public IActionResult EditDailyReport(ManualReportEntries rpt)
|
|
||||||
{
|
|
||||||
JsonFileHandler.SaveJSONFile(rpt, _dailyRptFilePath);
|
|
||||||
|
|
||||||
return RedirectToAction("DailyReport");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public IActionResult EditDailyReport()
|
||||||
|
{
|
||||||
|
ManualReportEntries entries = JsonFileHandler.LoadJSONFile<ManualReportEntries>(_dailyRptFilePath);
|
||||||
|
|
||||||
|
return View(entries);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult EditDailyReport(ManualReportEntries rpt)
|
||||||
|
{
|
||||||
|
JsonFileHandler.SaveJSONFile(rpt, _dailyRptFilePath);
|
||||||
|
|
||||||
|
return RedirectToAction("DailyReport");
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,8 @@
|
|||||||
namespace ReportingServices.UI.Models
|
namespace ReportingServices.UI.Models;
|
||||||
{
|
|
||||||
public class ErrorViewModel
|
|
||||||
{
|
|
||||||
public string RequestId { get; set; }
|
|
||||||
|
|
||||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
public class ErrorViewModel
|
||||||
}
|
{
|
||||||
|
public string RequestId { get; set; }
|
||||||
|
|
||||||
|
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
}
|
}
|
@ -1,50 +1,54 @@
|
|||||||
using ReportingServices.Shared.Repositories;
|
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
LoggerConfiguration loggerConfiguration = new();
|
internal class Program
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
|
||||||
Environment.SetEnvironmentVariable("workingDirectory", "D:\\tmp\\logging\\MesaReportingServices\\UI");
|
|
||||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, builder.Configuration);
|
|
||||||
_ = SerilogHostBuilderExtensions.UseSerilog(builder.Host);
|
|
||||||
Log.Logger = loggerConfiguration.CreateLogger();
|
|
||||||
Serilog.ILogger log = Log.ForContext<Program>();
|
|
||||||
|
|
||||||
|
|
||||||
// Add services to the container.
|
|
||||||
builder.Services.AddControllersWithViews();
|
|
||||||
|
|
||||||
var app = builder.Build();
|
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
|
||||||
if (!app.Environment.IsDevelopment())
|
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Home/Error");
|
private static void Main(string[] args)
|
||||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
{
|
||||||
app.UseHsts();
|
LoggerConfiguration loggerConfiguration = new();
|
||||||
}
|
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||||
app.UseStaticFiles();
|
Environment.SetEnvironmentVariable("workingDirectory", "D:\\tmp\\logging\\MesaReportingServices\\UI");
|
||||||
|
_ = loggerConfiguration.ReadFrom.Configuration(builder.Configuration);
|
||||||
|
_ = builder.Host.UseSerilog();
|
||||||
|
Log.Logger = loggerConfiguration.CreateLogger();
|
||||||
|
Serilog.ILogger log = Log.ForContext<Program>();
|
||||||
|
|
||||||
app.UseRouting();
|
// Add services to the container.
|
||||||
|
_ = builder.Services.AddControllersWithViews();
|
||||||
|
|
||||||
app.UseAuthorization();
|
WebApplication app = builder.Build();
|
||||||
|
|
||||||
app.MapControllerRoute(
|
// Configure the HTTP request pipeline.
|
||||||
name: "default",
|
if (!app.Environment.IsDevelopment())
|
||||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
{
|
||||||
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
_ = app.UseExceptionHandler("/Home/Error");
|
||||||
log.Information("Starting Web Application");
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
try
|
_ = app.UseHsts();
|
||||||
{
|
}
|
||||||
app.Run();
|
|
||||||
}
|
_ = app.UseHttpsRedirection();
|
||||||
catch (Exception ex)
|
_ = app.UseStaticFiles();
|
||||||
{
|
|
||||||
log.Fatal(ex, "Host terminated unexpectedly");
|
_ = app.UseRouting();
|
||||||
}
|
|
||||||
finally
|
_ = app.UseAuthorization();
|
||||||
{
|
|
||||||
Log.CloseAndFlush();
|
_ = app.MapControllerRoute(
|
||||||
}
|
name: "default",
|
||||||
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||||
|
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
||||||
|
log.Information("Starting Web Application");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
app.Run();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Fatal(ex, "Host terminated unexpectedly");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReportingServices.Shared",
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5DEBD84-0237-49D3-B6D7-6F5736174EF6}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5DEBD84-0237-49D3-B6D7-6F5736174EF6}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
.editorconfig = .editorconfig
|
||||||
|
.gitignore = .gitignore
|
||||||
.config\dotnet-tools.json = .config\dotnet-tools.json
|
.config\dotnet-tools.json = .config\dotnet-tools.json
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Loading…
x
Reference in New Issue
Block a user