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,20 +2,16 @@
|
|||||||
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]")]
|
|
||||||
[ApiController]
|
|
||||||
public class ScrapeDBController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly IScrapeDatabaseRepository _scrapeDBRepository;
|
private readonly IScrapeDatabaseRepository _scrapeDBRepository;
|
||||||
|
|
||||||
public ScrapeDBController(IScrapeDatabaseRepository scrapeDBRepository)
|
public ScrapeDBController(IScrapeDatabaseRepository scrapeDBRepository) => _scrapeDBRepository = scrapeDBRepository;
|
||||||
{
|
|
||||||
_scrapeDBRepository = scrapeDBRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("ReactorOuts")]
|
[HttpGet("ReactorOuts")]
|
||||||
public YieldInformation GetReactorOuts(string startDate, string endDate)
|
public YieldInformation GetReactorOuts(string startDate, string endDate)
|
||||||
@ -31,63 +27,32 @@ namespace ReportingServices.API.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("PSNWO")]
|
[HttpGet("PSNWO")]
|
||||||
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate)
|
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate) => _scrapeDBRepository.GetReactorPSNWORuns(startDate, endDate);
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetReactorPSNWORuns(startDate, endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("PartChanges")]
|
[HttpGet("PartChanges")]
|
||||||
public int GetNumberOfPartChanges(string startDate, string endDate)
|
public int GetNumberOfPartChanges(string startDate, string endDate) => _scrapeDBRepository.GetNumberOfPartChanges(startDate, endDate);
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetNumberOfPartChanges(startDate, endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Targets")]
|
[HttpGet("Targets")]
|
||||||
public QuarterlyTargets GetQuarterlyTargets()
|
public QuarterlyTargets GetQuarterlyTargets() => _scrapeDBRepository.GetQuarterlyTargets();
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetQuarterlyTargets();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Reactors")]
|
[HttpGet("Reactors")]
|
||||||
public List<Reactor> GetReactors()
|
public List<Reactor> GetReactors() => _scrapeDBRepository.GetReactors();
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetReactors();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("RDS")]
|
[HttpGet("RDS")]
|
||||||
public List<RDS> GetRDSForLastDay(string date)
|
public List<RDS> GetRDSForLastDay(string date) => _scrapeDBRepository.GetRDSForLastDay(date);
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetRDSForLastDay(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("ReactorEvents")]
|
[HttpGet("ReactorEvents")]
|
||||||
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber)
|
public List<ReactorEvent> GetReactorEvents(string startDate, string endDate, string reactorNumber) => _scrapeDBRepository.GetReactorEvents(startDate, endDate, reactorNumber);
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetReactorEvents(startDate, endDate, reactorNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("GetLastUpTransaction")]
|
[HttpGet("GetLastUpTransaction")]
|
||||||
public int GetLastUpTransaction(string reactorNumber)
|
public int GetLastUpTransaction(string reactorNumber) => _scrapeDBRepository.GetLastUpTransaction(reactorNumber);
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetLastUpTransaction(reactorNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("ToolEvents")]
|
[HttpGet("ToolEvents")]
|
||||||
public ToolEvent GetLatestToolEvent(string toolID)
|
public ToolEvent GetLatestToolEvent(string toolID) => _scrapeDBRepository.GetLatestToolEvent(toolID);
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetLatestToolEvent(toolID);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("GetOutsAndScrapTotals")]
|
[HttpGet("GetOutsAndScrapTotals")]
|
||||||
public OutsAndScrapTotal GetOutsAndScrapTotal(string startDate, string endDate)
|
public OutsAndScrapTotal GetOutsAndScrapTotal(string startDate, string endDate) => _scrapeDBRepository.GetOutsAndScrapTotals(startDate, endDate);
|
||||||
{
|
|
||||||
return _scrapeDBRepository.GetOutsAndScrapTotals(startDate, endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("GetQuarterStartDate")]
|
[HttpGet("GetQuarterStartDate")]
|
||||||
public DateTime GetQuarterStartDate()
|
public DateTime GetQuarterStartDate() => _scrapeDBRepository.GetQuarterStartDate();
|
||||||
{
|
|
||||||
return _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.UseAuthorization();
|
||||||
|
|
||||||
|
_ = app.MapControllers();
|
||||||
|
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
||||||
|
log.Information("Starting Web APIs");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
app.Run();
|
app.Run();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log.Fatal(ex, "Host terminated unexpectedly");
|
log.Fatal(ex, "Host terminated unexpectedly");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
Log.CloseAndFlush();
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,9 +1,7 @@
|
|||||||
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;
|
DateTime date = DateTime.Now;
|
||||||
@ -52,5 +50,4 @@ namespace ReportingServices.Shared.HelperClasses
|
|||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,14 +1,12 @@
|
|||||||
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(T);
|
T deserializedJson = default;
|
||||||
|
|
||||||
using (HttpClient client = new())
|
using (HttpClient client = new())
|
||||||
{
|
{
|
||||||
@ -18,5 +16,4 @@ namespace ReportingServices.Shared.HelperClasses
|
|||||||
|
|
||||||
return deserializedJson;
|
return deserializedJson;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -2,10 +2,10 @@
|
|||||||
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 _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
||||||
private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.json";
|
private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.json";
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ namespace ReportingServices.Shared.HelperClasses
|
|||||||
report.SetRDSInfo(rds.Result);
|
report.SetRDSInfo(rds.Result);
|
||||||
report.SetReactorInfo(reactors, GetUnscheduledReactors(report));
|
report.SetReactorInfo(reactors, GetUnscheduledReactors(report));
|
||||||
|
|
||||||
foreach (var task in toolEvents)
|
foreach (Task<List<ReactorEvent>> task in toolEvents)
|
||||||
{
|
{
|
||||||
ToolEventView toolEvent = new(task.Result,
|
ToolEventView toolEvent = new(task.Result,
|
||||||
report.StartDate.ToString(), DateTime.Now.ToString(), task.Result[0].REACT_NO,
|
report.StartDate.ToString(), DateTime.Now.ToString(), task.Result[0].REACT_NO,
|
||||||
@ -120,7 +120,7 @@ namespace ReportingServices.Shared.HelperClasses
|
|||||||
}
|
}
|
||||||
|
|
||||||
report.ToolEvents = report.ToolEvents
|
report.ToolEvents = report.ToolEvents
|
||||||
.Where(x => x.Reactor != "100" && x.Reactor != "101" && x.Reactor != "47")
|
.Where(x => x.Reactor is not "100" and not "101" and not "47")
|
||||||
.OrderBy(x => x.Reactor)
|
.OrderBy(x => x.Reactor)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
@ -178,5 +178,4 @@ namespace ReportingServices.Shared.HelperClasses
|
|||||||
|
|
||||||
return reactors;
|
return reactors;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace ReportingServices.Shared.HelperClasses
|
namespace ReportingServices.Shared.HelperClasses;
|
||||||
|
|
||||||
|
public static class JsonFileHandler
|
||||||
{
|
{
|
||||||
public static class JsonFileHandler
|
|
||||||
{
|
|
||||||
public static T LoadJSONFile<T>(string file)
|
public static T LoadJSONFile<T>(string file)
|
||||||
{
|
{
|
||||||
string json = File.ReadAllText(file);
|
string json = File.ReadAllText(file);
|
||||||
@ -15,5 +15,4 @@ namespace ReportingServices.Shared.HelperClasses
|
|||||||
string json = JsonSerializer.Serialize(obj);
|
string json = JsonSerializer.Serialize(obj);
|
||||||
File.WriteAllText(file, json);
|
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")]
|
[JsonPropertyName("REACTOR")]
|
||||||
public string REACTOR { get; set; }
|
public string REACTOR { get; set; }
|
||||||
[JsonPropertyName("PSN")]
|
[JsonPropertyName("PSN")]
|
||||||
public string PSN { get; set; }
|
public string PSN { get; set; }
|
||||||
[JsonPropertyName("WO_COUNT")]
|
[JsonPropertyName("WO_COUNT")]
|
||||||
public int WO_COUNT { get; set; }
|
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 int TotalPartChanges { get; set; }
|
||||||
public string StartDate { get; set; }
|
public string StartDate { get; set; }
|
||||||
public string EndDate { get; set; }
|
public string EndDate { get; set; }
|
||||||
public List<ReactorPSNWORuns> ReactorPSNWORuns { get; set; }
|
public List<ReactorPSNWORuns> ReactorPSNWORuns { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
namespace ReportingServices.Shared.Models.ProductionReport
|
namespace ReportingServices.Shared.Models.ProductionReport;
|
||||||
|
|
||||||
|
public class ManualReportEntries
|
||||||
{
|
{
|
||||||
public class ManualReportEntries
|
|
||||||
{
|
|
||||||
public int OperatorHeadcountDays { get; set; }
|
public int OperatorHeadcountDays { get; set; }
|
||||||
public int OperatorHeadcountNights { get; set; }
|
public int OperatorHeadcountNights { get; set; }
|
||||||
public int OperatorCallOutsDays { get; set; }
|
public int OperatorCallOutsDays { get; set; }
|
||||||
@ -17,5 +17,4 @@
|
|||||||
public string BottleChanges { get; set; }
|
public string BottleChanges { get; set; }
|
||||||
public string DailyPartChanges { get; set; }
|
public string DailyPartChanges { get; set; }
|
||||||
public string WeeklyPartChanges { get; set; }
|
public string WeeklyPartChanges { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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")]
|
[JsonPropertyName("Outs")]
|
||||||
public int Outs { get; set; }
|
public int Outs { get; set; }
|
||||||
[JsonPropertyName("CustomerScrap")]
|
[JsonPropertyName("CustomerScrap")]
|
||||||
@ -12,5 +12,4 @@ namespace ReportingServices.Shared.Models.ProductionReport
|
|||||||
public int ManufacturingScrap { get; set; }
|
public int ManufacturingScrap { get; set; }
|
||||||
[JsonPropertyName("ProductionScrap")]
|
[JsonPropertyName("ProductionScrap")]
|
||||||
public int ProductionScrap { get; set; }
|
public int ProductionScrap { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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")]
|
[JsonPropertyName("Reactor_Outs")]
|
||||||
public int Reactor_Outs { get; set; }
|
public int Reactor_Outs { get; set; }
|
||||||
[JsonPropertyName("Yield_Outs")]
|
[JsonPropertyName("Yield_Outs")]
|
||||||
@ -14,5 +14,4 @@ namespace ReportingServices.Shared.Models.ProductionReport
|
|||||||
public float Yield { get; set; }
|
public float Yield { get; set; }
|
||||||
[JsonPropertyName("PlanWorkingDays")]
|
[JsonPropertyName("PlanWorkingDays")]
|
||||||
public int PlanWorkingDays { get; set; }
|
public int PlanWorkingDays { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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")]
|
[JsonPropertyName("Reactor")]
|
||||||
public int Reactor { get; set; }
|
public int Reactor { get; set; }
|
||||||
[JsonPropertyName("ReactorType")]
|
[JsonPropertyName("ReactorType")]
|
||||||
@ -14,5 +14,4 @@ namespace ReportingServices.Shared.Models.ProductionReport
|
|||||||
public int UnloadTemp { get; set; }
|
public int UnloadTemp { get; set; }
|
||||||
[JsonPropertyName("LayerType")]
|
[JsonPropertyName("LayerType")]
|
||||||
public string LayerType { get; set; }
|
public string LayerType { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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")]
|
[JsonPropertyName("ReactorNumber")]
|
||||||
public int ReactorNumber { get; set; }
|
public int ReactorNumber { get; set; }
|
||||||
[JsonPropertyName("Type")]
|
[JsonPropertyName("Type")]
|
||||||
@ -12,5 +12,4 @@ namespace ReportingServices.Shared.Models.ProductionReport
|
|||||||
public string PocketSize { get; set; }
|
public string PocketSize { get; set; }
|
||||||
[JsonPropertyName("HasDisabledLoadLock")]
|
[JsonPropertyName("HasDisabledLoadLock")]
|
||||||
public bool HasDisabledLoadlock { get; set; }
|
public bool HasDisabledLoadlock { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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")]
|
[JsonPropertyName("REACT_NO")]
|
||||||
public string REACT_NO { get; set; }
|
public string REACT_NO { get; set; }
|
||||||
[JsonPropertyName("EVENT_DTM")]
|
[JsonPropertyName("EVENT_DTM")]
|
||||||
@ -12,5 +12,4 @@ namespace ReportingServices.Shared.Models.ProductionReport
|
|||||||
public string COMMENT { get; set; }
|
public string COMMENT { get; set; }
|
||||||
[JsonPropertyName("REACT_MODE")]
|
[JsonPropertyName("REACT_MODE")]
|
||||||
public string REACT_MODE { get; set; }
|
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 string StartDate { get; set; }
|
||||||
public int TotalWafers { 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")]
|
[JsonPropertyName("RDS_NO")]
|
||||||
public string RDS_NO { get; set; }
|
public string RDS_NO { get; set; }
|
||||||
[JsonPropertyName("Units")]
|
[JsonPropertyName("Units")]
|
||||||
public string Units { get; set; }
|
public string Units { get; set; }
|
||||||
[JsonPropertyName("EndProcessTime")]
|
[JsonPropertyName("EndProcessTime")]
|
||||||
public string EndProcessTime { get; set; }
|
public string EndProcessTime { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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")]
|
[JsonPropertyName("StartDate")]
|
||||||
public string StartDate { get; set; }
|
public string StartDate { get; set; }
|
||||||
[JsonPropertyName("TW_PROD")]
|
[JsonPropertyName("TW_PROD")]
|
||||||
@ -14,5 +14,4 @@ namespace ReportingServices.Shared.Models.ProductionReport
|
|||||||
public int TOT_REJ_MANU { get; set; }
|
public int TOT_REJ_MANU { get; set; }
|
||||||
[JsonPropertyName("TOT_REJ_WFRS")]
|
[JsonPropertyName("TOT_REJ_WFRS")]
|
||||||
public int TOT_REJ_WFRS { get; set; }
|
public int TOT_REJ_WFRS { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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")]
|
[JsonPropertyName("TOOL_ID")]
|
||||||
public string TOOL_ID { get; set; }
|
public string TOOL_ID { get; set; }
|
||||||
[JsonPropertyName("START_DTM")]
|
[JsonPropertyName("START_DTM")]
|
||||||
@ -12,5 +12,4 @@ namespace ReportingServices.Shared.Models.ProductionReport
|
|||||||
public string TOOL_MODE { get; set; }
|
public string TOOL_MODE { get; set; }
|
||||||
[JsonPropertyName("TOOL_MODE_DESC")]
|
[JsonPropertyName("TOOL_MODE_DESC")]
|
||||||
public string TOOL_MODE_DESC { get; set; }
|
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 string Date { get; set; }
|
||||||
public double UptimePercentage { 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")]
|
[JsonPropertyName("Outs")]
|
||||||
public List<ReactorOutsByRDS> Outs { get; set; }
|
public List<ReactorOutsByRDS> Outs { get; set; }
|
||||||
[JsonPropertyName("Scrap")]
|
[JsonPropertyName("Scrap")]
|
||||||
public List<ScrapByDay> Scrap { get; set; }
|
public List<ScrapByDay> Scrap { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,25 +1,20 @@
|
|||||||
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 SqlConnection _connection;
|
||||||
private readonly string _connectionString;
|
private readonly string _connectionString;
|
||||||
|
|
||||||
public ScrapeDatabaseRepository()
|
public ScrapeDatabaseRepository() => _connectionString = "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true";
|
||||||
{
|
|
||||||
_connectionString = "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OpenConnection()
|
public void OpenConnection()
|
||||||
{
|
{
|
||||||
if (_connection == null)
|
_connection ??= new SqlConnection(_connectionString);
|
||||||
_connection = new SqlConnection(_connectionString);
|
|
||||||
|
|
||||||
if (_connection.State != ConnectionState.Open)
|
if (_connection.State != ConnectionState.Open)
|
||||||
_connection.Open();
|
_connection.Open();
|
||||||
@ -45,12 +40,12 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
"GROUP BY REACTOR) AS l WHERE PCHANGE > 0";
|
"GROUP BY REACTOR) AS l WHERE PCHANGE > 0";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
reader.Read();
|
_ = reader.Read();
|
||||||
|
|
||||||
result = int.Parse(reader[0].ToString());
|
result = int.Parse(reader[0].ToString());
|
||||||
}
|
}
|
||||||
@ -70,7 +65,7 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
foreach (ReactorOutsByRDS rout in outs)
|
foreach (ReactorOutsByRDS rout in outs)
|
||||||
rdsNumbers = rdsNumbers + "'" + rout.RDS_NO + "', ";
|
rdsNumbers = rdsNumbers + "'" + rout.RDS_NO + "', ";
|
||||||
|
|
||||||
rdsNumbers = rdsNumbers.Substring(0, rdsNumbers.Length - 2);
|
rdsNumbers = rdsNumbers[..^2];
|
||||||
|
|
||||||
OpenConnection();
|
OpenConnection();
|
||||||
|
|
||||||
@ -123,8 +118,8 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
"ORDER BY 1";
|
"ORDER BY 1";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
@ -173,7 +168,7 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
while(reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
if (reader[0].ToString().ToUpper() == "YIELD")
|
if (reader[0].ToString().ToUpper() == "YIELD")
|
||||||
targets.Add(reader[0].ToString(), float.Parse(reader[2].ToString()));
|
targets.Add(reader[0].ToString(), float.Parse(reader[2].ToString()));
|
||||||
@ -249,7 +244,7 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
"WHERE DATE_OUT >= @date";
|
"WHERE DATE_OUT >= @date";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@date", date);
|
_ = cmd.Parameters.AddWithValue("@date", date);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
@ -286,8 +281,8 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
"ORDER BY DATE_OUT ASC";
|
"ORDER BY DATE_OUT ASC";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
@ -337,9 +332,9 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
"ORDER BY EVENT_DTM ASC";
|
"ORDER BY EVENT_DTM ASC";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
_ = cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
@ -378,7 +373,7 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
"ORDER BY START_DTM DESC";
|
"ORDER BY START_DTM DESC";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@toolID", toolID);
|
_ = cmd.Parameters.AddWithValue("@toolID", toolID);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
@ -414,7 +409,7 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
"ORDER BY START_DTM DESC";
|
"ORDER BY START_DTM DESC";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
_ = cmd.Parameters.AddWithValue("@reactorNumber", reactorNumber);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
@ -446,8 +441,8 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
" AND DATE_OUT <= @endDate";
|
" AND DATE_OUT <= @endDate";
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("@startDate", startDate);
|
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||||
cmd.Parameters.AddWithValue("@endDate", endDate);
|
_ = cmd.Parameters.AddWithValue("@endDate", endDate);
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
@ -495,5 +490,4 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
|
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
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 OpenConnection();
|
||||||
public void CloseConnection();
|
public void CloseConnection();
|
||||||
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs);
|
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs);
|
||||||
@ -19,5 +19,4 @@ namespace ReportingServices.Shared.Repositories
|
|||||||
public int GetLastUpTransaction(string reactorNumber);
|
public int GetLastUpTransaction(string reactorNumber);
|
||||||
public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate);
|
public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate);
|
||||||
public DateTime GetQuarterStartDate();
|
public DateTime GetQuarterStartDate();
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
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 StartDate { get; set; }
|
||||||
public DateTime QuarterStartDate { get; set; }
|
public DateTime QuarterStartDate { get; set; }
|
||||||
public YieldStatistics CurrentWeek { get; set; }
|
public YieldStatistics CurrentWeek { get; set; }
|
||||||
@ -109,9 +109,9 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
|
|
||||||
private void SetUnloadTempsLessThan700(List<RDS> rdsList)
|
private void SetUnloadTempsLessThan700(List<RDS> rdsList)
|
||||||
{
|
{
|
||||||
var rdsWithTempsLessThan700 = rdsList.Where(rds => rds.UnloadTemp < 700).GroupBy(rds => rds.DateOut);
|
IEnumerable<IGrouping<DateTime, RDS>> rdsWithTempsLessThan700 = rdsList.Where(rds => rds.UnloadTemp < 700).GroupBy(rds => rds.DateOut);
|
||||||
|
|
||||||
foreach (var group in rdsWithTempsLessThan700)
|
foreach (IGrouping<DateTime, RDS> group in rdsWithTempsLessThan700)
|
||||||
{
|
{
|
||||||
UnloadTempsByDay.Add(new UnloadTempsByDay
|
UnloadTempsByDay.Add(new UnloadTempsByDay
|
||||||
{
|
{
|
||||||
@ -127,5 +127,4 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay);
|
CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay);
|
||||||
PreviousWeek.ScrapByDay = APIHelperFunctions.ReverseList(PreviousWeek.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 DateTime Date { get; set; }
|
||||||
public int ASM { get; set; }
|
public int ASM { get; set; }
|
||||||
public int HTR { get; set; }
|
public int HTR { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,10 +1,9 @@
|
|||||||
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 Reactor { get; set; }
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
public string StartDate { get; set; }
|
public string StartDate { get; set; }
|
||||||
@ -22,7 +21,7 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
EndDate = endDate;
|
EndDate = endDate;
|
||||||
Reactor = reactor;
|
Reactor = reactor;
|
||||||
Type = type;
|
Type = type;
|
||||||
MostRecentEvent = events[events.Count - 1];
|
MostRecentEvent = events[^1];
|
||||||
IsInProduction = EventIsProduction(MostRecentEvent.REACT_MODE);
|
IsInProduction = EventIsProduction(MostRecentEvent.REACT_MODE);
|
||||||
Uptime = DetermineToolUptimeData();
|
Uptime = DetermineToolUptimeData();
|
||||||
}
|
}
|
||||||
@ -105,7 +104,7 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
|
|
||||||
if (i == Events.Count - 1)
|
if (i == Events.Count - 1)
|
||||||
{
|
{
|
||||||
if ((DateTime.Parse(EndDate).Date != compareDate))
|
if (DateTime.Parse(EndDate).Date != compareDate)
|
||||||
{
|
{
|
||||||
while (DateTime.Parse(EndDate).Date != compareDate)
|
while (DateTime.Parse(EndDate).Date != compareDate)
|
||||||
{
|
{
|
||||||
@ -169,5 +168,4 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
return false;
|
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 DateTime Date { get; set; }
|
||||||
public int ASMUnloadsBelow700 { get; set; }
|
public int ASMUnloadsBelow700 { get; set; }
|
||||||
public int HTRUnloadsBelow700 { get; set; }
|
public int HTRUnloadsBelow700 { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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 DateTime StartDate { get; set; }
|
||||||
public List<ReactorOutsByDay> OutsByDay { get; set; }
|
public List<ReactorOutsByDay> OutsByDay { get; set; }
|
||||||
public List<ScrapByDay> ScrapByDay { get; set; }
|
public List<ScrapByDay> ScrapByDay { get; set; }
|
||||||
@ -58,5 +58,4 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
|
|||||||
|
|
||||||
return outsByDay;
|
return outsByDay;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
using ReportingServices.Shared.HelperClasses;
|
using ReportingServices.Shared.HelperClasses;
|
||||||
|
|
||||||
namespace ReportingServices.Test
|
namespace ReportingServices.Test;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class APIHelperTester
|
||||||
{
|
{
|
||||||
[TestClass]
|
|
||||||
public class APIHelperTester
|
|
||||||
{
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void CheckShortDateWithPassedInDate()
|
public void CheckShortDateWithPassedInDate()
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ namespace ReportingServices.Test
|
|||||||
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,10 +1,8 @@
|
|||||||
using ReportingServices.Shared.ViewModels.ProductionReport;
|
namespace ReportingServices.Test;
|
||||||
|
|
||||||
namespace ReportingServices.Test
|
[TestClass]
|
||||||
|
public class DailyReportTester
|
||||||
{
|
{
|
||||||
[TestClass]
|
|
||||||
public class DailyReportTester
|
|
||||||
{
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SetRDSInfo_InputData_CalculatedAndStoresCorrectly()
|
public void SetRDSInfo_InputData_CalculatedAndStoresCorrectly()
|
||||||
{
|
{
|
||||||
@ -63,5 +61,4 @@ namespace ReportingServices.Test
|
|||||||
Assert.AreEqual(singleLoadLockHTR, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRSingleLoadLock);
|
Assert.AreEqual(singleLoadLockHTR, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRSingleLoadLock);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
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 = 79, ReactorType = "ASM+", DateOut = new DateTime(2022, 12, 13), UnloadTemp = 600, LayerType = "Standard 1 Layer" },
|
||||||
@ -182,5 +182,4 @@ namespace ReportingServices.Test
|
|||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
new ManualReportEntries(),
|
new ManualReportEntries(),
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
@ -2,16 +2,13 @@
|
|||||||
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;
|
private readonly ILogger<HomeController> _logger;
|
||||||
|
|
||||||
public HomeController(ILogger<HomeController> logger)
|
public HomeController(ILogger<HomeController> logger) => _logger = logger;
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IActionResult Index()
|
public IActionResult Index()
|
||||||
{
|
{
|
||||||
@ -20,9 +17,5 @@ namespace ReportingServices.UI.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
public IActionResult Error()
|
public IActionResult Error() => View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||||
{
|
|
||||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,11 +1,11 @@
|
|||||||
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 ILogger<PlanningReportController> _logger;
|
||||||
private readonly string _baseUrl;
|
private readonly string _baseUrl;
|
||||||
|
|
||||||
@ -17,10 +17,7 @@ namespace ReportingServices.UI.Controllers
|
|||||||
_logger.LogInformation("Base API Address: {baseUrl}", _baseUrl);
|
_logger.LogInformation("Base API Address: {baseUrl}", _baseUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IActionResult Index()
|
public IActionResult Index() => View();
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IActionResult> WeeklyPartChangesReport(DateTime startDate, DateTime endDate)
|
public async Task<IActionResult> WeeklyPartChangesReport(DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
@ -45,11 +42,9 @@ namespace ReportingServices.UI.Controllers
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogCritical(ex, "Failed to get a response from API calls.");
|
_logger.LogCritical(ex, "Failed to get a response from API calls.");
|
||||||
RedirectToAction("Error");
|
_ = RedirectToAction("Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return View(weeklyPartChanges);
|
return View(weeklyPartChanges);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -3,10 +3,10 @@ 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 ILogger<ProductionReportController> _logger;
|
||||||
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
||||||
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
|
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
|
||||||
@ -20,11 +20,7 @@ namespace ReportingServices.UI.Controllers
|
|||||||
_logger.LogInformation("Base Database Address: {baseUrl}", _baseDBUrl);
|
_logger.LogInformation("Base Database Address: {baseUrl}", _baseDBUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IActionResult Index() => View();
|
||||||
public IActionResult Index()
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IActionResult DailyReport()
|
public IActionResult DailyReport()
|
||||||
{
|
{
|
||||||
@ -60,5 +56,4 @@ namespace ReportingServices.UI.Controllers
|
|||||||
|
|
||||||
return RedirectToAction("DailyReport");
|
return RedirectToAction("DailyReport");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +1,8 @@
|
|||||||
namespace ReportingServices.UI.Models
|
namespace ReportingServices.UI.Models;
|
||||||
|
|
||||||
|
public class ErrorViewModel
|
||||||
{
|
{
|
||||||
public class ErrorViewModel
|
|
||||||
{
|
|
||||||
public string RequestId { get; set; }
|
public string RequestId { get; set; }
|
||||||
|
|
||||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
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)
|
||||||
|
{
|
||||||
|
LoggerConfiguration loggerConfiguration = new();
|
||||||
|
|
||||||
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||||
|
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>();
|
||||||
|
|
||||||
|
// Add services to the container.
|
||||||
|
_ = builder.Services.AddControllersWithViews();
|
||||||
|
|
||||||
|
WebApplication app = builder.Build();
|
||||||
|
|
||||||
|
// Configure the HTTP request pipeline.
|
||||||
|
if (!app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
_ = app.UseExceptionHandler("/Home/Error");
|
||||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
_ = app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
_ = app.UseHttpsRedirection();
|
||||||
app.UseStaticFiles();
|
_ = app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseRouting();
|
_ = app.UseRouting();
|
||||||
|
|
||||||
app.UseAuthorization();
|
_ = app.UseAuthorization();
|
||||||
|
|
||||||
app.MapControllerRoute(
|
_ = app.MapControllerRoute(
|
||||||
name: "default",
|
name: "default",
|
||||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||||
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
||||||
log.Information("Starting Web Application");
|
log.Information("Starting Web Application");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
app.Run();
|
app.Run();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log.Fatal(ex, "Host terminated unexpectedly");
|
log.Fatal(ex, "Host terminated unexpectedly");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
Log.CloseAndFlush();
|
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